https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113565

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-01-23
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This should fix it (but I am have not tested it either and I am not 100% sure
we want/need this):

```
[apinski@xeond2 gcc]$ git diff fold-const-call.cc
diff --git a/gcc/fold-const-call.cc b/gcc/fold-const-call.cc
index 47bf8d64391..c9fa51e35ee 100644
--- a/gcc/fold-const-call.cc
+++ b/gcc/fold-const-call.cc
@@ -1031,7 +1031,7 @@ fold_const_call_ss (wide_int *result, combined_fn fn,
const wide_int_ref &arg,
          tmp = TYPE_PRECISION (arg_type);
        else if (!CLZ_DEFINED_VALUE_AT_ZERO (SCALAR_INT_TYPE_MODE (arg_type),
                                             tmp))
-         tmp = TYPE_PRECISION (arg_type);
+         return false;
        *result = wi::shwi (tmp, precision);
        return true;
       }
@@ -1046,7 +1046,7 @@ fold_const_call_ss (wide_int *result, combined_fn fn,
const wide_int_ref &arg,
          tmp = TYPE_PRECISION (arg_type);
        else if (!CTZ_DEFINED_VALUE_AT_ZERO (SCALAR_INT_TYPE_MODE (arg_type),
                                             tmp))
-         tmp = TYPE_PRECISION (arg_type);
+         return false;
        *result = wi::shwi (tmp, precision);
        return true;
       }

```

Confirmed.

Reply via email to