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, CHKP] [always_inline 2/2] Fix segafult in SRA


Hi,

In early SRA some_callers_have_mismatched_arguments_p function is called for function, all its thunks and aliases, but actually cannot handle function with thunks because assumes call_stmt for call_edge is not NULL.  This patch rejects functions with thunks instead of ICE.

Bootstrapped and checked on x86_64-unknown-linux-gnu.  Fixes faults revealed by the first patch in the series.  OK for trunk?

Thanks,
Ilya
--
2015-01-16  Ilya Enkovich  <ilya.enkovich@intel.com>

	* tree-sra.c (some_callers_have_mismatched_arguments_p): Allow thunk
	callers.


diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index f560fe0..f6a3acd 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -4873,7 +4873,7 @@ some_callers_have_mismatched_arguments_p (struct cgraph_node *node,
 {
   struct cgraph_edge *cs;
   for (cs = node->callers; cs; cs = cs->next_caller)
-    if (!callsite_arguments_match_p (cs->call_stmt))
+    if (!cs->call_stmt || !callsite_arguments_match_p (cs->call_stmt))
       return true;
 
   return false;


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