From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80506 invoked by alias); 10 Sep 2015 21:04:40 -0000 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 Received: (qmail 80449 invoked by uid 48); 10 Sep 2015 21:04:37 -0000 From: "pangbw at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds" Date: Thu, 10 Sep 2015 21:04: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-Version: 4.8.3 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pangbw at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-09/txt/msg00894.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D59124 baoshan changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pangbw at gmail dot com --- Comment #18 from baoshan --- I see this issue on 5.2.0 too: cat test.c unsigned baz[6]; void test(unsigned *bar, unsigned n) { unsigned i, j; if (n > 6) { n =3D 6; } for (i =3D 1; i < n; i++) { for (j =3D i - 1; j > 0; j--) { bar[j - 1] =3D baz[j - 1]; } } } bpg@ala-bpg-lx1$./cross/bin/arm-linux-gnueabi-gcc -c -Wall -O3 test.c test.c: In function =E2=80=98test=E2=80=99: test.c:9:32: warning: array subscript is above array bounds [-Warray-bounds] bar[j - 1] =3D baz[j - 1]; ^ test.c:9:32: warning: array subscript is above array bounds [-Warray-bounds] bpg@ala-bpg-lx1$./cross/bin/arm-linux-gnueabi-gcc -v Using built-in specs. COLLECT_GCC=3D./cross/bin/arm-linux-gnueabi-gcc COLLECT_LTO_WRAPPER=3D/net/ala-rsu-lx1/ala-rsu-lx11/bpg/SHARE/GCC520/X_520/= cross/libexec/gcc/arm-linux-gnueabi/5.2.0/lto-wrapper Target: arm-linux-gnueabi Configured with: ../gcc-5.2.0/configure --prefix=3D/net/ala-rsu-lx1/ala-rsu-lx11/bpg/SHARE/GCC520/X_520/cross --target=3Darm-linux-gnueabi --enable-languages=3Dc,c++ --d\ isable-multilib Thread model: posix gcc version 5.2.0 (GCC) >>From gcc-bugs-return-496917-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Sep 10 21:05:36 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 90131 invoked by alias); 10 Sep 2015 21:05:36 -0000 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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 90091 invoked by uid 48); 10 Sep 2015 21:05:33 -0000 From: "fxcoudert at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/67531] FAIL: gfortran.dg/ieee/large_2.f90 -O0 execution test Date: Thu, 10 Sep 2015 21:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fxcoudert at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-09/txt/msg00895.txt.bz2 Content-length: 852 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67531 --- Comment #1 from Francois-Xavier Coudert --- Thanks for the report. So apparently, on powerpc64le-unknown-linux-gnu, long double division of 1.0L by 3.0L with rounding mode set to "down" is incorrect. Can you compile and run the following C test case? $ cat z.c #include #include int main (void) { long double x1, x2, x; fesetround (FE_UPWARD); x1 = 1; x = 3; x1 = x1 / x; fesetround (FE_DOWNWARD); x2 = 1; x = 3; x2 = x2 / x; printf ("%.40Lg\n", x1); printf ("%.40Lg\n", x2); } $ gcc z.c -lm && ./a.out 0.3333333333333333333423683514373792036167 0.3333333333333333333152632971252415927665 Above is the result on x86_64-linux, so the outcome shouldn't be identical, but the two numbers output should not be equal.