]> 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>
Fri, 10 Jan 2025 13:36:34 +0000 (14:36 +0100)
commitc8b549857d968d634a74709112e5acc9f9caf35c
treeb02b6b787261f34218f5d0b722b2729786f8520b
parent882f7e53a7664f2c76b10dc020e720ba9f55f022
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.

(cherry picked from commit 1ea551514b9c285d801ac5ab8d78b22483ff65af)
gcc/testsuite/gcc.dg/torture/pr116057.c [new file with mode: 0644]
gcc/tree-ssa-ccp.cc