This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, gotools]: Fix TestCrashDumpsAllThreads testcase failure
- From: Ian Lance Taylor <iant at golang dot org>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, gofrontend-dev at googlegroups dot com
- Date: Mon, 22 Jan 2018 20:49:31 -0800
- Subject: Re: [PATCH, gotools]: Fix TestCrashDumpsAllThreads testcase failure
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4buH86HbNw6QBDpfArhSR4H+AgrPRXcbr8p-nfa8UBEcw@mail.gmail.com>
On Sun, Jan 21, 2018 at 3:13 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
> The default "go build" compile options over-optimize the auxiliary
> executable, built in TestCrashDumpsAllThreads testcase
> (libgo/go/runtime/crash_unix_test.go). This over-optimization results
> in removal of the trivial summing loop and in the inlining of the
> main.loop function into main.$thunk0.
>
> The testcase expects backtrace that shows several instances of
> main.loop in the backtrace dump. When main.loop gets inlined into
> thunk, its name is not dumped anymore.
>
> The solution is to pass "-O0" to gccgo, which inhibits unwanted inlining.
>
> Patch was bootstrapped and regression tested on x86_64-linux-gnu and
> alphev68-linux-gnu, where for the later target the patch fixed the
> mentioned failure.
That sounds like a bug somewhere. Even when one function gets inlined
into another, its name should still be dumped. This is implemented by
report_inlined_functions in libbacktrace/dwarf.c. While something
like your patch may be needed, I'd like to more clearly understand why
libbacktrace isn't working.
Ian