]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/54295 (Widening multiply-accumulate operation uses wrong...
authorRichard Earnshaw <rearnsha@arm.com>
Fri, 7 Sep 2012 10:37:08 +0000 (10:37 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Fri, 7 Sep 2012 10:37:08 +0000 (10:37 +0000)
PR tree-ssa/54295
* tree-ssa-math-opts.c (widening_mult_conversion_strippable_p):
Sign-extension of a zero-extended value can be simplified to
just zero-extension.

testsuite:
* gcc.target/arm/pr50318-1.c: Scan for smlal.
* gcc.target/arm/smlaltb-1.c: XFAIL test.
* gcc.target/arm/smlaltt-1.c: Likewise.

From-SVN: r191066

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr50318-1.c
gcc/testsuite/gcc.target/arm/smlaltb-1.c
gcc/testsuite/gcc.target/arm/smlaltt-1.c
gcc/tree-ssa-math-opts.c

index cdf6a201820c41d148ce2fbfb309885dd22ef31e..360fd5642fa392e1c2958908e6295fd7540b4120 100644 (file)
@@ -1,3 +1,10 @@
+2012-09-07  Richard Earnshaw  <rearnsha@arm.com>
+
+       PR tree-ssa/54295
+       * tree-ssa-math-opts.c (widening_mult_conversion_strippable_p):
+       Sign-extension of a zero-extended value can be simplified to
+       just zero-extension.
+
 2012-09-07  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/53667
index 8a987e1f8cf45f43fcf685fe1fd3b0c8e76e7d05..ff3583fc5259c67d0e66a306709cc8288e849537 100644 (file)
@@ -1,3 +1,9 @@
+2012-09-07  Richard Earnshaw  <rearnsha@arm.com>
+
+       * gcc.target/arm/pr50318-1.c: Scan for smlal.
+       * gcc.target/arm/smlaltb-1.c: XFAIL test.
+       * gcc.target/arm/smlaltt-1.c: Likewise.
+
 2012-09-07  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc.dg/pr44194-1.c: Skip on Alpha and adjust regexp for SPARC64.
index 05885e1b5aca048305bbb981c6e5327a022099be..be270eefaef3703add9dda3c894b19ce1c66e72a 100644 (file)
@@ -8,4 +8,4 @@ long long test (unsigned int sec, unsigned long long nsecs)
    long)nsecs;
 }
 
-/* { dg-final { scan-assembler "umlal" } } */
+/* { dg-final { scan-assembler "smlal" } } */
index 1472c9b3fa1605149b8d13270d70879be6a7443f..a27009d2513264b4d92f78e6a74c79c10fc7cf10 100644 (file)
@@ -11,4 +11,4 @@ foo (long long x, int in)
   return x + b * a;
 }
 
-/* { dg-final { scan-assembler "smlaltb\\t" } } */
+/* { dg-final { scan-assembler "smlaltb\\t" { xfail *-*-* } } } */
index 6bcbce0b95861bf8586b19ca5570b833e504e643..380e3d01be69c908a44fb9e502aab1dd6a8adb55 100644 (file)
@@ -11,4 +11,4 @@ foo (long long x, int in1, int in2)
   return x + b * a;
 }
 
-/* { dg-final { scan-assembler "smlaltt\\t" } } */
+/* { dg-final { scan-assembler "smlaltt\\t" { xfail *-*-* } } } */
index c3392fb14c8b5635ff068f00e4943d975c1d4618..94d19afc2c071482db16d4b33c7d5740915ca225 100644 (file)
@@ -1985,7 +1985,11 @@ widening_mult_conversion_strippable_p (tree result_type, gimple stmt)
         the operation and doesn't narrow the range.  */
       inner_op_type = TREE_TYPE (gimple_assign_rhs1 (stmt));
 
-      if (TYPE_UNSIGNED (op_type) == TYPE_UNSIGNED (inner_op_type)
+      /* If the inner-most type is unsigned, then we can strip any
+        intermediate widening operation.  If it's signed, then the
+        intermediate widening operation must also be signed.  */
+      if ((TYPE_UNSIGNED (inner_op_type)
+          || TYPE_UNSIGNED (op_type) == TYPE_UNSIGNED (inner_op_type))
          && TYPE_PRECISION (op_type) > TYPE_PRECISION (inner_op_type))
        return true;