------- Comment #2 from gergely+gccbug at risko dot hu 2010-05-21 08:06 ------- Based on code in cfgexpand.c (search for start_locus), my patch should probably use something like this for setting the location: /* Eventually, all FEs should explicitly set function_start_locus. */ if (cfun->function_start_locus == UNKNOWN_LOCATION) set_curr_insn_source_location (DECL_SOURCE_LOCATION (current_function_decl)); else set_curr_insn_source_location (cfun->function_start_locus);
I am not sure if there are still frontends that do not set function_start_locus. And probably this functionality should be moved to a function and we should only call that function from two places. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44189