Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce maximum repr(align(N)) to 2^29 #50378

Merged
merged 2 commits into from
May 3, 2018
Merged

Conversation

varkor
Copy link
Member

@varkor varkor commented May 1, 2018

The current maximum repr(align(N)) alignment is larger than the maximum alignment accepted by LLVM, which can cause issues for huge values of N, as seen in #49492. Fixes #49492.

r? @rkruppe

@varkor varkor changed the title Repr align max 29 Reduce maximum repr(align(N)) to 2^29 May 1, 2018
@varkor
Copy link
Member Author

varkor commented May 1, 2018

r? @rkruppe (I think something's wrong with @rust-highfive :( )

/// with a maximum capacity of 2<sup>31</sup> - 1 or 2147483647.
/// Each field is a power of two, giving the alignment a maximum value
/// of 2<sup>(2<sup>8</sup> - 1)</sup>, which is limited by LLVM to a
/// maximum capacity of 2<sup>29</sup> or 536870912.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure Align::from_bytes needs to be updated to reflect this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, of course!

@kennytm kennytm added T-lang Relevant to the language team, which will review and decide on the PR/issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 1, 2018
varkor added 2 commits May 1, 2018 22:01
This brings it into line with LLVM's maximum permitted alignment.
@varkor varkor force-pushed the repr-align-max-29 branch from af4022d to cd2f5f7 Compare May 1, 2018 21:02
@hanna-kruppe
Copy link
Contributor

cc @eddyb

@eddyb
Copy link
Member

eddyb commented May 1, 2018

@bors r+

@bors
Copy link
Contributor

bors commented May 1, 2018

📌 Commit cd2f5f7 has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 1, 2018
@bors
Copy link
Contributor

bors commented May 3, 2018

⌛ Testing commit cd2f5f7 with merge 427c548...

bors added a commit that referenced this pull request May 3, 2018
Reduce maximum repr(align(N)) to 2^29

The current maximum `repr(align(N))` alignment is larger than the maximum alignment accepted by LLVM, which can cause issues for huge values of `N`, as seen in #49492. Fixes #49492.

r? @rkruppe
@bors
Copy link
Contributor

bors commented May 3, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing 427c548 to master...

@bors bors merged commit cd2f5f7 into rust-lang:master May 3, 2018
@varkor varkor deleted the repr-align-max-29 branch May 3, 2018 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants