wrong range-check errors reported with INLINE-functions
Original Reporter info from Mantis: Raziel
-
Reporter name:
Original Reporter info from Mantis: Raziel
- Reporter name:
Description:
adding a INLINE-clause to a routine causes FPC 2.6.0 to errornously report a range-check error when calling the routine.
Steps to reproduce:
The repcase-program looks as follows:
D:\My_Files\Projects\work\SYSLIB\src>type playground.pas
PROGRAM PLAYGROUND( OUTPUT );
VAR
v_byte : BYTE = 0;
FUNCTION F_Some( VAR X : BYTE; Y : BYTE ) : BYTE; INLINE;
BEGIN X := X AND NOT Y; EXIT( X ); END;
BEGIN
WRITELN( F_Some( v_byte, 1 ) );
END.
Additional information:
compiling the repcase-program fails with FPC 2.6.0 ...
D:\My_Files\Projects\work\SYSLIB\src>g:\Compiler\FPC\2.6.0\bin\i386-win32\fpc.exe -iD -iW -iSO -iSP -iTO -iTP
2011/12/25 2.6.0 win32 i386 win32 i386
D:\My_Files\Projects\work\SYSLIB\src>g:\Compiler\FPC\2.6.0\bin\i386-win32\fpc.exe -Cr PLAYGROUND.pas
Free Pascal Compiler version 2.6.0 [2011/12/25] for i386
Copyright (c) 1993-2011 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling PLAYGROUND.pas
PLAYGROUND.pas(10,34) Error: range check error while evaluating constants
PLAYGROUND.pas(12) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: g:\Compiler\FPC\2.6.0\bin\i386-win32\ppc386.exe returned an error exitcode (normal if you did not specify a source file to be compiled)
... but correctly succeeds with 2.4.2 (I didn't try previous versions)
D:\My_Files\Projects\work\SYSLIB\src>g:\Compiler\FPC\2.4.2\bin\i386-win32\fpc.exe -iD -iW -iSO -iSP -iTO -iTP
2010/11/10 2.4.2 win32 i386 win32 i386
D:\My_Files\Projects\work\SYSLIB\src>g:\Compiler\FPC\2.4.2\bin\i386-win32\fpc.exe -Cr PLAYGROUND.pas
Free Pascal Compiler version 2.4.2 [2010/11/10] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Win32 for i386
Compiling PLAYGROUND.pas
Linking PLAYGROUND.exe
11 lines compiled, 0.1 sec , 26160 bytes code, 1528 bytes data
Mantis conversion info:
- Mantis ID: 21029
- OS: Windows XP
- OS Build: SP3
- Platform: Win32-i386
- Version: 2.6.0
- Fixed in version: 2.6.1
- Fixed in revision: 20427 (#75aac428)