[fpc-devel]Corrected, but is still a bug in Compiler: Bug 1222 continued ...
Michael Knapp
mknapp at gmx.at
Wed Dec 20 16:27:25 CET 2000
compiled with snapshot ppc386 go32v2 ver 1.1 [2000/12/16]
asm source and comments see below
CONST
c1=$80000000;
c2=$80000001;
c3=$80000002;
c4=$80000003;
cm=$80000007;
VAR v:dword;
BEGIN
v:=c2;
CASE (v AND cm) OF
c1,c2:writeln('case c1,c2');
c3,c4:writeln('case c3,c4');
ELSE writeln('case failed, but it should not');
END;
END.
{
.file "bug1222.pas"
.text
.balign 16
# [bug1222.pas]
# [13] BEGIN
.globl _main
_main:
.globl PASCALMAIN
PASCALMAIN:
.globl program_init
program_init:
pushl %ebp
movl %esp,%ebp
subl $4,%esp
call FPC_INITIALIZEUNITS
# [14] v:=c2;
movl $-2147483647,_V
# [15] CASE (v AND cm) OF
movl _V,%eax EAX := 80000001
xorl %edx,%edx EDX := 00000000
andl .L13,%eax EAX := 80000001 .L13 = 80000007
andl .L13+4,%edx EDX := 00000000 .L13+4 = 00000000
cmpl $-1,%edx 00000000 - (-1) = +1 EDX is always 0 in
that case
jl .L12 jumps not
jg .L14 jumps to .L14
cmpl $-2147483648,%eax
jb .L12
.L14:
cmpl $-1,%edx 00000000 - (-1) = +1
jl .L3 jumps not
jg .L15 jumps to .L15
cmpl $-2147483647,%eax
jbe .L3
.L15:
cmpl $-1,%edx 00000000 - (-1) = +1
jl .L6 jumps not
jg .L16 jumps to .L16
cmpl $-2147483645,%eax
jbe .L6
.L16:
jmp .L12 jumps to .L12
.L6:
.L17:
# [17] c3,c4:writeln('case c3,c4');
leal U_SYSTEM_OUTPUT,%edi
movl %edi,-4(%ebp)
pushl $.L20
pushl -4(%ebp)
pushl $0
call FPC_WRITE_TEXT_SHORTSTR
pushl -4(%ebp)
call FPC_WRITELN_END
pushl $.L17
call FPC_IOCHECK
jmp .L11
.L3:
.L21:
# [16] c1,c2:writeln('case c1,c2');
leal U_SYSTEM_OUTPUT,%edi
movl %edi,-4(%ebp)
pushl $.L24
pushl -4(%ebp)
pushl $0
call FPC_WRITE_TEXT_SHORTSTR
pushl -4(%ebp)
call FPC_WRITELN_END
pushl $.L21
call FPC_IOCHECK
jmp .L11
.L12:
.L25:
# [18] ELSE writeln('case failed, but it should not');
leal U_SYSTEM_OUTPUT,%edi
movl %edi,-4(%ebp)
pushl $.L28
pushl -4(%ebp)
pushl $0
call FPC_WRITE_TEXT_SHORTSTR
pushl -4(%ebp)
call FPC_WRITELN_END
pushl $.L25
call FPC_IOCHECK
.L11:
# [20] END.
call FPC_DO_EXIT
leave
ret
.balign 16
.data
.ascii "FPC 1.1 [2000/12/16] for i386 - GO32V2"
.balign 4
.globl FPC_RESOURCESTRINGTABLES
FPC_RESOURCESTRINGTABLES:
.long 0
.globl INITFINAL
INITFINAL:
.long 1,0
.long INIT$$SYSTEM
.long 0
.globl HEAPSIZE
HEAPSIZE:
.long 2097152
.globl __stklen
__stklen:
.long 16384
.data
.L13:
.long -2147483641,0
.L20:
.ascii "\012case c3,c4\000"
.L24:
.ascii "\012case c1,c2\000"
.L28:
.ascii "\036case failed, but it should not\000"
.data
.bss
# [11] VAR v:dword;
.lcomm _V,4
.comm HEAP,2097152
}
--
+--------------------------------------------------------------------+
| Michael Knapp - Mauerbach - Niederösterreich - Austria - Europe |
| E-Mail: mknapp at gmx.at ICQ: 36542787 |
+--------------------------------------------------------------------+
| G r a p h i X http://programmierer.freepage.de/graphix/ |
| Graphics Library for Freepascal, Virtual Pascal and Borland Pascal |
| http://graphix4pascal.cjb.net/ http://www.graphix4pascal.de.vu/ |
+--------------------------------------------------------------------+
More information about the fpc-devel
mailing list