[Bug tree-optimization/106617] [13 Regression] gcc is very slow at ternary expressions since r13-322-g7f04b0d786e13ff5
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Aug 18 14:04:10 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106617
--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:ac68f904fe31baf80fa53218f1d8ee033bd8c79b
commit r13-2113-gac68f904fe31baf80fa53218f1d8ee033bd8c79b
Author: Richard Biener <rguenther@suse.de>
Date: Thu Aug 18 11:10:30 2022 +0200
middle-end/106617 - fix fold_binary_op_with_conditional_arg pattern issue
Now that we have parts of fold_binary_op_with_conditional_arg duplicated
in match.pd and are using ! to take or throw away the result we have to
be careful to not have both implementations play games which each other,
causing quadratic behavior. In particular the match.pd implementation
requires both arms to simplify while the fold-const.cc is happy with
just one arm simplifying (something we cannot express in match.pd).
The fix is to simply not enable the match.pd pattern for GENERIC.
PR middle-end/106617
* match.pd ((a ? b : c) > d -> a ? (b > d) : (c > d)): Fix
guard, disable on GENERIC to not cause quadratic behavior
with the fold-const.cc implementation and the use of !
* gcc.dg/pr106617.c: New testcase.
More information about the Gcc-bugs
mailing list