-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Optimization of deinitialization became worse in nightly #149727
Copy link
Copy link
Open
Labels
A-codegenArea: Code generationArea: Code generationC-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchS-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Milestone
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationC-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchS-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Code
I tried this code (not from real code, but just experimenting):
In beta, this compiles to (Godbolt):
In nightly, this compiles to (Godbolt):
Since we've deinitialized the memory that
xpoints to, returning a copy of that memory should result in returning uninit. The compiler should be free to return whatever garbage data it wants, so justretis a valid compilation, and is probably the best-performing compilation result.Version it worked on
It most recently worked on Godbolt full compiler version:
Version with regression
Godbolt full compiler version: