1. 05 Jan, 2015 1 commit
  2. 15 Dec, 2014 1 commit
  3. 17 May, 2014 1 commit
    • rm a bunch of _stat allocation functions · 231120e5
      Now that we can use c++ default arguments there's no reason to use
      functions and wrapper macros.
      
      gcc/ChangeLog:
      
      	* dwarf2out.c (tree_add_const_value_attribute): Call
      	ggc_internal_cleared_alloc instead of ggc_alloc_cleared_atomic.
      	* gengtype.c (write_typed_alloc_def): Call ggc_internal_<x>alloc
      	instead of ggc_internal_<x>alloc_stat.
      	* ggc-common.c (ggc_internal_cleared_alloc): Drop _stat suffix.
      	(ggc_realloc): Likewise.
      	* ggc-none.c (ggc_internal_alloc): Likewise.
      	(ggc_internal_cleared_alloc): Likewise.
      	* ggc-page.c: Likewise.
      	* ggc.h (ggc_internal_alloc_stat): Likewise.
      	(ggc_internal_alloc): Remove macro.
      	(ggc_internal_cleared_alloc_stat): Drop _stat suffix.
      	(ggc_internal_cleared_alloc): Remove macro.
      	(GGC_RESIZEVEC): Adjust.
      	(ggc_resizevar): Remove macro.
      	(ggc_internal_vec_alloc_stat): Drop _stat suffix.
      	(ggc_internal_cleared_vec_alloc_stat): Likewise.
      	(ggc_internal_vec_cleared_alloc): Remove macro.
      	(ggc_alloc_atomic_stat): Drop _stat suffix.
      	(ggc_alloc_atomic): Remove macro.
      	(ggc_alloc_cleared_atomic): Remove macro.
      	(ggc_alloc_string_stat): Drop _stat suffix.
      	(ggc_alloc_string): Remove macro.
      	(ggc_alloc_rtx_def_stat): Adjust.
      	(ggc_alloc_tree_node_stat): Likewise.
      	(ggc_alloc_cleared_tree_node_stat): Likewise.
      	(ggc_alloc_cleared_gimple_statement_stat): Likewise.
      	(ggc_alloc_cleared_simd_clone_stat): Likewise.
      	* gimple.c (gimple_build_omp_for): Likewise.
      	(gimple_copy): Likewise.
      	* stringpool.c (ggc_alloc_string_stat): Drop _stat suffix.
      	* toplev.c (realloc_for_line_map): Adjust.
      	* tree-data-ref.h (lambda_vector_new): Likewise.
      	* tree-phinodes.c (allocate_phi_node): Likewise.
      	* tree.c (grow_tree_vec_stat): Likewise.
      	* vec.h (va_gc::reserve): Adjust.
      
      gcc/java/ChangeLog:
      
      	* constants.c (set_constant_entry): Adjust.
      
      From-SVN: r210565
      Trevor Saunders committed
  4. 12 Feb, 2014 1 commit
    • vec.c (vec_prefix::calculate_allocation): Move as inline variant to vec.h. · 3a938d75
      2014-02-12  Richard Biener  <rguenther@suse.de>
      
      	* vec.c (vec_prefix::calculate_allocation): Move as
      	inline variant to vec.h.
      	(vec_prefix::calculate_allocation_1): New out-of-line version.
      	* vec.h (vec_prefix::calculate_allocation_1): Declare.
      	(vec_prefix::m_has_auto_buf): Rename to ...
      	(vec_prefix::m_using_auto_storage): ... this.
      	(vec_prefix::calculate_allocation): Inline the easy cases
      	and dispatch to calculate_allocation_1 which doesn't need the
      	prefix address.
      	(va_heap::reserve): Use gcc_checking_assert.
      	(vec<T, A, vl_embed>::embedded_init): Add argument to initialize
      	m_using_auto_storage.
      	(auto_vec): Change m_vecpfx member to a vec<T, va_heap, vl_embed>
      	member and adjust.
      	(vec<T, va_heap, vl_ptr>::reserve): Remove redundant check.
      	(vec<T, va_heap, vl_ptr>::release): Avoid casting.
      	(vec<T, va_heap, vl_ptr>::using_auto_storage): Simplify.
      
      From-SVN: r207729
      Richard Biener committed
  5. 07 Feb, 2014 1 commit
  6. 17 Jan, 2014 1 commit
    • re PR tree-optimization/46590 (long compile time with -O2 and many loops) · 32500433
      2014-01-17  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/46590
      	* vec.h (vec<>::bseach): New member function implementing
      	binary search according to C89 bsearch.
      	(vec<>::qsort): Avoid calling ::qsort for vectors with sizes 0 or 1.
      	* tree-ssa-loop-im.c (struct mem_ref): Make stored member a
      	bitmap pointer again.  Make accesses_in_loop a flat array.
      	(mem_ref_obstack): New global.
      	(outermost_indep_loop): Adjust for mem_ref->stored changes.
      	(mark_ref_stored): Likewise.
      	(ref_indep_loop_p_2): Likewise.
      	(set_ref_stored_in_loop): New helper function.
      	(mem_ref_alloc): Allocate mem_refs on the mem_ref_obstack obstack.
      	(memref_free): Adjust.
      	(record_mem_ref_loc): Simplify.
      	(gather_mem_refs_stmt): Adjust.
      	(sort_locs_in_loop_postorder_cmp): New function.
      	(analyze_memory_references): Sort accesses_in_loop after
      	loop postorder number.
      	(find_ref_loc_in_loop_cmp): New function.
      	(for_all_locs_in_loop): Find relevant cluster of locs in
      	accesses_in_loop and iterate without recursion.
      	(execute_sm): Avoid uninit warning.
      	(struct ref_always_accessed): Simplify.
      	(ref_always_accessed::operator ()): Likewise.
      	(ref_always_accessed_p): Likewise.
      	(tree_ssa_lim_initialize): Initialize mem_ref_obstack, compute
      	loop postorder numbers here.
      	(tree_ssa_lim_finalize): Free mem_ref_obstack and loop postorder
      	numbers.
      
      From-SVN: r206709
      Richard Biener committed
  7. 02 Jan, 2014 1 commit
  8. 20 Dec, 2013 1 commit
  9. 22 Nov, 2013 1 commit
    • add auto_vec · ef062b13
      2013-11-22  Trevor Saunders  <tsaunders@mozilla.com>
      
      gcc/
      	* vec.h (auto_vec): New class.
      	* cfganal.c, cfgloop.c, cgraphunit.c, config/i386/i386.c, dwarf2out.c,
      	function.c, genautomata.c, gimple.c, haifa-sched.c, ipa-inline.c,
      	ira-build.c, loop-unroll.c, omp-low.c, ree.c, trans-mem.c,
      tree-call-cdce.c, tree-eh.c, tree-if-conv.c, tree-into-ssa.c,
      tree-loop-distribution.c, tree-predcom.c, tree-sra.c,
      tree-sssa-forwprop.c, tree-ssa-loop-manip.c, tree-ssa-pre.c,
      tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c,
      	tree-vect-loop.c, tree-vect-stmts.c: Use auto_vec and stack_vec as
      	appropriate instead of vec for local variables.
      
      	cp/
      	* parser.c, semantics.c: Change some local variables from vec to
      	auto_vec or stack_vec.
      
      From-SVN: r205244
      Trevor Saunders committed
  10. 05 Nov, 2013 1 commit
    • don't try and free what must be a null vector when reserving 0 elements · ecbffdd8
      in va_heap::reserve
      
      2013-11-05  Trevor Saunders  <tsaunders@mozilla.com>
      
      	* vec.c (vec_prefix::calculate_allocation): Don't try to handle the
      	case of no prefix and reserving zero slots, because when that's the
      	case we'll never get here.
      	* vec.h (va_heap::reserve): Don't try and handle
      	vec_prefix::calculate_allocation returning zero because that should
      	never happen.
      
      From-SVN: r204392
      Trevor Saunders committed
  11. 28 Oct, 2013 1 commit
    • df-scan.c (df_collection_rec): Adjust. · ff4c81cc
      	* df-scan.c (df_collection_rec): Adjust.
      	(copy_defs): New constant.
      	(copy_uses): Likewise.
      	(copy_eq_uses): Likewise.
      	(copy_mw): Likewise.
      	(copy_all): Likewise.
      	(df_insn_rescan): Adjust.
      	(df_notes_rescan): Likewise.
      	(df_swap_refs): Likewise.
      	(df_sort_and_compress_refs): Likewise.
      	(df_sort_and_compress_mws): Likewise.
      	(df_install_refs): Likewise.
      	(df_install_mws): Likewise.
      	(df_refs_add_to_chains): Add flags parameter controlling which vectors
      	are coppied.
      	(df_bb_refs_record): Adjust.
      	(df_record_entry_block_defs): Likewise.
      	(df_record_exit_block_defs): Likewise.
      	(df_refs_verify): Likewise.
      	(df_mws_verify): Likewise.
      	(df_insn_refs_verify): Likewise.
      	(df_bb_verify): Likewise.
      	* ipa-pure-const.c (finish_state): Remove.
      	(propagate): Adjust.
      	* tree-data-ref.c tree-ssa-alias.c tree-ssa-loop-ivcanon.c
      	tree-ssa-threadedge.c tree-vect-loop-manip.c tree-vect-slp.c
      	var-tracking.c: Adjust.
      	* vec.c (stack_vecs): Remove.
      	(register_stack_vec): Likewise.
      	(stack_vec_register_index): Likewise.
      	(unregister_stack_vec): Likewise.
      	* vec.h (struct va_stack): Remove.
      	(struct vec<T, A, vl_ptr>): Specialize as
      	struct vec<T, va_heap, vl_ptr> instead since va_heap is the only
      	allocation strategy compatable with the vl_ptr layout.
      	(struct vec<T, va_gc, vl_ptr>): Remove because it now gets an empty
      	specialization anyway.
      	(class stack_vec): New class.
      	(vec_stack_alloc): Remove.
      	(vec<T, va_heap, vl_ptr>::using_auto_storage): New method.
      
      	* gcc-interface/decl.c (components_to_record): Adjust.
      
      From-SVN: r204137
      Trevor Saunders committed
  12. 30 Sep, 2013 1 commit
  13. 28 Sep, 2013 1 commit
    • alloc-pool.c, [...]: Add missing whitespace before "(". · c3284718
      gcc/
      	* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
      	bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
      	cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
      	cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
      	combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
      	cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
      	df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
      	dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
      	errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
      	fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
      	gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
      	genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
      	genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
      	genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
      	gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
      	gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
      	gimple.h, godump.c, graphite-clast-to-gimple.c,
      	graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
      	graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
      	hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
      	ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
      	ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
      	ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
      	loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
      	lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
      	mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
      	pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
      	predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
      	profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
      	regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
      	reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
      	sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
      	statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
      	system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
      	tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
      	tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
      	tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
      	tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
      	tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
      	tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
      	tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
      	tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
      	tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
      	tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
      	tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
      	tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
      	tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
      	tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
      	tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
      	tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
      	tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
      	tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
      	tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
      	tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
      	varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
      	whitespace before "(".
      
      From-SVN: r203004
      Richard Sandiford committed
  14. 11 Jul, 2013 1 commit
  15. 10 Jan, 2013 1 commit
  16. 27 Nov, 2012 1 commit
    • Fix bootstrap failure with --enable-gather-detailed-mem-stats. · 18e1fd75
      This patch restores bootstrap when detailed memory stats are enabled.
      No functional changes.
      
      Tested on x86_64.  Committed to trunk.
      
      2012-11-27  Diego Novillo  <dnovillo@google.com>
      
      	* vec.h: Replace 'class vec' with 'struct vec' everywhere.
      	(ggc_internal_cleared_alloc_stat): Remove.
      	(va_gc::reserve): Add PASS_MEM_STAT to ggc_realloc_stat call.
      	(va_stack::reserve): Add PASS_MEM_STAT to va_heap::reserve call.
      	(vec<T, A, vl_embed>::copy): Replace ALONE_MEM_STAT_DECL with
      	ALONE_CXX_MEM_STAT_INFO.
      	(vec_safe_reserve): Replace MEM_STAT_DECL with CXX_MEM_STAT_INFO.
      	(vec_safe_reserve_exact): Likewise.
      	(vec_alloc): Likewise.
      	(vec_safe_grow): Likewise.
      	(vec_safe_grow_cleared): Likewise.
      	(vec_safe_push): Likewise.
      	(vec_safe_insert): Likewise.
      	(vec_safe_splice): Likewise.
      	(vec_alloc): Likewise.
      	(vec_check_alloc): Likewise.
      
      From-SVN: r193864
      Diego Novillo committed
  17. 20 Nov, 2012 3 commits
    • Introduce vNULL to use as a nil initializer for vec<>. · 6e1aa848
      This patch implements Jakub's idea of adding an empty struct with
      a typecast operator that returns nil vectors.  This is useful to
      shorten all the initializers when declaring vec instances or passing
      nil vectors as function arguments.
      
      2012-11-20  Diego Novillo  <dnovillo@google.com>
      	    Jakub Jelinek  <jakub@redhat.com>
      
      ChangeLog
      	* vec.h (struct vnull): Declare.
      	(vNULL): Declare.
      	* vec.c (vNULL): Define.
      	* bb-reorder.c: Replace all vec<T, A>() initializers with vNULL.
      	* cfgexpand.c: Likewise.
      	* cfgloop.c: Likewise.
      	* cfgloopanal.c: Likewise.
      	* cfgloopmanip.c: Likewise.
      	* cgraph.c: Likewise.
      	* config/c6x/c6x.c: Likewise.
      	* config/i386/i386.c: Likewise.
      	* df-core.c: Likewise.
      	* dominance.c: Likewise.
      	* dwarf2out.c: Likewise.
      	* except.c: Likewise.
      	* function.c: Likewise.
      	* gcse.c: Likewise.
      	* genautomata.c: Likewise.
      	* graphds.c: Likewise.
      	* graphite-scop-detection.c: Likewise.
      	* graphite.c: Likewise.
      	* haifa-sched.c: Likewise.
      	* ifcvt.c: Likewise.
      	* ipa-cp.c: Likewise.
      	* ipa-inline-analysis.c: Likewise.
      	* ipa-inline-transform.c: Likewise.
      	* ipa-inline.c: Likewise.
      	* ipa-prop.c: Likewise.
      	* ipa-split.c: Likewise.
      	* ipa-utils.c: Likewise.
      	* ira-build.c: Likewise.
      	* lto-cgraph.c: Likewise.
      	* lto-streamer-in.c: Likewise.
      	* lto-symtab.c: Likewise.
      	* opts-global.c: Likewise.
      	* passes.c: Likewise.
      	* ree.c: Likewise.
      	* sched-deps.c: Likewise.
      	* sel-sched-ir.c: Likewise.
      	* sel-sched-ir.h: Likewise.
      	* sel-sched.c: Likewise.
      	* stor-layout.c: Likewise.
      	* trans-mem.c: Likewise.
      	* tree-call-cdce.c: Likewise.
      	* tree-cfg.c: Likewise.
      	* tree-data-ref.c: Likewise.
      	* tree-diagnostic.c: Likewise.
      	* tree-eh.c: Likewise.
      	* tree-loop-distribution.c: Likewise.
      	* tree-predcom.c: Likewise.
      	* tree-ssa-loop-im.c: Likewise.
      	* tree-ssa-loop-ivcanon.c: Likewise.
      	* tree-ssa-loop-manip.c: Likewise.
      	* tree-ssa-loop-niter.c: Likewise.
      	* tree-ssa-loop-prefetch.c: Likewise.
      	* tree-ssa-math-opts.c: Likewise.
      	* tree-ssa-phiopt.c: Likewise.
      	* tree-ssa-pre.c: Likewise.
      	* tree-ssa-propagate.c: Likewise.
      	* tree-ssa-reassoc.c: Likewise.
      	* tree-ssa-sccvn.c: Likewise.
      	* tree-ssa-structalias.c: Likewise.
      	* tree-ssa-threadedge.c: Likewise.
      	* tree-ssa-uninit.c: Likewise.
      	* tree-stdarg.c: Likewise.
      	* tree-switch-conversion.c: Likewise.
      	* tree-vect-data-refs.c: Likewise.
      	* tree-vect-loop.c: Likewise.
      	* tree-vect-slp.c: Likewise.
      	* tree-vect-stmts.c: Likewise.
      	* value-prof.c: Likewise.
      	* varasm.c: Likewise.
      
      ada/ChangeLog
      	* gcc-interface/decl.c: Replace all vec<T,A>()
      	initializers with vNULL.
      
      cp/ChangeLog
      	* name-lookup.c: Replace all vec<T, A>() initializers
      	with vNULL.
      	* semantics.c: Likewise.
      
      fortran/ChangeLog
      	* trans-openmp.c: Replace all vec<T, A>() initializers
      	with vNULL.
      
      lto/ChangeLog
      	* lto.c: Replace all vec<T, A>() initializers with vNULL.
      
      objc/ChangeLog
      	* objc-act.c: Replace all vec<T, A>() initializers with vNULL.
      
      Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
      
      From-SVN: r193677
      Diego Novillo committed
    • vec.h (class vec_prefix): Change into struct. · 26da79f5
      	* vec.h (class vec_prefix): Change into struct.
      	Rename field alloc_PRIVATE_ back to alloc_.
      	Rename field num_PRIVATE_ to num_.
      	Update all users.
      	(class vec<T, A, vl_embed>): Rename field pfx_PRIVATE_ to vecpfx_.
      	Rename field data_PRIVATE_ to vecdata_.
      	Update all users.
      	(class vec<T, A, vl_ptr>): Make every field public.
      	Rename field vec_PRIVATE_ back to vec_.
      	Update all users.
      
      From-SVN: r193675
      Jakub Jelinek committed
    • Convert vec<> into a POD. · 38f2ca32
      This fixes PR 55398 by making vec<> a true POD.  I thought we could get
      away with having private fields, but we can't.  We fail to pass vec<>
      instances through varargs.
      
      The patch makes every field public and mangles the field names in the
      hope that no future patch will try to make use of them directly.  It's
      horrible, but I could not think of anything better.
      
      Tested with clang++ as the host compiler.
      
      2012-11-20  Diego Novillo  <dnovillo@google.com>
      
          PR middle-end/55398
          * vec.h (class vec_prefix): Make every field public.
          Rename field alloc_ to alloc_PRIVATE_.
          Rename field num_ to num_PRIVATE_.
          Update all users.
          (class vec<T, A, vl_embed>): Make every field public.
          Rename field pfx_ to pfx_PRIVATE_.
          Rename field data_ to data_PRIVATE_.
          Update all users.
          (class vec<T, A, vl_ptr>): Make every field public.
          Rename field vec_ to vec_PRIVATE_.
          Update all users.
      
      From-SVN: r193667
      Diego Novillo committed
  18. 18 Nov, 2012 1 commit
    • This patch rewrites the old VEC macro-based interface into a new one based on… · 9771b263
      This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'.
      
      This patch rewrites the old VEC macro-based interface into a new one
      based on the template class 'vec'.  The user-visible changes are
      described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec.
      
      I have tested the patch pretty extensively:
      
      - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa.
      - Bootstraps with --enable-checking=release
      - Bootstraps with --enable-checking=gc,gcac
      - Basic builds on all targets (using contrib/config-list.mk).
      
      We no longer access the vectors via VEC_* macros.  The pattern is
      "VEC_operation (T, A, V, args)" becomes "V.operation (args)".
      
      The only thing I could not do is create proper ctors and dtors for the
      vec class.  Since these vectors are stored in unions, we
      have to keep them as PODs (C++03 does not allow non-PODs in unions).
      
      This means that creation and destruction must be explicit.  There is a
      new method vec<type, allocation, layout>::create() and another vec<type,
      allocation, layout>::destroy() to allocate the internal vector.
      
      For vectors that must be pointers, there is a family of free functions
      that implement the operations that need to tolerate NULL vectors.
      These functions all start with the prefix 'vec_safe_'.  See the wiki
      page for details.
      
      The gengtype change removes the special handling for VEC() that used
      to exist in gengtype. Additionally, it allows gengtype to recognize
      templates of more than one argument and introduces the concept of an
      undefined type (useful for template arguments that may or may not be
      types).
      
      When a TYPE_UNDEFINED is reached, gengtype will ignore it if it
      happens inside a type marked with GTY((user)).  Otherwise, it will
      emit an error.
      
      Finally, gengtype rejects root types marked GTY((user)) that are not
      first class pointers.
      
      2012-11-16  Diego Novillo  <dnovillo@google.com>
      
      	VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
      
      	* vec.c (register_overhead): Convert it into
      	member function of vec_prefix.
      	(release_overhead): Likewise.
      	(calculate_allocation): Likewise.
      	(vec_heap_free): Remove.
      	(vec_gc_o_reserve_1): Remove.
      	(vec_heap_o_reserve_1): Remove.
      	(vec_stack_o_reserve_1): Remove.
      	(vec_stack_o_reserve_exact): Remove.
      	(register_stack_vec): New.
      	(stack_vec_register_index): New.
      	(unregister_stack_vec): New.
      	(vec_assert_fail): Remove.
      	* vec.h: Conditionally include ggc.h.  Document conditional
      	hackery.
      	Update top-level documentation.
      	(ALONE_VEC_CHECK_INFO): Remove.
      	(VEC_CHECK_INFO): Remove.
      	(ALONE_VEC_CHECK_DECL): Remove.
      	(VEC_CHECK_DECL): Remove.
      	(ALONE_VEC_CHECK_PASS): Remove.
      	(VEC_CHECK_PASS): Remove.
      	(VEC_ASSERT): Remove.
      	(vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and
      	va_stack.
      	Mark fields alloc_ and num_ as protected.
      	(struct vec_t): Remove.  Remove all function members.
      	(struct vl_embed): Declare.
      	(struct vl_ptr): Declare.
      	(free): Remove.
      	(reserve_exact): Remove.
      	(reserve): Remove.
      	(safe_splice): Remove.
      	(safe_push): Remove.
      	(safe_grow): Remove.
      	(safe_grow_cleared): Remove.
      	(safe_insert): Remove.
      	(DEF_VEC_I): Remove.
      	(DEF_VEC_ALLOC_I): Remove.
      	(DEF_VEC_P): Remove.
      	(DEF_VEC_ALLOC_P): Remove.
      	(DEF_VEC_O): Remove.
      	(DEF_VEC_ALLOC_O): Remove.
      	(DEF_VEC_ALLOC_P_STACK): Remove.
      	(DEF_VEC_ALLOC_O_STACK): Remove.
      	(DEF_VEC_ALLOC_I_STACK): Remove.
      	(DEF_VEC_A): Remove.
      	(DEF_VEC_ALLOC_A): Remove.
      	(vec_stack_p_reserve_exact_1): Remove.
      	(vec_stack_o_reserve): Remove.
      	(vec_stack_o_reserve_exact): Remove.
      	(VEC_length): Remove.
      	(VEC_empty): Remove.
      	(VEC_address): Remove.
      	(vec_address): Remove.
      	(VEC_last): Remove.
      	(VEC_index): Remove.
      	(VEC_iterate): Remove.
      	(VEC_embedded_size): Remove.
      	(VEC_embedded_init): Remove.
      	(VEC_free): Remove.
      	(VEC_copy): Remove.
      	(VEC_space): Remove.
      	(VEC_reserve): Remove.
      	(VEC_reserve_exact): Remove.
      	(VEC_splice): Remove.
      	(VEC_safe_splice): Remove.
      	(VEC_quick_push): Remove.
      	(VEC_safe_push): Remove.
      	(VEC_pop): Remove.
      	(VEC_truncate): Remove.
      	(VEC_safe_grow): Remove.
      	(VEC_replace): Remove.
      	(VEC_quick_insert): Remove.
      	(VEC_safe_insert): Remove.
      	(VEC_ordered_remove): Remove.
      	(VEC_unordered_remove): Remove.
      	(VEC_block_remove): Remove.
      	(VEC_lower_bound): Remove.
      	(VEC_alloc): Remove.
      	(VEC_qsort): Remove.
      
      	(va_heap): Declare.
      	(va_heap::default_layout): New typedef to vl_ptr.
      	(va_heap::reserve): New.
      	(va_heap::release): New.
      	(va_gc): Declare.
      	(va_gc::default_layout): New typedef to vl_embed.
      	(va_gc::reserve): New.
      	(va_gc::release): New.
      	(va_gc_atomic): Declare.  Inherit from va_gc.
      	(va_stack): Declare.
      	(va_stack::default_layout): New typedef to vl_ptr.
      	(va_stack::alloc): New.
      	(va_stack::reserve): New.
      	(va_stack::release): New.
      	(register_stack_vec): Declare.
      	(stack_vec_register_index): Declare.
      	(unregister_stack_vec): Declare.
      
      	(vec<T, A = va_heap, L = typename A::default_layout>): Declare
      	empty vec template.
      	(vec<T, A, vl_embed>): Partial specialization for embedded
      	layout.
      	(vec<T, A, vl_embed>::allocated): New.
      	(vec<T, A, vl_embed>::length): New.
      	(vec<T, A, vl_embed>::is_empty): New.
      	(vec<T, A, vl_embed>::address): New.
      	(vec<T, A, vl_embed>::operator[]): New.
      	(vec<T, A, vl_embed>::last New.
      	(vec<T, A, vl_embed>::space): New.
      	(vec<T, A, vl_embed>::iterate): New.
      	(vec<T, A, vl_embed>::iterate): New.
      	(vec<T, A, vl_embed>::copy): New.
      	(vec<T, A, vl_embed>::splice): New.
      	(vec<T, A, vl_embed>::quick_push New.
      	(vec<T, A, vl_embed>::pop New.
      	(vec<T, A, vl_embed>::truncate): New.
      	(vec<T, A, vl_embed>::quick_insert): New.
      	(vec<T, A, vl_embed>::ordered_remove): New.
      	(vec<T, A, vl_embed>::unordered_remove): New.
      	(vec<T, A, vl_embed>::block_remove): New.
      	(vec<T, A, vl_embed>::qsort): New.
      	(vec<T, A, vl_embed>::lower_bound): New.
      	(vec<T, A, vl_embed>::embedded_size): New.
      	(vec<T, A, vl_embed>::embedded_init): New.
      	(vec<T, A, vl_embed>::quick_grow): New.
      	(vec<T, A, vl_embed>::quick_grow_cleared): New.
      	(vec_safe_space): New.
      	(vec_safe_length): New.
      	(vec_safe_address): New.
      	(vec_safe_is_empty): New.
      	(vec_safe_reserve): New.
      	(vec_safe_reserve_exact): New.
      	(vec_alloc): New.
      	(vec_free): New.
      	(vec_safe_grow): New.
      	(vec_safe_grow_cleared): New.
      	(vec_safe_iterate): New.
      	(vec_safe_push): New.
      	(vec_safe_insert): New.
      	(vec_safe_truncate): New.
      	(vec_safe_copy): New.
      	(vec_safe_splice): New.
      
      	(vec<T, A, vl_ptr>): New partial specialization for the space
      	efficient layout.
      	(vec<T, A, vl_ptr>::exists): New.
      	(vec<T, A, vl_ptr>::is_empty): New.
      	(vec<T, A, vl_ptr>::length): New.
      	(vec<T, A, vl_ptr>::address): New.
      	(vec<T, A, vl_ptr>::operator[]): New.
      	(vec<T, A, vl_ptr>::operator!=): New.
      	(vec<T, A, vl_ptr>::operator==): New.
      	(vec<T, A, vl_ptr>::last): New.
      	(vec<T, A, vl_ptr>::space): New.
      	(vec<T, A, vl_ptr>::iterate): New.
      	(vec<T, A, vl_ptr>::copy): New.
      	(vec<T, A, vl_ptr>::reserve): New.
      	(vec<T, A, vl_ptr>::reserve_exact): New.
      	(vec<T, A, vl_ptr>::splice): New.
      	(vec<T, A, vl_ptr>::safe_splice): New.
      	(vec<T, A, vl_ptr>::quick_push): New.
      	(vec<T, A, vl_ptr>::safe_push): New.
      	(vec<T, A, vl_ptr>::pop): New.
      	(vec<T, A, vl_ptr>::truncate): New.
      	(vec<T, A, vl_ptr>::safe_grow): New.
      	(vec<T, A, vl_ptr>::safe_grow_cleared): New.
      	(vec<T, A, vl_ptr>::quick_grow): New.
      	(vec<T, A, vl_ptr>::quick_grow_cleared): New.
      	(vec<T, A, vl_ptr>::quick_insert): New.
      	(vec<T, A, vl_ptr>::safe_insert): New.
      	(vec<T, A, vl_ptr>::ordered_remove): New.
      	(vec<T, A, vl_ptr>::unordered_remove): New.
      	(vec<T, A, vl_ptr>::block_remove): New.
      	(vec<T, A, vl_ptr>::qsort): New.
      	(vec<T, A, vl_ptr>::lower_bound): New.
      	(vec_stack_alloc): Define.
      	(FOR_EACH_VEC_SAFE_ELT): Define.
      	* vecir.h: Remove.  Update all users.
      	* vecprim.h: Remove.  Update all users.
      	Move uchar to coretypes.h.
      
      	* Makefile.in (VEC_H): Add $(GGC_H).
      	Remove vecir.h and vecprim.h dependencies everywhere.
      
      2012-11-16  Diego Novillo  <dnovillo@google.com>
      
      	* gengtype-lex.l (VEC): Remove.
      	Add characters in the set [\!\>\.-].
      	* gengtype-parse.c (token_names): Remove "VEC".
      	(require_template_declaration): Remove handling of VEC_TOKEN.
      	(type): Likewise.
      	Call create_user_defined_type when parsing GTY((user)).
      	* gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED.
      	(write_state_undefined_type): New.
      	(write_state_type): Call write_state_undefined_type for
      	TYPE_UNDEFINED.
      	(read_state_type): Call read_state_undefined_type for
      	TYPE_UNDEFINED.
      	* gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED.
      	(create_user_defined_type): Make extern.
      	(type_for_name): Factor out of resolve_typedef.
      	(create_undefined_type): New
      	(resolve_typedef): Call it when we cannot find a previous
      	typedef and the type is not a template.
      	(find_structure): Accept TYPE_UNDEFINED.
      	(set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES,
      	default to false.
      	Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or
      	ALLOWED_UNDEFINED_TYPES is set.
      	Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT.
      	(filter_type_name): Accept templates with more than one
      	argument.
      	(output_mangled_typename): Handle TYPE_UNDEFINED
      	(walk_type): Likewise.
      	(write_types_process_field): Likewise.
      	(write_func_for_structure): If CHAIN_NEXT is set, ORIG_S
      	should not be a user-defined type.
      	(write_types_local_user_process_field): Handle TYPE_ARRAY,
      	TYPE_NONE and TYPE_UNDEFINED.
      	(write_types_local_process_field): Likewise.
      	(contains_scalar_p): Return 0 for TYPE_USER_STRUCT.
      	(write_root): Reject user-defined types that are not pointers.
      	Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT
      	and TYPE_PARAM_STRUCT.
      	(output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and
      	TYPE_ARRAY.
      	(dump_typekind): Handle TYPE_UNDEFINED.
      	* gengtype.h (enum typekind): Add TYPE_UNDEFINED.
      	(create_user_defined_type): Declare.
      	(enum gty_token): Remove VEC_TOKEN.
      
      2012-11-16  Diego Novillo  <dnovillo@google.com>
      
      	Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
      
      	* coretypes.h (uchar): Define.
      	* alias.c: Use new vec API in vec.h.
      	* asan.c: Likewise.
      	* attribs.c: Likewise.
      	* basic-block.h: Likewise.
      	* bb-reorder.c: Likewise.
      	* builtins.c: Likewise.
      	* calls.c: Likewise.
      	* cfg.c: Likewise.
      	* cfganal.c: Likewise.
      	* cfgcleanup.c: Likewise.
      	* cfgexpand.c: Likewise.
      	* cfghooks.c: Likewise.
      	* cfghooks.h: Likewise.
      	* cfgloop.c: Likewise.
      	* cfgloop.h: Likewise.
      	* cfgloopanal.c: Likewise.
      	* cfgloopmanip.c: Likewise.
      	* cfgrtl.c: Likewise.
      	* cgraph.c: Likewise.
      	* cgraph.h: Likewise.
      	* cgraphclones.c: Likewise.
      	* cgraphunit.c: Likewise.
      	* combine.c: Likewise.
      	* compare-elim.c: Likewise.
      	* coverage.c: Likewise.
      	* cprop.c: Likewise.
      	* data-streamer.h: Likewise.
      	* dbxout.c: Likewise.
      	* dce.c: Likewise.
      	* df-core.c: Likewise.
      	* df-problems.c: Likewise.
      	* df-scan.c: Likewise.
      	* dominance.c: Likewise.
      	* domwalk.c: Likewise.
      	* domwalk.h: Likewise.
      	* dse.c: Likewise.
      	* dwarf2cfi.c: Likewise.
      	* dwarf2out.c: Likewise.
      	* dwarf2out.h: Likewise.
      	* emit-rtl.c: Likewise.
      	* except.c: Likewise.
      	* except.h: Likewise.
      	* expr.c: Likewise.
      	* expr.h: Likewise.
      	* final.c: Likewise.
      	* fold-const.c: Likewise.
      	* function.c: Likewise.
      	* function.h: Likewise.
      	* fwprop.c: Likewise.
      	* gcc.c: Likewise.
      	* gcse.c: Likewise.
      	* genattr.c: Likewise.
      	* genattrtab.c: Likewise.
      	* genautomata.c: Likewise.
      	* genextract.c: Likewise.
      	* genopinit.c: Likewise
      	* ggc-common.c: Likewise.
      	* ggc.h: Likewise.
      	* gimple-low.c: Likewise.
      	* gimple-ssa-strength-reduction.c: Likewise.
      	* gimple-streamer-in.c: Likewise.
      	* gimple.c: Likewise.
      	* gimple.h: Likewise.
      	* gimplify.c: Likewise.
      	* graph.c: Likewise.
      	* graphds.c: Likewise.
      	* graphds.h: Likewise.
      	* graphite-blocking.c: Likewise.
      	* graphite-clast-to-gimple.c: Likewise.
      	* graphite-dependences.c: Likewise.
      	* graphite-interchange.c: Likewise.
      	* graphite-optimize-isl.c: Likewise.
      	* graphite-poly.c: Likewise.
      	* graphite-poly.h: Likewise.
      	* graphite-scop-detection.c: Likewise.
      	* graphite-scop-detection.h: Likewise.
      	* graphite-sese-to-poly.c: Likewise.
      	* graphite.c: Likewise.
      	* godump.c: Likewise.
      	* haifa-sched.c: Likewise.
      	* hw-doloop.c: Likewise.
      	* hw-doloop.h: Likewise.
      	* ifcvt.c: Likewise.
      	* insn-addr.h: Likewise.
      	* ipa-cp.c: Likewise.
      	* ipa-inline-analysis.c: Likewise.
      	* ipa-inline-transform.c: Likewise.
      	* ipa-inline.c: Likewise.
      	* ipa-inline.h: Likewise.
      	* ipa-prop.c: Likewise.
      	* ipa-prop.h: Likewise.
      	* ipa-pure-const.c: Likewise.
      	* ipa-ref-inline.h: Likewise.
      	* ipa-ref.c: Likewise.
      	* ipa-ref.h: Likewise.
      	* ipa-reference.c: Likewise.
      	* ipa-split.c: Likewise.
      	* ipa-utils.c: Likewise.
      	* ipa-utils.h: Likewise.
      	* ipa.c: Likewise.
      	* ira-build.c: Likewise.
      	* ira-color.c: Likewise.
      	* ira-emit.c: Likewise.
      	* ira-int.h: Likewise.
      	* ira.c: Likewise.
      	* loop-invariant.c: Likewise.
      	* loop-unroll.c: Likewise.
      	* lower-subreg.c: Likewise.
      	* lra-lives.c: Likewise.
      	* lra.c: Likewise.
      	* lto-cgraph.c: Likewise.
      	* lto-section-out.c: Likewise.
      	* lto-streamer-in.c: Likewise.
      	* lto-streamer-out.c: Likewise.
      	* lto-streamer.h: Likewise.
      	* lto-symtab.c: Likewise.
      	* mcf.c: Likewise.
      	* modulo-sched.c: Likewise.
      	* omp-low.c: Likewise.
      	* opts-common.c: Likewise.
      	* opts-global.c: Likewise.
      	* opts.c: Likewise.
      	* opts.h: Likewise.
      	* passes.c: Likewise.
      	* predict.c: Likewise.
      	* print-tree.c: Likewise.
      	* profile.c: Likewise.
      	* profile.h: Likewise.
      	* read-rtl.c: Likewise.
      	* ree.c: Likewise.
      	* reg-stack.c: Likewise.
      	* regrename.c: Likewise.
      	* regrename.h: Likewise.
      	* reload.c: Likewise.
      	* reload.h: Likewise.
      	* reload1.c: Likewise.
      	* rtl.h: Likewise.
      	* sched-deps.c: Likewise.
      	* sched-int.h: Likewise.
      	* sdbout.c: Likewise.
      	* sel-sched-dump.c: Likewise.
      	* sel-sched-ir.c: Likewise.
      	* sel-sched-ir.h: Likewise.
      	* sel-sched.c: Likewise.
      	* sese.c: Likewise.
      	* sese.h: Likewise.
      	* statistics.h: Likewise.
      	* stmt.c: Likewise.
      	* stor-layout.c: Likewise.
      	* store-motion.c: Likewise.
      	* tlink.c: Likewise.
      	* toplev.c: Likewise.
      	* trans-mem.c: Likewise.
      	* tree-browser.c: Likewise.
      	* tree-call-cdce.c: Likewise.
      	* tree-cfg.c: Likewise.
      	* tree-cfgcleanup.c: Likewise.
      	* tree-chrec.c: Likewise.
      	* tree-chrec.h: Likewise.
      	* tree-complex.c: Likewise.
      	* tree-data-ref.c: Likewise.
      	* tree-data-ref.h: Likewise.
      	* tree-dfa.c: Likewise.
      	* tree-diagnostic.c: Likewise.
      	* tree-dump.c: Likewise.
      	* tree-eh.c: Likewise.
      	* tree-emutls.c: Likewise.
      	* tree-flow.h: Likewise.
      	* tree-if-conv.c: Likewise.
      	* tree-inline.c: Likewise.
      	* tree-inline.h: Likewise.
      	* tree-into-ssa.c: Likewise.
      	* tree-iterator.c: Likewise.
      	* tree-loop-distribution.c: Likewise.
      	* tree-mudflap.c: Likewise.
      	* tree-optimize.c: Likewise.
      	* tree-outof-ssa.c: Likewise.
      	* tree-parloops.c: Likewise.
      	* tree-phinodes.c: Likewise.
      	* tree-predcom.c: Likewise.
      	* tree-pretty-print.c: Likewise.
      	* tree-scalar-evolution.c: Likewise.
      	* tree-sra.c: Likewise.
      	* tree-ssa-address.c: Likewise.
      	* tree-ssa-alias.c: Likewise.
      	* tree-ssa-ccp.c: Likewise.
      	* tree-ssa-coalesce.c: Likewise.
      	* tree-ssa-dce.c: Likewise.
      	* tree-ssa-dom.c: Likewise.
      	* tree-ssa-forwprop.c: Likewise.
      	* tree-ssa-live.c: Likewise.
      	* tree-ssa-live.h: Likewise.
      	* tree-ssa-loop-im.c: Likewise.
      	* tree-ssa-loop-ivcanon.c: Likewise.
      	* tree-ssa-loop-ivopts.c: Likewise.
      	* tree-ssa-loop-manip.c: Likewise.
      	* tree-ssa-loop-niter.c: Likewise.
      	* tree-ssa-loop-prefetch.c: Likewise.
      	* tree-ssa-math-opts.c: Likewise.
      	* tree-ssa-operands.c: Likewise.
      	* tree-ssa-phiopt.c: Likewise.
      	* tree-ssa-phiprop.c: Likewise.
      	* tree-ssa-pre.c: Likewise.
      	* tree-ssa-propagate.c: Likewise.
      	* tree-ssa-reassoc.c: Likewise.
      	* tree-ssa-sccvn.c: Likewise.
      	* tree-ssa-sccvn.h: Likewise.
      	* tree-ssa-strlen.c: Likewise.
      	* tree-ssa-structalias.c: Likewise.
      	* tree-ssa-tail-merge.c: Likewise.
      	* tree-ssa-threadedge.c: Likewise.
      	* tree-ssa-threadupdate.c: Likewise.
      	* tree-ssa-uncprop.c: Likewise.
      	* tree-ssa-uninit.c: Likewise.
      	* tree-ssa.c: Likewise.
      	* tree-ssanames.c: Likewise.
      	* tree-stdarg.c: Likewise.
      	* tree-streamer-in.c: Likewise.
      	* tree-streamer-out.c: Likewise.
      	* tree-streamer.c: Likewise.
      	* tree-streamer.h: Likewise.
      	* tree-switch-conversion.c: Likewise.
      	* tree-vect-data-refs.c: Likewise.
      	* tree-vect-generic.c: Likewise.
      	* tree-vect-loop-manip.c: Likewise.
      	* tree-vect-loop.c: Likewise.
      	* tree-vect-patterns.c: Likewise.
      	* tree-vect-slp.c: Likewise.
      	* tree-vect-stmts.c: Likewise.
      	* tree-vectorizer.c: Likewise.
      	* tree-vectorizer.h: Likewise.
      	* tree-vrp.c: Likewise.
      	* tree.c: Likewise.
      	* tree.h: Likewise.
      	* value-prof.c: Likewise.
      	* value-prof.h: Likewise.
      	* var-tracking.c: Likewise.
      	* varasm.c: Likewise.
      	* varpool.c: Likewise.
      	* vmsdbgout.c: Likewise.
      	* config/bfin/bfin.c: Likewise.
      	* config/c6x/c6x.c: Likewise.
      	* config/darwin.c: Likewise.
      	* config/i386/i386.c: Likewise.
      	* config/ia64/ia64.c: Likewise.
      	* config/mep/mep.c: Likewise.
      	* config/mips/mips.c: Likewise.
      	* config/pa/pa.c: Likewise.
      	* config/rs6000/rs6000-c.c: Likewise.
      	* config/rs6000/rs6000.c: Likewise.
      	* config/rx/rx.c: Likewise.
      	* config/spu/spu-c.c: Likewise.
      	* config/vms/vms.c: Likewise.
      	* config/vxworks.c: Likewise.
      	* config/epiphany/resolve-sw-modes.c: Likewise.
      
      From-SVN: r193595
      Diego Novillo committed
  19. 12 Sep, 2012 1 commit
  20. 11 Sep, 2012 1 commit
    • Remove unnecessary VEC function overloads. · f32682ca
      Several VEC member functions that accept an element 'T' used to have
      two overloads: one taking 'T', the second taking 'T *'.
      
      This used to be needed because of the interface dichotomy between
      vectors of objects and vectors of pointers.  In the past, vectors of
      pointers would use pass-by-value semantics, but vectors of objects
      would use pass-by-reference semantics.  This is no longer necessary,
      but the distinction had remained.
      
      The main side-effect of this change is some code reduction in code
      that manipulates vectors of objects.  For instance,
      
      -  struct iterator_use *iuse;
      -
      -  iuse = VEC_safe_push (iterator_use, heap, iterator_uses, NULL);
      -  iuse->iterator = iterator;
      -  iuse->ptr = ptr;
      +  struct iterator_use iuse = {iterator, ptr};
      +  VEC_safe_push (iterator_use, heap, iterator_uses, iuse);
      
      Compile time performance was not affected.
      
      Tested on x86_64 and ppc64.
      
      Also built all-gcc on all targets using VEC routines: arm, bfin, c6x,
      epiphany, ia64, mips, sh, spu, and vms.
      
      2012-09-10  Diego Novillo  <dnovillo@google.com>
      
      	* vec.h (vec_t::quick_push): Remove overload that accepts 'T *'.
      	Update all users.
      	(vec_t::safe_push): Likewise.
      	(vec_t::quick_insert): Likewise.
      	(vec_t::lower_bound): Likewise.
      	(vec_t::safe_insert): Likewise.
      	(vec_t::replace): Change second argument to 'T &'.
      
      From-SVN: r191165
      Diego Novillo committed
  21. 05 Sep, 2012 1 commit
  22. 04 Sep, 2012 4 commits
    • Fix bootstrap failure with clang++. · bde6de5d
      This patch fixes a bootstrap failure when using clang as the host
      compiler.  Default arguments for class template member functions
      should be added in the declaration, not the definition.
      
      From Jason:
      
      > 8.3.6 says "Default arguments for a member function of a class template shall
      > be specified on the initial declaration of the member function within the
      > class template."
      
      	PR bootstrap/54484
      	* vec.h (vec_t::embedded_init): Move default argument value
      	to function declaration.
      
      From-SVN: r190951
      Diego Novillo committed
    • This patch works around a parsing problem with g++ 4.3. · 326280d4
      This patch works around a parsing problem with g++ 4.3.  The parser is
      failing to lookup calls to the template function reserve when called
      from other member functions:
      
      vec_t<T>::reserve<A> (...)
      
      The parser thinks that the '<' in reserve<A> is a less-than operation.
      This problem does not happen after 4.3.
      
      This code is going to change significantly, so this won't be needed
      soon.
      
      Tested on x86_64 with g++ 4.3 and g++ 4.6.
      
      	PR bootstrap/54478
      	* vec.h (vec_t::alloc): Remove explicit type specification
      	in call to reserve.
      	(vec_t::copy): Likewise.
      	(vec_t::reserve): Likewise.
      	(vec_t::reserve_exact): Likewise.
      	(vec_t::safe_splice): Likewise.
      	(vec_t::safe_push): Likewise.
      	(vec_t::safe_grow): Likewise.
      	(vec_t::safe_grow_cleared): Likewise.
      	(vec_t::safe_insert): Likewise.
      
      From-SVN: r190943
      Diego Novillo committed
    • re PR bootstrap/54479 (Bootstrap with release-checking broken) · dce6e8ad
      	PR bootstrap/54479
      	* vec.h (vec_t::copy): Add cast in call to reserve_exact.
      
      From-SVN: r190937
      Diego Novillo committed
    • Make all VEC_* functions, member functions of vec_t. · bd0c3bfd
      This patch is the first step towards making the API for VEC use
      member functions.
      
      There are no user code modifications in this patch.  Everything
      is still using the VEC_* macros, but this time they expand into
      member function calls.
      
      Because of the way VECs are used, this required some trickery.
      The API allows VECs to be NULL.  This means that services like
      VEC_length(V) will return 0 when V is a NULL pointer.  This is,
      of course, not possible to do if we call V->length().
      
      For functions that either need to allocate/re-allocate the
      vector, or they need to handle NULL vectors, I implemented them
      as static member functions or free functions.
      
      Another wart that I did not address in this patch is the fact
      that vectors of pointers and vectors of objects have slightly
      different semantics when handling elements in the vector.  In
      vector of pointers, we pass them around by value, but in vectors
      of objects, they are passed around via pointers.  That's why we
      need TYPE * and TYPE ** overloads for some functions (e.g.,
      vec_t::iterate).
      
      I will fix these two warts in a subsequent patch.  The idea is to
      make vec_t a single-word structure, which acts as a handler for
      the structure containing the actual vector.  Something like this:
      
      template<typename T>
      struct vec_t
      {
        struct vec_internal<T> *vec_;
      };
      
      This has the advantage that we can now declare the actual vector
      instances as regular variables, instead of pointers.  They will
      use the same amount of memory when embedded in other structures,
      and we will be able to allocate and reallocate the actual data
      without having to mutate the vector instance.
      
      All the functions that are now static members in vec_t, will
      become instance members in the new vec_t.  This will mean that
      all the callers will need to be changed, of course.
      
      Tested on x86_64 and ppc64 with all languages plus ada, go and obj-c++.
      
      	Rewrite VEC_* functions as member functions of vec_t.
      
      	* vec.h: Update documentation.
      	(ALONE_VEC_CHECK_INFO): Define.
      	(ALONE_VEC_CHECK_DECL): Define.
      	(ALONE_VEC_CHECK_PASS): Define.
      	(struct vec_prefix): Rename field NUM to NUM_.
      	Rename field ALLOC to ALLOC_.
      	Update all users.
      	(struct vec_t): Rename field PREFIX to PREFIX_.
      	Rename field VEC to VEC_.
      	Update all users.
      	(vec_t::length): Rename from VEC_length_1.  Update all users.
      	(vec_t::empty): Rename from VEC_empty_1.  Update all users.
      	(vec_t::address): Rename from VEC_address_1.  Update all users.
      	(vec_address): New.
      	(vec_t::last): Rename from VEC_last_1.  Update all users.
      	(vec_t::operator[]): Rename from VEC_index_1.  Update all users.
      	(vec_t::iterate): Rename from VEC_iterate_1.  Update all users.
      	(vec_t::embedded_size): Rename from VEC_embedded_size_1.
      	Update all users.
      	(vec_t::embedded_init): Rename from VEC_embedded_init_1.
      	Update all users.
      	(vec_t::alloc): Rename from VEC_alloc_1.  Update all users.
      	(vec_t::free): Rename from VEC_free_1.  Update all users.
      	(vec_t::copy): Rename from VEC_copy_1.  Update all users.
      	(vec_t::space): Rename from VEC_space_1.  Update all users.
      	(vec_t::reserve): Rename from VEC_reserve_1.  Update all users.
      	(vec_t::reserve_exact): Rename from VEC_reserve_exact_1.
      	Update all users.
      	(vec_t::splice): Rename from VEC_splice_1.  Update all users.
      	(vec_t::safe_splice): Rename from VEC_safe_splice_1.  Update all users.
      	(vec_t::quick_push): Rename from VEC_quick_push_1.  Update all users.
      	(vec_t::safe_push): Rename from VEC_safe_push_1.  Update all users.
      	(vec_t::pop): Rename from VEC_pop_1.  Update all users.
      	(vec_t::truncate): Rename from VEC_truncate_1.  Update all users.
      	(vec_t::safe_grow): Rename from VEC_safe_grow_1.  Update all users.
      	(vec_t::safe_grow_cleared): Rename from VEC_safe_grow_cleared_1.
      	Update all users.
      	(vec_t::replace): Rename from VEC_replace_1.  Update all users.
      	(vec_t::quick_insert): Rename from VEC_quick_insert_1.
      	Update all users.
      	(vec_t::safe_insert): Rename from VEC_safe_insert_1.  Update all users.
      	(vec_t::ordered_remove): Rename from VEC_ordered_remove_1.
      	Update all users.
      	(vec_t::unordered_remove): Rename from VEC_unordered_remove_1.
      	Update all users.
      	(vec_t::block_remove): Rename from VEC_block_remove_1. Update all users.
      	(vec_t::lower_bound): Rename from VEC_lower_bound_1. Update all users.
      
      From-SVN: r190927
      Diego Novillo committed
  23. 21 Aug, 2012 1 commit
  24. 15 Aug, 2012 1 commit
    • backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html... · 0823efed
      Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
      
      As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
      changes the default bootstrap process so that stage 1 always builds with a C++
      compiler.
      
      Other than the bootstrap change, the patch makes no functional changes to the
      compiler.  Everything should build as it does now in trunk.  The main
      changes in this patch are:
      
      1- Configuration changes.
      2- Re-write of VEC.
      3- Re-write of gengtype to support C++ templates and
         user-provided marking functions.
      4- New hash table class.
      5- Re-write double_int.
      6- Implement tree macros as inline functions so they can be
         called from gdb.
      
      As discussed before, several of these changes do not fully change
      the call sites to use the new APIs.
      
      The bootstrap changes have already been tested on a wide range of
      targets (http://gcc.gnu.org/wiki/CppBuildStatus).  Additionally,
      I have tested the merged trunk on: x86_64-unknown-linux-gnu,
      mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
      i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
      
      ChangeLog
      2012-08-14   Diego Novillo  <dnovillo@google.com>
      
      	Merge from cxx-conversion branch.
      
      	* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
      	POSTSTAGE1_CONFIGURE_FLAGS.
      	* Makefile.in: Regenerate.
      	* configure.ac (ENABLE_BUILD_WITH_CXX): Remove.  Update all users.
      	Force C++ when bootstrapping.
      	* configure: Regenerate.
      
      
      libcpp/ChangeLog
      2012-08-14   Diego Novillo  <dnovillo@google.com>
      
      	Merge from cxx-conversion branch.  Configury.
      
      	* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
      	* configure.ac: Likewise.
      	* configure: Regenerate.
      
      2012-08-14   Lawrence Crowl  <crowl@google.com>
      
      	Merge from cxx-conversion branch.  New C++ hash table.
      
      	* include/symtab.h (typedef struct ht hash_table): Change the typedef
      	name to cpp_hash_table.  Update all users of the typedef.
      
      gcc/ChangeLog
      2012-08-14   Diego Novillo  <dnovillo@google.com>
      
      	Merge from cxx-conversion branch.  Configury.
      
      	* configure.ac (CXX_FOR_BUILD): Define and substitute.
      	(BUILD_CXXFLAGS): Define.
      	Remove all handlers of ENABLE_BUILD_WITH_CXX.
      	Force all build to be with C++.
      	* Makefile.in (BUILD_CXXFLAGS): Use it.
      	Remove all handlers of ENABLE_BUILD_WITH_CXX.
      	* configure: Regenerate.
      	* config.in: Regenerate.
      	* doc/install.texi: Remove documentation for --enable-build-with-cxx
      	and --enable-build-poststage1-with-cxx.
      
      2012-08-14   Diego Novillo  <dnovillo@google.com>
      
      	Merge from cxx-conversion branch.  Re-implement VEC in C++.
      
      	* vec.c (vec_heap_free): Convert into a template function.
      	(vec_gc_o_reserve_1): Make extern.
      	(vec_gc_p_reserve): Remove.
      	(vec_gc_p_reserve_exact): Remove.
      	(vec_gc_o_reserve): Remove.
      	(vec_gc_o_reserve_exact): Remove.
      	(vec_heap_o_reserve_1): Make extern.
      	(vec_heap_p_reserve): Remove.
      	(vec_heap_p_reserve_exact): Remove.
      	(vec_heap_o_reserve): Remove.
      	(vec_heap_o_reserve_exact): Remove.
      	(vec_stack_p_reserve): Remove.
      	(vec_stack_p_reserve_exact): Remove.
      	* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
      	VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
      	in the file.
      	(VEC): Define to vec_t<T>.
      	(vec_allocation_t): Define.
      	(struct vec_prefix): Move earlier in the file.
      	(vec_t<T>): New template.
      	(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
      	DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
      	DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
      	DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
      	(DEF_VEC_A): Provide template instantiations for
      	GC/PCH markers that do not traverse the vector.
      	(vec_stack_p_reserve): Remove.
      	(vec_stack_p_reserve_exact): Remove.
      	(vec_stack_p_reserve_exact_1): Remove.
      	(vec_stack_o_reserve): Remove.
      	(vec_stack_o_reserve_exact): Remove.
      	(vec_stack_free): Re-write as a template function.
      	(vec_reserve): New template function.
      	(vec_reserve_exact): New template function.
      	(vec_heap_free): New template function if GATHER_STATISTICS is
      	defined.  Otherwise, macro that expands to free().
      	(VEC_length_1): New template function.
      	(VEC_length): Call it.
      	(VEC_empty_1): New template function.
      	(VEC_empty): Call it.
      	(VEC_address_1): New template function.
      	(VEC_address): Call it.
      	(VEC_last_1): New template function.
      	(VEC_last): Call it.  Change return type to T&.
      	Change all users that used VEC_Os.
      	(VEC_index_1): New template function.
      	(VEC_index): Call it.  Return a T& instead of a T*.
      	Update all callers that were using VEC_O before.
      	(VEC_iterate_1): New template function.
      	(VEC_iterate): Call it.
      	(VEC_embedded_size_1): New template function.
      	(VEC_embedded_size): Call it.
      	(VEC_embedded_init_1): New template function.
      	(VEC_embedded_init): Call it.
      	(VEC_alloc_1): New template function.
      	(VEC_alloc): Call it.  If A is 'stack', call XALLOCAVAR to
      	do the allocation.
      	(VEC_free_1): New template function.
      	(VEC_free): Call it.
      	(VEC_copy_1): New template function.
      	(VEC_copy): Call it.
      	(VEC_space_1): New template function
      	(VEC_space): Call it.
      	(VEC_reserve_1): New template function.
      	(VEC_reserve): Call it.
      	(VEC_reserve_exact_1): New template function.
      	(VEC_reserve_exact): Call it.
      	(VEC_splice_1): New template function.
      	(VEC_splice): Call it.
      	(VEC_safe_splice_1): New template function.
      	(VEC_safe_splice): Call it.
      	(VEC_quick_push_1): New template function.  Create two overloads, one
      	accepting T, the other accepting T *.  Update all callers
      	where T and T * are ambiguous.
      	(VEC_quick_push): Call it.
      	(VEC_safe_push_1): New template function. Create two overloads, one
      	accepting T, the other accepting T *.  Update all callers
      	where T and T * are ambiguous.
      	(VEC_safe_push): Call it.
      	(VEC_pop_1): New template function.
      	(VEC_pop): Call it.
      	(VEC_truncate_1): New template function.
      	(VEC_truncate): Call it.
      	(VEC_safe_grow_1): New template function.
      	(VEC_safe_grow): Call it.
      	(VEC_safe_grow_cleared_1): New template function.
      	(VEC_safe_grow_cleared): Call it.
      	(VEC_replace_1): New template function.
      	(VEC_replace): Call it.  Always accept T instead of T*.
      	Update all callers that used VEC_Os.
      	(VEC_quick_insert_1): New template function.
      	(VEC_quick_insert): Call it.
      	(VEC_safe_insert_1): New template function.
      	(VEC_safe_insert): Call it.
      	(VEC_ordered_remove_1): New template function.
      	(VEC_ordered_remove): Call it.
      	(VEC_unordered_remove_1): New template function.
      	(VEC_unordered_remove): Call it.
      	(VEC_block_remove_1): New template function.
      	(VEC_block_remove): Call it.
      	(VEC_lower_bound_1): New template function.
      	(VEC_lower_bound): Call it.
      	(VEC_OP): Remove.
      	(DEF_VEC_FUNC_P): Remove.
      	(DEF_VEC_ALLOC_FUNC_P): Remove.
      	(DEF_VEC_NONALLOC_FUNCS_P): Remove.
      	(DEF_VEC_FUNC_O): Remove.
      	(DEF_VEC_ALLOC_FUNC_O): Remove.
      	(DEF_VEC_NONALLOC_FUNCS_O): Remove.
      	(DEF_VEC_ALLOC_FUNC_I): Remove.
      	(DEF_VEC_NONALLOC_FUNCS_I): Remove.
      	(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
      	(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
      	(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
      	(vec_reserve_exact): New template function.
      
      	* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
      	* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
      	(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
      	(def_vec_alloc): Remove.  Update all callers.
      	* gengtype.c (filter_type_name): New.
      	(output_mangled_typename): Call it.
      	(write_func_for_structure): Likewise.
      	(write_types): Likewise.
      	(write_root): Likewise.
      	(write_typed_alloc_def): Likewise.
      	(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
      	(note_def_vec_alloc): Remove.
      	* gengtype.h (note_def_vec_alloc): Remove.
      	(DEFVEC_ALLOC): Remove token code.
      
      	* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
      	inside the insn traversal loop.
      	* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
      	* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
      	* reg-stack.c (stack): Rename to STACK_PTR.  Update all users.
      	* tree-vrp.c (stack): Rename to EQUIV_STACK.  Update all users.
      
      	* config/bfin/bfin.c (hwloop_optimize): Update some calls to
      	VEC_* for vectors of non-pointers.
      	* config/c6x/c6x.c (try_rename_operands): Likewise.
      	(reshuffle_units): Likewise.
      	* config/mips/mips.c (mips_multi_start): Likewise.
      	(mips_multi_add): Likewise.
      	(mips_multi_copy_insn): Likewise.
      	(mips_multi_set_operand): Likewise.
      	* hw-doloop.c (discover_loop): Likewise.
      	(discover_loops): Likewise.
      	(reorg_loops): Likewise.
      
      2012-08-14   Diego Novillo  <dnovillo@google.com>
      
      	Merge from cxx-conversion branch.  C++ support in gengtype.
      
      	* coretypes.h (gt_pointer_operator): Move from ...
      	* ggc.h: ... here.
      	* doc/gty.texi: Document support for C++ templates and
      	user-provided markers.
      	* gcc/gengtype-lex.l: Update copyright year.
      	Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
      	DEFVEC_I.
      	* gengtype-parse.c: Update copyright year.
      	(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
      	(require_template_declaration): New.
      	(typedef_name): Call it.
      	(type): Replace IS_UNION with KIND. Replace all users.
      	(def_vec): Remove.  Update all users.
      	* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
      	(write_state_user_struct_type): New.
      	(write_state_type): Call it.
      	(read_state_user_struct_type): New.
      	(read_state_type): Call it.
      	* gengtype.c: Update copyright year.
      	(dump_pair): Move declaration to the top.
      	(dump_type): Likewise.
      	(dump_type_list): Likewise.
      	(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
      	(create_user_defined_type): New.
      	(resolve_typedef): Call it.
      	(new_structure): Replace argument ISUNION with KIND.
      	Change users to refer to KIND directly.
      	Update all callers.
      	(find_structure): Likewise.
      	(set_gc_used_type): Handle TYPE_USER_STRUCT.
      	(create_file): Update HDR to include new copyright year.
      	(struct walk_type_data): Add field IN_PTR_FIELD.
      	(output_mangled_typename): Handle TYPE_USER_STRUCT.
      	(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
      	Clear it afterwards.
      	Handle TYPE_USER_STRUCT.
      	(write_types_process_field): Handle TYPE_USER_STRUCT.
      	(get_type_specifier): Move earlier in the file.
      	(write_type_decl): New.
      	(write_marker_function_name): New.
      	(write_user_func_for_structure_ptr): New.
      	(write_user_func_for_structure_body): New.
      	(write_user_marking_functions): New.
      	(write_func_for_structure): Call write_marker_function_name
      	and write_type_decl.
      	Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
      	function directly.
      	Call write_user_marking_functions on TYPE_USER_STRUCTs.
      	(write_types_local_user_process_field): New.
      	(write_pch_user_walking_for_structure_body): New.
      	(write_pch_user_walking_functions): New.
      	(write_types_local_process_field): Handle TYPE_USER_STRUCT.
      	(write_local_func_for_structure): Do not call walk_type for
      	TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
      	Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
      	(write_root): Handle TYPE_USER_STRUCT.
      	(vec_prefix_type): Remove.  Update all users.
      	(note_def_vec): Remove.  Update all users.
      	(dump_typekind): Handle TYPE_USER_STRUCT.
      	(dump_type): Initialize SEEN_TYPES, if needed.
      	Handle TYPE_USER_STRUCT.
      	(dump_everything): Do not initialize SEEN_TYPES.
      	* gengtype.h: Update copyright year.
      	(enum typekind): Add TYPE_USER_STRUCT.
      	(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
      	Convert into function.
      	Add an overload taking const_type_p.
      	Update all callers.
      	(new_structure): Change second field to type enum typekind.
      	Update all users.
      	(find_structure): Likewise.
      	(note_def_vec): Remove.
      	(DEFVEC_OP): Remove.
      	(DEFVEC_I): Remove.
      	* ggc-page.c (gt_ggc_mx): Add entry points for marking
      	'const char *&', 'unsigned char *&' and 'unsigned char&'.
      	* ggc-zone.c (gt_ggc_mx): Add entry points for marking
      	'const char *&' and 'unsigned char *&'.
      	* stringpool.c (gt_pch_nx): Add entry points for marking
      	'const char *&', 'unsigned char *&' and 'unsigned char&'.
      	Add an entry point for the overload taking arguments 'unsigned char
      	*', 'gt_pointer_operator' and 'void *'.
      	* vec.h (struct vec_prefix): Remove GTY marker.
      	(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
      	(gt_ggc_mx (vec_t<T> *)): New template function.
      	(gt_pch_nx (vec_t<T> *)): New template function.
      	(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
      	function.
      	(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
      	function.
      
      	* basic-block.h (struct edge_def): Mark GTY((user)).
      	Remove all GTY markers from fields.
      	(gt_ggc_mx): Declare.
      	(gt_pch_nx): Declare.
      	* tree-cfg.c (gt_ggc_mx): New.
      	(gt_pch_nx): New.
      
      	* gengtype-lex.l (USER_GTY): Add pattern for "user".
      	* gengtype-parse.c (option): Handle USER_GTY.
      	(opts_have): New.
      	(type): Call it.
      	If the keyword 'user' is used, do not walk the fields
      	of the structure.
      	* gengtype.h (USER_GTY): Add.
      	* doc/gty.texi: Update.
      
      2012-08-14   Lawrence Crowl  <crowl@google.com>
      
      	Merge cxx-conversion branch.  Implement C++ hash table.
      
      	* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
      	* hash-table.c: Likewise.
      	* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
      	(static htab_t same_succ_htab): Change type to hash_table;
      	move specification of helper functions from create call to declaration.
      	Change users to invoke member functions.
      	(same_succ_print_traverse): Make extern ssa_.... Change callers.
      	Remove void* casting.
      	(same_succ_hash): Likewise.
      	(same_succ_equal): Likewise.
      	(same_succ_delete): Likewise.
      	* tree-ssa-threadupdate.c: Include hash-table.h.
      	(struct local_info): Rename to ssa_local_info_t to avoid overloading
      	the type name local_info with the variable name local_info.
      	(static htab_t redirection_data): Change type to hash_table.
      	Move specification of helper functions from create call to declaration.
      	Change users to invoke member functions.
      	(redirection_data_hash): Make extern ssa_.... Change callers.
      	Remove void* casting.
      	(redirection_data_eq): Likewise.
      	(fix_duplicate_block_edges): Likewise.
      	(create_duplicates): Likewise.
      	(fixup_template_block): Likewise.
      	(redirect_edges): Likewise.
      	(lookup_redirection_data): Change types associated with the hash table
      	from void* to their actual type. Remove unnecessary casts.
      	* tree-ssa-ccp.c: Include hash-table.h.
      	(typedef gimple_htab): New.  Uses hash_table.  Replace specific uses
      	of htab_t with gimple_htab.  Change users to invoke member functions.
      	Move specification of helper functions from create call to declaration.
      	* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
      	(hash_ssa_name_by_var): Make extern. Remove void* casting.
      	(eq_ssa_name_by_var): Likewise.
      	(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
      	to hash_table. Change users to invoke member functions.
      	Move specification of helper functions from create call to declaration.
      	* coverage.c: Include hash-table.h instead of hashtab.h.
      	(static htab_t counts_hash): Change type to hash_table;
      	move specification of helper functions from create call to declaration.
      	Change users to invoke member functions.
      	(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
      	of htab_... Remove void* casting.
      	(htab_counts_entry_eq): Likewise.
      	(htab_counts_entry_del): Likewise.
      	* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
      	(static htab_t expression_to_id): Change type to hash_table.
      	Move specification of helper functions from create call to declaration.
      	Change users to invoke member functions.
      	(static htab_t phi_translate_table): Likewise.
      	(pre_expr_eq): Make extern ssa_.... Change callers.
      	Remove void* casting.
      	(pre_expr_hash): Likewise.
      	(expr_pred_trans_hash): Likewise.
      	(expr_pred_trans_eq): Likewise.
      	(alloc_expression_id): Change types associated with the hash table
      	from void* to their actual type. Remove unnecessary casts.
      	(lookup_expression_id): Likewise.
      	(phi_trans_lookup): Likewise.
      	(phi_trans_add): Likewise.
      	* stringpool.c: Rename uses of libcpp typedef hash_table to
      	cpp_hash_table.
      	* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
      	Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
      
      2012-08-14   Lawrence Crowl  <crowl@google.com>
      
      	Merge from cxx-conversion branch.  Re-write double_int in C++.
      
      	* hash-table.h
      	(typedef double_int): Change to struct (POD).
      	(double_int::make): New overloads for int to double-int conversion.
      	(double_int::mask): New.
      	(double_int::max_value): New.
      	(double_int::min_value): New.
      	(double_int::operator ++): New.
      	(double_int::operator --): New.
      	(double_int::operator *=): New.
      	(double_int::operator +=): New.
      	(double_int::operator -=): New.
      	(double_int::to_signed): New.
      	(double_int::to_unsigned): New.
      	(double_int::fits_unsigned): New.
      	(double_int::fits_signed): New.
      	(double_int::fits): New.
      	(double_int::trailing_zeros): New.
      	(double_int::popcount): New.
      	(double_int::multiple_of): New.
      	(double_int::set_bit): New.
      	(double_int::mul_with_sign): New.
      	(double_int::operator * (binary)): New.
      	(double_int::operator + (binary)): New.
      	(double_int::operator - (binary)): New.
      	(double_int::operator - (unary)): New.
      	(double_int::operator ~ (unary)): New.
      	(double_int::operator & (binary)): New.
      	(double_int::operator | (binary)): New.
      	(double_int::operator ^ (binary)): New.
      	(double_int::and_not): New.
      	(double_int::lshift): New.
      	(double_int::rshift): New.
      	(double_int::alshift): New.
      	(double_int::arshift): New.
      	(double_int::llshift): New.
      	(double_int::lrshift): New.
      	(double_int::lrotate): New.
      	(double_int::rrotate): New.
      	(double_int::div): New.
      	(double_int::sdiv): New.
      	(double_int::udiv): New.
      	(double_int::mod): New.
      	(double_int::smod): New.
      	(double_int::umod): New.
      	(double_int::divmod): New.
      	(double_int::sdivmod): New.
      	(double_int::udivmod): New.
      	(double_int::ext): New.
      	(double_int::zext): New.
      	(double_int::sext): New.
      	(double_int::is_zero): New.
      	(double_int::is_one): New.
      	(double_int::is_minus_one): New.
      	(double_int::is_negative): New.
      	(double_int::cmp): New.
      	(double_int::ucmp): New.
      	(double_int::scmp): New.
      	(double_int::ult): New.
      	(double_int::ugt): New.
      	(double_int::slt): New.
      	(double_int::sgt): New.
      	(double_int::max): New.
      	(double_int::smax): New.
      	(double_int::umax): New.
      	(double_int::min): New.
      	(double_int::smin): New.
      	(double_int::umin): New.
      	(double_int::operator ==): New.
      	(double_int::operator !=): New.
      	(shwi_to_double_int): Change implementation to use member function.
      	(double_int_minus_one): Likewise.
      	(double_int_zero): Likewise.
      	(double_int_one): Likewise.
      	(double_int_two): Likewise.
      	(double_int_ten): Likewise.
      	(uhwi_to_double_int): Likewise.
      	(double_int_to_shwi): Likewise.
      	(double_int_to_uhwi): Likewise.
      	(double_int_fits_in_uhwi_p): Likewise.
      	(double_int_fits_in_shwi_p): Likewise.
      	(double_int_fits_in_hwi_p): Likewise.
      	(double_int_mul): Likewise.
      	(double_int_mul_with_sign): Likewise.
      	(double_int_add): Likewise.
      	(double_int_sub): Likewise.
      	(double_int_neg): Likewise.
      	(double_int_div): Likewise.
      	(double_int_sdiv): Likewise.
      	(double_int_udiv): Likewise.
      	(double_int_mod): Likewise.
      	(double_int_smod): Likewise.
      	(double_int_umod): Likewise.
      	(double_int_divmod): Likewise.
      	(double_int_sdivmod): Likewise.
      	(double_int_udivmod): Likewise.
      	(double_int_multiple_of): Likewise.
      	(double_int_setbit): Likewise.
      	(double_int_ctz): Likewise.
      	(double_int_not): Likewise.
      	(double_int_ior): Likewise.
      	(double_int_and): Likewise.
      	(double_int_and_not): Likewise.
      	(double_int_xor): Likewise.
      	(double_int_lshift): Likewise.
      	(double_int_rshift): Likewise.
      	(double_int_lrotate): Likewise.
      	(double_int_rrotate): Likewise.
      	(double_int_cmp): Likewise.
      	(double_int_scmp): Likewise.
      	(double_int_ucmp): Likewise.
      	(double_int_max): Likewise.
      	(double_int_smax): Likewise.
      	(double_int_umax): Likewise.
      	(double_int_min): Likewise.
      	(double_int_smin): Likewise.
      	(double_int_umin): Likewise.
      	(double_int_ext): Likewise.
      	(double_int_sext): Likewise.
      	(double_int_zext): Likewise.
      	(double_int_mask): Likewise.
      	(double_int_max_value): Likewise.
      	(double_int_min_value): Likewise.
      	(double_int_zero_p): Likewise.
      	(double_int_one_p): Likewise.
      	(double_int_minus_one_p): Likewise.
      	(double_int_equal_p): Likewise.
      	(double_int_popcount): Likewise.
      	* hash-table.c
      	(double_int_mask): Reuse implementation for double_int::mask.
      	(double_int_max_value): Likewise.
      	(double_int_min_value): Likewise.
      	(double_int_ext): Likewise.
      	(double_int_zext): Likewise.
      	(double_int_sext): Likewise.
      	(double_int_mul_with_sign): Likewise.
      	(double_int_divmod): Likewise.
      	(double_int_sdivmod): Likewise.
      	(double_int_udivmod): Likewise.
      	(double_int_div): Likewise.
      	(double_int_sdiv): Likewise.
      	(double_int_udiv): Likewise.
      	(double_int_mod): Likewise.
      	(double_int_smod): Likewise.
      	(double_int_umod): Likewise.
      	(double_int_multiple_of): Likewise.
      	(double_int_lshift): Likewise.
      	(double_int_rshift): Likewise.
      	(double_int_lrotate): Likewise.
      	(double_int_rrotate): Likewise.
      	(double_int_cmp): Likewise.
      	(double_int_ucmp): Likewise.
      	(double_int_scmp): Likewise.
      	(double_int_max): Likewise.
      	(double_int_smax): Likewise.
      	(double_int_umax): Likewise.
      	(double_int_min): Likewise.
      	(double_int_smin): Likewise.
      	(double_int_umin): Likewise.
      	(double_int_min): Likewise.
      	(double_int_min): Likewise.
      	(double_int_min): Likewise.
      	(double_int_min): Likewise.
      	(double_int_min): Likewise.
      	(double_int_min): Likewise.
      	(double_int::alshift): New.
      	(double_int::arshift): New.
      	(double_int::llshift): New.
      	(double_int::lrshift): New.
      	(double_int::ult): New.
      	(double_int::ugt): New.
      	(double_int::slt): New.
      	(double_int::sgt): New.
      	(double_int_setbit): Reuse implementation for double_int::set_bit,
      	which avoids a name conflict with a macro.
      	(double_int_double_int_ctz): Reuse implementation for
      	double_int::trailing_zeros.
      	(double_int_fits_in_shwi_p): Reuse implementation for
      	double_int::fits_signed.
      	(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
      	(double_int_mul): Reuse implementation for binary
      	double_int::operator *.
      	(double_int_add): Likewise.
      	(double_int_sub): Likewise.
      	(double_int_neg): Reuse implementation for unary
      	double_int::operator -.
      	(double_int_max_value): Likewise.
      	* fixed-value.c: Change to use member functions introduced above.
      
      2012-08-14   Lawrence Crowl  <crowl@google.com>
      
      	Merge cxx-conversion branch.  Support tree macro calling
      	from gdb.
      
      	* tree.h (tree_check): New.
      	(TREE_CHECK): Use inline function above instead of __extension__.
      	(tree_not_check): New.
      	(TREE_NOT_CHECK): Use inline function above instead of __extension__.
      	(tree_check2): New.
      	(TREE_CHECK2): Use inline function above instead of __extension__.
      	(tree_not_check2): New.
      	(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
      	(tree_check3): New.
      	(TREE_CHECK3): Use inline function above instead of __extension__.
      	(tree_not_check3): New.
      	(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
      	(tree_check4): New.
      	(TREE_CHECK4): Use inline function above instead of __extension__.
      	(tree_not_check4): New.
      	(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
      	(tree_check5): New.
      	(TREE_CHECK5): Use inline function above instead of __extension__.
      	(tree_not_check5): New.
      	(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
      	(contains_struct_check): New.
      	(CONTAINS_STRUCT_CHECK): Use inline function above instead of
      	__extension__.
      	(tree_class_check): New.
      	(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
      	(tree_range_check): New.
      	(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
      	(omp_clause_subcode_check): New.
      	(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
      	__extension__.
      	(omp_clause_range_check): New.
      	(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
      	__extension__.
      	(expr_check): New.
      	(EXPR_CHECK): Use inline function above instead of __extension__.
      	(non_type_check): New.
      	(NON_TYPE_CHECK): Use inline function above instead of __extension__.
      	(tree_vec_elt_check): New.
      	(TREE_VEC_ELT_CHECK): Use inline function above instead of
      	__extension__.
      	(omp_clause_elt_check): New.
      	(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
      	__extension__.
      	(tree_operand_check): New.
      	(TREE_OPERAND_CHECK): Use inline function above instead of
      	__extension__.
      	(tree_operand_check_code): New.
      	(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
      	__extension__.
      	(TREE_CHAIN): Simplify implementation.
      	(TREE_TYPE): Simplify implementation.
      	(tree_operand_length): Move for compilation dependences.
      	* gdbinit.in: (macro define __FILE__): New.
      	(macro define __LINE__): New.
      	(skip "tree.h"): New.
      
      gcc/cp/ChangeLog
      2012-08-14   Diego Novillo  <dnovillo@google.com>
      
      	Merge from cxx-conversion branch.  Re-write VEC in C++.
      
      	* call.c (add_function_candidate): Remove const qualifier
      	from call to VEC_index.
      
      2012-08-14   Diego Novillo  <dnovillo@google.com>
      
      	Merge from cxx-conversion branch.  Configury.
      
      	* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
      	* go-gcc.cc: Likewise.
      	* go-system.h: Likewise.
      
      From-SVN: r190402
      Diego Novillo committed
  25. 30 Jul, 2012 1 commit
    • gengtype.c (adjust_field_type): Diagnose duplicate "length" option applications… · c0fd3497
      gengtype.c (adjust_field_type): Diagnose duplicate "length" option applications and option being applied to...
      
      gcc:
      2012-07-27  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
      	    Steven Bosscher  <steven@gcc.gnu.org>
      
      	* gengtype.c (adjust_field_type): Diagnose duplicate "length"
      	option applications and option being applied to arrays of atomic
      	types.
      	(walk_type): Allow "atomic" option on strings too.
      	* dwarf2out.h (struct dw_vec_struct): Use the "atomic" GTY option
      	for the array field.
      	* vec.h: Describe the atomic object "A" type of the macros in
      	the header comment.
      	(VEC_T_GTY_ATOMIC, DEF_VEC_A, DEF_VEC_ALLOC_A): Define.
      	* emit-rtl.c (locations_locators_vals): use the atomic object
      	vector.
      	* doc/gty.texi: Clarify that GTY option "length" is only for
      	arrays of non-atomic objects.  Fix typo in the description of the
      	"atomic" option.
      
      gcc/java:
      2012-07-24  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
      
      	* jcf.h (CPool): Use the "atomic" GTY option for the tags field.
      	(bootstrap_method): Likewise for the bootstrap_arguments field.
      
      libcpp:
      2012-07-24  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
      
      	* include/line-map.h (line_map_macro): Use the "atomic" GTY option
      	for the macro_locations field.
      
      Co-Authored-By: Steven Bosscher <steven@gcc.gnu.org>
      
      From-SVN: r189951
      Laurynas Biveinis committed
  26. 24 Jul, 2012 1 commit
    • sbitmap.h (SBITMAP_ELT_BITS): Use "1u" trick as for BITMAP_WORD_BITS. · 7aa6d18a
      gcc/
      	* sbitmap.h (SBITMAP_ELT_BITS): Use "1u" trick as for BITMAP_WORD_BITS.
      	Move test to check that there is a popcount function for the the number
      	of bits in SBITMAP_ELT_BITS to sbitmap.c.
      	* sbitmap.c: Test SBITMAP_ELT_BITS, not HOST_BITS_PER_WIDEST_FAST_INT.
      	MEM_STAT_INFO): Define in terms of their ALONE counterparts.
      
      	* configure.ac (GATHER_STATISTICS): Always define, non-zero if enabled.
      	* configure: Regenerate.
      	* statistics.h (GATHER_STATISTICS): Error out if it is not defined.
      	(GCC_MEM_STAT_ARGUMENTS): New define.
      	(ALONE_MEM_STAT_DECL): Define in terms of GCC_MEM_STAT_ARGUMENTS.
      	(ALONE_FINAL_MEM_STAT_DECL, ALONE_FINAL_PASS_MEM_STAT): New defines.
      	(MEM_STAT_DECL, FINAL_MEM_STAT_DECL, PASS_MEM_STAT, FINAL_PASS_MEM_STAT,
      	* ggc-internal.h (ggc_record_overhead): Use FINAL_MEM_STAT_DECL.
      	* ggc.h (ggc_record_overhead, ggc_free_overhead,
      	ggc_prune_overhead_list): Remove internal prototypes, they are defined
      	already in ggc-internal.h.
      	* ggc-common.c (struct loc_descriptor): Remove #ifdef GATHER_STATISTICS
      	wrappers.
      	(add_statistics): Likewise.
      	(dump_ggc_loc_statistics): Likewise. Return if GATHER_STATISTICS is 0. 
      	* ggc-zone.c (struct page_entry): Remove #ifdef GATHER_STATISTICS
      	wrappers around "survived" and "stats" members.
      	(alloc_large_page): Always initialize survived.
      	(ggc_internal_alloc_zone_stat): Likewise.
      	Remove #ifdef GATHER_STATISTICS wrappers.  Record overhead if
      	GATHER_STATISTICS is non-0.
      	(ggc_free): Convert #ifdef GATHER_STATISTICS to if-code.
      	(sweep_pages): Always increase survived.
      	(ggc_collect_1): Convert #ifdef GATHER_STATISTICS to if-code.
      	(calculate_average_page_survival): Always define.
      	(ggc_collect): Convert #ifdef GATHER_STATISTICS to if-code.
      	(ggc_print_statistics): Likewise.
      	(ggc_pch_read): Likewise.
      	* ggc-page.c (struct globals): Always define "stats" member.
      	(ggc_internal_alloc_stat): Convert #ifdef GATHER_STATISTICS to if-code.
      	(ggc_free): Likewise.
      	(ggc_collec): Likewise.
      	(ggc_print_statistics): Likewise.
      	* bitmap.h (struct bitmap_head_def): Always define "desc" member.
      	(bitmap_initialize_stat): Convert #ifdef GATHER_STATISTICS to if-code.
      	* gimple.h (enum gimple_alloc_kind): Always define.
      	(gimple_alloc_kind): Likewise.
      	* tree-flow.h (phinodes_print_statistics): Always define.
      	(ssanames_print_statistics): Likewise.
      	* vec.h (vec_heap_free): Always define.
      	(VEC_stack_alloc): Define if GATHER_STATISTICS is non-0.
      	* alloc-pool.c (alloc_pool_descriptor): Always define.
      	(create_alloc_pool): Convert #ifdef GATHER_STATISTICS to if-code.
      	(empty_alloc_pool): Likewise.
      	(pool_alloc): Likewise.
      	(pool_free): Likewise.
      	(dump_alloc_pool_statistics): Likewise.
      	(print_statistics): Always define.
      	* bitmap.c (struct bitmap_descriptor): Always define.
      	(bitmap_register): Pass ALONE_FINAL_PASS_MEM_STAT.
      	(register_overhead): Always define.
      	(bitmap_element_free): Convert #ifdef GATHER_STATISTICS to if-code.
      	(bitmap_element_allocate): Likewise.
      	(bitmap_elt_clear_from): Likewise.
      	(bitmap_obstack_alloc_stat): Likewise.
      	(bitmap_gc_alloc_stat): Likewise.
      	(bitmap_obstack_free): Likewise.
      	(bitmap_find_bit): Likewise.
      	(bitmap_ior_and_into):  Likewise.
      	(bitmap_print): Likewise.
      	(dump_bitmap_statistics): Likewise. Return if GATHER_STATISTICS is 0.
      	* gimple.c (gimple_alloc_counts, gimple_alloc_sizes): Always define.
      	(gimple_alloc_kind_names): Likewise.
      	(gimple_alloc_stat): Convert #ifdef GATHER_STATISTICS to if-code.
      	(dump_gimple_statistics): Likewise. Return if GATHER_STATISTICS is 0.
      	* rtl.c (rtx_alloc_counts, rtx_alloc_sizes, rtvec_alloc_counts,
      	rtvec_alloc_sizes): Always define.
      	(rvec_alloc): Convert #ifdef GATHER_STATISTICS to if-code.
      	(rtx_alloc_stat): Likewise.
      	(dump_rtx_statistics): Likewise. Return if GATHER_STATISTICS is 0.
      	* tree.c (_obstack_allocated_p, tree_code_counts, tree_node_counts,
      	tree_node_sizes, tree_node_kind_names): Always define.
      	(record_node_allocation_statistics): Convert #ifdef GATHER_STATISTICS
      	to if-code.
      	(type_hash_canon): Likewise.
      	(dump_tree_statistics): Likewise.
      	* tree-ssanames.c (ssa_name_nodes_reused, ssa_name_nodes_created):
      	Always define.
      	(ssanames_print_statistics): Likewise.
      	(make_ssa_name_fn): Convert #ifdef GATHER_STATISTICS to if-code.
      	* tree-phinodes.c (phi_nodes_reused, phi_nodes_created): Always define.
      	(phinodes_print_statistics): Likewise.
      	(allocate_phi_node): Convert #ifdef GATHER_STATISTICS to if-code.
      	* vec.c (struct vec_descriptor): Always define.
      	(hash_descriptor, eq_descriptor, ptr_hash_entry, hash_ptr, eq_ptr,
      	vec_descriptor, rester_overhead, free_overhead): Likewise.
      	(cmp_statistic): Likewise.
      	(vec_heap_free): Convert #ifdef GATHER_STATISTICS to if-code.
      	(vec_heap_o_reserve_1): Likewise.
      	(dump_vec_loc_statistics): Likewise.
      
      cp/
      	* cp/class.c (n_vtables, n_vtable_entries, n_vtable_searches,
      	n_vtable_elems, n_convert_harshness, n_compute_conversion_costs,
      	n_inner_fields_searched): Always define.
      	(build_primary_vtable): Convert #ifdef GATHER_STATISTICS to if-code.
      	(print_class_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
      	* cp/tree.c (depth_reached): Always define global.
      	(cxx_print_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
      	* cp/pt.c (depth_reached): Always define.
      	(push_tinst_level): Convert #ifdef GATHER_STATISTICS to if-code.
      	* cp/search.c (n_fields_searched, n_calls_lookup_field,
      	n_calls_lookup_field_1, n_calls_lookup_fnfields,
      	n_calls_lookup_fnfields_1, n_calls_get_base_type,
      	n_outer_fields_searched, n_contexts_saved): Always define.
      	(lookup_field_1): Convert #ifdef GATHER_STATISTICS to if-code.
      	(lookup_member): Likewise.
      	(lookup_fnfields_idx_nolazy): Likewise.
      	(print_search_statistics): Likewise.
      	(reinit_search_statistics): Unconditionally re-set counters.
      	* cp/lex.c (retrofit_lang_decl): Convert #ifdef GATHER_STATISTICS
      	to if-code.
      	(cxx_dup_lang_specific_decl): Likewise.
      	(copy_lang_type): Likewise.
      	(cxx_make_type): Likewise.
      
      From-SVN: r189803
      Steven Bosscher committed
  27. 10 Nov, 2011 1 commit
  28. 07 Sep, 2011 1 commit
    • regrename.c (struct du_head): Make nregs signed. · 8ffa0351
      	* regrename.c (struct du_head): Make nregs signed.
      	(closed_chains): Remove.
      	(create_new_chain): Return the new chain.
      	(chain_from_id): New static function.
      	(dump_def_use_chain): Change argument to be an int, indicating
      	the first ID to print.  All callers changed.
      	(merge_overlapping_regs): Use chain_from_id.  Assert that
      	chains don't conflict with themselves.
      	(rename_chains): Take no argument.  Iterate over id_to_chain
      	rather to find chains to rename.  Clear tick before the main
      	loop.
      	(struct incoming_reg_info): New struct.
      	(struct bb_rename_info): New struct.
      	(init_rename_info, set_incoming_from_chain, merge_chains): New
      	static functions.
      	(regrename_analyze): New static function, broken out of
      	regrename_optimize.  Record and make use of open chain information
      	at basic block boundaries, and merge chains where possible.
      	(scan_rtx_reg): Make this_nregs signed.  Don't update
      	closed_chains.
      	(build_def_use): Return a bool to indicate success.  All callers
      	changed.  Don't initialize global data here.
      	(regrename_optimize): Move most code out of here into
      	regrename_analyze.
      	* regs.h (add_range_to_hard_reg_set, remove_range_from_hard_reg_set,
      	range_overlaps_hard_reg_set_p, range_in_hard_reg_set_p): New
      	static inline functions.
      	* vec.h (FOR_EACH_VEC_ELT_FROM): New macro.
      
      From-SVN: r178645
      Bernd Schmidt committed
  29. 27 May, 2011 1 commit
    • re PR other/48981 (bootstrap-lto -O3 produces miscompiled, broken gcc) · fc64b448
      2011-05-27  Andrew Pinski  <pinskia@gmail.com>
      
      	PR middle-end/48981
      	* gengtype.c (vec_prefix_type): New function.
      	(note_def_vec): Use vec_prefix_type and change the length
      	attribute to be based on the prefix.
      	* vec.c: Include coretypes.h before vec.h.
      	(struct vec_prefix): Remove.
      	(vec_gc_p_reserve): Change the offsetof to sizeof.
      	(vec_gc_p_reserve_exact): Likewise.
      	(vec_heap_p_reserve): Likewise.
      	(vec_heap_p_reserve_exact): Likewise.
      	(vec_stack_o_reserve_1): Copy from +1 instead of from vec.
      	(vec_stack_p_reserve): Change the offsetof to sizeof.
      	(vec_stack_p_reserve_exact): Likewise.
      	* vec.h (struct vec_prefix): New struct definition.
      	(VEC_T(T,B)): Use vec_prefix instead of having num/alloc fields.
      	(VEC_T_GTY(T,B)): Likewise.
      	(DEF_VEC_FUNC_P(T)): Use prefix field.
      	(DEF_VEC_NONALLOC_FUNCS_O(T,A)): Likewise.
      	(DEF_VEC_NONALLOC_FUNCS_I(T,A)): Likewise.
      
      From-SVN: r174359
      Andrew Pinski committed
  30. 11 Oct, 2010 1 commit
    • vec.h (VEC_qsort): Define. · 5095da95
      gcc/
      	* vec.h (VEC_qsort): Define.
      	* dbxout.c (output_used_types): Use it.
      	* df-scan.c (df_sort_and_compress_refs): Likewise.
      	(df_sort_and_compress_mws): Likewise.
      	* genautomata.c (uniq_sort_alt_states): Likewise.
      	(evaluate_equiv_classes): Likewise.
      	(output_trans_table): Likewise.
      	(output_state): Likewise.
      	* gimplify.c (compare_case_labels): Likewise.
      	* graphite-sese-to-poly.c (graphite_sort_dominated_info): Likewise.
      	* ipa.c (build_cdtor_fns): Likewise.
      	* lto.c (lto_wpa_write_files): Likewise.
      	* sel-sched.c (fill_vec_av_set): Likewise.
      	* tree-predcom.c (determine_roots_comp): Likewise.
      	* tree-sra.c (sort_and_spliace_var_accesses): Likewise.
      	(splice_param_accesses): Likewise.
      	* tree-ssa-live.c (dump_enumerated_decls): Likewise.
      	* tree-ssa-reassoc.c (undistribute_ops_list): Likewise.
      	(reassociate_bb): Likewise.
      	* tree-ssa-sccvn.c (sort_scc): Likewise.
      	* tree-ssa-structalias.c (sort_fieldstack): Likewise.
      
      gcc/ada/
      	* gcc-interface/utils2.c (gnat_build_constructor): Use VEC_qsort.
      
      From-SVN: r165314
      Nathan Froyd committed
  31. 20 Aug, 2010 1 commit
    • vec.h (FOR_EACH_VEC_ELT): Define. · ac47786e
      gcc/
      	* vec.h (FOR_EACH_VEC_ELT): Define.
      	* c-decl.c: Use it.
      	* cfgloop.c: Likewise.
      	* cfgloopmanip.c: Likewise.
      	* cgraph.c: Likewise.
      	* cgraphunit.c: Likewise.
      	* combine.c: Likewise.
      	* config/bfin/bfin.c: Likewise.
      	* config/mips/mips.c: Likewise.
      	* config/rs6000/rs6000.c: Likewise.
      	* dbxout.c: Likewise.
      	* df-scan.c: Likewise.
      	* dominance.c: Likewise.
      	* dse.c: Likewise.
      	* dwarf2out.c: Likewise.
      	* except.c: Likewise.
      	* expr.c: Likewise.
      	* function.c: Likewise.
      	* gcse.c: Likewise.
      	* genattr.c: Likewise.
      	* ggc-common.c: Likewise.
      	* gimplify.c: Likewise.
      	* graphite-blocking.c: Likewise.
      	* graphite-clast-to-gimple.c: Likewise.
      	* graphite-dependences.c: Likewise.
      	* graphite-interchange.c: Likewise.
      	* graphite-poly.c: Likewise.
      	* graphite-scop-detection.c: Likewise.
      	* graphite-sese-to-poly.c: Likewise.
      	* graphite.c: Likewise.
      	* haifa-sched.c: Likewise.
      	* ifcvt.c: Likewise.
      	* implicit-zee.c: Likewise.
      	* ipa-prop.c: Likewise.
      	* ipa-struct-reorg.c: Likewise.
      	* ipa.c: Likewise.
      	* ira-build.c: Likewise.
      	* ira-color.c: Likewise.
      	* ira-emit.c: Likewise.
      	* lambda-code.c: Likewise.
      	* loop-invariant.c: Likewise.
      	* loop-unroll.c: Likewise.
      	* lower-subreg.c: Likewise.
      	* lto-cgraph.c: Likewise.
      	* lto-opts.c: Likewise.
      	* lto-streamer-in.c: Likewise.
      	* lto-streamer-out.c: Likewise.
      	* lto-streamer.c: Likewise.
      	* lto-symtab.c: Likewise.
      	* matrix-reorg.c: Likewise.
      	* opts.c: Likewise.
      	* predict.c: Likewise.
      	* print-tree.c: Likewise.
      	* sdbout.c: Likewise.
      	* sel-sched-dump.c: Likewise.
      	* sel-sched-ir.c: Likewise.
      	* sel-sched.c: Likewise.
      	* sese.c: Likewise.
      	* stor-layout.c: Likewise.
      	* tree-cfg.c: Likewise.
      	* tree-cfgcleanup.c: Likewise.
      	* tree-chrec.c: Likewise.
      	* tree-data-ref.c: Likewise.
      	* tree-emutls.c: Likewise.
      	* tree-inline.c: Likewise.
      	* tree-into-ssa.c: Likewise.
      	* tree-loop-distribution.c: Likewise.
      	* tree-loop-linear.c: Likewise.
      	* tree-mudflap.c: Likewise.
      	* tree-outof-ssa.c: Likewise.
      	* tree-parloops.c: Likewise.
      	* tree-predcom.c: Likewise.
      	* tree-pretty-print.c: Likewise.
      	* tree-scalar-evolution.c: Likewise.
      	* tree-ssa-live.c: Likewise.
      	* tree-ssa-loop-im.c: Likewise.
      	* tree-ssa-loop-ivcanon.c: Likewise.
      	* tree-ssa-loop-ivopts.c: Likewise.
      	* tree-ssa-loop-manip.c: Likewise.
      	* tree-ssa-loop-niter.c: Likewise.
      	* tree-ssa-loop-prefetch.c: Likewise.
      	* tree-ssa-phiprop.c: Likewise.
      	* tree-ssa-pre.c: Likewise.
      	* tree-ssa-reassoc.c: Likewise.
      	* tree-ssa-sccvn.c: Likewise.
      	* tree-ssa-structalias.c: Likewise.
      	* tree-ssa.c: Likewise.
      	* tree-vect-data-refs.c: Likewise.
      	* tree-vect-loop-manip.c: Likewise.
      	* tree-vect-loop.c: Likewise.
      	* tree-vect-patterns.c: Likewise.
      	* tree-vect-slp.c: Likewise.
      	* tree-vect-stmts.c: Likewise.
      	* tree-vrp.c: Likewise.
      	* tree.c: Likewise.
      	* value-prof.c: Likewise.
      	* var-tracking.c: Likewise.
      	* varasm.c: Likewise.
      	* vmsdbgout.c: Likewise.
      
      gcc/ada/
      	* gcc-interface/decl.c: Use FOR_EACH_VEC_ELT.
      	* gcc-interface/trans.c: Likewise.
      	* gcc-interface/utils.c: Likewise.
      
      gcc/c-family/
      	* c-common.c: Use FOR_EACH_VEC_ELT.
      	* c-gimplify.c: Likewise.
      	* c-pragma.c: Likewise.
      
      gcc/cp/
      	* call.c: Use FOR_EACH_VEC_ELT.
      	* class.c: Likewise.
      	* decl.c: Likewise.
      	* decl2.c: Likewise.
      	* error.c: Likewise.
      	* except.c: Likewise.
      	* mangle.c: Likewise.
      	* method.c: Likewise.
      	* name-lookup.c: Likewise.
      	* parser.c: Likewise.
      	* pt.c: Likewise.
      	* repo.c: Likewise.
      	* semantics.c: Likewise.
      	* typeck2.c: Likewise.
      
      gcc/fortran/
      	* trans-openmp.c: Use FOR_EACH_VEC_ELT.
      
      gcc/java/
      	* class.c: Use FOR_EACH_VEC_ELT.
      	* expr.c: Likewise.
      	* jcf-parse.c: Likewise.
      	* resource.c: Likewise.
      
      gcc/lto/
      	* lto.c: Use FOR_EACH_VEC_ELT.
      
      From-SVN: r163401
      Nathan Froyd committed
  32. 13 Jul, 2010 1 commit
    • re PR debug/44901 (-fcompare-debug failure for tree-predcom.c) · 2fed2012
      	PR debug/44901
      	* vec.h (VEC_block_remove): Fix comment.
      	* tree-ssa-live.c (remove_unused_locals): Don't use
      	VEC_unordered_remove on local_decls, instead replace a single
      	vector element in each iteration if at least one element had
      	to be removed and VEC_truncate at the end.
      	* omp-low.c (expand_omp_taskreg): Likewise.
      
      From-SVN: r162126
      Jakub Jelinek committed
  33. 06 Jul, 2010 1 commit
    • vec.h (FOR_EACH_VEC_ELT_REVERSE): New macro. · c021f10b
      gcc/
      	* vec.h (FOR_EACH_VEC_ELT_REVERSE): New macro.
      	* function.h (struct_function): Change type of local_decls field
      	to a VEC.
      	(add_local_decl): New function.
      	(FOR_EACH_LOCAL_DECL): New macro.
      	* cfgexpand.c (init_vars_expansion): Adjust for new type of
      	cfun->local_decls.
      	(estimated_stack_frame_size): Likewise.
      	(expand_used_vars): Likewise.
      	* cgraphbuild.c (build_cgraph_edges): Likewise.
      	* function.c (instantiate_decls_1): Likewise.
      	* ipa-struct-reorg.c (build_data_structure): Likewise.
      	* ipa-type-escape.c (analyze_function): Likewise.
      	* lto-streamer-in.c (input_function): Likewise.
      	* lto-streamer-out.c (output_function): Likewise.
      	* tree-ssa-live.c (remove_unused_locals): Likewise.
      	* tree.c (free_lang_data_in_decl): Likewise.
      	(find_decls_types_in_node): Likewise.
      	* omp-low.c (remove_exit_barrier): Likewise.
      	(expand_omp_taskreg): Likewise.
      	(list2chain): Rename to...
      	(vec2chain): ...this.  Adjust.
      	* cgraphunit.c (assemble_thunk): Call add_local_decl.
      	* tree-cfg.c (replace_by_duplicate_decl): Likewise.
      	* gimple-low.c (record_vars_into): Likewise.
      	* tree-inline.c (remap_decls): Likewise.
      	(declare_return_variable): Likewise.
      	(declare_inline_vars): Likewise.
      	(copy_forbidden): Adjust for new type of cfun->local_decls.
      	(add_local_variables): New function.
      	(expand_call_inline): Call it.
      	(tree_function_versioning): Likewise.
      
      gcc/cp/
      	* decl.c (cp_finish_decl): Call add_local_decl.
      	* optimize.c (clone_body): Adjust for new type of cfun->local_decls.
      
      From-SVN: r161862
      Nathan Froyd committed
  34. 05 Jul, 2010 1 commit
    • vec.h (VEC_splice, [...]): New macros. · 989ea525
      gcc/
      	* vec.h (VEC_splice, VEC_safe_splice): New macros.  Add function
      	implementations.
      
      gcc/fortran/
      	* trans.h (gfc_conv_procedure_call): Take a VEC instead of a tree.
      	* trans-intrinsic.c (gfc_conv_intrinsic_funcall): Adjust for new
      	type of gfc_conv_procedure_call.
      	(conv_generic_with_optional_char_arg): Likewise.
      	* trans-stmt.c (gfc_trans_call): Likewise.
      	* trans-expr.c (gfc_conv_function_expr): Likewise.
      	(gfc_conv_procedure_call): Use build_call_vec instead of
      	build_call_list.
      
      From-SVN: r161834
      Nathan Froyd committed
  35. 28 Jun, 2010 1 commit