From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23178 invoked by alias); 18 Jan 2011 13:40:16 -0000 Received: (qmail 23095 invoked by uid 22791); 18 Jan 2011 13:40:15 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Jan 2011 13:40:10 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/47290] [4.5/4.6 Regression] memory exhausted compiling a destructor with an infinite 'for (;;);' loop X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: memory-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.5.3 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 18 Jan 2011 13:47:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg01780.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47290 --- Comment #8 from Richard Guenther 2011-01-18 13:39:47 UTC --- (In reply to comment #7) > We could also limit the number of iterations: > int i; > > - for (i = 1; VEC_iterate (eh_landing_pad, cfun->eh->lp_array, i, lp); ++i) > + int len = VEC_length (eh_landing_pad, cfun->eh->lp_array) * 2; > + for (i = 1; > + VEC_iterate (eh_landing_pad, cfun->eh->lp_array, i, lp) && i < len; > + i++) > if (lp) > changed |= cleanup_empty_eh (lp); won't it still say "changed" and iterate in the caller? Note that we could avoid the above if we'd avoid generating new landing-pads and instead moved the old ones.