This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch to cp/decl.c


The attched patch is needed to avoid an ICE when compiling
g++.dg/ext/pretty1.C with --enable-mapped-location.  In that
case input_location is UNKNOWN_LOCATION, which means
input_filename is NULL, so you can't take its lbasename.
The simplest fix seeks to be to skip this code if DECL_ARTIFICIAL.

Ok for mainline?
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/
2005-04-19  Per Bothner  <per@bothner.com>

	* decl.c (make_rtl_for_nonlocal_decl): Don't try get_fileinfo for
	artificial declarations.

Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1385
diff -u -p -r1.1385 decl.c
--- cp/decl.c	9 Apr 2005 03:18:14 -0000	1.1385
+++ cp/decl.c	19 Apr 2005 19:09:09 -0000
@@ -4596,6 +4596,7 @@ make_rtl_for_nonlocal_decl (tree decl, t
       && TREE_READONLY (decl)
       && DECL_INITIAL (decl) != NULL_TREE
       && DECL_INITIAL (decl) != error_mark_node
+      && ! DECL_ARTIFICIAL (decl)
       && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl))
       && toplev
       && !TREE_PUBLIC (decl))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]