[arm] Fix code generation bug with "mod 1" (PR#5910).

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13662 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Benedikt Meurer 2013-05-08 13:21:32 +00:00
parent d31eb278a3
commit e86e81323a
2 changed files with 2 additions and 1 deletions

View File

@ -35,6 +35,7 @@ Standard library:
(Marshal.to_*), forcing the output to be readable on 32-bit hosts.
Bug fixes:
- PR#5910: Fix code generation bug for "mod 1" on ARM.
- PR#5973: Format module incorrectly parses format string
- PR#5121: %( %) in Format module seems to be broken
- PR#4887: input_char after close_in crashes ocaml (msvc runtime)

View File

@ -174,7 +174,7 @@ method! select_operation op args =
| (Cdivi, args) ->
(Iextcall("__aeabi_idiv", false), args)
| (Cmodi, [arg; Cconst_int n])
when n = 1 lsl Misc.log2 n ->
when n > 1 && n = 1 lsl Misc.log2 n ->
(Iintop_imm(Imod, n), [arg])
| (Cmodi, args) ->
(* See above for fix up of return register *)