aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-reassoc.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-07-25 12:50:30 +0200
committerMartin Liska <marxin@gcc.gnu.org>2016-07-25 10:50:30 +0000
commit16b0596564668914c43e4dce6724af1e602664d4 (patch)
treef44c5cd3ee4d5141243b26e7fcc9ad504976a038 /gcc/tree-ssa-reassoc.c
parent19bb30c065848fab2edc67f56990704e42345b2b (diff)
downloadgcc-16b0596564668914c43e4dce6724af1e602664d4.zip
gcc-16b0596564668914c43e4dce6724af1e602664d4.tar.gz
gcc-16b0596564668914c43e4dce6724af1e602664d4.tar.bz2
Call get_ops just for SSA_NAMEs (PR tree-optimization/71987)
PR tree-optimization/71987 * tree-ssa-reassoc.c (maybe_optimize_range_tests): Call get_ops just for SSA_NAMEs. Fix GNU coding style. * gcc.dg/torture/pr71987.c: New test. From-SVN: r238704
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r--gcc/tree-ssa-reassoc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index ece2d08..18cf978 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -3519,7 +3519,8 @@ maybe_optimize_range_tests (gimple *stmt)
(or &, corresponding to 1/0 in the phi arguments,
push into ops the individual range test arguments
of the bitwise or resp. and, recursively. */
- if (!get_ops (rhs, code, &ops,
+ if (TREE_CODE (rhs) == SSA_NAME
+ && !get_ops (rhs, code, &ops,
loop_containing_stmt (stmt))
&& (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt))
!= tcc_comparison)
@@ -3540,8 +3541,8 @@ maybe_optimize_range_tests (gimple *stmt)
else if (is_gimple_assign (stmt)
&& (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt))
== tcc_comparison)
- &&!get_ops (lhs, code, &ops,
- loop_containing_stmt (stmt))
+ && !get_ops (lhs, code, &ops,
+ loop_containing_stmt (stmt))
&& has_single_use (lhs))
{
operand_entry *oe = operand_entry_pool.allocate ();