[patch 1/2] PR27313 Discover non-trapping memory accesses
Steven Bosscher
stevenb.gcc@gmail.com
Tue Apr 17 09:04:00 GMT 2007
On 4/17/07, Richard Guenther <richard.guenther@gmail.com> wrote:
> > > Nope, that's not how things work. The trapping side effect doesn't
> > > prevent dead code elimination.
> >
> > So you say that with
> >
> > void foo (int *p)
> > {
> > int q = *p;
> > }
> >
> > we are allowed to remove the load from *p even if it may trap? This is not
> > how I believe things are working.
>
> Hm, we _do_ remove the load. We keep it only with -fexceptions
> -fnon-call-exceptions.
Without -fnon-call-exceptions, a trap on an invalid load is
irrelevant, so it's not surprising that we remove it. I bet we remove
it even with -fexceptions.
Gr.
Steven
More information about the Gcc-patches
mailing list