Francisco T. A. Silva escreveu:
When compiled with this command line:
msp430-gcc -c -mmcu=msp430x449 -I. -g -O1 -funsigned-char \
-funsigned-bitfields -fpack-struct -fshort-enums \
-Wall -Wstrict-prototypes -Winline \
-fregmove -foptimize-register-move -frename-registers -fssa \
-Wa,-adhlns=test.lst -std=gnu99 test.c -o test.o
Generates code that pushes r14 and r15, even though they are
never used.
Replying to myself.
As odd as it may seem, if I don't use -fpack-struct, the problem
goes away :) the compiler chooses r15 and r12 instead of r13 and
r12, but only pushes the ones used).
BTW, I found this when I stumbled on a 'issue' with -fpack-struct.
If I compile the following code:
/**************************************************************************************/
typedef unsigned char u08;
typedef struct { u08 y; u08 x; const u08 *p; u08 *b; u08 s;} const par;
u08 buf1[5];
const u08 p1[] = "test";
par t = {
2,
3,
p1,
buf1,
sizeof(buf1),
};
/**************************************************************************************/
$ msp430-gcc -fpack-struct -S test.c
test.c:12: initializer for integer value is too complicated
test.c:12: initializer for integer value is too complicated
The error goes away if I omit -fpack-struct.
There is no such error with avr-gcc or my linux gcc.
--
Francisco