Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 729434 - sys-devel/gcc-10.1.0 - internal compiler error: unexpected expression of kind implicit_conv_expr
Summary: sys-devel/gcc-10.1.0 - internal compiler error: unexpected expression of kind...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://gcc.gnu.org/PR95508
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-24 11:45 UTC by hsk17
Modified: 2020-07-04 08:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
source code producing ICE (VIP_Mover.cc,15.88 KB, text/x-c++src)
2020-06-24 11:45 UTC, hsk17
Details
preprocessed source producing ICE (VIP_Mover.i.xz,427.65 KB, application/x-xz)
2020-06-24 11:48 UTC, hsk17
Details
35_all_ICE-array-subscript-PR95508.patch (35_all_ICE-array-subscript-PR95508.patch,3.79 KB, patch)
2020-06-24 18:07 UTC, Sergei Trofimovich (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description hsk17 2020-06-24 11:45:41 UTC
Created attachment 646046 [details]
source code producing ICE

trying to recompile rosetta (a huge scientific software package) using "gcc (Gentoo 10.1.0-r1 p2) 10.1.0" produces an internal compiler error; earlier gcc versions (9.2, 8.3) compiled the software.


VIP_Mover.cc: In function 'core::scoring::packstat::PackstatReal core::scoring::packstat::compute_sasa_generic(utility::vector1<T>&, core::scoring::packstat::PackstatReal, bool)':
VIP_Mover.cc:185125:41: internal compiler error: unexpected expression '(short unsigned int)l->atom_sasa_masks.ObjexxFCL::FArray2D<ObjexxFCL::ubyte>::operator[]()' of kind implicit_conv_expr
185125 |    ctr += bit_count[atom_sasa_masks[ l ]];
       |                                         ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.


raw and preprocessed source code files attached

further info needed?  or should i report at gcc.gnu.org?
Comment 1 hsk17 2020-06-24 11:48:00 UTC
Created attachment 646048 [details]
preprocessed source producing ICE
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2020-06-24 17:35:29 UTC
I can reproduce on 'gcc-11.0.0 -c -x c++ VIP_Mover.i'. Should be good enough for me to follow up. But if you want to do it yourself you can also do it.

There are some notes at: https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-06-24 18:03:31 UTC
gcc master does not crash. Probably fixed by https://gcc.gnu.org/PR95508
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2020-06-24 18:07:54 UTC
Created attachment 646086 [details, diff]
35_all_ICE-array-subscript-PR95508.patch

Try 35_all_ICE-array-subscript-PR95508.patch patch. You can drop it to /etc/portage/patches/sys-devel/gcc:10/ to get applied automatically.
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2020-06-24 20:12:13 UTC
cvise reduced example down to something similar in upstream bug WRT implicit conversion:

"""
class a {
  operator int();
};
class b {
  a operator[](long);
} extern c[];
template <class> void d() {
  b e;
  int f;
  c[e[f]]
"""
Comment 6 Larry the Git Cow gentoo-dev 2020-06-24 20:15:47 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=21ed34524e3ab3139c811b6d61f50522ebd2b184

commit 21ed34524e3ab3139c811b6d61f50522ebd2b184
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-06-24 20:14:42 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-06-24 20:14:42 +0000

    10.1.0: backport PR95508, ICE on array subscript implicit conversion
    
    Reported-by: hsk17@mail.de
    Bug: https://bugs.gentoo.org/729434
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 .../35_all_ICE-array-subscript-PR95508.patch       | 106 +++++++++++++++++++++
 10.1.0/gentoo/README.history                       |   1 +
 2 files changed, 107 insertions(+)
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2020-06-24 20:17:07 UTC
The patch should land in gentoo within a month with next patchset.
Comment 8 hsk17 2020-06-25 15:50:26 UTC
grabbed up the patch, took me the whole day to recompile gcc and then to resolve some other gcc10 compatability glitches in the rosetta software - but now:

success!

a huge THANK YOU
Comment 9 Larry the Git Cow gentoo-dev 2020-07-04 07:56:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=ad32bf914e7dda8709a7adb8197bc43917be4f41

commit ad32bf914e7dda8709a7adb8197bc43917be4f41
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-07-04 07:44:32 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-07-04 07:44:32 +0000

    10.1.0: cut 3 patchset
    
    Four new patches:
    + 33_all_avx512-scalar-PR95528.patch: fix ICE on small avx512 unpack
    + 34_all_cet-cross-x86.patch: backport CET cross-compilation fix
    + 35_all_ICE-array-subscript-PR95508.patch: fix ICE on some C++ array
      subscripts
    + 36_all_fno-delayed-branch.patch: disable -fdelayed-branch to
      to fix python mis-compilation.
    
    Bug: https://gcc.gnu.org/PR95528
    Bug: https://bugs.gentoo.org/727028
    Bug: https://gcc.gnu.org/94998
    Bug: https://bugs.gentoo.org/729074
    Bug: https://gcc.gnu.org/PR95508
    Bug: https://bugs.gentoo.org/729434
    Reported-by: Jeroen Roovers
    Bug: https://gcc.gnu.org/PR96015
    Bug: https://bugs.gentoo.org/729570.
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 10.1.0/gentoo/README.history | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 10 Larry the Git Cow gentoo-dev 2020-07-04 08:09:28 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a478857e97c4a4d2769ded41b859c5dcfc3cbf9

commit 9a478857e97c4a4d2769ded41b859c5dcfc3cbf9
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-07-04 07:54:40 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-07-04 08:09:16 +0000

    sys-devel/gcc: 10.1.0: cut 3 patchset
    
    Four new patches:
    + 33_all_avx512-scalar-PR95528.patch: fix ICE on small avx512 unpack
    + 34_all_cet-cross-x86.patch: backport CET cross-compilation fix
    + 35_all_ICE-array-subscript-PR95508.patch: fix ICE on some C++ array
      subscripts
    + 36_all_fno-delayed-branch.patch: disable -fdelayed-branch to
      to fix python mis-compilation.
    
    Bug: https://gcc.gnu.org/PR95528
    Bug: https://bugs.gentoo.org/727028
    Bug: https://gcc.gnu.org/94998
    Bug: https://bugs.gentoo.org/729074
    Bug: https://gcc.gnu.org/PR95508
    Bug: https://bugs.gentoo.org/729434
    Reported-by: Jeroen Roovers
    Bug: https://gcc.gnu.org/PR96015
    Bug: https://bugs.gentoo.org/729570.
    Package-Manager: Portage-2.3.103, Repoman-2.3.23
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-devel/gcc/Manifest             |  1 +
 sys-devel/gcc/gcc-10.1.0-r2.ebuild | 13 +++++++++++++
 2 files changed, 14 insertions(+)
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2020-07-04 08:17:02 UTC
Should be fixed by gcc-10.1.0-r2 in https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a478857e97c4a4d2769ded41b859c5dcfc3cbf9