From: Hans-Peter Nilsson <h...@bitrange.com>

This has an effect only for MMIX and BPF.  All other targets are
either 32-bits-or-less BITS_PER_WORD (and will now get 64 just
by a more obvious expression), or they don't use the default
MAX_FIXED_MODE_SIZE.

I can't build a complete toolchain for BPF (fails building
libgcc, PR121149), but from what I can see with that build,
having MAX_FIXED_MODE_SIZE 64 is unintended: TImode isn't
disabled for BPF.  So, I'm not offering a patch to keep
MAX_FIXED_MODE_SIZE 64 for BPF; with this patch, it moves to 2 *
BITS_PER_WORD == 128 as all other 64-bitters.

(BTW, disabling TImode and building an unmodified libgcc for a
target with MIN_UNITS_PER_WORD > 4 is not currently possible.)

Tested cris-elf (using the "new" default) and MMIX (fixing
gcc.dg/pr105094.c and incidentally PR 120935, where there's a
more proper patch proposed) and native x86_64 (though it doesn't
use the default at all).

Ok for master?

-- >8 --
The old GET_MODE_SIZE (DImode) (i.e. 64) made sense before
64-bitters.  Now the default is just a trap: when using the
default 64, things like TImode (128 bits) still mostly works,
but general corner cases related to computing large-size objects
numbers, like (1 << 64)/8 break, as exposed by
gcc.dg/pr105094.c.

So, keep the floor at 64 for 32-bitters and smaller targets, but
for larger targets, make it 2 * BITS_PER_WORD.  Also, express it
more directly with focus on BITS_PER_WORD, not the size of a mode.

        * defaults.h (MAX_FIXED_MODE_SIZE): Default to 2 * BITS_PER_WORD
        for larger-than-32-bitters.
---
 gcc/defaults.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/defaults.h b/gcc/defaults.h
index 16f6dc24e3b8..f807ef667e6d 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -1158,7 +1158,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  
If not, see
 #endif
 
 #ifndef MAX_FIXED_MODE_SIZE
-#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
+#define MAX_FIXED_MODE_SIZE MAX (BITS_PER_WORD * 2, 64)
 #endif
 
 /* Nonzero if structures and unions should be returned in memory.
-- 
2.39.2

Reply via email to