public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] d: Use HOST_WIDE_INT for type size temporaries.
@ 2021-11-18 23:46 Iain Buclaw
  0 siblings, 0 replies; only message in thread
From: Iain Buclaw @ 2021-11-18 23:46 UTC (permalink / raw)
  To: gcc-patches; +Cc: iains.gcc, Iain Buclaw

Hi,

This patch fixes an issue with bootstrap on x86_64-darwin when building
with --enable-werror.

These couple variables are later used as the value for the format
specifier `%wd`, to which the expected type may not match dinteger_t,
causing unnecessary -Wformat warnings.

Bootstrapped and regression tested on x86_64-linux-gnu, committed to
mainline and backported to the releases/gcc-9, gcc-10, and gcc-11
branches as it's obvious what this is doing.

Regards
Iain

---
gcc/d/ChangeLog:

	* decl.cc (d_finish_decl): Use HOST_WIDE_INT for type size
	temporaries.
---
 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 0d46ee180e7..9c9205fa349 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -1544,8 +1544,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)
 	{
-- 
2.30.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-18 23:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 23:46 [committed] d: Use HOST_WIDE_INT for type size temporaries Iain Buclaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).