From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31182 invoked by alias); 16 Nov 2012 19:37:31 -0000 Received: (qmail 31172 invoked by uid 22791); 16 Nov 2012 19:37:31 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,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; Fri, 16 Nov 2012 19:37:25 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAGJbPoL017676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 16 Nov 2012 14:37:25 -0500 Received: from stumpy.slc.redhat.com (ovpn-113-26.phx2.redhat.com [10.3.113.26]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qAGJbNtX017900; Fri, 16 Nov 2012 14:37:24 -0500 Message-ID: <50A695F3.2070904@redhat.com> Date: Fri, 16 Nov 2012 19:37:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: Jakub Jelinek CC: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix dom ICE (PR tree-optimization/55329) References: <20121115201415.GD1886@tucnak.redhat.com> In-Reply-To: <20121115201415.GD1886@tucnak.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg01419.txt.bz2 On 11/15/2012 01:14 PM, Jakub Jelinek wrote: > Hi! > > On the following testcase we ICE, because tree_ssa_dominator_optimize > modifies the bitmap while iterating it. In particular, it contained just > a single bit in it, bitmap_clear_bit turned the bitmap into empty bitmap and > bitmap_set_bit on a lower bit reused the same bitmap_element with lower > index, but higher bit set in it, therefore EXECUTE_IF_SET_IN_BITMAP in next > iteration gave bit above highest basic block. > > Fixed by never clearing any bits from the bitmap while traversing it, > it isn't IMHO a big deal, gimple_purge_all_dead_eh_edges will in a few > insns find out the forwarder block doesn't have any EDGE_EH edges and will > do nothing for it, on the other side to handle even chained forwarder blocks > it loops to find the last one. Insertion of bits looks safe to me, we don't > care if those inserted bits are processed again or not (nothing will be done > for them anymore). > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2012-11-15 Jakub Jelinek > > PR tree-optimization/55329 > * tree-ssa-dom.c (tree_ssa_dominator_optimize): Never clear > bits in needed_eh_cleanup while iterating over the bitmap. > Look through all forwarder blocks at once. > > * g++.dg/opt/pr55329.C: New test. This is fine. I've still got a todo on my list from 2009 to have checking code to detect when a bitmap is changing while we're iterating on it. jeff