This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Oct 2005 21:40:48 -0000
- Subject: [Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
- References: <bug-24225-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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=10036&action=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