RFA [PR rtl-optimization/37273] [4.4/4.5/4.6 Regression] IRA does not re-materializes addresses (loads from the TOC)

Eric Botcazou ebotcazou@adacore.com
Wed Jan 26 11:40:00 GMT 2011


> IRA decides that (reg:SI 83) is best left in memory.  A reasonable
> choice.  Reload also decides to leave it in memory and replace the
> pseudo with its equivalent memory location.  In that code reload sets
> the MEM_NOTRAP_P bit for the equivalent memory location.  This is the
> point at which I believe things have gone wrong.
>
> Anyway, later ifcvt looks as the MEM_NOTRAP_P flag and decides it can
> move the memory reference with abandon and moves the memory reference
> before the address check guard triggering the fault.
>
> As I mentioned, I believe the point at which we've taken the wrong step
> is setting MEM_NOTRAP_P.  While it is true that the memref can't trap as
> long as it stays in its original context, ifcvt can change the context
> in which the MEM occurs thus making MEM_NOTRAP_P inconsistent with reality.

This is a known pattern though, see may_trap_or_fault_p vs may_trap_p.  Maybe 
noce_operand_ok should invoke the former instead of the latter.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list