diff options
author | Martin Jambor <mjambor@suse.cz> | 2025-05-29 16:32:04 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2025-06-12 14:07:48 +0200 |
commit | f5fc1c6a169bfa6ebe569c701f293b55e5a3490e (patch) | |
tree | 2273af08fee1908bd15345570a0b2476547187f9 /gcc/dwarf2ctf.cc | |
parent | 36bc863200b86a311cf7d9a027b0597280dfebf0 (diff) | |
download | gcc-f5fc1c6a169bfa6ebe569c701f293b55e5a3490e.zip gcc-f5fc1c6a169bfa6ebe569c701f293b55e5a3490e.tar.gz gcc-f5fc1c6a169bfa6ebe569c701f293b55e5a3490e.tar.bz2 |
ipa: When inlining, don't combine PT JFs changing signedness (PR120295)
In GCC 15 we allowed jump-function generation code to skip over a
type-cast converting one integer to another as long as the latter can
hold all the values of the former or has at least the same precision.
This works well for IPA-CP where we do then evaluate each jump
function as we propagate values and value-ranges. However, the
test-case in PR 120295 shows a problem with inlining, where we combine
pass-through jump-functions so that they are always relative to the
function which is the root of the inline tree. Unfortunately, we are
happy to combine also those with type-casts to a different signedness
which makes us use sign zero extension for the expected value ranges
where we should have used sign extension. When the value-range which
then leads to wrong insertion of a call to builtin_unreachable is
being computed, the information about an existence of a intermediary
signed type has already been lost during previous inlining.
This patch simply blocks combining such jump-functions so that it is
back-portable to GCC 15. Once we switch pass-through jump functions
to use a vector of operations rather than having room for just one, we
will be able to address this situation with adding an extra conversion
instead.
gcc/ChangeLog:
2025-05-19 Martin Jambor <mjambor@suse.cz>
PR ipa/120295
* ipa-prop.cc (update_jump_functions_after_inlining): Do not
combine pass-through jump functions with type-casts changing
signedness.
gcc/testsuite/ChangeLog:
2025-05-19 Martin Jambor <mjambor@suse.cz>
PR ipa/120295
* gcc.dg/ipa/pr120295.c: New test.
(cherry picked from commit 0b004c92f5ea239936a403a2a757e12ca82ce6d8)
Diffstat (limited to 'gcc/dwarf2ctf.cc')
0 files changed, 0 insertions, 0 deletions