From: Jose E. Marchesi Date: Wed, 17 Dec 2025 17:03:15 +0000 (+0100) Subject: a68: fix imports in big-endian targets [PR algol68/123132] X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcbf597cb0de9b0c3152a50d39474ca55d8d38be;p=thirdparty%2Fgcc.git 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 gcc/algol68/ChangeLog PR algol68/123132 * a68-imports.cc (DOFFSET): Fix big-endian path. --- diff --git a/gcc/algol68/a68-imports.cc b/gcc/algol68/a68-imports.cc index 9b367dac4c5..c628d21f581 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 \ { \