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 tree-optimization/48184] ICE: SIGFPE (division by zero) in compute_alignments () at final.c:731 with --param align-threshold=0 on basic code


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);


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