Define ASM_OUTPUT_ALIGNED_DECL_LOCAL for large local common symbol.

gcc/ChangeLog:

        * config/i386/x86-64.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): New.

gcc/testsuite/ChangeLog:

        * gcc.target/i386/pr95620.c: New test.
---
 gcc/config/i386/x86-64.h                | 11 +++++++++++
 gcc/testsuite/gcc.target/i386/pr95620.c | 19 +++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr95620.c

diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h
index 88db428f592..0c5b8af5a13 100644
--- a/gcc/config/i386/x86-64.h
+++ b/gcc/config/i386/x86-64.h
@@ -59,6 +59,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
 #define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN)          
\
   x86_elf_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN);
 
+#undef  ASM_OUTPUT_ALIGNED_DECL_LOCAL
+#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN)  \
+  do                                                                 \
+    {                                                                \
+      fprintf ((FILE), "%s", LOCAL_ASM_OP);                          \
+      assemble_name ((FILE), (NAME));                                \
+      fprintf ((FILE), "\n");                                        \
+      ASM_OUTPUT_ALIGNED_DECL_COMMON (FILE, DECL, NAME, SIZE, ALIGN); \
+    }                                                                \
+  while (0)
+
 /* This is used to align code labels according to Intel recommendations.  */
 
 #define SUBALIGN_LOG 3
diff --git a/gcc/testsuite/gcc.target/i386/pr95620.c 
b/gcc/testsuite/gcc.target/i386/pr95620.c
new file mode 100644
index 00000000000..ac9b40383e7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95620.c
@@ -0,0 +1,19 @@
+/* { dg-do assemble { target lp64 } } */
+/* { dg-require-effective-target fopenmp } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto -fopenmp -mcmodel=medium" } */
+
+double a[353783808];
+int b, c, d;
+
+int
+main()
+{
+  for (; b;)
+#pragma omp parallel
+    a[c] = 1;
+  for (;; b++)
+    if (a[c])
+      d++;
+  return 0;
+}
-- 
2.26.2

Reply via email to