This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] SH: Bootstrap failure
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: gcc-patches at gcc dot gnu dot org
- Cc: joern dot rennecke at st dot com, aoliva at redhat dot com
- Date: Sat, 14 May 2005 13:35:31 +0900 (JST)
- Subject: [PATCH] SH: Bootstrap failure
Hi,
Mainline fails to build libstdc++-v3 for sh4-unknown-linux-gnu:
../../../../ORIG/gcc/libstdc++-v3/src/strstream.cc: In member function 'void std::strstream::_ZTv0_n12_NSt9strstreamD0Ev()':
../../../../ORIG/gcc/libstdc++-v3/src/strstream.cc:415: internal compiler error: Segmentation fault
The recent Honza's patch
http://gcc.gnu.org/ml/gcc-patches/2005-05/msg01144.html
intializes cfun->cfg in init_flow instead of allocate_struct_function.
sh_output_mi_thunk and dbr_schedule called from it access the variables
like basic_block_info and n_basic_block which are members of the struct
*cfun->cfg prior to calling init_flow and this causes segfaults.
The appended patch is to fix it. The second hunk of the patch calls
find_basic_blocks to set n_basic_block correctly.
It's tested with bootstrap and the toplevel "make -k check" on
sh4-unknown-linux-gnu. I saw some new failures in c and java tests,
but they are seen also on the other targets in gcc-testresult list
and would be irrelevant to the patch. Ok for mainline?
Regards,
kaz
--
2005-05-13 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (sh_output_mi_thunk): Check cfun->cfg instead
of basic_block_info. Call init_flow and find_basic_blocks
before dbr_schedule if needed.
diff -uprN ORIG/gcc/gcc/config/sh/sh.c LOCAL/gcc/gcc/config/sh/sh.c
--- ORIG/gcc/gcc/config/sh/sh.c 2005-05-13 09:27:04.000000000 +0900
+++ LOCAL/gcc/gcc/config/sh/sh.c 2005-05-13 13:00:08.000000000 +0900
@@ -10301,7 +10301,7 @@ sh_output_mi_thunk (FILE *file, tree thu
/* Initialize the bitmap obstacks. */
bitmap_obstack_initialize (NULL);
bitmap_obstack_initialize (®_obstack);
- if (! basic_block_info)
+ if (! cfun->cfg)
init_flow ();
rtl_register_cfg_hooks ();
find_basic_blocks (insns);
@@ -10315,7 +10315,14 @@ sh_output_mi_thunk (FILE *file, tree thu
sh_reorg ();
if (optimize > 0 && flag_delayed_branch)
- dbr_schedule (insns, dump_file);
+ {
+ if (! cfun->cfg)
+ {
+ init_flow ();
+ find_basic_blocks (insns);
+ }
+ dbr_schedule (insns, dump_file);
+ }
shorten_branches (insns);
final_start_function (insns, file, 1);
final (insns, file, 1);