Skip to content

Instantly share code, notes, and snippets.

@dgraham
Created April 18, 2017 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgraham/5097e90918c1b05d60cd7e04525374ae to your computer and use it in GitHub Desktop.
Save dgraham/5097e90918c1b05d60cd7e04525374ae to your computer and use it in GitHub Desktop.
Constant expression inlining optimization.
// Compile without optimizations:
// cc -S -O0 -masm=intel const-expr.c
// Compile with optimizations:
// cc -S -O3 -masm=intel const-expr.c
int main() {
int x = 11;
int y = 12;
int z = x + y;
return z;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment