From: Bernd Edlinger Date: Fri, 23 Jun 2017 12:44:07 +0000 (+0000) Subject: ira.c (update_equiv_regs): Revert to using may_trap_or_fault_p again. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=08f424143c105ec8e610e01a4ee09d96d1eaa823;p=gcc.git ira.c (update_equiv_regs): Revert to using may_trap_or_fault_p again. 2017-06-23 Bernd Edlinger 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f750a63dd1..b3a9adda731 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-06-23 Bernd Edlinger + + 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 * tree.h (builtin_structptr_type): New type. diff --git a/gcc/ira.c b/gcc/ira.c index 36a779bd37f..08a1cc550b2 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -3551,7 +3551,8 @@ update_equiv_regs (void) if (DF_REG_DEF_COUNT (regno) == 1 && note && !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); remove_note (insn, note); diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index d9f57c30d8e..bf4183e793d 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -485,7 +485,7 @@ rtx_addr_can_trap_p_1 (const_rtx x, HOST_WIDE_INT offset, HOST_WIDE_INT size, case SYMBOL_REF: if (SYMBOL_REF_WEAK (x)) return 1; - if (!CONSTANT_POOL_ADDRESS_P (x)) + if (!CONSTANT_POOL_ADDRESS_P (x) && !SYMBOL_REF_FUNCTION_P (x)) { tree decl; 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, case PLUS: /* An address is assumed not to trap if: - - it is the pic register plus a constant. */ - if (XEXP (x, 0) == pic_offset_table_rtx && CONSTANT_P (XEXP (x, 1))) + - it is the pic register plus a const unspec without offset. */ + 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; /* - or it is an address that can't trap plus a constant integer. */