https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84592
Bug ID: 84592 Summary: [openacc] lto1: ICE in input_varpool_node, at lto-cgraph.c:1424: for CSWTCH symbol Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- Consider the following openacc testcase: ... /* { dg-additional-options "-ftree-switch-conversion" } */ #include <stdio.h> #pragma acc routine seq static int __attribute__((noinline)) foo (int n) { switch (n & 3) { case 0: return 4; case 1: return 3; case 2: return 2; default: return 1; } } int main (void) { int n[1]; n[1] = 4; #pragma acc parallel copy(n) { n[0] = foo (n[0]); } printf ("n: %d\n", n[0]); return 0; } ... When compiling this (by copying it into libgomp/testsuite/libgomp.oacc-c-c++-common), we run into: ... lto1: internal compiler error: in input_varpool_node, at lto-cgraph.c:1424^M 0x959ebb input_varpool_node^M gcc/lto-cgraph.c:1422^M 0x959ebb input_cgraph_1^M gcc/lto-cgraph.c:1544^M 0x959ebb input_symtab()^M gcc/lto-cgraph.c:1858^M 0x5aceac read_cgraph_and_symbols^M gcc/lto/lto.c:2891^M 0x5aceac lto_main()^M gcc/lto/lto.c:3356^M ... When running lto1 using gdb we find the node we're processing is: ... (gdb) call debug_generic_expr ( node.decl ) CSWTCH.4 ... The CSWTCH.4 is a symbol introduced by -ftree-switch-conversion. If we use -fno-tree-switch-conversion there's no ICE.