]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/gimple-fold.c
re PR tree-optimization/46909 (Logical OR expressions are miscompiled)
authorJakub Jelinek <jakub@redhat.com>
Tue, 14 Dec 2010 14:09:59 +0000 (15:09 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 14 Dec 2010 14:09:59 +0000 (15:09 +0100)
commit8236c8eb4f599f95d76aafcdc11720edbce407cf
treee408f2279c770c233318337d4a252ee4b8fb25c6
parent2b503136079b6b526bd438b47ae6c5163942b7d0
re PR tree-optimization/46909 (Logical OR expressions are miscompiled)

PR tree-optimization/46909
* gimple-fold.c (and_var_with_comparison_1): Save partial
result even in the is_and case, if both partial results
are the same, return it.
(or_var_with_comparison_1): Use is_or predicate instead of
innercode == TRUTH_OR_EXPR test.  Save partial result
even in the is_or case, if both partial results are the
same, return it.  In the !is_or case when both partial
results are the same, return the partial result instead
of boolean_true_node.

* gcc.c-torture/execute/pr46909-1.c: New test.
* gcc.c-torture/execute/pr46909-2.c: New test.
* gcc.dg/pr46909.c: New test.

From-SVN: r167800
gcc/ChangeLog
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr46909-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr46909-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr46909.c [new file with mode: 0644]