[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::fortran

Title:Digital Fortran
Notice:Read notes 1.* for important information
Moderator:QUARK::LIONEL
Created:Thu Jun 01 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1333
Total number of notes:6734

1292.0. "optimizer generating wrong code???" by FRSTSC::TLAUER ("I've been designed multi-asking.") Mon May 12 1997 10:04

I've got the following piece of code, which produces different results when
compiled with optimize level 1 or 2:

OpenVMS Alpha V7.1, Digital Fortran 77 V7.1-107-3313

      COMMON /A/  LLLLL
      LOGICAL LLLLL
      LOGICAL MMMMM /.TRUE./
      INTEGER IVERS  /102/
      LLLLL = .TRUE.
      CALL SUB1(MMMMM,IVERS)
      END
*----
      SUBROUTINE SUB1(MMMMM,IVERS)
      IMPLICIT INTEGER (I)
      COMMON/A/ LLLLL
      LOGICAL LLLLL
      LOGICAL MMMMM,NNNNN
      NNNNN = .FALSE.
      IF (MMMMM.AND.IVERS.GT.100) NNNNN = .TRUE.
      WRITE(6,*) 'VERIFYING FORTRAN COMPILING ERRORS...'
      IOK = 1
      IF (.NOT.NNNNN) IOK = 0
      IF(LLLLL) THEN
        IF(IOK.EQ.1) THEN
          WRITE(6,*) ' IOK:',IOK,' LLLLL:',LLLLL
        ELSE
          WRITE(6,*) ' IOK:',IOK,' LLLLL:',LLLLL
        ENDIF
      ENDIF
      END


When compiled, you should see the following:

NODE> for/warn=nodecl/opt=level=1 test
NODE> link test
NODE> run test
VERIFYING FORTRAN COMPILING ERRORS...
 IOK:           1 LLLLL: T
NODE> for/warn=nodecl/opt=level=2 test
NODE> link test
NODE> run test
VERIFYING FORTRAN COMPILING ERRORS...
 IOK:           0 LLLLL: T


Is this a bug in the optimizer or did the customer violate fortran syntax (i
couldn't see anything obvious, but well...)? Anyway, my feeling is that the
compiler shouldn't produce .exes with different functionality without aven
spitting out some warnings.


By the way, why does the compiler put the string 'symbol table' at the top of
several pages in the listing file which definitely do NOT hold the symbol table?

-- Thilo
T.RTitleUserPersonal
Name
DateLines
1292.1QUARK::LIONELFree advice is worth every centMon May 12 1997 10:336
I don't see anything obviously wrong in the program, and the VAX compiler
generates the same answer for /OPT and /NOOPT.  I note that the F90 compiler
matches F77's behavior, so it may indeed be an optimizer problem.  I'm sure
Dave will have more to say on this later.

				Steve
1292.2Yes, a code-generation bugWIBBIN::NOYCEPulling weeds, pickin' stonesMon May 12 1997 10:429
Yes, it's a bug.  The compiler computed the value of NNNNN, but forgot to
store it to memory across the I/O call.  Later it fetched it from memory,
but got random garbage.

Obviously, the compiler doesn't usually make such mistakes.  This arises only
for a particular combination of LOGICAL operators.

One "big-hammer" workaround would be to declare NNNNN volatile.  Meanwhile,
the compiler fix is underway...
1292.3FixedTLE::EKLUNDAlways smiling on the inside!Mon May 12 1997 11:526
    	We have fixed the problem.  Thanks again for the simple
    program!
    
    Cheers!
    Dave Eklund
    
1292.4That was 108 minutes for the fix - could we trim that under 1 hour ;-)FRSTSC::TLAUER"I've been designed multi-asking."Tue May 13 1997 02:538
Many thanks for that really fast solution!!! Is the fixed compiler available?
I'm sure my customer doesn't want to wait for a fully tested version, but get
hands on an improved version as quick as possible.


Thanks again,

-- Thilo
1292.5QUARK::LIONELFree advice is worth every centTue May 13 1997 09:563
This fix should make the ECO kit we'll put out next week.

			Steve
1292.6TLE::EKLUNDAlways smiling on the inside!Tue May 13 1997 10:225
    	The Fortran team has a keen appreciation for great performance...
    
    Cheers!
    Dave Eklund
    
1292.7unable to locate the promised ECOFRSTSC::TLAUER"I've been designed multi-asking."Fri Jun 06 1997 05:1614
Hello,


today i got the customer's response that the promised ECO is still not
available, and indeed it's not visible within TIMA TOOLS. May i kindly ask for a
special private version of the planned ECO to provide a solution for the
customer? Until a final fix they have to use /NOOPT for all their BIIIG FORTRAN
programs (this is a university), and have to waste expensive cpu cycles...


thanks and regards,


-- Thilo
1292.8also...CERN::HOBBSCongrats to the Ignoble Peace Prize winner! (http://www.eecs.harvard.edu/ig_nobel)Fri Jun 06 1997 06:347
This program fails on DIGITAL Visual Fortran 5.0.1b1 on Alpha, but is
OK on Intel.

Do you want a standard bug report on DVF, or is the fix in the source
pool already?

-cw
1292.9DVF T5.0.1 Beta 2 will have the fixTLE::WHITLOCKStan WhitlockFri Jun 06 1997 09:3212
>>This program fails on DIGITAL Visual Fortran 5.0.1b1 on Alpha, but is
>>OK on Intel.

>>Do you want a standard bug report on DVF, or is the fix in the source
>>pool already?

DVF T5.0.1 Beta 1 was frozen on 16-Apr so it could not contain this fix.  The
fix is in the sources so it will appread in DVF T5.0.1 Beta 2.

No extra bug report is necessary.

/Stan
1292.10yes, give them DFA411TLE::WHITLOCKStan WhitlockFri Jun 06 1997 09:3515
>>today i got the customer's response that the promised ECO is still not
>>available, and indeed it's not visible within TIMA TOOLS. 

The ECO was submitted yesterday so it isn't yet on TIMA.

>>May i kindly ask for a special private version of the planned ECO to provide
>>a solution for the customer?

The ECO is announced in note 21.last... and says that the kit is in

	ftp://format.zko.dec.com/DFA411.tar

Yes, you can give that kit to the customer.

/Stan
1292.11QUARK::LIONELFree advice is worth every centFri Jun 06 1997 10:464
Unfortunately, Stan, the ECO kit announced is for UNIX - the customer reported
the problem on OpenVMS.  We should have the OpenVMS kit ready next week.

				Steve