This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[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
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Dec 2011 13:10:15 +0000
- Subject: [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
- Auto-submitted: auto-generated
- References: <bug-48189-4@http.gcc.gnu.org/bugzilla/>
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?