summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/config
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-06-06 03:36:32 +0000
committerobrien <obrien@FreeBSD.org>2002-06-06 03:36:32 +0000
commit28b73f7a82880e5da37cfeae97575ee7a71445cc (patch)
treea364ba3e5cc51bf3a2f3c77f205ab504b2576c01 /contrib/gcc/config
parent4699cf5d0b985289e66c79cd98b19f310c553839 (diff)
downloadFreeBSD-src-28b73f7a82880e5da37cfeae97575ee7a71445cc.zip
FreeBSD-src-28b73f7a82880e5da37cfeae97575ee7a71445cc.tar.gz
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)
Diffstat (limited to 'contrib/gcc/config')
-rw-r--r--contrib/gcc/config/i386/i386.c4
-rw-r--r--contrib/gcc/config/i386/i386.h7
2 files changed, 9 insertions, 2 deletions
diff --git a/contrib/gcc/config/i386/i386.c b/contrib/gcc/config/i386/i386.c
index a593221..3e8fc2c 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 cb37393..df2f346 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 }}
OpenPOWER on IntegriCloud