diff options
author | Alan Modra <amodra@gmail.com> | 2013-05-10 10:36:49 +0930 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2013-05-10 10:36:49 +0930 |
commit | ebc9a431c48079f6ad0f794c1a91f4838250fcbc (patch) | |
tree | ed3a68d4a1dfebd13840f02ab890d9c6cd74e803 | |
parent | 65267ae9567a0c3f1d3ba6056ac28179a06e97de (diff) | |
download | gcc-ebc9a431c48079f6ad0f794c1a91f4838250fcbc.zip gcc-ebc9a431c48079f6ad0f794c1a91f4838250fcbc.tar.gz gcc-ebc9a431c48079f6ad0f794c1a91f4838250fcbc.tar.bz2 |
re PR target/55033 (PowerPC section type conflict error)
PR target/55033
* varasm.c (default_elf_select_section): Move !DECL_P check..
(get_named_section): ..to here before calling get_section_name.
Adjust assertion.
(default_section_type_flags): Add DECL_P check.
* config/i386/winnt.c (i386_pe_section_type_flags): Likewise.
* config/rs6000/rs6000.c (rs6000_xcoff_section_type_flags): Likewise.
From-SVN: r198762
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/config/i386/winnt.c | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 2 | ||||
-rw-r--r-- | gcc/varasm.c | 12 |
4 files changed, 19 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fe4c00a..f1ffb43 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2013-05-10 Alan Modra <amodra@gmail.com> + + PR target/55033 + * varasm.c (default_elf_select_section): Move !DECL_P check.. + (get_named_section): ..to here before calling get_section_name. + Adjust assertion. + (default_section_type_flags): Add DECL_P check. + * config/i386/winnt.c (i386_pe_section_type_flags): Likewise. + * config/rs6000/rs6000.c (rs6000_xcoff_section_type_flags): Likewise. + 2013-05-09 Joern Rennecke <joern.rennecke@embecosm.com> * config/epiphany/epiphany.c (epiphany_expand_prologue): diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index c8002f6..f0f972c 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -476,7 +476,7 @@ i386_pe_section_type_flags (tree decl, const char *name, int reloc) flags |= SECTION_PE_SHARED; } - if (decl && DECL_ONE_ONLY (decl)) + if (decl && DECL_P (decl) && DECL_ONE_ONLY (decl)) flags |= SECTION_LINKONCE; /* See if we already have an entry for this section. */ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index b30d47d..e82b24e 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -26029,7 +26029,7 @@ rs6000_xcoff_section_type_flags (tree decl, const char *name, int reloc) unsigned int flags = default_section_type_flags (decl, name, reloc); /* Align to at least UNIT size. */ - if (flags & SECTION_CODE || !decl) + if ((flags & SECTION_CODE) != 0 || !decl || !DECL_P (decl)) align = MIN_UNITS_PER_WORD; else /* Increase alignment of large objects if not already stricter. */ diff --git a/gcc/varasm.c b/gcc/varasm.c index 2532d80..6fb49cf 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -402,12 +402,16 @@ get_named_section (tree decl, const char *name, int reloc) { unsigned int flags; - gcc_assert (!decl || DECL_P (decl)); if (name == NULL) - name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); + { + gcc_assert (decl && DECL_P (decl) && DECL_SECTION_NAME (decl)); + name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); + } flags = targetm.section_type_flags (decl, name, reloc); + if (decl && !DECL_P (decl)) + decl = NULL_TREE; return get_section (name, flags, decl); } @@ -5990,7 +5994,7 @@ default_section_type_flags (tree decl, const char *name, int reloc) flags |= SECTION_RELRO; } - if (decl && DECL_ONE_ONLY (decl)) + if (decl && DECL_P (decl) && DECL_ONE_ONLY (decl)) flags |= SECTION_LINKONCE; if (decl && TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL_P (decl)) @@ -6349,8 +6353,6 @@ default_elf_select_section (tree decl, int reloc, gcc_unreachable (); } - if (!DECL_P (decl)) - decl = NULL_TREE; return get_named_section (decl, sname, reloc); } |