From patchwork Mon Jan 15 21:55:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 861088 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-471309-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="mYb78Qb2"; 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 3zL6bW1v1Jz9sNV for ; Tue, 16 Jan 2018 08:55:19 +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:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=YArhkJQdHSmlBesp1fxVibNm2vhwt Z0Wx0fO7TDBLZSvx5JcyXopwYoogHPWTzPbK1Co/BNf00T7u0oTO7NIHtNOv0VUM +GxU05cCTQxgcvsZarzid+38RGOL//NY5Oga8wd/mlXlkdJEh0H4T7UBb2iQYIAy PZDxIinhT1GjTc= 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:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=gyDpEHCvxYSjTVTdycNrRdhiklw=; b=mYb 78Qb2qweQFPWY3HQa6JLOKlVzsbekPn1g3EgUIXPOmBzs67DzAMRJlFDPFe5qXCD pWc5PbMkoGJISeB6Zhv5iwGh1KR02hXY6K5DTXKsQjxMPtfYtPdkv3k6cD4o9MuH AupqGhYQY6HmT3wW7MpY0Dg2TXQQxcqNzkeKBvnY= Received: (qmail 31183 invoked by alias); 15 Jan 2018 21:55:11 -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 31168 invoked by uid 89); 15 Jan 2018 21:55:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= 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, 15 Jan 2018 21:55:10 +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 0E74E1E2D4; Mon, 15 Jan 2018 21:55:09 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-22.ams2.redhat.com [10.36.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 902075D962; Mon, 15 Jan 2018 21:55:08 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w0FLt66q013672; Mon, 15 Jan 2018 22:55:06 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w0FLt4vK013671; Mon, 15 Jan 2018 22:55:04 +0100 Date: Mon, 15 Jan 2018 22:55:04 +0100 From: Jakub Jelinek To: Richard Biener , Jeff Law , Eric Botcazou Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Preserve CROSSING_JUMP_P in peephole2 (PR rtl-optimization/83213) Message-ID: <20180115215504.GE2063@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) X-IsSubscribed: yes Hi! On the testcase in the PR (too large and creduce not making sufficient progress) we ICE because i386.md: ;; Combining simple memory jump instruction (define_peephole2 [(set (match_operand:W 0 "register_operand") (match_operand:W 1 "memory_operand")) (set (pc) (match_dup 0))] "!TARGET_X32 && !ix86_indirect_branch_thunk_register && peep2_reg_dead_p (2, operands[0])" [(set (pc) (match_dup 1))]) peephole2 triggers on a CROSSING_JUMP_P jump, but nothing actually copies that bit over from the old to the new JUMP_INSN. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2018-01-15 Jakub Jelinek PR rtl-optimization/83213 * recog.c (peep2_attempt): Copy over CROSSING_JUMP_P from peepinsn to last if both are JUMP_INSNs. Jakub --- gcc/recog.c.jj 2018-01-09 08:58:14.594002069 +0100 +++ gcc/recog.c 2018-01-15 16:37:13.279196178 +0100 @@ -3446,6 +3446,8 @@ peep2_attempt (basic_block bb, rtx_insn last = emit_insn_after_setloc (attempt, peep2_insn_data[i].insn, INSN_LOCATION (peepinsn)); + if (JUMP_P (peepinsn) && JUMP_P (last)) + CROSSING_JUMP_P (last) = CROSSING_JUMP_P (peepinsn); before_try = PREV_INSN (insn); delete_insn_chain (insn, peep2_insn_data[i].insn, false);