Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-03

fpc198 and old bugs

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bartek

hi,

i've just downloaded fpc198 and tried the following out. (there was a bug
with the stack in fpc)
//--------------------------------------------------------------------------
program bug2;
uses sysutils;
type
        tmmxint      =array[0..3] of smallint;
const
        x0 :tmmxint=(0,0,0,0);
var
        a,b,r :tmmxint;

function paddw(a,b :tmmxint):tmmxint;assembler;inline; asm
movq mm0, a
paddw mm0, b
movq @result, mm0
end;

begin
a:=x0;b:=x0;r:=x0;
a[0]:=1;b[0]:=1;
r:=paddw(a,b);
writeln(r[0]);
end.
//--------------------------------------------------------------------------
compilations aborts with:
//--------------------------------------------------------------------------
 Assembling bug2
 bug2.pas(8,13) Error: Error while assembling exitcode 1
 bug2.pas(8,13) Fatal: There were 2 errors compiling module, stopping
//--------------------------------------------------------------------------

other programs also using assembler compiled well.

i've also tried this one out:
//--------------------------------------------------------------------------
program bug;
uses heaptrc,sysutils;
begin
markheap;
end.
//--------------------------------------------------------------------------

output:
//-------------------------------------------------------------------------- ? Free Pascal IDE Version 1.0.2 [2005/02/21]
? Compiler Version 1.9.8
? GBD Version GDB 6.2.1
? Cygwin "E:\fpc198\bin\i386-win32\cygwin1.dll" version 1005.12.0.0 Running "e:\fpc198\work\bug.exe /P"
Marked memory at $00083514 invalid
Wrong signature $AAAAAAAA instead of 8736A0C5
$004072DB
$00404E74
$0040C6D6
$004096B4
$0040C473
$0040C1C9
$004082C6
$00408088
$004022C7
//--------------------------------------------------------------------------

thanks for help in advance
bartek

Reply by email

Peter Vreman
to Bartek
you wrote 20 lines
hi, i've just downloaded fpc198 and tried the following out. (there was a bug with the stack in fpc) //-------------------------------------------------------------------------- program bug2; uses sysutils; type tmmxint =array[0..3] of smallint; const x0 :tmmxint=(0,0,0,0); var a,b,r :tmmxint; function paddw(a,b :tmmxint):tmmxint;assembler;inline; asm movq mm0, a paddw mm0, b movq @result, mm0 end;

inline uses registers to pass arguments. movq doesn't support registers. You need to load a first in a local temp or use a different calling convention like stdcall.

Note also that inline is disabled for assembler procedures (same as with delphi 2005).

Show quoted text 6 lines
//-------------------------------------------------------------------------- program bug; uses heaptrc,sysutils; begin markheap; end.

Use the bug repository to report bugs otherwise they will be forgotten.

Peter

Reply by email

Bartek
to Peter Vreman

----- Original Message -----

Earlier message 21 lines
From: "Peter Vreman" To: "FPC-Pascal users discussions" Sent: Tuesday, March 08, 2005 10:12 PM Subject: Re: [fpc-pascal] fpc198 and old bugs > >//------------------------------------------------------------------------- - > >program bug; > >uses heaptrc,sysutils; > >begin > >markheap; > >end. > > Use the bug repository to report bugs otherwise they will be forgotten. done so. thanks for your answer. bartek

Reply by email