* dojump.c (do_jump): Copy SUBREGs into a pseudo for comparison.
authorRoger Sayle <roger@eyesopen.com>
Sun, 30 Mar 2003 23:07:27 +0000 (23:07 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 30 Mar 2003 23:07:27 +0000 (23:07 +0000)
From-SVN: r65060

gcc/ChangeLog
gcc/dojump.c

index ea9655ae1600854710e29c73defc1a95f707bd37..a51e1433eda4c5ae5dfd3f3cf79d99b04ff4af8d 100644 (file)
@@ -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
index 14fed968f32e749d2a5ac50247f85c8b0fefa927..6921d2b72becc7b5894543ccaa32c238c9f8802d 100644 (file)
@@ -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 ();
     }