empty.c ------- /* This page intentionally left blank. */ > ./xgcc -B. -o t empty.c -shared -fwhopr lto1: internal compiler error: vector VEC(cgraph_node_ptr,base) index domain error, in csi_node at cgraph.h:614 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. this is because we try to find a name for the ltrans file (which we'll end up not needing...) by looking at the first element of the callgraph-set (which is empty ...).
*** Bug 43609 has been marked as a duplicate of this bug. ***
Same happens with cat >a.c <<\EOF int i = 42; EOF or with cat >a.c <<\EOF int foo; int *i = &foo; EOF
Interestingly, LTO actually tries to use the original file name: /* Since SET does not need to be processed by LTRANS, use the original file name and mark it with a '*' prefix so that lto_execute_ltrans knows not to process it. */ cgraph_node_set_iterator si = csi_start (set); struct cgraph_node *first = csi_node (si); fname = prefix_name_with_star (first->local.lto_file_data->file_name); But it tries to take the file name from the first node in the call graph. And the reason why we try re-use the original file name, is because the call graph is empty. Strange logic... Maybe WHOPR should give a fatal error if the only set is empty.
Well, or just use some default name of the unit ;)
Fixed.
Subject: Bug 41584 Author: rguenth Date: Thu Jun 3 14:22:46 2010 New Revision: 160223 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160223 Log: 2010-06-03 Richard Guenther <rguenther@suse.de> PR lto/41584 * gcc.dg/lto/20100603-1_0.c: New testcase. * gcc.dg/lto/20100603-2_0.c: Likewise. * gcc.dg/lto/20100603-3_0.c: Likewise. Added: trunk/gcc/testsuite/gcc.dg/lto/20100603-1_0.c trunk/gcc/testsuite/gcc.dg/lto/20100603-2_0.c trunk/gcc/testsuite/gcc.dg/lto/20100603-3_0.c Modified: trunk/gcc/testsuite/ChangeLog
Subject: Bug 41584 Author: rguenth Date: Fri Jun 4 11:00:09 2010 New Revision: 160258 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160258 Log: 2010-06-04 Richard Guenther <rguenther@suse.de> PR lto/41584 * cgraph.h (struct varpool_node): Add lto_file_data field. * lto-cgraph.c (input_varpool_node): Initialize it. lto/ * lto.c (lto_1_to_1_map): Use the proper file_data for varpool nodes. Modified: trunk/gcc/ChangeLog trunk/gcc/cgraph.h trunk/gcc/lto-cgraph.c trunk/gcc/lto/ChangeLog trunk/gcc/lto/lto.c