https://gcc.gnu.org/g:dcbf597cb0de9b0c3152a50d39474ca55d8d38be
commit r16-6223-gdcbf597cb0de9b0c3152a50d39474ca55d8d38be Author: Jose E. Marchesi <[email protected]> Date: Wed Dec 17 18:03:15 2025 +0100 a68: fix imports in big-endian targets [PR algol68/123132] This commit fixes the macro DOFFSET in big-endian targets. Tested in sparc64-linux-gnu in both -m64 and -m32. Signed-off-by: Jose E. Marchesi <[email protected]> gcc/algol68/ChangeLog PR algol68/123132 * a68-imports.cc (DOFFSET): Fix big-endian path. Diff: --- gcc/algol68/a68-imports.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/algol68/a68-imports.cc b/gcc/algol68/a68-imports.cc index 9b367dac4c51..c628d21f5819 100644 --- a/gcc/algol68/a68-imports.cc +++ b/gcc/algol68/a68-imports.cc @@ -495,11 +495,10 @@ a68_get_packet_exports (const std::string &filename, if (pos + PTR_SIZE > size) \ goto decode_error; \ (V) = 0; \ - uint64_t ptr_bit_size = 8 * PTR_SIZE; \ if (BYTES_BIG_ENDIAN) \ { \ for (int i = 0; i < PTR_SIZE; i++) \ - (V) = ((V) | ((uint8_t) data[pos + i] << (ptr_bit_size - (i * 8)))); \ + (V) = ((V) | ((uint8_t) data[pos + i] << ((PTR_SIZE - i - 1) * 8))); \ } \ else \ { \
