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

Bug in ARM ocaml 3.01 #2735

Closed
vicuna opened this issue Mar 30, 2001 · 2 comments
Closed

Bug in ARM ocaml 3.01 #2735

vicuna opened this issue Mar 30, 2001 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 30, 2001

Original bug ID: 328
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

While attempting to `make opt' on an ARM-based NetWinder running Linux
with GNU binutils I discovered an ARM-specific bug in the code
generator.

The code generator created an invalid constant while running

../../../boot/ocamlrun ../../../ocamlopt -I ../../../stdlib -labels -c
-I ../support tk.ml

The constant is #1180, or 010010110010 in binary. The instructions are

add sp, sp, #1180
sub sp, sp, #1180

If you take a look at the ARM instruction format (tricky, only Mitel
supplies useful ARM documents these days), you will see that the constant
number is formed by right shifting an 8-bit value an even number of
positions. (The shift is encoded in a 4-bit value.) Unfortunately,
1180 contains 1s that are too far apart to be encoded. To use constants
that do not fit into the given format you will need to store the
constant in a register or use several ADD/SUB operations.

I can send you the .s file if you like.

The bug-reporting web site mentioned in the ocaml 3.01 README doesn't
seem to exist.

--

-- Michael Van Biesbrouck, mlvanbie@thinkage.ca

:b^Js/(.)(,.):\1(.)([a-z])(.)r(:.)>\3/\4\2:\1\3\4\5r\6\5>/
s/(.)(,.):\1(.)([a-z])(.)l(:.)(.)>\3/\4\2:\1\3\4\5l\6>\7\5/
s/>$/>0/^J/^halt/!bb

@vicuna
Copy link
Author

vicuna commented Mar 30, 2001

Comment author: administrator

While attempting to `make opt' on an ARM-based NetWinder running Linux
with GNU binutils I discovered an ARM-specific bug in the code
generator.

Correct. Thanks for the detailed analysis. I'll try to fix this.
Since I no longer have access to a Netwinder, would you be willing to
beta-test the fix?

The bug-reporting web site mentioned in the ocaml 3.01 README doesn't
seem to exist.

Oups, the URL was wrong. Thanks for mentioning it.

Regards,

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Apr 6, 2001

Comment author: administrator

Same bug as #2734. Fixed 2001-04-03 by XL.

@vicuna vicuna closed this as completed Apr 6, 2001
@vicuna vicuna added the bug label Mar 19, 2019
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

1 participant