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

update LLVM with fix for PR32379 #40779

Merged
merged 1 commit into from
Mar 24, 2017
Merged

update LLVM with fix for PR32379 #40779

merged 1 commit into from
Mar 24, 2017

Conversation

arielb1
Copy link
Contributor

@arielb1 arielb1 commented Mar 23, 2017

Fixes #40593.

The "root" codegen bug fixed here is that, when generating ARM code, unpatched LLVM 3.9/3.9.1 miscompiles bit operations in rare circumstances - this can cause user code compiled via LLVM (through both rustc and clang) to subtly return incorrect results - for more details, see the test in this PR or in the LLVM rare report.

One effect of that LLVM bug is that rustc 1.17 (and possibly other versions) is miscompiled on ARM. The code generated by a miscompiled rustc lacks destructor calls in many circumstances.

Users who run an affected/miscompiled rustc - 1.17 or above - on an ARM build machine will be affected by the (fairly blatant) missing destructor bug, regardless of the target architecture (this includes the official 1.17.0-beta.1, 1.17.0-beta.2, and some official 1.17/1.18 nightlies).

Users who use an affected LLVM (that's any unpatched LLVM 3.9/3.9.1), whether through rustc (in any version that supports 3.9 - that's 1.12 or above) or through clang, who compile code to an ARM target architecture might be affected by the (fairly hard to hit) bit operation bug, regardless of the build machine.

Distributors and user who want to compile rustc using their own LLVM should apply the patch to avoid miscompilations.

r? @alexcrichton
Beta-nominating because regression (rustc 1.16 is not blatantly miscompiled). This also picks a fix for the (MSVC-affecting) PR29151.

@arielb1 arielb1 added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Mar 23, 2017
@alexcrichton
Copy link
Member

@bors: r+

Awesome work finding this bug! Seems like a great backport.

FWIW we have tons of bug fixes on our LLVM fork that correspond to no actual release of LLVM. Unless you're using literally our LLVM then there's basically guaranteed to be at least one regression waiting for you if you use the compiler long enough.

@bors
Copy link
Contributor

bors commented Mar 23, 2017

📌 Commit bd52ff1 has been approved by alexcrichton

@alexcrichton alexcrichton added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Mar 23, 2017
@arielb1
Copy link
Contributor Author

arielb1 commented Mar 23, 2017

@alexcrichton

That's mostly MSVC fixes + optimizations, but I recommend all the distributors who want a working rustc to at least include a fix for https://bugs.llvm.org/show_bug.cgi?id=29163 (but that is included in 3.9.1).

@sanxiyn
Copy link
Member

sanxiyn commented Mar 24, 2017

FYI, the importance of fix for LLVM 29163 is that without it rustup will segfault: see #36023.

@arielb1
Copy link
Contributor Author

arielb1 commented Mar 24, 2017

travis failure is a network error on Mac - the standard builder is green.

@pmarcelll
Copy link
Contributor

I just realized that the latest nightly is still 1.17, not 1.18.
cc @brson (Sorry for the noise.)

@arielb1
Copy link
Contributor Author

arielb1 commented Mar 24, 2017

@bors p=1

Try to get all 1.18 nightlies clean.

@bors
Copy link
Contributor

bors commented Mar 24, 2017

⌛ Testing commit bd52ff1 with merge 3da4023...

bors added a commit that referenced this pull request Mar 24, 2017
update LLVM with fix for PR32379

Fixes #40593.

The "root" codegen bug fixed here is that, when generating ARM code, unpatched LLVM 3.9/3.9.1 miscompiles bit operations in rare circumstances - this can cause user code compiled via LLVM (through both `rustc` and `clang`) to subtly return incorrect results - for more details, see the test in this PR or in the LLVM rare report.

One effect of that LLVM bug is that `rustc` 1.17 (and possibly other versions) is miscompiled on ARM. The code generated by a miscompiled `rustc` lacks destructor calls in many circumstances.

