From 22d035258b7dcb4e0414d413e32d20a8d8e3cdfe Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 26 Jun 2015 19:55:12 +0000 Subject: array-notation-common.c (find_rank): Use INDIRECT_REF_P. * array-notation-common.c (find_rank): Use INDIRECT_REF_P. * c-common.c (c_fully_fold_internal): Likewise. (c_alignof_expr): Likewise. * c-pretty-print.c (c_pretty_printer::postfix_expression): Likewise. * c-ubsan.c (ubsan_instrument_bounds): Likewise. * cilk.c (create_parm_list): Likewise. * c-array-notation.c (fix_builtin_array_notation_fn): Use INDIRECT_REF_P. * c-typeck.c (array_to_pointer_conversion): Likewise. (build_unary_op): Likewise. (c_finish_return): Likewise. From-SVN: r225080 --- gcc/c/ChangeLog | 8 ++++++++ gcc/c/c-array-notation.c | 2 +- gcc/c/c-typeck.c | 11 +++++------ 3 files changed, 14 insertions(+), 7 deletions(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 4f89f8f..f682902 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,11 @@ +2015-06-26 Marek Polacek + + * c-array-notation.c (fix_builtin_array_notation_fn): Use + INDIRECT_REF_P. + * c-typeck.c (array_to_pointer_conversion): Likewise. + (build_unary_op): Likewise. + (c_finish_return): Likewise. + 2015-06-25 Andrew MacLeod * c-decl.c: Remove ipa-ref.h and plugin-api.h from include list. diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c index 0292468..e6a1539 100644 --- a/gcc/c/c-array-notation.c +++ b/gcc/c/c-array-notation.c @@ -324,7 +324,7 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) array_ind_value = build_decl (location, VAR_DECL, NULL_TREE, TREE_TYPE (func_parm)); array_op0 = (*array_operand)[0]; - if (TREE_CODE (array_op0) == INDIRECT_REF) + if (INDIRECT_REF_P (array_op0)) array_op0 = TREE_OPERAND (array_op0, 0); switch (an_type) { diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 9caf028..60d6ed8 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -1826,7 +1826,7 @@ array_to_pointer_conversion (location_t loc, tree exp) ptrtype = build_pointer_type (restype); - if (TREE_CODE (exp) == INDIRECT_REF) + if (INDIRECT_REF_P (exp)) return convert (ptrtype, TREE_OPERAND (exp, 0)); /* In C++ array compound literals are temporary objects unless they are @@ -4146,12 +4146,11 @@ build_unary_op (location_t location, unary '*' operator. */ if (VOID_TYPE_P (TREE_TYPE (arg)) && TYPE_QUALS (TREE_TYPE (arg)) == TYPE_UNQUALIFIED - && (TREE_CODE (arg) != INDIRECT_REF - || !flag_isoc99)) + && (!INDIRECT_REF_P (arg) || !flag_isoc99)) pedwarn (location, 0, "taking address of expression of type %"); /* Let &* cancel out to simplify resulting code. */ - if (TREE_CODE (arg) == INDIRECT_REF) + if (INDIRECT_REF_P (arg)) { /* Don't let this be an lvalue. */ if (lvalue_p (TREE_OPERAND (arg, 0))) @@ -4220,7 +4219,7 @@ build_unary_op (location_t location, /* ??? Cope with user tricks that amount to offsetof. Delete this when we have proper support for integer constant expressions. */ val = get_base_address (arg); - if (val && TREE_CODE (val) == INDIRECT_REF + if (val && INDIRECT_REF_P (val) && TREE_CONSTANT (TREE_OPERAND (val, 0))) { ret = fold_convert_loc (location, argtype, fold_offsetof_1 (arg)); @@ -9465,7 +9464,7 @@ c_finish_return (location_t loc, tree retval, tree origtype) inner = TREE_OPERAND (inner, 0); while (REFERENCE_CLASS_P (inner) - && TREE_CODE (inner) != INDIRECT_REF) + && !INDIRECT_REF_P (inner)) inner = TREE_OPERAND (inner, 0); if (DECL_P (inner) -- cgit v1.1