aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-01-28 14:52:07 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-01-28 14:52:07 +0000
commita77b7e32ec72dc7ee6085cfe0cf29b4384c70b1e (patch)
tree64aacc56afbb7ec47bda44a8380a7ded1e0eff0a /gcc/cse.c
parent4ff71d245b0c77d25fc7a18aaab439c1a1ae8afa (diff)
downloadgcc-a77b7e32ec72dc7ee6085cfe0cf29b4384c70b1e.zip
gcc-a77b7e32ec72dc7ee6085cfe0cf29b4384c70b1e.tar.gz
gcc-a77b7e32ec72dc7ee6085cfe0cf29b4384c70b1e.tar.bz2
* cse.c (cse_insn): Avoid redundant REG_EQUAL notes.
From-SVN: r61971
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 84210ba..e396042 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5684,12 +5684,16 @@ cse_insn (insn, libcall_insn)
&& GET_CODE (XEXP (XEXP (src_const, 0), 0)) == LABEL_REF
&& GET_CODE (XEXP (XEXP (src_const, 0), 1)) == LABEL_REF))
{
- /* Make sure that the rtx is not shared with any other insn. */
- src_const = copy_rtx (src_const);
+ /* We only want a REG_EQUAL note if src_const != src. */
+ if (! rtx_equal_p (src, src_const))
+ {
+ /* Make sure that the rtx is not shared. */
+ src_const = copy_rtx (src_const);
- /* Record the actual constant value in a REG_EQUAL note, making
- a new one if one does not already exist. */
- set_unique_reg_note (insn, REG_EQUAL, src_const);
+ /* Record the actual constant value in a REG_EQUAL note,
+ making a new one if one does not already exist. */
+ set_unique_reg_note (insn, REG_EQUAL, src_const);
+ }
/* If storing a constant value in a register that
previously held the constant value 0,