This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH,committed] Define ASM_OUTPUT_ALIGNED_LOCAL for AIX
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 1 Feb 2013 09:11:57 -0500
- Subject: [PATCH,committed] Define ASM_OUTPUT_ALIGNED_LOCAL for AIX
AIX 6.1 added an alignment argument to the .lcomm pseudo-op. This
fixes many of the remaining Altivec failures on AIX where GCC was
generating a zero vector in BSS, but the block was not appropriately
aligned.
I also took the opportunity to change ASM_OUTPUT_ALIGNED_COMMON use of
exact_log2 to floor_log2.
* config/rs6000/xcoff.h (ASM_OUTPUT_ALIGNED_COMMON): Use floor_log2.
(ASM_OUTPUT_ALIGNED_LOCAL): New.
Bootstrapped on powerpc-ibm-aix7.1.0.0.
Thanks, David
Index: xcoff.h
===================================================================
--- xcoff.h (revision 195639)
+++ xcoff.h (working copy)
@@ -283,7 +283,7 @@
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 \
@@ -292,12 +292,30 @@
/* 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)); \