Commit 9adeb64a by Jakub Jelinek Committed by Jakub Jelinek

re PR target/83100 (powerpc: internal compiler error: in get_variable_section,…

re PR target/83100 (powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections)

	PR target/83100
	* varasm.c (bss_initializer_p): Return true for DECL_COMMON
	TREE_READONLY decls.

	* gcc.dg/pr83100-1.c: New test.
	* gcc.dg/pr83100-2.c: New test.
	* gcc.dg/pr83100-3.c: New test.
	* gcc.dg/pr83100-4.c: New test.

From-SVN: r255160
parent 99282f81
2017-11-27 Jakub Jelinek <jakub@redhat.com>
PR target/83100
* varasm.c (bss_initializer_p): Return true for DECL_COMMON
TREE_READONLY decls.
2017-11-27 Markus Trippelsdorf <markus@trippelsdorf.de> 2017-11-27 Markus Trippelsdorf <markus@trippelsdorf.de>
PR rtl-optimization/82488 PR rtl-optimization/82488
2017-11-27 Jakub Jelinek <jakub@redhat.com>
PR target/83100
* gcc.dg/pr83100-1.c: New test.
* gcc.dg/pr83100-2.c: New test.
* gcc.dg/pr83100-3.c: New test.
* gcc.dg/pr83100-4.c: New test.
2017-11-26 Julia Koval <julia.koval@intel.com> 2017-11-26 Julia Koval <julia.koval@intel.com>
* gcc.target/i386/funcspec-56.inc: Handle new march. * gcc.target/i386/funcspec-56.inc: Handle new march.
......
/* PR target/83100 */
/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fcommon -fdata-sections" } */
const int a;
/* { dg-final { scan-assembler "comm" } } */
/* PR target/83100 */
/* { dg-do run } */
/* { dg-options "-O2 -fcommon -fdata-sections" } */
/* { dg-additional-sources pr83100-3.c } */
/* { dg-skip-if "-fdata-sections not supported" { hppa*-*-hpux* nvptx-*-* } } */
const int a;
int
main ()
{
if (a != 7)
__builtin_abort ();
return 0;
}
/* PR target/83100 */
/* { dg-do compile } */
/* { dg-options "-O2 -fcommon -fdata-sections" } */
/* { dg-skip-if "-fdata-sections not supported" { hppa*-*-hpux* nvptx-*-* } } */
const int a = 7;
/* PR target/83100 */
/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
/* { dg-options "-O2 -fno-common -fdata-sections" } */
const int a;
/* { dg-final { scan-assembler "rodata.a" { target i?86-*-* x86_64-*-* } } } */
...@@ -986,9 +986,9 @@ decode_reg_name (const char *name) ...@@ -986,9 +986,9 @@ decode_reg_name (const char *name)
bool bool
bss_initializer_p (const_tree decl) bss_initializer_p (const_tree decl)
{ {
/* Do not put constants into the .bss section, they belong in a readonly /* Do not put non-common constants into the .bss section, they belong in
section. */ a readonly section. */
return (!TREE_READONLY (decl) return ((!TREE_READONLY (decl) || DECL_COMMON (decl))
&& (DECL_INITIAL (decl) == NULL && (DECL_INITIAL (decl) == NULL
/* In LTO we have no errors in program; error_mark_node is used /* In LTO we have no errors in program; error_mark_node is used
to mark offlined constructors. */ to mark offlined constructors. */
......
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