Skip to content

[release/6.0] Add cast when replacing promoted struct with field in lowering - #58951

Merged
jeffschwMSFT merged 7 commits into
release/6.0from
backport/pr-58589-to-release/6.0
Sep 10, 2021
Merged

[release/6.0] Add cast when replacing promoted struct with field in lowering#58951
jeffschwMSFT merged 7 commits into
release/6.0from
backport/pr-58589-to-release/6.0

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Sep 10, 2021

Copy link
Copy Markdown
Contributor

Backport of #58589 to release/6.0

/cc @jakobbotsch

Customer Impact

Returning a pointer indirection reinterpreting a small struct as a small primitive type does not correctly zero/sign extend the result. We have one such case in our own libraries.

Testing

There are two test cases included.

Risk

Low, this is a targeted fix that inserts the necessary zero/sign-extensions when necessary.

We may need to sign/zero-extend when we do this replacement very late.
Normally this cast would be inserted in morph.
Fix#58373
Retyping it to the type of the ret node is not right when reinterpreting
small structs as a type that needs to be normalized.
@ghostghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 10, 2021
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #58589 to release/6.0

/cc @jakobbotsch

Customer Impact

Testing

Risk

Author:github-actions[bot]
Assignees:-
Labels:

area-CodeGen-coreclr

Milestone:-

@jeffschwMSFTjeffschwMSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Please get a code review and once we have a green ci we can merge.

@JulieLeeMSFT

Copy link
Copy Markdown
Member

CC @AndyAyersMS PTAL.

@jeffschwMSFT
jeffschwMSFT merged commit 9f2e4ac into release/6.0Sep 10, 2021
@jkotas
jkotas deleted the backport/pr-58589-to-release/6.0 branch September 18, 2021 04:09
@ghostghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@JulieLeeMSFT@jeffschwMSFT@AndyAyersMS@jakobbotsch