diff mbox series

[committed] d: Use HOST_WIDE_INT for type size temporaries.

Message ID 20211118234609.3086210-1-ibuclaw@gdcproject.org
State New
Headers show
Series [committed] d: Use HOST_WIDE_INT for type size temporaries. | expand

Commit Message

Iain Buclaw Nov. 18, 2021, 11:46 p.m. UTC
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 mbox series

Patch

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)
 	{