4.9 version and inline asm optimizer problem?
Hello,
I found problem with optimizer, when I try use inline asm. Here is exaple of code (in two files !)
=======
File test.h:
=======
__attribute_
{
register int *input1 __asm__("r0") = var;
__asm__ __volatile__ ("svc 123" : : "r" (input1));
}
=======
And file test.c:
=======
#include "test.h"
void fooBar(void)
{
int var;
var = 1234;
svcTest(&var);
}
=======
And here is problem. This is CORRECT result from 4.8 2014q3 ane earlier (only instructions) :
=======
fooBar:
sub sp, sp, #8
movw r3, #1234
add r0, sp, #8
str r3, [r0, #-4]!
svc 123
add sp, sp, #8
bx lr
=======
This is BROKEN result from 4.9 2014q4 (only instructions) :
=======
fooBar:
sub sp, sp, #8
add r0, sp, #4
svc 123
add sp, sp, #8
bx lr
=======
Where is "var = 1234;"? This is the bug. Or is it my fault?
Code is compiled by: "arm-none-
I try -O1 -O2, -Os and -Og and all have this problem. Only "-O0" not, but result is too slow and too hungry for RAM. Compilation for cortex-m4 produce same results
Have a nice day,
Jiri
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- jdobry
- Solved:
- Last query:
- Last reply: