Implement "-mno-align-long-strings" which prevents pessimization of strings

for space.  -Os could do this, but it was easy to hack an MD version.
This saves a whole 32 bytes in boot2, so I think it is worth using it.
(keep how much worse gcc 3.2 will compile boot2...)

Submitted by:	bde (minus gcc 3.2 commentary)
This commit is contained in:
David E. O'Brien 2002-06-06 03:36:32 +00:00
parent a56822dd07
commit 670fd7ad58
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97911
2 changed files with 9 additions and 2 deletions

View File

@ -10632,8 +10632,8 @@ ix86_constant_alignment (exp, align)
else if (ALIGN_MODE_128 (TYPE_MODE (TREE_TYPE (exp))) && align < 128)
return 128;
}
else if (TREE_CODE (exp) == STRING_CST && TREE_STRING_LENGTH (exp) >= 31
&& align < 256)
else if (TREE_CODE (exp) == STRING_CST && !TARGET_NO_ALIGN_LONG_STRINGS
&& TREE_STRING_LENGTH (exp) >= 31 && align < 256)
return 256;
return align;

View File

@ -138,6 +138,7 @@ extern int target_flags;
#define MASK_64BIT 0x02000000 /* Produce 64bit code */
/* ... overlap with subtarget options starts by 0x04000000. */
#define MASK_NO_RED_ZONE 0x04000000 /* Do not use red zone */
#define MASK_NO_ALIGN_LONG_STRINGS 0x08000000 /* Do not align long strings specially */
/* Use the floating point instructions */
#define TARGET_80387 (target_flags & MASK_80387)
@ -286,6 +287,8 @@ extern int x86_prefetch_sse;
#define TARGET_RED_ZONE (!(target_flags & MASK_NO_RED_ZONE))
#define TARGET_NO_ALIGN_LONG_STRINGS (target_flags & MASK_NO_ALIGN_LONG_STRINGS)
/* WARNING: Do not mark empty strings for translation, as calling
gettext on an empty string does NOT return an empty
string. */
@ -384,6 +387,10 @@ extern int x86_prefetch_sse;
N_("Use red-zone in the x86-64 code") }, \
{ "no-red-zone", MASK_NO_RED_ZONE, \
N_("Do not use red-zone in the x86-64 code") }, \
{ "no-align-long-strings", MASK_NO_ALIGN_LONG_STRINGS, \
N_("Do not align long strings specially") }, \
{ "align-long-strings", -MASK_NO_ALIGN_LONG_STRINGS, \
N_("Align strings longer than 30 on a 32-byte boundary") }, \
SUBTARGET_SWITCHES \
{ "", TARGET_DEFAULT, 0 }}