]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Do not assert NUM_POLY_INT_COEFFS != 1 early
authorRichard Biener <rguenther@suse.de>
Tue, 3 Sep 2024 08:40:41 +0000 (10:40 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 3 Sep 2024 08:42:50 +0000 (10:42 +0200)
The following moves the assert on NUM_POLY_INT_COEFFS != 1 after
INTEGER_CST processing.

* fold-const.cc (poly_int_binop): Move assert on
NUM_POLY_INT_COEFFS after INTEGER_CST processing.

gcc/fold-const.cc

index 2ada59f712bb3a72c932aae5254e9289bd7e1634..70db16759d04e31df21f066d1628b1bd9988ae37 100644 (file)
@@ -1241,7 +1241,6 @@ poly_int_binop (poly_wide_int &res, enum tree_code code,
                const_tree arg1, const_tree arg2,
                signop sign, wi::overflow_type *overflow)
 {
-  gcc_assert (NUM_POLY_INT_COEFFS != 1);
   gcc_assert (poly_int_tree_p (arg1) && poly_int_tree_p (arg2));
 
   if (TREE_CODE (arg1) == INTEGER_CST && TREE_CODE (arg2) == INTEGER_CST)
@@ -1254,6 +1253,8 @@ poly_int_binop (poly_wide_int &res, enum tree_code code,
       return true;
     }
 
+  gcc_assert (NUM_POLY_INT_COEFFS != 1);
+
   switch (code)
     {
     case PLUS_EXPR: