https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115307

            Bug ID: 115307
           Summary: [avr] Don't expand isinf() like a built-in
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

avr-gcc compiles

int isinff (float);

int call_isinff (float f)
{
    return isinff (f);
}

like:
call_isinff:
        push r12                 ;  63  [c=4 l=1]  pushqi1/0
        push r13                 ;  64  [c=4 l=1]  pushqi1/0
        push r14                 ;  65  [c=4 l=1]  pushqi1/0
        push r15                 ;  66  [c=4 l=1]  pushqi1/0
        push r28                 ;  67  [c=4 l=1]  pushqi1/0
/* prologue: function */
/* frame size = 0 */
/* stack size = 5 */
.L__stack_usage = 5
        movw r12,r22     ;  56  [c=4 l=2]  *movsf/0
        movw r14,r24
        clt      ;  57  [c=4 l=2]  *abssf2/1
        bld r15,7
        ldi r28,lo8(1)   ;  58  [c=4 l=1]  movqi_insn/1
        ldi r18,lo8(-1)  ;  59  [c=4 l=4]  *movsf/4
        ldi r19,lo8(-1)
        ldi r20,lo8(127)
        ldi r21,lo8(127)
        movw r24,r14     ;  60  [c=4 l=2]  *movsf/0
        movw r22,r12
        call __unordsf2  ;  10  [c=12 l=2]  call_value_insn/1
        cpse r24,__zero_reg__    ;  61  [c=0 l=1]  enable_interrupt-3
        rjmp .L2
        ldi r18,lo8(-1)  ;  52  [c=4 l=4]  *movsf/4
        ldi r19,lo8(-1)
        ldi r20,lo8(127)
        ldi r21,lo8(127)
        movw r24,r14     ;  53  [c=4 l=2]  *movsf/0
        movw r22,r12
        call __lesf2     ;  15  [c=12 l=2]  call_value_insn/1
        cp __zero_reg__,r24      ;  77  [c=16 l=1]  *swapped_tstqi
        brge .L2                 ;  78  [c=4 l=1]  branch
        ldi r28,0                ;  51  [c=4 l=1]  movqi_insn/0
.L2:
        ldi r24,lo8(1)   ;  45  [c=4 l=1]  movqi_insn/1
        eor r24,r28      ;  46  [c=4 l=1]  *xorqi3
        ldi r25,0                ;  50  [c=4 l=1]  movqi_insn/0
/* epilogue start */
        pop r28          ;  70  [c=4 l=1]  popqi
        pop r15          ;  71  [c=4 l=1]  popqi
        pop r14          ;  72  [c=4 l=1]  popqi
        pop r13          ;  73  [c=4 l=1]  popqi
        pop r12          ;  74  [c=4 l=1]  popqi
        ret              ;  75  [c=0 l=1]  return_from_epilogue

where a simple call to isinff would be mush better.

Reply via email to