From f6d1c3a69b64edc2ff6d10d8ec89456552a5f3a8 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sun, 20 Mar 2005 15:23:50 +0000 Subject: c-common.c (handle_aligned_attribute, [...]): Do not strip NOPS from INTEGER_CSTs. * c-common.c (handle_aligned_attribute, check_function_sentinel, get_nonnull_operand, handle_sentinel_attribute, check_function_arguments_recurse): Do not strip NOPS from INTEGER_CSTs. * c-decl.c (check_bitfield_type_and_width, build_enumerator): Likewise. * c-format.c (get_constant): Likewise. * c-parser.c (c_parser_postfix_expression): Likewise. * c-typeck.c (set_init_index): Likewise. (convert_arguments): Don't check for NOP_EXPR containing integer constant. From-SVN: r96760 --- gcc/c-format.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'gcc/c-format.c') diff --git a/gcc/c-format.c b/gcc/c-format.c index 914d6cc..a228b4b 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); -- cgit v1.1