xcoff.h (ASM_OUTPUT_ALIGNED_COMMON): Use floor_log2.
authorDavid Edelsohn <dje.gcc@gmail.com>
Fri, 1 Feb 2013 14:14:05 +0000 (14:14 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Fri, 1 Feb 2013 14:14:05 +0000 (09:14 -0500)
        * config/rs6000/xcoff.h (ASM_OUTPUT_ALIGNED_COMMON): Use floor_log2.
        (ASM_OUTPUT_ALIGNED_LOCAL): New.

From-SVN: r195660

gcc/ChangeLog
gcc/config/rs6000/xcoff.h

index 60394c74e490d77967a05ff23b328d805e5a4255..8c37f919bb2ec1a6746018e8a3f0389ebb58e48e 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-01  David Edelsohn  <dje.gcc@gmail.com>
+
+       * config/rs6000/xcoff.h (ASM_OUTPUT_ALIGNED_COMMON): Use floor_log2.
+       (ASM_OUTPUT_ALIGNED_LOCAL): New.
+
 2013-02-01  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/56113
index bde208f4c79f0a36f0a08ca34911862d66c5d0d1..512bcb5472e8b2c6508fae68433602451cdae887 100644 (file)
        RS6000_OUTPUT_BASENAME ((FILE), (NAME));                \
        if ((ALIGN) > 32)                               \
         fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", (SIZE), \
-                 exact_log2 ((ALIGN) / BITS_PER_UNIT)); \
+                 floor_log2 ((ALIGN) / BITS_PER_UNIT)); \
        else if ((SIZE) > 4)                            \
          fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",3\n", (SIZE)); \
        else                                            \
 
 /* This says how to output an assembler line
    to define a local common symbol.
-   Alignment cannot be specified, but we can try to maintain
+   The assembler in AIX 6.1 and later supports an alignment argument.
+   For earlier releases of AIX, we try to maintain
    alignment after preceding TOC section if it was aligned
    for 64-bit mode.  */
 
 #define LOCAL_COMMON_ASM_OP "\t.lcomm "
 
+#if TARGET_AIX_VERSION >= 61
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN)      \
+  do { fputs (LOCAL_COMMON_ASM_OP, (FILE));                    \
+       RS6000_OUTPUT_BASENAME ((FILE), (NAME));                        \
+       if ((ALIGN) > 32)                                       \
+        fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s,%u\n",    \
+                 (SIZE), xcoff_bss_section_name,                       \
+                 floor_log2 ((ALIGN) / BITS_PER_UNIT));                \
+       else if ((SIZE) > 4)                                    \
+        fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s,3\n",     \
+                 (SIZE), xcoff_bss_section_name);              \
+       else                                                    \
+        fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s\n",       \
+                 (SIZE), xcoff_bss_section_name);              \
+     } while (0)
+#endif
+
 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)    \
   do { fputs (LOCAL_COMMON_ASM_OP, (FILE));            \
        RS6000_OUTPUT_BASENAME ((FILE), (NAME));                \