This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] 2 patches for PR tree-optimization/34648
On Jan 17, 2008 4:55 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> > Right. This is also what doc/extend.texi says. It explicitly mentiones
> > that such calls are subject of common subexpression elimination (which
> > would also be not possible if the functions could throw).
>
> Why? I think it's a matter of convention. Unless I'm mistaken, pure
> functions in Ada can throw and can be CSE'd.
Well, all what SCCVN does is do CSE ;) So you say only PREing would
be invalid?
What about
try {
*x = foo();
} catch (...) {
print("one");
}
try {
*y = foo ();
} catch (...) {
print("two");
}
if we CSE the two calls you can observe the missed side-effect of
it throwing.
> > I think both patches are ok, but if anyone is concerned we can leave the
> > changing of tree_could_throw_p to stage1.
>
> Yes, I don't think now is the right time to make such a non-trivial change.
No problem.
Richard.