Compilers are (too) smart
6/Jun 2024
Last week I noticed some unexpected assembly code in a function calling std::unordered_map::find (yes, I know, friends don’t let friends use STL, but that is a topic for another discussion). I decided to investigate a bit and it turned out to be quite a journey.
It was a Clang compiler, ARM-based platform, I will use x64 here as behavior is similar and it is easier to repro in the Compiler Explorer.
What is important however, we should be using libcxx STL (-stdlib=libc++ switch). A mi...
Read more at msinilo.pl