[COMMITTED,07/30] ada: Use System.Address for address computation in System.Pool_Global
Message ID | 20240520074858.222435-7-poulhies@adacore.com |
---|---|
State | Committed |
Commit | 16cdeadb33400238ea522541009ecd2a24769f0c |
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 BB5713858430 for <patchwork@sourceware.org>; Mon, 20 May 2024 07:50:43 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 588C83858C78 for <gcc-patches@gcc.gnu.org>; Mon, 20 May 2024 07:49:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 588C83858C78 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 588C83858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::335 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716191360; cv=none; b=mKs/vEmBwXGjboVIp35dWyV0UfRdmGcL7R2D9PzD8IBJpXjE68Y+2H6TCyz9UnNDc6XaG7AERdR3Tga1FBk3CkBazgGHDX+f5x7L2pHe0SdtuFJnxB/JLg6CcIRpEyGv6FF4EyyEzE4s1XoJdyRinmZtsyn9CBUU4SZj+Gzwrns= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716191360; c=relaxed/simple; bh=ygLoK6QGLsCMgOTOHSo3Xj5S/XYE/nekj/9ekxnNj9E=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=QLdAZgHyzPeteRF8kLP17LTJC4KiC97lyYsYcZs9xG31jlHxA8oKqvhyaMsPQR8eG+oy9UomtCTF7FETB2UFn9hfEB7jOjlqEJK2VU+l4D+InonYu3r+3AE2ojKmxIpwG96zP6rlLXDZD7Eo2+DcpAlCS15d/paAjAZbk+Zfv50= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-420104e5336so11233905e9.1 for <gcc-patches@gcc.gnu.org>; Mon, 20 May 2024 00:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1716191357; x=1716796157; 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=SX88nxiDCZbXlcaeaN8LW3EPgyDZkr+BtyrQ692dV0Y=; b=XNy4fBCilmmqjLrfm5e350MDKaCfehCOLG6Oa0M58hRkRH+kKGSYHpcYV27YDpNljj /54ARqhBKuR9TdWoMiFjXDiaDcbpYsrOOdbli5DclNSZrLV7ZjZqDvshrne0E/WgS+Cx A5PPt+zbeIfuikIDYGlIIs6xkEdfo3ocQAREukMld7RdZEWhlJabdpdHfwtzH8nGi+qV aa7XkQYBAvJ5VQFSWmrO2/5/884UtKv9+It8oiGRP/8NPkeZjzjm187QoovWVfiAKmDH 1CgEkj0H1EmgyY8U2Rz4UyrsirrCDz6jNl7Gb1KmrFElLbPoh3c6Qvq2T3umnD+yYeaI 1NBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716191357; x=1716796157; 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=SX88nxiDCZbXlcaeaN8LW3EPgyDZkr+BtyrQ692dV0Y=; b=li5LO/O9BC06IbTjbbuqy9NnvFoZWm53L9UJ9CvRdgFiEpZkjm3mu2cp919Rw9DeUe cs/rMgZgp+ZASF8NWrqi3HpgIcliWl6t+bz4eEgDNbaZjWkh2Vh9cEegH9mJB10kAh2V mjsZhLZLieKWIW6+RC14JA0JNfyrOPAbP+MH//NqBdI9kZciZfopMdU2bRnV0LOGG3Dz S0pc2ttNI5Y3pV1B6O1wwm4ABVlQ1ckMvGzZ60cdfDa+1uFvO8FBvwkPX7ljXMivsepV V0K1d530bZ4jb9NcNVy9L4Hbb9jygh/mQInnQA17TCUfwOKfPSpWXXbuF2fU8xct/ocm lAkg== X-Gm-Message-State: AOJu0YxSQqHEL90Rw6R23NFLXeiGTTLigZmA/sqfkEbj5Fnp8zIWjZqD 8yKb8TUKGPAO+KLc/YvDKjiRNIBBv4vIwkRHPcRpFUHk0+k2gDae1ZFNRKapj6B3UYS3rQvonQk = X-Google-Smtp-Source: AGHT+IHwKwVMpna6JXaF29fiDw+IEPXKfDuzA66bnsMM1/lkxhb9/unTiWI13FmH/Yi+9CNwWYkCcQ== X-Received: by 2002:a05:600c:2316:b0:418:d3f4:677b with SMTP id 5b1f17b1804b1-420e1a0105emr45422165e9.17.1716191357192; Mon, 20 May 2024 00:49:17 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 00:49:16 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Sebastian Poeplau <poeplau@adacore.com> Subject: [COMMITTED 07/30] ada: Use System.Address for address computation in System.Pool_Global Date: Mon, 20 May 2024 09:48:33 +0200 Message-ID: <20240520074858.222435-7-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: Sebastian Poeplau <poeplau@adacore.com>
Some architectures don't let us convert
System.Storage_Elements.Integer_Address back to a valid System.Address.
Using the arithmetic operations on System.Address from
System.Storage_Elements prevents the problem while leaving semantics
unchanged.
gcc/ada/
* libgnat/s-pooglo.adb (Allocate): Use arithmetic on
System.Address to compute the aligned address.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/libgnat/s-pooglo.adb | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/gcc/ada/libgnat/s-pooglo.adb b/gcc/ada/libgnat/s-pooglo.adb index dea3de15cc5..9ce21c8fd0d 100644 --- a/gcc/ada/libgnat/s-pooglo.adb +++ b/gcc/ada/libgnat/s-pooglo.adb @@ -75,9 +75,10 @@ package body System.Pool_Global is -- Realign the returned address - Aligned_Address := To_Address - (To_Integer (Allocated) + Integer_Address (Alignment) - - (To_Integer (Allocated) mod Integer_Address (Alignment))); + Aligned_Address := + Allocated + Alignment + - Storage_Offset (To_Integer (Allocated) + mod Integer_Address (Alignment)); -- Save the block address