Skip to content

Commit

Permalink
Merge pull request #511 from MatthewFluet/toAddressMemLoc-disp-bug
Browse files Browse the repository at this point in the history
Fix `RegisterAllocation.toAddressMemLoc:disp` internal compiler error
  • Loading branch information
MatthewFluet authored Aug 31, 2023
2 parents 99b0643 + 2903750 commit 9213775
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
13 changes: 10 additions & 3 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ Here are the changes from version 20210117 to YYYYMMDD.

=== Details

* 2023-0-728
** Fix bug in `Date.localOffset` for time zones east of prime meridian.
Thanks to Arata Mizuki (minoki) for the bug report and suggested fix.
* 2023-08-31
** Fix bug in x86 and amd64 native codegens leading to an internal
compiler error
(`Fail: amd64AllocateRegisters.RegisterAllocation.toAddressMemLoc:disp`).
Thanks to Darin Minamoto (DarinM223) for the bug report.

* 2023-07-28
** Fix bug in `Date.localOffset` for time zones east of prime
meridian. Thanks to Arata Mizuki (minoki) for the bug report and
suggested fix.

* 2023-05-29
** Fix bugs in `WORD.scan` when `0` is followed by `w` or `x` or
Expand Down
4 changes: 3 additions & 1 deletion mlton/codegen/amd64-codegen/amd64-allocate-registers.fun
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(* Copyright (C) 2010,2020 Matthew Fluet.
(* Copyright (C) 2010,2020,2023 Matthew Fluet.
* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
* Copyright (C) 1997-2000 NEC Research Institute.
Expand Down Expand Up @@ -3775,6 +3775,8 @@ struct
Immediate.labelPlusWord (l1, w2)
| (Immediate.LabelPlusWord (l1, w1), Immediate.Word w2) =>
Immediate.labelPlusWord (l1, WordX.add (w1, w2))
| (Immediate.Word w1, Immediate.Word w2) =>
Immediate.word (WordX.add (w1, w2))
| _ => Error.bug "amd64AllocateRegisters.RegisterAllocation.toAddressMemLoc:disp")

(* The base register gets supplied by three distinct cases:
Expand Down
4 changes: 3 additions & 1 deletion mlton/codegen/x86-codegen/x86-allocate-registers.fun
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(* Copyright (C) 2010,2020 Matthew Fluet.
(* Copyright (C) 2010,2020,2023 Matthew Fluet.
* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
* Copyright (C) 1997-2000 NEC Research Institute.
Expand Down Expand Up @@ -3501,6 +3501,8 @@ struct
Immediate.labelPlusWord (mungeLabel l1, w2)
| (Immediate.LabelPlusWord (l1, w1), Immediate.Word w2) =>
Immediate.labelPlusWord (mungeLabel l1, WordX.add (w1, w2))
| (Immediate.Word w1, Immediate.Word w2) =>
Immediate.word (WordX.add (w1, w2))
| _ => Error.bug "x86AllocateRegisters.RegisterAllocation.toAddressMemLoc:disp")

val {register = register_base,
Expand Down

0 comments on commit 9213775

Please sign in to comment.