* [Bug tree-optimization/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
@ 2008-04-02 4:31 ` hjl dot tools at gmail dot com
2008-04-02 4:36 ` hjl dot tools at gmail dot com
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-04-02 4:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from hjl dot tools at gmail dot com 2008-04-02 04:30 -------
Bad revision is at
http://gcc.gnu.org/ml/gcc-cvs/2008-04/msg00011.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
2008-04-02 4:31 ` [Bug tree-optimization/35795] " hjl dot tools at gmail dot com
@ 2008-04-02 4:36 ` hjl dot tools at gmail dot com
2008-04-02 9:36 ` hubicka at ucw dot cz
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-04-02 4:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from hjl dot tools at gmail dot com 2008-04-02 04:35 -------
I am testing this patch:
--- function.c.foo 2008-04-01 17:40:49.000000000 -0700
+++ function.c 2008-04-01 21:34:20.000000000 -0700
@@ -3940,7 +3940,7 @@ push_struct_function (tree fndecl)
static void
prepare_function_start (void)
{
- gcc_assert (!rtl.emit.x_last_insn);
+ gcc_assert (!rtl.emit.sequence_stack || !rtl.emit.x_last_insn);
init_emit ();
init_varasm_status ();
init_expr ();
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
2008-04-02 4:31 ` [Bug tree-optimization/35795] " hjl dot tools at gmail dot com
2008-04-02 4:36 ` hjl dot tools at gmail dot com
@ 2008-04-02 9:36 ` hubicka at ucw dot cz
2008-04-02 14:32 ` dominiq at lps dot ens dot fr
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hubicka at ucw dot cz @ 2008-04-02 9:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from hubicka at ucw dot cz 2008-04-02 09:35 -------
Subject: Re: New: [4.4 Regression] Revision 133787 breaks ia64
Hi,
I've added the assert to check that we don't initialize RTL world twice
without freeing it first (and thus that we don't leak memory). This
seems to be the case. Naively, something like this should fix it.
I am building a cross and will try to reproduce it.
Index: config/ia64/ia64.c
===================================================================
*** config/ia64/ia64.c (revision 133785)
--- config/ia64/ia64.c (working copy)
*************** ia64_output_mi_thunk (FILE *file, tree t
*** 9694,9699 ****
--- 9694,9700 ----
final_start_function (insn, file, 1);
final (insn, file, 1);
final_end_function ();
+ free_after_compilation (cfun);
reload_completed = 0;
epilogue_completed = 0;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
` (2 preceding siblings ...)
2008-04-02 9:36 ` hubicka at ucw dot cz
@ 2008-04-02 14:32 ` dominiq at lps dot ens dot fr
2008-04-02 16:42 ` hjl dot tools at gmail dot com
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens dot fr @ 2008-04-02 14:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from dominiq at lps dot ens dot fr 2008-04-02 14:31 -------
I think PR35801 is the same problem on powerpc-apple-darwin9.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug tree-optimization/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
` (3 preceding siblings ...)
2008-04-02 14:32 ` dominiq at lps dot ens dot fr
@ 2008-04-02 16:42 ` hjl dot tools at gmail dot com
2008-04-02 17:55 ` [Bug target/35795] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-04-02 16:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from hjl dot tools at gmail dot com 2008-04-02 16:42 -------
(In reply to comment #3)
> Subject: Re: New: [4.4 Regression] Revision 133787 breaks ia64
>
> Hi,
> I've added the assert to check that we don't initialize RTL world twice
> without freeing it first (and thus that we don't leak memory). This
> seems to be the case. Naively, something like this should fix it.
> I am building a cross and will try to reproduce it.
>
> Index: config/ia64/ia64.c
> ===================================================================
> *** config/ia64/ia64.c (revision 133785)
> --- config/ia64/ia64.c (working copy)
> *************** ia64_output_mi_thunk (FILE *file, tree t
> *** 9694,9699 ****
> --- 9694,9700 ----
> final_start_function (insn, file, 1);
> final (insn, file, 1);
> final_end_function ();
> + free_after_compilation (cfun);
>
> reload_completed = 0;
> epilogue_completed = 0;
>
This patch works.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
` (4 preceding siblings ...)
2008-04-02 16:42 ` hjl dot tools at gmail dot com
@ 2008-04-02 17:55 ` pinskia at gcc dot gnu dot org
2008-04-03 5:16 ` wilson at tuliptree dot org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-04-02 17:55 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|tree-optimization |target
Target Milestone|--- |4.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
` (5 preceding siblings ...)
2008-04-02 17:55 ` [Bug target/35795] " pinskia at gcc dot gnu dot org
@ 2008-04-03 5:16 ` wilson at tuliptree dot org
2008-04-03 6:13 ` hubicka at ucw dot cz
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: wilson at tuliptree dot org @ 2008-04-03 5:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from wilson at tuliptree dot org 2008-04-03 05:16 -------
Subject: Re: [4.4 Regression] Revision 133787
breaks ia64
hubicka at ucw dot cz wrote:
> *************** ia64_output_mi_thunk (FILE *file, tree t
> final_end_function ();
> + free_after_compilation (cfun);
The patch is OK.
But won't all targets that have similar code need the same fix? If I cd
to the config dir, and try "grep final_end_function */*" it looks like
alpha, ia64, m68k, mips, rs6000, score (both score3 and score7), sh, and
sparc all have the same problem. The rs6000 port has already been fixed
via PR 35801. We have an ia64 patch here. We also need patches for the
rest.
Jim
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
` (6 preceding siblings ...)
2008-04-03 5:16 ` wilson at tuliptree dot org
@ 2008-04-03 6:13 ` hubicka at ucw dot cz
2008-04-03 12:51 ` hjl at gcc dot gnu dot org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hubicka at ucw dot cz @ 2008-04-03 6:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from hubicka at ucw dot cz 2008-04-03 06:12 -------
Subject: Re: [4.4 Regression] Revision 133787 breaks ia64
> The patch is OK.
>
> But won't all targets that have similar code need the same fix? If I cd
> to the config dir, and try "grep final_end_function */*" it looks like
> alpha, ia64, m68k, mips, rs6000, score (both score3 and score7), sh, and
> sparc all have the same problem. The rs6000 port has already been fixed
> via PR 35801. We have an ia64 patch here. We also need patches for the
> rest.
Thanks,
I've just noticed that too and send patch for all the backends. Looks
like we was leaking memory here for ages, probably not that big deal
since thunks are pretty small functions, but still keeping all the RTL
register tables around seems bit expensive.
Honza
>
> Jim
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
` (7 preceding siblings ...)
2008-04-03 6:13 ` hubicka at ucw dot cz
@ 2008-04-03 12:51 ` hjl at gcc dot gnu dot org
2008-04-03 13:45 ` joel at gcc dot gnu dot org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hjl at gcc dot gnu dot org @ 2008-04-03 12:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from hjl at gcc dot gnu dot org 2008-04-03 12:50 -------
Subject: Bug 35795
Author: hjl
Date: Thu Apr 3 12:49:27 2008
New Revision: 133868
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133868
Log:
2008-04-03 Jan Hubicka <jh@suse.cz>
PR tree-optimization/35795
* alpha/alpha.c (alpha_output_mi_thunk_osf): Free after compilation.
* sparc/sparc.c (sparc_output_mi_thunk): Likewise.
* ia64/ia64.c (ia64_output_mi_thunk): Likewise.
* m68k/m68k.c (m68k_output_mi_thunk): Likewise.
* score/score3.c (score3_output_mi_thunk): Likewise.
* score/score7.c (score7_output_mi_thunk): Likewise.
* mips/mips.c (mips_output_mi_thunk): Likewise.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/alpha/alpha.c
trunk/gcc/config/ia64/ia64.c
trunk/gcc/config/m68k/m68k.c
trunk/gcc/config/mips/mips.c
trunk/gcc/config/score/score3.c
trunk/gcc/config/score/score7.c
trunk/gcc/config/sparc/sparc.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
` (8 preceding siblings ...)
2008-04-03 12:51 ` hjl at gcc dot gnu dot org
@ 2008-04-03 13:45 ` joel at gcc dot gnu dot org
2008-04-03 15:44 ` hubicka at ucw dot cz
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: joel at gcc dot gnu dot org @ 2008-04-03 13:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from joel at gcc dot gnu dot org 2008-04-03 13:44 -------
I am pretty sure I saw this one targeting sparc-rtems. Building an updated
tree now to confirm it is the fix.
../../../../gcc/libstdc++-v3/src/iostream-inst.cc: In member function 'void
std::basic_iostream<char, std::char_traits<char> >::_ZThn8_NSdD1Ev()':
../../../../gcc/libstdc++-v3/src/iostream-inst.cc:51: internal compiler error:
in prepare_function_start, at function.c:3940
--
joel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |joel at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
` (9 preceding siblings ...)
2008-04-03 13:45 ` joel at gcc dot gnu dot org
@ 2008-04-03 15:44 ` hubicka at ucw dot cz
2008-04-03 16:20 ` joel at gcc dot gnu dot org
2008-04-03 16:22 ` hjl dot tools at gmail dot com
12 siblings, 0 replies; 14+ messages in thread
From: hubicka at ucw dot cz @ 2008-04-03 15:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from hubicka at ucw dot cz 2008-04-03 15:44 -------
Subject: Re: [4.4 Regression] Revision 133787 breaks ia64
> I am pretty sure I saw this one targeting sparc-rtems. Building an updated
> tree now to confirm it is the fix.
>
> ../../../../gcc/libstdc++-v3/src/iostream-inst.cc: In member function 'void
> std::basic_iostream<char, std::char_traits<char> >::_ZThn8_NSdD1Ev()':
> ../../../../gcc/libstdc++-v3/src/iostream-inst.cc:51: internal compiler error:
> in prepare_function_start, at function.c:3940
sparc, alpha, m68k, score and mips contained same problem, so hopefully
it is fixed now.
Honza
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
` (10 preceding siblings ...)
2008-04-03 15:44 ` hubicka at ucw dot cz
@ 2008-04-03 16:20 ` joel at gcc dot gnu dot org
2008-04-03 16:22 ` hjl dot tools at gmail dot com
12 siblings, 0 replies; 14+ messages in thread
From: joel at gcc dot gnu dot org @ 2008-04-03 16:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from joel at gcc dot gnu dot org 2008-04-03 16:19 -------
(In reply to comment #10)
> Subject: Re: [4.4 Regression] Revision 133787 breaks ia64
>
> > I am pretty sure I saw this one targeting sparc-rtems. Building an updated
> > tree now to confirm it is the fix.
> >
> > ../../../../gcc/libstdc++-v3/src/iostream-inst.cc: In member function 'void
> > std::basic_iostream<char, std::char_traits<char> >::_ZThn8_NSdD1Ev()':
> > ../../../../gcc/libstdc++-v3/src/iostream-inst.cc:51: internal compiler error:
> > in prepare_function_start, at function.c:3940
>
> sparc, alpha, m68k, score and mips contained same problem, so hopefully
> it is fixed now.
My sparc build is past this point now so I think it is fixed there.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug target/35795] [4.4 Regression] Revision 133787 breaks ia64
2008-04-02 4:29 [Bug tree-optimization/35795] New: [4.4 Regression] Revision 133787 breaks ia64 hjl dot tools at gmail dot com
` (11 preceding siblings ...)
2008-04-03 16:20 ` joel at gcc dot gnu dot org
@ 2008-04-03 16:22 ` hjl dot tools at gmail dot com
12 siblings, 0 replies; 14+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-04-03 16:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from hjl dot tools at gmail dot com 2008-04-03 16:21 -------
Fixed.
--
hjl dot tools at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35795
^ permalink raw reply [flat|nested] 14+ messages in thread