LWN.net Logo

GCC Explorer - an interactive take on compilation

GCC Explorer - an interactive take on compilation

Posted May 28, 2012 21:09 UTC (Mon) by gb (subscriber, #58328)
In reply to: GCC Explorer - an interactive take on compilation by hummassa
Parent article: GCC Explorer - an interactive take on compilation

Nope, i haven't forgotten this.

Compiler do know this perfectly, this static array is entirely inside function scope and it's trivial for compiler to find that static const case is absolutely same to plain const case, and that both are never used outside of scope of this function.


(Log in to post comments)

GCC Explorer - an interactive take on compilation

Posted May 29, 2012 18:53 UTC (Tue) by hummassa (subscriber, #307) [Link]

Anyway, arrays have to deal with many issues (aliasing, for instance) that preclude many optimization strategies; sometimes, the compiler programmers have to give some priority for the strategies that don't have to deal with that.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds