diff options
author | hainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-13 14:18:31 +0000 |
---|---|---|
committer | hainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-13 14:18:31 +0000 |
commit | 93d89886b5b6304307cadbc71dfed4ccea4568a5 (patch) | |
tree | 4c9cd35e7dd224f5d801377b48766612c1f477f5 /gcc/fwprop.c | |
parent | 2234e62819250039cd49559b6153ae2a8c163052 (diff) | |
download | gcc-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/fwprop.c')
-rw-r--r-- | gcc/fwprop.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/fwprop.c b/gcc/fwprop.c index 006dca3cda9..b54ff501fea 100644 --- a/gcc/fwprop.c +++ b/gcc/fwprop.c @@ -1294,10 +1294,11 @@ forward_propagate_and_simplify (df_ref use, rtx def_insn, rtx def_set) loc = &SET_SRC (use_set); /* Do not replace an existing REG_EQUAL note if the insn is not - recognized. Either we're already replacing in the note, or - we'll separately try plugging the definition in the note and - simplifying. */ - set_reg_equal = (note == NULL_RTX); + recognized. Either we're already replacing in the note, or we'll + separately try plugging the definition in the note and simplifying. + And only install a REQ_EQUAL note when the destination is a REG, + as the note would be invalid otherwise. */ + set_reg_equal = (note == NULL_RTX && REG_P (SET_DEST (use_set))); } if (GET_MODE (*loc) == VOIDmode) |