]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
value-range: Use int instead of uint for wi::ctz result [PR120746]
authorJakub Jelinek <jakub@redhat.com>
Sat, 21 Jun 2025 14:09:08 +0000 (16:09 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 21 Jun 2025 14:09:08 +0000 (16:09 +0200)
uint is some compatibility type in glibc sys/types.h enabled in misc/GNU
modes, so it doesn't exist on many hosts.
Furthermore, wi::ctz returns int rather than unsigned and the var is
only used in comparison to zero or as second argument of left shift, so
I think just using int instead of unsigned is better.

2025-06-21  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/120746
* value-range.cc (irange::snap): Use int type instead of uint.

gcc/value-range.cc

index ce13acc312d2f6523c04651c67e3e77f0133ed2a..23a5c66ed5e3eae99bc47cc6a51290531fbba2bd 100644 (file)
@@ -2287,7 +2287,7 @@ bool
 irange::snap (const wide_int &lb, const wide_int &ub,
              wide_int &new_lb, wide_int &new_ub)
 {
-  uint z = wi::ctz (m_bitmask.mask ());
+  int z = wi::ctz (m_bitmask.mask ());
   if (z == 0)
     return false;