This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR48184
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 10 Apr 2013 11:49:18 +0200
- Subject: Re: [PATCH] Fix PR48184
- References: <20130404140108 dot GD24873 at redhat dot com> <20130410094418 dot GC3837 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Apr 10, 2013 at 11:44:18AM +0200, Marek Polacek wrote:
> Ping.
>
> On Thu, Apr 04, 2013 at 04:01:09PM +0200, Marek Polacek wrote:
> > This fixes an ICE in case we use weirdo --param value for
> > PARAM_ALIGN_THRESHOLD. The patch is by Andrew; I added CL, testcase
> > and tested.
> >
> > Bootstrapped/regtested on x86_64-linux, ok for trunk? And what about other
> > branches?
> >
> > 2013-04-04 Marek Polacek <polacek@redhat.com>
> > Andrew Pinski <apinski@cavium.com>
> >
> > PR tree-optimization/48184
> > * final.c (compute_alignments): Set threshold to 0
> > if PARAM_ALIGN_THRESHOLD is 0.
> >
> > * gcc.dg/pr48184.c: New test.
Shouldn't this be again solved instead by bumping minimum for the param to 1
from 0? Because, the smaller the param is, the bigger freq_threshold is,
so if for the smallest param we suddenly set freq_threshold to 0, it isn't
consistent.
> > --- gcc/final.c.mp 2013-04-04 14:09:04.626020852 +0200
> > +++ gcc/final.c 2013-04-04 14:09:05.672024174 +0200
> > @@ -701,7 +701,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);
Jakub