This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/39252] Request new feature __builtin_not_reached();
- From: "hpa at zytor dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Feb 2009 21:58:27 -0000
- Subject: [Bug c/39252] Request new feature __builtin_not_reached();
- References: <bug-39252-3556@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from hpa at zytor dot com 2009-02-19 21:58 -------
Two reasons:
1. We have no control over what instruction __builtin_trap() will generate.
2. We require the address of the faulting instruction.
In particular, we currently have a construct which looks like:
#ifdef CONFIG_X86_32
# define __BUG_C0 "2:\t.long 1b, %c0\n"
#else
# define __BUG_C0 "2:\t.long 1b - 2b, %c0 - 2b\n"
#endif
#define BUG() \
do { \
asm volatile("1:\tud2\n" \
".pushsection __bug_table,\"a\"\n" \
__BUG_C0 \
"\t.word %c1, 0\n" \
"\t.org 2b+%c2\n" \
".popsection" \
: : "i" (__FILE__), "i" (__LINE__), \
"i" (sizeof(struct bug_entry))); \
for (;;) ; \
} while (0)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39252