For funcion:

  long mult (long x, long y)
  {
    return x * y;
  }

the avr-gcc 4.3.0 produces 29 words of code (-Os option):

  mult:
        push r14
        push r15
        push r16
        push r17
  /* prologue: function */
  /* frame size = 0 */
        mov r14,r18
        mov r15,r19
        mov r16,r20
        mov r17,r21
        mov r18,r22
        mov r19,r23
        mov r20,r24
        mov r21,r25
        mov r25,r17
        mov r24,r16
        mov r23,r15
        mov r22,r14
        rcall __mulsi3
        mov r18,r22
        mov r19,r23
        mov r20,r24
        mov r21,r25
        mov r23,r19
        mov r24,r20
        mov r25,r21
  /* epilogue start */
        pop r17
        pop r16
        pop r15
        pop r14
        ret

The result of avr-gcc 4.1.2 is 2 words:

  mult:
  /* prologue: frame size=0 */
  /* prologue end (size=0) */
        rcall __mulsi3
  /* epilogue: frame size=0 */
        ret


-- 
           Summary: [avr] 4.3.0: size of small funcion increases from 2 to
                    29 words
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dmixm at marine dot febras dot ru


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

Reply via email to