aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-03-30 23:07:27 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-03-30 23:07:27 +0000
commit9311f3f613826baba9506671cfd94227108853a9 (patch)
treedbb11f2059db5f960133c611cbd811745b901d63
parentc717c5af279f31b4e469f01469d17a7720c56d54 (diff)
downloadgcc-9311f3f613826baba9506671cfd94227108853a9.zip
gcc-9311f3f613826baba9506671cfd94227108853a9.tar.gz
gcc-9311f3f613826baba9506671cfd94227108853a9.tar.bz2
* dojump.c (do_jump): Copy SUBREGs into a pseudo for comparison.
From-SVN: r65060
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/dojump.c13
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ea9655a..a51e143 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2003-03-30 Roger Sayle <roger@eyesopen.com>
+
+ * dojump.c (do_jump): Copy SUBREGs into a pseudo for comparison.
+
2003-03-30 DJ Delorie <dj@redhat.com>
* profile.c (instrument_edges): Make sure any newly created
diff --git a/gcc/dojump.c b/gcc/dojump.c
index 14fed96..6921d2b 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -588,10 +588,15 @@ do_jump (exp, if_false_label, if_true_label)
/* Note swapping the labels gives us not-equal. */
do_jump_by_parts_equality_rtx (temp, if_true_label, if_false_label);
else if (GET_MODE (temp) != VOIDmode)
- do_compare_rtx_and_jump (temp, CONST0_RTX (GET_MODE (temp)),
- NE, TREE_UNSIGNED (TREE_TYPE (exp)),
- GET_MODE (temp), NULL_RTX,
- if_false_label, if_true_label);
+ {
+ /* The RTL optimizers prefer comparisons against pseudos. */
+ if (GET_CODE (temp) == SUBREG)
+ temp = copy_to_reg (temp);
+ do_compare_rtx_and_jump (temp, CONST0_RTX (GET_MODE (temp)),
+ NE, TREE_UNSIGNED (TREE_TYPE (exp)),
+ GET_MODE (temp), NULL_RTX,
+ if_false_label, if_true_label);
+ }
else
abort ();
}