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: Alex Velenko <Alex dot Velenko at arm dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Jack Howarth <howarth dot at dot gcc at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Thu, 19 Feb 2015 06:16:33 -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: <20150206162314 dot GA12597 at intel dot com> <CAJMcOU9+x47s7jwRL4uniLs2z9EHR_Ajfk==HX1mObm97qytCg at mail dot gmail dot com> <CAMe9rOr5Ktk_yhfFX9DHAb6Sq=v2SORaY6TbahSiKF9dB1LNSQ at mail dot gmail dot com> <CAJMcOU-hPQYF1k58CXP4E5K2_-3F50RaMV_rHm3f5R_hXxivWQ at mail dot gmail dot com> <20150207122739 dot GA25185 at gmail dot com> <CAJMcOU-Bk1i9LeaHLpZGspWjDcY_n2qFcNgnCbbEsq30ZPTipA at mail dot gmail dot com> <20150207155606 dot GA14159 at gmail dot com> <20150207164507 dot GA19402 at gmail dot com> <54DA75D2 dot 40402 at redhat dot com> <54DC46BF dot 5060503 at redhat dot com> <CAMe9rOo+qukAAFFG=3xdu1z8GnX_k-ELY+=0Ym-f0YdfymTuYA at mail dot gmail dot com> <CAMe9rOrFdRqFXxw-ASFasb8M+UaaT4NNKrWUZ+D-CjpFGvOuNA at mail dot gmail dot com> <54DCFE10 dot 3050906 at redhat dot com> <CAMe9rOrzZdRx31rXyBKBDvcWvoDuC2ZKib6o=EW984prxq8=CQ at mail dot gmail dot com> <CAMe9rOry6GiysKXXFcsGFpJ6CJLFSGBoXociSeSYs5MvnuLUeg at mail dot gmail dot com> <54DD3FA9 dot 3010609 at redhat dot com> <CAMe9rOpnbUcXOLDe0wvfQKmxi_iQZ5r-fFiak0hYsDPYWQv+Tg at mail dot gmail dot com> <54DD877E dot 7060500 at redhat dot com> <54E49EF6 dot 3090601 at arm dot com>
On 02/18/2015 06:17 AM, Alex Velenko wrote:
> By changing behaviour of varasm.c:default_binds_local_p, this patch changes
> behaviour of gcc/config/arm/arm.c:arm_function_in_section_p and through it
> breaks gcc/config/arm/arm.c:arm_is_long_call_p for weak symbols.
>
> As a result, I get regression for gcc.target/arm/long-calls-1.c on
> arm-none-eabi:
> FAIL: gcc.target/arm/long-calls-1.c scan-assembler-not \tbl?\tweak_l1\n
> FAIL: gcc.target/arm/long-calls-1.c scan-assembler-not \tbl?\tweak_l3\n
>
> In https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html there
> is a description for -mlong-calls.
>
> This has to be fixed.
Please file a bug, for tracking purposes.
That said, it looks as if arm_function_in_section_p should be using
decl_binds_to_current_def_p instead of targetm.binds_local_p.
That will properly reject weak symbols within a given module until we receive
extra information from LTO indicating when a weak definition turns out to be
the prevailing definition.
r~