public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, CHKP] [always_inline 2/2] Fix segafult in SRA
@ 2015-01-16 11:17 Ilya Enkovich
  2015-01-16 17:09 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Enkovich @ 2015-01-16 11:17 UTC (permalink / raw)
  To: gcc-patches

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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, CHKP] [always_inline 2/2] Fix segafult in SRA
  2015-01-16 11:17 [PATCH, CHKP] [always_inline 2/2] Fix segafult in SRA Ilya Enkovich
@ 2015-01-16 17:09 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2015-01-16 17:09 UTC (permalink / raw)
  To: Ilya Enkovich, gcc-patches

On 01/16/15 04:09, Ilya Enkovich wrote:
> 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.
OK.
jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-16 16:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-16 11:17 [PATCH, CHKP] [always_inline 2/2] Fix segafult in SRA Ilya Enkovich
2015-01-16 17:09 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).