diff options
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/c/c-array-notation.c | 2 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 11 |
3 files changed, 14 insertions, 7 deletions
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 <polacek@redhat.com> + + * 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 <amacleod@redhat.com> * 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 %<void%>"); /* 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) |