]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/114070 - folding breaking VEC_COND expansion
authorRichard Biener <rguenther@suse.de>
Fri, 23 Feb 2024 15:06:05 +0000 (16:06 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 21 Mar 2024 11:48:58 +0000 (12:48 +0100)
commita9a425df628ab80374cc6a132d39e470bc78c8bc
tree5b2f6fa117a168c9fd22470a0301b3454ce70425
parentbd276b5340563182f7d95c383196fdd6fb7e6a1d
middle-end/114070 - folding breaking VEC_COND expansion

The following properly guards the simplifications that move
operations into VEC_CONDs, in particular when that changes the
type constraints on this operation.

This needed a genmatch fix which was recording spurious implicit fors
when tcc_comparison is used in a C expression.

PR middle-end/114070
* genmatch.cc (parser::parse_c_expr): Do not record operand
lists but only mark operators used.
* match.pd ((c ? a : b) op (c ? d : e)  -->  c ? (a op d) : (b op e)):
Properly guard the case of tcc_comparison changing the VEC_COND
value operand type.

* gcc.dg/torture/pr114070.c: New testcase.

(cherry picked from commit af66ad89e8169f44db723813662917cf4cbb78fc)
gcc/genmatch.cc
gcc/match.pd
gcc/testsuite/gcc.dg/torture/pr114070.c [new file with mode: 0644]