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/67900] New: Interface bug: Binding parameters to C causes a compiler segmentation fault.


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

            Bug ID: 67900
           Summary: Interface bug: Binding parameters to C causes a
                    compiler segmentation fault.
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: giorgianb at gmail dot com
  Target Milestone: ---

Created attachment 36465
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36465&action=edit
Compiling this file will cause the compiler to segmentation fault.

A simple interface declaration in which the parameter names are the same and
are binding to C causes the compiler to segfault. Usually when declaring a
generic interface that does the same operation on varied types, it is good
practice to give the parameters the same name.

The program:

program main
        implicit none
        interface f
                function f_real(x)
                        real, bind(c) :: x
                        real :: f_real
                end function f_real

                function f_integer(x)
                        integer, bind(c) :: x
                        integer :: f_integer
                end function f_integer
        end interface f
end program main

Info about gcc:

$ gcc --version
gcc (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Basic machine info:
$ uname -a
Linux localhost.localdomain 4.1.8-200.fc22.x86_64 #1 SMP Tue Sep 22 12:13:21
UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


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