summaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorhainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-13 14:18:31 +0000
committerhainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-13 14:18:31 +0000
commit93d89886b5b6304307cadbc71dfed4ccea4568a5 (patch)
tree4c9cd35e7dd224f5d801377b48766612c1f477f5 /gcc/gcse.c
parent2234e62819250039cd49559b6153ae2a8c163052 (diff)
downloadgcc-93d89886b5b6304307cadbc71dfed4ccea4568a5.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164245 138bc75d-0d04-0410-961f-82ee72b054a4
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 775c7e14127..39a5d223338 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));
}