re PR rtl-optimization/31455 (lower subreg causes a performance regression in the...
authorIan Lance Taylor <iant@google.com>
Fri, 1 Jun 2007 15:06:19 +0000 (15:06 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 1 Jun 2007 15:06:19 +0000 (15:06 +0000)
PR rtl-optimization/31455
* lower-subreg.c (find_decomposable_subregs): Don't decompose
subregs which have a cast between modes which are not tieable.

From-SVN: r125265

gcc/ChangeLog
gcc/lower-subreg.c

index c1ee9fbfe425b81f2d5135b2aa464cc35eec3998..ece60c7ae48ee7e230d9c7672499e9d85bdc9c94 100644 (file)
@@ -1,3 +1,9 @@
+2007-06-01  Ian Lance Taylor  <iant@google.com>
+
+       PR rtl-optimization/31455
+       * lower-subreg.c (find_decomposable_subregs): Don't decompose
+       subregs which have a cast between modes which are not tieable.
+
 2007-06-01  Uros Bizjak  <ubizjak@gmail.com>
 
        * expr.c (force_operand) [DIV, MOD, UDIV, UMOD, ASHIFTRT]: Remove
index ac29272211d6d77584448eeb15901cfebe8d0f65..0b50a88de99c27591d3daf5983ea1030b633f617 100644 (file)
@@ -281,6 +281,18 @@ find_decomposable_subregs (rtx *px, void *data)
          bitmap_set_bit (decomposable_context, regno);
          return -1;
        }
+
+      /* If this is a cast from one mode to another, where the modes
+        have the same size, and they are not tieable, then mark this
+        register as non-decomposable.  If we decompose it we are
+        likely to mess up whatever the backend is trying to do.  */
+      if (outer_words > 1
+         && outer_size == inner_size
+         && !MODES_TIEABLE_P (GET_MODE (x), GET_MODE (inner)))
+       {
+         bitmap_set_bit (non_decomposable_context, regno);
+         return -1;
+       }
     }
   else if (REG_P (x))
     {