From: Jakub Jelinek Date: Fri, 23 Aug 2013 09:57:44 +0000 (+0200) Subject: re PR target/58218 (-mcmodel=medium cause assembler warning "ignoring incorrect secti... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=520a5868fa96c928b8004702440253ac02f64b9d;p=gcc.git re PR target/58218 (-mcmodel=medium cause assembler warning "ignoring incorrect section type for .lbss") PR target/58218 * config/i386/x86-64.h (TARGET_SECTION_TYPE_FLAGS): Define. * config/i386/i386.c (x86_64_elf_section_type_flags): New function. * gcc.target/i386/pr58218.c: New test. From-SVN: r201938 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e571e55169d..a6624ede668 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-08-23 Jakub Jelinek + + PR target/58218 + * config/i386/x86-64.h (TARGET_SECTION_TYPE_FLAGS): Define. + * config/i386/i386.c (x86_64_elf_section_type_flags): New function. + 2013-08-23 Kirill Yukhin * gcc/config/i386/predicates.md (ext_sse_reg_operand): New. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d05dbf02db0..536c35737d4 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4912,6 +4912,28 @@ x86_64_elf_select_section (tree decl, int reloc, return default_elf_select_section (decl, reloc, align); } +/* Select a set of attributes for section NAME based on the properties + of DECL and whether or not RELOC indicates that DECL's initializer + might contain runtime relocations. */ + +static unsigned int ATTRIBUTE_UNUSED +x86_64_elf_section_type_flags (tree decl, const char *name, int reloc) +{ + unsigned int flags = default_section_type_flags (decl, name, reloc); + + if (decl == NULL_TREE + && (strcmp (name, ".ldata.rel.ro") == 0 + || strcmp (name, ".ldata.rel.ro.local") == 0)) + flags |= SECTION_RELRO; + + if (strcmp (name, ".lbss") == 0 + || strncmp (name, ".lbss.", 5) == 0 + || strncmp (name, ".gnu.linkonce.lb.", 16) == 0) + flags |= SECTION_BSS; + + return flags; +} + /* Build up a unique section name, expressed as a STRING_CST node, and assign it to DECL_SECTION_NAME (decl). RELOC indicates whether the initial value of EXP requires diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h index 336343927c8..0c62723ae22 100644 --- a/gcc/config/i386/x86-64.h +++ b/gcc/config/i386/x86-64.h @@ -103,3 +103,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef TARGET_ASM_UNIQUE_SECTION #define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section + +#undef TARGET_SECTION_TYPE_FLAGS +#define TARGET_SECTION_TYPE_FLAGS x86_64_elf_section_type_flags diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c6e0653ca9e..db1c984459c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2013-08-23 Jakub Jelinek + PR target/58218 + * gcc.target/i386/pr58218.c: New test. + PR tree-optimization/58209 * gcc.c-torture/execute/pr58209.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr58218.c b/gcc/testsuite/gcc.target/i386/pr58218.c new file mode 100644 index 00000000000..4145242059f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr58218.c @@ -0,0 +1,5 @@ +/* PR target/58218 */ +/* { dg-do assemble { target lp64 } } */ +/* { dg-options "-mcmodel=medium" } */ + +struct { float x[16385]; } a = { { 0.f, } };