https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106078
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot
gnu.org
Keywords| |wrong-code
Status|NEW |ASSIGNED
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #0)
> Here I think it is invalid to move *b out of the loop with
> -fnon-call-exceptions:
>
> int array[10000];
> int test(short *b,int e, int f)
> {
> for (int i = 0; i<10000;i++)
> {
> e/=f;
> array[i]+=*b+e;
> }
> }
LIM uses nonpure_call_p to see whether a stmt possibly terminates a block
(and 'contains_call'). We probably have to treat const/pure throwing
calls and general throwing (or trapping) stmts the same way.