* [Bug other/17437] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
@ 2004-09-12 15:14 ` steven at gcc dot gnu dot org
2004-09-12 17:30 ` [Bug other/17437] New: " Graham Stott
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-09-12 15:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2004-09-12 15:14 -------
Created an attachment (id=7106)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7106&action=view)
Test case for this bug
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Bug other/17437] New: obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
2004-09-12 15:14 ` [Bug other/17437] " steven at gcc dot gnu dot org
@ 2004-09-12 17:30 ` Graham Stott
2004-09-12 17:30 ` [Bug other/17437] " graham dot stott at btinternet dot com
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Graham Stott @ 2004-09-12 17:30 UTC (permalink / raw)
To: gcc-bugzilla; +Cc: gcc-bugs
Steven,
FWIW it doesn't fail on a x86-ia64 cross using normal -O2 opts
But I could trigger a failure, but not your failure using -O3 -fno-unit-at_a-time
t.i:16476: error: Inlined_to pointer is wrong
detect_webs_set_in_cond_jump/314: (inline copy in build_i_graph/312) 54 insns tree inlinable
called by: make_webs/313 (inlined)
calls:
t.i:16476: internal compiler error: verify_cgraph_node failed.
Graham
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
2004-09-12 15:14 ` [Bug other/17437] " steven at gcc dot gnu dot org
2004-09-12 17:30 ` [Bug other/17437] New: " Graham Stott
@ 2004-09-12 17:30 ` graham dot stott at btinternet dot com
2004-09-12 17:35 ` pinskia at gcc dot gnu dot org
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: graham dot stott at btinternet dot com @ 2004-09-12 17:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From graham dot stott at btinternet dot com 2004-09-12 17:30 -------
Subject: Re: New: obscure GC problem
Steven,
FWIW it doesn't fail on a x86-ia64 cross using normal -O2 opts
But I could trigger a failure, but not your failure using -O3 -fno-unit-at_a-time
t.i:16476: error: Inlined_to pointer is wrong
detect_webs_set_in_cond_jump/314: (inline copy in build_i_graph/312) 54 insns tree inlinable
called by: make_webs/313 (inlined)
calls:
t.i:16476: internal compiler error: verify_cgraph_node failed.
Graham
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (2 preceding siblings ...)
2004-09-12 17:30 ` [Bug other/17437] " graham dot stott at btinternet dot com
@ 2004-09-12 17:35 ` pinskia at gcc dot gnu dot org
2004-09-14 3:12 ` [Bug other/17437] [4.0 Regression] " pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-12 17:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-12 17:34 -------
Now the non-unit-at-a-time problems is most likely PR 17419.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (3 preceding siblings ...)
2004-09-12 17:35 ` pinskia at gcc dot gnu dot org
@ 2004-09-14 3:12 ` pinskia at gcc dot gnu dot org
2004-09-14 5:36 ` pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-14 3:12 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Summary|obscure GC problem |[4.0 Regression] obscure GC
| |problem
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (4 preceding siblings ...)
2004-09-14 3:12 ` [Bug other/17437] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2004-09-14 5:36 ` pinskia at gcc dot gnu dot org
2004-09-14 6:23 ` steven at gcc dot gnu dot org
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-14 5:36 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-14 05:36 -------
I think the message at <http://gcc.gnu.org/ml/gcc/2004-09/msg00823.html> is the same bug.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (5 preceding siblings ...)
2004-09-14 5:36 ` pinskia at gcc dot gnu dot org
@ 2004-09-14 6:23 ` steven at gcc dot gnu dot org
2004-09-14 6:25 ` stevenb at suse dot de
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-09-14 6:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2004-09-14 06:23 -------
Jeff, the bug you described in your main at
<http://gcc.gnu.org/ml/gcc/2004-09/msg00823.html>
is exactly like what I've observed.
I couldn't find any place where we fail do free_df,
but I haven't looked very closely at it yet.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at redhat dot com
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-09-14 06:23:35
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (6 preceding siblings ...)
2004-09-14 6:23 ` steven at gcc dot gnu dot org
@ 2004-09-14 6:25 ` stevenb at suse dot de
2004-09-14 15:31 ` law at redhat dot com
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: stevenb at suse dot de @ 2004-09-14 6:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From stevenb at suse dot de 2004-09-14 06:25 -------
Subject: Re: [4.0 Regression] obscure GC problem
On Tuesday 14 September 2004 07:36, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-14
> 05:36 ------- I think the message at
> <http://gcc.gnu.org/ml/gcc/2004-09/msg00823.html> is the same bug.
That certainly looks like the bug I've been seeing.
Gr.
Steven
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (7 preceding siblings ...)
2004-09-14 6:25 ` stevenb at suse dot de
@ 2004-09-14 15:31 ` law at redhat dot com
2004-09-14 19:07 ` dnovillo at redhat dot com
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: law at redhat dot com @ 2004-09-14 15:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From law at redhat dot com 2004-09-14 15:31 -------
Subject: Re: [4.0 Regression] obscure GC problem
On Tue, 2004-09-14 at 00:23, steven at gcc dot gnu dot org wrote:
> ------- Additional Comments From steven at gcc dot gnu dot org 2004-09-14 06:23 -------
> Jeff, the bug you described in your main at
> <http://gcc.gnu.org/ml/gcc/2004-09/msg00823.html>
> is exactly like what I've observed.
>
> I couldn't find any place where we fail do free_df,
> but I haven't looked very closely at it yet.
I wonder if free_df is unable to free dataflow information attached
to statements that have been deleted or something similar.
What doesn't make sense to me is that the dataflow information isn't
attached to SSA_NAMEs, it's attached to statement nodes and PHIs.
So at least that part of my analysis is faulty.
Hmm, I wonder if something has mucked up the type of the annotation
or something similar.
Diego, can you dump the annotation in frame 5 from your failure?
It would also be useful to dump the lang tree node in frame 6.
You may have to do these by hand somewhat since I don't think we have
a pretty printer for annotations and lang tree nodes.
Jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (8 preceding siblings ...)
2004-09-14 15:31 ` law at redhat dot com
@ 2004-09-14 19:07 ` dnovillo at redhat dot com
2004-09-14 19:19 ` law at redhat dot com
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dnovillo at redhat dot com @ 2004-09-14 19:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at redhat dot com 2004-09-14 19:07 -------
Subject: Re: [4.0 Regression] obscure GC problem
On Tue, 2004-09-14 at 11:31, Jeffrey A Law wrote:
> What doesn't make sense to me is that the dataflow information isn't
> attached to SSA_NAMEs, it's attached to statement nodes and PHIs.
> So at least that part of my analysis is faulty.
>
Because SSA_NAMEs store their defining statement in tree.common.chain
and gt_ggc_mx_lang_tree_node jumps from the SSA_NAME into its defining
statement. From there, we start traversing the statement's DU chains
and end up in a statement whose basic block has been ggc_free'd already
by cfg.c:expunge_block.
This allows me to go past this failure and go into stage3, but I think
the real issue may be that somebody is holding on to DU chains too long.
I don't know what the right approach would be here. Force people to
always flush out DU chains? Maybe. But then, why put these things on
GC memory to begin with?
Diego.
Index: cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfg.c,v
retrieving revision 1.65
diff -d -u -p -r1.65 cfg.c
--- cfg.c 7 Sep 2004 15:46:46 -0000 1.65
+++ cfg.c 14 Sep 2004 19:03:02 -0000
@@ -266,7 +266,6 @@ expunge_block (basic_block b)
unlink_block (b);
BASIC_BLOCK (b->index) = NULL;
n_basic_blocks--;
- ggc_free (b);
}
/* Create an edge connecting SRC and DEST with flags FLAGS. Return newly
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (9 preceding siblings ...)
2004-09-14 19:07 ` dnovillo at redhat dot com
@ 2004-09-14 19:19 ` law at redhat dot com
2004-09-14 19:48 ` law at redhat dot com
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: law at redhat dot com @ 2004-09-14 19:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From law at redhat dot com 2004-09-14 19:19 -------
Subject: Re: [4.0 Regression] obscure GC problem
On Tue, 2004-09-14 at 13:07, Diego Novillo wrote:
> On Tue, 2004-09-14 at 11:31, Jeffrey A Law wrote:
>
> > What doesn't make sense to me is that the dataflow information isn't
> > attached to SSA_NAMEs, it's attached to statement nodes and PHIs.
> > So at least that part of my analysis is faulty.
> >
> Because SSA_NAMEs store their defining statement in tree.common.chain
> and gt_ggc_mx_lang_tree_node jumps from the SSA_NAME into its defining
> statement. From there, we start traversing the statement's DU chains
> and end up in a statement whose basic block has been ggc_free'd already
> by cfg.c:expunge_block.
Which is part of the reason why I think sprinkling ggc_free calls
around is generally a bad idea. While we may think we know the
lifetime of some object, it's bloody easy to miss some pointer
pointing into the object keeping it live.
>
> This allows me to go past this failure and go into stage3, but I think
> the real issue may be that somebody is holding on to DU chains too long.
Agreed.
> I don't know what the right approach would be here. Force people to
> always flush out DU chains? Maybe. But then, why put these things on
> GC memory to begin with?
Well, IMHO the ggc_free is bogus and we need to fix whatever code
forgot to call free_df.
jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (10 preceding siblings ...)
2004-09-14 19:19 ` law at redhat dot com
@ 2004-09-14 19:48 ` law at redhat dot com
2004-09-15 4:31 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: law at redhat dot com @ 2004-09-14 19:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From law at redhat dot com 2004-09-14 19:48 -------
Subject: Re: [4.0 Regression] obscure GC problem
On Tue, 2004-09-14 at 13:07, dnovillo at redhat dot com wrote:
> ------- Additional Comments From dnovillo at redhat dot com 2004-09-14 19:07 -------
> Subject: Re: [4.0 Regression] obscure GC problem
>
> On Tue, 2004-09-14 at 11:31, Jeffrey A Law wrote:
>
> > What doesn't make sense to me is that the dataflow information isn't
> > attached to SSA_NAMEs, it's attached to statement nodes and PHIs.
> > So at least that part of my analysis is faulty.
> >
> Because SSA_NAMEs store their defining statement in tree.common.chain
> and gt_ggc_mx_lang_tree_node jumps from the SSA_NAME into its defining
> statement. From there, we start traversing the statement's DU chains
> and end up in a statement whose basic block has been ggc_free'd already
> by cfg.c:expunge_block.
>
> This allows me to go past this failure and go into stage3, but I think
> the real issue may be that somebody is holding on to DU chains too long.
>
> I don't know what the right approach would be here. Force people to
> always flush out DU chains? Maybe. But then, why put these things on
> GC memory to begin with?
BTW, I have a theory why this is happening (dangling dataflow
information).
The code to remove dataflow walks through the IL removing dataflow
information on every statement it finds.
So imagine if we had dataflow information attached to a statement
which we delete. Furthermore, assume that statement is in a
block which we ultimately delete. ANd (of course) we're assuming
that the statement with the attached dataflow information has a
SSA_NAME in the SSA_NAME table, but assume the SSA_NAME hasn't
been released.
I _think_ that could lead to the behavior we're seeing and would
match the preliminary stuff I've seen under GDB.
jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (11 preceding siblings ...)
2004-09-14 19:48 ` law at redhat dot com
@ 2004-09-15 4:31 ` pinskia at gcc dot gnu dot org
2004-10-12 13:03 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-15 4:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-15 04:31 -------
Does the patch at <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01511.html> fix this problem?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (12 preceding siblings ...)
2004-09-15 4:31 ` pinskia at gcc dot gnu dot org
@ 2004-10-12 13:03 ` pinskia at gcc dot gnu dot org
2004-10-14 16:10 ` stevenb at novell dot com
2004-10-14 16:30 ` pinskia at gcc dot gnu dot org
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-12 13:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-12 13:03 -------
Can you try this again?
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (13 preceding siblings ...)
2004-10-12 13:03 ` pinskia at gcc dot gnu dot org
@ 2004-10-14 16:10 ` stevenb at novell dot com
2004-10-14 16:30 ` pinskia at gcc dot gnu dot org
15 siblings, 0 replies; 17+ messages in thread
From: stevenb at novell dot com @ 2004-10-14 16:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From stevenb at novell dot com 2004-10-14 16:09 -------
Subject: Re: [4.0 Regression] obscure GC problem
On Tuesday 12 October 2004 15:03, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-12
> 13:03 ------- Can you try this again?
Can't reproduce it
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug other/17437] [4.0 Regression] obscure GC problem
2004-09-12 15:13 [Bug other/17437] New: obscure GC problem steven at gcc dot gnu dot org
` (14 preceding siblings ...)
2004-10-14 16:10 ` stevenb at novell dot com
@ 2004-10-14 16:30 ` pinskia at gcc dot gnu dot org
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-14 16:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-14 16:30 -------
So closing as fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17437
^ permalink raw reply [flat|nested] 17+ messages in thread