Get the latest tech news

Both GCC and Clang generate strange/inefficient code


I ran into some surprisingly weird output of both Clang and gcc on a simple code snippet, and I thought I'd share it. Consider the following...

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of gcc

gcc

Photo of Clang

Clang

Photo of inefficient code

inefficient code

Related news:

News photo

Claude’s C Compiler vs. GCC

News photo

Initial AMD Zen 6 "znver6" Support Merged For LLVM/Clang

News photo

GCC 16 Compiler Steps Closer To Release With Algol 68 Frontend, AMD Zen 6, C++20 Default