This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix calls.c for a _complex type (PR ipa/80104).


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]