This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix thunk expansion (PR ipa/64896)
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Yvan Roux <yvan dot roux at linaro dot org>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Jakub Jelinek <jakub at redhat dot com>, Richard Biener <rguenther at suse dot de>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 10 Mar 2015 19:18:08 +0100
- Subject: Re: [PATCH] Fix thunk expansion (PR ipa/64896)
- Authentication-results: sourceware.org; auth=none
- References: <20150206202331 dot GO1746 at tucnak dot redhat dot com> <20150206203709 dot GA22441 at kam dot mff dot cuni dot cz> <CAD57uCfDKomop66KRd9RGhwH6aX=mKnJqjpVm_LHfyoTbsDCkw at mail dot gmail dot com> <CAD57uCeNcL_smkUdOvZHywxjN8DeZevT7rmyGxmtHbJQvUVR3g at mail dot gmail dot com>
> Hi
>
> On 9 March 2015 at 17:07, Yvan Roux <yvan.roux@linaro.org> wrote:
> > Hi,
> >
> > As added in the PR, this issue is also present on 4.9 branch and
> > affects at least arm-linux-gnueabihf target (as reported in PR61207).
> >
> > I've backported it in the 4.9 branch with the attached patch. The
> > difference with the trunk code is due the code introduced by PR63587
> > fix (I didn't checked on power7, on which the PR was initially
> > reported, but I didn't managed to reproduce the issue for arm targets
> > on 4.9 branch).
> >
> > Boostrapped on x86_64, and tested on arm/aarch64 targets (regression
> > testing is ongoing). is ok for 4.9 branch when validation is done ?
>
> So bootstrapped/regtested on x86_64 and cross-compiled/regtested on
> aarch64-linux-gnu
> arm-linux-gnueabihf
> armeb-linux-gnueabihf
> i686-linux-gnu
This is OK. note that cgraph_node::expand_thunk has gathered quite few
extra fixes that may be resonable for backporting. Looking across
changes after ipa-icf was enabled I think we should look into
these:
PR ipa/65236
* cgraphunit.c (cgraph_node::expand_thunk): Enable return slot
opt.
PR ipa/64813
* cgraphunit.c (cgraph_node::expand_thunk): Do not create
a return value for call to a function that is noreturn.
PR ipa/63595
* cgraphunit.c (cgraph_node::expand_thunk): DECL_BY_REFERENCE
is correctly handled for thunks created by IPA ICF.
PR ipa/63587
* cgraphunit.c (cgraph_node::expand_thunk): Only VAR_DECLs are put
to local declarations.
* function.c (add_local_decl): Implementation moved from header
file, assert introduced for tree type.
* function.h: Likewise.
While these bugs was triggered by ipa-icf, they all IMO can be reproduced by
thunks on targets that do not define assembler thunks.
(most are about return values and those are not excercised on main targets with
MI thunks because covariant thunks always returns pointer)
Honza