On Fri, Mar 24, 2017 at 10:25 AM, Martin Liška <mli...@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

Reply via email to