On Thu, Jun 12, 2014 at 10:36 AM, Eric Botcazou <ebotca...@adacore.com> wrote: >> Btw, I wonder if we can simply mark the MEMs generated from spill code >> with MEM_NOTRAP_P so we can remove the special casing of >> frame-pointer-based addresses from add while properly initializing >> MEM_NOTRAP_p from rtx_addr_can_trap_p? > > Spill code generated by the compiler itself? That's quite restrictive. > >> I suppose it was added exactly to cover spill code? > > Nope, it was added for jump tables: > > 2003-04-22 Richard Henderson <r...@redhat.com> > > PR 8866 > * rtl.h (MEM_NOTRAP_P): New. > (MEM_COPY_ATTRIBUTES): Copy it. > * rtlanal.c (may_trap_p): Check it. > * expr.c (do_tablejump): Set it. > * doc/rtl.texi (Flags): Document it. > > * cfgrtl.c (try_redirect_by_replacing_jump): Revert last three > changes. > > that is to say, for memory accesses that can nominally trap but for which we > know that they actually don't.
I was asking for the special-casing of frame-pointer-based accesses in rtx_addr_can_trap_p, not MEM_NOTRAP_P. (MEM_NOTRAP_P of course has the issue that it may not be trusted when you try to move the MEM ...) Richard. > -- > Eric Botcazou