Address access optimizations
Hello there,
I was playing around with some templates to configure the pins of an stm f4. I uploaded the offending code to http://
It is some bad template "magic", granted, I like playing around. Rest assured I was attacked for the bare existance of this source code by multiple parties already!
I looked at the assembly output with -Os and -O3. Two observations:
1: -Os actually produces more code than -O3, because it seems not catch the static nature of the code. Is that because the compiler can not know in how many compilation units the code might be referenced and thus assumes multiple use, so runtime calls will produce smaller code?
2: -O3. The template soup gets reduced to six stores (which obviously is very good). However the compiler includes six absolute addresses for the stores, instead of one or maybe two addresses and using relative writes subsequently. Is the address-
The code is rather lengthy but has no external dependency, so it should compile right away.
Best regards,
Michael
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Zhenqiang Chen
- Solved:
- Last query:
- Last reply: