Message ID | 20240520074858.222435-5-poulhies@adacore.com |
---|---|
State | Committed |
Commit | eef3025547ce55cbf6a9018b495ef5c9a562047a |
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 server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B96F33858417 for <patchwork@sourceware.org>; Mon, 20 May 2024 07:52:02 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id 0FE403858C60 for <gcc-patches@gcc.gnu.org>; Mon, 20 May 2024 07:49:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0FE403858C60 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 0FE403858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716191359; cv=none; b=WYtQk3X6HZ70Tw5wD/w6mMAGvp02DePYoX0T346o86XBrbEJRLoHYqfyXiELhZ0TKsyDFytgNBWz+CeimzfKqi9DlDvDI+tz011cXfH/WQN+sNIa3BX23JhzE73d8Ed04dotT+lDvYq5AOoiWtl9RneA5Tg8hTGLoQ2iuEeJPAE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716191359; c=relaxed/simple; bh=6qhLchnC92btjPevsvHAgYHyZQi/qHezRvZrmMNtDYA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KK8ge0NhdjxmX3ql0D+HXeXH8BKk8OXmCyINWhQ8Bz9TK9uNNz2QG2Ddi916jEkZ669bWrFS+iXWZApvA69vJo7Lv7SlrGsUgM8a8RnBpQtyncvULOv/IpzAQOi8M0wRisFTEx+R/P9/8ZGWIIpAcgpSpik1D08LfHORy11i5eQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2e6792ea67fso44595671fa.1 for <gcc-patches@gcc.gnu.org>; Mon, 20 May 2024 00:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1716191355; x=1716796155; 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=rY5pgB0sRHMeMu9C8T2yT3Kdrjj6j5RnZgScbu21pIM=; b=bAKieG0W/aV/T3NJ25+MPqCfLbctBTkkUGguwLBxnxawpVhOST/0Z7Dvfnkr1Fr1P4 5edukyDmL3Dgdll356KC+yQbmXnW0gZ9PKMXOgJufG5oiiYYnJyW4Fz2QXLeN6xRTKbM pPLE7wT2qBLP3hz8tyrgluy9pILvKypAxwYH2/M73ZMaHmqxMTDBmowLFUMyArwrwa/x ZZOjDIwY5FMuw84EOfmEES8TXs2mbRg/zq78KYimQEth6h4Zi/KCS07jf54pg2777ECN coOm8PmSrozTYhrm83BRqHM5gn3XiC5witxGrwWwMi7/CxAyV6MyO9V75re78sSvjUYN df0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716191355; x=1716796155; 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=rY5pgB0sRHMeMu9C8T2yT3Kdrjj6j5RnZgScbu21pIM=; b=FKFmTq1V4nH3YAoGCXYulnRSwA14DXUm5pfj3+Hg7oaPqBn+dHCKg6c5WbgfDSUy8X Bbjp08iIhHPBmYBcZ432768kkWg2vntcEXnA6TvfJBu1992eo2FgdqcOJoW5TJ1GLNY+ QDMxWliQ6QvcAVLHZDi1bkGnoywaWyezw8WdoemqxX9kEpfcjR4r51D33RL7Cx+58/Bw gFHxah0DViakSy2j0iug22miG5ouzkCIXjiVUmE4AlFqZsnp4h0naOZyQAf/czPlZNoO qEg2D2yggMOc6vZOd6KoNgWHDkKQHjF50Eb+ssQnLk9QnB+wYKpkW2TmqlpmsM1hOLci wzlA== X-Gm-Message-State: AOJu0YxQ1uIbvSPTbPCgF+BfbtTnB2Z/e/2IA/KwEEu3PsMOEG5YVNzH +3ffBikx3cPYnhv/yccOUvT5vlywmvtmJ8KgL8Cm4raUR2ywZix7He39QNmLnI8RMfLv3ZuYJ+g = X-Google-Smtp-Source: AGHT+IFtP5s9n14TFxsWabS88+pRJI16XduwKCFiFmKWkeQIEK8vrjYK2dLiXR3pwoj0boQGT1VfQw== X-Received: by 2002:a2e:9106:0:b0:2e3:93c2:4239 with SMTP id 38308e7fff4ca-2e51ff68308mr194237141fa.21.1716191355593; Mon, 20 May 2024 00:49:15 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:de37:8b1c:1f33:2610]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41f88111033sm446892175e9.34.2024.05.20.00.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 00:49:15 -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 05/30] ada: One more adjustment coming from aliasing considerations Date: Mon, 20 May 2024 09:48:31 +0200 Message-ID: <20240520074858.222435-5-poulhies@adacore.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240520074858.222435-1-poulhies@adacore.com> References: <20240520074858.222435-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.9 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 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+patchwork=sourceware.org@gcc.gnu.org |
Series |
[COMMITTED,01/30] ada: Rework and augment documentation on strict aliasing
|
|
Commit Message
Marc Poulhiès
May 20, 2024, 7:48 a.m. UTC
From: Eric Botcazou <ebotcazou@adacore.com>
It is needed on PowerPC platforms because of specific calling conventions.
gcc/ada/
* libgnat/g-sothco.ads (In_Addr): Add aspect Universal_Aliasing.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/libgnat/g-sothco.ads | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/gcc/ada/libgnat/g-sothco.ads b/gcc/ada/libgnat/g-sothco.ads index 8c219333649..da1e6f5bcdd 100644 --- a/gcc/ada/libgnat/g-sothco.ads +++ b/gcc/ada/libgnat/g-sothco.ads @@ -123,10 +123,13 @@ package GNAT.Sockets.Thin_Common is type In_Addr is record S_B1, S_B2, S_B3, S_B4 : C.unsigned_char; - end record with Convention => C, Alignment => C.int'Alignment; + end record + with Convention => C, Alignment => C.int'Alignment, Universal_Aliasing; -- IPv4 address, represented as a network-order C.int. Note that the -- underlying operating system may assume that values of this type have - -- C.int alignment, so we need to provide a suitable alignment clause here. + -- C.int's alignment, so we need to provide a suitable alignment clause. + -- We also need to inhibit strict type-based aliasing optimizations in + -- order to implement the following unchecked conversions efficiently. function To_In_Addr is new Ada.Unchecked_Conversion (C.int, In_Addr); function To_Int is new Ada.Unchecked_Conversion (In_Addr, C.int);