]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Bugfix gm2_type_for_size. Patchset suggestion missed.
authorGaius Mulley <gaiusmod2@gmail.com>
Tue, 6 Dec 2022 18:43:44 +0000 (18:43 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Tue, 6 Dec 2022 18:43:44 +0000 (18:43 +0000)
A feedback suggestion missed with the previous commits.
Use build_nonstandard_integer_type to avoid getting
a different type each time this function is called.

gcc/m2/ChangeLog:

* m2/gm2-lang.cc (gm2_type_for_size):
Use build_nonstandard_integer_type.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-lang.cc

index 2f57d740a36e00b5ad567fef55657b7e3a5de492..4acec02b55c17999151ce088c451cfcaac7bb510 100644 (file)
@@ -816,7 +816,8 @@ gm2_type_for_size (unsigned int bits, int unsignedp)
       else if (bits == LONG_LONG_TYPE_SIZE)
         type = long_long_unsigned_type_node;
       else
-        type = make_unsigned_type (bits);
+       type = build_nonstandard_integer_type (bits,
+                                              unsignedp);
     }
   else
     {
@@ -831,7 +832,8 @@ gm2_type_for_size (unsigned int bits, int unsignedp)
       else if (bits == LONG_LONG_TYPE_SIZE)
         type = long_long_integer_type_node;
       else
-        type = make_signed_type (bits);
+       type = build_nonstandard_integer_type (bits,
+                                              unsignedp);
     }
   return type;
 }