diff options
author | Jakub Jelinek <jakub@redhat.com> | 2025-02-27 22:11:51 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2025-02-27 22:11:51 +0100 |
commit | 8371e7f240c1130a3827be1afb94f73c26df81a6 (patch) | |
tree | 03e12b2cd73cb10df716a695188f5713f9af306e /libgfortran/generated/in_pack_i2.c | |
parent | 518def14ef1a8e6e307079f205ff98ad619ccd7b (diff) | |
download | gcc-8371e7f240c1130a3827be1afb94f73c26df81a6.zip gcc-8371e7f240c1130a3827be1afb94f73c26df81a6.tar.gz gcc-8371e7f240c1130a3827be1afb94f73c26df81a6.tar.bz2 |
gimple-fold: Fix a pasto in fold_truth_andor_for_ifcombine [PR119030]
The following testcase is miscompiled since r15-7597.
The left comparison is unsigned (x & 0x8000U) != 0) while the
right one is signed (x >> 16) >= 0 and is actually a signbit test,
so rsignbit is 64.
After debugging this and reading the r15-7597 change, I believe there
is just a pasto, the if (lsignbit) and if (rsignbit) blocks are pretty
much identical with just the first l on all variables starting with l
replaced with r (the only difference is that if (lsignbit) has a comment
explaining the sign <<= 1; stuff, while it isn't repeated in the second one.
Except the second one was using ll_unsignedp instead of rl_unsignedp
in one spot. I think it should use the latter, the signedness of the left
comparison doesn't affect the other one, they are basically independent
with the exception that we check that after transformations they are both
EQ or both NE and later on we try to merge them together.
2025-02-27 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/119030
* gimple-fold.cc (fold_truth_andor_for_ifcombine): Fix a pasto,
ll_unsignedp -> rl_unsignedp.
* gcc.c-torture/execute/pr119030.c: New test.
Diffstat (limited to 'libgfortran/generated/in_pack_i2.c')
0 files changed, 0 insertions, 0 deletions