Hello there,

I'm having a problem with the the msp430-gcc compiler when i use the
optimisation flag -02.
The problem relates to a section of code in my serial RX ISR. I have
included the incorrect code listing below and as you can see @ f278 there is
no actual code for the "serialHdrPtr" address assignment. When i take out
the -O2 flag everything build correctly. Is this a bug with the mp430-gcc ?
as this definitly should not be happening. All ideas and help welcome as i
would like to turn on opitimisation prioir to first field code release.


/*listing for the UART0 RX ISR routine */

   if (transmitting == 0)

    f268:       c2 93 93 02     cmp.b   #0,     &0x0293 ;r3 As==00
    f26c:       10 20           jnz     $+34            ;abs 0xf28e

         transmitting = 1;
    f26e:       d2 43 93 02     mov.b   #1,     &0x0293 ;r3 As==01
         serialBuffPtr = (unsigned char *)&serialBuff[0];
    f272:       b2 40 0a 02     mov     #522,   &0x0200 ;#0x020a
    f276:       00 02
         serialDataCnt = 0;
    f278:       c2 43 08 02     mov.b   #0,     &0x0208 ;r3 As==00
         serialHdrPtr = (unsigned char *)&serialHdrBuff[0];
         serialHdrCnt =0;
                 U0TXBUF = *serialHdrPtr++;
    f27c:       d2 42 04 02     mov.b   &0x0204,&0x0077 ;0x0204
    f280:       77 00
    f282:       b2 40 05 02     mov     #517,   &0x0202 ;#0x0205
    f286:       02 02
         serialHdrCnt++;
    f288:       d2 43 90 02     mov.b   #1,     &0x0290 ;r3 As==01
    f28c:       35 3c           jmp     $+108           ;abs 0xf2f8
   }

Best Regards,

Fintan McAndrew

Email: [email protected]
Tel: +353 91 520053





Reply via email to