Don't eliminate insns that may trap
Jan Hubicka
jh@suse.cz
Tue Oct 1 02:29:00 GMT 2002
> Richard Henderson writes:
> > On Mon, Sep 30, 2002 at 06:46:07PM +0100, Andrew Haley wrote:
> > > * flow.c (insn_dead_p): When using non-call-exceptions, don't
> > > eliminate insns that may trap.
> > > * cse.c (insn_live_p): Likewise.
> >
> > I'm not really fond of this, but I guess it's the
> > best we can do
>
> This seems to be the response to many of my patches... :-)
Perhaps this should be controlled by separate flag, like
-fhonnor-exceptions or something like that.
Except for removing insns that may trap we also need to disable some
algebraic simplifications (like noticing that x*0 can be elliminated)
and friends.
Honza
>
> > for 3.3. We really need a global optimizer that can prove that
> > memory ops shadowed by a preceeding trapping memory op can't trap.
>
> Also, may_trap_p needs to be rather smarter than it is -- I have
> noticed that it returns true for far more RTXes than it should. With
> Java, the front end has a very good idea which memory references might
> trap.
>
> Andrew.
More information about the Gcc-patches
mailing list