This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Do not declare artificial variables in tree-profile.c to have a definition (PR lto/69188).


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*.

Christophe


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]