Created
April 18, 2017 00:52
-
-
Save dgraham/5097e90918c1b05d60cd7e04525374ae to your computer and use it in GitHub Desktop.
Constant expression inlining optimization.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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