From patchwork Tue Dec 10 20:40:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1207274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515645-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="n4+b6T1i"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="fWVJ+16v"; 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 47XX5d27Bgz9sPK for ; Wed, 11 Dec 2019 07:41:07 +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:content-transfer-encoding; q=dns; s=default; b=o3A zOGt9tuNr7XLWE0vx4TfltdobulHol2sInvi0gZNw1Sous5qfZvarq8MkXD5VtAn I/67+mWXBqROA8GWLCDzi5kBQUgB+oJVfjUuwewz0SRrrSBhe4Co9yDcOB+GdOl3 qgFVujQxutItqlcFirTlFxes/fPudJm6aAg+sKTE= 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:content-transfer-encoding; s=default; bh=3j9hyee0i pruwwz5hgIPXRY0G5U=; b=n4+b6T1imXmX966e/GP5SiWWOCXb/dv2N0EJvzL74 eyDBYujVYNccINRux2zXTZu6Hza2nJz9TeOWFR8hpg+oGQJ2F9QzrTSIbPdqh9pe Aj9hvnjyKPkddji00oZ2rWGcW4y5R8eHo/sR5h7AV3JZuzxs0C2BHHodh3APcQhV 3k= Received: (qmail 106760 invoked by alias); 10 Dec 2019 20:41:00 -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 106751 invoked by uid 89); 10 Dec 2019 20:41:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Dec 2019 20:40:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576010457; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dvlt/e7ieQu4jilCW4XDsnRSLJEITry4gOTH2Hh35Ac=; b=fWVJ+16vJUOjtR2fBmZfsEZPAopSxCtjXecwKe1SENIOTvzDDH4A3ZXSYbT6NsWEoqe2Hm kIkn5XeAvZcabfN4v/g1ZdoohiYJReEptMv1Cjjuvsadc4qNrUjdwPu4FhidjXmAPHhYGj y0SxwDt3bYJe/QZCmOmPn3v6QIv2ahY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-231-iYd4VpqzOMGQWidHgMn3_w-1; Tue, 10 Dec 2019 15:40:55 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F11C1005502; Tue, 10 Dec 2019 20:40:54 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-59.ams2.redhat.com [10.36.117.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9CAC66362E; Tue, 10 Dec 2019 20:40:49 +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 xBAKelbr007150; Tue, 10 Dec 2019 21:40:47 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id xBAKejPd007149; Tue, 10 Dec 2019 21:40:45 +0100 Date: Tue, 10 Dec 2019 21:40:45 +0100 From: Jakub Jelinek To: Jeff Law , Richard Biener , Eric Botcazou Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix ICE in regstat_bb_compute_calls_crossed (PR rtl-optimization/92882) Message-ID: <20191210204045.GE10088@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 User-Agent: Mutt/1.11.3 (2019-02-01) X-Mimecast-Spam-Score: 0 Content-Disposition: inline X-IsSubscribed: yes Hi! The following testcase ICEs on the newly added asserts. Some comments hint that maybe it is fine if CODE_LABEL additions don't trigger df recomputations, but even if it is not ok, regstat_bb_compute_calls_crossed doesn't look like an IL verification routine and for !NONDEBUG_INSN_P it really doesn't need DF_INSN_INFO_GET for anything, so I think it is best not to get it. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2019-12-10 Jakub Jelinek PR rtl-optimization/92882 * regstat.c (regstat_bb_compute_calls_crossed): Don't check INSN_UID against DF_INSN_SIZE or use DF_INSN_INFO_GET unless NONDEBUG_INSN_P. * gfortran.dg/pr92882.f: New test. Jakub --- gcc/regstat.c.jj 2019-12-09 15:02:30.112287863 +0100 +++ gcc/regstat.c 2019-12-10 13:36:23.231327649 +0100 @@ -324,13 +324,13 @@ regstat_bb_compute_calls_crossed (unsign FOR_BB_INSNS_REVERSE (bb, insn) { + if (!NONDEBUG_INSN_P (insn)) + continue; + gcc_assert (INSN_UID (insn) < (int) DF_INSN_SIZE ()); struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn); unsigned int regno; - if (!NONDEBUG_INSN_P (insn)) - continue; - /* Process the defs. */ if (CALL_P (insn)) { --- gcc/testsuite/gfortran.dg/pr92882.f.jj 2019-12-10 13:38:17.737571868 +0100 +++ gcc/testsuite/gfortran.dg/pr92882.f 2019-12-10 13:38:07.453729553 +0100 @@ -0,0 +1,4 @@ +C PR rtl-optimization/92882 +C { dg-do compile } +C { dg-options "-O2 -fno-inline" } + INCLUDE 'secnds.f'