https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68662
Alan Modra <amodra at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-12-04 CC| |amodra at gmail dot com Ever confirmed|0 |1 --- Comment #2 from Alan Modra <amodra at gmail dot com> --- Confirmed. Also the -O0 variant of this test. I had a look at assembly output and see lines like addis 30,30,-.L7@ha This comes from rs6000_emit_load_toc_table use of toc_label_name which appears to be all-zero. toc_label_name is supposed to be set in rs6000_option_override_internal, but apparently isn't because when rs6000_option_override_internal runs, TARGET_TOC is not true. Making the initialisation unconditional isn't enough to cure the problem as that leads to linker errors about an undefined reference to ".LCTOC1". That is because code to set .LCTOC1 isn't being emitted from rs6000_elf_output_toc_section_asm_op. I haven't verified this, but I'd guess that is because rs6000_file_start doesn't see flag_pic == 2, and therefore doesn't call switch_to_section (toc_section). Notice that c_lto_20090210_0.o does *not* have -fPIC, while c_lto_20090210_1.o does.