gcc -v: Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper Target: i686-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu Thread model: posix gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) uname -a: Linux silvioricardoc-laptop 3.5.0-27-generic #46-Ubuntu SMP Mon Mar 25 20:00:05 UTC 2013 i686 i686 i686 GNU/Linux Command-line: gcc -Wall -Wextra code.c Description: GCC eliminates all code following a call to a non-returning function, even if this code includes an asm label that can be jumped to. In the latter case, it will generate the "jump-to-label" assembly output, but the code will fail to link due to the missing label. The problem may be the fact that GCC does not know when an asm label can be jumped into, but in this case, the correct solution should be to act conservatively and keep that part of the code intact.
Created attachment 29885 [details] Sample bug-causing code.
The testcase is of course invalid, you can't jump out of inline asm without telling the compiler about it. You can use asm goto to tell the compiler about it, then it wouldn't optimize it away (of course, the label is then a C label, not one hidden in assembly).