On Thu, Jul 7, 2022 at 12:44 PM Prathamesh Kulkarni
<prathamesh.kulka...@linaro.org> wrote:
>
> Hi,
> My recent commit to emit asm name with -fdump-statistics-asmname
> caused following ICE
> for attached fortran test case.
>
> during IPA pass: icf
> power.fppized.f90:6:26:
>
>     6 | END SUBROUTINE power_print
>       |                          ^
> internal compiler error: Segmentation fault
> 0xfddc13 crash_signal
>         ../../gcc/gcc/toplev.cc:322
> 0x7f6f940de51f ???
>         ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
> 0xfc909d get_function_name
>         ../../gcc/gcc/statistics.cc:124
> 0xfc929f statistics_fini_pass_2(statistics_counter**, void*)
>         ../../gcc/gcc/statistics.cc:175
> 0xfc94a4 void hash_table<stats_counter_hasher, false,
> xcallocator>::traverse_noresize<void*,
> &(statistics_fini_pass_2(statistics_counter**, void*))>(void*)
>         ../../gcc/gcc/hash-table.h:1084
> 0xfc94a4 statistics_fini_pass()
>         ../../gcc/gcc/statistics.cc:219
> 0xef12bc execute_todo
>         ../../gcc/gcc/passes.cc:2142
>
> This happens because fn was passed NULL in get_function_name.
> The patch adds a check to see if fn is NULL before checking for
> DECL_ASSEMBLER_NAME_SET_P, which fixes the issue.
> In case the fn is NULL, it calls function_name(NULL) as per old behavior,
> which returns "(nofn)".
>
> Bootstrap+tested on x86_64-linux-gnu.
> OK to commit ?
OK

>
> Thanks,
> Prathamesh

Reply via email to