#708 Label generation skips asm statements in loops

closed-fixed
5
2013-05-25
2004-02-13
James Chadd
No

I'm using sdcc for win32 from the nightly snapshots:
SDCC :
mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51
/ds400/hc08
2.3.8 (Feb 9 2004) (MINGW32)

Bug - Assembler and loops.
~~~~~~~~~~~~~~~~~~~~~~~~~~

When an assembler statement is the first line in a loop
the compiler ignores it when generating labels. As far as
I can tell this happens with all types of loop ( while, do-
while, for and lable-goto(!) ).
The code below reproduces the problem.

void main(void)
{
while(1)
{
_asm nop _endasm;
}
}

which generates this asm:

S_main__main code
_main ;Function start
nop
_00106_DS_:
;#CSRC main.c 10 _asm nop
_endasm;
GOTO _00106_DS_
RETURN

As you can see _00106_DS_: is after the nop, not
before it.

James

Discussion

  • Vangelis Rokas

    Vangelis Rokas - 2004-02-16
    • milestone: --> fixed
    • assigned_to: nobody --> vrokas
    • status: open --> closed-fixed
     
  • Vangelis Rokas

    Vangelis Rokas - 2004-02-16

    Logged In: YES
    user_id=770505

    Fixed in gen.c 1.22

     

Log in to post a comment.