This is the mail archive of the
mailing list for the GCC project.
[PATCH] Remove current_function_decl usage from get_polymorphic_call_info
- From: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 13 Aug 2014 18:17:42 +0400
- Subject: [PATCH] Remove current_function_decl usage from get_polymorphic_call_info
- Authentication-results: sourceware.org; auth=none
Testing 'mpx' branch after merge with trunk I got a segfault in ipa-devirt.c. It appears that cgraph_node cloning with indirect edge causes call to get_polymorphic_call_info which uses current_function_decl. It happens in IPA pass and therefore current_function_decl is NULL which causes segfault. Also even within a GIMPLE pass it seems wrong to use current_function_decl because examined call may belong to another function and passed fndecl should be used instead.
Proposed patch was bootstrapped and regtested on linux-x86_64. OK for trunk?
2014-08-13 Ilya Enkovich <email@example.com>
* ipa-devirt.c (get_polymorphic_call_info): Use fndecl instead of
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c
index 3650b43..0f38655 100644
@@ -2319,7 +2319,7 @@ get_polymorphic_call_info (tree fndecl,
= decl_maybe_in_construction_p (base,