Users who run an affected/miscompiled `rustc` - 1.17 or above - on an ARM build machine will be affected by the (fairly blatant) missing destructor bug, regardless of the target architecture (this includes the official `1.17.0-beta.1`, `1.17.0-beta.2`, and some official 1.17/1.18 nightlies).

Users who use an affected LLVM (that's any unpatched LLVM 3.9/3.9.1), whether through `rustc` (in any version that supports 3.9 - that's 1.12 or above) or through `clang`, who compile code to an ARM target architecture might be affected by the (fairly hard to hit) bit operation bug, regardless of the build machine.

Distributors and user who want to compile rustc using their own LLVM should apply the [patch](llvm-mirror/llvm@cdc303e) to avoid miscompilations.

r? @alexcrichton
Beta-nominating because regression (rustc 1.16 is not blatantly miscompiled). This also picks a fix for the (MSVC-affecting) PR29151.
@bors
Copy link
Contributor

bors commented Mar 24, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 3da4023 to master...

@bors bors merged commit bd52ff1 into rust-lang:master Mar 24, 2017
@arielb1 arielb1 mentioned this pull request Mar 27, 2017
5 tasks
@alexcrichton alexcrichton removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 1, 2017
bors added a commit that referenced this pull request Apr 1, 2017
Backport PRs to beta

Backport of

* #40967
* #40836
* #40779
* #40888

Also includes a cargo submodule update
cuviper added a commit to cuviper/rust that referenced this pull request Apr 18, 2017
There was a serious ARM codegen bug in LLVM that was fixed by rust-lang#40779,
also backported to beta.  This updates stage0 to 1.17.0-beta.3 to pick
up that change, so ARM can bootstrap natively again.

Fixes rust-lang#41291
cc @arielb1
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 18, 2017
Bump stage0 to fix ARM LLVM

There was a serious ARM codegen bug in LLVM that was fixed by rust-lang#40779,
also backported to beta.  This updates stage0 to 1.17.0-beta.3 to pick
up that change, so ARM can bootstrap natively again.

Fixes rust-lang#41291
cc @arielb1
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 18, 2017
Bump stage0 to fix ARM LLVM

There was a serious ARM codegen bug in LLVM that was fixed by rust-lang#40779,
also backported to beta.  This updates stage0 to 1.17.0-beta.3 to pick
up that change, so ARM can bootstrap natively again.

Fixes rust-lang#41291
cc @arielb1
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 18, 2017
Bump stage0 to fix ARM LLVM

There was a serious ARM codegen bug in LLVM that was fixed by rust-lang#40779,
also backported to beta.  This updates stage0 to 1.17.0-beta.3 to pick
up that change, so ARM can bootstrap natively again.

Fixes rust-lang#41291
cc @arielb1
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 18, 2017
Bump stage0 to fix ARM LLVM

There was a serious ARM codegen bug in LLVM that was fixed by rust-lang#40779,
also backported to beta.  This updates stage0 to 1.17.0-beta.3 to pick
up that change, so ARM can bootstrap natively again.

Fixes rust-lang#41291
cc @arielb1
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 19, 2017
Bump stage0 to fix ARM LLVM

There was a serious ARM codegen bug in LLVM that was fixed by rust-lang#40779,
also backported to beta.  This updates stage0 to 1.17.0-beta.3 to pick
up that change, so ARM can bootstrap natively again.

Fixes rust-lang#41291
cc @arielb1
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 20, 2017
Bump stage0 to fix ARM LLVM

There was a serious ARM codegen bug in LLVM that was fixed by rust-lang#40779,
also backported to beta.  This updates stage0 to 1.17.0-beta.3 to pick
up that change, so ARM can bootstrap natively again.

Fixes rust-lang#41291
cc @arielb1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RefCell complains two mutable borrows present when only one exist on armv7-unknown-linux-gnueabihf
5 participants