aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2015-02-21 00:06:53 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2015-02-21 00:06:53 +0000
commit6d2b71997e784ec8fc63de0844c52a113c1482b7 (patch)
treec6a8b3a34b2171dafac01246049225405321ae9b
parentb56ac9d5f41fc799b25397d2236e76c47893e128 (diff)
downloadgcc-6d2b71997e784ec8fc63de0844c52a113c1482b7.zip
gcc-6d2b71997e784ec8fc63de0844c52a113c1482b7.tar.gz
gcc-6d2b71997e784ec8fc63de0844c52a113c1482b7.tar.bz2
tree-streamer-in.c (unpack_ts_decl_common_value_fields, [...]): If ACCEL_COMPILER, restrict alignments to absolute_biggest_alignment.
* tree-streamer-in.c (unpack_ts_decl_common_value_fields, unpack_ts_type_common_value_fields): If ACCEL_COMPILER, restrict alignments to absolute_biggest_alignment. * config/i386/i386.c (TARGET_ABSOLUTE_BIGGEST_ALIGNMENT): Define. * doc/tm.texi.in (TARGET_ABSOLUTE_BIGGEST_ALIGNMENT): Add. * doc/tm.texi: Regenerate. * target.def (absolute_biggest_alignment): New DEFHOOKPOD. From-SVN: r220882
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/i386/i386.c3
-rw-r--r--gcc/config/i386/i386.h5
-rw-r--r--gcc/doc/tm.texi6
-rw-r--r--gcc/doc/tm.texi.in2
-rw-r--r--gcc/target.def7
-rw-r--r--gcc/tree-streamer-in.c9
7 files changed, 41 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dad8489..9febcbd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2015-02-20 Bernd Schmidt <bernds@codesourcery.com>
+
+ * tree-streamer-in.c (unpack_ts_decl_common_value_fields,
+ unpack_ts_type_common_value_fields): If ACCEL_COMPILER,
+ restrict alignments to absolute_biggest_alignment.
+ * config/i386/i386.c (TARGET_ABSOLUTE_BIGGEST_ALIGNMENT):
+ Define.
+ * doc/tm.texi.in (TARGET_ABSOLUTE_BIGGEST_ALIGNMENT): Add.
+ * doc/tm.texi: Regenerate.
+ * target.def (absolute_biggest_alignment): New DEFHOOKPOD.
+
2015-02-20 Vladimir Makarov <vmakarov@redhat.com>
PR target/64172
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 71a5b22..6620021 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -52131,6 +52131,9 @@ ix86_initialize_bounds (tree var, tree lb, tree ub, tree *stmts)
#define TARGET_OFFLOAD_OPTIONS \
ix86_offload_options
+#undef TARGET_ABSOLUTE_BIGGEST_ALIGNMENT
+#define TARGET_ABSOLUTE_BIGGEST_ALIGNMENT 512
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-i386.h"
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 5d1e5e0..1e755d3 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -795,7 +795,10 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
rounder than this.
Pentium+ prefers DFmode values to be aligned to 64 bit boundary
- and Pentium Pro XFmode values at 128 bit boundaries. */
+ and Pentium Pro XFmode values at 128 bit boundaries.
+
+ When increasing the maximum, also update
+ TARGET_ABSOLUTE_BIGGEST_ALIGNMENT. */
#define BIGGEST_ALIGNMENT \
(TARGET_AVX512F ? 512 : (TARGET_AVX ? 256 : 128))
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 048a28a..6f36ec6 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1003,6 +1003,12 @@ bits. Note that this is not the biggest alignment that is supported,
just the biggest alignment that, when violated, may cause a fault.
@end defmac
+@deftypevr {Target Hook} HOST_WIDE_INT TARGET_ABSOLUTE_BIGGEST_ALIGNMENT
+If defined, this target hook specifies the absolute biggest alignment
+that a type or variable can have on this machine, otherwise,
+@code{BIGGEST_ALIGNMENT} is used.
+@end deftypevr
+
@defmac MALLOC_ABI_ALIGNMENT
Alignment, in bits, a C conformant malloc implementation has to
provide. If not defined, the default value is @code{BITS_PER_WORD}.
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index edad99c..121c305 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -957,6 +957,8 @@ bits. Note that this is not the biggest alignment that is supported,
just the biggest alignment that, when violated, may cause a fault.
@end defmac
+@hook TARGET_ABSOLUTE_BIGGEST_ALIGNMENT
+
@defmac MALLOC_ABI_ALIGNMENT
Alignment, in bits, a C conformant malloc implementation has to
provide. If not defined, the default value is @code{BITS_PER_WORD}.
diff --git a/gcc/target.def b/gcc/target.def
index 356f7c1..035dece 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -1868,6 +1868,13 @@ recorded in the offload function and variable table.",
void, (tree),
hook_void_tree)
+DEFHOOKPOD
+(absolute_biggest_alignment,
+ "If defined, this target hook specifies the absolute biggest alignment\n\
+that a type or variable can have on this machine, otherwise,\n\
+@code{BIGGEST_ALIGNMENT} is used.",
+ HOST_WIDE_INT, BIGGEST_ALIGNMENT)
+
/* Allow target specific overriding of option settings after options have
been changed by an attribute or pragma or when it is reset at the
end of the code affected by an attribute or pragma. */
diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c
index 506e676..b4b6482 100644
--- a/gcc/tree-streamer-in.c
+++ b/gcc/tree-streamer-in.c
@@ -247,7 +247,10 @@ unpack_ts_decl_common_value_fields (struct bitpack_d *bp, tree expr)
DECL_EXTERNAL (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_GIMPLE_REG_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_ALIGN (expr) = (unsigned) bp_unpack_var_len_unsigned (bp);
-
+#ifdef ACCEL_COMPILER
+ if (DECL_ALIGN (expr) > targetm.absolute_biggest_alignment)
+ DECL_ALIGN (expr) = targetm.absolute_biggest_alignment;
+#endif
if (TREE_CODE (expr) == LABEL_DECL)
{
EH_LANDING_PAD_NR (expr) = (int) bp_unpack_var_len_unsigned (bp);
@@ -391,6 +394,10 @@ unpack_ts_type_common_value_fields (struct bitpack_d *bp, tree expr)
TYPE_READONLY (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_PRECISION (expr) = bp_unpack_var_len_unsigned (bp);
TYPE_ALIGN (expr) = bp_unpack_var_len_unsigned (bp);
+#ifdef ACCEL_COMPILER
+ if (TYPE_ALIGN (expr) > targetm.absolute_biggest_alignment)
+ TYPE_ALIGN (expr) = targetm.absolute_biggest_alignment;
+#endif
TYPE_ALIAS_SET (expr) = bp_unpack_var_len_int (bp);
}