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 tree-optimization/27365] New: add a way to mark that a path cannot be taken, something like __builtin_unreachable()


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


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