Skip to content
Snippets Groups Projects
Commit 0ef93c86 authored by Jakub Jelinek's avatar Jakub Jelinek
Browse files

lower-bitint: Fix ICE on bitint-39.c

torture/bitint-39.c ICEs with -O1; the problem is that the
finish_arith_overflow code in one spot replaces use_stmt with an
assignment or cast, but if unlucky and m_gsi iterator is the same statement,
when the code later
      tree clobber = build_clobber (TREE_TYPE (var), CLOBBER_EOL);
      g = gimple_build_assign (var, clobber);
      gsi_insert_after (&m_gsi, g, GSI_SAME_STMT);
it will insert after iterator which contains already replaced statement and
that causes the gimple chain corruption.

2023-12-01  Jakub Jelinek  <jakub@redhat.com>

	* gimple-lower-bitint.cc (bitint_large_huge::finish_arith_overflow):
	When replacing use_stmt which is gsi_stmt (m_gsi), update m_gsi to
	the new statement.
parent 36433265
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment