Hi!

On the following testcase we ICE because we call dump_global_iord
on the artificial function with file cdtor, and that function uses
input_location, which can be anything at that spot, can be completely
unrelated to that function and can be (as in this case) UNKNOWN_LOCATION,
where LOCATION_FILE is NULL, which pp_printf doesn't like for %s.
Fixed by using DECL_SOURCE_FILE of the cdtor instead.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2015-12-07  Jakub Jelinek  <ja...@redhat.com>

        PR c++/68760
        * error.c (dump_global_iord): Use DECL_SOURCE_FILE (t)
        instead of LOCATION_FILE (input_location).

        * g++.dg/tree-ssa/pr68760.C: New test.

--- gcc/cp/error.c.jj   2015-11-14 19:35:53.000000000 +0100
+++ gcc/cp/error.c      2015-12-07 15:34:54.978049661 +0100
@@ -953,7 +953,7 @@ dump_global_iord (cxx_pretty_printer *pp
   else
     gcc_unreachable ();
 
-  pp_printf (pp, p, LOCATION_FILE (input_location));
+  pp_printf (pp, p, DECL_SOURCE_FILE (t));
 }
 
 static void
--- gcc/testsuite/g++.dg/tree-ssa/pr68760.C.jj  2015-12-07 15:42:09.347982688 
+0100
+++ gcc/testsuite/g++.dg/tree-ssa/pr68760.C     2015-12-07 15:41:08.000000000 
+0100
@@ -0,0 +1,5 @@
+// PR c++/68760
+// { dg-do compile }
+// { dg-options "-fdump-ipa-cgraph" }
+
+struct A { A (); } a;

        Jakub

Reply via email to