This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/54767] New: Incorrect code generated with "-O2 -fcheck=bounds"
- From: "arnaud02 at users dot sourceforge.net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 01 Oct 2012 15:07:48 +0000
- Subject: [Bug fortran/54767] New: Incorrect code generated with "-O2 -fcheck=bounds"
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54767
Bug #: 54767
Summary: Incorrect code generated with "-O2 -fcheck=bounds"
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: arnaud02@users.sourceforge.net
Using the code attached:
>gfortran --version | head -2
GNU Fortran (GCC) 4.7.1
Copyright (C) 2012 Free Software Foundation, Inc.
>gfortran -O0 -fcheck=bounds xxx_1.f xxx_2.f
>/a.out
2 1
3 2
T
>gfortran -O2 -fcheck=bounds xxx_1.f xxx_2.f
>./a.out
2 1
3 1
F
The results are different and incorrect when compiling with "-O2
-fcheck=bounds". They are still correct when compiling with "-O1
-fcheck=bounds".