Menu

#1835 code generator error

closed-fixed
z80 port (189)
5
2011-09-14
2011-09-01
No

sdcc.exe -mz80 --nostdlib --nostdinc --fverbose-asm -I../include -c buggy_dequeue.c

SDCC : z80/r2k/r4k/pic16/pic14/hc08 3.0.4 #6784 (Aug 30 2011) (CYGWIN)

see ASSERTS in the source code

I suspect it is a bug in an optimization pass. A wrong value gets store in a file scope variable, and
the array update is lost.

Discussion

  • Lee Morrison

    Lee Morrison - 2011-09-01
     
  • Philipp Klaus Krause

    The bug occours in line 39/40:
    next_head = delay_next[delaying_task_head];
    delay_next[delaying_task_head] = NULL_IDX;
    iy is overwritten with &delaying_task_head, at the end of the code for line 39, but line 40 assumes that it still holds delay_next + delaying_task_head

    I have added the attachment to sdcc in revision #6803 as regression test bug3401973.c. It is disabled for the z80 until the bug is fixed.

    Philipp

    Philipp

     
  • Philipp Klaus Krause

    Fixed in revision #6851.

    Philipp

     
  • Philipp Klaus Krause

    • assigned_to: nobody --> spth
    • status: open --> closed-fixed
     

Log in to post a comment.