From 598f50d7891b420331f2027e60ba63824d335bad Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Tue, 30 Apr 2019 20:23:45 +0000 Subject: [PATCH] [GC PATCH] Correct TS marking of _EXPR nodes https://gcc.gnu.org/ml/gcc-patches/2019-04/msg01266.html gcc/ * tree.h (MARK_TS_EXP): New. gcc/c-family/ * c-common.c (c_common_init_ts): Use MARK_TS_EXP. Mark SIZEOF_EXPR. gcc/cp/ * cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR nodes. Call c_common_init_ts. From-SVN: r270711 --- gcc/ChangeLog | 4 ++ gcc/c-family/ChangeLog | 4 ++ gcc/c-family/c-common.c | 5 +- gcc/cp/ChangeLog | 5 ++ gcc/cp/cp-objcp-common.c | 107 +++++++++++++++++++++++---------------- gcc/tree.h | 4 ++ 6 files changed, 84 insertions(+), 45 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f1df76a6a11..6de1565143c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2019-04-30 Nathan Sidwell + + * tree.h (MARK_TS_EXP): New. + 2019-04-30 Martin Liska * opts.c (enable_warning_as_error): Provide hints diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 89758652684..dcbac101f43 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2019-04-30 Nathan Sidwell + + * c-common.c (c_common_init_ts): Use MARK_TS_EXP. Mark SIZEOF_EXPR. + 2019-04-30 Martin Liska * c-pragma.c (handle_pragma_diagnostic): Provide hints diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 99ca1ad3727..3c2f7a9d1c7 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -7907,8 +7907,9 @@ keyword_is_decl_specifier (enum rid keyword) void c_common_init_ts (void) { - MARK_TS_TYPED (C_MAYBE_CONST_EXPR); - MARK_TS_TYPED (EXCESS_PRECISION_EXPR); + MARK_TS_EXP (SIZEOF_EXPR); + MARK_TS_EXP (C_MAYBE_CONST_EXPR); + MARK_TS_EXP (EXCESS_PRECISION_EXPR); } /* Build a user-defined numeric literal out of an integer constant type VALUE diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 56503247233..ec15854d22d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-04-30 Nathan Sidwell + + * cp-objcp-common.c (cp_common_init_ts): Use MARK_TS_EXP for _EXPR + nodes. Call c_common_init_ts. + 2019-04-29 Nathan Sidwell * decl.c (duplicate_decls): Add whitespace, move comments into diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c index 47651040008..bfd3fa6bf8d 100644 --- a/gcc/cp/cp-objcp-common.c +++ b/gcc/cp/cp-objcp-common.c @@ -386,67 +386,88 @@ cp_common_init_ts (void) MARK_TS_COMMON (BOUND_TEMPLATE_TEMPLATE_PARM); MARK_TS_COMMON (UNBOUND_CLASS_TEMPLATE); - MARK_TS_TYPED (EXPR_PACK_EXPANSION); MARK_TS_TYPED (SWITCH_STMT); MARK_TS_TYPED (IF_STMT); MARK_TS_TYPED (FOR_STMT); MARK_TS_TYPED (RANGE_FOR_STMT); - MARK_TS_TYPED (AGGR_INIT_EXPR); - MARK_TS_TYPED (EXPR_STMT); MARK_TS_TYPED (EH_SPEC_BLOCK); MARK_TS_TYPED (CLEANUP_STMT); MARK_TS_TYPED (SCOPE_REF); - MARK_TS_TYPED (CAST_EXPR); - MARK_TS_TYPED (NON_DEPENDENT_EXPR); - MARK_TS_TYPED (MODOP_EXPR); MARK_TS_TYPED (TRY_BLOCK); - MARK_TS_TYPED (THROW_EXPR); MARK_TS_TYPED (HANDLER); - MARK_TS_TYPED (REINTERPRET_CAST_EXPR); - MARK_TS_TYPED (CONST_CAST_EXPR); - MARK_TS_TYPED (STATIC_CAST_EXPR); - MARK_TS_TYPED (DYNAMIC_CAST_EXPR); - MARK_TS_TYPED (IMPLICIT_CONV_EXPR); - MARK_TS_TYPED (TEMPLATE_ID_EXPR); - MARK_TS_TYPED (ARROW_EXPR); - MARK_TS_TYPED (SIZEOF_EXPR); - MARK_TS_TYPED (ALIGNOF_EXPR); - MARK_TS_TYPED (AT_ENCODE_EXPR); - MARK_TS_TYPED (UNARY_PLUS_EXPR); - MARK_TS_TYPED (TRAIT_EXPR); MARK_TS_TYPED (TYPE_ARGUMENT_PACK); MARK_TS_TYPED (NOEXCEPT_EXPR); - MARK_TS_TYPED (NONTYPE_ARGUMENT_PACK); MARK_TS_TYPED (WHILE_STMT); - MARK_TS_TYPED (NEW_EXPR); - MARK_TS_TYPED (VEC_NEW_EXPR); MARK_TS_TYPED (BREAK_STMT); - MARK_TS_TYPED (MEMBER_REF); - MARK_TS_TYPED (DOTSTAR_EXPR); MARK_TS_TYPED (DO_STMT); - MARK_TS_TYPED (DELETE_EXPR); - MARK_TS_TYPED (VEC_DELETE_EXPR); MARK_TS_TYPED (CONTINUE_STMT); - MARK_TS_TYPED (TAG_DEFN); - MARK_TS_TYPED (PSEUDO_DTOR_EXPR); - MARK_TS_TYPED (TYPEID_EXPR); - MARK_TS_TYPED (MUST_NOT_THROW_EXPR); - MARK_TS_TYPED (STMT_EXPR); - MARK_TS_TYPED (OFFSET_REF); - MARK_TS_TYPED (OFFSETOF_EXPR); - MARK_TS_TYPED (ADDRESSOF_EXPR); MARK_TS_TYPED (PTRMEM_CST); - MARK_TS_TYPED (EMPTY_CLASS_EXPR); - MARK_TS_TYPED (VEC_INIT_EXPR); MARK_TS_TYPED (USING_STMT); - MARK_TS_TYPED (LAMBDA_EXPR); - MARK_TS_TYPED (CTOR_INITIALIZER); - MARK_TS_TYPED (REQUIRES_EXPR); - MARK_TS_TYPED (UNARY_LEFT_FOLD_EXPR); - MARK_TS_TYPED (UNARY_RIGHT_FOLD_EXPR); - MARK_TS_TYPED (BINARY_LEFT_FOLD_EXPR); - MARK_TS_TYPED (BINARY_RIGHT_FOLD_EXPR); MARK_TS_TYPED (OMP_DEPOBJ); + + MARK_TS_EXP (AGGR_INIT_EXPR); + MARK_TS_EXP (CTOR_INITIALIZER); + MARK_TS_EXP (EXPR_STMT); + MARK_TS_EXP (TAG_DEFN); + MARK_TS_EXP (EMPTY_CLASS_EXPR); + MARK_TS_EXP (MODOP_EXPR); + MARK_TS_EXP (THROW_EXPR); + MARK_TS_EXP (CAST_EXPR); + MARK_TS_EXP (TYPE_EXPR); + MARK_TS_EXP (REINTERPRET_CAST_EXPR); + MARK_TS_EXP (CONST_CAST_EXPR); + MARK_TS_EXP (STATIC_CAST_EXPR); + MARK_TS_EXP (DYNAMIC_CAST_EXPR); + MARK_TS_EXP (IMPLICIT_CONV_EXPR); + MARK_TS_EXP (TEMPLATE_ID_EXPR); + MARK_TS_EXP (ARROW_EXPR); + MARK_TS_EXP (UNARY_PLUS_EXPR); + MARK_TS_EXP (TRAIT_EXPR); + + MARK_TS_EXP (NON_DEPENDENT_EXPR); + MARK_TS_EXP (NEW_EXPR); + MARK_TS_EXP (VEC_NEW_EXPR); + MARK_TS_EXP (MEMBER_REF); + MARK_TS_EXP (DOTSTAR_EXPR); + MARK_TS_EXP (DELETE_EXPR); + MARK_TS_EXP (VEC_DELETE_EXPR); + MARK_TS_EXP (PSEUDO_DTOR_EXPR); + MARK_TS_EXP (TYPEID_EXPR); + MARK_TS_EXP (MUST_NOT_THROW_EXPR); + MARK_TS_EXP (STMT_EXPR); + MARK_TS_EXP (OFFSET_REF); + MARK_TS_EXP (OFFSETOF_EXPR); + MARK_TS_EXP (ADDRESSOF_EXPR); + MARK_TS_EXP (VEC_INIT_EXPR); + MARK_TS_EXP (LAMBDA_EXPR); + + MARK_TS_EXP (ALIGNOF_EXPR); + MARK_TS_EXP (AT_ENCODE_EXPR); + + MARK_TS_EXP (NONTYPE_ARGUMENT_PACK); + MARK_TS_EXP (EXPR_PACK_EXPANSION); + MARK_TS_EXP (UNARY_LEFT_FOLD_EXPR); + MARK_TS_EXP (UNARY_RIGHT_FOLD_EXPR); + MARK_TS_EXP (BINARY_LEFT_FOLD_EXPR); + MARK_TS_EXP (BINARY_RIGHT_FOLD_EXPR); + + MARK_TS_EXP (REQUIRES_EXPR); + MARK_TS_EXP (SIMPLE_REQ); + MARK_TS_EXP (TYPE_REQ); + MARK_TS_EXP (COMPOUND_REQ); + MARK_TS_EXP (NESTED_REQ); + MARK_TS_EXP (PRED_CONSTR); + MARK_TS_EXP (CHECK_CONSTR); + MARK_TS_EXP (EXPR_CONSTR); + MARK_TS_EXP (TYPE_CONSTR); + MARK_TS_EXP (ICONV_CONSTR); + MARK_TS_EXP (DEDUCT_CONSTR); + MARK_TS_EXP (EXCEPT_CONSTR); + MARK_TS_EXP (PARM_CONSTR); + MARK_TS_EXP (CONJ_CONSTR); + MARK_TS_EXP (DISJ_CONSTR); + + c_common_init_ts (); } #include "gt-cp-cp-objcp-common.h" diff --git a/gcc/tree.h b/gcc/tree.h index f0300824435..d65affea2ee 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -114,6 +114,10 @@ as_internal_fn (combined_fn code) (MARK_TS_DECL_WITH_VIS (C), \ tree_contains_struct[C][TS_DECL_NON_COMMON] = true) +#define MARK_TS_EXP(C) \ + (MARK_TS_TYPED (C), \ + tree_contains_struct[C][TS_EXP] = true) + /* Returns the string representing CLASS. */ #define TREE_CODE_CLASS_STRING(CLASS)\ -- 2.30.2