Commit Graph

3077 Commits

Author SHA1 Message Date
Phil Muldoon ddc8de034a Let GDB reuse GCC's parser.
2014-10-27  Phil Muldoon  <pmuldoon@redhat.com>
	    Jan Kratochvil  <jan.kratochvil@redhat.com>
	    Tom Tromey  <tromey@redhat.com>

	* aclocal.m4: New file.
	* callbacks.cc: New file.
	* callbacks.hh: New file.
	* cc1plugin-config.h.in: New file.
	* configure: New file.
	* configure.ac: New file.
	* connection.cc: New file.
	* connection.hh: New file.
	* findcomp.cc: New file.
	* findcomp.hh: New file.
	* libcc1.cc: New file.
	* libcc1plugin.sym: New file.
	* libcc1.sym: New file.
	* Makefile.am: New file.
	* Makefile.in: New file.
	* marshall.cc: New file.
	* marshall.hh: New file.
	* names.cc: New file.
	* names.hh: New file.
	* plugin.cc: New file.
	* rpc.hh: New file.
	* status.hh: New file.

2014-10-27  Phil Muldoon  <pmuldoon@redhat.com>
	    Jan Kratochvil  <jan.kratochvil@redhat.com>
	    Tom Tromey  <tromey@redhat.com>

	* gcc-c-fe.def: New file.
	* gcc-c-interface.h: New file.
	* gcc-interface.h: New file.

2014-10-27  Phil Muldoon  <pmuldoon@redhat.com>
	    Tom Tromey  <tromey@redhat.com>

	* c-tree.h (enum c_oracle_request): New.
	(c_binding_oracle_function): New typedef.
	(c_binding_oracle, c_pushtag, c_bind): Declare.
	* c-decl.c (c_binding_oracle): New global.
	(I_SYMBOL_CHECKED): New macro.
	(i_symbol_binding): New function.
	(I_SYMBOL_BINDING, I_SYMBOL_DECL): Redefine.
	(I_TAG_CHECKED): New macro.
	(i_tag_binding): New function.
	(I_TAG_BINDING, I_TAG_DECL): Redefine.
	(I_LABEL_CHECKED): New macro.
	(i_label_binding): New function.
	(I_LABEL_BINDING, I_LABEL_DECL): Redefine.
	(c_print_identifier): Save and restore c_binding_oracle.
	(c_pushtag, c_bind): New functions.

2014-10-27  Phil Muldoon  <pmuldoon@redhat.com>
	    Tom Tromey  <tromey@redhat.com>

	* aclocal.m4, configure: Rebuild.
	* Makefile.in (aclocal_deps): Add gcc-plugin.m4.
	* configure.ac: Use GCC_ENABLE_PLUGINS.
	* stor-layout.c (finish_bitfield_layout): Now public.  Change
	argument type to 'tree'.
	(finish_record_layout): Update.
	* stor-layout.h (finish_bitfield_layout): Declare.

2014-10-27  Tom Tromey  <tromey@redhat.com>

	* gcc-plugin.m4: New file.

2014-10-27  Phil Muldoon  <pmuldoon@redhat.com>
	    Tom Tromey  <tromey@redhat.com>

	* Makefile.def: Add libcc1 to host_modules.
	* configure.ac (host_tools): Add libcc1.
	* Makefile.in, configure: Rebuild.

From-SVN: r216748
2014-10-27 17:21:42 +00:00
Andrew MacLeod 60393bbc61 ggcplug.c: Shuffle includes to include gcc-plugin.h earlier.
2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* testsuite/gcc.dg/plugin/ggcplug.c: Shuffle includes to include
	gcc-plugin.h earlier.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* c/c-typeck.c: Adjust include files.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* c-family/c-gimplify.c: Adjust include files.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* cp/cp-gimplify.c: Adjust include files.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* go/go-gcc.cc: Adjust include files.
	* go/go-lang.c: Ditto.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* java/java-gimplify.c: Adjust include files.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* lto/lto-lang.c: Adjust include files.
	* lto/lto-object.c: Ditto.
	* lto/lto-partition.c: Ditto.
	* lto/lto-symtab.c: Ditto.
	* lto/lto.c: Ditto.

