This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/32811] Cannot flag inline assembler code "noreturn"
- From: "gcc at kalvdans dot no-ip.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 19 Jul 2011 13:00:06 +0000
- Subject: [Bug inline-asm/32811] Cannot flag inline assembler code "noreturn"
- Auto-submitted: auto-generated
- References: <bug-32811-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32811
Christian HÃggstrÃm <gcc at kalvdans dot no-ip.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gcc at kalvdans dot
| |no-ip.org
--- Comment #3 from Christian HÃggstrÃm <gcc at kalvdans dot no-ip.org> 2011-07-19 12:59:43 UTC ---
It works by adding __builtin_unreachable() as suggested by the documentation
for asm goto.
$ cat pr32811.c
__attribute__ ((noreturn)) void noreturn_via_asm_goto() {
loop:
asm goto ("jmp %l[loop]\n" : : : : loop);
__builtin_unreachable();
}
$ gcc -O2 -Wall pr32811.c -c && objdump -d pr32811.o
pr32811.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <noreturn_via_asm_goto>:
0: eb fe jmp 0 <noreturn_via_asm_goto>
So I think this bug can be closed.