From patchwork Tue Mar 7 09:42:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 736098 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 3vcsC74Gzyz9s0g for ; Tue, 7 Mar 2017 20:42:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="fDvoaml/"; 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:in-reply-to:message-id:references :mime-version:content-type; q=dns; s=default; b=dVdjX7B6kof9h92Y QQSqUQUQ4SGC9SYM4Zk+WQE0wbwa29UtWGgqH9v+ajn4ruzDCL8fMyDgDxL9yvmp bnJQaws9RQXmuicPAvXWoS33RnkBn4DdaIVRmxLSD7yHXTjcQSeUdNckOSgKpXvv g55WP2qJ9seb8/qaCF/Wl7ugXv0= 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:in-reply-to:message-id:references :mime-version:content-type; s=default; bh=fvd0uGj6pZQ+ibVUKm3NQx gUiBA=; b=fDvoaml/x23ekMUiyAyRD4ADf+gNVfbkk6vZtvTEhHTVOXdE1AUgjE 2vACM2DtXB1mq59bxsWqHwCY98IXQ6YgxXcugUuuFfiY81HR7PzAW6X/JIwpEpRt qizKqH8cCKNL776tLAj7NpWBcXwB1MWid9zJ35jTDZcv3gbC4JL2I= Received: (qmail 5400 invoked by alias); 7 Mar 2017 09:42: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 5313 invoked by uid 89); 7 Mar 2017 09:42:10 -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_PASS autolearn=ham version=3.3.2 spammy=rightfully X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Mar 2017 09:42:09 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 63CEFAD79; Tue, 7 Mar 2017 09:42:07 +0000 (UTC) Date: Tue, 7 Mar 2017 10:42:07 +0100 (CET) From: Richard Biener To: Christophe Lyon cc: "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH] Fix PR79887 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 On Tue, 7 Mar 2017, Christophe Lyon wrote: > Hi Richard, > > > On 6 March 2017 at 13:05, Richard Biener wrote: > > > > This fixes a crash when we try to re-use a folded loop_vectorized_call > > when vectorizing an epilogue. > > > > Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. > > > > Richard. > > > > 2017-03-06 Richard Biener > > > > PR tree-optimization/79894 > > * tree-vectorizer.c (vectorize_loops): Set loop_vectorized_call > > to NULL after folding it. > > > > * gcc.dg/vect/pr79887.c: New testcase. > > > > The new testcase causes an ICE on arm-* targets. > > The backtrace is as follows: > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/vect/pr79887.c: > In function 'foo': > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/vect/pr79887.c:8:1: > error: control flow in the middle of basic block 10 > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/vect/pr79887.c:8:1: > error: wrong outgoing edge flags at end of bb 10 > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/vect/pr79887.c:8:1: > internal compiler error: verify_flow_info failed > 0x6b0205 verify_flow_info() > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/cfghooks.c:260 > 0xb9a794 checking_verify_flow_info > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/cfghooks.h:198 > 0xb9a794 cleanup_tree_cfg_noloop > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/tree-cfgcleanup.c:774 > 0xb9a794 cleanup_tree_cfg() > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/tree-cfgcleanup.c:820 > 0xa5af54 execute_function_todo > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/passes.c:1919 > 0xa5aca5 execute_todo > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/passes.c:2016 Thanks for reporting - prologue vectorization seems to hit a latent bug where the vectorizer (rightfully) assumes pre-headers but does not maintain them. Bootstrap / regtest in progress on x86_64-unknown-linux-gnu. Richard. 2017-03-07 Richard Biener * tree-vect-loop-manip.c (slpeel_add_loop_guard): Preserve preheaders. Index: gcc/tree-vect-loop-manip.c =================================================================== --- gcc/tree-vect-loop-manip.c (revision 245947) +++ gcc/tree-vect-loop-manip.c (working copy) @@ -569,6 +569,11 @@ slpeel_add_loop_guard (basic_block guard enter_e->count -= new_e->count; enter_e->probability = inverse_probability (probability); set_immediate_dominator (CDI_DOMINATORS, guard_to, dom_bb); + + /* Split enter_e to preserve LOOPS_HAVE_PREHEADERS. */ + if (enter_e->dest->loop_father->header == enter_e->dest) + split_edge (enter_e); + return new_e; }