[fpc-devel] crash with -gt -O2 (regvar) in trunk

Martin fpc at mfriebe.de
Mon Jun 7 18:44:10 CEST 2010


On 06/06/2010 20:44, Martin wrote:
> On 05/06/2010 19:57, Jonas Maebe wrote:
>>
>> One thing that was added is the node level CSE optimiser. You can 
>> disable it with the -Oonocse command line option (put it in the 
>> command line after -O2). There are no changes to -gt that I remember.
>>
>
Comparing the assembler of the same file with and without -gt I noted 
soemthing else, I am not sure about

local vars are:
   GlyphValid, Handled: Boolean;
   CustomGlyph: TGraphic;
   BitmapHandle, MaskHandle: HBitmap;

As expected the begin of the method is equal, I only copied it for 
completeness

.section .text.n_buttons_tcustombitbtn_$__realizekind
     .balign 16,0x90
     .balign 16,0x90
.globl    BUTTONS_TCUSTOMBITBTN_$__REALIZEKIND
BUTTONS_TCUSTOMBITBTN_$__REALIZEKIND:
.Lc82:
# Temps allocated between ebp-76 and ebp-12
# path: .\include\
# file: bitbtn.inc
# indx: 2
.Ll204:
# [184] begin
     pushl    %ebp
.Lc84:
.Lc85:
     movl    %esp,%ebp
.Lc86:
     subl    $76,%esp
# Var $self located in register eax
# Var GlyphValid located in register al
# Var CustomGlyph located in register esi
     movl    %ebx,-76(%ebp)
     movl    %esi,-72(%ebp)
     movl    %edi,-68(%ebp)
# Var Handled located at ebp-4
# Var BitmapHandle located at ebp-8
# Var MaskHandle located at ebp-12
     movl    %eax,-60(%ebp)
# ============================= here starts the difference
# here is the trashing of locals

.Ll205:
     movb    $85,-64(%ebp)
     movb    $85,-4(%ebp)
     movl    $0,%esi  # <<<<<<<<<<<<<<<<<<<
     movl    $1431655765,-8(%ebp)
     movl    $1431655765,-12(%ebp)


The line I marked trashes " CustomGlyph: TGraphic"

Other objects are trashed with 1431655765 , but this one is trashed with 
$0 ? (that isn't really trash?)

Martin



More information about the fpc-devel mailing list