2014-10-27  Andrew MacLeod  <amacleod@redhat.com>

	* basic-block.h: Remove all includes.
	(enum profile_status_d, struct control_flow_graph): Move to cfg.h
	* cfg.h (profile_status_d, struct control_flow_graph): Relocate here.
	* Makefile.in (GTFILES): Add cfg.h to list.
	* cgraph.h (symbol_table::create_empty): Move to cgraph.c.
	* cgraph.c (symbol_table::create_empty): Relocate from cgraph.h.
	* genconditions.c (write_header): Add predict.h and basic-block.h to
	lits of includes.
	* genemit.c (main): Ditto.
	* genpreds.c (write_insn_preds_c): Ditto.
	* genrecog.c (write_header): Ditto.
	* gengtype.c (open_base_files): Add predict.h, basic-block.h, and cfg.h
	to list of includes.
	* alias.c: Adjust include files.
	* asan.c: Ditto.
	* auto-inc-dec.c: Ditto.
	* auto-profile.c: Ditto.
	* bb-reorder.c: Ditto.
	* bt-load.c: Ditto.
	* builtins.c: Ditto.
	* caller-save.c: Ditto.
	* calls.c: Ditto.
	* cfg.c: Ditto.
	* cfganal.c: Ditto.
	* cfgbuild.c: Ditto.
	* cfgcleanup.c: Ditto.
	* cfgexpand.c: Ditto.
	* cfghooks.c: Ditto.
	* cfgloop.c: Ditto.
	* cfgloopanal.c: Ditto.
	* cfgloopmanip.c: Ditto.
	* cfgrtl.c: Ditto.
	* cgraphbuild.c: Ditto.
	* cgraphclones.c: Ditto.
	* cgraphunit.c: Ditto.
	* combine-stack-adj.c: Ditto.
	* combine.c: Ditto.
	* compare-elim.c: Ditto.
	* coverage.c: Ditto.
	* cprop.c: Ditto.
	* cse.c: Ditto.
	* cselib.c: Ditto.
	* data-streamer-in.c: Ditto.
	* data-streamer-out.c: Ditto.
	* data-streamer.c: Ditto.
	* dce.c: Ditto.
	* ddg.c: Ditto.
	* ddg.h: Ditto.
	* df-core.c: Ditto.
	* df-problems.c: Ditto.
	* df-scan.c: Ditto.
	* df.h: Ditto.
	* dojump.c: Ditto.
	* dominance.c: Ditto.
	* domwalk.c: Ditto.
	* dse.c: Ditto.
	* dwarf2cfi.c: Ditto.
	* emit-rtl.c: Ditto.
	* et-forest.c: Ditto.
	* except.c: Ditto.
	* expmed.c: Ditto.
	* expr.c: Ditto.
	* final.c: Ditto.
	* fold-const.c: Ditto.
	* function.c: Ditto.
	* fwprop.c: Ditto.
	* gcc-plugin.h: Ditto.
	* gcse.c: Ditto.
	* generic-match-head.c: Ditto.
	* ggc-page.c: Ditto.
	* gimple-builder.c: Ditto.
	* gimple-expr.c: Ditto.
	* gimple-fold.c: Ditto.
	* gimple-iterator.c: Ditto.
	* gimple-low.c: Ditto.
	* gimple-match-head.c: Ditto.
	* gimple-pretty-print.c: Ditto.
	* gimple-ssa-isolate-paths.c: Ditto.
	* gimple-ssa-strength-reduction.c: Ditto.
	* gimple-streamer-in.c: Ditto.
	* gimple-streamer-out.c: Ditto.
	* gimple-streamer.h: Ditto.
	* gimple-walk.c: Ditto.
	* gimple.c: Ditto.
	* gimplify-me.c: Ditto.
	* gimplify.c: Ditto.
	* graph.c: Ditto.
	* graphite-blocking.c: Ditto.
	* graphite-clast-to-gimple.c: Ditto.
	* graphite-dependences.c: Ditto.
	* graphite-interchange.c: Ditto.
	* graphite-isl-ast-to-gimple.c: Ditto.
	* graphite-optimize-isl.c: Ditto.
	* graphite-poly.c: Ditto.
	* graphite-scop-detection.c: Ditto.
	* graphite-sese-to-poly.c: Ditto.
	* graphite.c: Ditto.
	* haifa-sched.c: Ditto.
	* hw-doloop.c: Ditto.
	* ifcvt.c: Ditto.
	* init-regs.c: Ditto.
	* internal-fn.c: Ditto.
	* ipa-cp.c: Ditto.
	* ipa-devirt.c: Ditto.
	* ipa-icf-gimple.c: Ditto.
	* ipa-icf.c: Ditto.
	* ipa-inline-analysis.c: Ditto.
	* ipa-inline.c: Ditto.
	* ipa-polymorphic-call.c: Ditto.
	* ipa-profile.c: Ditto.
	* ipa-prop.c: Ditto.
	* ipa-pure-const.c: Ditto.
	* ipa-reference.c: Ditto.
	* ipa-split.c: Ditto.
	* ipa-utils.c: Ditto.
	* ipa.c: Ditto.
	* ira-build.c: Ditto.
	* ira-color.c: Ditto.
	* ira-conflicts.c: Ditto.
	* ira-costs.c: Ditto.
	* ira-emit.c: Ditto.
	* ira-lives.c: Ditto.
	* ira.c: Ditto.
	* jump.c: Ditto.
	* lcm.c: Ditto.
	* loop-doloop.c: Ditto.
	* loop-init.c: Ditto.
	* loop-invariant.c: Ditto.
	* loop-iv.c: Ditto.
	* loop-unroll.c: Ditto.
	* lower-subreg.c: Ditto.
	* lra-assigns.c: Ditto.
	* lra-coalesce.c: Ditto.
	* lra-constraints.c: Ditto.
	* lra-eliminations.c: Ditto.
	* lra-lives.c: Ditto.
	* lra-spills.c: Ditto.
	* lra.c: Ditto.
	* lto-cgraph.c: Ditto.
	* lto-compress.c: Ditto.
	* lto-opts.c: Ditto.
	* lto-section-in.c: Ditto.
	* lto-section-out.c: Ditto.
	* lto-streamer-in.c: Ditto.
	* lto-streamer-out.c: Ditto.
	* lto-streamer.c: Ditto.
	* mcf.c: Ditto.
	* mode-switching.c: Ditto.
	* modulo-sched.c: Ditto.
	* omp-low.c: Ditto.
	* optabs.c: Ditto.
	* opts-global.c: Ditto.
	* passes.c: Ditto.
	* postreload-gcse.c: Ditto.
	* postreload.c: Ditto.
	* predict.c: Ditto.
	* print-rtl.c: Ditto.
	* profile.c: Ditto.
	* recog.c: Ditto.
	* ree.c: Ditto.
	* reg-stack.c: Ditto.
	* regcprop.c: Ditto.
	* regcprop.h: Ditto.
	* reginfo.c: Ditto.
	* regrename.c: Ditto.
	* regstat.c: Ditto.
	* reload.c: Ditto.
	* reload1.c: Ditto.
	* reorg.c: Ditto.
	* resource.c: Ditto.
	* rtlanal.c: Ditto.
	* sched-deps.c: Ditto.
	* sched-ebb.c: Ditto.
	* sched-int.h: Ditto.
	* sched-rgn.c: Ditto.
	* sched-vis.c: Ditto.
	* sel-sched-dump.c: Ditto.
	* sel-sched-ir.c: Ditto.
	* sel-sched-ir.h: Ditto.
	* sel-sched.c: Ditto.
	* sese.c: Ditto.
	* shrink-wrap.c: Ditto.
	* stack-ptr-mod.c: Ditto.
	* stmt.c: Ditto.
	* store-motion.c: Ditto.
	* symtab.c: Ditto.
	* toplev.c: Ditto.
	* tracer.c: Ditto.
	* trans-mem.c: Ditto.
	* tree-affine.c: Ditto.
	* tree-call-cdce.c: Ditto.
	* tree-cfg.c: Ditto.
	* tree-cfgcleanup.c: Ditto.
	* tree-chrec.c: Ditto.
	* tree-complex.c: Ditto.
	* tree-data-ref.c: Ditto.
	* tree-dfa.c: Ditto.
	* tree-eh.c: Ditto.
	* tree-emutls.c: Ditto.
	* tree-if-conv.c: Ditto.
	* tree-inline.c: Ditto.
	* tree-into-ssa.c: Ditto.
	* tree-loop-distribution.c: Ditto.
	* tree-nested.c: Ditto.
	* tree-nrv.c: Ditto.
	* tree-object-size.c: Ditto.
	* tree-outof-ssa.c: Ditto.
	* tree-parloops.c: Ditto.
	* tree-phinodes.c: Ditto.
	* tree-predcom.c: Ditto.
	* tree-pretty-print.c: Ditto.
	* tree-profile.c: Ditto.
	* tree-scalar-evolution.c: Ditto.
	* tree-sra.c: Ditto.
	* tree-ssa-address.c: Ditto.
	* tree-ssa-alias.c: Ditto.
	* tree-ssa-ccp.c: Ditto.
	* tree-ssa-coalesce.c: Ditto.
	* tree-ssa-copy.c: Ditto.
	* tree-ssa-copyrename.c: Ditto.
	* tree-ssa-dce.c: Ditto.
	* tree-ssa-dom.c: Ditto.
	* tree-ssa-dse.c: Ditto.
	* tree-ssa-forwprop.c: Ditto.
	* tree-ssa-ifcombine.c: Ditto.
	* tree-ssa-live.c: Ditto.
	* tree-ssa-loop-ch.c: Ditto.
	* tree-ssa-loop-im.c: Ditto.
	* tree-ssa-loop-ivcanon.c: Ditto.
	* tree-ssa-loop-ivopts.c: Ditto.
	* tree-ssa-loop-manip.c: Ditto.
	* tree-ssa-loop-niter.c: Ditto.
	* tree-ssa-loop-prefetch.c: Ditto.
	* tree-ssa-loop-unswitch.c: Ditto.
	* tree-ssa-loop.c: Ditto.
	* tree-ssa-math-opts.c: Ditto.
	* tree-ssa-operands.c: Ditto.
	* tree-ssa-phiopt.c: Ditto.
	* tree-ssa-phiprop.c: Ditto.
	* tree-ssa-pre.c: Ditto.
	* tree-ssa-propagate.c: Ditto.
	* tree-ssa-reassoc.c: Ditto.
	* tree-ssa-sccvn.c: Ditto.
	* tree-ssa-sink.c: Ditto.
	* tree-ssa-strlen.c: Ditto.
	* tree-ssa-structalias.c: Ditto.
	* tree-ssa-tail-merge.c: Ditto.
	* tree-ssa-ter.c: Ditto.
	* tree-ssa-threadedge.c: Ditto.
	* tree-ssa-threadupdate.c: Ditto.
	* tree-ssa-uncprop.c: Ditto.
	* tree-ssa-uninit.c: Ditto.
	* tree-ssa.c: Ditto.
	* tree-ssanames.c: Ditto.
	* tree-stdarg.c: Ditto.
	* tree-streamer-in.c: Ditto.
	* tree-streamer-out.c: Ditto.
	* tree-streamer.c: Ditto.
	* tree-switch-conversion.c: Ditto.
	* tree-tailcall.c: Ditto.
	* tree-vect-data-refs.c: Ditto.
	* tree-vect-generic.c: Ditto.
	* tree-vect-loop-manip.c: Ditto.
	* tree-vect-loop.c: Ditto.
	* tree-vect-patterns.c: Ditto.
	* tree-vect-slp.c: Ditto.
	* tree-vect-stmts.c: Ditto.
	* tree-vectorizer.c: Ditto.
	* tree-vrp.c: Ditto.
	* tree.c: Ditto.
	* tsan.c: Ditto.
	* ubsan.c: Ditto.
	* valtrack.c: Ditto.
	* valtrack.h: Ditto.
	* value-prof.c: Ditto.
	* var-tracking.c: Ditto.
	* varasm.c: Ditto.
	* varpool.c: Ditto.
	* vtable-verify.c: Ditto.
	* web.c: Ditto.
	* config/aarch64/aarch64-builtins.c: Ditto.
	* config/aarch64/aarch64.c: Ditto.
	* config/alpha/alpha.c: Ditto.
	* config/arc/arc.c: Ditto.
	* config/arm/arm.c: Ditto.
	* config/avr/avr.c: Ditto.
	* config/bfin/bfin.c: Ditto.
	* config/c6x/c6x.c: Ditto.
	* config/cr16/cr16.c: Ditto.
	* config/cris/cris.c: Ditto.
	* config/darwin-c.c: Ditto.
	* config/darwin.c: Ditto.
	* config/epiphany/epiphany.c: Ditto.
	* config/epiphany/mode-switch-use.c: Ditto.
	* config/epiphany/resolve-sw-modes.c: Ditto.
	* config/fr30/fr30.c: Ditto.
	* config/frv/frv.c: Ditto.
	* config/h8300/h8300.c: Ditto.
	* config/i386/i386.c: Ditto.
	* config/i386/winnt.c: Ditto.
	* config/ia64/ia64.c: Ditto.
	* config/iq2000/iq2000.c: Ditto.
	* config/lm32/lm32.c: Ditto.
	* config/m32c/m32c.c: Ditto.
	* config/m32r/m32r.c: Ditto.
	* config/m68k/m68k.c: Ditto.
	* config/mcore/mcore.c: Ditto.
	* config/mep/mep.c: Ditto.
	* config/microblaze/microblaze.c: Ditto.
	* config/mips/mips.c: Ditto.
	* config/mmix/mmix.c: Ditto.
	* config/mn10300/mn10300.c: Ditto.
	* config/moxie/moxie.c: Ditto.
	* config/msp430/msp430.c: Ditto.
	* config/nds32/nds32-cost.c: Ditto.
	* config/nds32/nds32-fp-as-gp.c: Ditto.
	* config/nds32/nds32-intrinsic.c: Ditto.
	* config/nds32/nds32-isr.c: Ditto.
	* config/nds32/nds32-md-auxiliary.c: Ditto.
	* config/nds32/nds32-memory-manipulation.c: Ditto.
	* config/nds32/nds32-pipelines-auxiliary.c: Ditto.
	* config/nds32/nds32-predicates.c: Ditto.
	* config/nds32/nds32.c: Ditto.
	* config/nios2/nios2.c: Ditto.
	* config/pa/pa.c: Ditto.
	* config/pdp11/pdp11.c: Ditto.
	* config/rl78/rl78.c: Ditto.
	* config/rs6000/rs6000.c: Ditto.
	* config/rx/rx.c: Ditto.
	* config/s390/s390.c: Ditto.
	* config/sh/sh-mem.cc: Ditto.
	* config/sh/sh.c: Ditto.
	* config/sh/sh_optimize_sett_clrt.cc: Ditto.
	* config/sh/sh_treg_combine.cc: Ditto.
	* config/sparc/sparc.c: Ditto.
	* config/spu/spu.c: Ditto.
	* config/stormy16/stormy16.c: Ditto.
	* config/tilegx/tilegx.c: Ditto.
	* config/tilepro/tilepro.c: Ditto.
	* config/v850/v850.c: Ditto.
	* config/vax/vax.c: Ditto.
	* config/xtensa/xtensa.c: Ditto.

