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/66141] New: Invalid code generation with -O1, -O2, -O3 for x86_64 target for array reference in Fortran COMMON


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66141

            Bug ID: 66141
           Summary: Invalid code generation with -O1, -O2, -O3 for x86_64
                    target for array reference in Fortran COMMON
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: george at gly dot bris.ac.uk
  Target Milestone: ---

Created attachment 35540
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35540&action=edit
Self-contained program to show buggy functionality

Attached short Fortran program functions properly with no optimization or -O0
but not when -O1, -O2, or -O3 used.  Code generation for references to storage
in Fortran COMMON incorrect.

Expected output, when compiled with -O0 or no optimization is:

 kvalue should be OK but is OK

Output when compiled with -O1, -O2, or -O3 is:

 kvalue should be OK but is UNDEFINE

[Program generates warning on compilation, but this is allowed under the
semantics of Fortran COMMON (allocated COMMON storage is longest among any of
its definition).]


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