[fpc-pascal] 2.4.0: Some lines are not compiled (just thrown away)

Gerhard Scholz gs at g--s.de
Sun Jan 24 21:10:45 CET 2010


Some lines are ignored.

An IF-clause is ignored.

Versin 2.2.4 runs o.k.!!!!

The program:

program rangtest ;

  type
    trange = 0..2030 ;
    ytrange = 1990..2030 ;

  CONST
    lrange =   low ( trange ) ;
    hrange =  high ( trange ) ;
    ylrange =  low ( ytrange ) ;
    yhrange = high ( ytrange ) ;

  var
    bbb : trange ;
    kkk : longint ;
    xyzzy : array [ ytrange, 1..100 ] of
              record
                xyzp : longint ;
                xyzb : boolean ;
               end ;

  begin       (*$r+,s+,o+*)
    bbb := 0 ;
    kkk := 1 ;
    IF ( bbb >= ylrange )                   //  this IFstatement can not be 
found in the assembler file
       AND ( bbb <= yhrange )         //  and the program stops with range 
error
      THEN begin                             //
        WITH xyzzy[bbb,kkk] DO
          BEGIN
            xyzp := 2 ;
            xyzb := True ;
           END ;
       end
      else writeln ( 'out' ) ;
   end.

OS: WinXP

Output of the compiler:

Free Pascal Compiler version 2.4.0 [2009/12/18] for i386
Copyright (c) 1993-2009 by Florian Klaempfl
Note: Switching assembler to default source writing assembler
Target OS: Win32 for i386
Compiling rangtest.pas
rangtest.pas(34,12) Warning: unreachable code
rangtest.pas(16,5) Note: Local variable "xyzzy" is assigned but never used
Assembling rangtest
Linking .\rangtest.exe
35 lines compiled, 0.1 sec , 35952 bytes code, 1728 bytes data
1 warning(s) issued
2 note(s) issued
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.

the assembler file (only the part from BEGIN to WITH)

# [rangtest.pas]
# [22] begin       (*$r+,s+,o+*)
 call FPC_INITIALIZEUNITS
 # Register eax,ecx,edx released
 # Register ax allocated
 .stabn 68,0,22,.Ll2 - _main
.Ll2:
 movw $0,%ax
 # Register eax allocated
 movl $0,%eax
 # Register eax released
 # Register dx allocated
 .stabn 68,0,23,.Ll3 - _main
.Ll3:
# [23] bbb := 0 ;
 movw $0,%dx
 # Register ecx allocated
 .stabn 68,0,24,.Ll4 - _main
.Ll4:
# [24] kkk := 1 ;
 movl $1,%ecx
 # Register eax allocated
 .stabn 68,0,28,.Ll5 - _main

##
## Here should be some result of the IF !!!!! the 2.2.4 version does not 
drop these lines
##

.Ll5:
# [28] WITH xyzzy[bbb,kkk] DO
 movzwl %dx,%eax
 subl $1990,%eax
 cmpl $40,%eax
 # Register eax released
 jbe .Lj9
 call FPC_RANGEERROR
.Lj9:




More information about the fpc-pascal mailing list