This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix calls.c for a _complex type (PR ipa/80104).
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Martin Liška <mliska at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Fri, 24 Mar 2017 12:49:57 +0100
- Subject: Re: [PATCH] Fix calls.c for a _complex type (PR ipa/80104).
- Authentication-results: sourceware.org; auth=none
- References: <5040cf25-9cfb-995c-2442-c4c705533733@suse.cz>
On Fri, Mar 24, 2017 at 10:25 AM, Martin Liška <mliska@suse.cz> wrote:
> Hello.
>
> Briefly described in the PR, running ICF (without any optimization level) can create a thunk call
> that does not use an SSA_NAME which is a default def of an argument of the caller:
>
> c (complex float b)
> {
> complex float arg.1;
> float retval.0;
>
> <bb 2> [100.00%]:
> arg.1_2 = b;
> retval.0_4 = a (arg.1_2); [tail call]
>
> return retval.0_4;
>
> }
>
> The "arg" variable creation was introduced by Jason in r207301.
> As complex type is passed as invisible reference, we need to find address of the argument.
> Thus I'm suggesting to find it alternatively via SSA_NAME_DEF_STMT.
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. And fixes the ICE
> on s390x cross compiler.
>
> Ready to be installed?
Ick, that looks like fragile code ... looks like the
call_from_thunk_p case expects
the default def or the param-decl. So why not create it that way? Or
simply not do
this "optimization"?
Richard.
> Martin