http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56515
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-04 12:10:32 UTC --- We inline __gcov_indirect_call_profiler: 2 foo.o 4 211 1fa7ccac167ed480 PREVAILING_DEF foo 218 1fa7ccac167ed480 RESOLVED_EXEC __gcov_merge_add 220 1fa7ccac167ed480 RESOLVED_IR __gcov_indirect_call_profiler 229 1fa7ccac167ed480 RESOLVED_EXEC __gcov_init bar.o 2 165 fdbab47f5593e985 PREVAILING_DEF_IRONLY __gcov_indirect_call_profiler 186 fdbab47f5593e985 PREVAILING_DEF_IRONLY bar We build the function decls via build_fn_decl which ends up using input_location of the first random function we are processing. But that doesn't seem to be the issue after all ... The issue is that we do in expand_call_inline: /* Build a block containing code to initialize the arguments, the actual inline expansion of the body, and a label for the return statements within the function to jump to. The type of the statement expression is the return type of the function call. */ id->block = make_node (BLOCK); BLOCK_ABSTRACT_ORIGIN (id->block) = fn; BLOCK_SOURCE_LOCATION (id->block) = input_location; if (gimple_block (stmt)) prepend_lexical_block (gimple_block (stmt), id->block); that is, we only link the copied BLOCK tree into the caller BLOCK tree if the call stmt had an associated BLOCK. Which isn't the case for the calls created by the middle-end (profile instrumentation in this case).