From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 276F33988889; Tue, 11 May 2021 13:59:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 276F33988889 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-720] More maybe_fold_reference TLC X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: 7862a1922d33f0fb926bba18e807bc591feb9498 X-Git-Newrev: dfdedc1a753ebaa68381638dd8a2bcd84de5ec9e Message-Id: <20210511135939.276F33988889@sourceware.org> Date: Tue, 11 May 2021 13:59:39 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 May 2021 13:59:39 -0000 https://gcc.gnu.org/g:dfdedc1a753ebaa68381638dd8a2bcd84de5ec9e commit r12-720-gdfdedc1a753ebaa68381638dd8a2bcd84de5ec9e Author: Richard Biener Date: Tue May 11 14:49:07 2021 +0200 More maybe_fold_reference TLC This removes stale users of maybe_fold_reference where IL constraints make it never do anything. 2021-05-11 Richard Biener * gimple-fold.c (gimple_fold_call): Do not call maybe_fold_reference on call arguments or the static chain. (fold_stmt_1): Do not call maybe_fold_reference on GIMPLE_ASM inputs. Diff: --- gcc/gimple-fold.c | 59 ------------------------------------------------------- 1 file changed, 59 deletions(-) diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 74ec36e3a78..68717cf1542 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -5447,19 +5447,6 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace) gcall *stmt = as_a (gsi_stmt (*gsi)); tree callee; bool changed = false; - unsigned i; - - /* Fold *& in call arguments. */ - for (i = 0; i < gimple_call_num_args (stmt); ++i) - if (REFERENCE_CLASS_P (gimple_call_arg (stmt, i))) - { - tree tmp = maybe_fold_reference (gimple_call_arg (stmt, i)); - if (tmp) - { - gimple_call_set_arg (stmt, i, tmp); - changed = true; - } - } /* Check for virtual calls that became direct calls. */ callee = gimple_call_fn (stmt); @@ -5562,15 +5549,6 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace) gimple_call_set_chain (stmt, NULL); changed = true; } - else - { - tree tmp = maybe_fold_reference (gimple_call_chain (stmt)); - if (tmp) - { - gimple_call_set_chain (stmt, tmp); - changed = true; - } - } } if (inplace) @@ -6285,43 +6263,6 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, bool inplace, tree (*valueize) (tree)) changed |= gimple_fold_call (gsi, inplace); break; - case GIMPLE_ASM: - /* Fold *& in asm operands. */ - { - gasm *asm_stmt = as_a (stmt); - size_t noutputs; - const char **oconstraints; - const char *constraint; - bool allows_mem, allows_reg; - - noutputs = gimple_asm_noutputs (asm_stmt); - oconstraints = XALLOCAVEC (const char *, noutputs); - - for (i = 0; i < noutputs; ++i) - { - tree link = gimple_asm_output_op (asm_stmt, i); - oconstraints[i] - = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link))); - } - for (i = 0; i < gimple_asm_ninputs (asm_stmt); ++i) - { - tree link = gimple_asm_input_op (asm_stmt, i); - tree op = TREE_VALUE (link); - constraint - = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link))); - parse_input_constraint (&constraint, 0, 0, noutputs, 0, - oconstraints, &allows_mem, &allows_reg); - if (REFERENCE_CLASS_P (op) - && (allows_reg || !allows_mem) - && (op = maybe_fold_reference (op)) != NULL_TREE) - { - TREE_VALUE (link) = op; - changed = true; - } - } - } - break; - case GIMPLE_DEBUG: if (gimple_debug_bind_p (stmt)) {