Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocaml native compiler generates improper assembler code on debian AMD64 #4067

Closed
vicuna opened this issue Jul 21, 2006 · 4 comments
Closed
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Jul 21, 2006

Original bug ID: 4067
Reporter: NicolasArchambault
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2006-08-01T01:06:59Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.09.2
Category: ~DO NOT USE (was: OCaml general)
Monitored by: NicolasArchambault

Bug description

On AMD64, I have an assembler error message with the attached file (works fine on i386).

ocamlopt.opt -noassert -inline 10 -c bugamd64.ml
/tmp/camlasmb9eccb.s: Assembler messages:
/tmp/camlasmb9eccb.s:115: Error: suffix or operands invalid for `movabs'
Assembler error, input left in file /tmp/camlasmb9eccb.s

I could not reduce the code further without the error vanishing.

Additional information

With latest debian packages (stable and unstable)

On debian unstable :

dpkg -l ocaml-native-compilers
ii ocaml-native-compilers 3.09.2-5

ocamlopt -v
The Objective Caml native-code compiler, version 3.09.2
Standard library directory: /usr/lib/ocaml/3.09.2

On debian sarge :
dpkg -l ocaml-native-compilers
ii ocaml-native-compilers 3.08.3-3

ocamlopt -v
The Objective Caml native-code compiler, version 3.08.3
Standard library directory: /usr/lib/ocaml/3.08.3

File attachments

@vicuna
Copy link
Author

vicuna commented Jul 27, 2006

Comment author: @xavierleroy

I cannot reproduce the problem on my Mandriva x86_64 installation.
The two "movabs" instructions generated are:
movabsq $9223372036854775807, %rcx
movabsq $9223372036854775807, %rax
as --version says
GNU assembler 2.15.90.0.3 20040415

Could you please compile the following C snippet on your machine
using "gcc -S" and look at the generated .s file? On my machine,
it generates a "movabsq" instruction.

long f(void)
{
return 9223372036854775807;
}

@vicuna
Copy link
Author

vicuna commented Jul 28, 2006

Comment author: @xavierleroy

[ I'm not sure you were notified of the first note, so here is a copy. ]

I cannot reproduce the problem on my Mandriva x86_64 installation.
The two "movabs" instructions generated are:
movabsq $9223372036854775807, %rcx
movabsq $9223372036854775807, %rax
as --version says
GNU assembler 2.15.90.0.3 20040415

Could you please compile the following C snippet on your machine
using "gcc -S" and look at the generated .s file? On my machine,
it generates a "movabsq" instruction.

long f(void)
{
return 9223372036854775807;
}

@vicuna
Copy link
Author

vicuna commented Jul 28, 2006

Comment author: NicolasArchambault

For me, the two movabs instructions are (Sarge and Sid) :
movabsq $9223372036854775807, 32(%rsp)
movabsq $9223372036854775807, %rax

Your snippet generates the same instruction :
movabsq $9223372036854775807, %rax

Sarge :
as --version
GNU assembler 2.15

Sid :
as --version
GNU assembler 2.17 Debian GNU/Linux

Sorry, I had your note yesterday but was unable to test at the moment.

@vicuna
Copy link
Author

vicuna commented Aug 1, 2006

Comment author: @xavierleroy

The culprit is movabsq $xxxxx, 32($rsp), which is incorrect indeed.
Fixed in 3.09.3, file asmcomp/amd64/reload.ml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants