Caching globals in registers

jacob navia jacob@jacob.remcomp.fr
Sun Nov 5 19:56:00 GMT 2017


Le 05/11/2017 à 20:43, Jakub Jelinek a écrit :
> A bug in the program that does that.  You can use volatile, or atomics
> (including e.g. relaxed __atomic_load, which isn't really expensive).


Yeah true. Maybe I will cache them in registers too, it is not very 
difficult. Still, I think I will do it only in leaf functions. In 
non-leaf functions it (seems to me) a departure of the default that can 
be dangerous.

Yes, the user can declare them as such, and then nothing happens.

Just old software stops working and you do not know why. Until you get 
to what is not working it takes a LOT of effort, then  seeing that the 
variable is not getting read again from the assembly code is easy, of 
course. Anybody can do it.

GCC is used in many contexts, as you all know.




More information about the Gcc mailing list