Re: gcc optimization constant propagation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



charfi asma wrote:

Why in the fist code, c is not considered as a constant (in spite that affich() does not change c)
I have no idea how deep into affich the compiler can look (for changes to c). I expect/hope it looks as deep as it inlines.

But those operator<<() calls in affich go much deeper than you might be thinking through. I expect the compiler should not and does not inline that deep, nor check for changes to c that deep.

Maybe you want c to be a local variable, so as long as there isn't a accessible copy of its address lying around, the compiler can assume it isn't modified by code inside called functions.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux