From 28b73f7a82880e5da37cfeae97575ee7a71445cc Mon Sep 17 00:00:00 2001 From: obrien Date: Thu, 6 Jun 2002 03:36:32 +0000 Subject: [PATCH] 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) --- contrib/gcc/config/i386/i386.c | 4 ++-- contrib/gcc/config/i386/i386.h | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/contrib/gcc/config/i386/i386.c b/contrib/gcc/config/i386/i386.c index a5932219f33..3e8fc2cdeec 100644 --- a/contrib/gcc/config/i386/i386.c +++ b/contrib/gcc/config/i386/i386.c @@ -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; diff --git a/contrib/gcc/config/i386/i386.h b/contrib/gcc/config/i386/i386.h index cb3739393c4..df2f346e67e 100644 --- a/contrib/gcc/config/i386/i386.h +++ b/contrib/gcc/config/i386/i386.h @@ -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 }} -- 2.45.2