Commit Graph

16 Commits

Author SHA1 Message Date
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Jan Hubicka 37074a02ae re PR lto/61886 (LTO breaks fread with _FORTIFY_SOURCE=2)
PR ipa/61886
	PR middle-end/25140
	* ipa-reference.c (is_improper): Break out from ...
	(is_proper_for_analysis): ... here; fix WRT aliases.
	(analyze_function, generate_summary,
	ipa_reference_write_optimization_summary,
	ipa_reference_read_optimization_summary): Use ipa_reference_var_uid.
	* ipa-refrence.h (ipa_reference_var_uid): New inline.
	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
	call_may_clobber_ref_p_1): Use ipa_reference_var_uid.

	* gcc.c-torture/execute/alias-3.c: New testcase.

From-SVN: r231442
2015-12-09 07:34:16 +00:00
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Andrew MacLeod c582198bd9 cgraph.h: Flatten.
* cgraph.h: Flatten.  Remove all include files.
	(symbol_table::initialize): Move to cgraph.c.
	* cgraph.c: Adjust include files.
	(symbol_table::initialize): Relocate from cgraph.h.
	* gengtype.c (open_base_files): Adjust include files.
	* gccplugin.h: Add hash-map.h, is-a.h, plugin-api.h, and ipa-ref.h to
	included files.
	* ipa-inline.h: Remove all include files.
	* ipa-prop.h: Ditto.
	* ipa-reference.h: Ditto.
	* ipa-utils.h: Ditto:
	* lto-streamer.h: Remove cgraph.h from include list.
	* asan.c: Adjust include files.
	* auto-profile.c: Ditto.
	* bb-reorder.c: Ditto.
	* calls.c: Ditto.
	* cfgexpand.c: Ditto.
	* cgraphbuild.c: Ditto.
	* cgraphclones.c: Ditto.
	* cgraphunit.c: Ditto.
	* combine.c: Ditto.
	* coverage.c: Ditto.
	* data-streamer.c: Ditto.
	* data-streamer-in.c: Ditto.
	* data-streamer-out.c: Ditto.
	* dbxout.c: Ditto.
	* dwarf2out.c: Ditto.
	* except.c: Ditto.
	* expr.c: Ditto.
	* final.c: Ditto.
	* fold-const.c: Ditto.
	* ggc-page.c: Ditto.
	* gimple-fold.c: Ditto.
	* gimple-iterator.c: Ditto.
	* gimple-pretty-print.c: Ditto.
	* gimple-streamer-in.c: Ditto.
	* gimple-streamer-out.c: Ditto.
	* gimplify.c: Ditto.
	* ipa.c: Ditto.
	* ipa-comdats.c: Ditto.
	* ipa-cp.c: Ditto.
	* ipa-devirt.c: Ditto.
	* ipa-icf.c: Ditto.
	* ipa-icf-gimple.c: Ditto.
	* ipa-inline-analysis.c: Ditto.
	* ipa-inline.c: Ditto.
	* ipa-inline-transform.c: Ditto.
	* ipa-polymorphic-call.c: Ditto.
	* ipa-profile.c: Ditto.
	* ipa-prop.c: Ditto.
	* ipa-pure-const.c: Ditto.
	* ipa-ref.c: Ditto.
	* ipa-reference.c: Ditto.
	* ipa-split.c: Ditto.
	* ipa-utils.c: Ditto.
	* ipa-visibility.c: Ditto.
	* langhooks.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.c: Ditto.
	* lto-streamer-in.c: Ditto.
	* lto-streamer-out.c: Ditto.
	* omp-low.c: Ditto.
	* opts-global.c: Ditto.
	* passes.c: Ditto.
	* predict.c: Ditto.
	* print-tree.c: Ditto.
	* profile.c: Ditto.
	* ree.c: Ditto.
	* stor-layout.c: Ditto.
	* symtab.c: Ditto.
	* toplev.c: Ditto.
	* trans-mem.c: Ditto.
	* tree.c: Ditto.
	* tree-cfg.c: Ditto.
	* tree-eh.c: Ditto.
	* tree-emutls.c: Ditto.
	* tree-inline.c: Ditto.
	* tree-nested.c: Ditto.
	* tree-pretty-print.c: Ditto.
	* tree-profile.c: Ditto.
	* tree-sra.c: Ditto.
	* tree-ssa-alias.c: Ditto.
	* tree-ssa-loop-ivcanon.c: Ditto.
	* tree-ssa-loop-ivopts.c: Ditto.
	* tree-ssa-pre.c: Ditto.
	* tree-ssa-structalias.c: Ditto.
	* tree-streamer.c: Ditto.
	* tree-streamer-in.c: Ditto.
	* tree-streamer-out.c: Ditto.
	* tree-switch-conversion.c: Ditto.
	* tree-tailcall.c: Ditto.
	* tree-vect-data-refs.c: Ditto.
	* tree-vectorizer.c: Ditto.
	* tree-vect-stmts.c: Ditto.
	* tsan.c: Ditto.
	* ubsan.c: Ditto.
	* value-prof.c: Ditto.
	* varasm.c: Ditto.
	* varpool.c: Ditto.
	* config/arm/arm.c: Ditto.
	* config/bfin/bfin.c: Ditto.
	* config/c6x/c6x.c: Ditto.
	* config/cris/cris.c: Ditto.
	* config/darwin.c: Ditto.
	* config/darwin-c.c: Ditto.
	* config/i386/i386.c: Ditto.
	* config/i386/winnt.c: Ditto.
	* config/microblaze/microblaze.c: Ditto.
	* config/mips/mips.c: Ditto.
	* config/rs6000/rs6000.c: Ditto.
	* config/rx/rx.c: Ditto.

	* ada/gcc-interface/trans.c: Adjust include files.
	* ada/gcc-interface/utils.c: Ditto.

	* c/c-decl.c: Adjust include files.
	* c/c-parser.c: Ditto.

	* c-family/c-common.c: Adjust include files.
	* c-family/c-gimplify.c: Ditto.
	* c-family/cilk.c: Ditto.
	* c-family/c-pragma.c: Ditto.
	* c-family/c-ubsan.c: Ditto.

	* cp/call.c: Adjust include files.
	* cp/class.c: Ditto.
	* cp/decl2.c: Ditto.
	* cp/decl.c: Ditto.
	* cp/lambda.c: Ditto.
	* cp/mangle.c: Ditto.
	* cp/method.c: Ditto.
	* cp/optimize.c: Ditto.
	* cp/parser.c: Ditto.
	* cp/semantics.c: Ditto.
	* cp/tree.c: Ditto.
	* cp/vtable-class-hierarchy.c: Ditto.

	* fortran/f95-lang.c: Adjust include files.
	* fortran/trans-decl.c: Ditto.

	* go/go-gcc.cc: Adjust include files.

	* java/class.c: Adjust include files.
	* java/decl.c: Ditto.
	* java/jcf-parse.c: Ditto.
	* java/resource.c: Ditto.

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

	* objc/objc-act.c: Adjust include files.

