summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-13 11:04:26 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-13 11:04:26 +0000
commit043ce67745a1fe56010dfbe273d2a83dae9eaf00 (patch)
tree6346bea605532f76d3b46ee9bfb0d6588ee811de /gcc/tree-ssa-forwprop.c
parent096295f6c740cd12cd5257029ae9c08b7bdd22ac (diff)
downloadgcc-043ce67745a1fe56010dfbe273d2a83dae9eaf00.tar.gz
PR tree-optimization/45216
PR tree-optimization/57157 * tree-ssa-forwprop.c (simplify_rotate): Only recognize the (-Y) & (B - 1) variant if OP is |. * expmed.c (expand_shift_1): For rotations by const0_rtx just return shifted. Use (-op1) & (prec - 1) as other_amount instead of prec - op1. * c-c++-common/rotate-1.c: Add 32 tests with +. * c-c++-common/rotate-1a.c: Adjust. * c-c++-common/rotate-2.c: Add 32 tests with +, expect only 48 rotates. * c-c++-common/rotate-2b.c: New test. * c-c++-common/rotate-3.c: Add 32 tests with +. * c-c++-common/rotate-4.c: Add 32 tests with +, expect only 48 rotates. * c-c++-common/rotate-4b.c: New test. * c-c++-common/rotate-5.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198823 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index e714a5ef244..6043d318d71 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -2135,10 +2135,10 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
(X << (int) Y) OP (X >> (int) (B - Y))
((T) ((T2) X << Y)) OP ((T) ((T2) X >> (B - Y)))
((T) ((T2) X << (int) Y)) OP ((T) ((T2) X >> (int) (B - Y)))
- (X << Y) OP (X >> ((-Y) & (B - 1)))
- (X << (int) Y) OP (X >> (int) ((-Y) & (B - 1)))
- ((T) ((T2) X << Y)) OP ((T) ((T2) X >> ((-Y) & (B - 1))))
- ((T) ((T2) X << (int) Y)) OP ((T) ((T2) X >> (int) ((-Y) & (B - 1))))
+ (X << Y) | (X >> ((-Y) & (B - 1)))
+ (X << (int) Y) | (X >> (int) ((-Y) & (B - 1)))
+ ((T) ((T2) X << Y)) | ((T) ((T2) X >> ((-Y) & (B - 1))))
+ ((T) ((T2) X << (int) Y)) | ((T) ((T2) X >> (int) ((-Y) & (B - 1))))
and transform these into:
X r<< CNT1
@@ -2293,7 +2293,8 @@ simplify_rotate (gimple_stmt_iterator *gsi)
&& host_integerp (cdef_arg2[i], 0)
&& tree_low_cst (cdef_arg2[i], 0)
== TYPE_PRECISION (rtype) - 1
- && TREE_CODE (cdef_arg1[i]) == SSA_NAME)
+ && TREE_CODE (cdef_arg1[i]) == SSA_NAME
+ && gimple_assign_rhs_code (stmt) == BIT_IOR_EXPR)
{
tree tem;
enum tree_code code;