From-SVN: r216735
2014-10-27 12:41:01 +00:00
Richard Biener 1f59b31508 Makefile.in (BUILD_CPPLIB): Move $(LIBINTL) $(LIBICONV) to genmatch BUILD_LIBS instead.
2014-10-24  Richard Biener  <rguenther@suse.de>

	* Makefile.in (BUILD_CPPLIB): Move $(LIBINTL) $(LIBICONV)
	to genmatch BUILD_LIBS instead.

From-SVN: r216632
2014-10-24 11:09:30 +00:00
Richard Biener ef1ea28c3c Makefile.in (BUILD_CPPLIB): When in stage2+ use the host library and make sure to pull in the required...
2014-10-24  Richard Biener  <rguenther@suse.de>

	* Makefile.in (BUILD_CPPLIB): When in stage2+ use the
	host library and make sure to pull in the required libintl
	and libiconv dependencies.

From-SVN: r216619
2014-10-24 08:04:25 +00:00
Richard Biener 929315a917 Makefile.def: Add libcpp build module and dependencies.
2014-10-23  Richard Biener  <rguenther@suse.de>

	* Makefile.def: Add libcpp build module and dependencies.
	* configure.ac: Add libcpp build module.
	* Makefile.in: Regenerate.
	* configure: Likewise.

	gcc/
	* Makefile.in (BUILD_CPPLIB): Add.
	(build/genmatch$(build_exeext)): Use BUILD_CPPLIB, not CPPLIB.
	Drop LIBIBERTY.

From-SVN: r216579
2014-10-23 09:14:48 +00:00
Richard Biener 1d9ce5dd15 Makefile.in (s-match): Adjust dependencies to only catch match.pd.
2014-10-22  Richard Biener  <rguenther@suse.de>

	* Makefile.in (s-match): Adjust dependencies to only catch
	match.pd.

From-SVN: r216545
2014-10-22 08:55:45 +00:00
Richard Biener 3d2cf79f81 Makefile.in (OBJS): Add gimple-match.o and generic-match.o.
2014-10-22  Richard Biener  <rguenther@suse.de>
	Prathamesh Kulkarni  <bilbotheelffriend@gmail.com>

	* Makefile.in (OBJS): Add gimple-match.o and generic-match.o.
	(MOSTLYCLEANFILES): Add gimple-match.c and generic-match.c.
	(gimple-match.c): Generate by triggering s-match.
	(generic-match.c): Likewise.
	(s-match): Rule to build gimple-match.c and generic-match.c
	by running the genmatch generator program.
	(build/hash-table.o): Dependencies to build hash-table.c for the host.
	(build/genmatch.o): Dependencies to build genmatch.
	(genprog): Add match.
	(build/genmatch): Likewise.
	(TEXI_GCCINT_FILES): Add match-and-simplify.texi.
	* generic-match-head.c: New file.
	* gimple-match-head.c: Likewise.
	* gimple-match.h: Likewise.
	* genmatch.c: Likewise.
	* match.pd: Likewise.
	* builtins.h (fold_builtin_n): Export.
	* builtins.c (fold_builtin_n): Likewise.
	* gimple-fold.h (gimple_build): Declare various overloads.
	(gimple_simplify): Likewise.
	(gimple_convert): Re-implement in terms of gimple_build.
	* gimple-fold.c (gimple_convert): Remove.
	(gimple_build): New functions.

	* doc/match-and-simplify.texi: New file.
	* doc/gccint.texi: Add menu item Match and Simplify and include
	match-and-simplify.texi.

Co-Authored-By: Prathamesh Kulkarni <bilbotheelffriend@gmail.com>

From-SVN: r216542
2014-10-22 08:42:37 +00:00
Dehao Chen be3c16c474 Add AutoFDO.
gcc/ChangeLog:

2014-10-21  Dehao Chen  <dehao@google.com>

	* auto-profile.c: New file.
	* auto-profile.h: New file.
	* basic-block.h (maybe_hot_count_p): New export func.
	(add_working_set): New export func.
	* gcov-io.h (GCOV_TAG_AFDO_FILE_NAMES): New tag.
	(GCOV_TAG_AFDO_FUNCTION): Likewise.
	(GCOV_TAG_AFDO_WORKING_SET): Likewise.
	* opts.c (enable_fdo_optimizations): New func.
	(common_handle_option): Handle -fauto-profile flag.
	* ipa-inline.c (want_early_inline_function_p): Iterative-einline.
	(class pass_early_inline): Export early_inliner.
	(early_inliner): Likewise.
	(pass_early_inline::execute): Likewise.
	* ipa-inline.h (early_inliner): Likewise.
	* predict.c (maybe_hot_count_p): New export func.
	(counts_to_freqs): AutoFDO logic.
	(rebuild_frequencies): Likewise.
	* tree-profile.c (pass_ipa_tree_profile::gate): Likewise.
	* profile.c (add_working_set): New func.
	* Makefile.in (auto-profile.o): New object file.
	* passes.def (pass_ipa_auto_profile): New pass.
	* tree-ssa-live.c (remove_unused_scope_block_p): AutoFDO logic.
	* tree-pass.h (make_pass_ipa_auto_profile): New pass.
	* toplev.c (compile_file): AutoFDO logic.
	* doc/invoke.texi (-fauto-profile): New doc.
	* coverage.c (coverage_init): AutoFDO logic.
	* common.opt (-fauto-profile): New flag.
	* timevar.def (TV_IPA_AUTOFDO): New tag.
	* value-prof.c (gimple_alloc_histogram_value): New export func.
	(check_ic_target): Likewise.
	* value-prof.h (gimple_alloc_histogram_value): Likewise.
	(check_ic_target): Likewise.

From-SVN: r216523
2014-10-21 17:59:30 +00:00
Martin Liska b84d4347ac IPA ICF pass, part 3/5
* Makefile.in: New object files included.
	* cgraph.c (cgraph_node::dump): New cgraph_node flag icf_merged
	is printed.
	(verify_edge_corresponds_to_fndecl): More sensitive verification
	of nodes that are merged by IPA ICF.
	* cgraph.h (cgraph_node::num_references): New function.
	* cgraphunit.c (cgraph_node::expand_thunk): White space fixed.
	* common.opt: New options ipa-icf, ipa-icf-functions and
	ipa-icf-variables introduced.
	* doc/invoke.texi: Documentation of new options introduced.
	* ipa-icf-gimple.c: New file.
	* ipa-icf-gimple.h: New file.
	* ipa-icf.c: New file.
	* ipa-icf.h: New file.
	* lto-cgraph.c (lto_output_node): Streaming of icf_merged flag added.
	(input_overwrite_node): Likewise.
	* lto-section-in.c: New icf section added.
	* lto-streamer.h (enum lto_section_type): Likewise.
	* opts.c (common_handle_option): New option added.
	* passes.def: New pass included.
	* timevar.def: Time variable for IPA ICF added.
	* tree-pass.h: New IPA ICF pass entry point added.


Co-Authored-By: Jan Hubicka <hubicka@ucw.cz>

From-SVN: r216305
2014-10-16 10:47:55 +00:00
Aldy Hernandez e3c891c7cf * Makefile.in (TAGS): Tag ../include files.
From-SVN: r216160
2014-10-13 19:57:14 +00:00
Christophe Lyon 83022253ad Makefile.in: (check-%): Update comment, as RUNTESTFLAGS no longer impact parallelization.
2014-10-13  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
	* Makefile.in: (check-%): Update comment, as RUNTESTFLAGS no
	longer impact parallelization.

