match.pd: Revert a * (1 << b) relaxation.
authorMarc Glisse <marc.glisse@inria.fr>
Wed, 31 Aug 2016 18:22:58 +0000 (20:22 +0200)
committerMarc Glisse <glisse@gcc.gnu.org>
Wed, 31 Aug 2016 18:22:58 +0000 (18:22 +0000)
2016-08-31  Marc Glisse  <marc.glisse@inria.fr>

PR tree-optimization/73714
gcc/
* match.pd (a * (1 << b)): Revert change from 2016-05-23.
gcc/testsuite/
* gcc.dg/tree-ssa/pr73714.c: New test.

From-SVN: r239902

gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr73714.c [new file with mode: 0644]

index 4f1132174234c7198aec3bf1f9f8b64fc0054b01..2d508331e50f5abec86c52a33f57891afeb73ff9 100644 (file)
@@ -1,3 +1,8 @@
+2016-08-31  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR tree-optimization/73714
+       * match.pd (a * (1 << b)): Revert change from 2016-05-23.
+
 2016-08-31  David Malcolm  <dmalcolm@redhat.com>
 
        * selftest.c: Move "namespace selftest {" to top of file,
index 123e754483e298d037705978998cf4a5f978f922..786cf4ce042cadb6f8d4344ca501d2c09dc6d9ec 100644 (file)
@@ -468,8 +468,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 (simplify
  (mult:c @0 (convert? (lshift integer_onep@1 @2)))
   (if (! FLOAT_TYPE_P (type)
-       && (element_precision (type) <= element_precision (TREE_TYPE (@1))
-          || TYPE_UNSIGNED (TREE_TYPE (@1))))
+       && tree_nop_conversion_p (type, TREE_TYPE (@1)))
    (lshift @0 @2)))
 
 /* Fold (C1/X)*C2 into (C1*C2)/X.  */
index 20535a191a0a0606c35cc5d7323cb531ef92b564..4a9043c07cf5db5c6e15da94fd182f325966ffbd 100644 (file)
@@ -1,3 +1,8 @@
+2016-08-31  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR tree-optimization/73714
+       * gcc.dg/tree-ssa/pr73714.c: New test.
+
 2016-08-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libgfortran/77393
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr73714.c b/gcc/testsuite/gcc.dg/tree-ssa/pr73714.c
new file mode 100644 (file)
index 0000000..40604b8
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O2 -fdump-tree-optimized-raw" } */
+
+int f(int a, int b){
+  return a * (int)(1L << b);
+}
+
+/* { dg-final { scan-tree-dump "mult_expr" "optimized" } } */