https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92504
Bug ID: 92504
Summary: ICE on gcc-9 -fopenmp: internal compiler error: tree
check: expected tree that contains 'decl common'
structure, have 'baselink' in get_inner_reference, at
expr.c:7238
Product: gcc
Version: 9.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: slyfox at inbox dot ru
Target Milestone: ---
Original bug is reported at https://bugs.gentoo.org/699938 by Marc Vinyals
where invalid C++ code crashes gcc with internal error instead of error
message.
creduce turned it into the following:
// $ cat bug.ii
class c {
void d();
};
main() {
c a;
#pragma omp for
for (auto b = a; b != a.d; b)
;
Note: there is no closing bracket and for contents is quite invalid. gcc-master
files like that:
$ gcc/xg++ -Bgcc -O1 -fopenmp -c bug.ii -o bug.o
bug.ii:4:1: warning: ISO C++ forbids declaration of 'main' with no type
[-Wreturn-type]
4 | main() {
| ^~~~
bug.ii: In function 'int main()':
bug.ii:8:5: internal compiler error: tree check: expected tree that contains
'decl common' structure, have 'baselink' in get_inner_reference, at expr.c:7238
8 | ;
| ^
0x7f1fd53edf1a __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
gcc is built as:
Reading specs from /home/slyfox/dev/git/gcc-native-quick/gcc/specs
COLLECT_GCC=/home/slyfox/dev/git/gcc-native-quick/gcc/xg++
COLLECT_LTO_WRAPPER=/home/slyfox/dev/git/gcc-native-quick/gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --enable-languages=c,c++,lto
--disable-bootstrap --with-multilib-list=m64
--prefix=/home/slyfox/dev/git/gcc-native-quick/../gcc-native-quick-installed
--disable-nls --without-isl CFLAGS='-O1 ' CXXFLAGS='-O1 '
--with-sysroot=/usr/x86_64-HEAD-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.0.0 20191113 (experimental) (GCC)