From-SVN: r216147
2014-10-13 15:56:34 +02:00
Rong Xu afe0c5ee91 Makefile.in: Fix dependence.
2014-10-06  Rong Xu  <xur@google.com>

	* gcc/Makefile.in: Fix dependence.
	* gcc/gcov-counter.def (GCOV_COUNTER_ICALL_TOPNV): Add
        indirect call topn profiler.
	* gcc/gcov-io.h: Ditto.
	* libgcc/Makefile.in: Ditto.
	* libgcc/libgcov-driver.c (gcov_sort_n_vals): New utility function.
	(gcov_sort_icall_topn_counter): Ditto.
	(gcov_sort_topn_counter_arrays): Ditto.
	(dump_one_gcov): Sort indirect_call topn counters.
	* libgcc/libgcov-merge.c (__gcov_merge_icall_topn): New merge
        function.
	* libgcc/libgcov-profiler.c (__gcov_topn_value_profiler_body): New
        utility function.
	(__gcov_indirect_call_topn_profiler): New profiler function.
	* libgcc/libgcov-util.c (__gcov_icall_topn_counter_op): New.
	* libgcc/libgcov.h: New decls.

From-SVN: r215962
2014-10-07 04:02:31 +00:00
Olivier Hainque 5a6b6a9f21 Makefile.in (CROSS): Define, to @CROSS@.
2014-10-02  Olivier Hainque  <hainque@adacore.com>

        * Makefile.in (CROSS): Define, to @CROSS@.

From-SVN: r215799
2014-10-02 09:44:20 +00:00
David Malcolm b355f52ed1 PR plugins/63410: Fix missing headers for plugins
gcc/
	PR plugins/63410
	* Makefile.in (PRETTY_PRINT_H): Add wide-int-print.h.
	(PLUGIN_HEADERS): Add pass-instances.def.

From-SVN: r215727
2014-09-30 15:41:11 +00:00
Jan Hubicka aa803cc76e ipa-utils.h (subbinfo_with_vtable_at_offset, [...]): Declare.
* ipa-utils.h (subbinfo_with_vtable_at_offset, type_all_derivations_known_p,
	type_known_to_have_no_deriavations_p, types_must_be_same_for_odr,
	types_odr_comparable): Declare.
	(polymorphic_type_binfo_p): Move here from ipa-devirt.c
	* ipa-polymorphic-call.c: New file.
	(contains_polymorphic_type_p, possible_placement_new,
	ipa_polymorphic_call_context::restrict_to_inner_class,
	contains_type_p, decl_maybe_in_construction_p,
	ipa_polymorphic_call_context::stream_out,
	ipa_polymorphic_call_context::debug,
	ipa_polymorphic_call_context::stream_in,
	ipa_polymorphic_call_context::set_by_decl,
	ipa_polymorphic_call_context::set_by_invariant,
	walk_ssa_copies,
	ipa_polymorphic_call_context::ipa_polymorphic_call_context,
	type_change_info, noncall_stmt_may_be_vtbl_ptr_store,
	extr_type_from_vtbl_ptr_store, record_known_type
	check_stmt_for_type_change,
	ipa_polymorphic_call_context::get_dynamic_type): Move here from
	ipa-devirt.c
	* ipa-devirt.c: No longer include data-streamer.h, lto-streamer.h
	and streamer-hooks.h
	(contains_polymorphic_type_p, possible_placement_new,
	ipa_polymorphic_call_context::restrict_to_inner_class,
	contains_type_p, decl_maybe_in_construction_p,
	ipa_polymorphic_call_context::stream_out,
	ipa_polymorphic_call_context::debug,
	ipa_polymorphic_call_context::stream_in,
	ipa_polymorphic_call_context::set_by_decl,
	ipa_polymorphic_call_context::set_by_invariant,
	walk_ssa_copies,
	ipa_polymorphic_call_context::ipa_polymorphic_call_context,
	type_change_info, noncall_stmt_may_be_vtbl_ptr_store,
	extr_type_from_vtbl_ptr_store, record_known_type
	check_stmt_for_type_change,
	ipa_polymorphic_call_context::get_dynamic_type): Move to
	ipa-polymorphic-call.c
	(type_all_derivations_known_p, types_odr_comparable,
	types_must_be_same_for_odr): Export.
	(type_known_to_have_no_deriavations_p): New function.
	* Makefile.in: Add ipa-polymorphic-call.c

From-SVN: r215615
2014-09-25 19:52:20 +00:00
Jason Merrill 2eac08538a Makefile.in (check-parallel-%): Add @.
gcc/
	* Makefile.in (check-parallel-%): Add @.
libstdc++-v3/
	* testsuite/Makefile.am (%/site.exp): Add @.
	(check-DEJAGNU): Likewise.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r215474
2014-09-22 12:33:35 -04:00
Jakub Jelinek 717c478953 Makefile.in (dg_target_exps): Remove.
gcc/
	* Makefile.in (dg_target_exps): Remove.
	(check_gcc_parallelize): Change to just an upper bound number.
	(check-%-subtargets): Always print the non-parallelized goals.
	(check_p_vars, check_p_comma, check_p_subwork): Remove.
	(check_p_count, check_p_numbers0, check_p_numbers1, check_p_numbers2,
	check_p_numbers3, check_p_numbers4, check_p_numbers5,
	check_p_numbers6): New variables.
	(check_p_numbers): Set to sequence from 1 to 9999.
	(check_p_subdirs): Set to sequence from 1 to minimum of
	$(check_p_count) and either GCC_TEST_PARALLEL_SLOTS env var if set,
	or 128.
	(check-%, check-parallel-%): Rewritten so that for parallelized
	testing each job runs all the *.exp files, with
	GCC_RUNTEST_PARALLELIZE_DIR set in environment.
gcc/go/
	* Make-lang.in (check_go_parallelize): Change to just an upper bound
	number.
gcc/fortran/
	* Make-lang.in (check_gfortran_parallelize): Change to just an upper
	bound number.
gcc/cp/
	* Make-lang.in (check_g++_parallelize): Change to just an upper bound
	number.
gcc/objc/
	* Make-lang.in (check_objc_parallelize): Change to just an upper
	bound number.
gcc/ada/
	* gcc-interface/Make-lang.in (check_acats_numbers0,
	check_acats_numbers1, check_acats_numbers2, check_acats_numbers3,
	check_acats_numbers4, check_acats_numbers5, check_acats_numbers6,
	check_acats_numbers, check_acats_subdirs): New variables.
	(check_acats_targets): Use $(check_acats_subdirs).
	(check-acats, check-acats%): Rewritten so that for parallelized
	testing each job runs all the chapters files, with
	GCC_RUNTEST_PARALLELIZE_DIR set in environment.  Prepare the support
	directory sequentially and share it.
	(check-acats-subtargets): Always print just check-acats.
gcc/testsuite/
	* lib/gcc-defs.exp (gcc_parallel_test_run_p,
	gcc_parallel_test_enable): New procedures.  If
	GCC_RUNTEST_PARALLELIZE_DIR is set in environment, override
	runtest_file_p to invoke also gcc_parallel_test_run_p.
	* g++.dg/guality/guality.exp (check_guality): Save/restore
	test_counts array around the body of the procedure.
	* gcc.dg/guality/guality.exp (check_guality): Likewise.
	* g++.dg/plugin/plugin.exp: Run all the tests serially
	by the first parallel runtest encountering it.
	* gcc.dg/plugin/plugin.exp: Likewise.
	* gcc.misc-tests/matrix1.exp: Likewise.
	* gcc.misc-tests/dhry.exp: Likewise.
	* gcc.misc-tests/acker1.exp: Likewise.
	* gcc.misc-tests/linkage.exp: Likewise.
	* gcc.misc-tests/mg.exp: Likewise.
	* gcc.misc-tests/mg-2.exp: Likewise.
	* gcc.misc-tests/sort2.exp: Likewise.
	* gcc.misc-tests/sieve.exp: Likewise.
	* gcc.misc-tests/options.exp: Likewise.
	* gcc.misc-tests/help.exp: Likewise.
	* go.test/go-test.exp (go-gc-tests): Use
	gcc_parallel_test_enable {0, 1} around all handling of
	each test.
	* objc.dg/gnu-encoding/gnu-encoding.exp: Likewise.
	* ada/acats/run_all.sh: Parallelize using mkdir inside of
	a shared directory.  Avoid forking and expr uses if
	shell supports $(()).
