long time lurker, first time caller. *grin*
I've been using a version of mspgcc and gcc-3.2.3 with a 6+ month old
msplibc for a while now and decided to upgrade. A side question for the
group is: is it unwise to move to gcc-3.3.1 with mspgcc? (I like the
move as it's the same version we use for host and arm development).
In gcc-3.3.1 __FUNCTION__ functionality has been changed to more
closely match C99 specs. This means that iomacros.h:BIC_SR_IRQ no
longer compiles without a warning about deprecated string concat of
__FUNCTION__. I decided to try and fix this for us and ran into a
problem with __builtin_frame_address.
I think the proper way to do _BIC_SR_IRQ is:
#define _BIC_SR_IRQ(x)\
{\
void* addr = __builtin_frame_address(0);
__asm__ __volatile__ (\
"bic %0, %1 : : "i" ((uint16_t)x), "o" ((uint16_t)addr)\
)\
}
the problem is that __builtin_frame_address does not return the start of
frame, it instead just returns the current stack pointer. I tried to
figure out where this is broken but got pretty lost in builtins.c and
couldn't really get anywhere. Any ideas?
Thanks,
Hunter