Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

omajid
Copy link
Member

@omajid omajid commented Jan 31, 2022

Port fix of build using Clang 13 to release/3.1. Backport of dotnet/runtime#63314

Customer Impact

The recently released Clang 13 has started to apply assumption that this pointer is always aligned to the natural alignment of the object. These break compilation of .NET Core 3.1 e.g. on Fedora 35 where Clang 13 is the one installed. This issue was reported by Red Hat developers.

Testing

Local builds of release and debug versions using clang 9 and clang 13

Risk

Low, there are no functional changes and the fix has been in main and release/6.0 branches for about 2 months.


Original commit message:

  • Fix clang 13 induced runtime issues (#62170)

The clang 13 optimizer started to assume that "this" pointer is always
properly aligned. That lead to elimination of some code that was actually
needed.
It also takes pointer aliasing rules more strictly in one place in jit.
That caused the optimizer to falsely assume that a callee with an argument
passed by reference is not modifying that argument and used a stale
copy of the original value at the caller site.

This change fixes both of the issues. With this fix, runtime compiled
using clang 13 seems to be fully functional.

cc @janvorli

* Fix clang 13 induced runtime issues (#62170)

The clang 13 optimizer started to assume that "this" pointer is always
properly aligned. That lead to elimination of some code that was actually
needed.
It also takes pointer aliasing rules more strictly in one place in jit.
That caused the optimizer to falsely assume that a callee with an argument
passed by reference is not modifying that argument and used a stale
copy of the original value at the caller site.

This change fixes both of the issues. With this fix, runtime compiled
using clang 13 seems to be fully functional.
Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@janvorli janvorli added this to the 3.1 milestone Jan 31, 2022
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

Approved. We will take for consideration in 3.1.x

@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 1, 2022
@leecow leecow modified the milestones: 3.1, 3.1.24 Feb 1, 2022
@jeffschwMSFT
Copy link
Member

@safern is it time to merge these prs for the next release?

@safern safern merged commit cc5b241 into dotnet:release/3.1 Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants