aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2010-09-13 14:18:31 +0000
committerOlivier Hainque <hainque@gcc.gnu.org>2010-09-13 14:18:31 +0000
commit2f434b97f176acb60b345d2d135a0e15fcb5c5b7 (patch)
tree4c9cd35e7dd224f5d801377b48766612c1f477f5 /gcc/gcse.c
parent654a61fb34739e051618c5af90e8bfa77b84a8d2 (diff)
downloadgcc-2f434b97f176acb60b345d2d135a0e15fcb5c5b7.zip
gcc-2f434b97f176acb60b345d2d135a0e15fcb5c5b7.tar.gz
gcc-2f434b97f176acb60b345d2d135a0e15fcb5c5b7.tar.bz2
fwprop.c (forward_propagate_and_simplify): Only attach a REG_EQUAL note to an insn if the destination is a register.
* fwprop.c (forward_propagate_and_simplify): Only attach a REG_EQUAL note to an insn if the destination is a register. * gcse.c (try_replace_reg): Likewise. testsuite/ * gnat.dg/memtrap.adb: New test. From-SVN: r164245
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 775c7e1..39a5d22 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -2351,12 +2351,10 @@ try_replace_reg (rtx from, rtx to, rtx insn)
&& validate_change (insn, &SET_SRC (set), src, 0))
success = 1;
- /* If we've failed to do replacement, have a single SET, don't already
- have a note, and have no special SET, add a REG_EQUAL note to not
- lose information. */
- if (!success && note == 0 && set != 0
- && GET_CODE (SET_DEST (set)) != ZERO_EXTRACT
- && GET_CODE (SET_DEST (set)) != STRICT_LOW_PART)
+ /* If we've failed perform the replacement, have a single SET to
+ a REG destination and don't yet have a note, add a REG_EQUAL note
+ to not lose information. */
+ if (!success && note == 0 && set != 0 && REG_P (SET_DEST (set)))
note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
}