From-SVN: r216805
2014-10-28 16:17:19 +00:00
David Malcolm 3edf64aa91 State cleanups from jit branch
gcc/ChangeLog:
	* cgraph.c (cgraph_c_finalize): New function.
	* cgraph.h (cgraph_c_finalize): New prototype.
	(cgraphunit_c_finalize): New prototype.
	* cgraphunit.c (first_analyzed): Move from analyze_functions
	to file-scope.
	(first_analyzed_var): Likewise.
	(analyze_functions): Move static variables into file-scope.
	(cgraphunit_c_finalize): New function.
	* diagnostic.c (diagnostic_finish): Free the memory for
	context->classify_diagnostic and context->printer, running the
	destructor for the latter.
	(bt_stop): Use toplev::main.
	* dwarf2out.c (dwarf2out_finalize): New function.
	* dwarf2out.h (dwarf2out_c_finalize): New prototype.
	* gcse.c (gcse_c_finalize): New function.
	* gcse.h (gcse_c_finalize): New prototype.
	* ggc-page.c (init_ggc): Make idempotent.
	* input.c (input_location): Initialize to UNKNOWN_LOCATION.
	* ipa-cp.c (ipa_cp_c_finalize): New function.
	* ipa-prop.h (ipa_cp_c_finalize): New prototype.
	* ipa-pure-const.c (function_insertion_hook_holder): Move to be
	a field of class pass_ipa_pure_const.
	(node_duplication_hook_holder): Likewise.
	(node_removal_hook_holder): Likewise.
	(register_hooks): Convert to method...
	(pass_ipa_pure_const::register_hooks): ...here, converting
	static variable init_p into...
	(pass_ipa_pure_const::init_p): ...new field.
	(pure_const_generate_summary): Update invocation of
	register_hooks to invoke as a method of current_pass.
	(pure_const_read_summary): Likewise.
	(propagate): Convert to...
	(pass_ipa_pure_const::execute): ...method.
	* ipa-reference.c (ipa_init): Move static bool init_p from here
	to...
	(ipa_init_p): New file-scope variable, so that it can be reset
	when repeatedly invoking the compiler within one process by...
	(ipa_reference_c_finalize): New function.
	* ipa-reference.h (ipa_reference_c_finalize): New.
	* main.c (main): Replace invocation of toplev_main with
	construction of a toplev instance, and call its "main" method.
	* params.c (global_init_params): Add an assert that
	params_finished is false.
	(params_c_finalize): New.
	* params.h (params_c_finalize): New.
	* passes.c (execute_ipa_summary_passes): Set "current_pass" before
	invoking generate_summary, for the benefit of pass_ipa_pure_const.
	(ipa_write_summaries_2): Assign "pass" to "current_pass" global
	before calling write_summary hook.
	(ipa_write_optimization_summaries_1): Likewise when calling
	write_optimization_summary hook.
	(ipa_read_summaries_1): Likewise for read_summary hook.
	(ipa_read_optimization_summaries_1): Likewise for
	read_optimization_summary hook.
	(execute_ipa_stmt_fixups): Likewise.
	* stringpool.c (init_stringpool): Clean up if we're called more
	than once.
	* timevar.c (timevar_init): Ignore repeated calls.
	* toplev.c: Include "dwarf2out.h", "ipa-reference.h", "gcse.h",
	"ipa-prop.h".
	(general_init): Reset "input_location" to UNKNOWN_LOCATION.
	(initialize_rtl): Move static local "initialized_once"
	into file scope, and rename to...
	(rtl_initialized): New variable.
	(do_compile): Move timevar initialization from here to
	toplev::start_timevars.
	(toplev::toplev, toplev::~toplev, toplev::start_timevars,
	toplev::finalize): New functions.
	(toplev_main): Rename to...
	(toplev::main): ...this.
	* toplev.h (class toplev): New class.

