]> git.ipfire.org Git - thirdparty/gcc.git/commit
phiopt: allow store placement of `= {}` [PR122153]
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Fri, 3 Oct 2025 21:09:57 +0000 (14:09 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Sat, 4 Oct 2025 16:25:57 +0000 (09:25 -0700)
commit14a825d4891f12ae0e2595b6b08a3555518f5dcb
tree043a174b8710306f6944a3f619fcfa905a954ada
parent5193b9d250a8ecec669a87708a1a98abae94130f
phiopt: allow store placement of `= {}` [PR122153]

Currently cselim and cselim-limited are able to
handle stores which have a rhs of a ssa name or a constant.
This extends that support to also allow `= {}`.
The sink pass will also commonalize the store but in some
cases this is too late in the pipeline. Doing it in phiopt1
allows for better inlining estimates too.

This is also the first step in improving/fixing PR 122083
such that we do an early inlining which is now not happening
for GCC 15+.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/122153

gcc/ChangeLog:

* tree-ssa-phiopt.cc (cond_if_else_store_replacement_1): Handle
stores of empty constructors too.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/pr122153-1.c: New test.

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