This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch applied to sh.c (3rd try)
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: amylaar at spamcop dot net
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 25 Nov 2004 14:22:41 +0900 (JST)
- Subject: Re: patch applied to sh.c (3rd try)
- References: <20041124234541.cxy3o4c8wkckswo4@webmail.spamcop.net>
Even with your patch, the build for sh4-unknown-linux-gnu fails
at compiling libstdc++-v3/src/sstream-inst.cc:
../../../../ORIG/gcc/libstdc++-v3/src/sstream-inst.cc:61: internal compiler error: Segmentation fault
though this is currently hidden with PR 18511 in cross builds.
It seems that the segfault is occured in bitmap_set_bit because of
the uninitialized bitmap obstack. The appended patch adds lines to
initialize/release the bitmap obstacks for life_analysis. These
lines are taken from tree_rest_of_compilation.
Bootstrapped on sh4-unknown-linux-gnu without new regressions.
Regards,
kaz
--
* config/sh/sh.c (sh_output_mi_thunk): Initialize bitmap obstacks
before calling life_analysis and release them after.
diff -uprN ORIG/gcc/gcc/config/sh/sh.c LOCAL/gcc/gcc/config/sh/sh.c
--- ORIG/gcc/gcc/config/sh/sh.c 2004-11-25 13:52:26.000000000 +0900
+++ LOCAL/gcc/gcc/config/sh/sh.c 2004-11-24 13:51:49.000000000 +0900
@@ -9821,6 +9821,9 @@ sh_output_mi_thunk (FILE *file, tree thu
if (optimize > 0 && flag_schedule_insns_after_reload)
{
+ /* Initialize the bitmap obstacks. */
+ bitmap_obstack_initialize (NULL);
+ bitmap_obstack_initialize (®_obstack);
if (! basic_block_info)
init_flow ();
rtl_register_cfg_hooks ();
@@ -9845,6 +9848,10 @@ sh_output_mi_thunk (FILE *file, tree thu
{
/* Release all memory allocated by flow. */
free_basic_block_vars ();
+
+ /* Release the bitmap obstacks. */
+ bitmap_obstack_release (®_obstack);
+ bitmap_obstack_release (NULL);
}
reload_completed = 0;