public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>,
	       Christophe Lyon <christophe.lyon@linaro.org>
Cc: "Martin Liška" <mliska@suse.cz>,
	"GCC Patches" <gcc-patches@gcc.gnu.org>,
	"Jan Hubicka" <hubicka@ucw.cz>
Subject: Re: [PATCH] Do not declare artificial variables in tree-profile.c to have a definition (PR lto/69188).
Date: Mon, 23 Jan 2017 16:25:00 -0000	[thread overview]
Message-ID: <4c455747-94fa-54f4-f527-39bb284f778d@redhat.com> (raw)
In-Reply-To: <5885D575.3090008@foss.arm.com>

On 01/23/2017 03:05 AM, Kyrill Tkachov wrote:
>
> On 23/01/17 09:58, Christophe Lyon wrote:
>> On 13 January 2017 at 18:21, Jeff Law <law@redhat.com> wrote:
>>> On 01/13/2017 08:08 AM, Martin Liška wrote:
>>>> Hello.
>>>>
>>>> Nice example provided in the PR causes ICE as we have an artificial
>>>> symbol
>>>> created in tree-profile.c once being removed by remove unreachable
>>>> nodes
>>>> (-O0)
>>>> and once not (-O1). Well, difference is in process_references where
>>>> following hunk
>>>> prevent removal:
>>>>
>>>>                || (((before_inlining_p
>>>>                      && ((TREE_CODE (node->decl) != FUNCTION_DECL
>>>>                           && optimize)
>>>>
>>>> Anyway, these artificial symbols really should be just declarations as
>>>> they are defined
>>>> in libgcov library.
>>>>
>>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression
>>>> tests.
>>>>
>>>> Ready to be installed?
>>>> Martin
>>>>
>>>>
>>>> 0001-Do-not-declare-artificial-variables-in-tree-profile..patch
>>>>
>>>>
>>>>  From 87262b1b60009381fd943fb433bc38f5d5685ac9 Mon Sep 17 00:00:00 2001
>>>> From: marxin <mliska@suse.cz>
>>>> Date: Fri, 13 Jan 2017 13:12:57 +0100
>>>> Subject: [PATCH] Do not declare artificial variables in
>>>> tree-profile.c to
>>>> have
>>>>   a definition (PR lto/69188).
>>>>
>>>> gcc/testsuite/ChangeLog:
>>>>
>>>> 2017-01-13  Martin Liska  <mliska@suse.cz>
>>>>
>>>>          PR lto/69188
>>>>          * gcc.dg/lto/pr69188_0.c: New test.
>>>>          * gcc.dg/lto/pr69188_1.c: New test.
>>>>
>>>> gcc/ChangeLog:
>>>>
>>>> 2017-01-13  Martin Liska  <mliska@suse.cz>
>>>>
>>>>          PR lto/69188
>>>>          * tree-profile.c (init_ic_make_global_vars): Do not call
>>>>          finalize_decl.
>>>>          (gimple_init_gcov_profiler): Likewise.
>>> OK.
>>> jeff
>>>
>> Hi,
>>
>> The new test fails on arm-none-eabi:
>> /cc6RcpEu.ltrans0.ltrans.o: In function `fn1':
>> <artificial>:(.text+0x18): undefined reference to
>> `__gcov_indirect_call_profiler_v2'
>> <artificial>:(.text+0x1c): undefined reference to
>> `__gcov_indirect_call_callee'
>> <artificial>:(.text+0x20): undefined reference to
>> `__gcov_indirect_call_callee'
>> <artificial>:(.text+0x60): undefined reference to
>> `__gcov_time_profiler_counter'
>> <artificial>:(.text+0x64): undefined reference to
>> `__gcov_time_profiler_counter'
>> <artificial>:(.text+0x80): undefined reference to
>> `__gcov_time_profiler_counter'
>> <artificial>:(.text+0x84): undefined reference to
>> `__gcov_time_profiler_counter'
>> /cc6RcpEu.ltrans0.ltrans.o: In function `_GLOBAL__sub_D_00100_1_fn1':
>> <artificial>:(.text+0xb8): undefined reference to `__gcov_exit'
>> /cc6RcpEu.ltrans0.ltrans.o: In function `main':
>> <artificial>:(.text+0xd4): undefined reference to
>> `__gcov_indirect_call_profiler_v2'
>> <artificial>:(.text+0xd8): undefined reference to
>> `__gcov_indirect_call_callee'
>> <artificial>:(.text+0xdc): undefined reference to
>> `__gcov_indirect_call_callee'
>> <artificial>:(.text+0x10c): undefined reference to
>> `__gcov_time_profiler_counter'
>> <artificial>:(.text+0x110): undefined reference to
>> `__gcov_time_profiler_counter'
>> /cc6RcpEu.ltrans0.ltrans.o: In function `_GLOBAL__sub_D_00100_1_main':
>> <artificial>:(.text+0x180): undefined reference to `__gcov_exit'
>> /cc6RcpEu.ltrans0.ltrans.o:(.data+0x4c): undefined reference to
>> `__gcov_merge_time_profile'
>> /cc6RcpEu.ltrans0.ltrans.o:(.data+0xac): undefined reference to
>> `__gcov_merge_time_profile'
>> collect2: error: ld returned 1 exit status
>>
>> FAIL: gcc.dg/lto/pr69188 c_lto_pr69188_0.o-c_lto_pr69188_1.o link,
>> -flto -O0 -fprofile-generate
>>
>> It works on arm-linux*.
>
> Hi,
>
> The testcase fails on bare-metal targets that don't support profiling.
> I believe it needs to be guarded with dg-require-profiling (I grepped
> around the testsuite for similar directives).
> With this patch the testcase appears unsupported on aarch64-none-elf
> where I observed the failure.
>
> Ok to commit?
>
> Thanks,
> Kyrill
>
> 2016-01-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     * gcc.dg/lto/pr69188_0.c: Require profiling support for testcase.
OK.
jeff

      parent reply	other threads:[~2017-01-23 16:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 15:08 Martin Liška
2017-01-13 17:21 ` Jeff Law
2017-01-20 10:11   ` Martin Liška
2017-01-20 19:24     ` Jeff Law
2017-01-23 10:03   ` Christophe Lyon
2017-01-23 10:07     ` Kyrill Tkachov
2017-01-23 11:17       ` Martin Liška
2017-01-23 16:25       ` Jeff Law [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=4c455747-94fa-54f4-f527-39bb284f778d@redhat.com \
    --to=law@redhat.com \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=kyrylo.tkachov@foss.arm.com \
    --cc=mliska@suse.cz \
    /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).