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: Always 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.
Created attachment 22488 [details] tar file containing one script and 3 short fortran examples
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.nluug.nl>, who is gcc Fortran maintainer.