Bootstrapping with BOOT_CFLAGS="-Os -g" fails when the stage2 cc1 is used to build crtstuff.o. The segmentation fault occurs in find_uses_to_rename_use but the error really seems to be in its caller find_uses_to_rename_bb (tree-ssa-loop-manip.c). Looking at the tree dumps we have in t49.loopinit <L8>:; stmt_35 = bsi_stmt (bsi); get_stmt_operands (stmt_35); var_38 = op_iter_init_tree (&iter, stmt_35, 13); goto <bb 9> (<L10>); <L9>:; var_45 = op_iter_next_tree (&iter); <L10>:; D.17355_41 = iter.done; D.17353_42 = (int) D.17355_41; D.17347_44 = (unsigned char) D.17353_42; if (D.17347_44 == 0) goto <L9>; else goto <L12>; but in t50.lim we have: <L8>:; stmt_35 = bsi_stmt (bsi); get_stmt_operands (stmt_35); var_38 = op_iter_init_tree (&iter, stmt_35, 13); lsm_tmp.500_356 = iter.done; goto <bb 9> (<L10>); <L9>:; var_45 = op_iter_next_tree (&iter); <L10>:; D.17355_41 = lsm_tmp.500_356; D.17353_42 = (int) D.17355_41; D.17347_44 = (unsigned char) D.17353_42; if (D.17347_44 == 0) goto <L9>; else goto <L18>; <L18>:; iter.done = lsm_tmp.500_356; note that the use of iter.done has been hoisted out of the loop even though the call of op_iter_next_tree passes the address of iter.
*** Bug 20543 has been marked as a duplicate of this bug. ***
Subject: Re: New: [4.1 Regression] Bootstrap failure at -Os On Fri, 2005-03-18 at 21:21 +0000, rearnsha at gcc dot gnu dot org wrote: > Bootstrapping with BOOT_CFLAGS="-Os -g" fails when the stage2 cc1 is used to > build crtstuff.o. The segmentation fault occurs in find_uses_to_rename_use but > the error really seems to be in its caller find_uses_to_rename_bb > (tree-ssa-loop-manip.c). Looking at the tree dumps we have in t49.loopinit > > <L8>:; > stmt_35 = bsi_stmt (bsi); > get_stmt_operands (stmt_35); > var_38 = op_iter_init_tree (&iter, stmt_35, 13); > goto <bb 9> (<L10>); > > <L9>:; > var_45 = op_iter_next_tree (&iter); > > <L10>:; > D.17355_41 = iter.done; > D.17353_42 = (int) D.17355_41; > D.17347_44 = (unsigned char) D.17353_42; > if (D.17347_44 == 0) goto <L9>; else goto <L12>; > > but in t50.lim we have: > > <L8>:; > stmt_35 = bsi_stmt (bsi); > get_stmt_operands (stmt_35); > var_38 = op_iter_init_tree (&iter, stmt_35, 13); > lsm_tmp.500_356 = iter.done; > goto <bb 9> (<L10>); > > <L9>:; > var_45 = op_iter_next_tree (&iter); > > <L10>:; > D.17355_41 = lsm_tmp.500_356; > D.17353_42 = (int) D.17355_41; > D.17347_44 = (unsigned char) D.17353_42; > if (D.17347_44 == 0) goto <L9>; else goto <L18>; > > <L18>:; > iter.done = lsm_tmp.500_356; > > note that the use of iter.done has been hoisted out of the loop even though the > call of op_iter_next_tree passes the address of iter. This is probably because is_call_clobbered_ref is wrong for variables that have subvars (it checks the base var instead of the SFT's).
I'm testing a patch now
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01830.html>.
Subject: Bug 20542 CVSROOT: /cvs/gcc Module name: gcc Changes by: dberlin@gcc.gnu.org 2005-03-21 19:27:02 Modified files: gcc : ChangeLog tree-flow-inline.h tree-flow.h tree-ssa-alias.c tree-ssa-loop-im.c tree-ssa-operands.c Log message: 2005-03-18 Daniel Berlin <dberlin@dberlin.org> Fix PR tree-optimization/20542 * tree-flow-inline.h (overlap_subvar): Move to here. * tree-ssa-operands.c: From here. * tree-flow.h (overlap_subvar): Declare. * tree-ssa-alias.c (add_pointed_to_var): Use overlap_subvar here. * tree-ssa-loop-im.c (is_call_clobbered_ref): Return proper answer for variables with subvars. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7946&r2=2.7947 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-flow-inline.h.diff?cvsroot=gcc&r1=2.33&r2=2.34 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-flow.h.diff?cvsroot=gcc&r1=2.86&r2=2.87 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-alias.c.diff?cvsroot=gcc&r1=2.75&r2=2.76 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-loop-im.c.diff?cvsroot=gcc&r1=2.31&r2=2.32 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-operands.c.diff?cvsroot=gcc&r1=2.68&r2=2.69
Fixed