OSDN Git Service

2010-04-26 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Apr 2010 09:19:24 +0000 (09:19 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Apr 2010 09:19:24 +0000 (09:19 +0000)
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

gcc/ChangeLog
gcc/gimple.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lto/20100423-3_0.C [new file with mode: 0644]

index 54ad269..14b8b45 100644 (file)
@@ -1,5 +1,11 @@
 2010-04-26  Richard Guenther  <rguenther@suse.de>
 
+       PR lto/43080
+       * gimple.c (gimple_decl_printable_name): Deal gracefully
+       with a NULL DECL_NAME.
+
+2010-04-26  Richard Guenther  <rguenther@suse.de>
+
        PR lto/42425
        * tree.c (free_lang_data_in_type): Do not free TYPE_CONTEXT
        if emitting debug information and it is either a function
index aab6ef2..6d439c5 100644 (file)
@@ -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))
     {
index e041658..0524b7c 100644 (file)
@@ -1,5 +1,10 @@
 2010-04-26  Richard Guenther  <rguenther@suse.de>
 
+       PR lto/43080
+       * g++.dg/lto/20100423-3_0.C: New testcase.
+
+2010-04-26  Richard Guenther  <rguenther@suse.de>
+
        PR lto/42425
        * g++.dg/lto/20100423-2_0.C: New testcase.
 
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 (file)
index 0000000..49564a5
--- /dev/null
@@ -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();
+}
+