diff mbox

[committed] AIX lcomm alignment

Message ID CAGWvny=kF8zdN6o+iZXbZtGN7withRCkhW-Gh2JJ-95cDPrKyQ@mail.gmail.com
State New
Headers show

Commit Message

David Edelsohn Dec. 5, 2014, 3:05 p.m. UTC
AIX 6.1 and above provides a section alignment argument for the local
comment pseudo-op (.lcomm) which GCC uses to implement
ASM_OUTPUT_ALIGNED_LOCAL from emit_local().  In the AIX
implementation, the first alignment for a particular CSECT name wins
-- the CSECT alignment is not the maximum alignment mentioned.

This patch adjusts the macro to encode the alignment in the CSECT
name, which creates multiple CSECTs and all objects in the CSECT have
the same alignment.  This also changes the default alignment to word
alignment.

This patch fixes some of the vector instruction testsuite failures on AIX.

Bootstrapped and regression tested on powerpc-ibm-aix7.1.0.0

Thanks, David

* config/rs6000/xcoff.h (ASM_OUTPUT_ALIGNED_LOCAL): Append alignment
to section name. Increase default alignment to word.
diff mbox

Patch

Index: config/rs6000/xcoff.h
===================================================================
--- config/rs6000/xcoff.h       (revision 218423)
+++ config/rs6000/xcoff.h       (working copy)
@@ -251,14 +251,15 @@ 
   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",    \
+        fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s%u_,%u\n", \
                  (SIZE), xcoff_bss_section_name,                       \
+                 floor_log2 ((ALIGN) / BITS_PER_UNIT),                 \
                  floor_log2 ((ALIGN) / BITS_PER_UNIT));                \
        else if ((SIZE) > 4)                                    \
-        fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s,3\n",     \
+        fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s3_,3\n",   \
                  (SIZE), xcoff_bss_section_name);              \
        else                                                    \
-        fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s\n",       \
+        fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%s,2\n",     \
                  (SIZE), xcoff_bss_section_name);              \
      } while (0)
 #endif