summaryrefslogtreecommitdiff
path: root/gcc/c-format.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-format.c')
-rw-r--r--gcc/c-format.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/c-format.c b/gcc/c-format.c
index 914d6cc9792..a228b4b886f 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -147,17 +147,12 @@ check_format_string (tree argument, unsigned HOST_WIDE_INT format_num,
return true;
}
-/* Strip any conversions from the expression, verify it is a constant,
- and store its value. If validated_p is true, abort on errors.
+/* Verify EXPR is a constant, and store its value.
+ If validated_p is true, abort on errors.
Returns true on success, false otherwise. */
static bool
get_constant (tree expr, unsigned HOST_WIDE_INT *value, int validated_p)
{
- while (TREE_CODE (expr) == NOP_EXPR
- || TREE_CODE (expr) == CONVERT_EXPR
- || TREE_CODE (expr) == NON_LVALUE_EXPR)
- expr = TREE_OPERAND (expr, 0);
-
if (TREE_CODE (expr) != INTEGER_CST || TREE_INT_CST_HIGH (expr) != 0)
{
gcc_assert (!validated_p);