diff options
author | Jeff Law <law@redhat.com> | 2016-02-29 17:04:48 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2016-02-29 17:04:48 -0700 |
commit | e66f219b038771c074bfd460c067db842a36e4c4 (patch) | |
tree | 3e903d32f313b9c23e0efdd6335d9714de7b21c5 /gcc/tree-ssa-uncprop.c | |
parent | 0c6072a3fc25e656c606247df51a448ab21326c0 (diff) | |
download | gcc-e66f219b038771c074bfd460c067db842a36e4c4.zip gcc-e66f219b038771c074bfd460c067db842a36e4c4.tar.gz gcc-e66f219b038771c074bfd460c067db842a36e4c4.tar.bz2 |
re PR tree-optimization/70005 (wrong code at -O2 and -O3 on x86_64-linux-gnu)
PR tree-optimization/70005
* tree-ssa-uncprop.c (associate_equivalences_with_edges): Handle case
where an object with a boolean range is compared against a value
outside [0..1].
PR tree-optimization/70005
* gcc.c-torture/execute/pr70005.c New test.
From-SVN: r233829
Diffstat (limited to 'gcc/tree-ssa-uncprop.c')
-rw-r--r-- | gcc/tree-ssa-uncprop.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-ssa-uncprop.c b/gcc/tree-ssa-uncprop.c index 307bb1f..e2e8212 100644 --- a/gcc/tree-ssa-uncprop.c +++ b/gcc/tree-ssa-uncprop.c @@ -95,7 +95,8 @@ associate_equivalences_with_edges (void) if (TREE_CODE (op0) == SSA_NAME && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (op0) && ssa_name_has_boolean_range (op0) - && is_gimple_min_invariant (op1)) + && is_gimple_min_invariant (op1) + && (integer_zerop (op1) || integer_onep (op1))) { tree true_val = constant_boolean_node (true, TREE_TYPE (op0)); tree false_val = constant_boolean_node (false, |