From-SVN: r216522
2014-10-21 16:55:38 +00:00
Richard Sandiford 23a5b65a92 Update copyright years in gcc/
From-SVN: r206289
2014-01-02 22:23:26 +00:00
Diego Novillo 4d64880731 Re-factor inclusion of tree.h.
This moves tree.h out of every header. This exposes dependencies of
tree.h in files that should probably not need it after tree and gimple
are separated.

After this change, no header should include tree.h directly. It should
only be included by a .c file. Unfortunately, I did not find an
automatic way of forcing this.

Tested on x86_64 with all languages enabled and using
contrib/config-list.mk.

2013-10-21  Diego Novillo  <dnovillo@google.com>

	* asan.c: Include tree.h
	* bb-reorder.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* data-streamer-in.c: Likewise.
	* data-streamer-out.c: Likewise.
	* data-streamer.c: Likewise.
	* dwarf2cfi.c: 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-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa.c: Likewise.
	* ira.c: Likewise.
	* loop-init.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lto/lto-object.c: Likewise.
	* recog.c: Likewise.
	* reginfo.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-streamer.c: Likewise.
	* value-prof.c: Likewise.
	* target-globals.c: Likewise.
	* expr.h: Include tree-core.h instead of tree.h.
	* gimple.h: Likewise.
	* ipa-prop.h: Likewise.
	* ipa-utils.h: Likewise.
	* lto-streamer.h: Likewise.
	* streamer-hooks.h: Likewise.
	* ipa-reference.h: Include cgraph.h instead of tree.h.
	* cgraph.h: Include basic-block.h instead of tree.h.
	* tree-streamer.h: Do not include tree.h.
	* genattrtab.c (write_header): Generate inclusion of
	tree.h.
	* genautomata.c (main): Likewise.
	* genemit.c: Likewise.
	* genopinit.c: Likewise.
	* genoutput.c (output_prologue): Likewise.
	* genpeep.c: Likewise.

