This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch applied to sh.c (3rd try)

Even with your patch, the build for sh4-unknown-linux-gnu fails
at compiling libstdc++-v3/src/

../../../../ORIG/gcc/libstdc++-v3/src/ 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.

	* 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 (&reg_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 (&reg_obstack);
+      bitmap_obstack_release (NULL);
   reload_completed = 0;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]