On 11/26/18 2:00 PM, Jakub Jelinek wrote:
> Hi!
> 
> The following testcase fails to assemble, because with -ffunction-sections
> and hot/cold partitioning, secname_for_decl returns the same section
> for both the hot and cold partition, even when we actually use two different
> sections - .text._Z3fooi and .text.unlikely._Z3fooi.  If the secname is
> the same, we then try to emit DW_LLE_offset_pair with the same base in all
> entries, which is not possible if there is a section switch in between.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> BTW, I believe the secname_for_decl handling of VAR_OR_FUNCTION_NAME_P
> (decl) is wrong, because we should never care about in what section
> the variable is, secname is only used as something to base the
> start/end labels of the various ranges, so IMHO we always care solely
> about current_function_decl.  Is it ok as a follow-up to change that?
> 
> 2018-11-26  Jakub Jelinek  <ja...@redhat.com>
> 
>       PR c++/86900
>       * dwarf2out.c (secname_for_decl): For functions with
>       DECL_SECTION_NAME if in_cold_section_p, try to return
>       current_function_section's name if it is a named section.
> 
>       * g++.dg/debug/dwarf2/pr86900.C: New test.
OK.

WRT secname_for_decl, it really depends on how the caller's want to use
it.  You know the dwarf2out code far better than I, so if all the
callers have the intent you've suggested, then changing it as a
follow-up seems fine.

jeff

Reply via email to