From: Josh Triplett <josh@joshtriplett.org>
To: Chris Li <christ.li@gmail.com>
Cc: Jiri Slaby <jslaby@suse.cz>,
jirislaby@gmail.com, Larry Finger <Larry.Finger@lwfinger.net>,
linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org
Subject: Re: [PATCH 2/2] parser: define __builtin_unreachable
Date: Tue, 13 Jul 2010 11:12:13 -0700 [thread overview]
Message-ID: <20100713181212.GB20289@feather> (raw)
In-Reply-To: <AANLkTimf821jhfhU-Rsj7xa2S4EzuP23weoUSZVWsD2u@mail.gmail.com>
On Tue, Jul 13, 2010 at 12:52:48AM -0700, Chris Li wrote:
> On Sat, Jul 10, 2010 at 2:07 AM, Josh Triplett <josh@joshtriplett.org> wrote:
> > __builtin_unreachable has special semantics beyond just a function.
> > This definition will suffice to allow compilation, but
> > __builtin_unreachable should have the same effect in sparse that it does
> > in GCC: mark the point (and the remainder of the basic block) as
> > unreachable. Something like the mechanism used for handling noreturn
> > would work here as well; declaring the function to have attribute
> > noreturn would probably have almost the right semantics.
> >
>
> The attribute noreturn will apply to the whole function. The function
> NEVER returns.
> __builtin_unreachable only apply to current basic block. e.g. some
> error handling path like panic. The function can still return a value on the
> normal path. It has different meaning than attribute noreturn. So I don't think
> automatically give the function noreturn attribute is the right thing to do.
No, I didn't mean that using __builtin_unreachable should mark the
function calling it as noreturn. I meant that as an approximation to
the right behavior, __builtin_unreachable *itself* could have attribute
noreturn.
- Josh Triplett
next prev parent reply other threads:[~2010-07-13 18:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4C3680D1.5070601@lwfinger.net>
2010-07-09 20:47 ` Warning message when using sparse Jiri Slaby
2010-07-09 21:22 ` Larry Finger
2010-07-09 21:26 ` Jiri Slaby
2010-07-09 22:04 ` Christopher Li
2010-07-10 8:39 ` [PATCH 1/2] parser: fix and simplify support of asm goto Jiri Slaby
2010-07-10 18:36 ` Chris Li
2010-07-10 8:39 ` [PATCH 2/2] parser: define __builtin_unreachable Jiri Slaby
2010-07-10 9:07 ` Josh Triplett
2010-07-13 7:52 ` Chris Li
2010-07-13 18:12 ` Josh Triplett [this message]
2010-07-13 18:49 ` Chris Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100713181212.GB20289@feather \
--to=josh@joshtriplett.org \
--cc=Larry.Finger@lwfinger.net \
--cc=christ.li@gmail.com \
--cc=jirislaby@gmail.com \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).