Take the following program:
int g (float* g1)
{
  *g1 = 0;
}

Running it on ppc-darwin on the mainline (with -static), we get:
LC0:
        .long   0
        .text
        .align 2
        .globl _g
_g:
        lis r2,ha16(LC0)
        lfs f0,lo16(LC0)(r2)
        stfs f0,0(r3)
        blr

On 4.0.0, we get:
_g:
        li r0,0
        stw r0,0(r3)
        blr

x86 have the same problem but only with -fPIC but that is not a regression:
.LC0:
        .long   0
        .text
        .p2align 4,,15
.globl g
        .type   g, @function
g:
        call    __i686.get_pc_thunk.cx
        addl    $_GLOBAL_OFFSET_TABLE_, %ecx
        movl    4(%esp), %eax
        movl    [EMAIL PROTECTED](%ecx), %edx
        movl    %edx, (%eax)
        ret

-- 
           Summary: [4.1 Regression] store of 0.0 to float
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: minor
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc-darwin


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

Reply via email to