]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
defaults.h: Default MAX_FIXED_MODE_SIZE to MAX (BITS_PER_WORD * 2, 64)
authorHans-Peter Nilsson <hp@bitrange.com>
Wed, 16 Jul 2025 03:29:05 +0000 (05:29 +0200)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Mon, 4 Aug 2025 16:02:50 +0000 (18:02 +0200)
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.  Add "by GCC internally" in an attempt to tell that this
is when gcc cooks something up, not when plain input uses a type
with such a mode.

* defaults.h (MAX_FIXED_MODE_SIZE): Default to 2 * BITS_PER_WORD
for larger-than-32-bitters.
* doc/tm.texi.in (MAX_FIXED_MODE_SIZE): Adjust accordingly.  Tweak
wording.
* doc/tm.texi: Regenerate.

gcc/defaults.h
gcc/doc/tm.texi
gcc/doc/tm.texi.in

index 16f6dc24e3b8a784fac2e22f10622de5757946c7..f807ef667e6dad0f1cdc5b9bc83a93b9f4db07c6 100644 (file)
@@ -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.
index 215552ceed967ce196e6a85fefbb60148ef5bb33..4d4e676aadfa452e3a7c2bf43b249f4c7affbccb 100644 (file)
@@ -1424,10 +1424,10 @@ the smaller of @var{computed} and @code{BIGGEST_ALIGNMENT}
 
 @defmac MAX_FIXED_MODE_SIZE
 An integer expression for the size in bits of the largest integer
-machine mode that should actually be used.  All integer machine modes of
-this size or smaller can be used for structures and unions with the
-appropriate sizes.  If this macro is undefined, @code{GET_MODE_BITSIZE
-(DImode)} is assumed.
+machine mode that should actually be used by GCC internally.
+All integer machine modes of this size or smaller can be used for
+structures and unions with the appropriate sizes.  If this macro is
+undefined, @code{MAX (BITS_PER_WORD * 2, 64)} is assumed.
 @end defmac
 
 @defmac STACK_SAVEAREA_MODE (@var{save_level})
index b03ad4c97c6009030a660120826728629e84f0ca..1a51ad5481792c88121eb8af0f82910c1980fa38 100644 (file)
@@ -1251,10 +1251,10 @@ the smaller of @var{computed} and @code{BIGGEST_ALIGNMENT}
 
 @defmac MAX_FIXED_MODE_SIZE
 An integer expression for the size in bits of the largest integer
-machine mode that should actually be used.  All integer machine modes of
-this size or smaller can be used for structures and unions with the
-appropriate sizes.  If this macro is undefined, @code{GET_MODE_BITSIZE
-(DImode)} is assumed.
+machine mode that should actually be used by GCC internally.
+All integer machine modes of this size or smaller can be used for
+structures and unions with the appropriate sizes.  If this macro is
+undefined, @code{MAX (BITS_PER_WORD * 2, 64)} is assumed.
 @end defmac
 
 @defmac STACK_SAVEAREA_MODE (@var{save_level})