diff options
author | Martin Jambor <mjambor@suse.cz> | 2025-01-04 20:40:07 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2025-01-10 12:08:53 +0100 |
commit | d019ab4f115caab48316c185c007765719e93052 (patch) | |
tree | 28ff4082978828f99c75a82befbe96a8c15af3ab /gcc/c | |
parent | 86175a64f167e3b1701132fa1684d76230054c36 (diff) | |
download | gcc-d019ab4f115caab48316c185c007765719e93052.zip gcc-d019ab4f115caab48316c185c007765719e93052.tar.gz gcc-d019ab4f115caab48316c185c007765719e93052.tar.bz2 |
ipa-cp: Fold-convert values when necessary (PR 118138)
PR 118138 and quite a few duplicates that it has acquired in a short
time show that even though we are careful to make sure we do not loose
any bits when newly allowing type conversions in jump-functions, we
still need to perform the fold conversions during IPA constant
propagation and not just at the end in order to properly perform
sign-extensions or zero-extensions as appropriate.
This patch does just that, changing a safety predicate we already use
at the appropriate places to return the necessary type.
gcc/ChangeLog:
2025-01-03 Martin Jambor <mjambor@suse.cz>
PR ipa/118138
* ipa-cp.cc (ipacp_value_safe_for_type): Return the appropriate
type instead of a bool, accept NULL_TREE VALUEs.
(propagate_vals_across_arith_jfunc): Use the new returned value of
ipacp_value_safe_for_type.
(propagate_vals_across_ancestor): Likewise.
(propagate_scalar_across_jump_function): Likewise.
gcc/testsuite/ChangeLog:
2025-01-03 Martin Jambor <mjambor@suse.cz>
PR ipa/118138
* gcc.dg/ipa/pr118138.c: New test.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions