A classic example of a common class of functions that can't be optimized over even though you'd think it could be is *printf(). Standard printf() without %n can be freely optimized over, but alas glibc has an extension (user-defined format masks) that means printf() can call arbitrary functions for you. That nobody ever uses this extension is irrelevant: the compiler must assume that you might be.
Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds