public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pangbw at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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 [thread overview]
Message-ID: <bug-59124-4-xdrJh2V1tk@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59124-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124
baoshan <pangbw at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pangbw at gmail dot com
--- Comment #18 from baoshan <pangbw at gmail dot com> ---
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 = 6;
}
for (i = 1; i < n; i++) {
for (j = i - 1; j > 0; j--) {
bar[j - 1] = baz[j - 1];
}
}
}
bpg@ala-bpg-lx1$./cross/bin/arm-linux-gnueabi-gcc -c -Wall -O3 test.c
test.c: In function ‘test’:
test.c:9:32: warning: array subscript is above array bounds [-Warray-bounds]
bar[j - 1] = 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=./cross/bin/arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/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=/net/ala-rsu-lx1/ala-rsu-lx11/bpg/SHARE/GCC520/X_520/cross
--target=arm-linux-gnueabi --enable-languages=c,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: <gcc-bugs-return-496917-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
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: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
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" <gcc-bugzilla@gcc.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: <bug-67531-4-EXKqpq350E@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67531-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67531-4@http.gcc.gnu.org/bugzilla/>
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?idg531
--- Comment #1 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
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 <fenv.h>
#include <stdio.h>
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.
next prev parent reply other threads:[~2015-09-10 21:04 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 0:44 [Bug tree-optimization/59124] New: [4.8 " d.g.gorbachev at gmail dot com
2013-11-14 9:51 ` [Bug tree-optimization/59124] [4.8/4.9 " rguenth at gcc dot gnu.org
2013-11-14 17:56 ` d.g.gorbachev at gmail dot com
2013-11-21 14:39 ` rguenth at gcc dot gnu.org
2014-03-12 14:33 ` jakub at gcc dot gnu.org
2014-05-22 9:03 ` [Bug tree-optimization/59124] [4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-12-19 13:25 ` [Bug tree-optimization/59124] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-01-27 9:50 ` rguenth at gcc dot gnu.org
2015-01-27 10:59 ` rguenth at gcc dot gnu.org
2015-02-18 2:22 ` solar-gcc at openwall dot com
2015-02-18 4:37 ` solar-gcc at openwall dot com
2015-02-19 14:14 ` rguenth at gcc dot gnu.org
2015-02-24 13:09 ` rguenth at gcc dot gnu.org
2015-04-16 12:14 ` [Bug tree-optimization/59124] [4.8/4.9/5/6 " georgmueller at gmx dot net
2015-05-26 15:34 ` georgmueller at gmx dot net
2015-06-01 23:49 ` daniel at imperfectcode dot com
2015-06-23 8:16 ` rguenth at gcc dot gnu.org
2015-06-26 19:53 ` [Bug tree-optimization/59124] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:26 ` jakub at gcc dot gnu.org
2015-09-10 21:04 ` pangbw at gmail dot com [this message]
2015-09-11 0:29 ` manu at gcc dot gnu.org
2015-09-11 16:13 ` pangbw at gmail dot com
2015-09-11 16:51 ` manu at gcc dot gnu.org
2015-09-17 18:18 ` pangbw at gmail dot com
2015-09-17 19:02 ` pangbw at gmail dot com
2015-09-18 17:59 ` pangbw at gmail dot com
2015-09-18 18:32 ` manu at gcc dot gnu.org
2015-09-18 19:17 ` manu at gcc dot gnu.org
2015-09-18 21:11 ` pangbw at gmail dot com
2015-09-22 20:06 ` pangbw at gmail dot com
2021-01-05 9:14 ` [Bug tree-optimization/59124] [6 " szotsaki at gmail dot com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-59124-4-xdrJh2V1tk@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).