Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1554349 - LLVM ERROR: Cannot select: 0x7fff84646d20: ch = PPCISD::STBRX<ST6[%747](align=1)> 0x7fff843fc138, 0x7fff84646f90, 0x7fff848c46d8, ValueType:ch:i48
Summary: LLVM ERROR: Cannot select: 0x7fff84646d20: ch = PPCISD::STBRX<ST6[%747](align...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm
Version: rawhide
Hardware: ppc64le
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tilmann Scheller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-12 13:55 UTC by Igor Gnatenko
Modified: 2018-04-05 14:36 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1558226 (view as bug list)
Environment:
Last Closed: 2018-04-05 14:36:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
llvm-ir from rust 1.25-beta with llvm-6 (1.46 MB, application/x-xz)
2018-03-12 19:35 UTC, Josh Stone
no flags Details
Reduced test case (7.34 KB, text/plain)
2018-03-13 13:17 UTC, Tilmann Scheller
no flags Details


Links
System ID Private Priority Status Summary Last Updated
LLVM 35402 0 None None None 2018-03-13 15:26:00 UTC

Description Igor Gnatenko 2018-03-12 13:55:27 UTC
Running `/usr/bin/rustc --crate-name hyper src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="server-proto"' --cfg 'feature="tokio-proto"' -C metadata=996ec52bb3550cfa -C extra-filename=-996ec52bb3550cfa --out-dir /builddir/build/BUILD/hyper-0.11.22/target/release/deps -L dependency=/builddir/build/BUILD/hyper-0.11.22/target/release/deps --extern bytes=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libbytes-1cd6c276cb8c38c6.rlib --extern log=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/liblog-24453bcead8e001a.rlib --extern tokio_core=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libtokio_core-589f535c37b7e80b.rlib --extern relay=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/librelay-9e9e8a7e81d7566d.rlib --extern tokio_proto=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libtokio_proto-ac8864d0cc5d2ab5.rlib --extern percent_encoding=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libpercent_encoding-346527c6195ab050.rlib --extern base64=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libbase64-735243170dafb065.rlib --extern tokio_io=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libtokio_io-48ee6b77ac907338.rlib --extern iovec=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libiovec-bfe3c06d15bd96b1.rlib --extern unicase=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libunicase-f72ada045f556fa7.rlib --extern language_tags=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/liblanguage_tags-cc51ad236b75629f.rlib --extern tokio_service=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libtokio_service-0f8373c6d0e5ea3b.rlib --extern time=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libtime-4b661d71f798265a.rlib --extern mime=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libmime-69b309de50dc3892.rlib --extern futures_cpupool=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libfutures_cpupool-fbd61af11ff2776d.rlib --extern futures=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libfutures-3481a32bf0b18d01.rlib --extern httparse=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libhttparse-28b64b396a8b7567.rlib -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now`
LLVM ERROR: Cannot select: 0x7fff84646d20: ch = PPCISD::STBRX<ST6[%747](align=1)> 0x7fff843fc138, 0x7fff84646f90, 0x7fff848c46d8, ValueType:ch:i48
  0x7fff84646f90: i32 = truncate 0x7fff848c4190
    0x7fff848c4190: i64 = srl 0x7fff84646b18, Constant:i32<16>
      0x7fff84646b18: i64 = or 0x7fff848c3cb0, 0x7fff848c4878
        0x7fff848c3cb0: i64,ch = CopyFromReg 0x7fff843fc138, Register:i64 %vreg246
          0x7fff845e8f78: i64 = Register %vreg246
        0x7fff848c4878: i64 = shl 0x7fff846468a8, Constant:i32<16>
          0x7fff846468a8: i64 = AssertZext 0x7fff845e9800, ValueType:ch:i8
            0x7fff845e9800: i64,ch = CopyFromReg 0x7fff843fc138, Register:i64 %vreg248
              0x7fff848c4260: i64 = Register %vreg248
          0x7fff848c3ff0: i32 = Constant<16>
      0x7fff848c3ff0: i32 = Constant<16>
  0x7fff848c46d8: i64,ch = CopyFromReg 0x7fff843fc138, Register:i64 %vreg216
    0x7fff848c4128: i64 = Register %vreg216
In function: _ZN6base646decode6decode17h413b2e942bfe7a42E
error: Could not compile `hyper`.
Caused by:
  process didn't exit successfully: `/usr/bin/rustc --crate-name hyper src/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 --cfg feature="default" --cfg feature="server-proto" --cfg feature="tokio-proto" -C metadata=996ec52bb3550cfa -C extra-filename=-996ec52bb3550cfa --out-dir /builddir/build/BUILD/hyper-0.11.22/target/release/deps -L dependency=/builddir/build/BUILD/hyper-0.11.22/target/release/deps --extern bytes=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libbytes-1cd6c276cb8c38c6.rlib --extern log=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/liblog-24453bcead8e001a.rlib --extern tokio_core=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libtokio_core-589f535c37b7e80b.rlib --extern relay=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/librelay-9e9e8a7e81d7566d.rlib --extern tokio_proto=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libtokio_proto-ac8864d0cc5d2ab5.rlib --extern percent_encoding=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libpercent_encoding-346527c6195ab050.rlib --extern base64=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libbase64-735243170dafb065.rlib --extern tokio_io=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libtokio_io-48ee6b77ac907338.rlib --extern iovec=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libiovec-bfe3c06d15bd96b1.rlib --extern unicase=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libunicase-f72ada045f556fa7.rlib --extern language_tags=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/liblanguage_tags-cc51ad236b75629f.rlib --extern tokio_service=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libtokio_service-0f8373c6d0e5ea3b.rlib --extern time=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libtime-4b661d71f798265a.rlib --extern mime=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libmime-69b309de50dc3892.rlib --extern futures_cpupool=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libfutures_cpupool-fbd61af11ff2776d.rlib --extern futures=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libfutures-3481a32bf0b18d01.rlib --extern httparse=/builddir/build/BUILD/hyper-0.11.22/target/release/deps/libhttparse-28b64b396a8b7567.rlib -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now` (exit code: 1)

Probably bug in LLVM.

Comment 1 Igor Gnatenko 2018-03-12 14:05:00 UTC
100% reproducible on ppc64le with hyper crate.

Comment 2 Josh Stone 2018-03-12 16:54:48 UTC
On the surface, it looks very similar to this bug report:
https://bugs.llvm.org/show_bug.cgi?id=35402

Comment 3 Tom Stellard 2018-03-12 18:27:59 UTC
This is an LLVM issue.  Is there any way we can get an LLVM IR dump from rust?

Comment 4 Igor Gnatenko 2018-03-12 18:49:46 UTC
(In reply to Tom Stellard from comment #3)
> This is an LLVM issue.  Is there any way we can get an LLVM IR dump from
> rust?

https://kojipkgs.fedoraproject.org//work/tasks/3527/25663527/build.log

Unfortunately not in tarball, but it's hard to grab any archive from koji...

Comment 5 Dave Malcolm 2018-03-12 18:55:49 UTC
(In reply to Igor Gnatenko from comment #4)
> (In reply to Tom Stellard from comment #3)
> > This is an LLVM issue.  Is there any way we can get an LLVM IR dump from
> > rust?
> 
> https://kojipkgs.fedoraproject.org//work/tasks/3527/25663527/build.log
> 
> Unfortunately not in tarball, but it's hard to grab any archive from koji...

FWIW, for gcc, we have a hook to dump the preprocessed source on a crash (as /tmp/cc*out), and then use something like:

    BuildRequires: sharutils

and then:

  make || : ( tar cf - /tmp/cc*.out | bzip2 -9 | uuencode cc.tar.bz2 )

which stashes a uuencoded form of the tarball into the Koji build log, from which one can copy&paste it, and then decode it back to a tarball.

Comment 6 Igor Gnatenko 2018-03-12 19:07:07 UTC
Here we go: https://kojipkgs.fedoraproject.org//work/tasks/3864/25663864/build.log

Comment 7 Josh Stone 2018-03-12 19:35:04 UTC
Created attachment 1407362 [details]
llvm-ir from rust 1.25-beta with llvm-6

Here are the output files that I get from my scratch build of Rust 1.25 beta using LLVM 6, running: rustc ... --emit=llvm-ir

Comment 8 Josh Stone 2018-03-12 19:36:53 UTC
That rustc beta build is here:
https://koji.fedoraproject.org/koji/taskinfo?taskID=25562954

It also reproduces with the current stable rustc, using llvm5.0-libs.

Comment 9 Josh Stone 2018-03-12 19:45:43 UTC
It does NOT reproduce on Fedora 26, rust-1.24.0 and llvm-libs-4.0.1.

Comment 10 Tilmann Scheller 2018-03-13 13:17:24 UTC
Created attachment 1407574 [details]
Reduced test case

Reduced test case that works with LLVM 4.0

Comment 11 Tilmann Scheller 2018-03-13 13:20:41 UTC
The reduced test case reproduces with a trunk build from today and LLVM 5.0.1 in Fedora 27. Can confirm that it does not reproduce with the llc from the llvm4.0 package in Fedora 27.

Currently bisecting to find out at which point between 4.0 and 5.0 the regression was introduced.

Comment 12 Tilmann Scheller 2018-03-13 13:39:17 UTC
Looks like the regression was introduced a year ago with the following change in r296811:

commit f2f076498022ec1ab5abadb7349f62b1dbc2ac0d
Author: Guozhi Wei <carrot>
Date:   Thu Mar 2 21:07:59 2017 +0000

    [PPC] Fix code generation for bswap(int32) followed by store16
    
    This patch fixes pr32063.
    
    Current code in PPCTargetLowering::PerformDAGCombine can transform
    
    bswap
    store
    
    into a single PPCISD::STBRX instruction. but it doesn't consider the case that the operand size of bswap may be larger than store size. When it occurs, we need 2 modifications,
    
    1 For the last operand of PPCISD::STBRX, we should not use DAG.getValueType(N->getOperand(1).getValueType()), instead we should use cast<StoreSDNode>(N)->getMemoryVT().
    
    2 Before PPCISD::STBRX, we need to shift the original operand of bswap to the right side.
    
    Differential Revision: https://reviews.llvm.org/D30362


Will investigate further and file a bug upstream.

Comment 13 Tilmann Scheller 2018-03-16 19:20:42 UTC
Has been fixed upstream in http://llvm.org/viewvc/llvm-project?view=revision&revision=327651.

Comment 14 Tom Stellard 2018-03-20 03:22:50 UTC
Fixed in rawhide: llvm-6.0.0-8.fc29

Comment 15 Fedora Update System 2018-03-20 16:02:37 UTC
llvm4.0-4.0.1-4.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-5db8f23c3f

Comment 16 Fedora Update System 2018-03-20 16:06:06 UTC
llvm-5.0.1-5.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-cffb23a2cc

Comment 17 Fedora Update System 2018-03-20 18:33:47 UTC
llvm-4.0.1-3.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-add17f7db7

Comment 18 Fedora Update System 2018-03-20 19:39:46 UTC
llvm4.0-4.0.1-4.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-5db8f23c3f

Comment 19 Fedora Update System 2018-03-20 19:39:53 UTC
llvm-5.0.1-5.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-cffb23a2cc

Comment 20 Fedora Update System 2018-03-20 23:28:17 UTC
llvm5.0-5.0.1-7.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-c1c16c1fdb

Comment 21 Fedora Update System 2018-03-21 14:14:10 UTC
llvm5.0-5.0.1-7.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-c1c16c1fdb

Comment 22 Fedora Update System 2018-03-21 15:00:59 UTC
llvm-4.0.1-3.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-add17f7db7

Comment 23 Fedora Update System 2018-03-23 16:54:44 UTC
llvm-5.0.1-5.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2018-03-26 17:27:35 UTC
llvm-4.0.1-3.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2018-03-28 23:49:19 UTC
llvm4.0-4.0.1-4.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2018-03-30 13:11:17 UTC
llvm5.0-5.0.1-7.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 27 Fedora Update System 2018-04-02 14:21:22 UTC
pocl-1.1-2.fc28 lldb-6.0.0-3.fc28 clang-6.0.0-5.fc28 llvm-6.0.0-11.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-02c4091319

Comment 28 Fedora Update System 2018-04-03 15:57:11 UTC
clang-6.0.0-5.fc28, lldb-6.0.0-3.fc28, llvm-6.0.0-11.fc28, mesa-18.0.0-2.fc28.1, pocl-1.1-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-02c4091319

Comment 29 Fedora Update System 2018-04-03 23:25:12 UTC
clang-6.0.0-5.fc28 lldb-6.0.0-3.fc28 llvm-6.0.0-11.fc28 mesa-18.0.0-3.fc28 pocl-1.1-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-02c4091319

Comment 30 Fedora Update System 2018-04-04 18:35:03 UTC
clang-6.0.0-5.fc28, lldb-6.0.0-3.fc28, llvm-6.0.0-11.fc28, mesa-18.0.0-3.fc28, pocl-1.1-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-02c4091319

Comment 31 Fedora Update System 2018-04-05 11:47:46 UTC
clang-6.0.0-5.fc28, lldb-6.0.0-3.fc28, llvm-6.0.0-11.fc28, mesa-18.0.0-3.fc28, pocl-1.1-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.