summaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-30 00:56:59 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-30 00:56:59 +0000
commit9913d3a4c47a5b8371e30de43112f932aaba359c (patch)
tree3e72bc5f754672ecac841d4642054de785714fa0 /gcc/gcse.c
parent9b8b68276179a5f081c2d0b5b83cff8c0438c1a7 (diff)
downloadgcc-9913d3a4c47a5b8371e30de43112f932aaba359c.tar.gz
PR rtl-optimization/17581
* cselib.c (cselib_process_insn): The last instruction of a libcall block, with the REG_RETVAL note, should be considered in the libcall. * gcse.c (do_local_cprop): Allow constants to be propagated outside of libcall blocks. (adjust_libcall_notes): Use simplify_replace_rtx instead of replace_rtx to avoid creating invalid RTL in REG_RETVAL notes. * gcc.dg/pr17581-1.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89873 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index f1e1b0aa85f..f277801bced 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -3134,7 +3134,8 @@ do_local_cprop (rtx x, rtx insn, int alter_jumps, rtx *libcall_sp)
rtx this_rtx = l->loc;
rtx note;
- if (l->in_libcall)
+ /* Don't CSE non-constant values out of libcall blocks. */
+ if (l->in_libcall && ! CONSTANT_P (this_rtx))
continue;
if (gcse_constant_p (this_rtx))
@@ -3222,7 +3223,7 @@ adjust_libcall_notes (rtx oldreg, rtx newval, rtx insn, rtx *libcall_sp)
return true;
}
}
- XEXP (note, 0) = replace_rtx (XEXP (note, 0), oldreg, newval);
+ XEXP (note, 0) = simplify_replace_rtx (XEXP (note, 0), oldreg, newval);
insn = end;
}
return true;