From patchwork Thu Aug 3 08:46:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 797083 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-459705-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="hoZA/f3u"; 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 3xNNw54dyfz9s7g for ; Thu, 3 Aug 2017 18:47:01 +1000 (AEST) 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=tUVlyjwvT3UgWrBauRo8j8z90HrRW 6ldboJVVR4MBTwmu4NbvIxJnMnvw2NdTFVsgVRb5RQWnLGoDUW4SuT9CVsBKJmT4 ya5p2pWF+aXUGuEvS5kXmbfwQe7E5yXJWWshwJWBEhtDRLWELEutLCo/otx+/5TS BgQApW/pRWQs5Y= 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=VGuOS1BCg9WtkAWIpJz0199KIFI=; b=hoZ A/f3uJUOvu20Vpyr2oW+RRKiX4tiiJPob4XPPB+Lt/aSwFPoxM7onLIFG464qL/j 8X+ue9gMAdc112JgCMR7ZlK5apN9MQVfFSgqSIii6pidMSgGHX6y6vf79lZvBEUD o0UdtRhvZzUmX2gzbFH0P5V1EYtr08zLbJJghjGE= Received: (qmail 41641 invoked by alias); 3 Aug 2017 08:46:52 -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 41629 invoked by uid 89); 3 Aug 2017 08:46:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, 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; Thu, 03 Aug 2017 08:46:51 +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 B0F1D37E67; Thu, 3 Aug 2017 08:46:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B0F1D37E67 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub@redhat.com Received: from tucnak.zalov.cz (ovpn-116-40.ams2.redhat.com [10.36.116.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A42AB7C75C; Thu, 3 Aug 2017 08:46:48 +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 v738kk09020969; Thu, 3 Aug 2017 10:46:46 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v738kjQ7020968; Thu, 3 Aug 2017 10:46:45 +0200 Date: Thu, 3 Aug 2017 10:46:45 +0200 From: Jakub Jelinek To: Richard Biener , Jeff Law Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix df-related ICE due to bbpart pass bug (PR target/81621) Message-ID: <20170803084645.GT2123@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! The following testcase ICEs on s390x. The problem is that the bbpart pass calls df_set_flags (DF_DEFER_INSN_RESCAN); because it wants to defer rescanning, but doesn't actually df_finish_pass (it does in one case, but then calls df_set_flags with another changeable flag, so it has the same issue), and if the IRA pass is invoked soon after it without any df_finish_pass calls in between, we end up with deferred insn rescanning during IRA which heavily relies on immediate insn rescanning. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2017-08-03 Jakub Jelinek PR target/81621 * bb-reorder.c (pass_partition_blocks::execute): Return TODO_df_finish after setting changeable df flags. * gcc.dg/pr81621.c: New test. Jakub --- gcc/bb-reorder.c.jj 2017-07-21 10:28:13.000000000 +0200 +++ gcc/bb-reorder.c 2017-08-02 19:43:58.797243254 +0200 @@ -2904,7 +2904,7 @@ pass_partition_blocks::execute (function crossing_edges = find_rarely_executed_basic_blocks_and_crossing_edges (); if (!crossing_edges.exists ()) - return 0; + return TODO_df_finish; crtl->has_bb_partition = true; @@ -2970,7 +2970,7 @@ pass_partition_blocks::execute (function df_analyze (); } - return 0; + return TODO_df_finish; } } // anon namespace --- gcc/testsuite/gcc.dg/pr81621.c.jj 2017-08-02 19:52:08.435831121 +0200 +++ gcc/testsuite/gcc.dg/pr81621.c 2017-08-02 19:52:00.026924067 +0200 @@ -0,0 +1,5 @@ +/* PR target/81621 */ +/* { dg-do compile { target freorder } } */ +/* { dg-options "-Og -fno-split-wide-types -freorder-blocks-and-partition" } */ + +#include "graphite/scop-10.c"