gcc-10.2 produces wrong code that leads to segfault in mesa, when mesa is build with lto enabled. Upstream bugreports: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3239 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96482 Reproducible: Always
It may help to include a backtrace via gdb (use debug symbols: https://wiki.gentoo.org/wiki/Debugging), any other relevant output, and emerge --info, but yes, it seems to be a known upstream issue.
(In reply to Sam James from comment #1) > It may help to include a backtrace via gdb (use debug symbols: > https://wiki.gentoo.org/wiki/Debugging), any other relevant output, and > emerge --info, but yes, it seems to be a known upstream issue. That's why I have omitted the info this time. Upstream has fixed it, so maybe this could be added to the patchset?
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=c446f6f37e5a5f0867527acdb0b78333e3b70822 commit c446f6f37e5a5f0867527acdb0b78333e3b70822 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-08-13 08:39:49 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-08-13 08:39:49 +0000 10.2.0:backport ipa-cp bit fix (PR/96482) Reported-by: Johannes Hirte Bug: https://bugs.gentoo.org/736685 Bug: https://gcc.gnu.org/PR96482 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> 10.2.0/gentoo/35_all_ipa-fix-bit-CP.patch | 145 ++++++++++++++++++++++++++++++ 10.2.0/gentoo/README.history | 1 + 2 files changed, 146 insertions(+)
Queued patch for next gcc-10.2.0 patchset. Will take a few week. Meanwhile can you test it on your system? You can drop https://gitweb.gentoo.org/proj/gcc-patches.git/plain/10.2.0/gentoo/35_all_ipa-fix-bit-CP.patch to /etc/portage/patches/sys-devel/gcc:10/ and rebuild gcc.
(In reply to Sergei Trofimovich from comment #4) > Queued patch for next gcc-10.2.0 patchset. Will take a few week. > > Meanwhile can you test it on your system? You can drop > > https://gitweb.gentoo.org/proj/gcc-patches.git/plain/10.2.0/gentoo/ > 35_all_ipa-fix-bit-CP.patch > to > /etc/portage/patches/sys-devel/gcc:10/ > and rebuild gcc. Yes, this fixed it. The segfault is gone.
I get an ICE when compiling the linux kernel: during GIMPLE pass: ccp fs/btrfs/ctree.c: In function ‘insert_new_root’: fs/btrfs/ctree.c:3308:21: internal compiler error: in get_default_value, at tree-ssa-ccp.c:311 3308 | static noinline int insert_new_root(struct btrfs_trans_handle *trans, I'm just checking if this is caused by this patch.
Try to extract self-contained preprocessed example with https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=4a2371497e9bed64aa4f46169127f3ea8e32e726 looks like a plausible fix.
Yes it's caused by https://gitweb.gentoo.org/proj/gcc-patches.git/plain/10.2.0/gentoo/35_all_ipa-fix-bit-CP.patch, I'm testing if https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=4a2371497e9bed64aa4f46169127f3ea8e32e726 is fixing this.
(In reply to Johannes Hirte from comment #9) > Yes it's caused by > https://gitweb.gentoo.org/proj/gcc-patches.git/plain/10.2.0/gentoo/ > 35_all_ipa-fix-bit-CP.patch, > > I'm testing if > https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff; > h=4a2371497e9bed64aa4f46169127f3ea8e32e726 is fixing this. Yes, this fixed the ICE with the linux kernel.
(In reply to Johannes Hirte from comment #10) > (In reply to Johannes Hirte from comment #9) > > Yes it's caused by > > https://gitweb.gentoo.org/proj/gcc-patches.git/plain/10.2.0/gentoo/ > > 35_all_ipa-fix-bit-CP.patch, > > > > I'm testing if > > https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff; > > h=4a2371497e9bed64aa4f46169127f3ea8e32e726 is fixing this. > > Yes, this fixed the ICE with the linux kernel. Yay! Thank you for the test! Will queue patch up as well.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=0d98cab225ecb321bc18d894951bb2d3b7b45bd0 commit 0d98cab225ecb321bc18d894951bb2d3b7b45bd0 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-08-17 21:26:01 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-08-17 21:26:01 +0000 10.2.0: backport ipa-cp bit fix, part 2 (PR/96482) Reported-by: Johannes Hirte Bug: https://bugs.gentoo.org/736685 Bug: https://gcc.gnu.org/PR96482 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> 10.2.0/gentoo/36_all_ipa-fix-bit-CP-p2.patch | 80 ++++++++++++++++++++++++++++ 10.2.0/gentoo/README.history | 1 + 2 files changed, 81 insertions(+)
Queued as https://gitweb.gentoo.org/proj/gcc-patches.git/plain/10.2.0/gentoo/36_all_ipa-fix-bit-CP-p2.patch
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9bba1f72a9210743fddf664b716b5cf288132922 commit 9bba1f72a9210743fddf664b716b5cf288132922 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-08-23 09:11:31 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-08-23 09:11:31 +0000 10.2.0: cut 2 patchset Four new patches: + 33_all_lto-O0-mix-ICE-ipa-PR96291.patch: fix -O0 crash for ipa/lto + 34_all_fundecl-ICE-PR95820.patch: fix ICE on invalid templates + 35_all_ipa-fix-bit-CP.patch: fix bad code generation in ipa bit constprop + 36_all_ipa-fix-bit-CP-p2.patch: part 2 of previous patch Bug: https://bugs.gentoo.org/733482 Bug: https://gcc.gnu.org/PR96291 Bug: https://bugs.gentoo.org/730406 Bug: https://gcc.gnu.org/PR95820 Bug: https://bugs.gentoo.org/736685 Bug: https://gcc.gnu.org/PR96482 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> 10.2.0/gentoo/README.history | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=653d6bf6ea15bdf2db033e3099913bac47f5b0e0 commit 653d6bf6ea15bdf2db033e3099913bac47f5b0e0 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-08-23 09:17:12 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-08-23 09:17:12 +0000 sys-devel/gcc: cut 2 patchset Four new patches: + 33_all_lto-O0-mix-ICE-ipa-PR96291.patch: fix -O0 crash for ipa/lto + 34_all_fundecl-ICE-PR95820.patch: fix ICE on invalid templates + 35_all_ipa-fix-bit-CP.patch: fix bad code generation in ipa bit constprop + 36_all_ipa-fix-bit-CP-p2.patch: part 2 of previous patch Closes: https://bugs.gentoo.org/733482 Bug: https://gcc.gnu.org/PR96291 Closes: https://bugs.gentoo.org/730406 Bug: https://gcc.gnu.org/PR95820 Closes: https://bugs.gentoo.org/736685 Bug: https://gcc.gnu.org/PR96482 Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> sys-devel/gcc/Manifest | 1 + sys-devel/gcc/gcc-10.2.0-r1.ebuild | 13 +++++++++++++ 2 files changed, 14 insertions(+)