This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/48184] ICE: SIGFPE (division by zero) in compute_alignments () at final.c:731 with --param align-threshold=0 on basic code
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Dec 2011 02:19:12 +0000
- Subject: [Bug tree-optimization/48184] ICE: SIGFPE (division by zero) in compute_alignments () at final.c:731 with --param align-threshold=0 on basic code
- Auto-submitted: auto-generated
- References: <bug-48184-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48184
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-12-15
Ever Confirmed|0 |1
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-15 02:19:12 UTC ---
Simple patch:
Index: final.c
===================================================================
--- final.c (revision 182353)
+++ final.c (working copy)
@@ -724,7 +724,10 @@ compute_alignments (void)
FOR_EACH_BB (bb)
if (bb->frequency > freq_max)
freq_max = bb->frequency;
- freq_threshold = freq_max / PARAM_VALUE (PARAM_ALIGN_THRESHOLD);
+ if (PARAM_VALUE (PARAM_ALIGN_THRESHOLD) == 0)
+ freq_threshold = 0;
+ else
+ freq_threshold = freq_max / PARAM_VALUE (PARAM_ALIGN_THRESHOLD);
if (dump_file)
fprintf(dump_file, "freq_max: %i\n",freq_max);