Hello, I'm trying to adapt the FreeRTOS (www.freertos.org) to the MSP430(F449) and found some strange behaviour of the compiler in the file "list.c" function "pvListGetOwnerOfNextEntry".
Original Sourcecode is:
volatile void *pvListGetOwnerOfNextEntry( volatile xList *pxList )
{
if( !listLIST_IS_EMPTY( pxList ) )
{
/* Increment the index to the next item and return the item,
ensuring
we don't return the marker used at the end of the list. */
pxList->pxIndex = pxList->pxIndex->pxNext;
#ifdef __GNUrC__
if( (pxList->pxIndex - pxList->pxHead) == NULL )
#else
if( pxList->pxIndex == pxList->pxHead )
#endif
{
pxList->pxIndex = pxList->pxIndex->pxNext;
}
return pxList->pxIndex->pvOwner;
}
return NULL;
}
and that's what the compiler generated:
#ifdef __GNUrC__
if( (pxList->pxIndex - pxList->pxHead) == NULL )
#else
if( pxList->pxIndex == pxList->pxHead )
1528: 1e 4d 02 00 mov 2(r13), r14 ;
152c: 2f 4d mov @r13, r15 ;
152e: 05 24 jz $+12 ;abs 0x153a
#endif
I'm missing a comparision between 152c and 152e !
(To get a valid result just remove the "r" from __GNUrC__)
Is it really a bug, do I have to modify arguments of the command line or
anything else ?
I'm using msp430-gcc 3.2.3 (binaries downloaded from www.mikrocontroller.net)
Win98. For playing with it I attached the sources.
Joerg
J. Hübler
GEMAC mbH
Zwickauer Str. 227
09116 Chemnitz
Tel. +49 371 3377 350
Fax. +49 371 3377 272
mailto: [email protected]
--
GEMAC Virencheck: OK
Virus checked by G DATA AntiVirusKit
Version: AVK 12.0.529 from 18.08.2003
<<attachment: msp-rtos.zip>>
