public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/39252]  New: Request new feature __builtin_not_reached();
@ 2009-02-19 20:42 hpa at zytor dot com
  2009-02-19 20:46 ` [Bug c/39252] " hjl dot tools at gmail dot com
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: hpa at zytor dot com @ 2009-02-19 20:42 UTC (permalink / raw)
  To: gcc-bugs

In the Linux kernel, we use assembly constructs (asm volatile) which trap or
otherwise terminate execution.  gcc doesn't know about this, so it doesn't
terminate its flow analysis.  These assembly constructs are more complex than a
simple __builtin_trap(); will permit -- we have tried using assembly constructs
in conjunction with __builtin_trap(); but that relies too much on undefined
behaviour.

A much better solution would be to give us __builtin_not_reached(); which is
simply an annotation truncating the flow of control at that point.  You can
think of it from an implementation perspective as __builtin_trap(); that
doesn't actually generate any code.  This allows any arbitrary assembly that
truncates the flow of control to be annotated as such, without the overhead of
a compiler-generated catch loop which is never actually reached.


-- 
           Summary: Request new feature __builtin_not_reached();
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hpa at zytor dot com
 GCC build triplet: All
  GCC host triplet: All
GCC target triplet: All


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39252


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-06-12  0:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-19 20:42 [Bug c/39252] New: Request new feature __builtin_not_reached(); hpa at zytor dot com
2009-02-19 20:46 ` [Bug c/39252] " hjl dot tools at gmail dot com
2009-02-19 20:51 ` hjl dot tools at gmail dot com
2009-02-19 21:50 ` pinskia at gcc dot gnu dot org
2009-02-19 21:58 ` hpa at zytor dot com
2009-02-19 22:13 ` hpa at zytor dot com
2009-02-19 22:14 ` pinskia at gcc dot gnu dot org
2009-02-19 22:21 ` hpa at zytor dot com
2009-02-19 23:02 ` jakub at gcc dot gnu dot org
2009-02-20  4:34 ` hpa at zytor dot com
2009-02-20  9:57 ` rguenth at gcc dot gnu dot org
2009-03-01 22:34 ` hpa at zytor dot com
2009-03-01 22:42 ` rguenth at gcc dot gnu dot org
2009-06-09 20:12 ` daney at gcc dot gnu dot org
2009-06-09 20:16 ` daney at gcc dot gnu dot org
2009-06-11 23:56 ` [Bug c/39252] Request new feature __builtin_unreachable () daney at gcc dot gnu dot org
2009-06-12  0:29 ` daney at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).