aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-05-30 17:49:44 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-05-30 17:49:44 +0000
commit0c19a26f771e80f9f5b5700661d72bb8619d6cb6 (patch)
tree82a94f53b3de8865038ee21fdc4560d6ed2c908f /gcc/expr.c
parent9a38893aa75ebb4447f960f3e5a865e7f580e2cc (diff)
downloadgcc-0c19a26f771e80f9f5b5700661d72bb8619d6cb6.zip
gcc-0c19a26f771e80f9f5b5700661d72bb8619d6cb6.tar.gz
gcc-0c19a26f771e80f9f5b5700661d72bb8619d6cb6.tar.bz2
cse.c (cse_insn): Simplify REG_EQUAL note on libcalls when making a substitution.
* cse.c (cse_insn): Simplify REG_EQUAL note on libcalls when making a substitution. (dead_libcall_p): If directly replacing a libcall with a constant value produces an invalid instruction, also try forcing the constant into the constant pool. * expr.c (emit_move_insn): Add a REG_EQUAL note when it is not obvious that the source is a constant. (compress_float_constant): Use set_unique_reg_note to place REG_EQUAL notes on instructions. From-SVN: r67247
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 770bef4..e3872e8 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3166,7 +3166,7 @@ emit_move_insn (x, y)
{
enum machine_mode mode = GET_MODE (x);
rtx y_cst = NULL_RTX;
- rtx last_insn;
+ rtx last_insn, set;
x = protect_from_queue (x, 1);
y = protect_from_queue (y, 0);
@@ -3184,9 +3184,10 @@ emit_move_insn (x, y)
&& (last_insn = compress_float_constant (x, y)))
return last_insn;
+ y_cst = y;
+
if (!LEGITIMATE_CONSTANT_P (y))
{
- y_cst = y;
y = force_const_mem (mode, y);
/* If the target's cannot_force_const_mem prevented the spill,
@@ -3217,7 +3218,10 @@ emit_move_insn (x, y)
last_insn = emit_move_insn_1 (x, y);
- if (y_cst && GET_CODE (x) == REG)
+ if (y_cst && GET_CODE (x) == REG
+ && (set = single_set (last_insn)) != NULL_RTX
+ && SET_DEST (set) == x
+ && ! rtx_equal_p (y_cst, SET_SRC (set)))
set_unique_reg_note (last_insn, REG_EQUAL, y_cst);
return last_insn;
@@ -3621,8 +3625,7 @@ compress_float_constant (x, y)
last_insn = get_last_insn ();
if (GET_CODE (x) == REG)
- REG_NOTES (last_insn)
- = gen_rtx_EXPR_LIST (REG_EQUAL, y, REG_NOTES (last_insn));
+ set_unique_reg_note (last_insn, REG_EQUAL, y);
return last_insn;
}