diff options
author | Olivier Hainque <hainque@adacore.com> | 2010-09-13 14:18:31 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@gcc.gnu.org> | 2010-09-13 14:18:31 +0000 |
commit | 2f434b97f176acb60b345d2d135a0e15fcb5c5b7 (patch) | |
tree | 4c9cd35e7dd224f5d801377b48766612c1f477f5 /gcc/fwprop.c | |
parent | 654a61fb34739e051618c5af90e8bfa77b84a8d2 (diff) | |
download | gcc-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/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 006dca3c..b54ff50 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) |