This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug regression/55168] [4.8 Regression]: gcc.c-torture/compile/pr44119.c ICE, all but -O0


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]