[libcxx] [flang] [compiler-rt] [libc] [clang-tools-extra] [llvm] [clang] [libcxxabi] [lld] [lldb] [mlir] [Mips] Fix unable to handle inline assembly ends with compat-branch o… (PR #77291)

via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 4 00:01:04 PST 2024


yingopq wrote:

> What assembly does GCC emit, and how does GNU as deal with that assembly? That is, how do those two tools interact in the GNU world when dealing with forbidden slots?

All results were same: add nop after beqzc.
```
$ cat a.s
	.set reorder
bbb:
	beqzc $t1, bbb
	b bbb
$ sudo mipsel-linux-gnu-as -mips32r6 a.s
$ mipsel-linux-gnu-objdump -d a.out

a.out:     file format elf32-tradlittlemips


Disassembly of section .text:

00000000 <bbb>:
   0:	d93fffff 	beqzc	t1,0 <bbb>
   4:	00000000 	nop
   8:	1000ffff 	b	8 <bbb+0x8>
   c:	00000000 	nop
```

and
```
$ sudo mipsel-linux-gnu-gcc -mips32r6 -c a.s -o hello.o
$ mipsel-linux-gnu-objdump -d hello.o 

hello.o:     file format elf32-tradlittlemips


Disassembly of section .text:

00000000 <bbb>:
   0:	d93fffff 	beqzc	t1,0 <bbb>
   4:	00000000 	nop
   8:	1000ffff 	b	8 <bbb+0x8>
   c:	00000000 	nop
```

https://github.com/llvm/llvm-project/pull/77291


More information about the llvm-commits mailing list