From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1873) id D5D993858422; Thu, 18 Nov 2021 23:35:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5D993858422 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain Buclaw To: gcc-cvs@gcc.gnu.org Subject: [gcc r10-10279] d: Use HOST_WIDE_INT for type size temporaries. X-Act-Checkin: gcc X-Git-Author: Iain Buclaw X-Git-Refname: refs/heads/releases/gcc-10 X-Git-Oldrev: 14364fcb6fc3fa768a5a3afca3c8615b8d8a244d X-Git-Newrev: 3898cacbf79a6929fd96777194335a6b3a416a96 Message-Id: <20211118233543.D5D993858422@sourceware.org> Date: Thu, 18 Nov 2021 23:35:43 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2021 23:35:43 -0000 https://gcc.gnu.org/g:3898cacbf79a6929fd96777194335a6b3a416a96 commit r10-10279-g3898cacbf79a6929fd96777194335a6b3a416a96 Author: Iain Buclaw Date: Thu Nov 18 22:43:40 2021 +0100 d: Use HOST_WIDE_INT for type size temporaries. These variables are later used as the value for the format specifier `%wd`, which the expected type may not match dinteger_t, causing unnecessary -Wformat warnings. gcc/d/ChangeLog: * decl.cc (d_finish_decl): Use HOST_WIDE_INT for type size temporaries. (cherry picked from commit d6ec661e3931773e2f571ed4f6dd8b0402d8687d) Diff: --- gcc/d/decl.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc index f342688ba91..1ccd983af9c 100644 --- a/gcc/d/decl.cc +++ b/gcc/d/decl.cc @@ -1585,8 +1585,9 @@ d_finish_decl (tree decl) if (flag_checking && DECL_INITIAL (decl)) { /* Initializer must never be bigger than symbol size. */ - dinteger_t tsize = int_size_in_bytes (TREE_TYPE (decl)); - dinteger_t dtsize = int_size_in_bytes (TREE_TYPE (DECL_INITIAL (decl))); + HOST_WIDE_INT tsize = int_size_in_bytes (TREE_TYPE (decl)); + HOST_WIDE_INT dtsize = + int_size_in_bytes (TREE_TYPE (DECL_INITIAL (decl))); if (tsize < dtsize) {