This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Non-call exceptions versus cse


On Mon, 25 Nov 2002, Richard Kenner wrote:

>         int tmp = <may trap operation>;
>         var = tmp;
>     should not update var if the operation traps.
> That's expensive to guarantee.

I don't think so.  If you reread the thread I already wrote why combining
the above two insns is not safe in the general case and why I think CSE
shouldn't anyway do this currently.  But obviously CSE does do that, and
I'm more or less puzzled how that was supposed to work.  At least the
transformations CSE is doing that Andrew posted (the before and after CSE
dumps of the RTL stream) are quite bogus.  It moved an assignment of a
pseudo into a basic block, were it wasn't before, ergo there are now more
codepaths in which that pseudo is set, in particular one codepath in which
it before CSE retained it's old value, but after CSE overwrote that value.
That's never a safe transformation without more checks of the validity
(independent from the reason for basic block borders, trapping insns or
simple jumps).

I don't know if such invalid transformations only happen with exceptions
involved, but I can't see the underlying machinery in CSE to prevent that.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]