[Bug fortran/54767] New: Incorrect code generated with "-O2 -fcheck=bounds"

arnaud02 at users dot sourceforge.net gcc-bugzilla@gcc.gnu.org
Mon Oct 1 15:08:00 GMT 2012


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".



More information about the Gcc-bugs mailing list