Revision r222473 causes following warning on alpha-linux-gnu when compiling pr34999.c: /tmp/ccPdj6Kv.s: Assembler messages: /tmp/ccPdj6Kv.s:107: Warning: nested .ent directives /tmp/ccPdj6Kv.s:121: Warning: .end directive names different symbol than .ent /tmp/ccPdj6Kv.s:124: Warning: .end directive without matching .ent The failure can be seen with a crosscompiler to from x86_64-linux-gnu to alpha-linux-gnu with following command: gcc-build-alpha/gcc/cc1 -O2 -freorder-blocks-and-partition -fprofile-use -o pr34999.s -fpreprocessed pr34999.i The resulting assembly shows nested .ent/.end directives where main.cold.0 was inserted: --cut here-- .set noreorder .set volatile .set noat .section .rodata $LC0: .string "test" .section .text.unlikely,"ax",@progbits .align 2 $LCOLDB1: .section .text.startup,"ax",@progbits $LHOTB1: .align 2 .align 4 .globl main .ent main main: .frame $15,32,$26,0 .mask 0x4008000,-32 $LFB1: ldgp $29,0($27) $main..ng: lda $30,-32($30) $LCFI0: lda $1,$LC0 lda $3,buf bis $31,$31,$31 stq $15,8($30) $LCFI1: mov $30,$15 $LCFI2: stq $26,0($30) $LCFI3: .prologue 1 lda $30,-48($30) stq $30,16($15) lda $6,4($1) ldq_u $4,4($1) ldq_u $5,0($1) ldq_u $2,3($1) bis $31,$31,$31 extbl $4,$6,$8 ldl $19,4($30) extll $5,$1,$0 lda $24,$L2 extlh $2,$1,$7 insbl $8,0,$21 bic $19,255,$20 cpys $f31,$f31,$f31 bis $0,$7,$16 stl $16,0($30) bis $21,$20,$22 stl $22,4($30) stq $24,8($3) lda $23,16($15) stq $30,16($3) bis $31,$31,$31 stq $23,0($3) lda $3,4096($31) ldl $25,0($30) sll $25,40,$26 sra $26,56,$27 s4addq $27,30,$28 bic $28,15,$1 cmpult $1,$3,$5 subq $30,$1,$2 bne $5,$L7 lda $6,-4096($30) bis $31,$31,$31 $L6: stq $31,0($6) lda $6,-8192($6) cmpule $6,$2,$4 beq $4,$L6 stq $31,0($2) $L7: mov $2,$30 mov $30,$16 ble $27,$L9 subl $27,1,$0 zapnot $0,15,$7 mov $31,$17 s4addq $7,4,$18 jsr $26,memset ldgp $29,0($26) $L9: jsr $26,sub2 $L2: lda $15,-16($15) br $27,$LSJ100 $LSJ100: ldgp $29,0($27) ldq $16,16($15) lda $17,$LC0 jsr $26,strcmp ldgp $29,0($26) bne $0,$L17 mov $31,$16 jsr $26,exit $L17: br $31,$L4 .section .text.unlikely .ent main.cold.0 main.cold.0: .frame $15,32,$26,0 .mask 0x4008000,-32 $L4: $LCFI4: jsr $26,abort $LFE1: .section .text.startup bis $31,$31,$31 .end main .section .text.unlikely bis $31,$31,$31 .end main.cold.0 $LCOLDE1: .section .text.startup $LHOTE1: .section .text.unlikely .align 2 $LCOLDB2: .text $LHOTB2: .align 2 .align 4 .globl sub2 .ent sub2 sub2: .frame $15,16,$26,0 .mask 0x4008000,-16 $LFB0: ldgp $29,0($27) $sub2..ng: lda $30,-16($30) $LCFI5: lda $1,buf stq $15,8($30) $LCFI6: mov $30,$15 $LCFI7: stq $26,0($30) $LCFI8: .prologue 1 ldq $27,8($1) ldq $15,0($1) ldq $30,16($1) jmp $31,($27),0 $LFE0: .end sub2 .section .text.unlikely $LCOLDE2: .text $LHOTE2: [...] --cut here--
Created attachment 35422 [details] Preprocessed source
Created attachment 35423 [details] gcda file
The difference between new (zzz.s) and previous (yyy.s) asm dumps is: --- yyy.s 2015-04-29 13:44:03.870706031 +0200 +++ zzz.s 2015-04-29 13:26:41.812887199 +0200 @@ -99,7 +99,10 @@ $L17: br $31,$L4 .section .text.unlikely + .ent main.cold.0 main.cold.0: + .frame $15,32,$26,0 + .mask 0x4008000,-32 $L4: $LCFI4: jsr $26,abort @@ -108,6 +111,8 @@ bis $31,$31,$31 .end main .section .text.unlikely + bis $31,$31,$31 + .end main.cold.0 $LCOLDE1: .section .text.startup $LHOTE1:
Author: ctice Date: Thu Apr 30 17:49:02 2015 New Revision: 222643 URL: https://gcc.gnu.org/viewcvs?rev=222643&root=gcc&view=rev Log: Define & use special macros to record the name & size of cold partitions. (Fix PR 65929). gcc/ChangeLog PR 65929 * config/elfos.h (ASM_DECLARE_COLD_FUNCTION_NAME): New macro definition. (ASM_DECLARE_COLD_FUNCTION_SIZE): New macro definition. * doc/tm.texi.in (ASM_DECLARE_COLD_FUNCTION_NAME): Document new macro. (ASM_DECLARE_COLD_FUNCTION_SIZE): Document new macro. * final.c (final_scan_insn): Use ASM_DECLARE_COLD_FUNCTION_NAME instead of ASM_DECLARE_FUNCTION_NAME for cold partition name. * varasm.c (assemble_end_function): Use ASM_DECLARE_COLD_FUNCTION_SIZE instead of ASM_DECLARE_FUNCTION_SIZE for cold partition size. gcc/testsuite/ChangeLog: PR 65929 * gcc.dg/tree-prof/cold_partition_label.c: Only check for cold partition size on certain targets. Modified: trunk/gcc/ChangeLog trunk/gcc/config/elfos.h trunk/gcc/doc/tm.texi.in trunk/gcc/final.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c trunk/gcc/varasm.c
Fixed.