x86-64 Compiler wrongly accepts "q" suffix in ATT assembler for floating point values
Original Reporter info from Mantis: tom_at_work
-
Reporter name: Thomas Schatzl
Original Reporter info from Mantis: tom_at_work
- Reporter name: Thomas Schatzl
Description:
The x86-64 compiler/assembler reader accepts a "q" suffix for floating point instructions which is invalid.
GAS (2.11 here) rejects this suffix for fld instruction.
The error message when compiling the attached sample program is:
Free Pascal Compiler version 2.4.2 [2010/11/12] for x86_64
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Solaris for x86-64
Compiling x.pas
Assembling program
x.s: Assembler messages:
x.s:20: Error: suffix or operands invalid for `fld'
x.pas(11,4) Error: Error while assembling exitcode 1
x.pas(11,4) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
The generated assembler code looks as follows:
# [x.pas] # [4] begin pushq %rbp movq %rsp,%rbp call FPC_INITIALIZEUNITS # [6] fldl (%edi) fldl (%edi) # [7] fldq (%edi) fldq (%edi) # [8] flds (%edi) flds (%edi) # [9] fldt (%edi) fldt (%edi) # [11] end. call FPC_DO_EXIT leave
ret
Steps to reproduce:
Run the program added in "additional information".
Additional information:
{$ASMMODE ATT}
begin
asm
fldl (%edi)
fldq (%edi)
flds (%edi)
fldt (%edi)
end;
end.
Mantis conversion info:
- Mantis ID: 18900
- OS: Solaris
- OS Build: 5.11
- Build: release
- Platform: x86_64
- Version: 2.4.2
- Fixed in version: 2.6.0
- Fixed in revision: 17363 (#92adf34e)