#472 Strange observation in 2d arrays

closed
5
2013-05-25
2003-03-05
Anonymous
No

The last line in this example dont generate code.

Version:
SDCC : mcs51/gbz80/z80/avr/ds390/pic14/TININative/xa51
2.3.3 (Feb 23 2003) (UNIX)

-------------------------
data char disp_buf[7][8];
char tmp,tmp1;

main()
{
tmp=*(disp_buf[3] + 2);
// disp_buf[3][2]=tmp1; //This line works
*(disp_buf[3] + 2)=tmp1; // This line dont
generate // code
}
------------------------
This is the asm-file:

;tmp.c:4: main()
; -----------------------------------------
; function main
; -----------------------------------------
_main:
;tmp.c:6: tmp=*(disp_buf[3] + 2);
; genPointerGet
; genNearPointerGet
; genDataPointerGet
mov _tmp,(_disp_buf + 0x001a)
;tmp.c:7: *(disp_buf[3] + 2)=tmp1;
00101$:
ret
.area CSEG (CODE)
.area XINIT (CODE)

g.fink@gmx.net,
Nicolas Kral <nicolas.kral@dalsemi.com>

Discussion

  • Johan Knol

    Johan Knol - 2003-03-22

    Logged In: YES
    user_id=63512

    fixed in SDCCicode.c:1.149

    I know I should be off duty, but couldn't resist this one :).

     
  • Johan Knol

    Johan Knol - 2003-03-22
    • labels: --> C-Front End
    • milestone: --> fixed
    • assigned_to: nobody --> johanknol
    • status: open --> closed
     

Log in to post a comment.