aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-06-07 07:31:40 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-06-07 07:31:40 +0000
commit6b80d6fa72d99c5531ba8607bf2483e94a3b0a3d (patch)
tree6ecaf37186bbcea2e7b4a966938060136e61cc60 /gcc/tree-ssa-math-opts.c
parent0f3f94375a989a45df3c315789f0fc62bbf39989 (diff)
downloadgcc-6b80d6fa72d99c5531ba8607bf2483e94a3b0a3d.zip
gcc-6b80d6fa72d99c5531ba8607bf2483e94a3b0a3d.tar.gz
gcc-6b80d6fa72d99c5531ba8607bf2483e94a3b0a3d.tar.bz2
re PR tree-optimization/71428 (wrong code with -Os -fno-tree-forwprop (breaks in the .bswap dump))
2016-06-07 Richard Biener <rguenther@suse.de> PR tree-optimization/71428 * tree-ssa-math-opts.c (perform_symbolic_merge): Properly distinguish BIT_FIELD_REF op vs. load. * gcc.dg/torture/pr71428.c: New testcase. From-SVN: r237167
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 0b0c866..513ef0b 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -2164,10 +2164,12 @@ perform_symbolic_merge (gimple *source_stmt1, struct symbolic_number *n1,
struct symbolic_number *n_start;
tree rhs1 = gimple_assign_rhs1 (source_stmt1);
- if (TREE_CODE (rhs1) == BIT_FIELD_REF)
+ if (TREE_CODE (rhs1) == BIT_FIELD_REF
+ && TREE_CODE (TREE_OPERAND (rhs1, 0)) == SSA_NAME)
rhs1 = TREE_OPERAND (rhs1, 0);
tree rhs2 = gimple_assign_rhs1 (source_stmt2);
- if (TREE_CODE (rhs2) == BIT_FIELD_REF)
+ if (TREE_CODE (rhs2) == BIT_FIELD_REF
+ && TREE_CODE (TREE_OPERAND (rhs2, 0)) == SSA_NAME)
rhs2 = TREE_OPERAND (rhs2, 0);
/* Sources are different, cancel bswap if they are not memory location with