]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/convert.c
Fix #52283 error: case label does not reduce to an integer constant
[thirdparty/gcc.git] / gcc / convert.c
index 8ff2e9a825af8e144f1867ac8c2e343ece19681b..5e6b09e06545805374c87b117b9a2f1057d4e392 100644 (file)
@@ -537,7 +537,6 @@ convert_to_integer (tree type, tree expr)
       else if (outprec >= inprec)
        {
          enum tree_code code;
-         tree tem;
 
          /* If the precision of the EXPR's type is K bits and the
             destination mode has more bits, and the sign is changing,
@@ -555,13 +554,7 @@ convert_to_integer (tree type, tree expr)
          else
            code = NOP_EXPR;
 
-         tem = fold_unary (code, type, expr);
-         if (tem)
-           return tem;
-
-         tem = build1 (code, type, expr);
-         TREE_NO_WARNING (tem) = 1;
-         return tem;
+         return fold_build1 (code, type, expr);
        }
 
       /* If TYPE is an enumeral type or a type with a precision less