RFC: PATCH to consider MAX_OFILE_ALIGNMENT for targetm.absolute_biggest_alignment

Jason Merrill jason@redhat.com
Mon Sep 12 19:00:00 GMT 2016


TARGET_ABSOLUTE_BIGGEST_ALIGNMENT is documented to be the largest
alignment possible for any type or variable, and defaults to
BIGGEST_ALIGNMENT.  But MAX_OFILE_ALIGNMENT is typically much larger
than BIGGEST_ALIGNMENT, and is documented as the limit for __attribute
((aligned)).  Shouldn't it be considered in the default for
absolute_biggest_alignment?  But if we make that change, I expect that
your ACCEL_COMPILER streamer-in change would become a no-op.  What was
that change intended to accomplish?  I'm not finding anything about it
in gcc-patches.

Jason
-------------- next part --------------
commit a00ddb6492a784c192a19262780e734569866adb
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Sep 12 14:48:43 2016 -0400

            * target.def (absolute_biggest_alignment): Consider MAX_OFILE_ALIGNMENT.
            * config/i386/i386.c: Don't define TARGET_ABSOLUTE_BIGGEST_ALIGNMENT.

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 051fddb..9c2c6c4 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -50730,9 +50730,6 @@ ix86_addr_space_zero_address_valid (addr_space_t as)
 #define TARGET_OFFLOAD_OPTIONS \
   ix86_offload_options
 
-#undef TARGET_ABSOLUTE_BIGGEST_ALIGNMENT
-#define TARGET_ABSOLUTE_BIGGEST_ALIGNMENT 512
-
 #undef TARGET_OPTAB_SUPPORTED_P
 #define TARGET_OPTAB_SUPPORTED_P ix86_optab_supported_p
 
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index dc5bcd6..edb0fc8 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1011,7 +1011,7 @@ just the biggest alignment that, when violated, may cause a fault.
 @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.
+@code{MAX (BIGGEST_ALIGNMENT, MAX_OFILE_ALIGNMENT)} is used.
 @end deftypevr
 
 @defmac MALLOC_ABI_ALIGNMENT
diff --git a/gcc/target.def b/gcc/target.def
index 8509e7d..1c9fb5e 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -1931,8 +1931,8 @@ 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)
+@code{MAX (BIGGEST_ALIGNMENT, MAX_OFILE_ALIGNMENT)} is used.",
+ HOST_WIDE_INT, MAX (BIGGEST_ALIGNMENT, MAX_OFILE_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


More information about the Gcc-patches mailing list