Menu

#232 Double use of ACC

closed-fixed
5
2013-05-25
2001-11-18
No

#include <stdarg.h>

char c;

void
myprintf (const char code *fmt, ...) reentrant
{
int i1;
va_list argptr;
int i2, i3;

va_start (argptr, fmt); // BUG

for (i1 = 0; i1 < 1; ++i1)
for (i2 = 0; i2 < 1; ++i2)
for (i3 = 0; i3 < 1; ++i3)
c = va_arg (argptr, char);
}

acc is used twice:

; 11 va_start (argptr, fmt);
; genAddrOf
mov a,_bp
add a,#0xfc
; genAssign
mov a,_bp
add a,#0x03
mov r0,a
mov @r0,a

Discussion

  • Johan Knol

    Johan Knol - 2001-11-19
    • milestone: --> fixed
    • assigned_to: nobody --> johanknol
    • status: open --> closed-fixed
     
  • Johan Knol

    Johan Knol - 2001-11-19

    Logged In: YES
    user_id=63512

    fixed in SDCCicode.c:1.119, mcs51/ralloc.c: 1.76 and
    ds390/ralloc.c:1.53.

     

Log in to post a comment.