[tree-ssa] Fix gcc.dg/tree-ssa/20030530-2.c

Jan Hubicka jh@suse.cz
Wed Jun 11 17:28:00 GMT 2003


> On Wed, 11 Jun 2003 08:45:30 -0600, law@redhat.com wrote:
> 
> > No.  Consider VA_ARG_EXPR -- I've been unable to convince myself that
> > it's free of side effects.
> 
> It certainly isn't: it modifies the va_list argument.
> 
> >  >Also, don't we recognize functions whose calls can be elided if they're
> >  >called with the same arguments repeatedly?  (I forget the technical term
> >  >:)
> > Right now we do not remove redundant calls if they are pure.  That's
> > something I'll be looking at momentarily.  I'll note the old code 
> > didn't remove such calls either.
> 
> Incidentally, I note that the documentation says that a pure function can
> refer to global variables.  I think this is bogus; the distinction between
> const and pure should be that a pure function can load from the memory
> pointed to by its arguments, whereas a const function must not.  If a pure
> function can load from arbitrary memory, that means that we can't optimize
> calls to strlen across a write to global memory.
Yes, that is the case.  pure (in RTL) is simply assumed to read the
global memory, so any change to it invalidates the call.

Honza
> 
> Jason



More information about the Gcc-patches mailing list