From patchwork Mon Mar 25 21:22:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1064822 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-498410-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jCO5Daxr"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44SnK35jtdz9sP9 for ; Tue, 26 Mar 2019 08:22:15 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=Kl1zBjrk2YlhOZWQ9Ax0gck3gqu7F666h5LUrztb6PlT6WNIPY X2H7pejgkuULgt176VjigJEDKb3kWjIceE1QEqL6f5WjVjlolKUxw/CDbaNC8+iH HZxLX0k87Jr7uYsT6dTwQXqPyZpUPrWm/fW8aB8gavSuGd/bZrmcABuU4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=l1gBWCma/UcqXs6TnhRRJiIv16s=; b=jCO5Daxrk9oThcISyOyy QuzdKDQlyFH/3uVhmVfuKScZDpP+l8cVBly1B10iKlDn1FqcoPPGEGEfZCk3vAva /EEAkS7SQ2TI47Ao4QeT19trGb0c/WH9bIK1Azr7ls5nfxqitlizVfJ2tBr+yAwz jYAjNY5kTgDRy/taz5e2uQc= Received: (qmail 130449 invoked by alias); 25 Mar 2019 21:22:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 129740 invoked by uid 89); 25 Mar 2019 21:22:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=REG_P, reg_p, 269878 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Mar 2019 21:22:05 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8AFAA30821A1 for ; Mon, 25 Mar 2019 21:22:04 +0000 (UTC) Received: from [10.10.120.199] (ovpn-120-199.rdu2.redhat.com [10.10.120.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4282980FEF for ; Mon, 25 Mar 2019 21:22:04 +0000 (UTC) To: "gcc-patches@gcc.gnu.org" From: Vladimir Makarov Subject: One more patch for PR89676 Message-ID: <02bf51a9-532d-8fdc-a2b2-083cee308eb7@redhat.com> Date: Mon, 25 Mar 2019 17:22:02 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 X-IsSubscribed: yes Jeff Law recently found that my latest patch break some existing code compilation (the code is big to make test out of it). Here is the patch to fix it.  The patch was successfully bootstrapped on x86-64.  The patch actually results in less new transformations the previous patch introduced.  So it should be safe. Committed as rev. 269924. Index: ChangeLog =================================================================== --- ChangeLog (revision 269923) +++ ChangeLog (working copy) @@ -1,3 +1,10 @@ +2019-03-25 Vladimir Makarov + + PR rtl-optimization/89676 + * lra-constraints.c (curr_insn_transform): Do match reload for + early clobbers when the match was successful only for different + registers. + 2019-03-25 Martin Sebor * doc/extend.texi (Common Type Attributes): Document vector_size. Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 269878) +++ lra-constraints.c (working copy) @@ -4259,15 +4259,27 @@ curr_insn_transform (bool check_only_p) else if (goal_alt_matched[i][0] != -1 && curr_static_id->operand[i].type == OP_OUT && (curr_static_id->operand_alternative - [goal_alt_number * n_operands + i].earlyclobber)) + [goal_alt_number * n_operands + i].earlyclobber) + && REG_P (op)) { - /* Generate reloads for output and matched inputs. This - is the easiest way to avoid creation of non-existing - conflicts in lra-lives.c. */ - match_reload (i, goal_alt_matched[i], outputs, goal_alt[i], &before, - &after, TRUE); - outputs[n_outputs++] = i; - outputs[n_outputs] = -1; + for (j = 0; goal_alt_matched[i][j] != -1; j++) + { + rtx op2 = *curr_id->operand_loc[goal_alt_matched[i][j]]; + + if (REG_P (op2) && REGNO (op) != REGNO (op2)) + break; + } + if (goal_alt_matched[i][j] != -1) + { + /* Generate reloads for different output and matched + input registers. This is the easiest way to avoid + creation of non-existing register conflicts in + lra-lives.c. */ + match_reload (i, goal_alt_matched[i], outputs, goal_alt[i], &before, + &after, TRUE); + outputs[n_outputs++] = i; + outputs[n_outputs] = -1; + } continue; } else