From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 62F083857B98; Fri, 15 Sep 2023 13:05:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62F083857B98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694783120; bh=uoV9ED1n0urzwPewbynBm3nM9y5HbhkXBrCwiUbQoJc=; h=From:To:Subject:Date:From; b=smKKAUeU0FoGipQXjqoLTdiCBeVa6g234VgT2A6mC/KgTBClhUsNThttPMD7ADxR6 HU2NvRASwpMX4YCoteSYvQzr8WGhHuzAh/wVxigJrNz/22asaRZemztbGmtBS2Jsz1 aJkk1SSsjbl+uTZKXVTc6Cga8AzK/wiTR89TfABI= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-4033] ada: Fix minor glitch in finish_record_type X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: d9275e87812a65474be63d565ae4a2eb9a43e9b1 X-Git-Newrev: 540a1d936d8f73f5e2efdefafd8342ec27773ae8 Message-Id: <20230915130520.62F083857B98@sourceware.org> Date: Fri, 15 Sep 2023 13:05:20 +0000 (GMT) List-Id: https://gcc.gnu.org/g:540a1d936d8f73f5e2efdefafd8342ec27773ae8 commit r14-4033-g540a1d936d8f73f5e2efdefafd8342ec27773ae8 Author: Eric Botcazou Date: Thu Sep 7 10:47:31 2023 +0200 ada: Fix minor glitch in finish_record_type The size needs to be rounded up to the storage unit in all cases. gcc/ada/ * gcc-interface/utils.cc (finish_record_type): Round the size in the padding case as well. Diff: --- gcc/ada/gcc-interface/utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc index d0a13d2af33..f720f3a3b4a 100644 --- a/gcc/ada/gcc-interface/utils.cc +++ b/gcc/ada/gcc-interface/utils.cc @@ -2159,7 +2159,7 @@ finish_record_type (tree record_type, tree field_list, int rep_level, /* If this is a padding record, we never want to make the size smaller than what was specified in it, if any. */ if (TYPE_IS_PADDING_P (record_type) && had_size) - size = TYPE_SIZE (record_type); + size = round_up (TYPE_SIZE (record_type), BITS_PER_UNIT); else size = round_up (size, BITS_PER_UNIT);