mirror of
https://github.com/brain-hackers/lab
synced 2026-04-15 14:36:58 +09:00
Gprof test program
- Needs gprof-enabled CeGCC.
maketo compile AppMain.exe.
CFLAGS
By default, GCC emits code that is not comformant to APCS.
Gprof's _mcount assumes APCS-compliant and fp being present in the binary.
-mapcs-frameis disabled by default for all optimization level- It leads to a crash without APCS. Must be enabled explicitly.
-fno-omit-frame-pointeris enabled for all optimization level but-O0- It might have some effect on the compilation, but not sure
- As I experiment unsetting (disabling) this flag, it doesn't crash even with
-O2
Experiment results: flags' effect
-fno-omit-frame-pointerlooks like it has nothing to do with calling convention because of-mapcs-frame- Optimization other than
-O0optimizes the func call (inlining etc) and the resulting graph becomes strange (lack of main() etc.)
| CFLAGS | Screenshot |
|---|---|
-O0 |
![]() |
-O2 |
![]() |

