This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Fun with exceptions -- opinions needed
- From: Felix Lee <felix dot 1 at canids dot net>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 16 Jun 2003 13:16:26 -0700
- Subject: 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.
--