summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-19 22:42:07 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-19 22:42:07 +0000
commit3fe4cd25d4598b79557f7c9c72e8d1c5355293c6 (patch)
tree0ba44d7828040d98fc8b57247fc9e7f1558682ef /gcc
parentb29760a8e6a82c8ddbb584af71ccfdf5a051b96f (diff)
downloadgcc-3fe4cd25d4598b79557f7c9c72e8d1c5355293c6.tar.gz
2001-07-19 Alexandre Oliva <aoliva@redhat.com>
* simplify-rtx.c (simplify_replace_rtx): Try to obtain mode from old and new operands in `<', `3' and `b'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44164 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/simplify-rtx.c41
2 files changed, 34 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9d7ab64223b..e427ce579af 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-19 Alexandre Oliva <aoliva@redhat.com>
+
+ * simplify-rtx.c (simplify_replace_rtx): Try to obtain mode from
+ old and new operands in `<', `3' and `b'.
+
2001-07-19 Neil Booth <neil@daikokuya.demon.co.uk>
* Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h.
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 70b7240301f..1d090ba7783 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -247,21 +247,38 @@ simplify_replace_rtx (x, old, new)
simplify_replace_rtx (XEXP (x, 0), old, new),
simplify_replace_rtx (XEXP (x, 1), old, new));
case '<':
- return
- simplify_gen_relational (code, mode,
- (GET_MODE (XEXP (x, 0)) != VOIDmode
- ? GET_MODE (XEXP (x, 0))
- : GET_MODE (XEXP (x, 1))),
- simplify_replace_rtx (XEXP (x, 0), old, new),
- simplify_replace_rtx (XEXP (x, 1), old, new));
+ {
+ enum machine_mode op_mode = (GET_MODE (XEXP (x, 0)) != VOIDmode
+ ? GET_MODE (XEXP (x, 0))
+ : GET_MODE (XEXP (x, 1)));
+ rtx op0 = simplify_replace_rtx (XEXP (x, 0), old, new);
+ rtx op1 = simplify_replace_rtx (XEXP (x, 1), old, new);
+
+ return
+ simplify_gen_relational (code, mode,
+ (op_mode != VOIDmode
+ ? op_mode
+ : GET_MODE (op0) != VOIDmode
+ ? GET_MODE (op0)
+ : GET_MODE (op1)),
+ op0, op1);
+ }
case '3':
case 'b':
- return
- simplify_gen_ternary (code, mode, GET_MODE (XEXP (x, 0)),
- simplify_replace_rtx (XEXP (x, 0), old, new),
- simplify_replace_rtx (XEXP (x, 1), old, new),
- simplify_replace_rtx (XEXP (x, 2), old, new));
+ {
+ enum machine_mode op_mode = GET_MODE (XEXP (x, 0));
+ rtx op0 = simplify_replace_rtx (XEXP (x, 0), old, new);
+
+ return
+ simplify_gen_ternary (code, mode,
+ (op_mode != VOIDmode
+ ? op_mode
+ : GET_MODE (op0)),
+ op0,
+ simplify_replace_rtx (XEXP (x, 1), old, new),
+ simplify_replace_rtx (XEXP (x, 2), old, new));
+ }
case 'x':
/* The only case we try to handle is a SUBREG. */