Bug 225838 - clang error on 10.4 i386 - ran out of registers during register allocation
Summary: clang error on 10.4 i386 - ran out of registers during register allocation
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.4-RELEASE
Hardware: i386 Any
: --- Affects Only Me
Assignee: Dimitry Andric
Depends on:
Reported: 2018-02-11 22:17 UTC by Shane
Modified: 2019-08-14 02:50 UTC (History)
2 users (show)

See Also:

clang_3.4.1 error test code (428.95 KB, application/x-xz)
2018-02-11 22:17 UTC, Shane
no flags Details
clang compile command (995 bytes, application/x-shellscript)
2018-02-11 22:18 UTC, Shane
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shane 2018-02-11 22:17:50 UTC
Created attachment 190527 [details]
clang_3.4.1 error test code

Testing a new port version in poudriere (graphics/openimageio 1.8.8) I got the following error. Host is 11.1-stable r326495, jail is 10.4-RELEASE-p5.

fatal error: error in backend: ran out of registers during register allocation
c++: error: clang frontend command failed with exit code 70 (use -v to see invocation)
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: i386-unknown-freebsd10.4
Thread model: posix

11.1amd64, 11.1i386 and 10.4amd64 jails build without error.
Comment 1 Shane 2018-02-11 22:18:50 UTC
Created attachment 190528 [details]
clang compile command
Comment 2 Dimitry Andric freebsd_committer 2018-02-13 23:26:54 UTC
I can reproduce the error, and found that upstream's https://reviews.llvm.org/rL212119 fixes it, however this is a commit that is difficult to backport to clang 3.4.1 (it uses C++11 and is from quite a bit post the upstream 3.5 version), not to mention that it is likely pretty risky.

As an "easy solution" I would recommend to make the port depend on, and use, a newer version of clang, 3.8 or higher should do.  Might as well take clang 5.0 since that is used quite a lot in the ports tree already.
Comment 3 Shane 2018-02-14 03:45:20 UTC
I have found a few of my port updates fail on 10.4 (not with this same issue) and using clang50 is a solution. As they either use opengl or are used by opengl based apps USES=compiler:c++14-lang seems a reasonable option as clang50 can already be expected to be available.

Support for 10.4 ends in October, it doesn't appear that we will get a 10.5 release to extend that so we can expect to only support 10.x for another 8 months. I would skip a complex clang patch if it will only be used for 8 months. Also as this only affects 32bit systems, I don't see a large need for it.
Comment 4 Shane 2019-08-14 02:50:54 UTC
not an issue on currently supported systems