Bug 151013

Summary: g77 crash with duplicate subs and -fno-globals
Product: [Fedora] Fedora Reporter: Joe Krahn <krahn>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED DUPLICATE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 2   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-14 08:45:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joe Krahn 2005-03-14 02:20:36 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6)
Gecko/20050225 Firefox/1.0.1

Description of problem:
When compiling Fortran code with duplicate subroutines, g77 gives an
error for duplicate names. If compiled with -g and -fno-globals, this
becomes a warning instead, followed by a compiler internal error.

The no-globals option is useful in F77 code mainly for mixing scalar
and array arguments. Apparently, detecting multiple definitions versus
multiple calling conventions has gotten mixed up.



Version-Release number of selected component (if applicable):
gcc-g77-3.3.3-7

How reproducible:
Always

Steps to Reproduce:
1. Create 'bug.f' with this content:
      subroutine sub1()
      end
      subroutine sub1()
      end

2. g77 -g -c -fno-globals bug.f


Actual Results:  bug.f:1: warning:
         subroutine sub1()
                    1
bug.f:4: (continued):
         subroutine sub1()
                    2
Global name `sub1' defined at (2) already defined at (1) [info -f g77
M GLOBALS]
bug.f: In subroutine `sub1':
bug.f:5: internal compiler error: in gen_subprogram_die, at
dwarf2out.c:10814
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.

Expected Results:  The above should have been an error.

Additional info:

-fno-globals should should allow g77 to tolerate mismatched subroutine
arguments, often needed to work around F77 inefficientcies, but
multiple subroutine definitions must always be fatal.

It would be nice to have a 'relaxed' globals check that allowed
scalar/array mismatches as long as the data type was right. (But, F77
is so archaic anyhow.)

Comment 1 Jakub Jelinek 2005-03-14 08:45:13 UTC

*** This bug has been marked as a duplicate of 132579 ***