public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Sebastian Huber <sebastian.huber@embedded-brains.de>,
	GCC Development <gcc@gcc.gnu.org>
Subject: Re: gcc_assert() and inhibit_libc
Date: Thu, 12 Aug 2021 10:31:44 -0400	[thread overview]
Message-ID: <CADzB+2mw7XnC=A=y54yBFQwW-AOejyfvi4bekOyPNjvNeh1k1Q@mail.gmail.com> (raw)
In-Reply-To: <CAFiYyc3vwO_Wxo6TfussCVgQc81xA0nprwUUc92-WTdjODQusQ@mail.gmail.com>

On Thu, Jul 22, 2021 at 8:18 AM Richard Biener via Gcc <gcc@gcc.gnu.org> wrote:
>
> On Wed, Jul 21, 2021 at 2:45 PM Sebastian Huber
> <sebastian.huber@embedded-brains.de> wrote:
> >
> > Hello,
> >
> > while testing this patch
> >
> > https://www.google.com/search?client=firefox-b-e&q=gcc+enable_runtime_checking
> >
> > I noticed that __gcov_info_to_gcda() uses abort(). This is due to (from
> > tsystem.h):
> >
> > #ifdef ENABLE_RUNTIME_CHECKING
> > #define gcc_assert(EXPR) ((void)(!(EXPR) ? abort (), 0 : 0))
> > #else
> > /* Include EXPR, so that unused variable warnings do not occur.  */
> > #define gcc_assert(EXPR) ((void)(0 && (EXPR)))
> > #endif
> >
> > In tsystem.h there is this if inhibit_libc is defined:
> >
> > #ifndef abort
> > extern void abort (void) __attribute__ ((__noreturn__));
> > #endif
> >
> > Who is supposed to define abort here optionally? Can this be defined for
> > example by a target configuration header like gcc/config/rtems.h?
>
> I suppose for inhibit_libc we could use __builtin_trap () (but that might
> expand to abort() on some targets)

That seems straightforward.  Does it address the RTEMS concern?

Or, should we suppress ENABLE_RUNTIME_CHECKING when inhibit_libc?

Jason


  parent reply	other threads:[~2021-08-12 14:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 12:44 Sebastian Huber
2021-07-22 12:15 ` Richard Biener
2021-08-06 17:26   ` Sebastian Huber
2021-08-12 14:31   ` Jason Merrill [this message]
2021-08-12 14:08 ` Martin Liška
2021-08-12 14:12   ` Sebastian Huber
2021-08-12 14:29     ` Martin Liška
2021-08-12 14:31       ` Sebastian Huber
2021-08-16 12:33         ` Martin Liška
2021-08-16 13:50           ` Sebastian Huber
2021-08-16 16:50             ` Jason Merrill
2021-08-16 17:06               ` Jakub Jelinek
2021-08-16 18:57                 ` Jeff Law
2021-08-17  8:41               ` Sebastian Huber
2021-08-16 17:05             ` Joseph Myers

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='CADzB+2mw7XnC=A=y54yBFQwW-AOejyfvi4bekOyPNjvNeh1k1Q@mail.gmail.com' \
    --to=jason@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    --cc=sebastian.huber@embedded-brains.de \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).