Commit 3b10d286 by Jakub Jelinek Committed by Jakub Jelinek

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
parent 02550985
2005-12-14 Jakub Jelinek <jakub@redhat.com>
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.
2005-12-14 Ben Elliston <bje@au.ibm.com> 2005-12-14 Ben Elliston <bje@au.ibm.com>
* c-common.c (c_common_truthvalue_conversion): Generalise warning * c-common.c (c_common_truthvalue_conversion): Generalise warning
......
...@@ -1703,6 +1703,7 @@ x86_64_elf_select_section (tree decl, int reloc, ...@@ -1703,6 +1703,7 @@ x86_64_elf_select_section (tree decl, int reloc,
&& ix86_in_large_data_p (decl)) && ix86_in_large_data_p (decl))
{ {
const char *sname = NULL; const char *sname = NULL;
unsigned int flags = SECTION_WRITE;
switch (categorize_decl_for_section (decl, reloc, flag_pic)) switch (categorize_decl_for_section (decl, reloc, flag_pic))
{ {
case SECCAT_DATA: case SECCAT_DATA:
...@@ -1722,12 +1723,14 @@ x86_64_elf_select_section (tree decl, int reloc, ...@@ -1722,12 +1723,14 @@ x86_64_elf_select_section (tree decl, int reloc,
break; break;
case SECCAT_BSS: case SECCAT_BSS:
sname = ".lbss"; sname = ".lbss";
flags |= SECTION_BSS;
break; break;
case SECCAT_RODATA: case SECCAT_RODATA:
case SECCAT_RODATA_MERGE_STR: case SECCAT_RODATA_MERGE_STR:
case SECCAT_RODATA_MERGE_STR_INIT: case SECCAT_RODATA_MERGE_STR_INIT:
case SECCAT_RODATA_MERGE_CONST: case SECCAT_RODATA_MERGE_CONST:
sname = ".lrodata"; sname = ".lrodata";
flags = 0;
break; break;
case SECCAT_SRODATA: case SECCAT_SRODATA:
case SECCAT_SDATA: case SECCAT_SDATA:
...@@ -1741,7 +1744,14 @@ x86_64_elf_select_section (tree decl, int reloc, ...@@ -1741,7 +1744,14 @@ x86_64_elf_select_section (tree decl, int reloc,
break; break;
} }
if (sname) 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); return default_elf_select_section (decl, reloc, align);
} }
......
2005-12-14 Jakub Jelinek <jakub@redhat.com>
PR target/25254
PR target/24188
* gcc.target/i386/pr25254.c: New test.
* gfortran.dg/PR24188.f: New test.
2005-12-14 David Billinghurst (David.Billinghurst@riotinto.com) 2005-12-14 David Billinghurst (David.Billinghurst@riotinto.com)
* lib/fortran-torture.exp: Catch remaining uses of * lib/fortran-torture.exp: Catch remaining uses of
/* PR target/25254 */
/* { dg-do compile { target lp64 } } */
/* { dg-options "-mcmodel=medium -mlarge-data-threshold=1" } */
const struct { int i; int j; } c = { 2, 6 };
const char *
foo (void)
{
return "OK";
}
C PR target/24188
C { dg-do compile }
C { dg-options "-O2" }
C { dg-options "-O2 -mcmodel=medium" { target { x86_64-*-* && lp64 } } }
C { dg-options "-O2 -mcmodel=medium" { target { i?86-*-* && lp64 } } }
WRITE(6,*) ''
END
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment