------- Comment #35 from dominiq at lps dot ens dot fr  2008-01-20 15:16 -------
Note that the test gcc.dg/struct/wo_prof_mult_field_peeling.c pass for 32 and
64 bit modes on i686-apple-darwin9, so I am not sure that what follows will
help.

For the code in comment #34 the assembly code is:

[ibook-dhum] bug/tmp_dir% /opt/gcc/gcc4.3w/bin/gcc -S -O3 -fdump-ipa-all
-fwhole-program -combine -fipa-type-escape wo_prof_mult_field_peeling_db.c
[ibook-dhum] bug/tmp_dir% cat wo_prof_mult_field_peeling_db.s
        .text
        .align 4,0x90
.globl _main
_main:
        pushl   %ebp
        movl    %esp, %ebp
        pushl   %esi
        subl    $20, %esp
        movl    $400, (%esp)
        call    L_malloc$stub
        movl    $400, (%esp)
        movl    %eax, %esi
        call    L_malloc$stub
        movl    $400, (%esp)
        call    L_malloc$stub
        movl    $400, (%esp)
        call    L_malloc$stub
        xorl    %eax, %eax
        .align 4,0x90
L2:
        movl    $5, (%esi,%eax,4)
        addl    $1, %eax
        cmpl    $100, %eax
        jne     L2
        xorb    %al, %al
        jmp     L4
        .align 4,0x90
L3:
        addl    $1, %eax
        cmpl    $100, %eax
        je      L9
L4:
        cmpl    $5, (%esi,%eax,4)
        je      L3
        call    L_abort$stub
L9:
        addl    $20, %esp
        xorb    %al, %al
        popl    %esi
        popl    %ebp
        ret
        .picsymbol_stub
L_malloc$stub:
        .indirect_symbol _malloc
        call    LPC$1
LPC$1:  popl    %eax
        movl    L1$lz-LPC$1(%eax),%edx
        jmp     *%edx
L_malloc$stub_binder:
        lea     L1$lz-LPC$1(%eax),%eax
        pushl   %eax
        jmp     dyld_stub_binding_helper
        .lazy_symbol_pointer
L1$lz:
        .indirect_symbol _malloc
        .long L_malloc$stub_binder
        .picsymbol_stub
L_abort$stub:
        .indirect_symbol _abort
        call    LPC$2
LPC$2:  popl    %eax
        movl    L2$lz-LPC$2(%eax),%edx
        jmp     *%edx
L_abort$stub_binder:
        lea     L2$lz-LPC$2(%eax),%eax
        pushl   %eax
        jmp     dyld_stub_binding_helper
        .lazy_symbol_pointer
L2$lz:
        .indirect_symbol _abort
        .long L_abort$stub_binder
        .subsections_via_symbols

[ibook-dhum] bug/tmp_dir% /opt/gcc/gcc4.3w/bin/gcc -S -O3 -fdump-ipa-all
-fwhole-program -combine -fipa-type-escape -fipa-struct-reorg
/opt/gcc/_gcc_clean/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c
[ibook-dhum] bug/tmp_dir% cat wo_prof_mult_field_peeling.s                     
                                                                    .text
        .align 4,0x90
.globl _main
_main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $24, %esp
        movl    $1600, (%esp)
        call    L_malloc$stub
        movl    $400, (%esp)
        call    L_malloc$stub
        movl    $400, (%esp)
        call    L_malloc$stub
        movl    $400, (%esp)
        call    L_malloc$stub
        movl    $400, (%esp)
        call    L_malloc$stub
        xorl    %edx, %edx
        .align 4,0x90
L2:
        movl    $5, (%eax,%edx,4)
        addl    $1, %edx
        cmpl    $100, %edx
        jne     L2
        xorb    %dl, %dl
        jmp     L4
        .align 4,0x90
L3:
        addl    $1, %edx
        cmpl    $100, %edx
        je      L9
L4:
        cmpl    $5, (%eax,%edx,4)
        je      L3
        call    L_abort$stub
L9:
        xorl    %eax, %eax
        leave
        ret
        .picsymbol_stub
L_malloc$stub:
        .indirect_symbol _malloc
        call    LPC$1
LPC$1:  popl    %eax
        movl    L1$lz-LPC$1(%eax),%edx
        jmp     *%edx
L_malloc$stub_binder:
        lea     L1$lz-LPC$1(%eax),%eax
        pushl   %eax
        jmp     dyld_stub_binding_helper
        .lazy_symbol_pointer
L1$lz:
        .indirect_symbol _malloc
        .long L_malloc$stub_binder
        .picsymbol_stub
L_abort$stub:
        .indirect_symbol _abort
        call    LPC$2
LPC$2:  popl    %eax
        movl    L2$lz-LPC$2(%eax),%edx
        jmp     *%edx
L_abort$stub_binder:
        lea     L2$lz-LPC$2(%eax),%eax
        pushl   %eax
        jmp     dyld_stub_binding_helper
        .lazy_symbol_pointer
L2$lz:
        .indirect_symbol _abort
        .long L_abort$stub_binder
        .subsections_via_symbols

[ibook-dhum] bug/tmp_dir% diff wo_prof_mult_field_peeling.s
wo_prof_mult_field_peeling_db.s                                                
7,9c7,8
<       subl    $24, %esp
<       movl    $1600, (%esp)
<       call    L_malloc$stub
---
>       pushl   %esi
>       subl    $20, %esp
12a12
>       movl    %eax, %esi
18c18
<       xorl    %edx, %edx
---
>       xorl    %eax, %eax
21,23c21,23
<       movl    $5, (%eax,%edx,4)
<       addl    $1, %edx
<       cmpl    $100, %edx
---
>       movl    $5, (%esi,%eax,4)
>       addl    $1, %eax
>       cmpl    $100, %eax
25c25
<       xorb    %dl, %dl
---
>       xorb    %al, %al
29,30c29,30
<       addl    $1, %edx
<       cmpl    $100, %edx
---
>       addl    $1, %eax
>       cmpl    $100, %eax
33c33
<       cmpl    $5, (%eax,%edx,4)
---
>       cmpl    $5, (%esi,%eax,4)
37,38c37,40
<       xorl    %eax, %eax
<       leave
---
>       addl    $20, %esp
>       xorb    %al, %al
>       popl    %esi
>       popl    %ebp


-- 


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

Reply via email to