From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12730 invoked by alias); 30 Jul 2008 09:23:06 -0000 Received: (qmail 12700 invoked by uid 48); 30 Jul 2008 09:23:05 -0000 Date: Wed, 30 Jul 2008 09:23:00 -0000 Message-ID: <20080730092305.12699.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/36218] [4.2/4.3/4.4 regression] VRP causes stack overflow while building libgcj In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: java-prs@gcc.gnu.org From: "aph at gcc dot gnu dot org" Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2008-q3/txt/msg00012.txt.bz2 ------- Comment #14 from aph at gcc dot gnu dot org 2008-07-30 09:23 ------- This patch limits recursion in tree-vrp. Index: tree-vrp.c =================================================================== --- tree-vrp.c (revision 136670) +++ tree-vrp.c (working copy) @@ -4049,6 +4049,8 @@ the predicate operands, an assert location node is added to the list of assertions for the corresponding operands. */ +static size_t depth; + static bool find_conditional_asserts (basic_block bb, tree last) { @@ -4062,6 +4064,10 @@ need_assert = false; bsi = bsi_for_stmt (last); + depth++; + if (depth > 500) + goto ret; + /* Look for uses of the operands in each of the sub-graphs rooted at BB. We need to check each of the outgoing edges separately, so that we know what kind of ASSERT_EXPR to @@ -4121,6 +4127,8 @@ FOR_EACH_SSA_TREE_OPERAND (op, last, iter, SSA_OP_USE) SET_BIT (found_in_subgraph, SSA_NAME_VERSION (op)); + ret: + depth--; return need_assert; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36218