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, PR c++/41503] Make function_parameter_expanded_from_pack_p() return false if DECL_ARTIFICIAL (param_decl)


Hi,

the patch below fixes a number of segmentation faults in the libstdc++
testsuite when IPA-SRA is turned on.  Somehow IPA-SRA created
PARM_DECLs get passed to function_parameter_expanded_from_pack_p()
through dwrf2out and early inlining nowadays.  These don't have
language specific info and so access to it segfaults.

This patch fixes the problem by not trying to go to this info if
DECL_ARTIFICIAL is set on the parm_decl.  At least I hope that is the
correct approach.

Bootstrapped and tested on x86_64-linux (both with "release" and "yes"
checking).  OK for trunk?

Thanks,

Martin


2009-09-29  Martin Jambor  <mjambor@suse.cz>

	* cp/pt.c (function_parameter_expanded_from_pack_p): Return false if
	DECL_ARTIFICIAL (param_decl) is true.


Index: mine/gcc/cp/pt.c
===================================================================
--- mine.orig/gcc/cp/pt.c
+++ mine/gcc/cp/pt.c
@@ -2669,7 +2669,8 @@ get_function_template_decl (const_tree p
 bool
 function_parameter_expanded_from_pack_p (tree param_decl, tree pack)
 {
-    if (! function_parameter_pack_p (pack))
+    if (DECL_ARTIFICIAL (param_decl)
+	|| !function_parameter_pack_p (pack))
       return false;
 
     gcc_assert (DECL_NAME (param_decl) && DECL_NAME (pack));


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