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

            Bug ID: 93242
           Summary: [MIPS] patchable-function-entry broken
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: renat at idrisov dot info
  Target Milestone: ---

Created attachment 47640
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47640&action=edit
preprocessed file

Hi All,
when I try to use -fpatchable-function-entry on MIPS, it produces broken
assembly file:

c++ -mips64r6 -mabi=64 -o empty.o -c empty.c -fpatchable-function-entry=1 -v
-save-temps
...
empty.s: Assembler messages:
empty.s:14: Error: junk at end of line, first unrecognized character is `%'

I have attached preprocessed file, but it contains nothing special, source
program is:
```
int main() {
return 0;
}
```

If I look at assembly file, it indeed has a bogus:

```
        .module fp=64
        .module oddspreg
        .text
        .align  2
        .globl  main
        .section        __patchable_function_entries,"a",@progbits
        .8byte  $LPFE1
        .text
$LPFE1:
        %(nop%) <---- no such instruction
$LFB0 = .
        .cfi_startproc
        .set    nomips16
        .set    nomicromips
        .ent    main
        .type   main, @function
main:
        .frame  $fp,16,$31              # vars= 0, regs= 1/0, args= 0, gp= 0
        .mask   0x40000000,-8
        .fmask  0x00000000,0
...
```

I can provide a patch to fix it, but first I want to confirm it is a bug.

Thank you!

Reply via email to