New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 37039 - [PowerPC, bisected] miscompilation in rust crate "futures"
Summary: [PowerPC, bisected] miscompilation in rust crate "futures"
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: PowerPC (show other bugs)
Version: 6.0
Hardware: PC Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks: release-6.0.1
  Show dependency tree
 
Reported: 2018-04-06 16:26 PDT by Josh Stone
Modified: 2018-06-11 16:19 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s): r329852 r330076


Attachments
proposed fix: convert RLDICLo using a 64-bit InVal too (1.01 KB, patch)
2018-04-06 16:26 PDT, Josh Stone
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Stone 2018-04-06 16:26:00 PDT
Created attachment 20170 [details]
proposed fix: convert RLDICLo using a 64-bit InVal too

ref: https://bugzilla.redhat.com/show_bug.cgi?id=1563393

We found one test case in the "futures" crate that started failing on ppc64 when we upgraded to Rust 1.25 with LLVM 6.0 (Fedora's LLVM, not Rust's fork).  The same test case still passes with Rust 1.25 and LLVM 5.0.

I bisected this to https://reviews.llvm.org/D41369.  You can find IR and binaries before and after that commit on the rhbz, but I didn't figure out an easy way to reproduce this directly.  I went through the whole motion of building LLVM, building rustc with that LLVM, then running the "futures" tests.

The attached patch seems to solve it, using a 64-bit value for PPC::RLDICLo in PPCInstrInfo::convertToImmediateForm.  I don't know enough about LLVM or PPC to distill a proper test though, so I hope someone who knows the platform better can figure that out.
Comment 1 Nemanja Ivanovic 2018-04-10 14:11:53 PDT
Thank you so much for tracking this down and suggesting a fix. You're absolutely right, both RLDICL and RLDICLo operate on 64-bit inputs and the fix is fine. Do you want me to commit it for you or do you have commit access?
Comment 2 Josh Stone 2018-04-10 15:10:53 PDT
I don't have commit access, so it would be great if you commit it, thanks!
Comment 3 Nemanja Ivanovic 2018-04-11 14:27:48 PDT
Committed revision 329852.

You mentioned that this was discovered in LLVM 6.0. Please let me know if you need this back-ported.
Comment 4 Josh Stone 2018-04-11 16:04:40 PDT
Thanks again!  Yes, I would appreciate having this on 6.0 too.  That is, even if it's not backported officially here, I would still ask our distro maintainers to patch it - so we might as well share the fix broadly. :)
Comment 5 Nemanja Ivanovic 2018-04-12 03:47:01 PDT
Hi Hans,
I didn't see whether we have a meta bug for tracking commits that we would like backported to 6.0 yet. Do you have one set up to track this?
Comment 6 Hans Wennborg 2018-04-12 04:23:54 PDT
(In reply to Nemanja Ivanovic from comment #5)
> Hi Hans,
> I didn't see whether we have a meta bug for tracking commits that we would
> like backported to 6.0 yet. Do you have one set up to track this?

Yes, it's Bug 36649
Comment 7 Nemanja Ivanovic 2018-04-12 04:39:14 PDT
Thanks Hans.
Comment 8 Tom Stellard 2018-04-13 16:28:05 PDT
r329852 was merged to the release_60 branch as r330076.