GCC Bugzilla – Attachment 41976 Details for
Bug 81318
[8 regression] ICE in to_reg_br_prob_base, at profile-count.h:189
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch candidate
0001-Patch-candidate.patch (text/plain), 3.25 KB, created by
Martin Liška
on 2017-08-11 13:04:19 UTC
(
hide
)
Description:
Patch candidate
Filename:
MIME Type:
Creator:
Martin Liška
Created:
2017-08-11 13:04:19 UTC
Size:
3.25 KB
patch
obsolete
>From 7adb06ef209e35c385750dd00e99d57c98063bab Mon Sep 17 00:00:00 2001 >From: marxin <mliska@suse.cz> >Date: Fri, 11 Aug 2017 14:04:37 +0200 >Subject: [PATCH] Patch candidate. > >--- > gcc/predict.c | 44 ++++++++++++++++++---------------- > gcc/testsuite/gcc.dg/torture/pr81318.c | 13 ++++++++++ > 2 files changed, 37 insertions(+), 20 deletions(-) > create mode 100644 gcc/testsuite/gcc.dg/torture/pr81318.c > >diff --git a/gcc/predict.c b/gcc/predict.c >index 80c2c1966d8..198fa919d74 100644 >--- a/gcc/predict.c >+++ b/gcc/predict.c >@@ -747,8 +747,10 @@ dump_prediction (FILE *file, enum br_predictor predictor, int probability, > { > fprintf (file, " hit "); > e->count.dump (file); >- fprintf (file, " (%.1f%%)", e->count.to_gcov_type() * 100.0 >- / bb->count.to_gcov_type ()); >+ >+ if (e->count.initialized_p ()) >+ fprintf (file, " (%.1f%%)", e->count.to_gcov_type() * 100.0 >+ / bb->count.to_gcov_type ()); > } > } > >@@ -3446,7 +3448,7 @@ determine_unlikely_bbs () > if (dump_file && (dump_flags & TDF_DETAILS)) > fprintf (dump_file, "Basic block %i is locally unlikely\n", > bb->index); >- bb->count = profile_count::zero (); >+ bb->count = profile_count::guessed_zero (); > } > > if (bb->count == profile_count::zero ()) >@@ -3463,7 +3465,7 @@ determine_unlikely_bbs () > if (dump_file && (dump_flags & TDF_DETAILS)) > fprintf (dump_file, "Edge %i->%i is locally unlikely\n", > bb->index, e->dest->index); >- e->count = profile_count::zero (); >+ e->count = profile_count::guessed_zero (); > } > > gcc_checking_assert (!bb->aux); >@@ -3503,23 +3505,25 @@ determine_unlikely_bbs () > if (found) > continue; > } >- if (!(bb->count == profile_count::zero ()) >- && (dump_file && (dump_flags & TDF_DETAILS))) >- fprintf (dump_file, >- "Basic block %i is marked unlikely by backward prop\n", >- bb->index); >- bb->count = profile_count::zero (); >- bb->frequency = 0; >- FOR_EACH_EDGE (e, ei, bb->preds) >- if (!(e->count == profile_count::zero ())) >+ if (!(bb->count == profile_count::zero ())) > { >- e->count = profile_count::zero (); >- if (!(e->src->count == profile_count::zero ())) >- { >- nsuccs[e->src->index]--; >- if (!nsuccs[e->src->index]) >- worklist.safe_push (e->src); >- } >+ if (dump_file && (dump_flags & TDF_DETAILS)) >+ fprintf (dump_file, >+ "Basic block %i is marked unlikely by backward prop\n", >+ bb->index); >+ bb->count = profile_count::guessed_zero (); >+ bb->frequency = 0; >+ FOR_EACH_EDGE (e, ei, bb->preds) >+ if (!(e->count == profile_count::zero ())) >+ { >+ e->count = profile_count::guessed_zero (); >+ if (!(e->src->count == profile_count::zero ())) >+ { >+ nsuccs[e->src->index]--; >+ if (!nsuccs[e->src->index]) >+ worklist.safe_push (e->src); >+ } >+ } > } > } > } >diff --git a/gcc/testsuite/gcc.dg/torture/pr81318.c b/gcc/testsuite/gcc.dg/torture/pr81318.c >new file mode 100644 >index 00000000000..d6f005235bb >--- /dev/null >+++ b/gcc/testsuite/gcc.dg/torture/pr81318.c >@@ -0,0 +1,13 @@ >+/* PR middle-end/81318 */ >+ >+__attribute__((__cold__)) void a(); >+int d(void); >+int e(void); >+ >+void b() { a(); } >+ >+void c() { >+ b(); >+ if (d()) >+ e(); >+} >-- >2.13.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 81318
:
41813
| 41976