This is the mail archive of the gcc@gcc.gnu.org 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: [tree-ssa] Fun with exceptions -- opinions needed


fche@redhat.com (Frank Ch. Eigler):
> law wrote:
> > [...]  OK.  So think about what happens if "get" throws an exception
> > in the statement "i = get (strm.5)".  Right, the side effect of
> > assigning a new value to "i" does not happen.
> Can someone explain why such a side-effect would be expected?  I
> couldn't find a reference in Stroustrup about what is supposed to
> happen to the LHS of an assignment interrupted by an exception.

I thought the issue was a missed optimization.  If you have:
    i = 0;
    try {
        i = foo ();
    }
    catch (...) {
        L1:;
    }
    if (i != 0) {
       ...
    }
    L2:;
then the optimizer should be able to connect L1 to L2, bypassing
the test, but it can't because it will think i can change, unless
you separate the two effects of i = foo() with a temp.
--


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