[Bug tree-optimization/65307] [4.9/5 Regression] Incorrect optimization breaks basic arithmetic
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Mar 4 14:44:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65307
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work|5.0 |
Summary|[4.9 Regression] Incorrect |[4.9/5 Regression]
|optimization breaks basic |Incorrect optimization
|arithmetic |breaks basic arithmetic
Known to fail| |5.0
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
The simpler testcase reproduces on trunk for me. Trunk assert:
Index: gcc/tree-ssa-ccp.c
===================================================================
--- gcc/tree-ssa-ccp.c (revision 221174)
+++ gcc/tree-ssa-ccp.c (working copy)
@@ -1901,9 +1922,13 @@ evaluate_stmt (gimple stmt)
}
else
{
- if (wi::bit_and_not (val.value, nonzero_bits) != 0)
- val.value = wide_int_to_tree (TREE_TYPE (lhs),
- nonzero_bits & val.value);
+ wide_int tem = wi::bit_and_not (val.value, nonzero_bits);
+ if (tem != 0)
+ {
+ gcc_assert (extend_mask (tem).and_not (val.mask) == 0);
+ val.value = wide_int_to_tree (TREE_TYPE (lhs),
+ nonzero_bits & val.value);
+ }
if (nonzero_bits == 0)
val.mask = 0;
else
More information about the Gcc-bugs
mailing list