[PATCH/RFC] SH: libstdc++-v3 testsuite failures
Joern Rennecke
joern.rennecke@superh.com
Tue Aug 17 17:33:00 GMT 2004
> There are 12 failures for libstdc++-v3 testsuite of the current mainline
> on the sh4-unknown-linux-gnu target.
> It seems that 22_locale/num_put/put/wchar_t/4.cc and other 3 tests failed
> with accessing the null result of next_active_insn in split_branches and
> 23_containers/bitset/input/1.cc and several tests failed with the null
> ENTRY_BLOCK_PTR and cfg_hooks in basic block handling when called from
> sh_output_mi_thunk in some situations. It seems that there is no chance
> to call init_flow because the thunked function is the first translation
> unit in those cases.
> The first hunk of the appended patch checks the result of next_active_insn
> in a very similar way as the code just before this part of split_branches.
This code is handling conditional branches, so in general there should
be a fall-through instruction. The exception is when a syntax error has
left the rtl stream inconsistent. Is this the case here too? If yes,
this part of the patch:
> * config/sh/sh.c (split_branches): Check the result of
> next_active_insn.
is OK; otherwise, we should investigate what exactly is going on.
> The later hunk is intended to do the minimal initialization of bb stuff
> and cfg_hooks, though I don't know if it's the right thing to do.
> Could you please comment on it?
We've been using this patch locally:
Index: config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.247.2.4
diff -p -u -r1.247.2.4 sh.c
--- config/sh/sh.c 9 Mar 2004 03:00:12 -0000 1.247.2.4
+++ config/sh/sh.c 17 Aug 2004 16:40:51 -0000
@@ -9070,6 +9686,8 @@ sh_output_mi_thunk (FILE *file, tree thu
if (optimize > 0 && flag_schedule_insns_after_reload)
{
+ rtl_register_cfg_hooks ();
+ init_flow ();
find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
life_analysis (insns, rtl_dump_file, PROP_FINAL);
but the test case didn't trigger on gcc 3.5.
Your version is better as it avoids re-allocating
ENTRY_BLOCK_PTR / EXIT_BLOCK_PTR unnecessarily, and the test for
basic_block_info should presumably be safe, as it is also used in
rest_of_handle_jump.
So this part:
> (sh_output_mi_thunk): Call init_flow if basic_block_info is null.
> Call rtl_register_cfg_hooks.
is OK.
More information about the Gcc-patches
mailing list