Unbreak bootstrap

Richard Guenther rguenther@suse.de
Thu Sep 6 12:36:00 GMT 2007

On Tue, 4 Sep 2007, Jan Hubicka wrote:

> > On 9/4/07, Jan Hubicka <jh@suse.cz> wrote:
> > > Hi,
> > > Richard's patch to remove volatile flag from loads broke tailcall code
> > > to update SSA form.  The following patch bootstrapped for me on
> > > x86_64-linux and I went ahead and comitted it as it is pretty obvious to
> > > unbreak testing...
> > 
> > Actually this patch does not make sense as what is failing is using
> > stage2's compiler so we must be miscompiling stage2 already.
> > Compiling stage2 is ok.  I might be better if we revert Richard's
> > patch until he figures out what is going wrong.
> Actually I think I know what is going wrong - the tailcall is checking
> for zero virtual operands to verify that it is safe to do the
> conversion.  Without alias info represented the statements might
> actually read from memory that is affected by the conversion.
> I agree that reverting both patches is way to go for now.

I think that your first observation is still correct.  The ICE

../../trunk/gcc/tree-ssa-structalias.c: In function 
../../trunk/gcc/tree-ssa-structalias.c:5627: internal compiler error: tree 
check: expected ssa_name, have result_decl in eliminate_tail_call, at 

is exactly because

      /* If the statement has virtual or volatile operands, fail.  */
      ann = stmt_ann (stmt);
          || ann->has_volatile_ops)

doesn't work as expected if w/o aliasing we don't have all loads
marked with has_volatile_ops.  Note there are more similar cases in
CCP and copyprop.  What can be substituted here is
ann->references_memory instead.  Conservatively just by adding

          || (!gimple_aliases_computed_p (cfun)
              && ann->references_memory))

or (noting that calls are handled separately -- and those are also
_not_ marked volatile w/o aliasing, like loads through a pointer)

	if (ann->references_memory
	    || ann->has_volatile_ops)


More information about the Gcc-patches mailing list