darwin9.h (ASM_OUTPUT_ALIGNED_COMMON): Add.
authorMike Stump <mrs@apple.com>
Thu, 29 Mar 2007 01:44:26 +0000 (01:44 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Thu, 29 Mar 2007 01:44:26 +0000 (01:44 +0000)
* config/darwin9.h (ASM_OUTPUT_ALIGNED_COMMON): Add.
* config/darwin.h (MAX_OFILE_ALIGNMENT): Fix.

testsuite:
* gcc.dg/darwin-comm.c: Add.

From-SVN: r123321

gcc/ChangeLog
gcc/config/darwin.h
gcc/config/darwin9.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/darwin-comm.c [new file with mode: 0644]

index 1df143557aa055f2b6dedf284463e489e7422e18..380c5339219bec43316671ed7cb3220a37ba781d 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-28  Mike Stump  <mrs@apple.com>
+
+       * config/darwin9.h (ASM_OUTPUT_ALIGNED_COMMON): Add.
+       * config/darwin.h (MAX_OFILE_ALIGNMENT): Fix.
+
 2007-03-28  Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
 
        * config.gcc: Accept barcelona as a variant of amdfam10.
index 07cc7767a65b788bec86f57b289745317f9dbec7..6512a0f5aedc52df4913752eafd463d734c7a889 100644 (file)
@@ -674,11 +674,11 @@ extern GTY(()) int darwin_ms_struct;
       }                                                                        \
   } while (0)
 
-/* The maximum alignment which the object file format can support.
-   For Mach-O, this is 2^15.  */
+/* The maximum alignment which the object file format can support in
+   bits.  For Mach-O, this is 2^15 bytes.  */
 
 #undef MAX_OFILE_ALIGNMENT
-#define MAX_OFILE_ALIGNMENT 0x8000
+#define MAX_OFILE_ALIGNMENT (0x8000 * 8)
 
 /* Declare the section variables.  */
 #ifndef USED_FOR_TARGET
index 7431cfb1ed76faf89d6c78dc5707d6cc50e31075..522bbcdeb8234a3e22adb57bac2e545af43cc5a6 100644 (file)
 
 /* The linker can generate branch islands.  */
 #define DARWIN_LINKER_GENERATES_ISLANDS 1
+
+#undef  ASM_OUTPUT_ALIGNED_COMMON
+#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)             \
+  do {                                                                 \
+    unsigned HOST_WIDE_INT _new_size = SIZE;                           \
+    fprintf ((FILE), ".comm ");                                                \
+    assemble_name ((FILE), (NAME));                                    \
+    if (_new_size == 0) _new_size = 1;                                 \
+    fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",           \
+            (SIZE), floor_log2 ((ALIGN) / BITS_PER_UNIT));             \
+  } while (0)
index a869fb60fbef4f015ab1614039e0e704f0f7d50a..91b8a6019553fee72697c385017200e88c386fbc 100644 (file)
@@ -1,3 +1,7 @@
+2007-03-28  Mike Stump  <mrs@apple.com>
+
+       * gcc.dg/darwin-comm.c: Add.
+
 2007-03-28  Eric Christopher  <echristo@apple.com>
 
        * lib/target-supports.exp (check_effective_target_fstack_protector): New.
diff --git a/gcc/testsuite/gcc.dg/darwin-comm.c b/gcc/testsuite/gcc.dg/darwin-comm.c
new file mode 100644 (file)
index 0000000..74d5086
--- /dev/null
@@ -0,0 +1,4 @@
+/* { dg-do compile { target *-*-darwin9* } } */
+/* { dg-final { scan-assembler ".comm _foo,1,15" } } */
+
+char foo __attribute__ ((aligned(32768)));