Sujet : Re: int a = a (Was: Bart's Language)
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 18. Mar 2025, 23:27:21
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vrcs09$3ejvg$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 18.03.2025 20:51, David Brown wrote:
[...] A brief check suggests that gcc will generate code as it
would for "int a = 0;", but it is certainly possible for a compiler to
avoid any kind of initialisation here and let the register or stack slot
used for "a" stay as it was. That would be a pretty minor efficiency
improvement,
but optimised code is mostly the sum of lots of tiny improvements.
Interesting view. I've learned that such Peephole Optimizations were
not what contribute to optimizations most. It's rather transformations
of structure of various forms that is what "mostly" matters. - That's
what I've learned many decades ago, of course. - So I'm curious where
you've got that view from. (Some reference, maybe? Or was that just a
personal opinion?)
Janis, wondering