This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug inline-asm/32811] Cannot flag inline assembler code "noreturn"


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]