summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-05-17 23:00:05 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-05-17 23:00:05 +0000
commitf7d6703c5d83fc9fb06246d6eb49e9b61098045c (patch)
tree57adeaca11a81e869dded7cdb7caaa2c7bfb2115 /gcc
parent4899654eef097d074b37a9a07098c66ad2e59800 (diff)
downloadgcc-f7d6703c5d83fc9fb06246d6eb49e9b61098045c.tar.gz
* i386.h (ALIGN_DFmode): Delete.
(CONSTANT_ALIGNMENT): Define. * varasm.c (force_const_mem): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19823 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/i386.h26
-rw-r--r--gcc/varasm.c4
3 files changed, 34 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 07cb2379722..e2cbd10b628 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Sun May 17 23:59:45 1998 John Wehle (john@feith.com)
+
+ * i386.h (ALIGN_DFmode): Delete.
+ (CONSTANT_ALIGNMENT): Define.
+ * varasm.c (force_const_mem): Use it.
+
Sun May 17 19:31:05 1998 Richard Henderson <rth@cygnus.com>
* alpha.c (alpha_emit_conditional_branch): Clear cmp_code after
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 1053bd9c242..b55ffccb986 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -419,8 +419,30 @@ extern int ix86_arch;
aligned on 64 bit boundaries. */
#define BIGGEST_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)
-/* align DFmode constants and nonaggregates */
-#define ALIGN_DFmode (!TARGET_386)
+/* If defined, a C expression to compute the alignment given to a
+ constant that is being placed in memory. CONSTANT is the constant
+ and ALIGN is the alignment that the object would ordinarily have.
+ The value of this macro is used instead of that alignment to align
+ the object.
+
+ If this macro is not defined, then ALIGN is used.
+
+ The typical use of this macro is to increase alignment for string
+ constants to be word aligned so that `strcpy' calls that copy
+ constants can be done inline. */
+
+#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
+ (TREE_CODE (EXP) == REAL_CST \
+ ? ((TYPE_MODE (TREE_TYPE (EXP)) == DFmode && (ALIGN) < 64) \
+ ? 64 \
+ : (TYPE_MODE (TREE_TYPE (EXP)) == XFmode && (ALIGN) < 128) \
+ ? 128 \
+ : (ALIGN)) \
+ : TREE_CODE (EXP) == STRING_CST \
+ ? ((TREE_STRING_LENGTH (EXP) >= 31 && (ALIGN) < 256) \
+ ? 256 \
+ : (ALIGN)) \
+ : (ALIGN))
/* If defined, a C expression to compute the alignment for a static
variable. TYPE is the data type, and ALIGN is the alignment that
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 867ae1f1713..9951a50d31e 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -3417,6 +3417,10 @@ force_const_mem (mode, x)
align = (mode == VOIDmode) ? UNITS_PER_WORD : GET_MODE_SIZE (mode);
if (align > BIGGEST_ALIGNMENT / BITS_PER_UNIT)
align = BIGGEST_ALIGNMENT / BITS_PER_UNIT;
+#ifdef CONSTANT_ALIGNMENT
+ align = CONSTANT_ALIGNMENT (make_tree (type_for_mode (mode, 0), x),
+ align * BITS_PER_UNIT) / BITS_PER_UNIT;
+#endif
pool_offset += align - 1;
pool_offset &= ~ (align - 1);