testsuite/ChangeLog

	* g++.dg/plugin/selfassign.c: Include tree.h.
	* gcc.dg/plugin/finish_unit_plugin.c: Likewise.
	* gcc.dg/plugin/ggcplug.c: Likewise.
	* gcc.dg/plugin/one_time_plugin.c: Likewise.
	* gcc.dg/plugin/selfassign.c: Likewise.
	* gcc.dg/plugin/start_unit_plugin.c: Likewise.

From-SVN: r203908
2013-10-21 15:36:37 -04:00
Richard Sandiford d1e082c2c2 Update copyright years in gcc/
From-SVN: r195098
2013-01-10 20:38:27 +00:00
Jakub Jelinek d652f226fc Update Copyright years for files modified in 2010.
From-SVN: r168438
2011-01-03 21:52:22 +01:00
Jan Hubicka 46c3001944 tree.h (memory_identifier_string): Remove.
* tree.h (memory_identifier_string): Remove.
	* ipa-reference.c: Update comment; do not include gt-ipa-reference.h
	(ipa_reference_global_vars_info_d): Remove statics_not_read and
	statics_not_written.
	(ipa_reference_optimization_summary_d): New structure.
	(ipa_reference_optimization_summary_t): New type and vector.
	(ipa_reference_vars_info_d): Embedd structures instead of using
	pointers.
	(reference_vars_to_consider): Remove out of GGC space.
	(module_statics_escape): Remove.
	(global_info_obstack): Rename to ...
	(optimization_summary_obstack): ... this one.
	(initialization_status_t): Remove.
	(memory_identifier_string): Remove.
	(get_reference_vars_info): Fix indenting.
	(set_reference_vars_info): Likewise.
	(get_reference_optimization_summary): New.
	(set_reference_optimization_summary): New.
	(get_global_reference_vars_info): Remove.
	(ipa_reference_get_read_global): Remove.
	(ipa_reference_get_written_global): Remove.
	(ipa_reference_get_not_read_global): Update.
	(ipa_reference_get_not_written_global): Update.
	(is_proper_for_analysis): Outlaw addressable.
	(propagate_bits): Update for new datastructures.
	(analyze_variable): Remove.
	(init_function_info): Update for new datastructures.
	(clean_function_local_data): Remove.
	(clean_function): Remove.
	(copy_global_bitmap): Use optimizations_summary_obstack.
	(duplicate_node_data): Duplicate optimization summary only.
	(remove_node_data): Remove optimization summary only.
	(generate_summary): Do not analyze variables; do not compute
	module_statics_escape; do not prune solutions by it.
	(read_write_all_from_decl): Fix typos in comments.
	(propagate): Doscover readonly and nonaddressable first;
	update for new datastructures; share global bitmaps.
	* ipa-reference.h (ipa_reference_get_read_global,
	ipa_reference_get_written_global): Remove.
	* ipa-pure-const.c (check_stmt): Do not use memory_identifier_string.
	* Makefile.in: Remove ipa-refereference from GT files.

