------- Comment #38 from dominiq at lps dot ens dot fr 2008-01-20 20:47 ------- With patch form comments #11 and #31, the executable for gcc.dg/struct/wo_prof_mult_field_peeling.c segfault with -m64. I have used the 32 bit mode for -fprofile-generate, run the executable, and use -m64 for -fprofile-use. wo_prof_mult_field_peeling_db.c is the code from comment #34. The assembly follows with the options I have used:
[ibook-dhum] bug/tmp_dir% /opt/gcc/gcc4.3w/bin/gcc -S -m64 -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: LFB6: pushq %rbp LCFI0: movl $400, %edi movq %rsp, %rbp LCFI1: pushq %rbx LCFI2: subq $8, %rsp LCFI3: call _malloc movl $400, %edi movq %rax, %rbx call _malloc movl $400, %edi call _malloc movl $400, %edi call _malloc xorl %eax, %eax .align 4,0x90 L2: movl $5, (%rbx,%rax,4) addq $1, %rax cmpq $100, %rax jne L2 xorb %al, %al jmp L4 .align 4,0x90 L3: addq $1, %rax cmpq $100, %rax je L9 L4: cmpl $5, (%rbx,%rax,4) je L3 call _abort L9: addq $8, %rsp xorb %al, %al popq %rbx leave ret LFE6: .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support EH_frame1: .set L$set$0,LECIE1-LSCIE1 .long L$set$0 LSCIE1: .long 0x0 .byte 0x1 .ascii "zR\0" .byte 0x1 .byte 0x78 .byte 0x10 .byte 0x1 .byte 0x10 .byte 0xc .byte 0x7 .byte 0x8 .byte 0x90 .byte 0x1 .align 3 LECIE1: .globl _main.eh _main.eh: LSFDE1: .set L$set$1,LEFDE1-LASFDE1 .long L$set$1 LASFDE1: .long LASFDE1-EH_frame1 .quad LFB6-. .set L$set$2,LFE6-LFB6 .quad L$set$2 .byte 0x0 .byte 0x4 .set L$set$3,LCFI0-LFB6 .long L$set$3 .byte 0xe .byte 0x10 .byte 0x86 .byte 0x2 .byte 0x4 .set L$set$4,LCFI1-LCFI0 .long L$set$4 .byte 0xd .byte 0x6 .byte 0x4 .set L$set$5,LCFI3-LCFI1 .long L$set$5 .byte 0x83 .byte 0x3 .align 3 LEFDE1: .subsections_via_symbols [ibook-dhum] bug/tmp_dir% /opt/gcc/gcc4.3w/bin/gcc -S -m64 /opt/gcc/_gcc_clean/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c -O3 -fwhole-program -combine -fipa-type-escape -fprofile-use -fipa-struct-reorg -fdump-ipa-all [ibook-dhum] bug/tmp_dir% cat wo_prof_mult_field_peeling.s .section __TEXT,__text,regular,pure_instructions .align 4 .globl _main _main: LFB5: pushq %rbp LCFI0: movl $1600, %edi movq %rsp, %rbp LCFI1: call _malloc movl $400, %edi call _malloc movl $400, %edi call _malloc movl $400, %edi call _malloc movl $400, %edi call _malloc xorl %edx, %edx cltq .align 4 L2: movl $5, (%rax,%rdx,4) movl $5, 4(%rax,%rdx,4) movl $5, 8(%rax,%rdx,4) movl $5, 12(%rax,%rdx,4) movl $5, 16(%rax,%rdx,4) movl $5, 20(%rax,%rdx,4) movl $5, 24(%rax,%rdx,4) movl $5, 28(%rax,%rdx,4) movl $5, 32(%rax,%rdx,4) movl $5, 36(%rax,%rdx,4) addq $10, %rdx cmpq $100, %rdx jne L2 xorb %dl, %dl .align 4 L4: cmpl $5, (%rax,%rdx,4) jne L35 leaq 1(%rdx), %rcx cmpl $5, (%rax,%rcx,4) jne L35 cmpl $5, 8(%rax,%rdx,4) jne L35 cmpl $5, 12(%rax,%rdx,4) jne L35 cmpl $5, 16(%rax,%rdx,4) jne L35 cmpl $5, 20(%rax,%rdx,4) jne L35 cmpl $5, 24(%rax,%rdx,4) jne L35 cmpl $5, 28(%rax,%rdx,4) jne L35 cmpl $5, 32(%rax,%rdx,4) jne L35 cmpl $5, 36(%rax,%rdx,4) jne L35 leaq 9(%rcx), %rdx cmpq $100, %rdx jne L4 xorl %eax, %eax leave ret L35: call _abort LFE5: .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support EH_frame1: .set L$set$0,LECIE1-LSCIE1 .long L$set$0 LSCIE1: .long 0x0 .byte 0x1 .ascii "zR\0" .byte 0x1 .byte 0x78 .byte 0x10 .byte 0x1 .byte 0x10 .byte 0xc .byte 0x7 .byte 0x8 .byte 0x90 .byte 0x1 .align 3 LECIE1: .globl _main.eh _main.eh: LSFDE1: .set L$set$1,LEFDE1-LASFDE1 .long L$set$1 LASFDE1: .long LASFDE1-EH_frame1 .quad LFB5-. .set L$set$2,LFE5-LFB5 .quad L$set$2 .byte 0x0 .byte 0x4 .set L$set$3,LCFI0-LFB5 .long L$set$3 .byte 0xe .byte 0x10 .byte 0x86 .byte 0x2 .byte 0x4 .set L$set$4,LCFI1-LCFI0 .long L$set$4 .byte 0xd .byte 0x6 .align 3 LEFDE1: .subsections_via_symbols -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34483