This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR rtl-optimization/32219: optimizer causees wrong code in pic/hidden/weak symbol checking
- From: Richard Henderson <rth at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 16 Feb 2015 08:30:43 -0800
- Subject: Re: [PATCH] PR rtl-optimization/32219: optimizer causees wrong code in pic/hidden/weak symbol checking
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4Z4XH0TwZopQb8nXOfv08L2-cXFdPpPAN2uRpTHFtTGfg at mail dot gmail dot com> <CAMe9rOqwGccCzB-W8nYgzc6JL2O6kx0vkS07xOK+oa4bimHgiw at mail dot gmail dot com>
On 02/16/2015 06:01 AM, H.J. Lu wrote:
> On Mon, Feb 16, 2015 at 5:25 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>> Hello!
>>
>>> 2015-02-12 H.J. Lu <hongjiu.lu@intel.com>
>>> Richard Henderson <rth@redhat.com>
>>>
>>> PR rtl/32219
>>> * cgraphunit.c (cgraph_node::finalize_function): Set definition
>>> before notice_global_symbol.
>>> (varpool_node::finalize_decl): Likewise.
>>> * varasm.c (default_binds_local_p_2): Rename from
>>> default_binds_local_p_1, add weak_dominate argument. Use direct
>>> returns instead of assigning to local variable. Unify varpool and
>>> cgraph paths via symtab_node. Reject undef weak variables before
>>> testing visibility. Reorder tests for simplicity.
>>> (default_binds_local_p): Use default_binds_local_p_2.
>>> (default_binds_local_p_1): Likewise.
>>> (decl_binds_to_current_def_p): Unify varpool and cgraph paths
>>> via symtab_node.
>>> (default_elf_asm_output_external): Emit visibility when specified.
>>
>> It looks like this patch broke alphaev68-linux-gnu [1]. There are many
>> failures of the type:
>>
>> /tmp/cck7V7MR.o: In function
>> `__static_initialization_and_destruction_0(int, int)':^M
>> (.text+0x3ac): relocation truncated to fit: GPRELHIGH against symbol
>> `std::__cxx11::basic_string<char, std::char_traits<char>,
>> std::allocator<char> >::~basic_string()@@GLIBCXX_3.4.21' defined in
>> .text section in
>> /space/uros/gcc-build/alphaev68-unknown-linux-gnu/./libstdc++-v3/src/.libs/libstdc++.so^M
>> /space/homedirs/uros/local/bin/ld: /tmp/cck7V7MR.o: gp-relative
>> relocation against dynamic symbol
>
> It could be related to:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65064
>
> Before this bug fix, all common symbols don't bind locally,
> which is one of PR 32219 bugs. After this fix, common
> symbols bind locally. It may cause problems on targets with
> small data sections and common symbols aren't in small
> data section:
This is a destructor, and so obviously not a common symbol.
I'll have a look.
r~