[Bug tree-optimization/48189] [4.4/4.5/4.6/4.7 Regression] ICE: SIGFPE (division by zero) in in predict_loops () at predict.c:991 with --param max-predicted-iterations=0

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 20 13:21:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48189

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-12-20 13:10:15 UTC ---
Already the:
              if (host_integerp (niter, 1)
                  && compare_tree_int (niter, max-1) == -1)
                nitercst = tree_low_cst (niter, 1) + 1;
looks wrong, if max is 0, then we are calling compare_tree_int with UHWI
maximum
and even huge nitercst values will make through.
IMHO we should just guard the above with max != 0 as well.
I think max_stmt_executions_int will never return 0, so both patches probably
work fine.  Honza?



More information about the Gcc-bugs mailing list