From-SVN: r159430
2010-05-15 09:46:55 +00:00
Jakub Jelinek 66647d441f Update Copyright years for files modified in 2008 and/or 2009.
From-SVN: r144324
2009-02-20 16:20:38 +01:00
Jan Hubicka e2c9111c0e re PR middle-end/37448 (cannot compile big function)
PR middle-end/37448
	* ipa-reference.c (ipa_reference_local_vars_info_d,
	ipa_reference_global_vars_info_d,
	ipa_reference_local_vars_info_t, ipa_reference_global_vars_info_t,
	ipa_reference_vars_info_t): Move here from ipa-reference.h
	(node_duplication_hook_holder, node_removal_hook_holder): New.
	(get_reference_vars_info_from_cgraph): Rename to ...
	(get_reference_vars_info): ... this one, use cgraph uids.
	(get_local_reference_vars_info, get_global_reference_vars_info):
	Use cgraph instead of decl.
	(ipa_reference_get_read_local, ipa_reference_get_written_local): Remove.
	(ipa_reference_get_read_global, ipa_reference_get_not_read_global
	ipa_reference_get_written_global, ipa_reference_get_not_written_global): Use
	cgraph argument.
	(check_call): Simplify avail check.
	(scan_stmt_for_static_refs): Update.
	(propagate_bits): Update.
	(merge_callee_local_info): Remove.
	(init_function_info): Use cgraph nodes.
	(clean_function_local_data): Break out from ...
	(clean_function): ... here.
	(copy_local_bitmap, copy_global_bitmap): New functions.
	(duplicate_node_data, remove_node_data): New functions.
	(generate_summary): Register hooks; use visibility instead of
	master clones.
	(propafate): Use cgraph nodes; copy bitmap to each node in cycle.
	* ipa-reference.h (ipa_reference_local_vars_info_d,
	ipa_reference_global_vars_info_d,
	ipa_reference_local_vars_info_t, ipa_reference_global_vars_info_t,
	ipa_reference_vars_info_t): Move to ipa-reference.c
	(ipa_reference_get_read_local, ipa_reference_get_written_local):
	Remove.
	(ipa_reference_get_read_global, ipa_reference_get_written_global,
	ipa_reference_get_not_read_global, ipa_reference_get_not_written_global):
	Update prototype.
	* ipa-pure-const.c (funct_state_vec): Turn into VECtor.
	(init_state): Remove.
	(node_duplication_hook_holder, node_removal_hook_holder): New.
	(get_function_state, set_function_state): Use VECtor.
	(analyze_function): Check body availability.
	(add_new_function): Likewise.
	(duplicate_node_data, remove_node_data): New.
	(generate_summary): Register hooks; do not care about clones.
	(propafate): Do not care about clones; recursive functions are not looping.
	* ipa-utils.c (searchc, ipa_utils_reduced_inorder): Do not skip clones.
	* ipa-prop.c (edge_removal_hook_holder, node_removal_hook_holder,
	* edge_duplication_hook_holder, node_duplication_hook_holder): Make
	static.
	* tree-flow.h (function_ann_d): Remove reference_vars_info.
	* tree-ssa-opreands.c (add_call_clobber_ops, add_call_read_ops): Update call of
	ipa-reference accesors.

From-SVN: r140463
2008-09-18 17:28:40 +00:00
Nick Clifton 9dcd6f09a3 Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page.
From-SVN: r126948
2007-07-26 08:37:01 +00:00
Kazu Hirata 783455db8d ipa-pure-const.c, [...]: Update FSF address.
* ipa-pure-const.c, ipa-reference.c, ipa-reference.h,
	ipa-type-escape.c, ipa-type-escape.h, ipa-utils.c,
	ipa-utils.h, treestruct.def, config/crx/crx-protos.h,
	config/crx/crx.c, config/crx/crx.h, config/crx/crx.md: Update
	FSF address.