libstdc++-v3/
	* testsuite/Makefile.am (check_p_numbers0, check_p_numbers1,
	check_p_numbers2, check_p_numbers3, check_p_numbers4,
	check_p_numbers5, check_p_numbers6, check_p_numbers,
	check_p_subdirs): New variables.
	(check_DEJAGNU_normal_targets): Use check_p_subdirs.
	(check-DEJAGNU): Rewritten so that for parallelized
	testing each job runs all the *.exp files, with
	GCC_RUNTEST_PARALLELIZE_DIR set in environment.
	* testsuite/Makefile.in: Regenerated.
	* testsuite/lib/libstdc++.exp (gcc_parallel_test_run_p,
	gcc_parallel_test_enable): New procedures.  If
	GCC_RUNTEST_PARALLELIZE_DIR is set in environment, override
	runtest_file_p to invoke also gcc_parallel_test_run_p.
	* testsuite/libstdc++-abi/abi.exp: Run all the tests serially
	by the first parallel runtest encountering it.  Fix up path
	of the extract_symvers script.
	* testsuite/libstdc++-xmethods/xmethods.exp: Run all the tests
	serially by the first parallel runtest encountering it.  Run
	dg-finish even in case of error.

From-SVN: r215273
2014-09-15 20:23:36 +02:00
Joey Ye b3ba5f84af re PR plugins/59335 (Plugin doesn't build on trunk)
2014-09-05  Joey Ye  <joey.ye@arm.com>

    PR plugin/59335
    * Makefile.in (PLUGIN_HEADERS): Add wide-int.h, signop.h, hash-map.h,

From-SVN: r214938
2014-09-05 06:52:17 +00:00
Aldy Hernandez b67b29f62f * Makefile.in (TAGS): Handle constructs in timevar.def.
From-SVN: r214918
2014-09-04 19:19:46 +00:00
Aldy Hernandez 4e2b2eeec9 Makefile.in (TAGS): Handle constructs in common.opt, rtl.def, tree.def, and gimple.def
* Makefile.in (TAGS): Handle constructs in common.opt, rtl.def,
	tree.def, and gimple.def

From-SVN: r214822
2014-09-02 15:09:54 +00:00
Olivier Hainque 6a810ff44d Makefile.in (FLAGS_TO_PASS): Propagate INSTALL, INSTALL_DATA, INSTALL_SCRIPT and INSTALL_PROGRAM as well.
gcc/
        * Makefile.in (FLAGS_TO_PASS): Propagate INSTALL, INSTALL_DATA,
        INSTALL_SCRIPT and INSTALL_PROGRAM as well.

From-SVN: r214779
2014-09-01 08:43:47 +00:00
Roman Gareev eae1a5d419 configure.ac: Eliminate ClooG installation dependency.
* configure.ac: Eliminate ClooG installation dependency.
	* configure: Regenerate.
	* Makefile.tpl: Add definition of ISLLIBS and HOST_ISLLIBS.
	* Makefile.in: Regenerate.

[config/]

	* cloog.m4: Remove the path to isllibs from clooglibs.
	* isl.m4: Add paths to islinc, isllibs.

[gcc/]

	* Makefile.in: Add definition of ISLLIBS, HOST_ISLLIBS.
	* config.in: Add undef of HAVE_isl.
	* configure: Regenerate.
	* configure.ac: Add definition of HAVE_isl.
	* graphite-blocking.c: Add checking of HAVE_isl.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-isl-ast-to-gimple.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* toplev.c: Replace the checking of HAVE_cloog with the checking
	of HAVE_isl.

From-SVN: r214106
2014-08-18 15:42:11 +00:00
Yury Gribov b78475cf73 Added fnspec to internal functions.
2014-08-11  Yury Gribov  <y.gribov@samsung.com>

gcc/
        * gimple.c (gimple_call_fnspec): Support internal functions.
        (gimple_call_return_flags): Use const.
        * Makefile.in (GTFILES): Add internal-fn.h to list of GC files.
        * internal-fn.def: Add fnspec information.
        * internal-fn.h (internal_fn_fnspec): New function.
        (init_internal_fns): Declare new function.
        * internal-fn.c (internal_fn_fnspec_array): New global variable.
        (init_internal_fns): New function.
        * tree-core.h: Update macro call.
        * tree.c (build_common_builtin_nodes): Initialize internal fns.

From-SVN: r213806
2014-08-11 06:06:29 +00:00
Trevor Saunders 9f25a338f9 remove pointer-set.[ch]
gcc/

	* Makefile.in: Remove references to pointer-set.c and pointer-set.h.
	* alias.c, cfgexpand.c, cgraphbuild.c,
	config/aarch64/aarch64-builtins.c, config/aarch64/aarch64.c,
	config/alpha/alpha.c, config/darwin.c, config/i386/i386.c,
	config/i386/winnt.c, config/ia64/ia64.c, config/m32c/m32c.c,
	config/mep/mep.c, config/mips/mips.c, config/rs6000/rs6000.c,
	config/s390/s390.c, config/sh/sh.c, config/sparc/sparc.c,
	config/spu/spu.c, config/stormy16/stormy16.c, config/tilegx/tilegx.c,
	config/tilepro/tilepro.c, config/xtensa/xtensa.c, dominance.c,
	dse.c, except.c, gengtype.c, gimple-expr.c,
	gimple-ssa-strength-reduction.c, gimplify.c, ifcvt.c,
	ipa-visibility.c, lto-streamer.h, omp-low.c, predict.c, stmt.c,
	tree-affine.c, tree-cfg.c, tree-eh.c, tree-inline.c, tree-nested.c,
	tree-scalar-evolution.c, tree-ssa-loop-im.c, tree-ssa-loop-niter.c,
	tree-ssa-phiopt.c, tree-ssa-structalias.c, tree-ssa-uninit.c,
	tree-ssa.c, tree.c, var-tracking.c, varpool.c: Remove includes of
	pointer-set.h.
	* pointer-set.c: Remove file.
	* pointer-set.h: Remove file.

gcc/c-family/

	* c-gimplify.c, cilk.c: Remove includes of pointer-set.h.

gcc/c/

	* c-typeck.c: Remove include of pointer-set.h.

gcc/cp/

	* class.c, cp-gimplify.c, decl.c, decl2.c, error.c, method.c,
	optimize.c, pt.c, semantics.c: Remove includes of pointer-set.h.

From-SVN: r213738
2014-08-07 20:52:50 +00:00
Andi Kleen f768061c4c RTL & dwarf2out changes
Convert dwarf2out and rtl.c to the new inchash interface.

gcc/:

2014-07-31  Andi Kleen  <ak@linux.intel.com>

	* Makefile.in (OBJS): Add rtlhash.o
	* dwarf2out.c (addr_table_entry_do_hash): Convert to inchash.
	(loc_checksum): Dito.
	(loc_checksum_ordered): Dito.
	(hash_loc_operands): Dito.
	(hash_locs): Dito.
	(hash_loc_list): Dito.
	* rtl.c (iterative_hash_rtx): Moved to rtlhash.c
	* rtl.h (iterative_hash_rtx): Moved to rtlhash.h
	* rtlhash.c: New file.
	* rtlhash.h: New file.

From-SVN: r213395
2014-08-01 02:51:57 +00:00
Andi Kleen 6d8eb96b44 Add an abstract incremental hash data type
Some files in gcc, like lto or tree, do large scale incremential hashing.
The current jhash implementation of this could be likely improved
by using an incremential hash that does not do a full rehashing
for every new value added.

This patch adds a new "inchash" class that abstracts the internal
state of the hash. This makes it easier to plug in new hashes
and also cleans up the code a bit.

Right now it is just implemented in the same way as the old
iterative hash in tree.c. The previous iterative hash code
from tree.c moved into a new separate file. Also I fixed up all
users to include the new header.

It should not really significantly change any hashing by itself,
it's mostly a cleanup at this point.

v2: Remove begin. Add commutative interface.
Add merge hash interface.  Add add_flag.

gcc/:

2014-07-25  Andi Kleen  <ak@linux.intel.com>

	* Makefile.in (OBJS): Add inchash.o.
	(PLUGIN_HEADERS): Add inchash.h.
	* ipa-devirt.c: Include inchash.h.
	* lto-streamer-out.c: Dito.
	* tree-ssa-dom.c: Dito.
	* tree-ssa-pre.c: Dito.
	* tree-ssa-sccvn.c: Dito.
	* tree-ssa-tail-merge.c: Dito.
	* asan.c: Dito.
	* tree.c (iterative_hash_hashval_t): Move to ...
	(iterative_hash_host_wide_int): Move to ...
	* inchash.c: Here. New file.
	* tree.h (iterative_hash_hashval_t): Move to ...
	(iterative_hash_host_wide_int): Move to ...
	* inchash.h: Here. New file.

gcc/lto/:

2014-07-25  Andi Kleen  <ak@linux.intel.com>

	* lto.c: Include inchash.h

From-SVN: r213054
2014-07-25 13:39:05 +00:00
Rong Xu c77556a5d1 Add gcov-tool: an offline gcda profile processing tool Support.
2014-07-10  Rong Xu  <xur@google.com>

	Add gcov-tool: an offline gcda profile processing tool
	Support.
	* gcc/gcov-io.c (gcov_position): Make avaialble to gcov-tool.
	(gcov_is_error): Ditto.
	(gcov_read_string): Ditto.
	(gcov_read_sync): Ditto.
	* gcc/gcov-io.h: Move counter defines to gcov-counter.def.
	* gcc/gcov-dump.c (tag_counters): Use gcov-counter.def.
	* gcc/coverage.c: Ditto.
	* gcc/gcov-tool.c: Offline gcda profile processing tool.
        (unlink_gcda_file): Remove one gcda file.
	(unlink_profile_dir): Remove gcda files from the profile path.
	(gcov_output_files): Output gcda files to an output dir.
	(profile_merge): Merge two profiles in directory.
	(print_merge_usage_message): Print merge usage.
	(merge_usage): Print merge usage and exit.
	(do_merge): Driver for profile merge sub-command.
	(profile_rewrite): Rewrite profile.
	(print_rewrite_usage_message): Print rewrite usage.
	(rewrite_usage): Print rewrite usage and exit.
	(do_rewrite): Driver for profile rewrite sub-command.
	(print_usage): Print gcov-info usage and exit.
	(print_version): Print gcov-info version.
	(process_args): Process arguments.
	(main): Main routine for gcov-tool.
	* gcc/Makefile.in: Build and install gcov-tool.
	* gcc/gcov-counter.def: New file split from gcov-io.h.
	* libgcc/libgcov-driver.c (gcov_max_filename): Make available
        to gcov-tool.
	* libgcc/libgcov-merge.c (__gcov_merge_add): Replace
        gcov_read_counter() with a Macro.
	(__gcov_merge_ior): Ditto.
	(__gcov_merge_time_profile): Ditto.
	(__gcov_merge_single): Ditto.
	(__gcov_merge_delta): Ditto.
	* libgcc/libgcov-util.c (void gcov_set_verbose): Set the verbose flag
        in the utility functions.
	(set_fn_ctrs): Utility function for reading gcda files to in-memory
        gcov_list object link lists.
	(tag_function): Ditto.
	(tag_blocks): Ditto.
	(tag_arcs): Ditto.
	(tag_lines): Ditto.
	(tag_counters): Ditto.
	(tag_summary): Ditto.
	(read_gcda_finalize): Ditto.
	(read_gcda_file): Ditto.
	(ftw_read_file): Ditto.
	(read_profile_dir_init): Ditto.
	(gcov_read_profile_dir): Ditto.
	(gcov_read_counter_mem): Ditto.
	(gcov_get_merge_weight): Ditto.
	(merge_wrapper): A wrapper function that calls merging handler.
	(gcov_merge): Merge two gcov_info objects with weights.
	(find_match_gcov_info): Find the matched gcov_info in the list.
	(gcov_profile_merge): Merge two gcov_info object lists.
	(__gcov_add_counter_op): Process edge profile counter values.
	(__gcov_ior_counter_op): Process IOR profile counter values.
	(__gcov_delta_counter_op): Process delta profile counter values.
	(__gcov_single_counter_op): Process single  profile counter values.
	(fp_scale): Callback function for float-point scaling.
	(int_scale): Callback function for integer fraction scaling. 
	(gcov_profile_scale): Scaling profile counters.
	(gcov_profile_normalize): Normalize profile counters.
	* libgcc/libgcov.h: Add headers and functions for gcov-tool use.
        (gcov_get_counter): New.
        (gcov_get_counter_target): Ditto.
        (struct gcov_info): Make the functions field mutable in gcov-tool
        compilation.
	* gcc/doc/gcc.texi: Include gcov-tool.texi.
	* gcc/doc/gcov-tool.texi: Document for gcov-tool.

From-SVN: r212448
2014-07-11 05:48:07 +00:00
Roman Gareev f6cc31036a Makefile.in: Add the compilation of graphite-isl-ast-to-gimple.o.
gcc/
	* Makefile.in:
	Add the compilation of graphite-isl-ast-to-gimple.o.
	* common.opt:
	Add new switch fgraphite-code-generator=[isl|cloog].
	* flag-types.h:
	Add new enum fgraphite_generator.
	* graphite-isl-ast-to-gimple.c: New.
	* graphite-isl-ast-to-gimple.h: New.
	* graphite.c (graphite_transform_loops):
	Add choice of Graphite code generator,
	which depends on flag_graphite_code_gen.

	gcc/testsuite/gcc.dg/graphite/isl-codegen-loop-dumping.c:
	New testcase that checks that the dump is generated.

From-SVN: r212124
2014-06-29 14:20:35 +00:00
Bernd Schmidt 5f0ad6a561 Part 2 of the collect-utils library, now also used for collect2.
* Makefile.in (COLLECT2_OBJS): Add collect-utils.o.
        (LTO_WRAPPER_OBJS): New variable.
        (lto-wrapper$(exeext)): Use it.
        * collect2.c: Include "collect-utils.h".
        (verbose, debug): Remove variables.
        (at_file_supplied): No longer static.
        (tool_name): New variable.
        (do_wait, fork_execute, maybe_unlink): Don't declare.
        (tool_cleanup): No longer static.
        (notice): Remove function.
        (maybe_run_lto_and_relink, main, do_dsymutil): Add new arg to
        fork_execute calls.
        (collect_wait, do_wait, collect_execute): Remove functions.
        (maybe_unlink): No longer static.
        * collect2.h (verbose, debug): Don't declare.
        (at_file_supplied): Declare.
        * collect-utils.c (utils_cleanup): New arg from_signal.  All callers
        changed.
        (collect_execute): Replace with implementation from collect2, plus a
        new arg use_atfile.  All callers changed.
        (collect_wait): Replace with implementation from collect2.
        (maybe_unlink_file): Remove function.
        (fork_execute): Replace with implementation from collect2, plus a
        new arg use_atfile.  All callers changed.
        (do_wait): Add call to utils_cleanup to the error path.
        * collect-utils.h (collect_execute, fork_execute, utils_cleanup,
        tool_cleanup): Adjust declarations.
        * lto-wrapper.c (tool_cleanup): Add unused bool argument.
        * tlink.c: Include "collect-utils.h".
        (tlink_execute): New arg use_atfile.  All callers changed.
        (tlink_init, tlink_execute): Remove declarations.

From-SVN: r212020
2014-06-26 09:16:28 +00:00
Bernd Schmidt a185856a06 Make a collect-utils library for use by tools like collect2 and lto-wrapper.
* Makefile.in (ALL_HOST_BACKEND_OBJS): Add collect-utils.o.
	(lto-wrapper$(exeext)): Link with collect-utils.o.
	* collect-utils.c: New file.
	* collect-utils.h: New file.
	* lto-wrapper.c: Include "collect-utils.h".
	(args_name): Delete variable.
	(tool_name): New variable.
	(tool_cleanup): New function.
	(maybe_unlink): Renamed from maybe_unlink_file.  All callers changed.
	(lto_wrapper_cleanup, fatal_signal, collect_execute, collect_wait,
	fork_execute): Remove functions.

From-SVN: r212018
2014-06-26 09:16:11 +00:00
Martin Liska d122681a3c IPA REF refactoring
* Makefile.in: Removed header file (ipa-ref-inline.h).
	* cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function
	called.
	(cgraph_speculative_call_info): Likewise.
	(cgraph_for_node_thunks_and_aliases): Likewise.
	(cgraph_for_node_and_aliases): Likewise.
	(verify_cgraph_node): Likewise.
	* cgraph.h: Batch of IPA REF functions become member functions of
	symtab_node: add_reference, maybe_add_reference, clone_references,
	clone_referring, clone_reference, find_reference,
	remove_stmt_references, remove_all_references,
	remove_all_referring, dump_references, dump_referring,
	has_alias_p, iterate_reference, iterate_referring.
	* cgraphbuild.c (record_reference): New IPA REF function used.
	(record_type_list): Likewise.
	(record_eh_tables): Likewise.
	(mark_address): Likewise.
	(mark_load): Likewise.
	(mark_store): Likewise.
	(pass_build_cgraph_edges): Likewise.
	(rebuild_cgraph_edge): Likewise.
	(cgraph_rebuild_references): Likewise.
	(pass_remove_cgraph_callee_edges): Likewise.
	* cgraphclones.c (cgraph_clone_node): Likewise.
	(cgraph_create_virtual_clone): Likewise.
	(cgraph_materialize_clone): Likewise.
	(cgraph_materialize_all_clones): Likewise.
	* cgraphunit.c (cgraph_reset_node): Likewise.
	(cgraph_reset_node): Likewise.
	(analyze_function): Likewise.
	(assemble_thunks_and_aliases): Likewise.
	(expand_function): Likewise.
	* ipa-comdats.c (propagate_comdat_group): Likewise.
	(enqueue_references): Likewise.
	* ipa-cp.c (ipcp_discover_new_direct_edges): Likewise.
	(create_specialized_node): Likewise.
	* ipa-devirt.c (referenced_from_vtable_p): Likewise.
	* ipa-inline-transform.c (can_remove_node_now_p_1): Likewise.
	* ipa-inline.c (reset_edge_caches): Likewise.
	(update_caller_keys): Likewise.
	(execute): Likewise.
	* ipa-prop.c (remove_described_reference): Likewise.
	(propagate_controlled_uses): Likewise.
	(ipa_edge_duplication_hook): Likewise.
	(ipa_modify_call_arguments): Likewise.
	* ipa-pure-const.c (propagate_pure_const): Likewise.
	* ipa-ref-inline.h: Header file removed, functions moved
	to symtab_node class.
	* ipa-ref.c (remove_reference): New class member function.
	(cannot_lead_to_return): New class member function.
	(referring_ref_list): Likewise.
	(referred_ref_list): Likewise.
	Rest of functions moved to symtab_node class.
	* ipa-ref.h: New member functions remove_reference,
	cannot_lead_to_return, referring_ref_list, referred_ref_list added
	to ipa_ref class.
	ipa_ref_list class has new member functions: first_reference,
	first_referring, clear, nreferences.
	* ipa-reference.c (analyze_function): New IPA REF function used.
	(write_node_summary_p): Likewise.
	(ipa_reference_write_optimization_summary): Likewise.
	* ipa-split.c (split_function): Likewise.
	* ipa-utils.c (ipa_reverse_postorder): Likewise.
	* ipa-visibility.c (cgraph_non_local_node_p_1): Likewise.
	(function_and_variable_visibility): Likewise.
	* ipa.c (has_addr_references_p): Likewise.
	(process_references): Argument type changed.
	(symtab_remove_unreachable_nodes): New IPA REF function used.
	(process_references): Likewise.
	(set_writeonly_bit): Likewise.
	* lto-cgraph.c: Implementation of new symtab_node member functions
	that uses new IPA REF functions.
	* lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used.
	* lto-streamer-out.c (output_symbol_p): Likewise.
	* lto-streamer.h (referenced_from_this_partition_p): Argument type
	changed.
	* lto/lto-partition.c (add_references_to_partition): New IPA REF function
	used.
	(add_symbol_to_partition_1): Likewise.
	(lto_balanced_map): Likewise.
	* lto/lto-symtab.c (lto_cgraph_replace_node): Likewise.
	* symtab.c: Implementation of new IPA REF API.
	* trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used.
	(ipa_tm_create_version): Likewise.
	(ipa_tm_execute): Likewise.
	* tree-emutls.c (gen_emutls_addr): Likewise.
	* tree-inline.c (copy_bb): Likewise.
	(delete_unreachable_blocks_update_callgraph): Likewise.
	* varpool.c (varpool_remove_unreferenced_decls): Likewise.
	(varpool_for_node_and_aliases): Likewise.

From-SVN: r211987
2014-06-25 16:55:46 +00:00
Richard Sandiford 8677664e02 common.md: New file.
gcc/
	* common.md: New file.
	* doc/md.texi: Update description of generic, machine-independent
	constraints.
	* config/s390/constraints.md (e): Delete.
	* Makefile.in (md_file): Include common.md.
	* config/m32c/t-m32c (md_file): Likewise.
	* genpreds.c (general_mem): New array.
	(generic_constraint_letters): Remove constraints now defined by
	common.md.
	(add_constraint): Map TARGET_MEM_CONSTRAINT to general_mem.
	Allow the first character to be '<' or '>' as well.
	* genoutput.c (general_mem): New array.
	(indep_constraints): Remove constraints now defined by common.md.
	(note_constraint): Map TARGET_MEM_CONSTRAINT to general_mem.
	Remove special handling of 'm'.
	* ira-costs.c (record_reg_classes): Remove special handling of
	constraints now defined by common.md.
	* ira.c (ira_setup_alts, ira_get_dup_out_num): Likewise.
	* ira-lives.c (single_reg_class): Likewise.
	(ira_implicitly_set_insn_hard_regs): Likewise.
	* lra-constraints.c (reg_class_from_constraints): Likewise.
	(process_alt_operands, process_address, curr_insn_transform): Likewise.
	* postreload.c (reload_cse_simplify_operands): Likewise.
	* reload.c (push_secondary_reload, scratch_reload_class)
	(find_reloads, alternative_allows_const_pool_ref): Likewise.
	* reload1.c (maybe_fix_stack_asms): Likewise.
	* targhooks.c (default_secondary_reload): Likewise.
	* stmt.c (parse_output_constraint): Likewise.
	* recog.c (preprocess_constraints): Likewise.
	(constrain_operands, peep2_find_free_register): Likewise.
	(asm_operand_ok): Likewise, but add a comment saying why 'o'
	must be handled specially.

From-SVN: r211475
2014-06-11 16:59:17 +00:00
Kyrylo Tkachov 5d357f260c [AArch64] Implement CRC32 ACLE intrinsics.
* config.gcc (aarch64*-*-*): Add arm_acle.h to extra headers.
	* Makefile.in (TEXI_GCC_FILES): Add aarch64-acle-intrinsics.texi to
	dependencies.
	* config/aarch64/aarch64-builtins.c (AARCH64_CRC32_BUILTINS): Define.
	(aarch64_crc_builtin_datum): New struct.
	(aarch64_crc_builtin_data): New.
	(aarch64_init_crc32_builtins): New function.
	(aarch64_init_builtins): Initialise CRC32 builtins when appropriate.
	(aarch64_crc32_expand_builtin): New.
	(aarch64_expand_builtin): Add CRC32 builtin expansion case.
	* config/aarch64/aarch64.h (TARGET_CPU_CPP_BUILTINS): Define
	__ARM_FEATURE_CRC32 when appropriate.
	(TARGET_CRC32): Define.
	* config/aarch64/aarch64.md (UNSPEC_CRC32B, UNSPEC_CRC32H,
	UNSPEC_CRC32W, UNSPEC_CRC32X, UNSPEC_CRC32CB, UNSPEC_CRC32CH,
	UNSPEC_CRC32CW, UNSPEC_CRC32CX): New unspec values.
	(aarch64_<crc_variant>): New pattern.
	* config/aarch64/arm_acle.h: New file.
	* config/aarch64/iterators.md (CRC): New int iterator.
	(crc_variant, crc_mode): New int attributes.
	* doc/aarch64-acle-intrinsics.texi: New file.
	* doc/extend.texi (aarch64): Document aarch64 ACLE intrinsics.
	Include aarch64-acle-intrinsics.texi.

From-SVN: r211440
2014-06-11 09:17:18 +00:00
Jan Hubicka 7f7beb3f10 ipa.c (cgraph_non_local_node_p_1, [...]): Move to ipa-visibility.c
* ipa.c (cgraph_non_local_node_p_1, cgraph_local_node_p, address_taken_from_non_vtable_p,
	comdat_can_be_unshared_p_1, comdat_can_be_unshared_p, cgraph_externally_visible_p,
	varpool_externally_visible_p, can_replace_by_local_alias,
	update_visibility_by_resolution_info, function_and_variable_visibility,
	pass_data_ipa_function_and_variable_visibility,
	make_pass_ipa_function_and_variable_visibility,
	whole_program_function_and_variable_visibility,
	pass_data_ipa_whole_program_visibility,
	make_pass_ipa_whole_program_visibility): Move to ipa-visibility.c
	* cgraph.h (cgraph_local_node_p): Declare.
	* ipa-visibility.c: New file.
	* Makefile.in (OBJS): Add ipa-visiblity.o

From-SVN: r210907
2014-05-25 01:33:28 +00:00
Jan Hubicka a04d9035ec tree-pass.h (make_pass_ipa_comdats): New pass.
* tree-pass.h (make_pass_ipa_comdats): New pass.
	* timevar.def (TV_IPA_COMDATS): New timevar.
	* passes.def (pass_ipa_comdats): Add.
	* Makefile.in (OBJS): Add ipa-comdats.o
	* ipa-comdats.c: New file.

	* g++.dg/ipa/comdat.C: New file.

From-SVN: r210597
2014-05-19 00:58:43 +00:00
Zhenqiang Chen f30e25a336 Makefile.in: add shrink-wrap.o.
2014-05-13  Zhenqiang Chen  <zhenqiang.chen@linaro.org>

	* Makefile.in: add shrink-wrap.o.
	* config/i386/i386.c: include "shrink-wrap.h"
	* function.c: Likewise.
	(requires_stack_frame_p, next_block_for_reg,
	move_insn_for_shrink_wrap, prepare_shrink_wrap,
	dup_block_and_redirect): Move to shrink-wrap.c
	(thread_prologue_and_epilogue_insns): Extract three code segments
	as functions in shrink-wrap.c
	* function.h: Move #ifdef HAVE_simple_return ... #endif block to
	shrink-wrap.h
	* shrink-wrap.c: New file.
	* shrink-wrap.h: New file.

From-SVN: r210351
2014-05-13 07:05:46 +00:00
Richard Biener ee3958cfe1 Makefile.in (GTFILES): Remove tree-ssa-propagate.c.
2014-05-09  Richard Biener  <rguenther@suse.de>

	* Makefile.in (GTFILES): Remove tree-ssa-propagate.c.
	* tree-ssa-propagate.c: Do not include gt-tree-ssa-propagate.h.
	(interesting_ssa_edges, varying_ssa_edges): Move out of GC space.
	(add_ssa_edge, process_ssa_edge_worklist, ssa_prop_init,
	ssa_propagate): Adjust.

From-SVN: r210261
2014-05-09 07:49:18 +00:00
Kenneth Zadeck 807e902eea Merge in wide-int.
From-SVN: r210113
2014-05-06 16:25:05 +00:00
Richard Biener da4cfeacb0 Makefile.in (OBJS): Remove loop-unswitch.o.
2014-04-23  Richard Biener  <rguenther@suse.de>

	* Makefile.in (OBJS): Remove loop-unswitch.o.
	* loop-unswitch.c: Delete.
	* tree-pass.h (make_pass_rtl_unswitch): Remove.
	* passes.def (pass_rtl_unswitch): Likewise.
	* loop-init.c (gate_rtl_unswitch): Likewise.
	(rtl_unswitch): Likewise.
	(pass_data_rtl_unswitch): Likewise.
	(pass_rtl_unswitch): Likewise.
	(make_pass_rtl_unswitch): Likewise.
	* rtl.h (reversed_condition): Likewise.
	(compare_and_jump_seq): Likewise.
	* loop-iv.c (reversed_condition): Move here from loop-unswitch.c
	and make static.
	* loop-unroll.c (compare_and_jump_seq): Likewise.

From-SVN: r209698
2014-04-23 13:48:12 +00:00
Jakub Jelinek 4f0ddb6ff6 re PR plugins/59335 (Plugin doesn't build on trunk)
PR plugins/59335
	* Makefile.in (PLUGIN_HEADERS): Add various headers that have been
	added in 4.9.

	* Make-lang.h (CP_PLUGIN_HEADERS): Add type-utils.h.

From-SVN: r209404
2014-04-15 10:02:46 +02:00
Thomas Schwinge bb609c35be Fix shell scripting.
PR bootstrap/60719
	* Makefile.in (install-driver): Fix shell scripting.

From-SVN: r209072
2014-04-04 10:09:23 +02:00
Richard Biener a1ce39befe re PR bootstrap/60719 (With --program-prefix=$target_alias --program-suffix=-$version install-driver breaks)
2014-04-02  Richard Biener  <rguenther@suse.de>

	PR bootstrap/60719
	* Makefile.in (install-driver): Guard extra installs with special
	names properly.

From-SVN: r209010
2014-04-02 07:52:36 +00:00
Rainer Orth 15e3d4f172 Have s-macro_list depend on cc1
* Makefile.in (s-macro_list): Depend on cc1.

From-SVN: r208786
2014-03-24 09:24:07 +00:00
Matthias Klose 4973b0f955 Makefile.in (s-mlib): Only pass MULTIARCH_DIRNAME if MULTILIB_OSDIRNAMES is not defined.
2014-03-06  Matthias Klose  <doko@ubuntu.com>

        * Makefile.in (s-mlib): Only pass MULTIARCH_DIRNAME if
        MULTILIB_OSDIRNAMES is not defined.

From-SVN: r208383
2014-03-06 14:16:49 +00:00
Jakub Jelinek 487125e75b re PR plugins/59335 (Plugin doesn't build on trunk)
PR plugins/59335
	* Makefile.in (PLUGIN_HEADERS): Add tree-phinodes.h, stor-layout.h,
	ssa-iterators.h, $(RESOURCE_H) and tree-cfgcleanup.h.

From-SVN: r208346
2014-03-05 16:06:23 +01:00
Jakub Jelinek 2754b38fd3 * Makefile.in (prefix.o, cppbuiltin.o): Depend on $(BASEVER).
From-SVN: r207550
2014-02-06 11:58:16 +01:00
Alan Modra 2ceb362d0a Makefile.in (BUILD_CPPFLAGS): Do not use ALL_CPPFLAGS.
* Makefile.in (BUILD_CPPFLAGS): Do not use ALL_CPPFLAGS.
	* configure.ac <recursive call for build != host>: Define
	GENERATOR_FILE.  Comment.  Use CXX_FOR_BUILD, CXXFLAGS_FOR_BUILD
	and LD_FOR_BUILD too.
	* configure: Regenerate.

From-SVN: r207171
2014-01-28 17:38:22 +10:30
Dodji Seketeli 7ecc3eb9e6 PR preprocessor/58580 - preprocessor goes OOM with warning for zero literals
In this problem report, the compiler is fed a (bogus) translation unit
in which some literals contain bytes whose value is zero.  The
preprocessor detects that and proceeds to emit diagnostics for that
king of bogus literals.  But then when the diagnostics machinery
re-reads the input file again to display the bogus literals with a
caret, it attempts to calculate the length of each of the lines it got
using fgets.  The line length calculation is done using strlen.  But
that doesn't work well when the content of the line can have several
zero bytes.  The result is that the read_line never sees the end of
the line because strlen repeatedly reports that the line ends before
the end-of-line character; so read_line thinks its buffer for reading
the line is too small; it thus increases the buffer, leading to a huge
memory consumption and disaster.

Here is what this patch does.

location_get_source_line is modified to return the length of a source
line that can now contain bytes with zero value.
diagnostic_show_locus() is then modified to consider that a line can
have characters of value zero, and so just shows a white space when
instructed to display one of these characters.

Additionally location_get_source_line is modified to avoid re-reading
each and every line from the beginning of the file until it reaches
the line number N that it is instructed to get; this was leading to
annoying quadratic behaviour when reading adjacent lines near the end
of (big) files.  So a cache is now associated to the file opened in
text mode.  When the content of the file is read, that content is
stashed in the file cache.  That file cache is searched for line
delimiters.  A number of line positions are saved in the cache and a
number of file caches are kept in memory.  That way when
location_get_source_line is asked to read line N + 1, it just has to
start reading from line N that it has already read.

libcpp/ChangeLog:

	* include/line-map.h (linemap_get_file_highest_location): Declare
	new function.
	* line-map.c (linemap_get_file_highest_location): Define it.

gcc/ChangeLog:

	* input.h (location_get_source_line): Take an additional line_size
	parameter.
	(void diagnostics_file_cache_fini): Declare new function.
	* input.c (struct fcache): New type.
	(fcache_tab_size, fcache_buffer_size, fcache_line_record_size):
	New static constants.
	(diagnostic_file_cache_init, total_lines_num)
	(lookup_file_in_cache_tab, evicted_cache_tab_entry)
	(add_file_to_cache_tab, lookup_or_add_file_to_cache_tab)
	(needs_read, needs_grow, maybe_grow, read_data, maybe_read_data)
	(get_next_line, read_next_line, goto_next_line, read_line_num):
	New static function definitions.
	(diagnostic_file_cache_fini): New function.
	(location_get_source_line): Take an additional output line_len
	parameter.  Re-write using lookup_or_add_file_to_cache_tab and
	read_line_num.
	* diagnostic.c (diagnostic_finish): Call
	diagnostic_file_cache_fini.
	(adjust_line): Take an additional input parameter for the length
	of the line, rather than calculating it with strlen.
	(diagnostic_show_locus): Adjust the use of
	location_get_source_line and adjust_line with respect to their new
	signature.  While displaying a line now, do not stop at the first
	null byte.  Rather, display the zero byte as a space and keep
	going until we reach the size of the line.
	* Makefile.in: Add vec.o to OBJS-libcommon

gcc/testsuite/ChangeLog:

	* c-c++-common/cpp/warning-zero-in-literals-1.c: New test file.

Signed-off-by: Dodji Seketeli <dodji@seketeli.org>

From-SVN: r206957
2014-01-23 10:13:08 +01:00
Steve Ellcey 1aa26aacc4 re PR plugins/59335 (Plugin doesn't build on trunk)
2014-01-10  Steve Ellcey  <sellcey@mips.com>

	PR plugins/59335
	* Makefile.in (PLUGIN_HEADERS): Add gimplify.h, gimple-iterator.h,
	gimple-ssa.h, fold-const.h, tree-cfg.h, tree-into-ssa.h,
	tree-ssanames.h, print-tree.h, varasm.h, and context.h.

From-SVN: r206535
2014-01-10 17:54:10 +00:00
Steve Ellcey 3fadf78ac8 Makefile.in (TREE_FLOW_H): Remove.
2014-01-09  Steve Ellcey  <sellcey@mips.com>

	* Makefile.in (TREE_FLOW_H): Remove.
	(TREE_SSA_H): Add file names from tree-flow.h.
	* doc/tree-ssa.texi (Annotations): Remove reference to tree-flow.h
	* tree.h: Remove tree-flow.h reference.
	* hash-table.h: Remove tree-flow.h reference.
	* tree-ssa-loop-niter.c (dump_affine_iv): Replace tree-flow.h
	reference with tree-ssa-loop.h.

From-SVN: r206496
2014-01-09 21:02:43 +00:00