public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob
@ 2005-10-06 8:31 rguenth at gcc dot gnu dot org
2005-10-06 8:32 ` [Bug tree-optimization/24225] " rguenth at gcc dot gnu dot org
` (12 more replies)
0 siblings, 13 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-10-06 8:31 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1685 bytes --]
/usr/lib/gcc/i586-suse-linux/4.1.0/cc1 -fpreprocessed builtin.i -quiet
-dumpbase builtin.c -march=i586 -mtune=i686 -auxbase-strip builtin.o -O2 -Wall
-Wall -version -fmessage-length=0 -fno-strict-aliasing -fprofile-arcs -o
builtin.s
builtin.c: In function execbuiltin:
builtin.c:5173: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.suse.de/feedback> for instructions.
(gdb) bt
#0 0x0846db4d in branch_prob () at profile.c:815
#1 0x0852f803 in tree_profiling () at tree-profile.c:246
#2 0x0852f0cd in execute_one_pass (pass=0x8777060) at passes.c:827
#3 0x0852f18c in execute_pass_list (pass=0x8777060) at passes.c:859
#4 0x0852f260 in execute_ipa_pass_list (pass=0x8774a60) at passes.c:881
#5 0x085911d1 in ipa_passes () at cgraphunit.c:1221
#6 0x0859127c in cgraph_optimize () at cgraphunit.c:1255
#7 0x08068379 in c_write_global_declarations () at c-decl.c:7644
#8 0x084df96f in compile_file () at toplev.c:1003
#9 0x084e103c in do_compile () at toplev.c:1933
#10 0x084e10a4 in toplev_main (argc=19, argv=0xbf9bf844) at toplev.c:1965
#11 0x080d9b90 in main (argc=19, argv=0xbf9bf844) at main.c:35
--
Summary: [4,1 Regression] ICE: segmentation fault in
profile.c:branch_prob
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
@ 2005-10-06 8:32 ` rguenth at gcc dot gnu dot org
2005-10-06 11:15 ` rguenth at gcc dot gnu dot org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-10-06 8:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2005-10-06 08:32 -------
Created an attachment (id=9900)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9900&action=view)
testcase
Preprocessed testcase
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
2005-10-06 8:32 ` [Bug tree-optimization/24225] " rguenth at gcc dot gnu dot org
@ 2005-10-06 11:15 ` rguenth at gcc dot gnu dot org
2005-10-06 11:21 ` rguenth at gcc dot gnu dot org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-10-06 11:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2005-10-06 11:15 -------
Reducing.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
2005-10-06 8:32 ` [Bug tree-optimization/24225] " rguenth at gcc dot gnu dot org
2005-10-06 11:15 ` rguenth at gcc dot gnu dot org
@ 2005-10-06 11:21 ` rguenth at gcc dot gnu dot org
2005-10-06 11:47 ` belyshev at depni dot sinp dot msu dot ru
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-10-06 11:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2005-10-06 11:21 -------
Reduced testcase:
typedef struct linklist *LinkList;
typedef struct options *Options;
typedef struct builtin *Builtin;
struct options {
};
typedef int (*HandlerFunc) (char *, char **, Options, int);
struct builtin {
HandlerFunc handlerfunc;
int funcid;
};
enum { XTRACE, OPT_SIZE };
extern char opts[OPT_SIZE];
int execbuiltin(LinkList args, Builtin bn) {
char *pp, *name, *optstr;
int flags, sense, argc, execop, xtr = (opts[XTRACE]);
struct options ops;
if (!bn->handlerfunc) {
return 1;
}
{
char * (argarr)[argc + 1];
char **argv;
return (*(bn->handlerfunc)) (name, argv, &ops, bn->funcid);
}
}
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2005-10-06 11:21:00
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-10-06 11:21 ` rguenth at gcc dot gnu dot org
@ 2005-10-06 11:47 ` belyshev at depni dot sinp dot msu dot ru
2005-10-06 13:46 ` [Bug tree-optimization/24225] [4.1 " pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-10-06 11:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from belyshev at depni dot sinp dot msu dot ru 2005-10-06 11:47 -------
// smaller testcase, compile with -O1 -fprofile-arcs
int f (int a, int b)
{
if (a)
return 1;
{
int s [b];
return 0;
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-10-06 11:47 ` belyshev at depni dot sinp dot msu dot ru
@ 2005-10-06 13:46 ` pinskia at gcc dot gnu dot org
2005-10-06 13:51 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-06 13:46 UTC (permalink / raw)
To: gcc-bugs
--
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-10-06 13:46 ` [Bug tree-optimization/24225] [4.1 " pinskia at gcc dot gnu dot org
@ 2005-10-06 13:51 ` pinskia at gcc dot gnu dot org
2005-10-07 19:36 ` janis187 at us dot ibm dot com
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-06 13:51 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-10-06 13:51 ` pinskia at gcc dot gnu dot org
@ 2005-10-07 19:36 ` janis187 at us dot ibm dot com
2005-10-20 9:16 ` rguenth at gcc dot gnu dot org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: janis187 at us dot ibm dot com @ 2005-10-07 19:36 UTC (permalink / raw)
To: gcc-bugs
------- 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 hubicka@gcc.gnu.org:
http://gcc.gnu.org/ml/gcc-cvs/2005-08/msg00101.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-10-07 19:36 ` janis187 at us dot ibm dot com
@ 2005-10-20 9:16 ` rguenth at gcc dot gnu dot org
2005-10-20 21:03 ` steven at gcc dot gnu dot org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-10-20 9:16 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-10-20 9:16 ` rguenth at gcc dot gnu dot org
@ 2005-10-20 21:03 ` steven at gcc dot gnu dot org
2005-10-20 21:40 ` steven at gcc dot gnu dot org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-10-20 21:03 UTC (permalink / raw)
To: gcc-bugs
------- 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=10035&action=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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-10-20 21:03 ` steven at gcc dot gnu dot org
@ 2005-10-20 21:40 ` steven at gcc dot gnu dot org
2005-10-20 22:45 ` steven at gcc dot gnu dot org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-10-20 21:40 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
` (9 preceding siblings ...)
2005-10-20 21:40 ` steven at gcc dot gnu dot org
@ 2005-10-20 22:45 ` steven at gcc dot gnu dot org
2005-10-24 19:21 ` cvs-commit at gcc dot gnu dot org
2005-10-24 21:19 ` steven at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-10-20 22:45 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
` (10 preceding siblings ...)
2005-10-20 22:45 ` steven at gcc dot gnu dot org
@ 2005-10-24 19:21 ` cvs-commit at gcc dot gnu dot org
2005-10-24 21:19 ` steven at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-24 19:21 UTC (permalink / raw)
To: gcc-bugs
------- 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: steven@gcc.gnu.org 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=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6242&r2=1.6243
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.10210&r2=2.10211
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/profile.c.diff?cvsroot=gcc&r1=1.164&r2=1.165
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24225
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/24225] [4.1 Regression] ICE: segmentation fault in profile.c:branch_prob
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
` (11 preceding siblings ...)
2005-10-24 19:21 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-24 21:19 ` steven at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-10-24 21:19 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2005-10-24 21:19 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-06 8:31 [Bug tree-optimization/24225] New: [4,1 Regression] ICE: segmentation fault in profile.c:branch_prob rguenth at gcc dot gnu dot org
2005-10-06 8:32 ` [Bug tree-optimization/24225] " rguenth at gcc dot gnu dot org
2005-10-06 11:15 ` rguenth at gcc dot gnu dot org
2005-10-06 11:21 ` rguenth at gcc dot gnu dot org
2005-10-06 11:47 ` belyshev at depni dot sinp dot msu dot ru
2005-10-06 13:46 ` [Bug tree-optimization/24225] [4.1 " pinskia at gcc dot gnu dot org
2005-10-06 13:51 ` pinskia at gcc dot gnu dot org
2005-10-07 19:36 ` janis187 at us dot ibm dot com
2005-10-20 9:16 ` rguenth at gcc dot gnu dot org
2005-10-20 21:03 ` steven at gcc dot gnu dot org
2005-10-20 21:40 ` steven at gcc dot gnu dot org
2005-10-20 22:45 ` steven at gcc dot gnu dot org
2005-10-24 19:21 ` cvs-commit at gcc dot gnu dot org
2005-10-24 21:19 ` steven at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).