From ff6994e483be5bd340bfacc50d3441bd21aba1c4 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Sat, 20 Jul 2024 16:07:41 -0700 Subject: Revert "C++: Support clang compatible [[musttail]] (PR83324)" This reverts commit 59dd1d7ab21ad9a7ebf641ec9aeea609c003ad2f. --- gcc/cp/parser.cc | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) (limited to 'gcc/cp/parser.cc') diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 1fa0780..efd5d6f 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -2467,7 +2467,7 @@ static tree cp_parser_perform_range_for_lookup static tree cp_parser_range_for_member_function (tree, tree); static tree cp_parser_jump_statement - (cp_parser *, tree &); + (cp_parser *); static void cp_parser_declaration_statement (cp_parser *); @@ -12757,7 +12757,7 @@ cp_parser_statement (cp_parser* parser, tree in_statement_expr, case RID_CO_RETURN: case RID_GOTO: std_attrs = process_stmt_hotness_attribute (std_attrs, attrs_loc); - statement = cp_parser_jump_statement (parser, std_attrs); + statement = cp_parser_jump_statement (parser); break; /* Objective-C++ exception-handling constructs. */ @@ -14845,11 +14845,10 @@ cp_parser_init_statement (cp_parser *parser, tree *decl) jump-statement: goto * expression ; - STD_ATTRS are the statement attributes. They can be modified. Returns the new BREAK_STMT, CONTINUE_STMT, RETURN_EXPR, or GOTO_EXPR. */ static tree -cp_parser_jump_statement (cp_parser* parser, tree &std_attrs) +cp_parser_jump_statement (cp_parser* parser) { tree statement = error_mark_node; cp_token *token; @@ -14926,31 +14925,6 @@ cp_parser_jump_statement (cp_parser* parser, tree &std_attrs) /* If the next token is a `;', then there is no expression. */ expr = NULL_TREE; - - if (keyword == RID_RETURN) - { - bool musttail_p = false; - if (lookup_attribute ("gnu", "musttail", std_attrs)) - { - musttail_p = true; - std_attrs = remove_attribute ("gnu", "musttail", std_attrs); - } - /* Support this for compatibility. */ - if (lookup_attribute ("clang", "musttail", std_attrs)) - { - musttail_p = true; - std_attrs = remove_attribute ("clang", "musttail", std_attrs); - } - - tree ret_expr = expr; - if (ret_expr && TREE_CODE (ret_expr) == TARGET_EXPR) - ret_expr = TARGET_EXPR_INITIAL (ret_expr); - if (ret_expr && TREE_CODE (ret_expr) == AGGR_INIT_EXPR) - AGGR_INIT_EXPR_MUST_TAIL (ret_expr) = musttail_p; - else - set_musttail_on_return (expr, token->location, musttail_p); - } - /* Build the return-statement, check co-return first, since type deduction is not valid there. */ if (keyword == RID_CO_RETURN) -- cgit v1.1