From-SVN: r102384
2005-07-26 12:29:15 +00:00
Daniel Berlin ea900239f4 Makefile.in: Added rules for ipa-pure-const.c...
2005-07-16  Danny Berlin <dberlin@dberlin.org>
	    Kenneth Zadeck <zadeck@naturalbridge.com>

	* Makefile.in: Added rules for ipa-pure-const.c, ipa-reference.c,
	ipa-reference.h, ipa-utils.c, ipa-utils.h, ipa-type-escape.c,
	ipa-type-escape.h, tree-promote-statics.c
	* ipa-pure-const.c, ipa-reference.c, ipa-reference.h, ipa-utils.c,
	ipa-utils.h, ipa-type-escape.c, ipa-type-escape.h,
	tree-promote-statics.c: new files.
	* alias.c: (nonlocal_mentioned_p_1, nonlocal_mentioned_p,
	nonlocal_referenced_p_1, nonlocal_referenced_p, nonlocal_set_p_1,
	int nonlocal_set_p, mark_constant_function): Deleted.
	(rest_of_handle_cfg): Removed call to mark_constant_function.
        (nonoverlapping_component_refs_p): Added calls to support
	type based aliasing.
        * tree-ssa-alias.c (may_alias_p,
	compute_flow_insensitive_aliasing): Ditto.
	* calls.c (flags_from_decl_or_type): Removed reference to
	cgraph_rtl_info.
	(flags_from_decl_or_type): Support ECF_POINTER_NO_CAPTURE attribute.
	* c-common.c (handle_pointer_no_capture_attribute): New function
	and added pointer_no_capture attribute.
      	* c-typeck.c (convert_arguments): Make builtins tolerant of having
	too many arguments.  This is necessary for Spec 2000.
	* cgraph.h (const_function, pure_function): Removed.
	* common.opt: Added "fipa-pure-const", "fipa-reference",
	"fipa-type-escape", and "ftree-promote-static".
	* opts.c: Ditto.
	* passes.c: Added ipa and tree-promote-statics passes.
	* timevar.def: Added TV_IPA_PURE_CONST, TV_IPA_REFERENCE,
	TV_IPA_TYPE_ESCAPE, and TV_PROMOTE_STATICS.
	* tree.h: Support ECF_POINTER_NO_CAPTURE attribute.
	* tree-dfa.c (referenced_var_lookup_if_exists): New function.
	* tree-flow.h: Added exposed sra calls and addition of
	reference_vars_info field for FUNCTION_DECLS.
	* tree-pass.h: Added passes.
	* tree-sra.c: (sra_init_cache): New function.
	(sra_insert_before, sra_insert_after) Made public.
	(type_can_be_decomposed_p): Renamed from type_can_be_decomposed_p
	and made public.
	* tree-ssa-alias.c (dump_alias_stats): Added stats for type based
	aliasing. (may_alias_p): Added code to use type escape analysis to
	improve alias sets.
	* tree-ssa-operands.c (add_call_clobber_ops): Added parameter and
	code to prune clobbers of static variables based on information
	produced in ipa-reference pass.  Changed call clobbering so that
	statics are not marked as clobbered if the call does not clobber
	them.


2005-07-16  Danny Berlin <dberlin@dberlin.org>
	    Kenneth Zadeck <zadeck@naturalbridge.com>

	* gcc.dg/tree-ssa/ssa-dce-2.c: Changed dg-options to run at -O2
	since pure const detection cannot run at -O1 in c compiler.
	* gcc.dg/tree-ssa/20030714-1.c Changed scanning patterns because we
	can now optimize this case properly.
	* gcc.dg/tree-ssa/sra-2.c: Changed to -O3 and removed xfail
	because we now pass.
	* gcc.dg/vect/vect-92.c: Removed out of bounds array access.

Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com>

From-SVN: r102098
2005-07-16 18:56:53 +00:00