[Bug tree-optimization/26169] [4.2 Regression] ICE in duplicate_ssa_name

Jeffrey A Law law@redhat.com
Wed Feb 8 17:46:00 GMT 2006


On Wed, 2006-02-08 at 12:43 +0000, pinskia at gcc dot gnu dot org wrote:
> 
> ------- Comment #4 from pinskia at gcc dot gnu dot org  2006-02-08 12:43 -------
> (In reply to comment #3)
> > I didn't trip over anything like this on my x86 testing, but I have
> > been able to reproduce it with a cross compiler.  The fix is
> > pretty trivial, but it'll take until sometime tomorrow before the
> > regression testing and such is complete.
> 
> I should mention why you did not trip over it on the x86 testing orginally.
> This:
>   if (p == 0)
>     if (do_create)
> Was orginally:
>   if (p == 0 && do_create)
> Which causes a slightly different IR.
This patch should fix the various instances of the ICE in
duplicate_ssa_name.

Basically VRP performed a constant propagation, changing  the
index in an array reference from a variable to a constant.  When
this occurs we queue SSA graph updates for the virtual operands
of the statement.  As a side effect, the virtual operands are
no longer SSA_NAMEs, but instead _DECL nodes.

We then find that we're able to thread through the block containing
the updated array reference.  The block duplication code doesn't
know how to handle this case and dies.

This patch simply handles any queued SSA updates before dealing
with jump threads.  DOM does the exact same thing.

However, my gut tells me that this "solution" is mostly an artifact
of how the old old old SSA graph updating code in DOM worked.  I
suspect that it wouldn't be terribly difficult to do all the
SSA graph updates at the same time.  Doing so would probably be a
compile-time win as well.

Regardless, this patch should bring various failing targets back
into bootstrap land.

Bootstrapped and regression tested on i686-pc-linux-gnu; I've
also verified the ICE is fixed using cross compilers.







 

-------------- next part --------------
	* tree-vrp.c (execute_vrp): Perform any queued SSA updates before
	threading jumps.

Index: tree-vrp.c
===================================================================
*** tree-vrp.c	(revision 110757)
--- tree-vrp.c	(working copy)
*************** execute_vrp (void)
*** 4499,4504 ****
--- 4499,4512 ----
       as finalizing jump threads calls the CFG cleanup code which
       does not properly handle ASSERT_EXPRs.  */
    remove_range_assertions ();
+ 
+   /* If we exposed any new variables, go ahead and put them into
+      SSA form now, before we handle jump threading.  This simplifies
+      interactions between rewriting of _DECL nodes into SSA form
+      and rewriting SSA_NAME nodes into SSA form after block
+      duplication and CFG manipulation.  */
+   update_ssa (TODO_update_ssa);
+ 
    finalize_jump_threads ();
  
  }


More information about the Gcc-patches mailing list