This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/68520] [6 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in quick_push, at vec.h:845
- From: "segher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Nov 2015 21:23:57 +0000
- Subject: [Bug rtl-optimization/68520] [6 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in quick_push, at vec.h:845
- Auto-submitted: auto-generated
- References: <bug-68520-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68520
--- Comment #4 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Author: segher
Date: Tue Nov 24 21:23:25 2015
New Revision: 230843
URL: https://gcc.gnu.org/viewcvs?rev=230843&root=gcc&view=rev
Log:
shrink-wrap: Fix thinko (PR68520)
Part of the shrink-wrapping algorithm has this comment:
/* Now see if we can put the prologue at the start of PRO. Putting it
there might require duplicating a block that cannot be duplicated,
or in some cases we cannot insert the prologue there at all. If PRO
wont't do, try again with the immediate dominator of PRO, and so on.
The blocks that need duplicating are those reachable from PRO but
not dominated by it. We keep in BB_WITH a bitmap of the blocks
reachable from PRO that we already found, and in VEC a stack of
those we still need to consider (to find successors). */
Two of the cases that push to that stack do not actually check the
bitmap first. Either I thought those blocks could not be on the stack
already, or more likely I didn't think and it just didn't crash during
any testing. But of course those blocks *can* already be on the stack
(if you have a hideous loop structure), and then we end up with the
same block on the stack more than once. This is harmless, except that
(like in the PR) this can overflow the stack.
This fixes it, by doing the necessary bitmap checks before pushing.
PR rtl-optimization/68520
* shrink-wrap.c (try_shrink_wrapping): Don't push a block to VEC if
its bit was already set in BB_WITH.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/shrink-wrap.c