NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/52660 (gcc on sparc crashes when optimizing)



The following reply was made to PR toolchain/52660; it has been noted by GNATS.

From: Michael <macallan%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: toolchain/52660 (gcc on sparc crashes when optimizing)
Date: Thu, 21 Jun 2018 13:51:21 -0400

 uwe@ had the right idea - this avoids the crash so far:
 Index: predict.c
 ===================================================================
 RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/predict.c,v
 retrieving revision 1.1.1.4
 diff -u -w -r1.1.1.4 predict.c
 --- predict.c   2 Feb 2018 01:59:20 -0000       1.1.1.4
 +++ predict.c   21 Jun 2018 17:47:06 -0000
 @@ -2908,7 +2908,7 @@
           to outermost to examine frequencies for back edges.  */
        estimate_loops ();
  
 -      freq_max = 0;
 +      freq_max = 1;
        FOR_EACH_BB_FN (bb, cfun)
         if (freq_max < BLOCK_INFO (bb)->frequency)
           freq_max = BLOCK_INFO (bb)->frequency;
 
 ... which is followed by:
       freq_max = real_bb_freq_max / freq_max;
 ... which divides by 0 if the FOR_EACH_BB_FN() loop turns up empty.
 
 Leaves the question why this didn't trigger on v7 builds, or for that
 matter, other archs.
 
 have fun
 Michael
 


Home | Main Index | Thread Index | Old Index