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/32801] New: USE of ISO_C_BINDING, ONLY: C_LOC causes compiler seg fault


The following program causes a fault in the compiler:
    c_loc_prob.f:0: internal compiler error: Segmentation fault: 11
This is the reduced program:

    PROGRAM c_loc_prob
      USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_LOC 
     !   USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_PTR, C_LOC
    END PROGRAM c_loc_prob

Additional information:
  - Options for optimization and warnings seem to not affect the errot.
  - If C_PTR is declared prior to C_LOC (as in the comment), the compiler
    doesn't fault.
  - In the original programs (from which this example is extracted, the
    declaration of C_PTR prior to C_LOC causes the compiler to erroneously
    diagnose various other constructs

Workarounds:
  At least two workaounds for this problem work in the other (much larger)
  programs:
    - Avoid use of ONLY: qualifier to ISO_C_BINDING, e.g.,
        USE, INTRINSIC :: ISO_C_BINDING
    - Replace C_LOC with LOC at the invocation and C_PTR with C_LONG at the
      INTERFACE declaration.


-- 
           Summary: USE of ISO_C_BINDING, ONLY: C_LOC causes compiler seg
                    fault
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sysmaint at contek dot com
 GCC build triplet: same
  GCC host triplet: gfortran - 386-portbld-freebsd6.2 - 4.3.0 20070713
                    (experimental
GCC target triplet: same


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32801


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