From: Marc Glisse Date: Wed, 31 Aug 2016 18:22:58 +0000 (+0200) Subject: match.pd: Revert a * (1 << b) relaxation. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9ff6fb6ede9ac2902088514067aca53e1133cc80;p=gcc.git match.pd: Revert a * (1 << b) relaxation. 2016-08-31 Marc Glisse 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f113217423..2d508331e50 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-08-31 Marc Glisse + + PR tree-optimization/73714 + * match.pd (a * (1 << b)): Revert change from 2016-05-23. + 2016-08-31 David Malcolm * selftest.c: Move "namespace selftest {" to top of file, diff --git a/gcc/match.pd b/gcc/match.pd index 123e754483e..786cf4ce042 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -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. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 20535a191a0..4a9043c07cf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-08-31 Marc Glisse + + PR tree-optimization/73714 + * gcc.dg/tree-ssa/pr73714.c: New test. + 2016-08-31 Jerry DeLisle 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 index 00000000000..40604b8a913 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr73714.c @@ -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" } } */