From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24122 invoked by alias); 28 Nov 2012 18:39:46 -0000 Received: (qmail 23992 invoked by uid 22791); 28 Nov 2012 18:39:44 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Nov 2012 18:39:40 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qASIP1Bl013193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Nov 2012 13:25:01 -0500 Received: from redhat.com (ovpn-116-24.ams2.redhat.com [10.36.116.24]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qASIOvQQ014435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 28 Nov 2012 13:25:00 -0500 Date: Wed, 28 Nov 2012 18:39:00 -0000 From: Marek Polacek To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Don't bypass blocks with multiple latch edges (PR middle-end/54838) Message-ID: <20121128182457.GB26585@redhat.com> References: <20121126142843.GH17362@redhat.com> <1544820.Re9E01eJrW@polaris> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1544820.Re9E01eJrW@polaris> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg02358.txt.bz2 On Wed, Nov 28, 2012 at 10:52:17AM +0100, Eric Botcazou wrote: > No, I don't think that's the problem. The above messages are admittedly a bit > terse, they should say: > > JUMP-BYPASS: Proved reg 59 in jump_insn 15 equals constant (const_int 3 [0x3]) > when BB 4 is entered from BB 9. Redirect edge 9->4 to 5. > > so you can have different constants for BB 3 and BB 9. The patch to tweak the > dump messages along these lines is pre-approved. Ouch. Okay, I'll post a separate patch for improving the message. > The ICE in merge_latch_edges means that the loop structure and the CFG aren't > in sync anymore. Does the cprop pass modify the former without declaring it? I admit I'm not sure what to look at, maybe cprop should have in properties_destroyed PROP_loops? Well, then we need to remove one assert in loop-init.c. So something like: --- gcc/cprop.c.mp 2012-11-28 16:55:03.520375191 +0100 +++ gcc/cprop.c 2012-11-28 16:55:35.992246623 +0100 @@ -1927,7 +1927,7 @@ struct rtl_opt_pass pass_rtl_cprop = TV_CPROP, /* tv_id */ PROP_cfglayout, /* properties_required */ 0, /* properties_provided */ - 0, /* properties_destroyed */ + PROP_loops, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | TODO_verify_flow | TODO_ggc_collect /* todo_flags_finish */ --- gcc/loop-init.c.mp 2012-11-28 16:55:08.924398879 +0100 +++ gcc/loop-init.c 2012-11-28 16:55:17.684437276 +0100 @@ -54,8 +54,6 @@ loop_optimizer_init (unsigned flags) } else { - gcc_assert (cfun->curr_properties & PROP_loops); - /* Ensure that the dominators are computed, like flow_loops_find does. */ calculate_dominance_info (CDI_DOMINATORS); This quashes the ICE. I've regtested it, it caused one regression though: FAIL: gcc.dg/unroll_5.c scan-rtl-dump-times loop2_unroll "realistic bound: 2999999" 1 But there probably is something else. Thanks for the review, Marek