| Message ID | 20260602084541.3829876-51-poulhies@adacore.com |
|---|---|
| State | Committed |
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E18CD4BA2E0A for <patchwork@sourceware.org>; Tue, 2 Jun 2026 09:37:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E18CD4BA2E0A Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=QwRUlGSO 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 7F2944BA2E26 for <gcc-patches@gcc.gnu.org>; Tue, 2 Jun 2026 08:46:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7F2944BA2E26 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 7F2944BA2E26 Authentication-Results: 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=1780389998; cv=none; b=UZnb0OZEfhoY/xc5CmgbhNbiudY+PXcPCahEO2FQFZeK3Y+e1z5bfHc5iAR3kETx22FmMrbr12lc1QbwHE9zFePzkuUm4tszmRbCaW1BG//fDLYryy/ZkNmmVory8anFxwgiOfUoXzWIZxD+M4Qr4qerPlRuARzxPjIBYGqmMic= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389998; c=relaxed/simple; bh=OmfaVvN03cQuZ0j0pg1Mi8E7bOAeeTaEoj7E/3zUpsQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Il6n4MJa6Ms0ACwVHxvjR1Hmz1oZMmiFzxV6wY6z6wwCljSRXkrdY9CucH2anqJXnLN0AdztV8yfHtE6crGsFitMcpRqyOOmqiRpiFYQHykW+t/SfrXREoULEQPcE4SS3rc1e3BJ0ft6+C+6x7ffACBjKg7J5A3H2I0LhJFQCTM= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=QwRUlGSO DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F2944BA2E26 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-49041e84237so90266065e9.1 for <gcc-patches@gcc.gnu.org>; Tue, 02 Jun 2026 01:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389997; x=1780994797; 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=F9baYSiL2587/zQ/3QJYtYJLejWE/3MOOnAhU/A3+b8=; b=QwRUlGSOZxse4UPVo54aj24npkiOw3+IRPG0zp6+rfiNSw8T83YqAs2oIsUBVTKMXO sTvjEsBj61BpO6v01xX50WHLL8upP4SgRMAlvFZ7Y2QM8NU+NKt5OZtsNdRr/1HyzhFL 3rmZHpJ8D+iWZj7q88ltLXnI/RXyqNy9PLAMRJEZ9Al+LDghtstt5Csv+59BxSqUzga1 brXItzu2cLOz2l+YqIUPueDtNxy8mCYWcXFek2E1ZDsgm/p9tcswXh+ZVA1A5U+6ElCL LSUAT3LlndK4gGN8FpzKZrIaL7Eh49tYORUnCKWvJ5haeMdbBjPgqkwRSqXNt3z0a9jZ vvng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389997; x=1780994797; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=F9baYSiL2587/zQ/3QJYtYJLejWE/3MOOnAhU/A3+b8=; b=ds+fQkOPV5ILnQMmnOvAE24GENnwz+HwnyhLToSPK1DI4dApNnAw/20bjAanJG6pep 9zNlHhljohdwFAhmEVc1kTykezWtqo0qSAuPz4ilr6jRww7ntsdDl1MXAZbfRsUaVRjX 6vgOkQlV4Oh/PV8xnRIOyiP7HbMMIFOaypT2POGvhY91y3PHGIGrcREmtm9jh3L3yyUo HxbE0loMwC4YmyMb5Hr9baqXyB5UyC65Y50M5+80BPxS57Tpf7zfEdnVoAlhii/0H/M1 3DttRHNF3H8WBNdqk6MhtDB9PDoF4dBuNf1EjPo4Fm5hsZVnwsrgmaiW8E475TVKFg/+ Q/Vw== X-Gm-Message-State: AOJu0YyiBu4jpLY8QsqLmIyToj9KfvbGvicpVFBq4XoyQDawdI9H6kzI GAn6Gkhitt0sd5AQj9mba8RWmoJWpERSQ0TiLBpAGlIqO3yXrQ9IgLbN4j8aBXlI52OfeD7JKRC 6/Y4= X-Gm-Gg: Acq92OG7ceWO8ZKRhc8y7RzOGs94n1EjzNJom3a7xHeNq9lcO9aS8wGWu0XznpUUDeR 1xgLZ/lvZSiMsskjF7AfEeO+TqW28fHdE/tHOmKlTiY91iUcYi1obgAnYe5G/VIK9LyP9YeRzFm 8T9AJlQ1vBoBNSmwadlYt/r0Pu4DZjR2lbntV5GdjTPczGA8GY0ofcIprpydjoPU/D1iiU/t0a+ BDaFQSFets3831l9ZelNKL85RSdXbWZh3ZYj3MX/GtKNR/ojEnikf/cxZTASjBzBFxlhOOte1lB 97AkIU2iv0YIcNKEdZ6YLbq2FTI4UWf3ANJCr7/hoGAuNhcfGYx0cMhxixjXR7SgjMmcrGj2BP+ BR7XEgvjKrEYGoXaPbfZ9+K2oB7tFGgwVFDmdlKogStegERNcDKfKuA5U3wEBR49dV8b/2sp8nc mZoMn5Au5UVeHcW7Cus0jTJ82614bbi7YL12G74wDYzUufLwzlrPF6MwseHPktdaKJIpwh0bXxS ZmLc5egCfkaVHK5wvjTUd9CYN+F5M5io8umpYO1og== X-Received: by 2002:a05:600c:5254:b0:48f:e044:927d with SMTP id 5b1f17b1804b1-490b0e7caafmr44024055e9.10.1780389997485; Tue, 02 Jun 2026 01:46:37 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:37 -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 51/51] ada: Reject misalignment of objects with address clause Date: Tue, 2 Jun 2026 10:45:39 +0200 Message-ID: <20260602084541.3829876-51-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-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_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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~patchwork=sourceware.org@gcc.gnu.org |
| Series |
[COMMITTED,01/51] ada: Rename Private_Component function
|
|
Checks
| Context | Check | Description |
|---|---|---|
| linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 | fail | Patch failed to apply |
| linaro-tcwg-bot/tcwg_simplebootstrap_build--master-aarch64-bootstrap | fail | Patch failed to apply |
| linaro-tcwg-bot/tcwg_gcc_build--master-arm | fail | Patch failed to apply |
| linaro-tcwg-bot/tcwg_simplebootstrap_build--master-arm-bootstrap | fail | Patch failed to apply |
Commit Message
Marc Poulhiès
June 2, 2026, 8:45 a.m. UTC
From: Eric Botcazou <ebotcazou@adacore.com>
Misaligned objects are meant to be rejected universally by the compiler.
gcc/ada/ChangeLog:
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: Validate
a known alignment on the object even if there is an address clause.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/gcc-interface/decl.cc | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 50a065d2dea..3a14f226f0e 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -814,12 +814,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) } /* If an alignment is specified, use it if valid. Note that exceptions - are objects but don't have an alignment and there is also no point in - setting it for an address clause, since the final type of the object - will be a reference type. */ - if (Known_Alignment (gnat_entity) - && kind != E_Exception - && No (Address_Clause (gnat_entity))) + are objects but don't have an alignment. */ + if (Known_Alignment (gnat_entity) && kind != E_Exception) align = validate_alignment (Alignment (gnat_entity), gnat_entity, TYPE_ALIGN (gnu_type));