touch a.c gcc -fPIC -fwhopr -O2 -c a.c gcc -shared -fPIC a.o -fwhopr -O2 -o liba.so leads to: lto1: internal compiler error: vector VEC(cgraph_node_ptr,base) index domain error, in csi_node at cgraph.h:663 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. lto-wrapper: gcc returned 1 exit status collect2: lto-wrapper returned 1 exit status Doesn't happen with -flto instead of -fwhopr at link time, or with neither flag. This ICE fails several tests in the Libtool testsuite, with several different (valid) source files. I'm guessing the actual source file contents are irrelevant for the bug. If the -fwhopr flag was not meant to be passed at shared library creation time, then this would be a documentation bug and an ice-on-invalid-code instead.
This is just PR41584 I think. *** This bug has been marked as a duplicate of 41584 ***