From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12071 invoked by alias); 29 Nov 2012 08:34:36 -0000 Received: (qmail 11928 invoked by uid 22791); 29 Nov 2012 08:34:36 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ob0-f175.google.com (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 08:34:32 +0000 Received: by mail-ob0-f175.google.com with SMTP id vb8so13304715obc.20 for ; Thu, 29 Nov 2012 00:34:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.12.40 with SMTP id v8mr7148621obb.12.1354178071244; Thu, 29 Nov 2012 00:34:31 -0800 (PST) Received: by 10.76.95.202 with HTTP; Thu, 29 Nov 2012 00:34:31 -0800 (PST) In-Reply-To: <20121128182457.GB26585@redhat.com> References: <20121126142843.GH17362@redhat.com> <1544820.Re9E01eJrW@polaris> <20121128182457.GB26585@redhat.com> Date: Thu, 29 Nov 2012 08:34:00 -0000 Message-ID: Subject: Re: [PATCH] Don't bypass blocks with multiple latch edges (PR middle-end/54838) From: Richard Biener To: Marek Polacek Cc: Eric Botcazou , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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/msg02391.txt.bz2 On Wed, Nov 28, 2012 at 7:24 PM, Marek Polacek wrote: > 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: Definitely not - that means to not preserve loops until after cprop. The goal is to preserve loops everywhere! Richard. > --- 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