------- Comment #4 from siarhei dot siamashka at gmail dot com  2010-07-28 
07:16 -------
Could not reproduce the problem with gcc 4.3.5

Disassembly of pr45070.o:

0000000c <next>:
   c:   e92d401f        push    {r0, r1, r2, r3, r4, lr}
  10:   e890000c        ldm     r0, {r2, r3}
  14:   e1a04000        mov     r4, r0
  18:   e1520003        cmp     r2, r3
  1c:   b3a03000        movlt   r3, #0
  20:   ba000014        blt     78 <next+0x6c>
  24:   e5903008        ldr     r3, [r0, #8]
  28:   e3530000        cmp     r3, #0
  2c:   0a00000e        beq     6c <next+0x60>
  30:   e3a03000        mov     r3, #0
  34:   e5803008        str     r3, [r0, #8]
  38:   e2800004        add     r0, r0, #4
  3c:   ebffffef        bl      0 <fetch>
  40:   e1a00004        mov     r0, r4
  44:   ebfffff0        bl      c <next>
  48:   e1a00800        lsl     r0, r0, #16
  4c:   e1a00840        asr     r0, r0, #16
  50:   e5cd0000        strb    r0, [sp]
  54:   e1a00420        lsr     r0, r0, #8
  58:   e5cd0001        strb    r0, [sp, #1]
  5c:   e1dd30b0        ldrh    r3, [sp]
  60:   e1cd30bc        strh    r3, [sp, #12]
  64:   e1dd30bc        ldrh    r3, [sp, #12]
  68:   ea000002        b       78 <next+0x6c>
  6c:   e3a03001        mov     r3, #1
  70:   e5803008        str     r3, [r0, #8]
  74:   e59f3010        ldr     r3, [pc, #16]   ; 8c <next+0x80>
  78:   e1cd30bc        strh    r3, [sp, #12]
  7c:   e5dd300c        ldrb    r3, [sp, #12]
  80:   e5dd000d        ldrb    r0, [sp, #13]
  84:   e1830400        orr     r0, r3, r0, lsl #8
  88:   e8bd801f        pop     {r0, r1, r2, r3, r4, pc}

^^^ POP instruction just overwrites return value in r0 register here

  8c:   0000ffff        .word   0x0000ffff

Looks like the function gets treated as if it were returning 'void'.


-- 

siarhei dot siamashka at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
      Known to fail|                            |4.5.0
      Known to work|                            |4.3.5


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45070

Reply via email to