Day 13 of Advent of Compiler Optimisations!

You're calling a function inside a loop, but its result never changes between iterations. Does the compiler spot this and hoist it out? Turns out the answer depends on which compiler you use! Clang pulls off the optimisation beautifully, but gcc stumbles—even with explicit hints. What's going on?

Read more: xania.org/202512/13-licking-li
Watch: youtu.be/dIwaqJG0WDo

0

If you have a fediverse account, you can quote this note from your own instance. Search https://dice.camp/users/tinheadned/statuses/115712504013966282 on your instance and quote it. (Note that quoting is not supported in Mastodon.)