From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 5C9CC385BF9E for ; Mon, 9 Aug 2021 10:22:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5C9CC385BF9E Received: by mail-ej1-x62c.google.com with SMTP id qk33so27963716ejc.12 for ; Mon, 09 Aug 2021 03:22:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=/SEuRJ5fqmKNK2T072vdmbFzx9KaopqW1rzZE0gggqI=; b=j9zqQRGOog+m+ikUDcSu/b0SERTkiQwjNbWTYyx76JQVTXPGeS0hR5S17a0n/z3b/x nmmt6rcH1nTfmrzuoPdy257RKNWZNg04u9JcQyrlUyQQloeGuFH6PRbcQHrhFGyN6uEV 5laHgzbvZo6EpuDgo0WHOX2T9Wb4Mj51mpC2eV6XIa2aAL+6da4/PCsCvaRu68VbB6JB XwNnXTmccudTBY1pvVjuDzFFqg/y6Iygydp5IXyNoxETCePpb24enkhgJAAGjSOUa7l1 qvEobib1cWdsH9kGtFzNJT1BIRMk+rkh0HvDJRgoNsJjfYIp8arBxR07g8t3Y0kMn3rt Kl5A== X-Gm-Message-State: AOAM533reu95dDT7+pC0jEIwblM1sbkUbP0q5E/ImtBlKlIbfYaBN4Ty wVR5MY1SS5GscZBbTdt3FG7Ynea9PGHqNpU806Y= X-Google-Smtp-Source: ABdhPJyh+N4vwusDArqF9OYumEyocZljFyPpAAizetlWoQIosLHiNVsOfBKbWuHVEQlIR6zjdD9CsukA2HapGlFaOp4= X-Received: by 2002:a17:906:1901:: with SMTP id a1mr21753952eje.129.1628504552422; Mon, 09 Aug 2021 03:22:32 -0700 (PDT) MIME-Version: 1.0 References: <3bee8eef-1331-5bb8-0f65-6997ea134e5f@embedded-brains.de> In-Reply-To: <3bee8eef-1331-5bb8-0f65-6997ea134e5f@embedded-brains.de> From: Richard Biener Date: Mon, 9 Aug 2021 12:22:21 +0200 Message-ID: Subject: Re: get_gcov_type() vs. -fprofile-update=atomic To: Sebastian Huber Cc: GCC Development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Aug 2021 10:22:34 -0000 On Mon, Aug 9, 2021 at 8:52 AM 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 > =3D 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? It's a generic counter used for number of CFG edge traversal tracking. Can you not implement 64bit atomic support for 32bit SPARC somehow? > > Another option would be to add something like an > -fprofile-update=3Dforce-atomic option which would resort to libatomic. > Which would deliver bad performance, however, correct results in a > multi-threaded program I guess. > > -- > 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=C3=BCnchen > Registernummer: HRB 157899 > Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler > Unsere Datenschutzerkl=C3=A4rung finden Sie hier: > https://embedded-brains.de/datenschutzerklaerung/