From d39132ea9b9d1a740bfc169326020fc28d78ba81 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Tue, 19 Apr 2011 13:04:57 +0000 Subject: [PATCH] re PR debug/48207 (ICE in lhd_set_decl_assembler_name, at langhooks.c:158) 2011-04-19 Richard Guenther PR lto/48207 * tree.c (free_lang_data): Do not reset the decl-assembler-name langhook. * g++.dg/lto/pr48207_0.C: New testcase. From-SVN: r172708 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/lto/pr48207_0.C | 13 +++++++++++++ gcc/tree.c | 7 ++++++- 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/lto/pr48207_0.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b119fa766a5..14ed70733ca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-04-19 Richard Guenther + + PR lto/48207 + * tree.c (free_lang_data): Do not reset the decl-assembler-name + langhook. + 2011-04-19 Eric Botcazou * tree-inline.c (expand_call_inline): Do not issue a -Winline warning diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 497fd4dadae..69737234c9a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-04-19 Richard Guenther + + PR lto/48207 + * g++.dg/lto/pr48207_0.C: New testcase. + 2011-04-18 Jason Merrill * g++.dg/init/void1.C: New. diff --git a/gcc/testsuite/g++.dg/lto/pr48207_0.C b/gcc/testsuite/g++.dg/lto/pr48207_0.C new file mode 100644 index 00000000000..e66cb491b49 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr48207_0.C @@ -0,0 +1,13 @@ +// { dg-lto-do link } +// { dg-lto-options { { -flto -g } } } + +void bar(int) {} + +void foo(void) +{ + typedef enum { ABC } DEF; + DEF a; + bar((int)a); +} + +int main() {} diff --git a/gcc/tree.c b/gcc/tree.c index 57e8e684ad6..d0c18b17ae2 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -5176,7 +5176,12 @@ free_lang_data (void) lang_hooks.callgraph.analyze_expr = NULL; lang_hooks.dwarf_name = lhd_dwarf_name; lang_hooks.decl_printable_name = gimple_decl_printable_name; - lang_hooks.set_decl_assembler_name = lhd_set_decl_assembler_name; + /* We do not want the default decl_assembler_name implementation, + rather if we have fixed everything we want a wrapper around it + asserting that all non-local symbols already got their assembler + name and only produce assembler names for local symbols. Or rather + make sure we never call decl_assembler_name on local symbols and + devise a separate, middle-end private scheme for it. */ /* Reset diagnostic machinery. */ diagnostic_starter (global_dc) = default_tree_diagnostic_starter; -- 2.30.2