Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prologue/epilogue optimization #16

Closed
mskvortsov opened this issue Oct 22, 2018 · 2 comments
Closed

Prologue/epilogue optimization #16

mskvortsov opened this issue Oct 22, 2018 · 2 comments

Comments

@mskvortsov
Copy link
Contributor

Input: int foo() { return 1; }
Clang -O2/-Os output:

foo:
       0:	04 12 	push	r4
       2:	04 41 	mov	r1, r4
       4:	1c 43 	mov	#1, r12
       6:	34 41 	pop	r4
       8:	30 41 	ret

GCC:

foo:
       0:	5c 43 	mov.b	#1, r12
       2:	30 41 	ret
@asl
Copy link
Contributor

asl commented Oct 22, 2018

Interesting. Looks like we default to frame pointer? What does clang -fomit-frame-pointer do?

@mskvortsov
Copy link
Contributor Author

Yep, -fomit-frame-pointer does exactly what GCC does by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants