HI Honza,

> On 9 Jul 2025, at 10:23 pm, Jan Hubicka <hubi...@ucw.cz> wrote:
> 
> External email: Use caution opening links or attachments
> 
> 
>> 
>> I am seeing an ICEs in offline pass.
>> 
>> 
>> during IPA pass: afdo_offline
>> gmsh/src/mesh/meshGEdge.cpp:979:1: internal compiler error: in 
>> set_call_location, at auto-profile.cc:433
> 
> I added location and call_location into function instance that are
> originally set to UNKNOWN_LOCATION and later they are re-written by
> actual location of function and call to it (for inline instances).
> The ICE means that we have two gimple call statements that we think
> calls the given location which is likely problem iwth a discriminator.
> 
> create_gcov often outputs discriminator 0 for calls with discriinator
> non-0.  This is common situatio nin C++ where single statement implies a
> lot of calls. It is bug at create_gcov side in parsing dwarf5
> abbreviations fixed by
> 
> diff --git a/util/symbolize/addr2line_inlinestack.cc 
> b/util/symbolize/addr2line_inlinestack.cc
> index f68f6e1..8eeb8bd 100644
> --- a/util/symbolize/addr2line_inlinestack.cc
> +++ b/util/symbolize/addr2line_inlinestack.cc
> @@ -493,6 +493,12 @@ void InlineStackHandler::ProcessAttributeSigned(
>         subprogram_stack_.back()->set_callsite_line(data);
>         break;
> 
> +      // In case discriminator is implicit const, it is processed as signed
> +      // rather then unsigned value.
> +      case DW_AT_GNU_discriminator:
> +        CHECK(form == DW_FORM_implicit_const);
> +        subprogram_stack_.back()->set_callsite_discr(data);
> +        break;
>       default:
>         break;
>     }

Thanks for this fix and we are using this.
> 
> I tried to implement a workaround to match lost discriminator in cases
> this is uniquely deterined, but it is not so easy to do.
> My plan is to figure out how to upstream it and then drop the lost
> discriminator workaround from match.
> 
> Do you see warnings with -Wauto-profile?

Adding -Wauto-profile gets it to work. Let me look into this.

Thanks,
Kugan

Reply via email to