aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2002-06-16 22:18:25 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2002-06-16 20:18:25 +0000
commite932b21b1897f24e368954c6640c52808b86503c (patch)
treefd40410fb387f7e0deba976a7fe1b04099edb524
parent7ee0238171813f4ba29544a61a2da294088d7ab3 (diff)
downloadgcc-e932b21b1897f24e368954c6640c52808b86503c.zip
gcc-e932b21b1897f24e368954c6640c52808b86503c.tar.gz
gcc-e932b21b1897f24e368954c6640c52808b86503c.tar.bz2
i386-protos.h (x86_field_alignment): Declare.
* i386-protos.h (x86_field_alignment): Declare. * i386.c (x86_field_alignment): Define. * i386.h (ADJUST_FIELD_ALIGNMENT): New. (BIGGEST_FIELD_ALIGNMENT): Kill. From-SVN: r54674
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386-protos.h1
-rw-r--r--gcc/config/i386/i386.c17
-rw-r--r--gcc/config/i386/i386.h10
4 files changed, 28 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bad8dc2..84bc929 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Sun Jun 16 22:16:10 CEST 2002 Jan Hubicka <jh@suse.cz>
+
+ * i386-protos.h (x86_field_alignment): Declare.
+ * i386.c (x86_field_alignment): Define.
+ * i386.h (ADJUST_FIELD_ALIGNMENT): New.
+ (BIGGEST_FIELD_ALIGNMENT): Kill.
+
2002-06-16 Richard Henderson <rth@redhat.com>
* vax.md (casesi): Use emit_jump_insn. Tidy expander pattern.
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 1690d8a..83fe340 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -205,6 +205,7 @@ extern unsigned int i386_pe_section_type_flags PARAMS ((tree, const char *,
int));
extern void i386_pe_asm_named_section PARAMS ((const char *, unsigned int));
extern void x86_output_mi_thunk PARAMS ((FILE *, int, tree));
+extern int x86_field_alignment PARAMS ((tree, int));
#endif
extern rtx ix86_tls_get_addr PARAMS ((void));
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 44de3ca..f6b1101 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -13803,4 +13803,21 @@ x86_output_mi_thunk (file, delta, function)
}
}
+int
+x86_field_alignment (field, computed)
+ tree field;
+ int computed;
+{
+ enum machine_mode mode;
+ if (TARGET_64BIT || DECL_USER_ALIGN (field) || TARGET_ALIGN_DOUBLE)
+ return computed;
+ mode = TYPE_MODE (TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE
+ ? get_inner_array_type (field) : TREE_TYPE (field));
+ if ((mode == DFmode || mode == DCmode
+ || mode == DImode || mode == CDImode)
+ && !TARGET_ALIGN_DOUBLE)
+ return MIN (32, computed);
+ return computed;
+}
+
#include "gt-i386.h"
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 87b574b..2a85ff6 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -714,13 +714,9 @@ extern int x86_prefetch_sse;
/* The published ABIs say that doubles should be aligned on word
boundaries, so lower the aligment for structure fields unless
-malign-double is set. */
-/* BIGGEST_FIELD_ALIGNMENT is also used in libobjc, where it must be
- constant. Use the smaller value in that context. */
-#ifndef IN_TARGET_LIBS
-#define BIGGEST_FIELD_ALIGNMENT (TARGET_64BIT ? 128 : (TARGET_ALIGN_DOUBLE ? 64 : 32))
-#else
-#define BIGGEST_FIELD_ALIGNMENT 32
-#endif
+
+#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
+ x86_field_alignment (FIELD, COMPUTED)
/* If defined, a C expression to compute the alignment given to a
constant that is being placed in memory. EXP is the constant