This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]