Commit 85222504 by Eric Botcazou Committed by Eric Botcazou

re PR tree-optimization/89536 (wrong code at -Os and above on x86_64-linux-gnu)

	PR tree-optimization/89536
	* tree-ssa-dom.c (edge_info::derive_equivalences) <BIT_NOT_EXPR>: Test
	only whether bit #0 of the value is 0 instead of the entire value.

From-SVN: r269289
parent cc284d9c
2019-02-28 Eric Botcazou <ebotcazou@adacore.com>
PR tree-optimization/89536
* tree-ssa-dom.c (edge_info::derive_equivalences) <BIT_NOT_EXPR>: Test
only whether bit #0 of the value is 0 instead of the entire value.
2019-02-28 Marek Polacek <polacek@redhat.com> 2019-02-28 Marek Polacek <polacek@redhat.com>
PR c++/87068 - missing diagnostic with fallthrough statement. PR c++/87068 - missing diagnostic with fallthrough statement.
......
2019-02-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/20190228-1.c: New test.
2019-02-28 Marek Polacek <polacek@redhat.com> 2019-02-28 Marek Polacek <polacek@redhat.com>
PR c++/87068 - missing diagnostic with fallthrough statement. PR c++/87068 - missing diagnostic with fallthrough statement.
......
/* PR tree-optimization/89536 */
/* Testcase by Zhendong Su <su@cs.ucdavis.edu> */
int a = 1;
int main (void)
{
a = ~(a && 1);
if (a < -1)
a = ~a;
if (!a)
__builtin_abort ();
return 0;
}
...@@ -348,7 +348,7 @@ edge_info::derive_equivalences (tree name, tree value, int recursion_limit) ...@@ -348,7 +348,7 @@ edge_info::derive_equivalences (tree name, tree value, int recursion_limit)
&& TREE_CODE (rhs) == SSA_NAME && TREE_CODE (rhs) == SSA_NAME
&& ssa_name_has_boolean_range (rhs)) && ssa_name_has_boolean_range (rhs))
{ {
if (integer_zerop (value)) if ((TREE_INT_CST_LOW (value) & 1) == 0)
res = build_one_cst (TREE_TYPE (rhs)); res = build_one_cst (TREE_TYPE (rhs));
else else
res = build_zero_cst (TREE_TYPE (rhs)); res = build_zero_cst (TREE_TYPE (rhs));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment