diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-03-20 10:55:07 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2024-03-20 10:55:07 +0100 |
commit | 456e10f28b36aa417e0db145556831c4f979fbd7 (patch) | |
tree | db543e0d5f323802d4c94a47044019783f3c9c84 /gcc/fortran/trans-intrinsic.cc | |
parent | 4c276896d646c2dbc8047fd81d6e65f8c5ecf01d (diff) | |
download | gcc-456e10f28b36aa417e0db145556831c4f979fbd7.zip gcc-456e10f28b36aa417e0db145556831c4f979fbd7.tar.gz gcc-456e10f28b36aa417e0db145556831c4f979fbd7.tar.bz2 |
bitint: Fix handling of conditional bitfield loads [PR114365]
For the m_var_msb (aka left shift) case of large/huge _BitInt bitfield loads
handle_load adds a PHI node, but I forgot to actually update the temporary
the code later on uses, so the PHI result was unused and the code
incorrectly used something that wasn't valid SSA form.
In particular, we emitted
if (_29 != 2)
goto <bb 4>; [80.00%]
else
goto <bb 5>; [20.00%]
<bb 4> [local count: 1073741824]:
_33 = VIEW_CONVERT_EXPR<unsigned long[3]>(s.D.2771)[_31];
<bb 5> [local count: 1073741824]:
# _34 = PHI <_33(4), 0(3)>
_35 = _32 >> 31;
_36 = _33 << 33;
_37 = _36 | _35;
_38 = _37 << _19;
where instead of _33 the _36 def stmt should be using _34.
Fixed thusly.
2024-03-20 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/114365
* gimple-lower-bitint.cc (bitint_large_huge::handle_load): When adding
a PHI node, set iv2 to its result afterwards.
* gcc.dg/bitint-102.c: New test.
Diffstat (limited to 'gcc/fortran/trans-intrinsic.cc')
0 files changed, 0 insertions, 0 deletions