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] New: Request new feature __builtin_not_reached();


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


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