]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/116057 - wrong code with CCP and vector CTORs
authorRichard Biener <rguenther@suse.de>
Wed, 24 Jul 2024 11:16:35 +0000 (13:16 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 24 Jul 2024 12:08:44 +0000 (14:08 +0200)
commit1ea551514b9c285d801ac5ab8d78b22483ff65af
treea0af14b928556e272bf211fd469f614566860a21
parent39562dd1e745c7aacc23b51b2849a7d346cbef14
tree-optimization/116057 - wrong code with CCP and vector CTORs

The following fixes an issue with CCPs likely_value when faced with
a vector CTOR containing undef SSA names and constants.  This should
be classified as CONSTANT and not UNDEFINED.

PR tree-optimization/116057
* tree-ssa-ccp.cc (likely_value): Also walk CTORs in stmt
operands to look for constants.

* gcc.dg/torture/pr116057.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr116057.c [new file with mode: 0644]
gcc/tree-ssa-ccp.cc