From 2f434b97f176acb60b345d2d135a0e15fcb5c5b7 Mon Sep 17 00:00:00 2001 From: Olivier Hainque Date: Mon, 13 Sep 2010 14:18:31 +0000 Subject: 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 --- gcc/fwprop.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gcc/fwprop.c') 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) -- cgit v1.1