Fix PR41573, remove pass_remove_useless_stmts

Uros Bizjak ubizjak@gmail.com
Sat Oct 10 10:49:00 GMT 2009


Hello!

> 	PR middle-end/41573
> 	* builtins.c (fold_builtin_isascii): Use fold_build2.
> 	(fold_builtin_isdigit): Ditto.
> 	* except.c (duplicate_eh_regions_1): Tolerate NULL labels.
> 	* tree-cfg.c (struct rus_data, remove_useless_stmts_warn_notreached,
> 	remove_useless_stmts_cond, remove_useless_stmts_tf,
> 	remove_useless_stmts_tc, remove_useless_stmts_bind,
> 	remove_useless_stmts_goto, remove_useless_stmts_label,
> 	remove_useless_stmts_1, remove_useless_stmts,
> 	pass_remove_useless_stmts): Remove.
> 	* tree-pass.h (pass_remove_useless_stmts): Don't declare.
> 	* passes.c (init_optimization_passes): Don't add
> 	pass_remove_useless_stmts.
> 	* tree-eh.c (lower_eh_constructs_2): Handle empty cleanups.
> 	* tree.c (free_lang_data_in_decl): Don't clear DECL_INITIAL of
> 	static constants.
> 	* lto-symtab.c (lto_symtab_merge_decl): Accepts DECL_INITIAL
> 	for static constants.
> 	* lto-streamer-out.c (output_gimple_stmt): Handle GIMPLE_NOP.
> 	* lto-streamer-in.c (input_gimple_stmt): Handle GIMPLE_NOP.
>
> testsuite/
> 	* gcc.dg/tree-ssa/foldstring-1.c: Use fre dump.
> 	* gcc.dg/tree-ssa/useless-1.c: Use gimple dump.
> 	* gcc.dg/pr41573.c: New test.
>    


This patch introduced following testsuite failures [1]:

FAIL: gcc.dg/plugin/one_time-test-1.c -fplugin=./one_time_plugin.so (internal compiler error)
FAIL: gcc.dg/plugin/one_time-test-1.c -fplugin=./one_time_plugin.so (test for excess errors)


Regstrapped on x86_64-linux, no regressions, all languages+Ada.  Okay for
trunk?

Hm...


The problem is, that the plugin wants to plug itself after now removed 
"useless" pass, so the test needs to be updated (author CC'd).

IMO, gcc should exit with some kind of descriptive error instead of 
abort with ICE:

cc1: internal compiler error: in register_pass, at passes.c:620
...

which happens to be triggered at:

   /* Try to insert the new pass to the pass lists. We need to check all
      three lists as the reference pass could be in one (or all) of 
them.  */
   if (!position_pass (pass_info, &all_lowering_passes)
&& !position_pass (pass_info, &all_small_ipa_passes)
&& !position_pass (pass_info, &all_regular_ipa_passes)
&& !position_pass (pass_info, &all_lto_gen_passes)
&& !position_pass (pass_info, &all_passes))
     gcc_unreachable ();
   else
     ...

[1] http://gcc.gnu.org/ml/gcc-testresults/2009-10/msg00837.html

Uros.



More information about the Gcc-patches mailing list