#1197 increment by one does not work for 'float' pointers

closed-rejected
nobody
None
5
2013-05-25
2006-09-08
vinayak
No

No asm code is generated for any of the following syntax.

valuepointer++;
OR
valuepointer+=1;
OR
valuepointer=valuepointer+1;

But it creates correct code for

valuepointer+=2;
OR
valuepointer=valuepointer+2;

like --->

==========================================
; test.c:15: i++;
; genPlus
; genPlusIncr
inc r2
; test.c:16: valuepointer++;
; test.c:18: while(1)
; Peephole 112.b changed ljmp to sjmp
sjmp 00101$
00105$:
; Peephole 112.b changed ljmp to sjmp
sjmp 00105$
; Peephole 259.a removed redundant label 00107$ and ret
;
==========================================

Please find the file attached.

Discussion

  • vinayak

    vinayak - 2006-09-08

    comple this as sdcc test.c

     
  • Maarten Brock

    Maarten Brock - 2006-09-08
    • milestone: --> non_bugs
    • status: open --> closed-rejected
     
  • Maarten Brock

    Maarten Brock - 2006-09-08

    Logged In: YES
    user_id=888171

    If you take a better look at the generated asm you'll see
    that:
    1) r3,r4 (valuepointer) is assigned to dptr
    2) dptr is incremented 4 times
    3) dptr is assigned back to r3,r4.

    There is no bug here.

     

Log in to post a comment.