On 9/19/13 2:04 PM, Andreas Schwab wrote: > Daniel Colascione writes: > >> On 9/19/13 9:35 AM, Andreas Schwab wrote: >>> Daniel Colascione writes: >>> >>>> Can we please remove these "!defined __APPLE__" tests and start inlining >>>> functions again in OS X? >>> >>> Why doesn't the compiler inline static functions by itself? >> >> Why should it? > > There is no reason not to do it. Sure there is: programs would be huge if compilers naively treated every "static" as "inline, so they don't. Instead, compilers inline some static functions, some of the time, and the heuristics they use for deciding whether to do that are inscrutable and variable. Why should we rely on these heuristics for good performance when we just write "static inline" and make the decision ourselves? If we've identified a bit of inlining as performance critical, there is every reason to tell the compiler "this is important" instead of just hoping that the compiler figures it out on its own. We shouldn't strip these hints from existing code, at least. >> Why should we remove this hint? > > "Hint" is the essential hint. What's wrong with leaving hints in the code? We still have "register" all over the place, and "static inline" does much more than "register".