-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix mod_inv termination for the last iteration #103378
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -455,6 +455,18 @@ fn align_offset_various_strides() { | |
assert!(!x); | ||
} | ||
|
||
#[test] | ||
fn align_offset_issue_103361() { | ||
#[cfg(target_pointer_width = "64")] | ||
const SIZE: usize = 1 << 47; | ||
#[cfg(target_pointer_width = "32")] | ||
const SIZE: usize = 1 << 30; | ||
#[cfg(target_pointer_width = "16")] | ||
const SIZE: usize = 1 << 13; | ||
struct HugeSize([u8; SIZE - 1]); | ||
let _ = (SIZE as *const HugeSize).align_offset(SIZE); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We usually prefer the strict provenance APIs in libcore -- #104632 Note sure if the lint against int2ptr casts ever got implemented? If yes we should probably enable it here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I basically just copy-pasted over the reproducer from the issue… |
||
} | ||
|
||
#[test] | ||
fn offset_from() { | ||
let mut a = [0; 5]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly
unchecked
is useless here today -- LLVM turnssub nuw %m, 1
intoadd %m, -1
during normalization :((Doesn't need to change here, though. I'm just sad about llvm/llvm-project#53377.)