public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Cc: gcc Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [statistics.cc] ICE in get_function_name with fortran test-case
Date: Thu, 7 Jul 2022 13:44:50 +0200	[thread overview]
Message-ID: <CAFiYyc2OqPboNJ45gcU6QjUxuqSSminD4AG1e76PivoOkC+cPw@mail.gmail.com> (raw)
In-Reply-To: <CAAgBjMnynmyAupLFnn7evFhE5T0VOqd5P4XaQhnycER-6FydSw@mail.gmail.com>

On Thu, Jul 7, 2022 at 12:44 PM Prathamesh Kulkarni
<prathamesh.kulkarni@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	other threads:[~2022-07-07 11:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 10:43 Prathamesh Kulkarni
2022-07-07 11:44 ` Richard Biener [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc2OqPboNJ45gcU6QjUxuqSSminD4AG1e76PivoOkC+cPw@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=prathamesh.kulkarni@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).