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 c/39252] Request new feature __builtin_not_reached();



------- 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


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