diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-12-14 12:00:50 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2005-12-14 12:00:50 +0100 |
commit | 3b10d286080e96f54509e7be39d5791da2527e01 (patch) | |
tree | 30fc47663bc7fc1421fbecedb0b2c6d00716536e /gcc/config/i386 | |
parent | 025509856a4457d15401a5d69962f451b23281c3 (diff) | |
download | gcc-3b10d286080e96f54509e7be39d5791da2527e01.zip gcc-3b10d286080e96f54509e7be39d5791da2527e01.tar.gz gcc-3b10d286080e96f54509e7be39d5791da2527e01.tar.bz2 |
re PR target/25254 (ICE with -mcmodel=medium -mlarge-data-threshold=1)
PR target/25254
PR target/24188
* config/i386/i386.c (x86_64_elf_select_section): If DECL is not
DECL_P, call get_section rather than get_named_section. Supply
section flags to it.
* gcc.target/i386/pr25254.c: New test.
* gfortran.dg/PR24188.f: New test.
From-SVN: r108506
Diffstat (limited to 'gcc/config/i386')
-rw-r--r-- | gcc/config/i386/i386.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 079ead8..33b9c6f 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1703,6 +1703,7 @@ x86_64_elf_select_section (tree decl, int reloc, && ix86_in_large_data_p (decl)) { const char *sname = NULL; + unsigned int flags = SECTION_WRITE; switch (categorize_decl_for_section (decl, reloc, flag_pic)) { case SECCAT_DATA: @@ -1722,12 +1723,14 @@ x86_64_elf_select_section (tree decl, int reloc, break; case SECCAT_BSS: sname = ".lbss"; + flags |= SECTION_BSS; break; case SECCAT_RODATA: case SECCAT_RODATA_MERGE_STR: case SECCAT_RODATA_MERGE_STR_INIT: case SECCAT_RODATA_MERGE_CONST: sname = ".lrodata"; + flags = 0; break; case SECCAT_SRODATA: case SECCAT_SDATA: @@ -1741,7 +1744,14 @@ x86_64_elf_select_section (tree decl, int reloc, break; } if (sname) - return get_named_section (decl, sname, reloc); + { + /* We might get called with string constants, but get_named_section + doesn't like them as they are not DECLs. Also, we need to set + flags in that case. */ + if (!DECL_P (decl)) + return get_section (sname, flags, NULL); + return get_named_section (decl, sname, reloc); + } } return default_elf_select_section (decl, reloc, align); } |