]> git.ipfire.org Git - people/ms/gcc.git/commit
middle-end/108625 - wrong folding due to misinterpreted !
authorRichard Biener <rguenther@suse.de>
Thu, 2 Feb 2023 10:09:26 +0000 (11:09 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 15 Mar 2023 09:07:16 +0000 (10:07 +0100)
commite19e9c36abc7fff9c628cf744e55e4c0e686ea53
tree3f112b96820003dc7a03f36e733cebc91d926a1b
parentb955080a5ab8690902f7cc99a770f9c3da171d6f
middle-end/108625 - wrong folding due to misinterpreted !

The following fixes a problem with ! handling in genmatch which isn't
conservative enough when intermediate simplifications push to the
sequence but the final operation appears to just pick an existing
(but in this case newly defined in the sequence) operand.  The easiest
fix is to disallow adding to the sequence when processing !.

PR middle-end/108625
* genmatch.cc (expr::gen_transform): Also disallow resimplification
from pushing to lseq with force_leaf.
(dt_simplify::gen_1): Likewise.

* gcc.dg/pr108625.c: New testcase.

(cherry picked from commit 605d1297b91c2c7c23ccfe669e66dda5791d1f55)
gcc/genmatch.cc
gcc/testsuite/gcc.dg/pr108625.c [new file with mode: 0644]