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>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, 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 09:26:06 -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> <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> <54E5F041 dot 6040701 at redhat dot com> <54E6188F dot 507 at arm dot com>
On 02/19/2015 09:08 AM, Alex Velenko wrote:
> Your suggestion seem to fix gcc.target/arm/long-calls-1.c, but has to be
> thoroughly tested.
Before you do complete testing, please also delete the TREE_STATIC test.
That bit should never be relevant to functions, as it indicates not that
it is in the compilation unit, but that it has static (as opposed to
automatic) storage duration. Thus it is only relevant to variables.
r~
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 7bf5b4d..777230e 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -6392,14 +6392,8 @@ arm_set_default_type_attributes (tree type)
static bool
arm_function_in_section_p (tree decl, section *section)
{
- /* We can only be certain about functions defined in the same
- compilation unit. */
- if (!TREE_STATIC (decl))
- return false;
-
- /* Make sure that SYMBOL always binds to the definition in this
- compilation unit. */
- if (!targetm.binds_local_p (decl))
+ /* We can only be certain about the prevailing symbol definition. */
+ if (!decl_binds_to_current_def_p (decl))
return false;
/* If DECL_SECTION_NAME is set, assume it is trustworthy. */