[Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
--- Comment #11 from cvs-commit at gcc dot gnu dot org 2005-10-24 19:21 --- Subject: Bug 24225 CVSROOT:/cvs/gcc Module name:gcc Changes by: [EMAIL PROTECTED] 2005-10-24 19:20:38 Modified files: gcc/testsuite : ChangeLog gcc: ChangeLog profile.c Added files: gcc/testsuite/gcc.dg: pr24225.c Log message: PR tree-optimization/24225 gcc/ * profile.c (branch_prob): Look from end to start through a basic block when looking for a locus. testsuite/ * gcc.dg/pr24225.c: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr24225.c.diff?cvsroot=gccr1=NONEr2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gccr1=1.6242r2=1.6243 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gccr1=2.10210r2=2.10211 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/profile.c.diff?cvsroot=gccr1=1.164r2=1.165 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
[Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
--- Comment #12 from steven at gcc dot gnu dot org 2005-10-24 21:19 --- . -- steven at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
[Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
--- Comment #7 from rguenth at gcc dot gnu dot org 2005-10-20 09:16 --- Honza, can you have a look at this (now that you appear to be back)? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
[Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
--- Comment #8 from steven at gcc dot gnu dot org 2005-10-20 21:03 --- Created an attachment (id=10035) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10035action=view) Hack that makes the test case work. Needs testing. -- steven at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |steven at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
[Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
--- Comment #9 from steven at gcc dot gnu dot org 2005-10-20 21:40 --- Created an attachment (id=10036) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10036action=view) Alternate fix As suggested by Andrew Pinski... Put loci on the stack save and restore operations. This gives: f (a, b) { intD.0 sD.1611[0:D.1616]; voidD.35 * saved_stack.2D.1623; voidD.35 * D.1622; intD.0[0:D.1616] * s.1D.1621; long unsigned intD.4 D.1620; bit_size_type D.1619; bit_size_type D.1618; long unsigned intD.4 D.1617; long unsigned intD.4 D.1616; long intD.2 D.1615; long intD.2 D.1614; intD.0 b.0D.1613; intD.0 D.1612; # BLOCK 0, starting at line 5 # PRED: ENTRY [t.c : 5] if ([t.c : 5] aD.1607 != 0) goto L0; else goto L1; # SUCC: 1 2 # BLOCK 1, starting at line 6 # PRED: 0 L0:; [t.c : 6] D.1612 = 1; [t.c : 6] goto bb 3 (L3); # SUCC: 3 # BLOCK 2, starting at line 8 # PRED: 0 L1:; [t.c : 8] saved_stack.2D.1623 = __builtin_stack_save (); [t.c : 8] b.0D.1613 = bD.1608; [t.c : 8] D.1614 = (long intD.2) b.0D.1613; [t.c : 8] D.1615 = D.1614 - 1; [t.c : 8] D.1616 = (long unsigned intD.4) D.1615; [t.c : 8] D.1617 = (long unsigned intD.4) b.0D.1613; [t.c : 8] D.1618 = (bit_size_type) D.1617; [t.c : 8] D.1619 = D.1618 * 32; [t.c : 8] D.1617 = (long unsigned intD.4) b.0D.1613; [t.c : 8] D.1620 = D.1617 * 4; [t.c : 8] D.1617 = (long unsigned intD.4) b.0D.1613; [t.c : 8] D.1618 = (bit_size_type) D.1617; [t.c : 8] D.1619 = D.1618 * 32; [t.c : 8] D.1617 = (long unsigned intD.4) b.0D.1613; [t.c : 8] D.1620 = D.1617 * 4; [t.c : 8] D.1622 = [t.c : 8] __builtin_alloca (D.1620); [t.c : 8] s.1D.1621 = (intD.0[0:D.1616] *) D.1622; [t.c : 9] D.1612 = 0; [t.c : 9] __builtin_stack_restore (saved_stack.2D.1623); # SUCC: 3 # BLOCK 3 # PRED: 1 2 L3:; return D.1612; # SUCC: EXIT } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
[Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
--- Comment #10 from steven at gcc dot gnu dot org 2005-10-20 22:45 --- The second fix boostraps the compiler proper and it builds libstdc++ and libgfortran without problems. But it fails on cp-demangle.c for some reason. That's probably another case where we don't put a locus on statements in a gimplified statement list. Fixing that, who knows where else we'll discover similar problems... Therefore, at least for GCC 4.1 I'm more comfortable with my first patch. I'll bootstrap+test and profilebootstrap that patch and post it for comment if it doesn't cause any regressions. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
[Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
--- Comment #6 from janis187 at us dot ibm dot com 2005-10-07 19:36 --- A regression hunt on powerpc-linux using the testcase from comment #4 identified this patch from [EMAIL PROTECTED]: http://gcc.gnu.org/ml/gcc-cvs/2005-08/msg00101.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
[Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||hubicka at gcc dot gnu dot ||org Summary|[4,1 Regression] ICE: |[4.1 Regression] ICE: |segmentation fault in |segmentation fault in |profile.c:branch_prob |profile.c:branch_prob Target Milestone|--- |4.1.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
[Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
--- Comment #5 from pinskia at gcc dot gnu dot org 2005-10-06 13:51 --- saved_stack.3 = __builtin_stack_save (); [t.c : 6] b.0 = b; For last, we don't have a line number associated with it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225