diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-06 14:30:33 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-06 14:30:33 +0000 |
commit | 6c86f9ee277f12c56e5e0bd13ca228cf5fb6d88a (patch) | |
tree | e5e1af94eb1502ba893bd6ce4a11f68877ff62a9 /gcc | |
parent | badff076649bf7f653a97999208b15fa8062b695 (diff) | |
parent | 5c3f3470f97a047819f593b60db38cf7a34b8187 (diff) |
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@210111 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
110 files changed, 624 insertions, 429 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 74aa6785005b..cd6a42ff029a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,120 @@ +2014-05-06 Jan-Benedict Glaw <jbglaw@lug-owl.de> + + * config/avr/avr.c (avr_can_eliminate): Mark unused argument. + +2014-05-06 Richard Biener <rguenther@suse.de> + + * tree-pass.h (TODO_verify_ssa, TODO_verify_flow, + TODO_verify_stmts, TODO_verify_rtl_sharing): Remove. + (TODO_verify_all): Adjust. + * asan.c: Remove references to TODO_verify_ssa, TODO_verify_flow, + TODO_verify_stmts and TODO_verify_rtl_sharing. + * bb-reorder.c: Likewise. + * cfgexpand.c: Likewise. + * cprop.c: Likewise. + * cse.c: Likewise. + * function.c: Likewise. + * fwprop.c: Likewise. + * gcse.c: Likewise. + * gimple-ssa-isolate-paths.c: Likewise. + * gimple-ssa-strength-reduction.c: Likewise. + * ipa-split.c: Likewise. + * loop-init.c: Likewise. + * loop-unroll.c: Likewise. + * lower-subreg.c: Likewise. + * modulo-sched.c: Likewise. + * postreload-gcse.c: Likewise. + * predict.c: Likewise. + * recog.c: Likewise. + * sched-rgn.c: Likewise. + * store-motion.c: Likewise. + * tracer.c: Likewise. + * trans-mem.c: Likewise. + * tree-call-cdce.c: Likewise. + * tree-cfg.c: Likewise. + * tree-cfgcleanup.c: Likewise. + * tree-complex.c: Likewise. + * tree-eh.c: Likewise. + * tree-emutls.c: Likewise. + * tree-if-conv.c: Likewise. + * tree-into-ssa.c: Likewise. + * tree-loop-distribution.c: Likewise. + * tree-object-size.c: Likewise. + * tree-parloops.c: Likewise. + * tree-pass.h: Likewise. + * tree-sra.c: Likewise. + * tree-ssa-ccp.c: Likewise. + * tree-ssa-copy.c: Likewise. + * tree-ssa-copyrename.c: Likewise. + * tree-ssa-dce.c: Likewise. + * tree-ssa-dom.c: Likewise. + * tree-ssa-dse.c: Likewise. + * tree-ssa-forwprop.c: Likewise. + * tree-ssa-ifcombine.c: Likewise. + * tree-ssa-loop-ch.c: Likewise. + * tree-ssa-loop-ivcanon.c: Likewise. + * tree-ssa-loop.c: Likewise. + * tree-ssa-math-opts.c: Likewise. + * tree-ssa-phiopt.c: Likewise. + * tree-ssa-phiprop.c: Likewise. + * tree-ssa-pre.c: Likewise. + * tree-ssa-reassoc.c: Likewise. + * tree-ssa-sink.c: Likewise. + * tree-ssa-strlen.c: Likewise. + * tree-ssa-tail-merge.c: Likewise. + * tree-ssa-uncprop.c: Likewise. + * tree-switch-conversion.c: Likewise. + * tree-tailcall.c: Likewise. + * tree-vect-generic.c: Likewise. + * tree-vectorizer.c: Likewise. + * tree-vrp.c: Likewise. + * tsan.c: Likewise. + * var-tracking.c: Likewise. + * bt-load.c: Likewise. + * cfgcleanup.c: Likewise. + * combine-stack-adj.c: Likewise. + * combine.c: Likewise. + * compare-elim.c: Likewise. + * config/epiphany/resolve-sw-modes.c: Likewise. + * config/i386/i386.c: Likewise. + * config/mips/mips.c: Likewise. + * config/s390/s390.c: Likewise. + * config/sh/sh_treg_combine.cc: Likewise. + * config/sparc/sparc.c: Likewise. + * dce.c: Likewise. + * dse.c: Likewise. + * final.c: Likewise. + * ifcvt.c: Likewise. + * mode-switching.c: Likewise. + * passes.c: Likewise. + * postreload.c: Likewise. + * ree.c: Likewise. + * reg-stack.c: Likewise. + * regcprop.c: Likewise. + * regrename.c: Likewise. + * web.c: Likewise. + +2014-05-06 Richard Biener <rguenther@suse.de> + + PR middle-end/61070 + * bitmap.c (debug_bitmap): Dump to stderr, not stdout. + * tree-ssa-structalias.c (dump_solution_for_var): Likewise. + +2014-05-05 Jan Hubicka <hubicka@ucw.cz> + + PR ipa/60965 + * ipa-devirt.c (get_class_context): Allow POD to change to non-POD. + +2014-05-05 Radovan Obradovic <robradovic@mips.com> + Tom de Vries <tom@codesourcery.com> + + * target.def (call_fusage_contains_non_callee_clobbers): New DEFHOOKPOD. + * doc/tm.texi.in (@node Stack and Calling): Add Miscellaneous Register + Hooks to @menu. + (@node Miscellaneous Register Hooks): New node. + (@hook TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS): New hook. + * doc/tm.texi: Regenerate. + 2014-05-05 Marek Polacek <polacek@redhat.com> PR driver/61065 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index d43065abe470..6696ff3d2e80 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20140505 +20140506 diff --git a/gcc/asan.c b/gcc/asan.c index d7c282e312e4..118f9fccc292 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -2506,8 +2506,7 @@ const pass_data pass_data_asan = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_flow | TODO_verify_stmts - | TODO_update_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_asan : public gimple_opt_pass @@ -2545,8 +2544,7 @@ const pass_data pass_data_asan_O0 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_flow | TODO_verify_stmts - | TODO_update_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_asan_O0 : public gimple_opt_pass @@ -2585,8 +2583,7 @@ const pass_data pass_data_sanopt = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_flow | TODO_verify_stmts - | TODO_update_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_sanopt : public gimple_opt_pass diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index db490f1f8760..9581c71dedcf 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -2315,7 +2315,7 @@ const pass_data pass_data_reorder_blocks = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_reorder_blocks : public rtl_opt_pass @@ -2385,7 +2385,7 @@ const pass_data pass_data_duplicate_computed_gotos = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_duplicate_computed_gotos : public rtl_opt_pass @@ -2749,7 +2749,7 @@ pass_partition_blocks::execute (function *fun) df_analyze (); } - return TODO_verify_flow | TODO_verify_rtl_sharing; + return 0; } } // anon namespace diff --git a/gcc/bitmap.c b/gcc/bitmap.c index 4855a6691ead..c4d81581f14c 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -2117,7 +2117,7 @@ debug_bitmap_file (FILE *file, const_bitmap head) DEBUG_FUNCTION void debug_bitmap (const_bitmap head) { - debug_bitmap_file (stdout, head); + debug_bitmap_file (stderr, head); } /* Function to print out the contents of a bitmap. Unlike debug_bitmap_file, diff --git a/gcc/bt-load.c b/gcc/bt-load.c index 53c5f5804617..757a3e79b57b 100644 --- a/gcc/bt-load.c +++ b/gcc/bt-load.c @@ -1507,7 +1507,7 @@ const pass_data pass_data_branch_target_load_optimize1 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_branch_target_load_optimize1 : public rtl_opt_pass diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 3c9732395d36..e347b3274773 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2014-05-06 Richard Biener <rguenther@suse.de> + + * c-opts.c (c_common_post_options): For -freestanding, + -fno-hosted and -fno-builtin disable pattern recognition + if not enabled explicitely. + 2014-05-02 Marek Polacek <polacek@redhat.com> * c.opt (Wsizeof-pointer-memaccess): Describe option. diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index e162e49a18a8..29e9a355beed 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -851,6 +851,12 @@ c_common_post_options (const char **pfilename) if (flag_objc_exceptions && !flag_objc_sjlj_exceptions) flag_exceptions = 1; + /* If -ffreestanding, -fno-hosted or -fno-builtin then disable + pattern recognition. */ + if (!global_options_set.x_flag_tree_loop_distribute_patterns + && flag_no_builtin) + flag_tree_loop_distribute_patterns = 0; + /* -Woverlength-strings is off by default, but is enabled by -Wpedantic. It is never enabled in C++, as the minimum limit is not normative in that standard. */ diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index d793a70b4dbc..caa4c5f0a273 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -3091,7 +3091,7 @@ const pass_data pass_data_jump = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_jump : public rtl_opt_pass @@ -3138,7 +3138,7 @@ const pass_data pass_data_jump2 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_jump2 : public rtl_opt_pass diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 78eca25f4937..b57fac17eaef 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -5558,8 +5558,7 @@ const pass_data pass_data_expand = | PROP_gimple_lvec ), /* properties_required */ PROP_rtl, /* properties_provided */ ( PROP_ssa | PROP_trees ), /* properties_destroyed */ - ( TODO_verify_ssa | TODO_verify_flow - | TODO_verify_stmts ), /* todo_flags_start */ + 0, /* todo_flags_start */ 0, /* todo_flags_finish */ }; diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c index 399beb4c1bfd..11434dd0cca4 100644 --- a/gcc/combine-stack-adj.c +++ b/gcc/combine-stack-adj.c @@ -641,7 +641,7 @@ const pass_data pass_data_stack_adjustments = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_stack_adjustments : public rtl_opt_pass diff --git a/gcc/combine.c b/gcc/combine.c index 1dba5aac7d38..a2f42c58ccd1 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -13891,7 +13891,7 @@ const pass_data pass_data_combine = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_combine : public rtl_opt_pass diff --git a/gcc/compare-elim.c b/gcc/compare-elim.c index 7555d48c6132..a3737990aec6 100644 --- a/gcc/compare-elim.c +++ b/gcc/compare-elim.c @@ -656,8 +656,7 @@ const pass_data pass_data_compare_elim_after_reload = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_df_verify - | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + ( TODO_df_finish | TODO_df_verify ), /* todo_flags_finish */ }; class pass_compare_elim_after_reload : public rtl_opt_pass diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 9f87adaee005..2edc78ac041e 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -742,7 +742,7 @@ avr_allocate_stack_slots_for_args (void) /* Return true if register FROM can be eliminated via register TO. */ static bool -avr_can_eliminate (const int from, const int to) +avr_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to) { return ((frame_pointer_needed && to == FRAME_POINTER_REGNUM) || !frame_pointer_needed); diff --git a/gcc/config/epiphany/resolve-sw-modes.c b/gcc/config/epiphany/resolve-sw-modes.c index fa8fea509772..f65fe2a635ed 100644 --- a/gcc/config/epiphany/resolve-sw-modes.c +++ b/gcc/config/epiphany/resolve-sw-modes.c @@ -51,7 +51,7 @@ const pass_data pass_data_resolve_sw_modes = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_resolve_sw_modes : public rtl_opt_pass diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index f86c8e135dc7..01ad5e50193a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -2527,7 +2527,7 @@ const pass_data pass_data_insert_vzeroupper = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_insert_vzeroupper : public rtl_opt_pass diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 29d0ac16102c..35844ad275ab 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -16543,7 +16543,7 @@ const pass_data pass_data_mips_machine_reorg2 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_mips_machine_reorg2 : public rtl_opt_pass diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 6c22c0604c3d..ef080ad6c799 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -8642,8 +8642,7 @@ const pass_data pass_data_s390_early_mach = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_verify | TODO_df_finish - | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + ( TODO_df_verify | TODO_df_finish ), /* todo_flags_finish */ }; class pass_s390_early_mach : public rtl_opt_pass diff --git a/gcc/config/sh/sh_treg_combine.cc b/gcc/config/sh/sh_treg_combine.cc index 254847971722..ebc80a507687 100644 --- a/gcc/config/sh/sh_treg_combine.cc +++ b/gcc/config/sh/sh_treg_combine.cc @@ -600,7 +600,6 @@ const pass_data sh_treg_combine::default_pass_data = 0, // properties_destroyed 0, // todo_flags_start TODO_df_finish | TODO_df_verify // todo_flags_finish - | TODO_verify_rtl_sharing }; sh_treg_combine::sh_treg_combine (gcc::context* ctx, bool split_insns, diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index fbce29f71663..ff1e9d154b21 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -1129,7 +1129,7 @@ const pass_data pass_data_work_around_errata = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_work_around_errata : public rtl_opt_pass diff --git a/gcc/cprop.c b/gcc/cprop.c index d29b6f68f271..aef3ee85c711 100644 --- a/gcc/cprop.c +++ b/gcc/cprop.c @@ -1923,8 +1923,7 @@ const pass_data pass_data_rtl_cprop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_rtl_cprop : public rtl_opt_pass diff --git a/gcc/cse.c b/gcc/cse.c index 5ee3f9b7688b..3ca8e1797575 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -7503,8 +7503,7 @@ const pass_data pass_data_cse = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_cse : public rtl_opt_pass @@ -7576,8 +7575,7 @@ const pass_data pass_data_cse2 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_cse2 : public rtl_opt_pass @@ -7651,8 +7649,7 @@ const pass_data pass_data_cse_after_global_opts = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_cse_after_global_opts : public rtl_opt_pass diff --git a/gcc/dce.c b/gcc/dce.c index 344e31af0746..0e245779fcd7 100644 --- a/gcc/dce.c +++ b/gcc/dce.c @@ -792,7 +792,7 @@ const pass_data pass_data_ud_rtl_dce = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_ud_rtl_dce : public rtl_opt_pass @@ -1224,7 +1224,7 @@ const pass_data pass_data_fast_rtl_dce = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_fast_rtl_dce : public rtl_opt_pass diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index e01cbd953f86..fd4e4fd6628b 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3091,6 +3091,7 @@ This describes the stack layout and calling conventions. * Profiling:: * Tail Calls:: * Stack Smashing Protection:: +* Miscellaneous Register Hooks:: @end menu @node Frame Layout @@ -5020,6 +5021,21 @@ normally defined in @file{libgcc2.c}. Whether this target supports splitting the stack when the options described in @var{opts} have been passed. This is called after options have been parsed, so the target may reject splitting the stack in some configurations. The default version of this hook returns false. If @var{report} is true, this function may issue a warning or error; if @var{report} is false, it must simply return a value @end deftypefn +@node Miscellaneous Register Hooks +@subsection Miscellaneous register hooks +@cindex miscellaneous register hooks + +@deftypevr {Target Hook} bool TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS +set to true if all the calls in the current function contain clobbers in +CALL_INSN_FUNCTION_USAGE for the registers that are clobbered by the call +rather than by the callee, and are not already set or clobbered in the call +pattern. Examples of such registers are registers used in PLTs and stubs, +and temporary registers used in the call instruction but not present in the +rtl pattern. Another way to formulate it is the registers not present in the +rtl pattern that are clobbered by the call assuming the callee does not +clobber any register. The default version of this hook is set to false. +@end deftypevr + @node Varargs @section Implementing the Varargs Macros @cindex varargs implementation diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index bbb032e217fa..9c030df6990e 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -2720,6 +2720,7 @@ This describes the stack layout and calling conventions. * Profiling:: * Tail Calls:: * Stack Smashing Protection:: +* Miscellaneous Register Hooks:: @end menu @node Frame Layout @@ -3987,6 +3988,12 @@ the function prologue. Normally, the profiling code comes after. @hook TARGET_SUPPORTS_SPLIT_STACK +@node Miscellaneous Register Hooks +@subsection Miscellaneous register hooks +@cindex miscellaneous register hooks + +@hook TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS + @node Varargs @section Implementing the Varargs Macros @cindex varargs implementation diff --git a/gcc/dse.c b/gcc/dse.c index 88b8c373bbf5..167920cf098e 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -3720,7 +3720,7 @@ const pass_data pass_data_rtl_dse1 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_rtl_dse1 : public rtl_opt_pass @@ -3761,7 +3761,7 @@ const pass_data pass_data_rtl_dse2 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_rtl_dse2 : public rtl_opt_pass diff --git a/gcc/final.c b/gcc/final.c index d3e0bba015e0..327143093fe5 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -861,7 +861,7 @@ const pass_data pass_data_compute_alignments = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_compute_alignments : public rtl_opt_pass diff --git a/gcc/function.c b/gcc/function.c index 383a52a8fc0b..38ccb133988e 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -7018,9 +7018,8 @@ const pass_data pass_data_thread_prologue_and_epilogue = 0, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ - TODO_verify_flow, /* todo_flags_start */ - ( TODO_df_verify | TODO_df_finish - | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + 0, /* todo_flags_start */ + ( TODO_df_verify | TODO_df_finish ), /* todo_flags_finish */ }; class pass_thread_prologue_and_epilogue : public rtl_opt_pass diff --git a/gcc/fwprop.c b/gcc/fwprop.c index 6960d62e250c..0179bf1a5780 100644 --- a/gcc/fwprop.c +++ b/gcc/fwprop.c @@ -1496,8 +1496,7 @@ const pass_data pass_data_rtl_fwprop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_flow - | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_rtl_fwprop : public rtl_opt_pass @@ -1562,7 +1561,7 @@ const pass_data pass_data_rtl_fwprop_addr = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_rtl_fwprop_addr : public rtl_opt_pass diff --git a/gcc/gcse.c b/gcc/gcse.c index d88b2750d52b..84a114799b25 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -4196,8 +4196,7 @@ const pass_data pass_data_rtl_pre = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_rtl_pre : public rtl_opt_pass @@ -4248,8 +4247,7 @@ const pass_data pass_data_rtl_hoist = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_rtl_hoist : public rtl_opt_pass diff --git a/gcc/gimple-ssa-isolate-paths.c b/gcc/gimple-ssa-isolate-paths.c index b01417d09e59..298e14ccd1da 100644 --- a/gcc/gimple-ssa-isolate-paths.c +++ b/gcc/gimple-ssa-isolate-paths.c @@ -426,7 +426,7 @@ const pass_data pass_data_isolate_erroneous_paths = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_isolate_erroneous_paths : public gimple_opt_pass diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index af9f26d2e9c8..a41d9722dae1 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -3601,7 +3601,7 @@ const pass_data pass_data_strength_reduction = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_strength_reduction : public gimple_opt_pass diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index a468beed742b..b4267ab98737 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,21 @@ +2014-05-06 Chris Manghane <cmang@google.com> + + * go-c.h (go_create_gogo): Update declaration to add + check_divide_zero and check_divide_overflow parameters. + * go-lang.c (go_langhook_init): Pass new arguments to + go_create_gogo. + +2014-05-05 Chris Manghane <cmang@google.com> + + * go-gcc.cc (Gcc_backend::implicit_variable): Rename from + gc_root_variable. Add name and is_constant parameters. + +2014-05-05 Chris Manghane <cmang@google.com> + + * go-gcc.cc (Gcc_backend::indirect_expression): Add btype + parameter. + (Gcc_backend::temporary_variable): Check for erroneous function. + 2014-04-30 Chris Manghane <cmang@google.com> * go-backend.c: #include "diagnostics.h". diff --git a/gcc/go/go-c.h b/gcc/go/go-c.h index cb10f2b7be71..5f5ac0da9bc8 100644 --- a/gcc/go/go-c.h +++ b/gcc/go/go-c.h @@ -34,7 +34,8 @@ extern void go_add_search_path (const char*); extern void go_create_gogo (int int_type_size, int pointer_size, const char* pkgpath, const char *prefix, - const char *relative_import_path); + const char *relative_import_path, + bool check_divide_zero, bool check_divide_overflow); extern void go_parse_input_files (const char**, unsigned int, bool only_check_syntax, diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index 45827a08ea28..f4c242f60aa8 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -229,7 +229,7 @@ class Gcc_backend : public Backend var_expression(Bvariable* var, Location); Bexpression* - indirect_expression(Bexpression* expr, bool known_valid, Location); + indirect_expression(Btype*, Bexpression* expr, bool known_valid, Location); Bexpression* named_constant_expression(Btype* btype, const std::string& name, @@ -381,7 +381,7 @@ class Gcc_backend : public Backend Location, Bstatement**); Bvariable* - gc_root_variable(Btype*, Bexpression*); + implicit_variable(const std::string&, Btype*, Bexpression*, bool); Bvariable* immutable_struct(const std::string&, bool, bool, Btype*, Location); @@ -1146,14 +1146,26 @@ Gcc_backend::var_expression(Bvariable* var, Location) // An expression that indirectly references an expression. Bexpression* -Gcc_backend::indirect_expression(Bexpression* expr, bool known_valid, - Location location) +Gcc_backend::indirect_expression(Btype* btype, Bexpression* expr, + bool known_valid, Location location) { + tree expr_tree = expr->get_tree(); + tree type_tree = btype->get_tree(); + if (expr_tree == error_mark_node || type_tree == error_mark_node) + return this->error_expression(); + + // If the type of EXPR is a recursive pointer type, then we + // need to insert a cast before indirecting. + tree target_type_tree = TREE_TYPE(TREE_TYPE(expr_tree)); + if (VOID_TYPE_P(target_type_tree)) + expr_tree = fold_convert_loc(location.gcc_location(), + build_pointer_type(type_tree), expr_tree); + tree ret = build_fold_indirect_ref_loc(location.gcc_location(), - expr->get_tree()); + expr_tree); if (known_valid) TREE_THIS_NOTRAP(ret) = 1; - return tree_to_expr(ret); + return this->make_expression(ret); } // Return an expression that declares a constant named NAME with the @@ -2405,17 +2417,18 @@ Gcc_backend::temporary_variable(Bfunction* function, Bblock* bblock, Location location, Bstatement** pstatement) { + gcc_assert(function != NULL); + tree decl = function->get_tree(); tree type_tree = btype->get_tree(); tree init_tree = binit == NULL ? NULL_TREE : binit->get_tree(); - if (type_tree == error_mark_node || init_tree == error_mark_node) + if (type_tree == error_mark_node + || init_tree == error_mark_node + || decl == error_mark_node) { *pstatement = this->error_statement(); return this->error_variable(); } - gcc_assert(function != NULL); - tree decl = function->get_tree(); - tree var; // We can only use create_tmp_var if the type is not addressable. if (!TREE_ADDRESSABLE(type_tree)) @@ -2462,10 +2475,12 @@ Gcc_backend::temporary_variable(Bfunction* function, Bblock* bblock, return new Bvariable(var); } -// Make a GC root variable. +// Create an implicit variable that is compiler-defined. This is used when +// generating GC root variables and storing the values of a slice initializer. Bvariable* -Gcc_backend::gc_root_variable(Btype* type, Bexpression* init) +Gcc_backend::implicit_variable(const std::string& name, Btype* type, + Bexpression* init, bool is_constant) { tree type_tree = type->get_tree(); tree init_tree = init->get_tree(); @@ -2473,11 +2488,16 @@ Gcc_backend::gc_root_variable(Btype* type, Bexpression* init) return this->error_variable(); tree decl = build_decl(BUILTINS_LOCATION, VAR_DECL, - create_tmp_var_name("gc"), type_tree); + get_identifier_from_string(name), type_tree); DECL_EXTERNAL(decl) = 0; TREE_PUBLIC(decl) = 0; TREE_STATIC(decl) = 1; DECL_ARTIFICIAL(decl) = 1; + if (is_constant) + { + TREE_READONLY(decl) = 1; + TREE_CONSTANT(decl) = 1; + } DECL_INITIAL(decl) = init_tree; rest_of_decl_compilation(decl, 1, 0); diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c index 3599aa85e545..f6e865e08cf7 100644 --- a/gcc/go/go-lang.c +++ b/gcc/go/go-lang.c @@ -104,7 +104,8 @@ go_langhook_init (void) build_common_builtin_nodes (because it calls, indirectly, go_type_for_size). */ go_create_gogo (INT_TYPE_SIZE, POINTER_SIZE, go_pkgpath, go_prefix, - go_relative_import_path); + go_relative_import_path, go_check_divide_zero, + go_check_divide_overflow); build_common_builtin_nodes (); diff --git a/gcc/go/gofrontend/backend.h b/gcc/go/gofrontend/backend.h index 786223fe736c..95f494accfc3 100644 --- a/gcc/go/gofrontend/backend.h +++ b/gcc/go/gofrontend/backend.h @@ -253,9 +253,11 @@ class Backend // Create an expression that indirects through the pointer expression EXPR // (i.e., return the expression for *EXPR). KNOWN_VALID is true if the pointer - // is known to point to a valid memory location. + // is known to point to a valid memory location. BTYPE is the expected type + // of the indirected EXPR. virtual Bexpression* - indirect_expression(Bexpression* expr, bool known_valid, Location) = 0; + indirect_expression(Btype* btype, Bexpression* expr, bool known_valid, + Location) = 0; // Return an expression that declares a constant named NAME with the // constant value VAL in BTYPE. @@ -534,11 +536,16 @@ class Backend bool address_is_taken, Location location, Bstatement** pstatement) = 0; - // Create a GC root variable. TYPE is the __go_gc_root_list struct described - // in Gogo::register_gc_vars. INIT is the composite literal consisting of a - // pointer to the next GC root and the global variables registered. + // Create an implicit variable that is compiler-defined. This is used when + // generating GC root variables and storing the values of a slice constructor. + // NAME is the name of the variable, either gc# for GC roots or C# for slice + // initializers. TYPE is the type of the implicit variable with an initial + // value INIT. IS_CONSTANT is true if the implicit variable should be treated + // like it is immutable. For slice initializers, if the values must be copied + // to the heap, the variable IS_CONSTANT. virtual Bvariable* - gc_root_variable(Btype* type, Bexpression* init) = 0; + implicit_variable(const std::string& name, Btype* type, Bexpression* init, + bool is_constant) = 0; // Create a named immutable initialized data structure. This is // used for type descriptors, map descriptors, and function diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index a4f959da09d0..df3103b0d1d7 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -760,16 +760,24 @@ Var_expression::do_get_tree(Translate_context* context) context->function()); bool is_in_heap; Location loc = this->location(); + Btype* btype; + Gogo* gogo = context->gogo(); if (this->variable_->is_variable()) - is_in_heap = this->variable_->var_value()->is_in_heap(); + { + is_in_heap = this->variable_->var_value()->is_in_heap(); + btype = this->variable_->var_value()->type()->get_backend(gogo); + } else if (this->variable_->is_result_variable()) - is_in_heap = this->variable_->result_var_value()->is_in_heap(); + { + is_in_heap = this->variable_->result_var_value()->is_in_heap(); + btype = this->variable_->result_var_value()->type()->get_backend(gogo); + } else go_unreachable(); Bexpression* ret = context->backend()->var_expression(bvar, loc); if (is_in_heap) - ret = context->backend()->indirect_expression(ret, true, loc); + ret = context->backend()->indirect_expression(btype, ret, true, loc); return expr_to_tree(ret); } @@ -4105,20 +4113,47 @@ Unary_expression::do_get_tree(Translate_context* context) } } - if (this->is_gc_root_) + static unsigned int counter; + char buf[100]; + if (this->is_gc_root_ || this->is_slice_init_) { - // Build a decl for a GC root variable. GC roots are mutable, so they - // cannot be represented as an immutable_struct in the backend. - Bvariable* gc_root = gogo->backend()->gc_root_variable(btype, bexpr); - bexpr = gogo->backend()->var_expression(gc_root, loc); + bool copy_to_heap = false; + if (this->is_gc_root_) + { + // Build a decl for a GC root variable. GC roots are mutable, so + // they cannot be represented as an immutable_struct in the + // backend. + static unsigned int root_counter; + snprintf(buf, sizeof buf, "gc%u", root_counter); + ++root_counter; + } + else + { + // Build a decl for a slice value initializer. An immutable slice + // value initializer may have to be copied to the heap if it + // contains pointers in a non-constant context. + snprintf(buf, sizeof buf, "C%u", counter); + ++counter; + + Array_type* at = this->expr_->type()->array_type(); + go_assert(at != NULL); + + // If we are not copying the value to the heap, we will only + // initialize the value once, so we can use this directly + // rather than copying it. In that case we can't make it + // read-only, because the program is permitted to change it. + copy_to_heap = (at->element_type()->has_pointer() + && !context->is_const()); + } + Bvariable* implicit = + gogo->backend()->implicit_variable(buf, btype, bexpr, copy_to_heap); + bexpr = gogo->backend()->var_expression(implicit, loc); } else if ((this->expr_->is_composite_literal() || this->expr_->string_expression() != NULL) && this->expr_->is_immutable()) { // Build a decl for a constant constructor. - static unsigned int counter; - char buf[100]; snprintf(buf, sizeof buf, "C%u", counter); ++counter; @@ -4168,20 +4203,7 @@ Unary_expression::do_get_tree(Translate_context* context) } } - - // If the type of EXPR is a recursive pointer type, then we - // need to insert a cast before indirecting. - tree expr = expr_to_tree(bexpr); - tree target_type_tree = TREE_TYPE(TREE_TYPE(expr)); - if (VOID_TYPE_P(target_type_tree)) - { - tree ind = type_to_tree(pbtype); - expr = fold_convert_loc(loc.gcc_location(), - build_pointer_type(ind), expr); - bexpr = tree_to_expr(expr); - } - - ret = gogo->backend()->indirect_expression(bexpr, false, loc); + ret = gogo->backend()->indirect_expression(pbtype, bexpr, false, loc); } break; @@ -5410,7 +5432,7 @@ Binary_expression::lower_compare_to_memcmp(Gogo*, Statement_inserter* inserter) } Expression* -Binary_expression::do_flatten(Gogo*, Named_object*, +Binary_expression::do_flatten(Gogo* gogo, Named_object*, Statement_inserter* inserter) { Location loc = this->location(); @@ -5440,11 +5462,9 @@ Binary_expression::do_flatten(Gogo*, Named_object*, left_type->integer_type() != NULL) || this->op_ == OPERATOR_MOD); - // FIXME: go_check_divide_zero and go_check_divide_overflow are globals - // defined in gcc/go/lang.opt. These should be defined in go_create_gogo - // and accessed from the Gogo* passed to do_flatten. if (is_shift_op - || (is_idiv_op && (go_check_divide_zero || go_check_divide_overflow))) + || (is_idiv_op + && (gogo->check_divide_by_zero() || gogo->check_divide_overflow()))) { if (!this->left_->is_variable()) { @@ -6024,7 +6044,7 @@ Binary_expression::do_get_tree(Translate_context* context) // Add checks for division by zero and division overflow as needed. if (is_idiv_op) { - if (go_check_divide_zero) + if (gogo->check_divide_by_zero()) { // right == 0 Bexpression* zero_expr = @@ -6043,7 +6063,7 @@ Binary_expression::do_get_tree(Translate_context* context) crash_expr, ret, loc); } - if (go_check_divide_overflow) + if (gogo->check_divide_overflow()) { // right == -1 // FIXME: It would be nice to say that this test is expected @@ -10329,7 +10349,10 @@ Array_index_expression::do_get_tree(Translate_context* context) array_type->get_value_pointer(gogo, this->array_); Bexpression* ptr = tree_to_expr(valptr->get_tree(context)); ptr = gogo->backend()->pointer_offset_expression(ptr, start, loc); - ret = gogo->backend()->indirect_expression(ptr, true, loc); + + Type* ele_type = this->array_->type()->array_type()->element_type(); + Btype* ele_btype = ele_type->get_backend(gogo); + ret = gogo->backend()->indirect_expression(ele_btype, ptr, true, loc); } return expr_to_tree(ret); } @@ -10667,7 +10690,9 @@ String_index_expression::do_get_tree(Translate_context* context) Bexpression* bstart = tree_to_expr(start->get_tree(context)); Bexpression* ptr = tree_to_expr(bytes->get_tree(context)); ptr = gogo->backend()->pointer_offset_expression(ptr, bstart, loc); - Bexpression* index = gogo->backend()->indirect_expression(ptr, true, loc); + Btype* ubtype = Type::lookup_integer_type("uint8")->get_backend(gogo); + Bexpression* index = + gogo->backend()->indirect_expression(ubtype, ptr, true, loc); Btype* byte_btype = bytes->type()->points_to()->get_backend(gogo); Bexpression* index_error = tree_to_expr(bad_index->get_tree(context)); @@ -12450,6 +12475,7 @@ Slice_construction_expression::do_get_tree(Translate_context* context) return error_mark_node; } + Location loc = this->location(); Type* element_type = array_type->element_type(); if (this->valtype_ == NULL) { @@ -12464,35 +12490,24 @@ Slice_construction_expression::do_get_tree(Translate_context* context) else mpz_init_set_ui(lenval, this->indexes()->back() + 1); } - Location loc = this->location(); Type* int_type = Type::lookup_integer_type("int"); length = Expression::make_integer(&lenval, int_type, loc); mpz_clear(lenval); this->valtype_ = Type::make_array_type(element_type, length); } - tree values; - Gogo* gogo = context->gogo(); - Btype* val_btype = this->valtype_->get_backend(gogo); + Expression_list* vals = this->vals(); if (this->vals() == NULL || this->vals()->empty()) { - // We need to create a unique value. - Btype* int_btype = Type::lookup_integer_type("int")->get_backend(gogo); - Bexpression* zero = gogo->backend()->zero_expression(int_btype); - std::vector<unsigned long> index(1, 0); - std::vector<Bexpression*> val(1, zero); - Bexpression* ctor = - gogo->backend()->array_constructor_expression(val_btype, index, val, - this->location()); - values = expr_to_tree(ctor); + // We need to create a unique value for the empty array literal. + vals = new Expression_list; + vals->push_back(NULL); } - else - values = expr_to_tree(this->get_constructor(context, val_btype)); - - if (values == error_mark_node) - return error_mark_node; + Expression* array_val = + new Fixed_array_construction_expression(this->valtype_, this->indexes(), + vals, loc); - bool is_constant_initializer = TREE_CONSTANT(values); + bool is_constant_initializer = array_val->is_immutable(); // We have to copy the initial values into heap memory if we are in // a function or if the values are not constants. We also have to @@ -12503,89 +12518,22 @@ Slice_construction_expression::do_get_tree(Translate_context* context) || (element_type->has_pointer() && !context->is_const())); - if (is_constant_initializer) - { - tree tmp = build_decl(this->location().gcc_location(), VAR_DECL, - create_tmp_var_name("C"), TREE_TYPE(values)); - DECL_EXTERNAL(tmp) = 0; - TREE_PUBLIC(tmp) = 0; - TREE_STATIC(tmp) = 1; - DECL_ARTIFICIAL(tmp) = 1; - if (copy_to_heap) - { - // If we are not copying the value to the heap, we will only - // initialize the value once, so we can use this directly - // rather than copying it. In that case we can't make it - // read-only, because the program is permitted to change it. - TREE_READONLY(tmp) = 1; - TREE_CONSTANT(tmp) = 1; - } - DECL_INITIAL(tmp) = values; - rest_of_decl_compilation(tmp, 1, 0); - values = tmp; - } - - tree space; - tree set; + Expression* space; if (!copy_to_heap) { - // the initializer will only run once. - space = build_fold_addr_expr(values); - set = NULL_TREE; + // The initializer will only run once. + space = Expression::make_unary(OPERATOR_AND, array_val, loc); + space->unary_expression()->set_is_slice_init(); } else - { - Expression* alloc = - context->gogo()->allocate_memory(this->valtype_, this->location()); - space = save_expr(alloc->get_tree(context)); - - tree s = fold_convert(build_pointer_type(TREE_TYPE(values)), space); - tree ref = build_fold_indirect_ref_loc(this->location().gcc_location(), - s); - TREE_THIS_NOTRAP(ref) = 1; - set = build2(MODIFY_EXPR, void_type_node, ref, values); - } + space = Expression::make_heap_expression(array_val, loc); // Build a constructor for the slice. - tree type_tree = type_to_tree(this->type()->get_backend(context->gogo())); - if (type_tree == error_mark_node) - return error_mark_node; - go_assert(TREE_CODE(type_tree) == RECORD_TYPE); - - vec<constructor_elt, va_gc> *init; - vec_alloc(init, 3); - - constructor_elt empty = {NULL, NULL}; - constructor_elt* elt = init->quick_push(empty); - tree field = TYPE_FIELDS(type_tree); - go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__values") == 0); - elt->index = field; - elt->value = fold_convert(TREE_TYPE(field), space); - - tree length_tree = this->valtype_->array_type()->length()->get_tree(context); - elt = init->quick_push(empty); - field = DECL_CHAIN(field); - go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__count") == 0); - elt->index = field; - elt->value = fold_convert(TREE_TYPE(field), length_tree); - - elt = init->quick_push(empty); - field = DECL_CHAIN(field); - go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)),"__capacity") == 0); - elt->index = field; - elt->value = fold_convert(TREE_TYPE(field), length_tree); - - tree constructor = build_constructor(type_tree, init); - if (constructor == error_mark_node) - return error_mark_node; - if (!copy_to_heap) - TREE_CONSTANT(constructor) = 1; - - if (set == NULL_TREE) - return constructor; - else - return build2(COMPOUND_EXPR, type_tree, set, constructor); + Expression* len = this->valtype_->array_type()->length(); + Expression* slice_val = + Expression::make_slice_value(this->type(), space, len, len, loc); + return slice_val->get_tree(context); } // Make a slice composite literal. This is used by the type @@ -13816,7 +13764,9 @@ Heap_expression::do_get_tree(Translate_context* context) gogo->backend()->temporary_variable(fndecl, context->bblock(), btype, space, true, loc, &decl); space = gogo->backend()->var_expression(space_temp, loc); - Bexpression* ref = gogo->backend()->indirect_expression(space, true, loc); + Btype* expr_btype = this->expr_->type()->get_backend(gogo); + Bexpression* ref = + gogo->backend()->indirect_expression(expr_btype, space, true, loc); Bexpression* bexpr = tree_to_expr(this->expr_->get_tree(context)); Bstatement* assn = gogo->backend()->assignment_statement(ref, bexpr, loc); @@ -14095,9 +14045,13 @@ Type_info_expression::do_get_tree(Translate_context* context) default: go_unreachable(); } - tree val_type_tree = type_to_tree(this->type()->get_backend(gogo)); - go_assert(val_type_tree != error_mark_node); - return build_int_cstu(val_type_tree, val); + mpz_t cst; + mpz_init_set_ui(cst, val); + Btype* int_btype = this->type()->get_backend(gogo); + Bexpression* ret = + gogo->backend()->integer_constant_expression(int_btype, cst); + mpz_clear(cst); + return expr_to_tree(ret); } // Dump ast representation for a type info expression. @@ -14796,6 +14750,10 @@ class Struct_field_offset_expression : public Expression { } protected: + bool + do_is_immutable() const + { return true; } + Type* do_type() { return Type::lookup_integer_type("uintptr"); } diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index 0936e00bae0e..6f03e02a8c6d 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -1305,7 +1305,7 @@ class Unary_expression : public Expression Unary_expression(Operator op, Expression* expr, Location location) : Expression(EXPRESSION_UNARY, location), op_(op), escapes_(true), create_temp_(false), is_gc_root_(false), - expr_(expr), issue_nil_check_(false) + is_slice_init_(false), expr_(expr), issue_nil_check_(false) { } // Return the operator. @@ -1344,6 +1344,15 @@ class Unary_expression : public Expression this->is_gc_root_ = true; } + // Record that this is an address expression of a slice value initializer, + // which is mutable if the values are not copied to the heap. + void + set_is_slice_init() + { + go_assert(this->op_ == OPERATOR_AND); + this->is_slice_init_ = true; + } + // Apply unary opcode OP to UNC, setting NC. Return true if this // could be done, false if not. Issue errors for overflow. static bool @@ -1427,6 +1436,11 @@ class Unary_expression : public Expression // special struct composite literal that is mutable when addressed, meaning // it cannot be represented as an immutable_struct in the backend. bool is_gc_root_; + // True if this is an address expression for a slice value with an immutable + // initializer. The initializer for a slice's value pointer has an array + // type, meaning it cannot be represented as an immutable_struct in the + // backend. + bool is_slice_init_; // The operand. Expression* expr_; // Whether or not to issue a nil check for this expression if its address diff --git a/gcc/go/gofrontend/go.cc b/gcc/go/gofrontend/go.cc index d2331f3e0ae3..222ea90ae01d 100644 --- a/gcc/go/gofrontend/go.cc +++ b/gcc/go/gofrontend/go.cc @@ -21,7 +21,8 @@ static Gogo* gogo; GO_EXTERN_C void go_create_gogo(int int_type_size, int pointer_size, const char *pkgpath, - const char *prefix, const char *relative_import_path) + const char *prefix, const char *relative_import_path, + bool check_divide_by_zero, bool check_divide_overflow) { go_assert(::gogo == NULL); Linemap* linemap = go_get_linemap(); @@ -34,6 +35,10 @@ go_create_gogo(int int_type_size, int pointer_size, const char *pkgpath, if (relative_import_path != NULL) ::gogo->set_relative_import_path(relative_import_path); + if (check_divide_by_zero) + ::gogo->set_check_divide_by_zero(check_divide_by_zero); + if (check_divide_overflow) + ::gogo->set_check_divide_overflow(check_divide_overflow); } // Parse the input files. diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index ab54f8491e3c..e0ddc2f35ffa 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -5210,7 +5210,10 @@ Function::return_value(Gogo* gogo, Named_object* named_function, Bvariable* bvar = no->get_backend_variable(gogo, named_function); Bexpression* val = gogo->backend()->var_expression(bvar, location); if (no->result_var_value()->is_in_heap()) - val = gogo->backend()->indirect_expression(val, true, location); + { + Btype* bt = no->result_var_value()->type()->get_backend(gogo); + val = gogo->backend()->indirect_expression(bt, val, true, location); + } vals[i] = val; } return gogo->backend()->return_statement(this->fndecl_, vals, location); diff --git a/gcc/go/gofrontend/gogo.h b/gcc/go/gofrontend/gogo.h index 37cbbdf44114..f125201643f5 100644 --- a/gcc/go/gofrontend/gogo.h +++ b/gcc/go/gofrontend/gogo.h @@ -215,7 +215,27 @@ class Gogo // Set the relative import path from a command line option. void set_relative_import_path(const std::string& s) - {this->relative_import_path_ = s; } + { this->relative_import_path_ = s; } + + // Return whether to check for division by zero in binary operations. + bool + check_divide_by_zero() const + { return this->check_divide_by_zero_; } + + // Set the option to check division by zero from a command line option. + void + set_check_divide_by_zero(bool b) + { this->check_divide_by_zero_ = b; } + + // Return whether to check for division overflow in binary operations. + bool + check_divide_overflow() const + { return this->check_divide_overflow_; } + + // Set the option to check division overflow from a command line option. + void + set_check_divide_overflow(bool b) + { this->check_divide_overflow_ = b; } // Return the priority to use for the package we are compiling. // This is two more than the largest priority of any package we @@ -716,6 +736,12 @@ class Gogo // The relative import path, from the -fgo-relative-import-path // option. std::string relative_import_path_; + // Whether or not to check for division by zero, from the + // -fgo-check-divide-zero option. + bool check_divide_by_zero_; + // Whether or not to check for division overflow, from the + // -fgo-check-divide-overflow option. + bool check_divide_overflow_; // A list of types to verify. std::vector<Type*> verify_types_; // A list of interface types defined while parsing. diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 91a535f01c8c..096d87288d48 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -245,7 +245,7 @@ Type::points_to() const return ptype == NULL ? NULL : ptype->points_to(); } -// Return whether this is an open array type. +// Return whether this is a slice type. bool Type::is_slice_type() const @@ -5839,54 +5839,6 @@ Array_type::write_equal_function(Gogo* gogo, Named_type* name) gogo->add_statement(s); } -// Get a tree for the length of a fixed array. The length may be -// computed using a function call, so we must only evaluate it once. - -tree -Array_type::get_length_tree(Gogo* gogo) -{ - go_assert(this->length_ != NULL); - if (this->length_tree_ == NULL_TREE) - { - Numeric_constant nc; - mpz_t val; - if (this->length_->numeric_constant_value(&nc) && nc.to_int(&val)) - { - if (mpz_sgn(val) < 0) - { - this->length_tree_ = error_mark_node; - return this->length_tree_; - } - Type* t = nc.type(); - if (t == NULL) - t = Type::lookup_integer_type("int"); - else if (t->is_abstract()) - t = t->make_non_abstract_type(); - Btype* btype = t->get_backend(gogo); - Bexpression* iexpr = - gogo->backend()->integer_constant_expression(btype, val); - this->length_tree_ = expr_to_tree(iexpr); - mpz_clear(val); - } - else - { - // Make up a translation context for the array length - // expression. FIXME: This won't work in general. - Translate_context context(gogo, NULL, NULL, NULL); - tree len = this->length_->get_tree(&context); - if (len != error_mark_node) - { - Type* int_type = Type::lookup_integer_type("int"); - tree int_type_tree = type_to_tree(int_type->get_backend(gogo)); - len = convert_to_integer(int_type_tree, len); - len = save_expr(len); - } - this->length_tree_ = len; - } - } - return this->length_tree_; -} - // Get the backend representation of the fields of a slice. This is // not declared in types.h so that types.h doesn't have to #include // backend.h. @@ -5927,7 +5879,7 @@ get_backend_slice_fields(Gogo* gogo, Array_type* type, bool use_placeholder, // Get a tree for the type of this array. A fixed array is simply // represented as ARRAY_TYPE with the appropriate index--i.e., it is -// just like an array in C. An open array is a struct with three +// just like an array in C. A slice is a struct with three // fields: a data pointer, the length, and the capacity. Btype* @@ -5958,12 +5910,48 @@ Array_type::get_backend_element(Gogo* gogo, bool use_placeholder) return this->element_type_->get_backend(gogo); } -// Return the backend representation of the length. +// Return the backend representation of the length. The length may be +// computed using a function call, so we must only evaluate it once. Bexpression* Array_type::get_backend_length(Gogo* gogo) { - return tree_to_expr(this->get_length_tree(gogo)); + go_assert(this->length_ != NULL); + if (this->blength_ == NULL) + { + Numeric_constant nc; + mpz_t val; + if (this->length_->numeric_constant_value(&nc) && nc.to_int(&val)) + { + if (mpz_sgn(val) < 0) + { + this->blength_ = gogo->backend()->error_expression(); + return this->blength_; + } + Type* t = nc.type(); + if (t == NULL) + t = Type::lookup_integer_type("int"); + else if (t->is_abstract()) + t = t->make_non_abstract_type(); + Btype* btype = t->get_backend(gogo); + this->blength_ = + gogo->backend()->integer_constant_expression(btype, val); + mpz_clear(val); + } + else + { + // Make up a translation context for the array length + // expression. FIXME: This won't work in general. + Translate_context context(gogo, NULL, NULL, NULL); + this->blength_ = tree_to_expr(this->length_->get_tree(&context)); + + Btype* ibtype = Type::lookup_integer_type("int")->get_backend(gogo); + this->blength_ = + gogo->backend()->convert_expression(ibtype, this->blength_, + this->length_->location()); + } + } + return this->blength_; } // Finish backend representation of the array. @@ -5997,7 +5985,7 @@ Array_type::get_value_pointer(Gogo*, Expression* array) const array->location()); } - // Open array. + // Slice. return Expression::make_slice_info(array, Expression::SLICE_INFO_VALUE_POINTER, array->location()); @@ -6012,7 +6000,7 @@ Array_type::get_length(Gogo*, Expression* array) const if (this->length_ != NULL) return this->length_; - // This is an open array. We need to read the length field. + // This is a slice. We need to read the length field. return Expression::make_slice_info(array, Expression::SLICE_INFO_LENGTH, array->location()); } @@ -6026,7 +6014,7 @@ Array_type::get_capacity(Gogo*, Expression* array) const if (this->length_ != NULL) return this->length_; - // This is an open array. We need to read the capacity field. + // This is a slice. We need to read the capacity field. return Expression::make_slice_info(array, Expression::SLICE_INFO_CAPACITY, array->location()); } @@ -8936,9 +8924,8 @@ Type::finalize_methods(Gogo* gogo, const Type* type, Location location, Methods** all_methods) { *all_methods = NULL; - Types_seen types_seen; - Type::add_methods_for_type(type, NULL, 0, false, false, &types_seen, - all_methods); + std::vector<const Named_type*> seen; + Type::add_methods_for_type(type, NULL, 0, false, false, &seen, all_methods); Type::build_stub_methods(gogo, type, *all_methods, location); } @@ -8956,7 +8943,7 @@ Type::add_methods_for_type(const Type* type, unsigned int depth, bool is_embedded_pointer, bool needs_stub_method, - Types_seen* types_seen, + std::vector<const Named_type*>* seen, Methods** methods) { // Pointer types may not have methods. @@ -8966,19 +8953,24 @@ Type::add_methods_for_type(const Type* type, const Named_type* nt = type->named_type(); if (nt != NULL) { - std::pair<Types_seen::iterator, bool> ins = types_seen->insert(nt); - if (!ins.second) - return; - } + for (std::vector<const Named_type*>::const_iterator p = seen->begin(); + p != seen->end(); + ++p) + { + if (*p == nt) + return; + } - if (nt != NULL) - Type::add_local_methods_for_type(nt, field_indexes, depth, - is_embedded_pointer, needs_stub_method, - methods); + seen->push_back(nt); + + Type::add_local_methods_for_type(nt, field_indexes, depth, + is_embedded_pointer, needs_stub_method, + methods); + } Type::add_embedded_methods_for_type(type, field_indexes, depth, is_embedded_pointer, needs_stub_method, - types_seen, methods); + seen, methods); // If we are called with depth > 0, then we are looking at an // anonymous field of a struct. If such a field has interface type, @@ -8987,6 +8979,9 @@ Type::add_methods_for_type(const Type* type, // following the usual rules for an interface type. if (depth > 0) Type::add_interface_methods_for_type(type, field_indexes, depth, methods); + + if (nt != NULL) + seen->pop_back(); } // Add the local methods for the named type NT to *METHODS. The @@ -9032,7 +9027,7 @@ Type::add_embedded_methods_for_type(const Type* type, unsigned int depth, bool is_embedded_pointer, bool needs_stub_method, - Types_seen* types_seen, + std::vector<const Named_type*>* seen, Methods** methods) { // Look for anonymous fields in TYPE. TYPE has fields if it is a @@ -9076,7 +9071,7 @@ Type::add_embedded_methods_for_type(const Type* type, (needs_stub_method || is_pointer || i > 0), - types_seen, + seen, methods); } } diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h index d2ca1bf27fb3..e6ba995429fc 100644 --- a/gcc/go/gofrontend/types.h +++ b/gcc/go/gofrontend/types.h @@ -1171,14 +1171,11 @@ class Type static tree build_receive_return_type(tree type); - // A hash table we use to avoid infinite recursion. - typedef Unordered_set_hash(const Named_type*, Type_hash_identical, - Type_identical) Types_seen; - // Add all methods for TYPE to the list of methods for THIS. static void add_methods_for_type(const Type* type, const Method::Field_indexes*, - unsigned int depth, bool, bool, Types_seen*, + unsigned int depth, bool, bool, + std::vector<const Named_type*>*, Methods**); static void @@ -1189,7 +1186,8 @@ class Type static void add_embedded_methods_for_type(const Type* type, const Method::Field_indexes*, - unsigned int depth, bool, bool, Types_seen*, + unsigned int depth, bool, bool, + std::vector<const Named_type*>*, Methods**); static void @@ -2305,7 +2303,7 @@ class Array_type : public Type public: Array_type(Type* element_type, Expression* length) : Type(TYPE_ARRAY), - element_type_(element_type), length_(length), length_tree_(NULL) + element_type_(element_type), length_(length), blength_(NULL) { } // Return the element type. @@ -2313,7 +2311,7 @@ class Array_type : public Type element_type() const { return this->element_type_; } - // Return the length. This will return NULL for an open array. + // Return the length. This will return NULL for a slice. Expression* length() const { return this->length_; } @@ -2407,9 +2405,6 @@ class Array_type : public Type bool verify_length(); - tree - get_length_tree(Gogo*); - Expression* array_type_descriptor(Gogo*, Named_type*); @@ -2420,8 +2415,9 @@ class Array_type : public Type Type* element_type_; // The number of elements. This may be NULL. Expression* length_; - // The length as a tree. We only want to compute this once. - tree length_tree_; + // The backend representation of the length. + // We only want to compute this once. + Bexpression* blength_; }; // The type of a map. diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index e8a9fec9d66c..cd2b5dcda03c 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -4544,7 +4544,7 @@ const pass_data pass_data_rtl_ifcvt = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_rtl_ifcvt : public rtl_opt_pass @@ -4592,7 +4592,7 @@ const pass_data pass_data_if_after_combine = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_if_after_combine : public rtl_opt_pass @@ -4639,7 +4639,7 @@ const pass_data pass_data_if_after_reload = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_if_after_reload : public rtl_opt_pass diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index b714ae6dab7a..d0296e7e4c76 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -1137,6 +1137,17 @@ give_up: context->outer_type = expected_type; context->offset = 0; context->maybe_derived_type = true; + context->maybe_in_construction = true; + /* POD can be changed to an instance of a polymorphic type by + placement new. Here we play safe and assume that any + non-polymorphic type is POD. */ + if ((TREE_CODE (type) != RECORD_TYPE + || !TYPE_BINFO (type) + || !polymorphic_type_binfo_p (TYPE_BINFO (type))) + && (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST + || (offset + tree_to_uhwi (TYPE_SIZE (expected_type)) <= + tree_to_uhwi (TYPE_SIZE (type))))) + return true; return false; } diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index eefa1954e302..bd1c08624f91 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -1659,7 +1659,7 @@ const pass_data pass_data_split_functions = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_all, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_split_functions : public gimple_opt_pass @@ -1719,7 +1719,7 @@ const pass_data pass_data_feedback_split_functions = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_all, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_feedback_split_functions : public gimple_opt_pass diff --git a/gcc/loop-init.c b/gcc/loop-init.c index b7f8d9c68c51..3c53b49ba618 100644 --- a/gcc/loop-init.c +++ b/gcc/loop-init.c @@ -382,7 +382,7 @@ const pass_data pass_data_rtl_loop_init = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_rtl_loop_init : public rtl_opt_pass @@ -421,7 +421,7 @@ const pass_data pass_data_rtl_loop_done = 0, /* properties_provided */ PROP_loops, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_flow | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_rtl_loop_done : public rtl_opt_pass @@ -478,8 +478,7 @@ const pass_data pass_data_rtl_move_loop_invariants = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_verify | TODO_df_finish - | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + ( TODO_df_verify | TODO_df_finish ), /* todo_flags_finish */ }; class pass_rtl_move_loop_invariants : public rtl_opt_pass @@ -522,7 +521,7 @@ const pass_data pass_data_rtl_unroll_and_peel_loops = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_rtl_unroll_and_peel_loops : public rtl_opt_pass @@ -585,7 +584,7 @@ const pass_data pass_data_rtl_doloop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_rtl_doloop : public rtl_opt_pass diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index b39ed0bf6571..5797d200d95f 100644 --- a/gcc/loop-unroll.c +++ b/gcc/loop-unroll.c @@ -1026,7 +1026,7 @@ split_edge_and_insert (edge e, rtx insns) CFG. For this purpose we used to set the BB_SUPERBLOCK flag on BB and call break_superblocks when going out of cfglayout mode. But it turns out that this never happens; and that if it does ever happen, - the TODO_verify_flow at the end of the RTL loop passes would fail. + the verify_flow_info at the end of the RTL loop passes would fail. There are two reasons why we expected we could have control flow insns in INSNS. The first is when a comparison has to be done in parts, and diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c index ae935f76459d..916e4ad66a32 100644 --- a/gcc/lower-subreg.c +++ b/gcc/lower-subreg.c @@ -1702,7 +1702,7 @@ const pass_data pass_data_lower_subreg = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_flow, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_lower_subreg : public rtl_opt_pass @@ -1745,8 +1745,7 @@ const pass_data pass_data_lower_subreg2 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_lower_subreg2 : public rtl_opt_pass diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c index b132cba4f2a6..1ae8120ee4d2 100644 --- a/gcc/mode-switching.c +++ b/gcc/mode-switching.c @@ -802,7 +802,7 @@ const pass_data pass_data_mode_switching = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_mode_switching : public rtl_opt_pass diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c index 2e454f553e7a..d3c65c2e78a6 100644 --- a/gcc/modulo-sched.c +++ b/gcc/modulo-sched.c @@ -3339,8 +3339,7 @@ const pass_data pass_data_sms = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_flow - | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_sms : public rtl_opt_pass diff --git a/gcc/passes.c b/gcc/passes.c index 2b3a63c3e596..223b693d2cfb 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -549,7 +549,7 @@ const pass_data pass_data_postreload = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_postreload : public rtl_opt_pass diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c index f5d536335391..af2d731a94de 100644 --- a/gcc/postreload-gcse.c +++ b/gcc/postreload-gcse.c @@ -1330,7 +1330,7 @@ const pass_data pass_data_gcse2 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_rtl_sharing | TODO_verify_flow ), /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_gcse2 : public rtl_opt_pass diff --git a/gcc/postreload.c b/gcc/postreload.c index ea83c3c9b735..47687203d667 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -2328,7 +2328,7 @@ const pass_data pass_data_postreload_cse = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_postreload_cse : public rtl_opt_pass diff --git a/gcc/predict.c b/gcc/predict.c index d8669e39327b..165cc4e2ec65 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -3061,7 +3061,7 @@ const pass_data pass_data_profile = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_profile : public gimple_opt_pass @@ -3126,7 +3126,7 @@ const pass_data pass_data_strip_predict_hints = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_strip_predict_hints : public gimple_opt_pass diff --git a/gcc/recog.c b/gcc/recog.c index 653c5358b741..2f5cf8eb5773 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -3876,7 +3876,7 @@ const pass_data pass_data_peephole2 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_peephole2 : public rtl_opt_pass @@ -4080,7 +4080,7 @@ const pass_data pass_data_split_before_sched2 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_flow, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_split_before_sched2 : public rtl_opt_pass @@ -4128,7 +4128,7 @@ const pass_data pass_data_split_for_shorten_branches = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_rtl_sharing, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_split_for_shorten_branches : public rtl_opt_pass diff --git a/gcc/ree.c b/gcc/ree.c index b4710333ba79..77f13842a52d 100644 --- a/gcc/ree.c +++ b/gcc/ree.c @@ -1106,7 +1106,7 @@ const pass_data pass_data_ree = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_ree : public rtl_opt_pass diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 7aa8a6b800e9..692abc50bdfe 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -3353,7 +3353,7 @@ const pass_data pass_data_stack_regs_run = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_stack_regs_run : public rtl_opt_pass diff --git a/gcc/regcprop.c b/gcc/regcprop.c index c1fbb65ca4f4..a710cc38bf52 100644 --- a/gcc/regcprop.c +++ b/gcc/regcprop.c @@ -1173,7 +1173,7 @@ const pass_data pass_data_cprop_hardreg = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_cprop_hardreg : public rtl_opt_pass diff --git a/gcc/regrename.c b/gcc/regrename.c index 68e8ad730152..019aee178600 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -1849,7 +1849,7 @@ const pass_data pass_data_regrename = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing | 0 ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_regrename : public rtl_opt_pass diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index ce3fe5df0163..53ba0a4cd150 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -3656,8 +3656,7 @@ const pass_data pass_data_live_range_shrinkage = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_live_range_shrinkage : public rtl_opt_pass @@ -3705,8 +3704,7 @@ const pass_data pass_data_sched = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_sched : public rtl_opt_pass @@ -3753,8 +3751,7 @@ const pass_data pass_data_sched2 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_sched2 : public rtl_opt_pass diff --git a/gcc/store-motion.c b/gcc/store-motion.c index 920da5312134..b3e58900b391 100644 --- a/gcc/store-motion.c +++ b/gcc/store-motion.c @@ -1245,8 +1245,7 @@ const pass_data pass_data_rtl_store_motion = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_rtl_store_motion : public rtl_opt_pass diff --git a/gcc/target.def b/gcc/target.def index 288d1d172b18..febd3207beda 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -5142,6 +5142,22 @@ FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM.", void, (bitmap regs), hook_void_bitmap) +/* Targets should define this target hook to mark that non-callee clobbers are + present in CALL_INSN_FUNCTION_USAGE for all the calls in the current + function. */ +DEFHOOKPOD +(call_fusage_contains_non_callee_clobbers, + "set to true if all the calls in the current function contain clobbers in\n\ +CALL_INSN_FUNCTION_USAGE for the registers that are clobbered by the call\n\ +rather than by the callee, and are not already set or clobbered in the call\n\ +pattern. Examples of such registers are registers used in PLTs and stubs,\n\ +and temporary registers used in the call instruction but not present in the\n\ +rtl pattern. Another way to formulate it is the registers not present in the\n\ +rtl pattern that are clobbered by the call assuming the callee does not\n\ +clobber any register. The default version of this hook is set to false.", + bool, + false) + /* Fill in additional registers set up by prologue into a regset. */ DEFHOOK (set_up_by_prologue, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1c9d4d31c662..a3dd81c0864e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-05-05 Jan Hubicka <hubicka@ucw.cz> + + PR ipa/60965 + * g++.dg/ipa/devirt-32.C: New testcase. + 2014-05-05 Richard Biener <rguenther@suse.de> PR middle-end/61010 diff --git a/gcc/testsuite/g++.dg/ipa/devirt-32.C b/gcc/testsuite/g++.dg/ipa/devirt-32.C new file mode 100644 index 000000000000..64c44ba1e9ee --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/devirt-32.C @@ -0,0 +1,23 @@ +/* { dg-options "-O2 -std=c++11 -fdump-ipa-inline" } */ +#include <new> + +class EmbeddedObject { +public: + virtual int val() { return 2; } +}; + +class Container { + alignas(EmbeddedObject) char buffer[sizeof(EmbeddedObject)]; +public: + EmbeddedObject *obj() { return (EmbeddedObject*)buffer; } + Container() { new (buffer) EmbeddedObject(); } +}; + +Container o; + +int main() +{ + __builtin_printf("%d\n", o.obj()->val()); +} +/* { dg-final { scan-ipa-dump-not "__builtin_unreachable" "inline" } } */ +/* { dg-final { cleanup-ipa-dump "inline" } } */ diff --git a/gcc/tracer.c b/gcc/tracer.c index 09a8f40c7f53..16c6949dd1d0 100644 --- a/gcc/tracer.c +++ b/gcc/tracer.c @@ -381,7 +381,7 @@ const pass_data pass_data_tracer = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_tracer : public gimple_opt_pass diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c index 417ca8a8fa27..c0e44c78ebe7 100644 --- a/gcc/trans-mem.c +++ b/gcc/trans-mem.c @@ -3018,7 +3018,7 @@ const pass_data pass_data_tm_mark = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_tm_mark : public gimple_opt_pass @@ -3175,7 +3175,7 @@ const pass_data pass_data_tm_edges = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_tm_edges : public gimple_opt_pass diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c index d8ad5201b8c2..f62fb40b359e 100644 --- a/gcc/tree-call-cdce.c +++ b/gcc/tree-call-cdce.c @@ -880,7 +880,7 @@ const pass_data pass_data_call_cdce = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_call_cdce : public gimple_opt_pass diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 5793fcc11fc1..fee1ede809e9 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -359,7 +359,7 @@ const pass_data pass_data_build_cfg = ( PROP_cfg | PROP_loops ), /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_stmts, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_build_cfg : public gimple_opt_pass @@ -8098,7 +8098,7 @@ const pass_data pass_data_split_crit_edges = PROP_no_crit_edges, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_flow, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_split_crit_edges : public gimple_opt_pass @@ -8410,7 +8410,7 @@ execute_fixup_cfg (void) { basic_block bb; gimple_stmt_iterator gsi; - int todo = gimple_in_ssa_p (cfun) ? TODO_verify_ssa : 0; + int todo = 0; gcov_type count_scale; edge e; edge_iterator ei; diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c index 104620716ec0..71c294bed5d2 100644 --- a/gcc/tree-cfgcleanup.c +++ b/gcc/tree-cfgcleanup.c @@ -957,7 +957,7 @@ const pass_data pass_data_merge_phi = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_merge_phi : public gimple_opt_pass diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c index a97aaf974ce7..7e12c30f37c0 100644 --- a/gcc/tree-complex.c +++ b/gcc/tree-complex.c @@ -1668,7 +1668,7 @@ const pass_data pass_data_lower_complex = PROP_gimple_lcx, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_stmts ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_lower_complex : public gimple_opt_pass @@ -1706,7 +1706,7 @@ const pass_data pass_data_lower_complex_O0 = PROP_gimple_lcx, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_stmts ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_lower_complex_O0 : public gimple_opt_pass diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index e86c96b65e3e..624f2775f7c5 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -3316,7 +3316,7 @@ const pass_data pass_data_lower_resx = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_flow, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_lower_resx : public gimple_opt_pass @@ -3716,7 +3716,7 @@ const pass_data pass_data_lower_eh_dispatch = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_flow, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_lower_eh_dispatch : public gimple_opt_pass @@ -4575,7 +4575,7 @@ const pass_data pass_data_cleanup_eh = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_cleanup_eh : public gimple_opt_pass diff --git a/gcc/tree-emutls.c b/gcc/tree-emutls.c index 0ed503aec3fa..4d7598d8c043 100644 --- a/gcc/tree-emutls.c +++ b/gcc/tree-emutls.c @@ -813,7 +813,7 @@ ipa_lower_emutls (void) access_vars.release (); free_varpool_node_set (tls_vars); - return TODO_verify_all; + return 0; } namespace { diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 5b08669f456d..69f1e1f06150 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -2144,8 +2144,7 @@ const pass_data pass_data_if_conversion = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_stmts | TODO_verify_flow - | TODO_verify_ssa ), /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_if_conversion : public gimple_opt_pass diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c index 8fc419344c77..5b541037c3a1 100644 --- a/gcc/tree-into-ssa.c +++ b/gcc/tree-into-ssa.c @@ -2312,7 +2312,7 @@ const pass_data pass_data_build_ssa = PROP_ssa, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_ssa | TODO_remove_unused_locals ), /* todo_flags_finish */ + TODO_remove_unused_locals, /* todo_flags_finish */ }; class pass_build_ssa : public gimple_opt_pass diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 5fff7be5bd86..00cf24c0d61a 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -1682,7 +1682,7 @@ const pass_data pass_data_loop_distribution = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_loop_distribution : public gimple_opt_pass diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c index 865c1dfb17bc..3c606b02d41a 100644 --- a/gcc/tree-object-size.c +++ b/gcc/tree-object-size.c @@ -1219,7 +1219,7 @@ const pass_data pass_data_object_sizes = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_object_sizes : public gimple_opt_pass diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 79b327b02c0b..3bc6a2bbf239 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -2266,7 +2266,7 @@ const pass_data pass_data_parallelize_loops = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_flow, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_parallelize_loops : public gimple_opt_pass diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 616e85bd5a00..c025b1f07198 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -230,15 +230,11 @@ protected: /* To-do flags. */ #define TODO_do_not_ggc_collect (1 << 1) -#define TODO_verify_ssa (1 << 2) -#define TODO_verify_flow (1 << 3) -#define TODO_verify_stmts (1 << 4) #define TODO_cleanup_cfg (1 << 5) #define TODO_verify_il (1 << 6) #define TODO_dump_symtab (1 << 7) #define TODO_remove_functions (1 << 8) #define TODO_rebuild_frequencies (1 << 9) -#define TODO_verify_rtl_sharing (1 << 10) /* To-do flags for calls to update_ssa. */ @@ -309,9 +305,7 @@ protected: | TODO_update_ssa_full_phi \ | TODO_update_ssa_only_virtuals) -#define TODO_verify_all \ - (TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts | TODO_verify_il \ - | TODO_verify_rtl_sharing) +#define TODO_verify_all TODO_verify_il /* Register pass info. */ diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 4a24e6a1b70a..72c485be5215 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -3579,7 +3579,7 @@ const pass_data pass_data_sra_early = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_sra_early : public gimple_opt_pass @@ -3616,7 +3616,7 @@ const pass_data pass_data_sra = 0, /* properties_provided */ 0, /* properties_destroyed */ TODO_update_address_taken, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_sra : public gimple_opt_pass diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index eebb4584f670..d7410122c460 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2357,8 +2357,7 @@ const pass_data pass_data_ccp = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_ssa | TODO_update_address_taken - | TODO_verify_stmts ), /* todo_flags_finish */ + TODO_update_address_taken, /* todo_flags_finish */ }; class pass_ccp : public gimple_opt_pass @@ -2629,7 +2628,7 @@ const pass_data pass_data_fold_builtins = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_ssa | TODO_update_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_fold_builtins : public gimple_opt_pass diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c index 6e3a5693aa77..0c1421666bb1 100644 --- a/gcc/tree-ssa-copy.c +++ b/gcc/tree-ssa-copy.c @@ -657,8 +657,7 @@ const pass_data pass_data_copy_prop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_cleanup_cfg | TODO_verify_ssa - | TODO_update_ssa ), /* todo_flags_finish */ + ( TODO_cleanup_cfg | TODO_update_ssa ), /* todo_flags_finish */ }; class pass_copy_prop : public gimple_opt_pass diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c index b9c9ba399508..89437d94927d 100644 --- a/gcc/tree-ssa-copyrename.c +++ b/gcc/tree-ssa-copyrename.c @@ -312,7 +312,7 @@ const pass_data pass_data_rename_ssa_copies = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_rename_ssa_copies : public gimple_opt_pass diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c index e1edb2ee3acf..4969b11c1685 100644 --- a/gcc/tree-ssa-dce.c +++ b/gcc/tree-ssa-dce.c @@ -1522,7 +1522,7 @@ const pass_data pass_data_dce = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_dce : public gimple_opt_pass @@ -1560,7 +1560,7 @@ const pass_data pass_data_dce_loop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_dce_loop : public gimple_opt_pass @@ -1598,7 +1598,7 @@ const pass_data pass_data_cd_dce = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_ssa | TODO_verify_flow ), /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_cd_dce : public gimple_opt_pass diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 15c4fb07596a..5b5adca90b2f 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -845,9 +845,7 @@ const pass_data pass_data_dominator = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_cleanup_cfg | TODO_update_ssa - | TODO_verify_ssa - | TODO_verify_flow ), /* todo_flags_finish */ + ( TODO_cleanup_cfg | TODO_update_ssa ), /* todo_flags_finish */ }; class pass_dominator : public gimple_opt_pass @@ -3038,9 +3036,7 @@ const pass_data pass_data_phi_only_cprop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_cleanup_cfg | TODO_verify_ssa - | TODO_verify_stmts - | TODO_update_ssa ), /* todo_flags_finish */ + ( TODO_cleanup_cfg | TODO_update_ssa ), /* todo_flags_finish */ }; class pass_phi_only_cprop : public gimple_opt_pass diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index af69063bd205..4632adde9c9b 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -338,7 +338,7 @@ const pass_data pass_data_dse = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_dse : public gimple_opt_pass diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 9a990f931224..563abe0d2cc0 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -3582,7 +3582,7 @@ const pass_data pass_data_forwprop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_forwprop : public gimple_opt_pass diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c index 0ce02a04f08c..fae389b90886 100644 --- a/gcc/tree-ssa-ifcombine.c +++ b/gcc/tree-ssa-ifcombine.c @@ -736,7 +736,7 @@ const pass_data pass_data_tree_ifcombine = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_tree_ifcombine : public gimple_opt_pass diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c index fb86de4a7b06..e44f9de235d9 100644 --- a/gcc/tree-ssa-loop-ch.c +++ b/gcc/tree-ssa-loop-ch.c @@ -144,8 +144,7 @@ const pass_data pass_data_ch = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_cleanup_cfg | TODO_verify_ssa - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_cleanup_cfg, /* todo_flags_finish */ }; class pass_ch : public gimple_opt_pass diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index 6b5a4eb5d00e..e332918fd16b 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -1366,7 +1366,7 @@ const pass_data pass_data_complete_unrolli = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_flow, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_complete_unrolli : public gimple_opt_pass diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c index ccc812152cfc..b49ed8a52b23 100644 --- a/gcc/tree-ssa-loop.c +++ b/gcc/tree-ssa-loop.c @@ -57,7 +57,7 @@ const pass_data pass_data_tree_loop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_tree_loop : public gimple_opt_pass @@ -398,7 +398,7 @@ const pass_data pass_data_tree_loop_done = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_cleanup_cfg | TODO_verify_flow ), /* todo_flags_finish */ + TODO_cleanup_cfg, /* todo_flags_finish */ }; class pass_tree_loop_done : public gimple_opt_pass diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index ea404688b4ab..336626d0886a 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -519,8 +519,7 @@ const pass_data pass_data_cse_reciprocals = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa - | TODO_verify_stmts ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_cse_reciprocals : public gimple_opt_pass @@ -1416,8 +1415,7 @@ const pass_data pass_data_cse_sincos = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa - | TODO_verify_stmts ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_cse_sincos : public gimple_opt_pass @@ -2086,8 +2084,7 @@ pass_optimize_bswap::execute (function *fun) statistics_counter_event (fun, "64-bit bswap implementations found", bswap_stats.found_64bit); - return (changed ? TODO_update_ssa | TODO_verify_ssa - | TODO_verify_stmts : 0); + return (changed ? TODO_update_ssa : 0); } } // anon namespace @@ -2788,8 +2785,7 @@ const pass_data pass_data_optimize_widening_mul = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_ssa | TODO_verify_stmts - | TODO_update_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_optimize_widening_mul : public gimple_opt_pass diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index 3cb6ab95179d..28a6ea76e856 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -2206,8 +2206,7 @@ const pass_data pass_data_phiopt = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_ssa | TODO_verify_flow - | TODO_verify_stmts ), /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_phiopt : public gimple_opt_pass @@ -2247,8 +2246,7 @@ const pass_data pass_data_cselim = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_ssa | TODO_verify_flow - | TODO_verify_stmts ), /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_cselim : public gimple_opt_pass diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c index 0154b47af742..8a668635fd4c 100644 --- a/gcc/tree-ssa-phiprop.c +++ b/gcc/tree-ssa-phiprop.c @@ -387,7 +387,7 @@ const pass_data pass_data_phiprop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_phiprop : public gimple_opt_pass diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 7fe7f1612e1c..95e3af98238a 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -4705,7 +4705,7 @@ const pass_data pass_data_pre = 0, /* properties_provided */ PROP_no_crit_edges, /* properties_destroyed */ TODO_rebuild_alias, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_pre : public gimple_opt_pass @@ -4772,7 +4772,6 @@ pass_pre::execute (function *fun) clear_expression_ids (); remove_dead_inserted_code (); - todo |= TODO_verify_flow; scev_finalize (); fini_pre (); @@ -4821,7 +4820,7 @@ const pass_data pass_data_fre = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_fre : public gimple_opt_pass diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index e1504ca9cd03..357ac08381cc 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -4706,9 +4706,7 @@ const pass_data pass_data_reassoc = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_ssa - | TODO_update_ssa_only_virtuals - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_update_ssa_only_virtuals, /* todo_flags_finish */ }; class pass_reassoc : public gimple_opt_pass diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c index 7992ced11dc6..1d4924f15364 100644 --- a/gcc/tree-ssa-sink.c +++ b/gcc/tree-ssa-sink.c @@ -578,8 +578,7 @@ const pass_data pass_data_sink_code = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_sink_code : public gimple_opt_pass diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c index 1cc36d81e362..bc3d712796ab 100644 --- a/gcc/tree-ssa-strlen.c +++ b/gcc/tree-ssa-strlen.c @@ -2074,7 +2074,7 @@ const pass_data pass_data_strlen = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_strlen : public gimple_opt_pass diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 5074142f6f2a..5d3a323e54a6 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -5833,12 +5833,12 @@ dump_solution_for_var (FILE *file, unsigned int var) fprintf (file, "\n"); } -/* Print the points-to solution for VAR to stdout. */ +/* Print the points-to solution for VAR to stderr. */ DEBUG_FUNCTION void debug_solution_for_var (unsigned int var) { - dump_solution_for_var (stdout, var); + dump_solution_for_var (stderr, var); } /* Create varinfo structures for all of the variables in the diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c index f6b1ba081547..f879871c7f02 100644 --- a/gcc/tree-ssa-tail-merge.c +++ b/gcc/tree-ssa-tail-merge.c @@ -1732,7 +1732,6 @@ tail_merge_optimize (unsigned int todo) dump_function_to_file (current_function_decl, dump_file, dump_flags); } - todo |= (TODO_verify_ssa | TODO_verify_stmts | TODO_verify_flow); mark_virtual_operands_for_renaming (cfun); } diff --git a/gcc/tree-ssa-uncprop.c b/gcc/tree-ssa-uncprop.c index 52c568a749a2..7342c9d1514a 100644 --- a/gcc/tree-ssa-uncprop.c +++ b/gcc/tree-ssa-uncprop.c @@ -553,7 +553,7 @@ const pass_data pass_data_uncprop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_uncprop : public gimple_opt_pass diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c index 7757b1c7dbbd..3651120d0e19 100644 --- a/gcc/tree-switch-conversion.c +++ b/gcc/tree-switch-conversion.c @@ -1435,9 +1435,7 @@ const pass_data pass_data_convert_switch = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa - | TODO_verify_stmts - | TODO_verify_flow ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_convert_switch : public gimple_opt_pass diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index 9ad25d81c6d4..f7beaefd76d4 100644 --- a/gcc/tree-tailcall.c +++ b/gcc/tree-tailcall.c @@ -1100,7 +1100,7 @@ const pass_data pass_data_tail_recursion = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_tail_recursion : public gimple_opt_pass @@ -1141,7 +1141,7 @@ const pass_data pass_data_tail_calls = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_tail_calls : public gimple_opt_pass diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c index e22ce2cc71d3..43a695d65f2c 100644 --- a/gcc/tree-vect-generic.c +++ b/gcc/tree-vect-generic.c @@ -1565,9 +1565,7 @@ const pass_data pass_data_lower_vector = PROP_gimple_lvec, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa - | TODO_verify_stmts - | TODO_verify_flow + ( TODO_update_ssa | TODO_cleanup_cfg ), /* todo_flags_finish */ }; @@ -1612,9 +1610,7 @@ const pass_data pass_data_lower_vector_ssa = PROP_gimple_lvec, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_update_ssa | TODO_verify_ssa - | TODO_verify_stmts - | TODO_verify_flow + ( TODO_update_ssa | TODO_cleanup_cfg ), /* todo_flags_finish */ }; diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index d7de964fa377..8f5f2d662512 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -599,8 +599,7 @@ const pass_data pass_data_slp_vectorize = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_ssa | TODO_update_ssa - | TODO_verify_stmts ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_slp_vectorize : public gimple_opt_pass diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 613c9e67103d..633c329030f6 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -9795,9 +9795,7 @@ const pass_data pass_data_vrp = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_cleanup_cfg | TODO_update_ssa - | TODO_verify_ssa - | TODO_verify_flow ), /* todo_flags_finish */ + ( TODO_cleanup_cfg | TODO_update_ssa ), /* todo_flags_finish */ }; class pass_vrp : public gimple_opt_pass diff --git a/gcc/tsan.c b/gcc/tsan.c index d9f5718ee7ec..1de108b90dfa 100644 --- a/gcc/tsan.c +++ b/gcc/tsan.c @@ -745,7 +745,7 @@ const pass_data pass_data_tsan = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_all | TODO_update_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_tsan : public gimple_opt_pass @@ -787,7 +787,7 @@ const pass_data pass_data_tsan_O0 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_all | TODO_update_ssa ), /* todo_flags_finish */ + TODO_update_ssa, /* todo_flags_finish */ }; class pass_tsan_O0 : public gimple_opt_pass diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 7309846eb88e..f36a1e9a6921 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -10374,7 +10374,7 @@ const pass_data pass_data_variable_tracking = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_verify_rtl_sharing | TODO_verify_flow ), /* todo_flags_finish */ + 0, /* todo_flags_finish */ }; class pass_variable_tracking : public rtl_opt_pass diff --git a/gcc/web.c b/gcc/web.c index 46a6ff7448d3..2c038f2bb81d 100644 --- a/gcc/web.c +++ b/gcc/web.c @@ -338,7 +338,7 @@ const pass_data pass_data_web = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ + TODO_df_finish, /* todo_flags_finish */ }; class pass_web : public rtl_opt_pass |