Created attachment 33752 [details] reproducer I got the following error when compiling a file with FDO. /tmp/cc6azLyK.o:(.debug_info+0x228): undefined reference to `.L29' The error is triggered by function splitting. Adding -fno-reorder-blocks-and-partition will make the build pass. Here is the diagnosis: We generate a label die and assume the label instruction will be generated in final pass. This label is marked as deleted, but because it's a user defined label, we should output it in the final pass. This label instruction is removed from insn stream in record_effective_endpoints() and put the header of one bb and later merged to the footer of another. The bb footer got overwritten in emit_barrier_after_bb() (from add_labels_and_missing_jumps()). Since it's overwritten, it never gets to put back to inst stream in cfg_layout_finalize. I think the overwritten in emit_barrier_after_bb() is wrong. We should append to the bb footer if the footer contains non-barrier instruction. Once I do the appending, the label is emitted. Reproducer attached. Build instructions are in the head of the file.
Patches is here: https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01795.html
Author: xur Date: Fri Nov 14 00:30:31 2014 New Revision: 217530 URL: https://gcc.gnu.org/viewcvs?rev=217530&root=gcc&view=rev Log: 2014-11-13 Rong Xu <xur@google.com> gcc: PR debug/63581 * cfgrtl.c (emit_barrier_after_bb): Append the barrier to the footer, instead of unconditionally overwritten gcc/testsuite: PR debug/63581 * g++.dg/tree-prof/pr63581.C: New test. Added: trunk/gcc/testsuite/g++.dg/tree-prof/pr63581.C Modified: trunk/gcc/ChangeLog trunk/gcc/cfgrtl.c trunk/gcc/testsuite/ChangeLog
Fixed a long time ago.
*** Bug 64593 has been marked as a duplicate of this bug. ***