Hello,
I cannot compile __bic_SR_register_on_exit() using mspgcc version 3.2.3:
My source file:
#include <iomacros.h>
#define USCI_A0_VECTOR 114
#define OSCOFF (1<<5)
extern "C" interrupt( USCI_A0_VECTOR) isr_func(void)
{
__bic_SR_register_on_exit( OSCOFF );
}
It is probably caused by not allowed trial of merging __FUNCTION__ with
other string
in macro that defines __bic_SR_register (in iomacros.h):
#define __bic_SR_register_on_exit(x) \
__asm__ __volatile__ ( \
"bic %0, .L__FrameOffset_" __FUNCTION__ "(r1)" \
: : "ir" ((uint16_t) x) \
)
Is it __FUNCTION__ a literal or "const char *" ?
Other information:
1. host operating system: Windows XP
2. prebuild installer: mspgcc-20081230.exe
3. mcu = msp430f5438
4. source compiled by following line:
msp430-gcc -c -v -mmcu=msp430x5438 -g -O3 -Wall -Wcast-align -Wcast-qual
-Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wnested-externs
-Wpointer-arith -Wredundant-decls -Wreturn-type -Wshad
ow -Wstrict-prototypes -Wswitch -Wunused -I. -Ie:/mspgcc/msp430/include
-fno-exceptions -fno-rtti -Wa,-adhlns=bic_bug.c bic_bug.c -o bic_bug.o
Reading specs from e:\mspgcc\bin\..\lib\gcc-lib\msp430\3.2.3\specs
Configured with: ./configure --target=msp430
--prefix=c:/work/mspgcc/sf/packaging/build/installed --disable-multilib
--disable-libc --disable-libssp --disable-intl --disable-libiberty
--with-gcc --wit
h-gnu-ld --with-gnu-as --with-stabs --disable-shared --disable-threads
--disable-win32-registry --disable-nls --enable-languages=c,c++
Thread model: single
gcc version 3.2.3
e:\mspgcc\bin\..\lib\gcc-lib\msp430\3.2.3\cc1.exe -lang-c -v -I.
-Ie:/mspgcc/msp430/include -iprefix
e:\mspgcc\bin\..\lib/gcc-lib/msp430\3.2.3\ -D__GNUC__=3 -D__GNUC_MINOR__=2
-D__GNUC_PATCHLEVEL__=3
-D__GXX_ABI_VERSION=102 -DMSP430 -D__MSP430__ -D__MSP430 -D__OPTIMIZE__
-D__STDC_HOSTED__=1 -DMSP430_HAS_HW_MUL -D__MSP430_5438__ -D__MSP430X2__
-DMSP430_HAS_HWMUL -D__SIZE_TYPE__=unsigned int -D__PT
RDIFF_TYPE__=int -D__INT_MAX__=32767 bic_bug.c -quiet -dumpbase bic_bug.c
-mmcu=msp430x5438 -g -O3 -Wall -Wcast-align -Wcast-qual -Wimplicit
-Wmissing-declarations -Wmissing-prototypes -Wnested-extern
s -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow
-Wstrict-prototypes -Wswitch -Wunused -version -fno-exceptions -fno-rtti -o
C:\DOCUME~1\internet\LOCALS~1\Temp/ccRCHztf.s
GNU CPP version 3.2.3 (cpplib) (GNU assembler syntax)
GNU C version 3.2.3 (msp430)
compiled by GNU C version 3.4.5 (mingw-vista special r3).
ignoring nonexistent directory "e:/mspgcc/msp430/sys-include"
ignoring nonexistent directory
"c:/work/mspgcc/sf/packaging/build/installed/include"
ignoring nonexistent directory
"c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/includ
e"
ignoring nonexistent directory
"c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/../../
../../msp430/sys-include"
ignoring nonexistent directory
"c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/../../
../../msp430/include"
#include "..." search starts here:
#include <...> search starts here:
.
e:/mspgcc/msp430/include
e:/mspgcc/lib/gcc-lib/msp430/3.2.3/include
e:/mspgcc/msp430/include
End of search list.
bic_bug.c:7: syntax error before string constant
make: *** [bic_bug.o] Error 1
5. running preprocessor:
msp430-gcc -E -v -mmcu=msp430x5438 -g -O3 -Wall -Wcast-align -Wcast-qual
-Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wnested-externs
-Wpointer-arith -Wredundant-decls -Wreturn-type -Wshad
ow -Wstrict-prototypes -Wswitch -Wunused -I. -Ie:/mspgcc/msp430/include
-fno-exceptions -fno-rtti -Wa,-adhlns=bic_bug.c bic_bug.c -o bic_bug.i
Reading specs from e:\mspgcc\bin\..\lib\gcc-lib\msp430\3.2.3\specs
Configured with: ./configure --target=msp430
--prefix=c:/work/mspgcc/sf/packaging/build/installed --disable-multilib
--disable-libc --disable-libssp --disable-intl --disable-libiberty
--with-gcc --wit
h-gnu-ld --with-gnu-as --with-stabs --disable-shared --disable-threads
--disable-win32-registry --disable-nls --enable-languages=c,c++
Thread model: single
gcc version 3.2.3
e:\mspgcc\bin\..\lib\gcc-lib\msp430\3.2.3\cpp0.exe -lang-c -v -I.
-Ie:/mspgcc/msp430/include -iprefix
e:\mspgcc\bin\..\lib/gcc-lib/msp430\3.2.3\ -D__GNUC__=3 -D__GNUC_MINOR__=2
-D__GNUC_PATCHLEVEL__=
3 -D__GXX_ABI_VERSION=102 -DMSP430 -D__MSP430__ -D__MSP430 -D__OPTIMIZE__
-D__STDC_HOSTED__=1 -DMSP430_HAS_HW_MUL -D__MSP430_5438__ -D__MSP430X2__
-DMSP430_HAS_HWMUL -D__SIZE_TYPE__=unsigned int -D__P
TRDIFF_TYPE__=int -D__INT_MAX__=32767 bic_bug.c -o bic_bug.i -Wall
-Wcast-align -Wcast-qual -Wimplicit -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -W
return-type -Wshadow -Wstrict-prototypes -Wswitch -Wunused
GNU CPP version 3.2.3 (cpplib) (GNU assembler syntax)
ignoring nonexistent directory "e:/mspgcc/msp430/sys-include"
ignoring nonexistent directory
"c:/work/mspgcc/sf/packaging/build/installed/include"
ignoring nonexistent directory
"c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/includ
e"
ignoring nonexistent directory
"c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/../../
../../msp430/sys-include"
ignoring nonexistent directory
"c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/../../
../../msp430/include"
#include "..." search starts here:
#include <...> search starts here:
.
e:/mspgcc/msp430/include
e:/mspgcc/lib/gcc-lib/msp430/3.2.3/include
e:/mspgcc/msp430/include
End of search list.
6. Preprocesor output:
# 1 "bic_bug.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "bic_bug.c"
# 1 "e:/mspgcc/msp430/include/iomacros.h" 1
# 34 "e:/mspgcc/msp430/include/iomacros.h"
# 1 "e:/mspgcc/msp430/include/sys/inttypes.h" 1
# 38 "e:/mspgcc/msp430/include/sys/inttypes.h"
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef int int16_t;
typedef unsigned int uint16_t;
typedef long int32_t;
typedef unsigned long uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
typedef int16_t intptr_t;
typedef uint16_t uintptr_t;
# 35 "e:/mspgcc/msp430/include/iomacros.h" 2
# 2 "bic_bug.c" 2
extern "C" interrupt( 114) isr_func(void)
{
__asm__ __volatile__ ( "bic %0, .L__FrameOffset_" __FUNCTION__
"(r1)" : : "ir" ((uint16_t) (1<<5)) );
}
#include <iomacros.h>
#define USCI_A0_VECTOR 114
#define OSCOFF (1<<5)
extern "C" interrupt( USCI_A0_VECTOR) isr_func(void)
{
__bic_SR_register_on_exit( OSCOFF );
}
# 1 "bic_bug.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "bic_bug.c"
# 1 "e:/mspgcc/msp430/include/iomacros.h" 1
# 34 "e:/mspgcc/msp430/include/iomacros.h"
# 1 "e:/mspgcc/msp430/include/sys/inttypes.h" 1
# 38 "e:/mspgcc/msp430/include/sys/inttypes.h"
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef int int16_t;
typedef unsigned int uint16_t;
typedef long int32_t;
typedef unsigned long uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
typedef int16_t intptr_t;
typedef uint16_t uintptr_t;
# 35 "e:/mspgcc/msp430/include/iomacros.h" 2
# 2 "bic_bug.c" 2
extern "C" interrupt( 114) isr_func(void)
{
__asm__ __volatile__ ( "bic %0, .L__FrameOffset_" __FUNCTION__ "(r1)" :
: "ir" ((uint16_t) (1<<5)) );
}