diff options
author | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-26 19:55:12 +0000 |
---|---|---|
committer | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-26 19:55:12 +0000 |
commit | aa3e402e1d13e754e43aff87ee05a393af16c580 (patch) | |
tree | ec115bec7a7a3f95f3ee52ded9cc7d29440b574b /gcc/c | |
parent | 96177d13e19487b232627b13e337b1a23ead622b (diff) | |
download | gcc-aa3e402e1d13e754e43aff87ee05a393af16c580.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225080 138bc75d-0d04-0410-961f-82ee72b054a4
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 4f89f8f030f..f6829024f38 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 02924688336..e6a1539cda9 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 9caf028b0b1..60d6ed85ba3 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) |