View Issue Details

IDProjectCategoryView StatusLast Update
0034574FPCCompilerpublic2018-11-20 20:25
ReporterAkira1364Assigned ToJonas Maebe 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSWindowsOS Version10
Product Version3.3.1Product BuildApproximately r40345 (and above) 
Target VersionFixed in Version3.3.1 
Summary0034574: Additional notes on current Win64 build failures based on further investigation (before-and-after assembly listings attached)
DescriptionTo recap, as it stands right now attempts to do a full build of the FPC source tree on Win64 (with a bootstrap compiler binary that is also 64-bit) will consistently fail at the "packages_all" stage specifically because the FPMake executable generated by the newly-built compiler crashes immediately upon trying to build the first package.

I've attached two assembly listings for "fpmkunit.pp" here: one from a working build by the last "good" revision of the compiler, and one from a broken build by the current trunk revision of the compiler.
Steps To ReproduceBuild trunk from a Win64 bootstrap binary.
Additional InformationFrom what I can tell, the most significant difference is that the broken version appears to (invalidly, I believe) call things like "fpc_ansistr_decr_ref" on the same address two times in a row instead of just once in a large number of places, behaviour that is not present in the working version.

For example, from the "bad" build:

.section .text.n_fpmkunit$_$iswild$ansistring$ansistring$boolean$$boolean_$$_fin$93,"x"
    .balign 16,0x90
FPMKUNIT$_$ISWILD$ANSISTRING$ANSISTRING$BOOLEAN$$BOOLEAN_$$_fin$93:
.Lc6:
.seh_proc FPMKUNIT$_$ISWILD$ANSISTRING$ANSISTRING$BOOLEAN$$BOOLEAN_$$_fin$93
# [1527] begin
    pushq %rbp
.seh_pushreg %rbp
.Lc8:
.Lc9:
    movq %rcx,%rbp
.Lc10:
    leaq -32(%rsp),%rsp
.seh_stackalloc 32
.seh_endprologue
# [1601] end;
    leaq -8(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -16(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -112(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -104(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -96(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -64(%rbp),%rax
    movq %rax,%rcx
    call fpc_ansistr_decr_ref
    leaq -8(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -16(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -112(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -104(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -96(%rbp),%rcx
    call fpc_ansistr_decr_ref
    nop
    leaq 32(%rsp),%rsp
    popq %rbp
    ret
.seh_endproc

And from the "good" build:

.section .text.n_fpmkunit$_$iswild$ansistring$ansistring$boolean$$boolean_$$_fin$0,"x"
    .balign 16,0x90
FPMKUNIT$_$ISWILD$ANSISTRING$ANSISTRING$BOOLEAN$$BOOLEAN_$$_fin$0:
.Lc6:
.seh_proc FPMKUNIT$_$ISWILD$ANSISTRING$ANSISTRING$BOOLEAN$$BOOLEAN_$$_fin$0
# [1527] begin
    pushq %rbp
.seh_pushreg %rbp
.Lc8:
.Lc9:
    movq %rcx,%rbp
.Lc10:
    leaq -32(%rsp),%rsp
.seh_stackalloc 32
.seh_endprologue
# [1601] end;
    leaq -64(%rbp),%rax
    movq %rax,%rcx
    call fpc_ansistr_decr_ref
    leaq -112(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -104(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -96(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -8(%rbp),%rcx
    call fpc_ansistr_decr_ref
    leaq -16(%rbp),%rcx
    call fpc_ansistr_decr_ref
    nop
    leaq 32(%rsp),%rsp
    popq %rbp
    ret
.seh_endproc
TagsNo tags attached.
Fixed in Revision40357
FPCOldBugId
FPCTarget
Attached Files

Activities

Akira1364

2018-11-20 16:36

reporter  

fpmkunit_good.s (1,976,549 bytes)

Akira1364

2018-11-20 16:38

reporter  

fpmkunit_bad.s (1,994,989 bytes)

Jonas Maebe

2018-11-20 20:25

manager   ~0112086

Thanks for the analysis, should be fixed (can't test because I don't have win64).

Issue History

Date Modified Username Field Change
2018-11-20 16:36 Akira1364 New Issue
2018-11-20 16:36 Akira1364 File Added: fpmkunit_good.s
2018-11-20 16:38 Akira1364 File Added: fpmkunit_bad.s
2018-11-20 20:24 Jonas Maebe Assigned To => Jonas Maebe
2018-11-20 20:24 Jonas Maebe Status new => assigned
2018-11-20 20:25 Jonas Maebe Fixed in Revision => 40357
2018-11-20 20:25 Jonas Maebe Note Added: 0112086
2018-11-20 20:25 Jonas Maebe Status assigned => resolved
2018-11-20 20:25 Jonas Maebe Fixed in Version => 3.3.1
2018-11-20 20:25 Jonas Maebe Resolution open => fixed