From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15059 invoked by alias); 15 Nov 2012 01:01:54 -0000 Received: (qmail 14361 invoked by uid 48); 15 Nov 2012 01:01:31 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/55079] [4.8 regression] false positive -Warray-bounds (also seen at -O3 bootstrap) Date: Thu, 15 Nov 2012 01:01:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg01337.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55079 --- Comment #9 from Jan Hubicka 2012-11-15 01:= 01:30 UTC --- This is reduced testcase from gcov.c int a[8]; int t (void) { int ix =3D 0; int k; int b =3D 0; int curr =3D 0; for (k =3D 0; k < 2; k++) { b =3D ix * 32; curr =3D a[ix++]; if (!(ix <=3D 8)) abort (); while (curr) { b =3D ix * 32; curr =3D a[ix++]; if (!(ix <=3D 8)) abort (); } } return curr + b; } jan@linux-e0ml:~/trunk/build/gcc> ./xgcc -B ./ -O2 -fprofile-use t.c -Warray-bounds -S -S -fdump-tree-cunroll-details -fdump-tree-all-details= =20=20 t.c: In function =E2=80=98t=E2=80=99: t.c:14:2: warning: incompatible implicit declaration of built-in function =E2=80=98abort=E2=80=99 [enabled by default] abort (); ^ t.c:25:1: note: file /home/jan/trunk/build/gcc/t.gcda not found, execution counts estimated } ^ t.c:19:15: warning: array subscript is above array bounds [-Warray-bounds] curr =3D a[ix++]; ^ t.c:19:15: warning: array subscript is above array bounds [-Warray-bounds] Obivously here unroller does not know that bv_ix is at least 1