This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/27365] New: add a way to mark that a path cannot be taken, something like __builtin_unreachable()
- From: "dann at godzilla dot ics dot uci dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Apr 2006 19:23:58 -0000
- Subject: [Bug tree-optimization/27365] New: add a way to mark that a path cannot be taken, something like __builtin_unreachable()
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
It would be nice to have some form of a builtin that shows that a portion of
the code is not reachable, and it generates no code in the binary.
gcc_unreachable() is used now in the gcc sources for this, but it will generate
assembly code that calls abort().
Another way to accomplish the same thing could be with attributes
Can attributes be used for function calls? I beleive right now they can't.
If they could, then something like this could work:
myfunc(foo,bar,baz) __attribute__((noreturn));
Some functions are known not to return only in certain situations, so they
cannot be declared as being "noreturn". An example where this would be useful
is the Fsignal function in emacs.
--
Summary: add a way to mark that a path cannot be taken, something
like __builtin_unreachable()
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dann at godzilla dot ics dot uci dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27365