News for hackers. Stuff that matters.
Re:Building the Rust Compiler with GCC by Rogach on Monday July 07, 2025 @01:52AM (#44487178)
Sounds like attempting to always inline a recursive function should be an error instead. But it's probably undesirable to make that change because it would likely break existing crates and thus backwards compatibility as well?
Re:Building the Rust Compiler with GCC by dwattttt on Monday July 07, 2025 @04:07AM (#44487843)
"inline(always)" I expect matches Clang's "always_inline", and Clang's documentation makes what it does clearer:

> Inlining heuristics are disabled and inlining is always attempted regardless of optimization level.

So it should be interpreted as "always attempt to inline", as opposed to "this must be inclined", or other attributes that instead influence the "should this be inclined" heuristic.

Re:Building the Rust Compiler with GCC by j16sdiz on Monday July 07, 2025 @07:08AM (#44488972)
recursive function can be inline when unrolled. This is a valid optimization.

Google "llvm inline recursion". It exists. It should works. Fibonacci is the standard test case.

Re:Building the Rust Compiler with GCC by 1718627440 on Monday July 07, 2025 @09:02AM (#44489957)
But not every recursive function can be inlined (without a secondary stack).