View Issue Details

IDProjectCategoryView StatusLast Update
0029019FPCCompilerpublic2019-11-04 14:24
ReporterIstvan KosztaAssigned ToMarco van de Voort 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformPENTIUMOSWINDOWSOS Versionxp SP3
Product Version3.1.1Product Build 
Target VersionFixed in Version 
Summary0029019: Probably intel assembler error:
Descriptionvar
colora[0..15] of tColorRef;
c_black :tColorRef absolute colora[0];
c_blue :tColorRef absolute colora[1];
...
o1,o2 :pointer
asm
       lea eax,c_blak; lea edx,c_blue; sub edx,eax // edx = 0 (bug)
end;
pascal:
 o1:= @c_black;
 o2:= @c_blue;
asm
  mov eax,o2; sub eax , o1 // eax = 4 (so ok)
end;
Tagsassembler
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files

Activities

Thaddy de Koning

2015-11-16 16:15

reporter   ~0087322

Last edited: 2015-11-16 16:16

View 2 revisions

This depends so much on context. Plz give us a compileable example as an attachment. And 2.6.4 is end-of -life so check with 3.0

Istvan Koszta

2015-11-16 17:21

reporter  

fpc002.dpr (674 bytes)

Marco van de Voort

2017-05-07 15:20

manager   ~0100139

Last edited: 2017-05-07 15:21

View 2 revisions

I tested the uploaded example with yesterday's 3.1.1 and

seems the assembler indeed doesn't regard the [1]:

# [27] lea edx , c_blue; lea eax , c_black ; sub edx , eax;
    leal U_$P$FPC001_$$_COLORA,%edx
    leal U_$P$FPC001_$$_COLORA,%eax

Marco van de Voort

2019-11-04 14:24

manager   ~0119050

Seems to be fixed in 3.3.1. Now produces on win32:
# [14] lea eax,c_black; lea edx,c_blue; sub edx,eax // edx = 0 (bug)
    leal U_$P$PROGRAM_$$_COLORA,%eax
    leal U_$P$PROGRAM_$$_COLORA+4,%edx
    subl %eax,%edx

Issue History

Date Modified Username Field Change
2015-11-16 15:45 Istvan Koszta New Issue
2015-11-16 15:52 Istvan Koszta Tag Attached: assembler
2015-11-16 16:15 Thaddy de Koning Note Added: 0087322
2015-11-16 16:16 Thaddy de Koning Note Edited: 0087322 View Revisions
2015-11-16 17:21 Istvan Koszta File Added: fpc002.dpr
2017-05-07 15:20 Marco van de Voort Note Added: 0100139
2017-05-07 15:20 Marco van de Voort Assigned To => Marco van de Voort
2017-05-07 15:20 Marco van de Voort Status new => confirmed
2017-05-07 15:21 Marco van de Voort Product Version 2.6.4 => 3.1.1
2017-05-07 15:21 Marco van de Voort Note Edited: 0100139 View Revisions
2019-11-04 14:24 Marco van de Voort Status confirmed => resolved
2019-11-04 14:24 Marco van de Voort Resolution open => fixed
2019-11-04 14:24 Marco van de Voort FPCTarget => -
2019-11-04 14:24 Marco van de Voort Note Added: 0119050