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

--- Comment #2 from Kewen Lin <linkw at gcc dot gnu.org> ---
Created attachment 53405
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53405&action=edit
untested patch

With the attached patch, for -fpatchable-function-entry=5,2 it gets:

foo:
.LFB0:
        .cfi_startproc
.LCF0:
0:      addis 2,12,.TOC.-.LCF0@ha
        addi 2,2,.TOC.-.LCF0@l
        .section        __patchable_function_entries,"awo",@progbits,foo
        .align 3
        .8byte  .LPFE1
        .section        ".text"
.LPFE1:
        nop
        nop
        .localentry     foo,.-foo
        .section        __patchable_function_entries,"awo",@progbits,foo
        .align 3
        .8byte  .LPFE2
        .section        ".text"
.LPFE2:
        nop
        nop
        nop
        std 31,-8(1)

for -fpatchable-function-entry=5,1, it emits error msg:

test.c:4:1: error: ā€˜-fpatchable-function-entry=M,Nā€™ N NOPs can cause assembler
error due to invalid .localentry expression.

Reply via email to