Unboxed returns (multiple return values)#1248
Closed
Ekdohibs wants to merge 12 commits intooxcaml:mainfrom
Closed
Conversation
9b2a770 to
8524c17
Compare
Contributor
|
I've found a bug ! Compiling and executing the following code: let[@inline never][@unboxed] f x =
( (* each line has 20 elements *)
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x,
x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x
)
let () =
let (
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, y, _, _, _
)
= f 5
in
print_int y;
print_newline ()Results in the output The cause seems to be that after the call, the stack pointer is moved before moving the result into a register. It might be useful to add a few tests exercising unboxed result somewhere. |
Contributor
|
the bug above is fixed by f50cb88 |
Gbury
reviewed
Mar 23, 2023
e2f75d6 to
8ae47ab
Compare
Contributor
Author
|
Subsumed by #1271. |
This was referenced Apr 13, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a rebase of #1170, together with an attribute
[@unboxed]that can be added on the definition of a function to decide to have an unboxed result. It does not trigger automatically, as that would require thinking about a probably complex strategy to avoid reallocations (leading to two test failures).