]> gcc.gnu.org Git - gcc.git/commit
Fix PR 110666: `(a != 2) == a` produces wrong code
authorAndrew Pinski <apinski@marvell.com>
Fri, 14 Jul 2023 16:55:57 +0000 (09:55 -0700)
committerAndrew Pinski <apinski@marvell.com>
Mon, 17 Jul 2023 06:26:59 +0000 (23:26 -0700)
commitd20e542ecd8cfc009b120f9e432caeb7005e7c53
tree79d065dd61ebd9faf19b84b9950c2db4a3b46e21
parenta5088dc3f5ef73c8740f0b8be3e6ebf6b535f192
Fix PR 110666: `(a != 2) == a` produces wrong code

I had messed up the case where the outer operator is `==`.
The check for the resulting should have been `==` and not `!=`.
This patch fixes that and adds a full runtime testcase now for
all cases to make sure it works.

OK? Bootstrapped and tested on x86-64-linux-gnu with no regressions.

gcc/ChangeLog:

PR tree-optimization/110666
* match.pd (A NEEQ (A NEEQ CST)): Fix Outer EQ case.

gcc/testsuite/ChangeLog:

PR tree-optimization/110666
* gcc.c-torture/execute/pr110666-1.c: New test.
gcc/match.pd
gcc/testsuite/gcc.c-torture/execute/pr110666-1.c [new file with mode: 0644]
This page took 0.056156 seconds and 5 git commands to generate.