This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR ipa/64049
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Richard Biener <richard dot guenther at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 9 Dec 2014 08:18:25 +0100
- Subject: Re: [PATCH] Fix PR ipa/64049
- Authentication-results: sourceware.org; auth=none
- References: <DUB118-W49097CA70585F4128C2AC9E4640 at phx dot gbl> <DUB118-W4945E53800785CF3BB5C32E4640 at phx dot gbl> <CAFiYyc3U1f0dA774+_-bBwJ4foFaxqRQmYyUzE65pKgMfJ_3bQ at mail dot gmail dot com> <20141208224957 dot GB32347 at kam dot mff dot cuni dot cz> <20141208231635 dot GC32347 at kam dot mff dot cuni dot cz> <DUB118-W166BA21136719C903820BBE4650 at phx dot gbl>
>
>
> BTW: I have never seen any VAR_DECL here, at least not in my test case, do you have test cases for that?
If you call virtual method of undefined variable:
struct A {
virtual void foo ();
};
void
t()
{
struct A *a;
a->foo ();
}
It will make GCC to drop the virtual table lookup and directly call __builtin_unreachable
>
> The condition here was if TREE_CODE(..) != PARM_DECL, and I extended it to be
> TREE_CODE (..) == PARM_DECL ||| TREE_CODE (..) == RESULT_DECL.
>
> That was purely by heuristic, the intention was to change as little as possible, so
> refining that to TREE_CODE (...) == PARM_DECL || (TREE_CODE (...) == RESULT_DECL && !(DECL_BY_REFERENCE (...)))
> would be fully consistent with my heuristic.
>
> I don't have much more than the example where this RESULT_DECL showed up here.
> If this extra condition does not make the test case fail, it would be OK for me.
Actually trying to play with a testcase, for scalar return values, we never put RESULT_DECL
there, only for values returned by reference. So I guess no extra condition is needed.
So I guess the patch is fine as it is.
Honza
>
> But why is a RESULT_DECL per se undefined?
>
> Do you have a test case, where this extra condition would make a difference?
>
>
> Thanks,
> Bernd.
>