#639 error in produced assembly code

closed-fixed
5
2003-11-23
2003-11-19
Anonymous
No

reply to omer.enbar [at] ceibo [dot] com
(ceibo.com)
hello,

command line:
sdcc.exe err_sample.c --model-large -Lc:\sdcc\lib\large

version
SDCC :
mcs51/gbz80/z80/avr/ds390/pic14/pic16/TININative/xa51
/ds400/hc08 2.3.6 (N
ov 3 2003) (MINGW32)

the incorrect output:
a = 5;
b = 6;
swap(&a, &b);

should be: a=6; b=5;
but gets a=6; b=6;

I tracked down the error in the assembly code, if needed.
also, the bug only occurs when the function is reentrant.
I also tried to remove any optimizations (--noinduction, -
-no..., etc...) but it still doesn't work.

Discussion

  • Erik Petrich

    Erik Petrich - 2003-11-19
    • labels: --> Live range problems
     
  • Erik Petrich

    Erik Petrich - 2003-11-19

    Logged In: YES
    user_id=635249

    Looks like packRegsForAssign is substituting iTemp3 for
    iTemp1, but not transfering the clash between iTemp1 &
    iTemp6 to iTemp3?

     
  • Klaus Flittner

    Klaus Flittner - 2003-11-21

    Logged In: YES
    user_id=879538

    Yes, this seems to be the problem.
    The best solution IMO would be, to do the LR computation
    after the
    register packing and only the really needed parts before.
    If there are no objections i will do this.

     
  • Klaus Flittner

    Klaus Flittner - 2003-11-21
    • assigned_to: nobody --> kflittner
     
  • Klaus Flittner

    Klaus Flittner - 2003-11-23
    • status: open --> closed-fixed
     
  • Klaus Flittner

    Klaus Flittner - 2003-11-23

    Logged In: YES
    user_id=879538

    fixed.
    See ChangeLog 1.513 for details.

     

Log in to post a comment.