Bug 2020861 - codegen issues when compiling doctests on i686 on Fedora 34 and 35
Summary: codegen issues when compiling doctests on i686 on Fedora 34 and 35
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm
Version: 34
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tom Stellard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-06 15:20 UTC by Fabio Valentini
Modified: 2022-06-08 01:00 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-08 01:00:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rust-lang llvm-project pull 111 0 None Merged [BACKPORT] MachineBasicBlock: add liveout iterator aware of which liveins are defined by the runtime. 2021-11-08 19:22:49 UTC
Github rust-lang rust issues 83854 0 None closed UI test `issue-64655-extern-rust-must-allow-unwind.rs#thin0` triggers LLVM assert when compiled for i586 target with CGU... 2021-11-08 19:22:49 UTC
Github rust-lang rust issues 86758 0 None closed UI test issue-64655-extern-rust-must-allow-unwind.rs#fat0 triggers LLVM assert when compiled for i686 target 2021-11-08 19:22:49 UTC

Description Fabio Valentini 2021-11-06 15:20:36 UTC
Description of problem:

Compilation of most doctests on i686 fails for some crates, for example ahash and nom. The error message is:

---- src/hash_set.rs - hash_set::&'_ AHashSet<T, S>::bitor (line 95) stdout ----
error: ran out of registers during register allocation
LLVM ERROR: Cannot emit physreg copy instruction
Couldn't compile the test.

or

---- src/number/streaming.rs - number::streaming::le_i32 (line 624) stdout ----
error: ran out of registers during register allocation
LLVM ERROR: Cannot emit physreg copy instruction
Couldn't compile the test.

for all doctests that failed to compile.


Version-Release number of selected component (if applicable):

1.56.1-1.fc35 and llvm12-libs-12.0.1-2.fc35 on Fedora 35
1.56.1-1.fc34 and llvm-libs-12.0.1-1.fc34.i686 on Fedora 34

The same crates compile fine on Rawhide with LLVM 13.

How reproducible:
Always.

Steps to Reproduce:
1. enable tests in rust-ahash or rust-nom ("%bcond_without check")
2. run scratch build on f35 or f34
3. see LLVM fail to compile doctests on i686

Actual results:
Doctests make LLVM explode.

Expected results:
Doctests work.

Additional info:
This looks similar to an issue that was present on aarch64 until Rust switched to LLVM 12: https://bugzilla.redhat.com/show_bug.cgi?id=1902663

If indeed the combination of LLVM 12 and Rust 1.56 is to blame, it would be unfortunate if compiling doctests on i686 stayed broken on Fedora 34 forever, though ...

Here's some failed koji builds that exhibited this issue:

https://koji.fedoraproject.org/koji/taskinfo?taskID=78385123
https://koji.fedoraproject.org/koji/taskinfo?taskID=78385174
https://koji.fedoraproject.org/koji/taskinfo?taskID=78427325
https://koji.fedoraproject.org/koji/taskinfo?taskID=78427336

Comment 1 Josh Stone 2021-11-08 19:22:50 UTC
I just added links to a few Rust issues, which were fixed by a backport of this commit:
https://github.com/llvm/llvm-project/commit/c1dc267258e06bb69e1ca217d1d8ce2d15b8757f

I'm reassigning to llvm to consider that backport in Fedora. I'm also retargeting this to f34, because rustc in f35 will move to llvm-13 as soon as that rebase is complete (not rc1).

Comment 2 Josh Stone 2021-11-08 21:59:41 UTC
That patch backports cleanly, but it adds public methods to MachineBasicBlock, so I'm not sure if that's acceptable for API/ABI. Perhaps it could be refactored a little to keep that internal.

Comment 3 Ben Cotton 2022-05-12 16:40:02 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 4 Ben Cotton 2022-06-08 01:00:08 UTC
Fedora Linux 34 entered end-of-life (EOL) status on 2022-06-07.

Fedora Linux 34 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release.

Thank you for reporting this bug and we are sorry it could not be fixed.


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