Date: Mon, 25 Jun 2007 11:22:18 -0400 From: "Alexander Kabaev" <kabaev@gmail.com> To: "Andrey Chernov" <ache@nagual.pp.ru>, "Alexander Kabaev" <kabaev@gmail.com>, current@freebsd.org, kan@freebsd.org Subject: Re: Silent gcc 4.2.0 loop optimization bug with -O2 Message-ID: <8e5ef5f70706250822o3c80817brd0b0801e3956e9c7@mail.gmail.com> In-Reply-To: <20070625145627.GA53685@nagual.pp.ru> References: <20070625130913.GA50273@nagual.pp.ru> <20070625133951.GA51324@nagual.pp.ru> <8e5ef5f70706250659v48f64410wb5399985a571087e@mail.gmail.com> <20070625145627.GA53685@nagual.pp.ru>
index | next in thread | previous in thread | raw e-mail
On 6/25/07, Andrey Chernov <ache@nagual.pp.ru> wrote:
> On Mon, Jun 25, 2007 at 09:59:21AM -0400, Alexander Kabaev wrote:
> > It is trivial to extract a sample for miscompiltations. Just use
> > -save-temps and cut down the code until you have a simple case. If you
> > cannot be bothered to do that, nobody else would either,
>
> Well... Is this small enough?
>
> cc -O2 a.c
> ./a.out
> cc -O a.c
> ./a.out
> ------------------------------------------------------------------
> #include <stdio.h>
>
> const char *szElem[4];
>
> void main()
> {
> float power1[80], total2;
> int i, j;
> char sz[80];
>
> for (i = 1; i <= 12; i++) {
> if (i <= 4) {
> sprintf(sz, " -%9.7s:", szElem[i-1]);
> for (j = 1; j < 12; j += 4)
> total2 += power1[i-1+j];
> } else if (i == 6) {
> } else if (i >= 7 && i <= 9) {
> printf("MUST BE HERE!!! %d\n", i);
> }
> }
> }
> -------------------------------------------------------------------
>
> --
> http://ache.pp.ru/
>
This one is almost perfect.
--
Alexander Kabaev
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8e5ef5f70706250822o3c80817brd0b0801e3956e9c7>
