From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: GCC Development <gcc@gcc.gnu.org>
Subject: Re: get_gcov_type() vs. -fprofile-update=atomic
Date: Mon, 9 Aug 2021 10:02:17 +0200 [thread overview]
Message-ID: <c8d14072-3039-989e-c282-cd5edeeea63e@embedded-brains.de> (raw)
In-Reply-To: <3bee8eef-1331-5bb8-0f65-6997ea134e5f@embedded-brains.de>
On 09/08/2021 08:51, Sebastian Huber wrote:
> Hello,
>
> I would like to use gcov for a multi-threaded program running on an SMP
> machine using a 32-bit SPARC/LEON3 target. This target supports
> HAVE_atomic_compare_and_swapsi but not HAVE_atomic_compare_and_swapdi.
> Unfortunately we have:
>
> /* Return the type node for gcov_type. */
>
> tree
> get_gcov_type (void)
> {
> scalar_int_mode mode
> = smallest_int_mode_for_size (LONG_LONG_TYPE_SIZE > 32 ? 64 : 32);
> return lang_hooks.types.type_for_mode (mode, false);
> }
>
> The long long type is 64-bit, the get_gcov_type() returns a 64-bit type.
> This disables the atomic support in tree_profiling().
>
> For what is the gcov type used? Could we add an option to force it to
> 32-bit? What would be the consequences?
>
> Another option would be to add something like an
> -fprofile-update=force-atomic option which would resort to libatomic.
> Which would deliver bad performance, however, correct results in a
> multi-threaded program I guess.
Here is a proposed patch:
https://gcc.gnu.org/pipermail/gcc-patches/2021-August/576947.html
--
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/
next prev parent reply other threads:[~2021-08-09 8:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-09 6:51 Sebastian Huber
2021-08-09 8:02 ` Sebastian Huber [this message]
2021-08-09 10:22 ` Richard Biener
2021-08-09 10:55 ` Sebastian Huber
2021-08-09 11:27 ` Richard Biener
2021-08-09 12:03 ` Sebastian Huber
2021-08-09 12:13 ` Richard Biener
2021-08-09 13:36 ` Sebastian Huber
2021-08-10 6:07 ` Sebastian Huber
2021-08-10 7:59 ` Richard Biener
2021-08-10 8:10 ` Sebastian Huber
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=c8d14072-3039-989e-c282-cd5edeeea63e@embedded-brains.de \
--to=sebastian.huber@embedded-brains.de \
--cc=gcc@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).