From: rguenth Date: Mon, 26 Apr 2010 09:19:24 +0000 (+0000) Subject: 2010-04-26 Richard Guenther X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60d62ca4bc390be555a8a59767bd870ba1edab17;p=thirdparty%2Fgcc.git 2010-04-26 Richard Guenther PR lto/43080 * gimple.c (gimple_decl_printable_name): Deal gracefully with a NULL DECL_NAME. * g++.dg/lto/20100423-3_0.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158723 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 54ad2698db2e..14b8b45cbfbc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-04-26 Richard Guenther + + PR lto/43080 + * gimple.c (gimple_decl_printable_name): Deal gracefully + with a NULL DECL_NAME. + 2010-04-26 Richard Guenther PR lto/42425 diff --git a/gcc/gimple.c b/gcc/gimple.c index aab6ef25f342..6d439c553a25 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -4579,7 +4579,8 @@ gimple_ior_addresses_taken (bitmap addresses_taken, gimple stmt) const char * gimple_decl_printable_name (tree decl, int verbosity) { - gcc_assert (decl && DECL_NAME (decl)); + if (!DECL_NAME (decl)) + return NULL; if (DECL_ASSEMBLER_NAME_SET_P (decl)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e041658dbabc..0524b7cffd25 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-04-26 Richard Guenther + + PR lto/43080 + * g++.dg/lto/20100423-3_0.C: New testcase. + 2010-04-26 Richard Guenther PR lto/42425 diff --git a/gcc/testsuite/g++.dg/lto/20100423-3_0.C b/gcc/testsuite/g++.dg/lto/20100423-3_0.C new file mode 100644 index 000000000000..49564a586b4a --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/20100423-3_0.C @@ -0,0 +1,14 @@ +// { dg-lto-do assemble } +// { dg-lto-options {{-flto -g}} } + +inline int foo() +{ + static union { int i; }; + return i; +} + +void bar() +{ + foo(); +} +