public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix speculative edge reference lookup
@ 2013-08-31 14:26 Jan Hubicka
  0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2013-08-31 14:26 UTC (permalink / raw)
  To: gcc-patches

Hi,
this patch fixes ugly thinko when looking up reference for a speculative call.
Without LTO we can end up choosing wrong alternative for function with many devirtualizations
(as it happens for PPC64)

Bootstrapped/regtested ppc64-linux, comitted.

Honza

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 202128)
+++ ChangeLog	(working copy)
@@ -1,5 +1,9 @@
 2013-08-31  Jan Hubicka  <jh@suse.cz>
 
+	* cgraph.c (cgraph_speculative_call_info): Fix ref lookup
+
+2013-08-31  Jan Hubicka  <jh@suse.cz>
+
 	* basic-block.h (apply_scale): Make scale parmeter gcov_type.
 
 2013-08-31  Uros Bizjak  <ubizjak@gmail.com>
Index: cgraph.c
===================================================================
--- cgraph.c	(revision 202100)
+++ cgraph.c	(working copy)
@@ -1151,7 +1151,7 @@ cgraph_speculative_call_info (struct cgr
 					      i, ref); i++)
     if (ref->speculative
 	&& ((ref->stmt && ref->stmt == e->call_stmt)
-	    || (ref->lto_stmt_uid == e->lto_stmt_uid)))
+	    || (!ref->stmt && ref->lto_stmt_uid == e->lto_stmt_uid)))
       {
 	reference = ref;
 	break;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-08-31 14:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-31 14:26 Fix speculative edge reference lookup Jan Hubicka

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).