diff mbox series

[AIX] rs6000 output_aligned_decl_common fix

Message ID CAGWvny=Xzi8eWMvROcKYt6UQ-hWXHY4XS_TTx+JzKEUuqiXDdg@mail.gmail.com
State New
Headers show
Series [AIX] rs6000 output_aligned_decl_common fix | expand

Commit Message

David Edelsohn Oct. 12, 2017, 12:03 a.m. UTC
GCC toplev.c uses ASM_OUTPUT_ALIGNED_DECL_COMMON with a NULL decl to
emit the LTO marker, so the rs6000 implementation needs to test for
that situation.  config/darwin.c tests similarly.  With this patch,
gcc -flto produces correct output on AIX.

Bootstrapped on powerpc-ibm-aix7.2.0.0

Thanks, David

* config/rs6000/rs6000.c
(rs6000_xcoff_asm_output_aligned_decl_common): Test for NULL decl.
diff mbox series

Patch

Index: rs6000.c
===================================================================
--- rs6000.c    (revision 253666)
+++ rs6000.c    (working copy)
@@ -34375,7 +34375,8 @@  rs6000_xcoff_asm_output_aligned_decl_common (FILE
           size, align2);

 #ifdef HAVE_GAS_HIDDEN
-  fputs (rs6000_xcoff_visibility (decl), stream);
+  if (decl != NULL)
+    fputs (rs6000_xcoff_visibility (decl), stream);
 #endif
   putc ('\n', stream);
 }