2015-11-18 Andreas Tobler <andreast@gcc.gnu.org>
authorandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Nov 2015 20:48:18 +0000 (20:48 +0000)
committerandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Nov 2015 20:48:18 +0000 (20:48 +0000)
    * config/i386/freebsd.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Bring in the
    commit from r125920 for FreeBSD.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230565 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/freebsd.h

index 635de67..8bf60bb 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-18  Andreas Tobler  <andreast@gcc.gnu.org>
+
+       * config/i386/freebsd.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Bring in the
+       commit from r125920 for FreeBSD.
+
 2015-11-18  Jason Merrill  <jason@redhat.com>
 
        * ggc-page.c (ggc_globals): Change finalizers and vec_finalizers
index db7dd7f..78d5e19 100644 (file)
@@ -98,11 +98,21 @@ along with GCC; see the file COPYING3.  If not see
 
 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
 #undef  ASM_OUTPUT_MAX_SKIP_ALIGN
-#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP)                                 \
-  if ((LOG) != 0) {                                                                                                            \
-    if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG));   \
-    else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));   \
-  }
+#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP)                   \
+  do {                                                                 \
+    if ((LOG) != 0) {                                                  \
+      if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
+      else {                                                           \
+       fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP));     \
+       /* Make sure that we have at least 8 byte alignment if > 8 byte \
+          alignment is preferred.  */                                  \
+       if ((LOG) > 3                                                   \
+           && (1 << (LOG)) > ((MAX_SKIP) + 1)                          \
+           && (MAX_SKIP) >= 7)                                         \
+         fputs ("\t.p2align 3\n", (FILE));                             \
+      }                                                                        \
+    }                                                                  \
+  } while (0)
 #endif
 
 /* Don't default to pcc-struct-return, we want to retain compatibility with