From 04a751889435ce14f2aca6880add30c2ff3319e3 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Wed, 15 Sep 2004 22:16:33 +0000 Subject: [PATCH] varasm.c (default_function_rdodata_section): Make sure to pass along a decl for a link-once section. * varasm.c (default_function_rdodata_section): Make sure to pass along a decl for a link-once section. * g++.dg/opt/switch1.C: New test. From-SVN: r87569 --- gcc/ChangeLog | 5 +++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/opt/switch1.C | 23 +++++++++++++++++++++++ gcc/varasm.c | 2 +- 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/opt/switch1.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 175bd11e046..d9620165672 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-09-15 Mark Mitchell + + * varasm.c (default_function_rdodata_section): Make sure to pass + along a decl for a link-once section. + 2004-09-15 Richard Henderson * tree-ssa-operands.c (add_call_clobber_ops): Fix unused variable diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e04c94049e0..f9dfb7f6751 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-09-15 Mark Mitchell + + * g++.dg/opt/switch1.C: New test. + 2004-09-15 Joseph S. Myers * g++.dg/ext/member-attr.C, g++.dg/warn/deprecated.C, diff --git a/gcc/testsuite/g++.dg/opt/switch1.C b/gcc/testsuite/g++.dg/opt/switch1.C new file mode 100644 index 00000000000..c21630d752b --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/switch1.C @@ -0,0 +1,23 @@ +// { dg-options "-O1" } + +template +int f(T t) { + switch (t) { + case 1: + return 5; + case 2: + return 6; + case 3: + return -4; + case 4: + return 8; + case 5: + return 12; + case 6: + return 13; + default: + return -27; + } +} + +template int f(int); diff --git a/gcc/varasm.c b/gcc/varasm.c index b5362b92001..05d60eb44d1 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -600,7 +600,7 @@ default_function_rodata_section (tree decl) memcpy (rname, name, len); rname[14] = 'r'; - named_section_flags (rname, SECTION_LINKONCE); + named_section_real (rname, SECTION_LINKONCE, decl); return; } /* For .text.foo we want to use .rodata.foo. */ -- 2.30.2