Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add back
noalias
to &mut T
pointer parameters
This was removed because these could alias with `&const T` or `@mut T` and those are now gone from the language. There are still aliasing issues within local scopes, but this is correct for function parameters. This also removes the no-op `noalias` marker on proc (not a pointer) and leaves out the mention of #6750 because real type-based alias analysis is not within the scope of best effort usage of the `noalias` attribute. Test case: pub fn foo(x: &mut &mut u32) { **x = 5; **x = 5; } Before: define void @_ZN3foo20h0ce94c9671b0150bdaa4v0.0E(i32** nocapture readonly) unnamed_addr #0 { entry-block: %1 = load i32** %0, align 8 store i32 5, i32* %1, align 4 %2 = load i32** %0, align 8 store i32 5, i32* %2, align 4 ret void } After: define void @_ZN3foo20h0ce94c9671b0150bdaa4v0.0E(i32** noalias nocapture readonly) unnamed_addr #0 { entry-block: %1 = load i32** %0, align 8 store i32 5, i32* %1, align 4 ret void } Closes #12436
- Loading branch information
f62c753
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.
saw approval from pcwalton
at https://github.com/thestinger/rust/commit/f62c753b8f7879607204bcf77491cc81baf9c2dc
f62c753
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.
merging thestinger/rust/noalias = f62c753 into auto
f62c753
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.
thestinger/rust/noalias = f62c753 merged ok, testing candidate = 2be738a
f62c753
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.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5592
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5588
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/4682
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4694
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5690
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/4778
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4786
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5692
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/4777
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/4783
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/4845
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2579
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/5685
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/4781
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4796
f62c753
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.
fast-forwarding master to auto = 2be738a