This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug regression/55168] [4.8 Regression]: gcc.c-torture/compile/pr44119.c ICE, all but -O0
- From: "hubicka at ucw dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Nov 2012 20:49:18 +0000
- Subject: [Bug regression/55168] [4.8 Regression]: gcc.c-torture/compile/pr44119.c ICE, all but -O0
- Auto-submitted: auto-generated
- References: <bug-55168-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55168
--- Comment #2 from Jan Hubicka <hubicka at ucw dot cz> 2012-11-01 20:49:18 UTC ---
This actually looks like a previously latent issue in predict.c For all but
estimate_num_iterations_int. It uses the funny definition of number of
iterations (i.e. 0 means that loop will exit at first invocation of the exit
condition and that is what it will be predicted with when nitercst == 1.
Index: predict.c
===================================================================
--- predict.c (revision 193062)
+++ predict.c (working copy)
@@ -1433,8 +1437,8 @@ predict_loops (void)
the loop, use it to predict this exit. */
else if (n_exits == 1)
{
- nitercst = estimated_stmt_executions_int (loop);
- if (nitercst < 0)
+ nitercst = estimated_stmt_executions_int (loop) + 1;
+ if (nitercst <= 0)
continue;
if (nitercst > max)
nitercst = max;