public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32801]  New: USE of ISO_C_BINDING, ONLY: C_LOC causes compiler seg fault
@ 2007-07-17 23:58 sysmaint at contek dot com
  2007-07-18  5:44 ` [Bug fortran/32801] " burnus at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: sysmaint at contek dot com @ 2007-07-17 23:58 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <20070806092010.29220.qmail@sourceware.org>]

end of thread, other threads:[~2007-08-09  0:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-17 23:58 [Bug fortran/32801] New: USE of ISO_C_BINDING, ONLY: C_LOC causes compiler seg fault sysmaint at contek dot com
2007-07-18  5:44 ` [Bug fortran/32801] " burnus at gcc dot gnu dot org
2007-07-18 11:24 ` fxcoudert at gcc dot gnu dot org
2007-07-18 20:19 ` crickett at lanl dot gov
2007-07-18 21:15 ` patchapp at dberlin dot org
2007-07-18 22:02 ` burnus at gcc dot gnu dot org
2007-07-18 22:06 ` burnus at gcc dot gnu dot org
2007-07-21 20:31 ` kargl at gcc dot gnu dot org
2007-07-21 20:41 ` kargl at gcc dot gnu dot org
2007-08-06  9:20 ` fxcoudert at gcc dot gnu dot org
     [not found] <20070806092010.29220.qmail@sourceware.org>
2007-08-09  0:50 ` Douglas Wells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).