This is the mail archive of the gcc-help@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]

How to avoid constant propagation into functions?


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


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