Red Hat Bugzilla – Bug 151013
g77 crash with duplicate subs and -fno-globals
Last modified: 2007-11-30 17:11:01 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6)
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):
Steps to Reproduce:
1. Create 'bug.f' with this content:
2. g77 -g -c -fno-globals bug.f
Actual Results: bug.f:1: warning:
Global name `sub1' defined at (2) already defined at (1) [info -f g77
bug.f: In subroutine `sub1':
bug.f:5: internal compiler error: in gen_subprogram_die, at
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.
-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.)
*** This bug has been marked as a duplicate of 132579 ***