public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/63470] [5 Regression] internal compiler error: in estimate_edge_growth, at ipa-inline.h:308
Date: Mon, 12 Jan 2015 07:57:00 -0000	[thread overview]
Message-ID: <bug-63470-4-O0aBSqVwM0@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-63470-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63470

--- Comment #12 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The other bug is double ajdusting of call_stmt_size when the call is turned
direct. Fixed thus:

Index: ipa-prop.c
===================================================================
--- ipa-prop.c  (revision 219430)
+++ ipa-prop.c  (working copy)
@@ -2736,6 +2736,7 @@
                       "converting indirect call in %s to direct call to %s\n",
                       ie->caller->name (), callee->name ());
     }
+  struct cgraph_edge *orig = ie;
   if (!speculative)
     ie = ie->make_direct (callee);
   else
@@ -2750,11 +2751,16 @@
       ie = ie->make_speculative
             (callee, ie->count * 8 / 10, ie->frequency * 8 / 10);
     }
-  es = inline_edge_summary (ie);
-  es->call_stmt_size -= (eni_size_weights.indirect_call_cost
-                        - eni_size_weights.call_cost);
-  es->call_stmt_time -= (eni_time_weights.indirect_call_cost
-                        - eni_time_weights.call_cost);
+  /* If we resolved speuclative edge the cost is already up to date
+     for direct call (adjusted by inline_edge_duplication_hook).  */
+  if (ie == orig)
+    {
+      es = inline_edge_summary (ie);
+      es->call_stmt_size -= (eni_size_weights.indirect_call_cost
+                            - eni_size_weights.call_cost);
+      es->call_stmt_time -= (eni_time_weights.indirect_call_cost
+                            - eni_time_weights.call_cost);
+    }

   return ie;
 }
Index: ipa-inline-analysis.c
===================================================================
--- ipa-inline-analysis.c       (revision 219430)
+++ ipa-inline-analysis.c       (working copy)
@@ -1312,6 +1312,14 @@
   info->predicate = NULL;
   edge_set_predicate (dst, srcinfo->predicate);
   info->param = srcinfo->param.copy ();
+  if (!dst->indirect_unknown_callee && src->indirect_unknown_callee)
+    {
+      gcc_checking_assert (src->caller == dst->caller);
+      info->call_stmt_size -= (eni_size_weights.indirect_call_cost
+                              - eni_size_weights.call_cost);
+      info->call_stmt_time -= (eni_time_weights.indirect_call_cost
+                              - eni_time_weights.call_cost);
+    }
 }


  parent reply	other threads:[~2015-01-12  7:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-63470-4@http.gcc.gnu.org/bugzilla/>
2014-10-07 14:36 ` [Bug ipa/63470] [5 Regression] lto1: " rguenth at gcc dot gnu.org
2014-11-18  7:51 ` dcb314 at hotmail dot com
2014-11-18  8:36 ` Joost.VandeVondele at mat dot ethz.ch
2014-11-18  8:53 ` dcb314 at hotmail dot com
2014-11-18  8:56 ` dcb314 at hotmail dot com
2014-11-18  9:21 ` trippels at gcc dot gnu.org
2014-11-20 12:13 ` rguenth at gcc dot gnu.org
2014-11-27  8:54 ` [Bug ipa/63470] [5 Regression] " Joost.VandeVondele at mat dot ethz.ch
2015-01-12  7:40 ` hubicka at gcc dot gnu.org
2015-01-12  7:49 ` trippels at gcc dot gnu.org
2015-01-12  7:53 ` trippels at gcc dot gnu.org
2015-01-12  7:57 ` hubicka at gcc dot gnu.org [this message]
2015-01-12  9:24 ` hubicka at gcc dot gnu.org
2015-01-12  9:26 ` hubicka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-63470-4-O0aBSqVwM0@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).