How to avoid constant propagation into functions?

Georg-Johann Lay avr@gjlay.de
Mon Dec 5 16:40:00 GMT 2016


On 05.12.2016 17:33, Tim Prince wrote:
>> Hi, I just came across a small test program that propagates a constant
>> value from a function to a callee, even though the callee has attribute
>> "noclone".
>>
>> From the gcc documentation I would conclude that "noclone" should
>> prevent such propagations?
>>
>> https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-g_t_0040code_007bnoclone_007d-function-attribute-3345
>>
>> noclone
>>     This function attribute prevents a function from being
>>     considered for cloning -- a mechanism that produces specialized
>>     copies of functions and which is (currently) performed by
>>     interprocedural constant propagation.
>>
>>
>> I see this with gcc 5.4 (x86_64) and current trunk.
>>
>> Johann
>
> Maybe you want -fno-inline-functions ?

The function has __attribute((noinline,noclone)).  This is not sufficient?

Johann





More information about the Gcc-help mailing list