Message ID | 20240902082430.1863631-9-poulhies@adacore.com |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Ah0z8DHk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wy1zn1WwZz1ygC for <incoming@patchwork.ozlabs.org>; Mon, 2 Sep 2024 18:25:57 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1278D3865C23 for <incoming@patchwork.ozlabs.org>; Mon, 2 Sep 2024 08:25:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 48109386182F for <gcc-patches@gcc.gnu.org>; Mon, 2 Sep 2024 08:24:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 48109386182F Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 48109386182F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265494; cv=none; b=S1l6K2ZaZUZb/A1zx9RTJgB8a0BURMiodQxJHnWuejAkK07OBadxou5H1fyCaQ1Z9Low60GJrGvEQpRsNbaTFPr8X69nOVTaPocno+Xe42QHEo9WmJkqckQb/ZYr8goJ/wNJvc6B4jPGwyAGrJaZOmoNqOBAf7/LEWhDUY98Q6M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725265494; c=relaxed/simple; bh=Ay5n0pVqo41n2Hl0YyIptc73PuVgxzt0tErgtN3a2Oc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=q0OII2y23ObYa5V6/0Bxd87Im/bRGn4iA/B/IOs8rxeiIBDMjuA9/el0L2deJzzgFxvAWYyGqiAB5JmyMgfdoq9AxDpLSdvHCUjTptW+RnV5AhYuaOO+dvRw0ipOw8UEHFqBHAkh1VbKAacojFb0gYY6CvuPebzQ0w9hSSsoDv4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42ba9b47f4eso22469235e9.1 for <gcc-patches@gcc.gnu.org>; Mon, 02 Sep 2024 01:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1725265492; x=1725870292; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a4Ln9hVyxfqRvzRlQHizB+vO6iLpy4+VKmdenCB8tZs=; b=Ah0z8DHk0fr2Ul1y/V6akKhqsWb26sfALkZ9CEKqL17YsXJtQh6PuRLTtQnY/LIqwh oKZGIS/HtqcKuO114YoRbWPwse8ObE+AOMzMxDFIgcqjprHE7KB4DQj1XjKtfeUUTJWF T5oY3fvfaZliKvXN2sDAADK0+gyWLUv6ctnMGVxzxhDkuQjXmXzKFSS3dx6nt2cnr8es U8hEzB3dPO/PfQeiVT1DrHug32VpqFAHuTu3nyK2lH3p5otn37cgMI4qyPNnUfldqgxE Sq204/6LNOOQVem/VoHm1/h3zpeQqDJ3FNuLq0RfaHpumgZq6dFbsk6F6UnrD7qGkXM9 y+8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725265492; x=1725870292; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a4Ln9hVyxfqRvzRlQHizB+vO6iLpy4+VKmdenCB8tZs=; b=C7A+PI2uLfeEJIBb06nHUZPDrcffnyz9C+5YBib1MkKbyQ/Y6Zg6y/xhwbm+m6yZim wxdTuS7dUWUjX/MA+gTgtmzteYsl+0Y/egCGd+iTsIOeWv+sU9iRjrChx5L46/uY3cjh DBnUNKsnde0vMz4MgiWeLVo6oaofeTb/5CZwkPiOQfuHQ410WdseiqpRAZ00GwjgAyV3 hgyCSMY/Hymjr4QfwqF046APIv/c2ONJUdlaenpWhk/P8/nyTvLK1x1rBVIA8joEbChH 2cEufAKvQWrFKjzw/jeZodVeO7+qDq9q6s+xSnimV3mdEugwyJqOm7hLP+vwAiQAnpwQ kCjw== X-Gm-Message-State: AOJu0YwwlE2AC5vEUFiWKLJpMPobnonbMG2NlPvK1xOtC0czsWgh3XlL sGFzzERb9UYdB6d0XqChtIiufKGwRwVsZ2cB0RvIrWyoSaluPnA6Gvw16Rper6UmAqmy3yMy4Co = X-Google-Smtp-Source: AGHT+IFjdsulcaX51x5p+XtBknhqbsGVxjoeS+4otaBj/hbrvmwrBxbC06uIIhUavV4WmQadgLVXIQ== X-Received: by 2002:a05:600c:1c83:b0:424:8dbe:817d with SMTP id 5b1f17b1804b1-42bb4c5e500mr77969495e9.10.1725265491742; Mon, 02 Sep 2024 01:24:51 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:830d:da2f:a98:f5d6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ef7ea91sm10782219f8f.78.2024.09.02.01.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 01:24:51 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou <ebotcazou@adacore.com> Subject: [COMMITTED 9/9] ada: Diagnose too large size clause on floating-point type Date: Mon, 2 Sep 2024 10:24:28 +0200 Message-ID: <20240902082430.1863631-9-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240902082430.1863631-1-poulhies@adacore.com> References: <20240902082430.1863631-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org |
Series |
[COMMITTED,1/9] ada: Remove repeated guards in validity checks
|
expand
|
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index d7c17238bbc..398e01521a3 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -521,8 +521,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) esize = UI_To_Int (Esize (gnat_entity)); if (IN (kind, Float_Kind)) +#ifdef WIDEST_HARDWARE_FP_SIZE + max_esize = fp_prec_to_size (WIDEST_HARDWARE_FP_SIZE); +#else max_esize = fp_prec_to_size (TYPE_PRECISION (long_double_type_node)); +#endif else if (IN (kind, Access_Kind)) max_esize = POINTER_SIZE * 2; else
From: Eric Botcazou <ebotcazou@adacore.com> The problem is that the size clause changes the floating-point format used for the type, but it must not when this format is the widest format that is supported in hardware on the target. Instead a padding type must be built and the associated warning given. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity): Cap the Esize of a floating-point type to the size of the widest format supported in hardware if it is explicity defined. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 4 ++++ 1 file changed, 4 insertions(+)