Bug 47057 - Unitialized variables not found by g77 when -fno-automatic is used
Unitialized variables not found by g77 when -fno-automatic is used
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2001-07-02 16:14 EDT by Alfredo Ferrari
Modified: 2007-04-18 12:34 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-07-02 16:15:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
tar file containing one script and 3 short fortran examples (407 bytes, text/plain)
2001-07-02 16:15 EDT, Alfredo Ferrari
no flags Details

  None (edit)
Description Alfredo Ferrari 2001-07-02 16:14:12 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.3-12 i686)

Description of problem:
Compiling a fortran code with obviously uninitialized variables under the
-Wall option should result in warning messages. Indeed this is true in many
cases, but the same exact code with the -fno-automatic
option does no longer give any warning (wrong of course). This is true
also if the SAVE statement is put into the code (this is consistent since
SAVE should perform the same as -fno-automatic)

The attached tar file contains a script, dobug, and two extremely short
fortran examples showing the problem

How reproducible:

Steps to Reproduce:
1.untar the example
2.run dobug
3.look at the results

Actual Results:  no warning is issued for the second and third examples,
while both should result in the same warnings as of the first example.
The 4th example (bug3.f) reults in only two warnings out of the required 4,
showing that all variables which are SAVEd are for some reason no longer
subject to the checks about initialization

Expected Results:  all four examples should issue warnings about all non
initialized variables

Additional info:

the problem is particular nasty when compiling large codes where the
-fno-automatic option is required or where anyway some variables must be
SAVEd. In the present version, g77 systematically misses unitialized
variables with obvious consequences. The problem bubbled up when the same
code was compiled under IM-AIX and Compaq TrueUnix
or whatever is now the name of Digital Unix, which both exposed some typos
which went unobserved under RH7.1.
Comment 1 Alfredo Ferrari 2001-07-02 16:15:41 EDT
Created attachment 22488 [details]
tar file containing one script and 3 short fortran examples
Comment 2 Jakub Jelinek 2001-07-25 11:11:10 EDT
All of egcs, g77 2.95.2, g77 2.96-RH, g77 3.0 and g77 3.1 CVS behave this way
(well, the variables are not uninitialized in that case, they are initialized
to 0). I don't know Fortran at all, so I have no idea what the standard
sais about it.
If you really think this should result in a warning, please talk to
Toon Moene <toon@moene.indiv.nluug.nl>, who is gcc Fortran maintainer.

Note You need to log in before you can comment on or make changes to this bug.