TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

See What Your C Function Compiles To

7 pointsby SworDsyalmost 10 years ago

2 comments

Samathyalmost 10 years ago
The output provided when looking at the given example squaring function without and then with the compiler option -O (GCC 5.1.0 or Clang 3.6) is rather interesting.<p>The code goes from something rather crazy looking, to something that a human would write. Its surprising that these compilers arnt clever enough already to produce the optimized output by default.
J_Darnleyalmost 10 years ago
&gt; Compiler: x86 gcc 4.9.2<p>&gt; Compiler options: -march=i686<p>&gt; error: CPU you selected does not support x86-64 instruction set<p>Strange, I&#x27;m sure x86 is not x86_64