From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 2C933385842A; Mon, 27 Dec 2021 21:01:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2C933385842A Received: by mail-wr1-x42a.google.com with SMTP id v7so34324100wrv.12; Mon, 27 Dec 2021 13:01:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=1dWm7IZjgqqHMiM4Vnz8PyeRmv4GT+gmpeg1u8L7pHk=; b=jeFGgBTNJQCtUpgM35UWTM+OYEmQD7APoVHy5gA5t2G9NxZlO8efS12f0bj7Qj8Ryh yYr3E7bd3N090N7s/v0V603P9MiNDikp5nJeMgbg9TBW7ED3i+14o3BsoRqR3QtA2kHg abHNQOVMXjd1/7HpvyZQcCpQp2K8TlY6mglGhN8tWDqpDFvqM804pMhe7do4BA8Li2VF qtGx9qwzeQiKFq7iVnwHx629SQZ8e3INSDIjuy/lLQ8agzVl9/0NykzPjUxwysKnbY64 G5kcK+B0lcRtYquLFtkIGPQB9ZxnlETNn14XNuDuE03dgp3wVGQOzdyYFKsvOhAePNs1 RNhQ== X-Gm-Message-State: AOAM531WcdcI3GEIMJSvEmLq+209tLMCWDuykhcpbWa/OPXAQdHRRgrH RoFWdAhfeVEdUD8swJqYTb4= X-Google-Smtp-Source: ABdhPJxXZ+uEsaHK+tFBP7hHm53dF7ElmoHMaDgK9XjRgKTp9XG7kbtv2jdhXnzzDufes8yr++2L4g== X-Received: by 2002:adf:f084:: with SMTP id n4mr14126116wro.415.1640638861241; Mon, 27 Dec 2021 13:01:01 -0800 (PST) Received: from smtpclient.apple ([2a01:e34:ec28:8cb0:b83e:74b2:f7e5:dc29]) by smtp.gmail.com with ESMTPSA id d13sm16109730wru.41.2021.12.27.13.01.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Dec 2021 13:01:00 -0800 (PST) From: FX Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_C7783739-9035-4B8C-AC26-7347C500A4BC" Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) Subject: Re: [PATCH] Make integer output faster in libgfortran Date: Mon, 27 Dec 2021 22:01:00 +0100 In-Reply-To: <1471f348-1829-b253-86f3-47abb9182e25@netcologne.de> Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org, ro@gcc.gnu.org To: Thomas Koenig References: <28ba2e92-065e-109f-b9e2-95b4609d0f66@netcologne.de> <18EA83FD-C127-4A5B-942B-224083947F9F@gmail.com> <43c60a0b-06b5-162b-bd5f-a7177cd76172@netcologne.de> <91272BC5-B108-4DB0-929C-EE437703F10B@gmail.com> <1471f348-1829-b253-86f3-47abb9182e25@netcologne.de> X-Mailer: Apple Mail (2.3693.40.0.1.81) X-Spam-Status: No, score=-1.9 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: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Dec 2021 21:01:06 -0000 --Apple-Mail=_C7783739-9035-4B8C-AC26-7347C500A4BC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Follow-up patch committed, after my use of the one-argument variant of = static_assert() broke bootstrap on Solaris (sorry Rainer!). The one-arg form is new since C23, while Solaris only = supports the two-arg form (C11). I have confirmed that other target libraries use the two-arg form, and = bootstrapped the attached patch on x86_64-pc-linux-gnu. FX --Apple-Mail=_C7783739-9035-4B8C-AC26-7347C500A4BC Content-Disposition: attachment; filename=static_assert.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="static_assert.diff" Content-Transfer-Encoding: 7bit commit 3430132f3e8289f1b789a1a91206c44c47fb032c Author: Francois-Xavier Coudert Date: 2021-12-27 21:32:08 +0100 Fortran: fix use of static_assert() to conform to C11 libgfortran/ChangeLog: PR libfortran/98076 * runtime/string.c (gfc_itoa): Use two args for static_assert(). diff --git a/libgfortran/runtime/string.c b/libgfortran/runtime/string.c index 0ccd731852a..21585f48dc9 100644 --- a/libgfortran/runtime/string.c +++ b/libgfortran/runtime/string.c @@ -242,7 +242,8 @@ gfc_itoa (GFC_UINTEGER_LARGEST n, char *buffer, size_t len) integers (we would need three calls), but they do suffice for all values up to 2^127, which is the largest that Fortran can produce (-HUGE(0_16)-1) with its signed integer types. */ - static_assert(sizeof(GFC_UINTEGER_LARGEST) <= 2 * sizeof(uint64_t)); + static_assert(sizeof(GFC_UINTEGER_LARGEST) <= 2 * sizeof(uint64_t), + "integer too large"); GFC_UINTEGER_LARGEST r; r = n % TEN19; --Apple-Mail=_C7783739-9035-4B8C-AC26-7347C500A4BC--