This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/47290] [4.5/4.6 Regression] memory exhausted compiling a destructor with an infinite 'for (;;);' loop
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 18 Jan 2011 13:40:09 +0000
- Subject: [Bug tree-optimization/47290] [4.5/4.6 Regression] memory exhausted compiling a destructor with an infinite 'for (;;);' loop
- Auto-submitted: auto-generated
- References: <bug-47290-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47290
--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 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.