C++ compiler puzzle: can you guess why GCC 10.3 generates slightly worse code when switching from -std=c++17 to -std=c++20?
https://godbolt.org/z/99z7jxM1c
#cpp #programming #cpp20 #assembly #gcc #compilers
C++ compiler puzzle: can you guess why GCC 10.3 generates slightly worse code when switching from -std=c++17 to -std=c++20?
https://godbolt.org/z/99z7jxM1c
#cpp #programming #cpp20 #assembly #gcc #compilers
This is a reduced testcase from a large codebase for 32-bit ARM microcontrollers.
Yesterday I noticed that GCC 12 generates the exact same code in C++17 and C++20 mode.
This morning, a GCC developer guessed the issue and pointed me at the fix that was merged two years ago.
I can't update my toolchain right now, but knowing what triggers the bug made it easy to come up with a workaround for GCC 10.
Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.
All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.