[PATCH][Tree-optimization/PR89730]grant always_inline when -flive-patching=inline-only-static

Qing Zhao qing.zhao@oracle.com
Tue Mar 26 17:53:00 GMT 2019


Hi, Richard,

thanks for the suggestion.

I tried it yesterday, but it did not work. 

the reason is:

inside “can_inline_edge_by_limits_p”,  the “allowance for always_inline” is guarded by the following condition:

else if “caller_tree != callee_tree”

this condition is ONLY true when when callee has different optimization level than the caller. 

So, I think that the correct spot for the checking of live-patching=inline-only-static should still be inside “can_inline_edge_p”. 

so my previous patch for this bug should be fine.

what’s your opinion?

thanks.

Qing

> On Mar 25, 2019, at 7:23 AM, Richard Biener <richard.guenther@gmail.com> wrote:
> 
> On Wed, Mar 20, 2019 at 4:16 PM Qing Zhao <qing.zhao@oracle.com> wrote:
>> 
>> Hi,
>> 
>> there is a bug in the current support for -flive-patching=inline-only-static:
>> 
>> it rejects inlining of external always_inline routine, therefore triggers a compilation time error.
>> 
>> we should always inline “always_inline” routines.
>> 
>> please review the following simple patch, it has been bootstrapped and regression tested on aarch64.
>> 
>> Okay for committing?
> 
> To me this seems like can_inline_edge_p was the wrong spot to disable inlining
> for -flive-patching=inline-only-static and instead it should have been in
> can_inline_edge_by_limits_p which already has proper allowance for
> always-inline.
> 
> So can you move the check there, like after
> 
>      /* gcc.dg/pr43564.c.  Apply user-forced inline even at -O0.  */
>      else if (always_inline)
>        ;
> 
> ?
> 
>> thanks.
>> 
>> Qing.
>> 
>> gcc/ChangeLog:
>> 
>> 2019-03-20  qing zhao  <qing.zhao@oracle.com>
>> 
>>        PR tree-optimization/89730
>>       * ipa-inline.c (can_inline_edge_p): Grant always_inline even when
>>       -flive-patching=inline-only-static.
>> 
>> gcc/testsuite/ChangeLog:
>> 
>> 2019-03-20  qing zhao  <qing.zhao@oracle.com>
>> 
>>        * gcc.dg/live-patching-4.c: New test.
>> 



More information about the Gcc-patches mailing list