Hello All,

I have found a BUG with loading long long constant:

Here is the source:

void Test(long long l)
{
}

int main()
{
 Test(1);
}

And here is the GDB disassembly:

- 0x1166 <main>:  mov #2560, SP ;#0x0a00
- 0x116a <main+4>:  mov r1, r4 ;
 9  Test(1);
- 0x116c <main+6>:  mov #1, r12 ;subst r3 with As==01
- 0x116e <main+8>:  clr r13  ;
- 0x1170 <main+10>:  mov #1, r14 ;subst r3 with As==01  should be clr r14 !
- 0x1172 <main+12>:  mov #1, r15 ;subst r3 with As==01  should be clr r15 !
- 0x1174 <main+14>:  call #4416  ;#0x1140
- 0x1178 <main+18>:  br #0x117c  ;

I use msp430-gcc win32 build from 11 Dec 2002.

Thanks,
Oleg.
P.S. Compiling to assembly gives correct asm listing:
/***********************
 * Function `main' 
 ***********************/
main:
 .stabn 68,0,8,.LM3-main
.LM3:
/* prologue: frame size = 0 */
.L__FrameSize_main=0x0
.L__FrameOffset_main=0x0
 mov #(__stack-0), r1
/* prologue end (size=2) */
 .stabn 68,0,9,.LM4-main
.LM4:
 mov #llo(1), r12
 mov #lhi(1), r13
 mov #hlo(1), r14
 mov #hhi(1), r15
 call #Test
 .stabn 68,0,10,.LM5-main
.LM5:
/* epilogue: frame size=0 */
 br #__stop_progExec__
/* epilogue end (size=4) */
/* function main size 12 (6) */
.Lfe2:
 .size main,.Lfe2-main
/********* End of function ******/

Reply via email to