From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25007 invoked by alias); 26 Jun 2009 16:36:16 -0000 Received: (qmail 24998 invoked by uid 22791); 26 Jun 2009 16:36:15 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from us01smtp3.synopsys.com (HELO hermes.synopsys.com) (198.182.44.81) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Jun 2009 16:36:09 +0000 Received: from crone.synopsys.com (crone.synopsys.com [146.225.7.23]) by hermes.synopsys.com (Postfix) with ESMTP id A24E72C95C; Fri, 26 Jun 2009 09:36:07 -0700 (PDT) Received: from venkatar-opt-lnx.internal.synopsys.com (localhost [127.0.0.1]) by crone.synopsys.com (8.9.1/8.9.1) with ESMTP id JAA28884; Fri, 26 Jun 2009 09:36:07 -0700 (PDT) Received: from venkatar-opt-lnx.internal.synopsys.com (localhost.localdomain [127.0.0.1]) by venkatar-opt-lnx.internal.synopsys.com (8.13.1/8.12.3) with ESMTP id n5QGa6Gp013331; Fri, 26 Jun 2009 09:36:06 -0700 Received: (from jbuck@localhost) by venkatar-opt-lnx.internal.synopsys.com (8.13.1/8.13.1/Submit) id n5QGa0AX013330; Fri, 26 Jun 2009 09:36:00 -0700 Date: Fri, 26 Jun 2009 16:51:00 -0000 From: Joe Buck To: Alexander Monakov Cc: Jeff Law , Richard Guenther , GCC Subject: Re: (known?) Issue with bitmap iterators Message-ID: <20090626163559.GM14794@synopsys.com> References: <4A3CF81C.7050406@redhat.com> <84fc9c000906200801v28f814cj3fa5327c5f3df35e@mail.gmail.com> <4A3FBA1E.6040502@redhat.com> <20090622174623.GA6603@synopsys.com> <4A43C0F3.30503@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00613.txt.bz2 On Fri, Jun 26, 2009 at 03:38:31AM -0700, Alexander Monakov wrote: > 1. Add bool field `modified_p' in bitmap structure. > 2. Make iterator setup functions (e.g. bmp_iter_set_init) reset it to > false. > 3. Make functions that modify the bitmap set it to true. > 4. Make iterator increment function (e.g. bmp_iter_next) assert > !modified_p. Sorry, it doesn't work. Function foo has a loop that iterates over a bitmap. During the iteration, it calls a function bar. bar modifies the bitmap, then iterates over the bitmap. It then returns to foo, which is in the middle of an iteration, which it continues. The bitmap has been modified (by bar), but modified_p was reset to false by the iteration that happened at the end of bar.