public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Sebastian Huber <sebastian.huber@embedded-brains.de>
Cc: GCC Development <gcc@gcc.gnu.org>
Subject: Re: gcc_assert() and inhibit_libc
Date: Thu, 22 Jul 2021 14:15:28 +0200	[thread overview]
Message-ID: <CAFiYyc3vwO_Wxo6TfussCVgQc81xA0nprwUUc92-WTdjODQusQ@mail.gmail.com> (raw)
In-Reply-To: <7a2725f1-5f72-f0e6-15a4-84ba31e4d527@embedded-brains.de>

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)

>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.huber@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/

  reply	other threads:[~2021-07-22 12:15 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 [this message]
2021-08-06 17:26   ` Sebastian Huber
2021-08-12 14:31   ` Jason Merrill
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=CAFiYyc3vwO_Wxo6TfussCVgQc81xA0nprwUUc92-WTdjODQusQ@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --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).