From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87127 invoked by alias); 8 Oct 2015 20:33:15 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 86929 invoked by uid 48); 8 Oct 2015 20:33:11 -0000 From: "giorgianb at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/67900] New: Interface bug: Binding parameters to C causes a compiler segmentation fault. Date: Thu, 08 Oct 2015 20:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 5.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: giorgianb at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg00608.txt.bz2 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