]> git.ipfire.org Git - thirdparty/gcc.git/commit
phiprop: Make sure types of the load match the inserted phi [PR122847]
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Tue, 25 Nov 2025 22:19:18 +0000 (14:19 -0800)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Wed, 26 Nov 2025 02:34:22 +0000 (18:34 -0800)
commite75a9e33b97cfdcc76b6bfea3e7ca6184be5d5c0
treec9a81a60505cf0b21dc2bedc56ed19b502e05fbf
parent3c62023d05e9112ac51678fef42b2ba6e582f383
phiprop: Make sure types of the load match the inserted phi [PR122847]

This was introduced with r16-5556-ge94e91d6f3775, but the type
check for the delay was not happen because the type at the point
of delaying was set to NULL. It is only until a non-delayed load
when the phi is created, the type is set.

This adds the type check to the replacement for the delayed statements.

Pushed as obvious.

PR tree-optimization/122847

gcc/ChangeLog:

* tree-ssa-phiprop.cc (propagate_with_phi): Add type
check for reuse of the phi for the delayed statements.

gcc/testsuite/ChangeLog:

* gcc.dg/torture/pr122847-1.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/testsuite/gcc.dg/torture/pr122847-1.c [new file with mode: 0644]
gcc/tree-ssa-phiprop.cc