Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006006OCamlOCaml backend (code generation)public2013-05-05 17:422013-05-08 15:25
Reporterwime 
Assigned Tomeurer 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.00.1 
Target VersionFixed in Version4.00.2+dev 
Summary0006006: Cannot "ocamlopt" the expression "x mod 1" on ARM
DescriptionWhen I tried to compile ocamlnet on a Pandaboard the compiler failed with the messages

...
/tmp/camlasm0de67d.s: Assembler messages:
/tmp/camlasm0de67d.s:9339: Error: shift expression is too large -- `mov r0,r1,lsl#32'
/tmp/camlasm0de67d.s:9431: Error: shift expression is too large -- `mov r4,r5,lsl#32'
File "netmech_scram.ml", line 1:
Error: Assembler error, input left in file /tmp/camlasm0de67d.s
make[1]: *** [netmech_scram.cmx] Fehler 2
make: *** [opt] Fehler 2
Steps To ReproduceThe following simplified code produces a similar error if you "ocamlopt" it. ocamlc works fine.

let x = (Random.int 255) in print_int (x mod 1);
Additional InformationCurrently "x mod 1" results in an left bit shift of 32 bits (lsl#32), which is not allowed on ARM. I was able to circumvent this problem by applying the attached patch, which limits the shift width to 31 bits and handles 32 bits in a separate case. It might need some refinement.
TagsNo tags attached.
Attached Filespatch file icon ocaml_arm_mod.patch [^] (1,668 bytes) 2013-05-05 17:42 [Show Content]

- Relationships
duplicate of 0005910resolvedmeurer assembler complains of invalid code 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2013-05-05 17:42 wime New Issue
2013-05-05 17:42 wime File Added: ocaml_arm_mod.patch
2013-05-06 09:13 xleroy Assigned To => meurer
2013-05-06 09:13 xleroy Status new => acknowledged
2013-05-07 14:15 meurer Relationship added duplicate of 0005910
2013-05-08 15:25 meurer Status acknowledged => resolved
2013-05-08 15:25 meurer Fixed in Version => 4.00.2+dev
2013-05-08 15:25 meurer Resolution open => fixed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker