Commit 08f42414 by Bernd Edlinger Committed by Bernd Edlinger

ira.c (update_equiv_regs): Revert to using may_trap_or_fault_p again.

2017-06-23  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        rtl-optimizatoin/79286
        * ira.c (update_equiv_regs): Revert to using may_trap_or_fault_p again.
        * rtlanal.c (rtx_addr_can_trap_p_1): SYMBOL_REF_FUNCTION_P can never
        trap.  PIC register plus a const unspec without offset can never trap.

From-SVN: r249588
parent 2db9b7cd
2017-06-23 Bernd Edlinger <bernd.edlinger@hotmail.de>
rtl-optimizatoin/79286
* ira.c (update_equiv_regs): Revert to using may_trap_or_fault_p again.
* rtlanal.c (rtx_addr_can_trap_p_1): SYMBOL_REF_FUNCTION_P can never
trap. PIC register plus a const unspec without offset can never trap.
2017-06-23 Marc Glisse <marc.glisse@inria.fr> 2017-06-23 Marc Glisse <marc.glisse@inria.fr>
* tree.h (builtin_structptr_type): New type. * tree.h (builtin_structptr_type): New type.
......
...@@ -3551,7 +3551,8 @@ update_equiv_regs (void) ...@@ -3551,7 +3551,8 @@ update_equiv_regs (void)
if (DF_REG_DEF_COUNT (regno) == 1 if (DF_REG_DEF_COUNT (regno) == 1
&& note && note
&& !rtx_varies_p (XEXP (note, 0), 0) && !rtx_varies_p (XEXP (note, 0), 0)
&& def_dominates_uses (regno)) && (!may_trap_or_fault_p (XEXP (note, 0))
|| def_dominates_uses (regno)))
{ {
rtx note_value = XEXP (note, 0); rtx note_value = XEXP (note, 0);
remove_note (insn, note); remove_note (insn, note);
......
...@@ -485,7 +485,7 @@ rtx_addr_can_trap_p_1 (const_rtx x, HOST_WIDE_INT offset, HOST_WIDE_INT size, ...@@ -485,7 +485,7 @@ rtx_addr_can_trap_p_1 (const_rtx x, HOST_WIDE_INT offset, HOST_WIDE_INT size,
case SYMBOL_REF: case SYMBOL_REF:
if (SYMBOL_REF_WEAK (x)) if (SYMBOL_REF_WEAK (x))
return 1; return 1;
if (!CONSTANT_POOL_ADDRESS_P (x)) if (!CONSTANT_POOL_ADDRESS_P (x) && !SYMBOL_REF_FUNCTION_P (x))
{ {
tree decl; tree decl;
HOST_WIDE_INT decl_size; HOST_WIDE_INT decl_size;
...@@ -644,8 +644,11 @@ rtx_addr_can_trap_p_1 (const_rtx x, HOST_WIDE_INT offset, HOST_WIDE_INT size, ...@@ -644,8 +644,11 @@ rtx_addr_can_trap_p_1 (const_rtx x, HOST_WIDE_INT offset, HOST_WIDE_INT size,
case PLUS: case PLUS:
/* An address is assumed not to trap if: /* An address is assumed not to trap if:
- it is the pic register plus a constant. */ - it is the pic register plus a const unspec without offset. */
if (XEXP (x, 0) == pic_offset_table_rtx && CONSTANT_P (XEXP (x, 1))) if (XEXP (x, 0) == pic_offset_table_rtx
&& GET_CODE (XEXP (x, 1)) == CONST
&& GET_CODE (XEXP (XEXP (x, 1), 0)) == UNSPEC
&& offset == 0)
return 0; return 0;
/* - or it is an address that can't trap plus a constant integer. */ /* - or it is an address that can't trap plus a constant integer. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment