From patchwork Tue Feb 21 16:49:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 730691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3vSRL13W7jz9s2Q for ; Wed, 22 Feb 2017 03:49:29 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="fBPAJGpC"; dkim-atps=neutral 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=ibvAzf617tWbWmS5ooGBdYtaNzNoT TQqahRNMia/mlQFLA7Z2gS3DZ8E+veR6ocypk1s0SBBdiN7bV9/AHzHck+mVD53p BojcQSIlcIuzGYVoH1g1kxPyDsO7ZR/UFLCvvHohdOqZx7k6vRCRgTtSlFmwiW2M s0Tw8drjNEOlKs= 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=1gtlZdslkri2TlVi1IAeVQpQDB0=; b=fBP AJGpCe58YXxQViw3vbo9pT7Y3eyrThh5+wqKzEQYVPhMAKlrU2aJrt5GmR33I6Qi zWLzxJMMM88QDMGBpDfeYPj4ESeES3AJ88E6fVqiIvlRwb4rpXsxhhFF1N9sEMuW a+Gx7ArYdCxzCPKoYhEUGTRAR6WD7x3oALzNfdJ8= Received: (qmail 98232 invoked by alias); 21 Feb 2017 16:49:18 -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 98205 invoked by uid 89); 21 Feb 2017 16:49:17 -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, RP_MATCHES_RCVD, SPF_HELO_PASS 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; Tue, 21 Feb 2017 16:49:16 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 857C161D08; Tue, 21 Feb 2017 16:49:16 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-76.ams2.redhat.com [10.36.117.76]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LGnEsQ001214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Feb 2017 11:49:15 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v1LGnC2Q017206; Tue, 21 Feb 2017 17:49:12 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v1LGnA8L017205; Tue, 21 Feb 2017 17:49:10 +0100 Date: Tue, 21 Feb 2017 17:49:10 +0100 From: Jakub Jelinek To: Alexander Monakov , Vladimir Makarov , Alexandre Oliva Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix ICE with selective scheduling and VTA (PR target/79570) Message-ID: <20170221164910.GV1849@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes Hi! We ICE in the following hunk which has been added by Alexandre back in VTA merge. A fairly recent change started clearing BLOCK_FOR_INSN for instructions that are temporarily removed from the IL (but those would never previously satisfy the condition - they would never be heads of their block). While it isn't well understood why the condition is in there, the patch pretty much restores the previous behavior for such DEBUG_INSNs. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2017-02-21 Jakub Jelinek PR target/79570 * sel-sched.c (moveup_expr_cached): Don't call sel_bb_head on temporarily removed DEBUG_INSNs. * gcc.dg/pr79570.c: New test. Jakub --- gcc/sel-sched.c.jj 2017-01-01 12:45:38.000000000 +0100 +++ gcc/sel-sched.c 2017-02-17 14:14:06.493525368 +0100 @@ -2529,6 +2529,7 @@ moveup_expr_cached (expr_t expr, insn_t } if (DEBUG_INSN_P (EXPR_INSN_RTX (expr)) + && BLOCK_FOR_INSN (EXPR_INSN_RTX (expr)) && (sel_bb_head (BLOCK_FOR_INSN (EXPR_INSN_RTX (expr))) == EXPR_INSN_RTX (expr))) /* Don't use cached information for debug insns that are heads of --- gcc/testsuite/gcc.dg/pr79570.c.jj 2017-02-17 14:37:15.183672738 +0100 +++ gcc/testsuite/gcc.dg/pr79570.c 2017-02-17 14:37:10.306738336 +0100 @@ -0,0 +1,6 @@ +/* PR target/79570 */ +/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O2 -fselective-scheduling2 -fvar-tracking-assignments" } */ +/* { dg-warning "changes selective scheduling" "" { target *-*-* } 0 } */ + +#include "pr69956.c"