2014-12-04  Tobias Burnus  <burnus@net-b.de>

        * Makefile.in: Remove CLOOGLIB and CLOOGINC.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218389 138bc75d-0d04-0410-961f-82ee72b054a4
	PR middle-end/56917
	* fold-const.c (fold_unary_loc): Perform the negation in A's type
	when transforming ~ (A - 1) or ~ (A + -1) to -A.

	* c-c++-common/ubsan/pr56917.c: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218395 138bc75d-0d04-0410-961f-82ee72b054a4
x86-64: Optimize access to globals in PIE with copy reloc

Normally, with -fPIE/-fpie, GCC accesses globals that are extern to the
module using the GOT.  This is two instructions, one to get the address
of the global from the GOT and the other to get the value.  If it turns
out that the global gets defined in the executable at link-time, it still
needs to go through the GOT as it is too late then to generate a direct
 access.

Examples:

foo.cc
------
int a_glob;
int main () {
  return a_glob; // defined in this file
}

With -O2 -fpie -pie, the generated code directly accesses the global via
PC-relative insn:

5e0   <main>:
   mov    0x165a(%rip),%eax        # 1c40 <a_glob>

foo.cc
------

extern int a_glob;
int main () {
  return a_glob; // defined in this file
}

With -O2 -fpie -pie, the generated code accesses global via GOT using
two memory loads:

6f0  <main>:
   mov    0x1609(%rip),%rax   # 1d00 <_DYNAMIC+0x230>
   mov    (%rax),%eax

This is true even if in the latter case the global was defined in the
executable through a different file.

Some experiments on google benchmarks shows that the extra memory loads
affects performance by 1% to 5%.

Solution - Copy Relocations:

When the linker supports copy relocations, GCC can always assume that
the global will be defined in the executable.  For globals that are truly
extern (come from shared objects), the linker will create copy relocations
and have them defined in the executable. Result is that no global access
needs to go through the GOT and hence improves performance.

This optimization only applies to undefined, non-weak global data.
Undefined, weak global data access still must go through the GOT.

This patch checks if linker supports PIE with copy reloc, which is
enabled in gold and bfd linker in bininutils 2.25, at configure time
and enables this optimization if the linker support is available.

gcc/

	* configure.ac (HAVE_LD_PIE_COPYRELOC): Defined to 1 if
	Linux/x86-64 linker supports PIE with copy reloc.
	* config.in: Regenerated.
	* configure: Likewise.

	* config/i386/i386.c (legitimate_pic_address_disp_p): Allow
	pc-relative address for undefined, non-weak, non-function
	symbol reference in 64-bit PIE if linker supports PIE with
	copy reloc.

	* doc/sourcebuild.texi: Document pie_copyreloc target.

gcc/testsuite/

	* gcc.target/i386/pie-copyrelocs-1.c: New test.
	* gcc.target/i386/pie-copyrelocs-2.c: Likewise.
	* gcc.target/i386/pie-copyrelocs-3.c: Likewise.
	* gcc.target/i386/pie-copyrelocs-4.c: Likewise.

	* lib/target-supports.exp (check_effective_target_pie_copyreloc):
	New procedure.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218397 138bc75d-0d04-0410-961f-82ee72b054a4
Update docs to reflect use of gimple subclasses

gcc/ChangeLog:
	* doc/cfg.texi (GIMPLE statement iterators): Add note about
	gphi_iterator, and use one in the example.
	* doc/gimple.texi (Tuple specific accessors): Add missing
	GIMPLE_GOTO section and menu item.
	(gimple_build_asm, gimple gimple_build_assign_with_ops)
	gimple_call_mark_uninlinable, gimple_call_cannot_inline_p): Remove
	description of removed functions.
	(gimple_build_assign, gimple_build_bind, gimple_build_call,
	gimple_build_call_from_tree, gimple_build_call_vec,
	gimple_build_catch, gimple_build_cond,
	gimple_build_cond_from_tree, gimple_build_debug_bind,
	gimple_build_eh_filter, gimple_build_label, gimple_build_goto,
	gimple_build_omp_atomic_load, gimple_build_omp_atomic_store,
	gimple_build_omp_continue, gimple_build_omp_critical,
	gimple_build_omp_for, gimple_build_omp_parallel,
	gimple_build_omp_sections, gimple_build_omp_single,
	gimple_build_return, gimple_build_resx, gimple_build_switch,
	gimple_build_try): Update return type within description to
	reflect changes in gimple.h to using gimple subclasses.
	(gimple_build_asm_vec): Update return type, params and
	description.
	(gimple_asm_ninputs): Update param.
	(gimple_asm_noutputs, gimple_asm_nclobbers, gimple_asm_input_op
	gimple_asm_set_input_op, gimple_asm_output_op
	gimple_asm_set_output_op, gimple_asm_clobber_op,
	gimple_asm_set_clobber_op, gimple_asm_string,
	gimple_asm_volatile_p, gimple_asm_set_volatile, gimple_bind_vars,
	gimple_bind_set_vars, gimple_bind_append_vars, gimple_bind_body,
	gimple_bind_set_body, gimple_bind_add_stmt, gimple_bind_add_seq,
	gimple_bind_block, gimple_bind_set_block, gimple_call_set_fn,
	gimple_call_return_type, gimple_call_set_chain,
	gimple_call_set_tail, gimple_call_tail_p,
	gimple_call_copy_skip_args, gimple_catch_types,
	gimple_catch_types_ptr, gimple_catch_handler,
	gimple_catch_set_types, gimple_catch_set_handler,
	gimple_cond_set_code, gimple_cond_set_lhs, gimple_cond_set_rhs,
	gimple_cond_true_label, gimple_cond_set_true_label,
	gimple_cond_set_false_label, gimple_cond_false_label,
	gimple_cond_make_false, gimple_cond_make_true,
	gimple_eh_filter_set_types, gimple_eh_filter_set_failure,
	gimple_eh_must_not_throw_fndecl,
	gimple_eh_must_not_throw_set_fndecl, gimple_label_label,
	gimple_label_set_label, gimple_goto_set_dest,
	gimple_omp_atomic_load_set_lhs, gimple_omp_atomic_load_lhs,
	gimple_omp_atomic_load_set_rhs, gimple_omp_atomic_load_rhs,
	gimple_omp_atomic_store_set_val, gimple_omp_atomic_store_val,
	gimple_omp_continue_control_def,
	gimple_omp_continue_control_def_ptr,
	gimple_omp_continue_set_control_def,
	gimple_omp_continue_control_use,
	gimple_omp_continue_control_use_ptr,
	gimple_omp_continue_set_control_use, gimple_omp_critical_name,
	gimple_omp_critical_name_ptr, gimple_omp_critical_set_name,
	gimple_omp_parallel_clauses_ptr, gimple_omp_parallel_set_clauses,
	gimple_omp_parallel_child_fn, gimple_omp_parallel_child_fn_ptr,
	gimple_omp_parallel_set_child_fn, gimple_omp_parallel_data_arg,
	gimple_omp_parallel_data_arg_ptr,
	gimple_omp_parallel_set_data_arg, gimple_omp_single_set_clauses,
	gimple_phi_set_result, gimple_phi_set_arg, gimple_resx_region,
	gimple_resx_set_region, gimple_return_retval,
	gimple_return_set_retval, gimple_switch_num_labels,
	gimple_switch_set_num_labels, gimple_switch_index,
	gimple_switch_set_index, gimple_switch_label,
	gimple_switch_set_label, gimple_switch_default_label,
	gimple_switch_set_default_label, gimple_try_set_eval,
	gimple_try_set_cleanup): Update initial param within description
	to reflect changes in gimple.h to using gimple subclasses.
	(Adding a new GIMPLE statement code): Update to reflect gimple
	statement subclassing.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218399 138bc75d-0d04-0410-961f-82ee72b054a4
fix comment

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218400 138bc75d-0d04-0410-961f-82ee72b054a4
	PR c++/64080
	* constexpr.c (cxx_eval_store_expression): Handle non-decl store
	targets.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218401 138bc75d-0d04-0410-961f-82ee72b054a4
	PR c++/64029
	* decl.c (grok_reference_init): Complete array type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218402 138bc75d-0d04-0410-961f-82ee72b054a4
PR jit/63854: Fix leak of ipa hooks

gcc/ChangeLog:
	PR jit/63854
	* ipa-prop.c (ipa_register_cgraph_hooks): Guard insertion of
	ipa_add_new_function on function_insertion_hook_holder being
	non-NULL.
	* ipa-reference.c (ipa_reference_c_finalize): Remove
	node_removal_hook_holder and node_duplication_hook_holder if
	they've been added to symtab.
	* toplev.c (toplev::finalize): Call ipa_reference_c_finalize
	before cgraph_c_finalize so that the former can access "symtab".



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218403 138bc75d-0d04-0410-961f-82ee72b054a4
PR jit/63854: Fix double-initialization within tree-pretty-print.c

gcc/ChangeLog:
	PR jit/63854
	* tree-pretty-print.c: Eliminate include of <new>.
	(buffer): Convert this variable from a pretty_printer to a
	pretty_printer *.
	(initialized): Eliminate this variable in favor of the NULL-ness
	of "buffer".
	(print_generic_decl): Update for "buffer" becoming a pointer.
	(print_generic_stmt): Likewise.
	(print_generic_stmt_indented): Likewise.
	(print_generic_expr): Likewise.
	(maybe_init_pretty_print): Likewise, allocating "buffer" on the
	heap and using its non-NULL-ness to ensure idempotency.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218404 138bc75d-0d04-0410-961f-82ee72b054a4
Avoid overuse of name "buffer" in tree-pretty-print.c

gcc/ChangeLog:
	* tree-pretty-print.c (INDENT): Rename "buffer" to "pp".
	(NIY): Likewise.
	(buffer): Rename this variable to...
	(tree_pp): ...this.

	(do_niy): Rename param from "buffer" to "pp".
	(dump_decl_name): Likewise.
	(dump_function_name): Likewise.
	(dump_function_declaration): Likewise.
	(dump_array_domain): Likewise.
	(dump_omp_clause): Likewise.
	(dump_omp_clauses): Likewise.
	(dump_location): Likewise.
	(dump_block_node): Likewise.
	(dump_generic_node): Likewise.
	(print_declaration): Likewise.
	(print_struct_decl): Likewise.
	(print_call_name): Likewise.
	(pretty_print_string): Likewise.
	(newline_and_indent): Likewise.

	(print_generic_decl): Update for renaming of "buffer" to
	"tree_pp".
	(print_generic_stmt): Likewise.
	(print_generic_stmt_indented): Likewise.
	(print_generic_expr): Likewise.
	(maybe_init_pretty_print): Likewise.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218405 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog:

2014-12-04  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* diagnostic.c (diagnostic_color_init): New.
	* diagnostic.h: Declare.
	* gcc.c (driver::global_initializations): Use it.
	(driver_handle_option): Handle -fdiagnostics-color_.
	* toplev.c: Do not include diagnostic-color.h.
	(process_options): Do not initialize color diagnostics here.
	* common.opt (fdiagnostics-color=): Add Driver.
	* opts-global.c (init_options_once): Initialize color here.
	* opts.c (common_handle_option): Use diagnostics_color_init.
	* diagnostic-color.h: Fix comment.





git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218406 138bc75d-0d04-0410-961f-82ee72b054a4
libcpp/ChangeLog:

2014-12-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* line-map.c (linemap_position_for_loc_and_offset): Add new
	linemap_assert_fails.

gcc/fortran/ChangeLog:

2014-12-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* scanner.c (gfc_next_char_literal): Use gfc_warning_now.
	(load_file): Use the line length as the column hint for
	linemap_line_start. Reserve a location for the highest column of
	the line.

gcc/testsuite/ChangeLog:

2014-12-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* gfortran.dg/line_length_5.f90: New test.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218407 138bc75d-0d04-0410-961f-82ee72b054a4
Always define HAVE_LD_PIE_COPYRELOC

	PR bootstrap/64189
	* configure.ac (HAVE_LD_PIE_COPYRELOC): Always define.
	* configure: Regenerated.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218408 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/fortran/ChangeLog:

2014-12-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* error.c (gfc_diagnostic_build_locus_prefix): Use
	diagnostic_expand_location.

gcc/ChangeLog:

2014-12-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* diagnostic.h (diagnostic_expand_location): New inline function.
	* diagnostic.c (diagnostic_build_prefix): Use it.
	(diagnostic_show_locus): Likewise.





git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218409 138bc75d-0d04-0410-961f-82ee72b054a4
This test should have been added in revision 218407.

gcc/testsuite/

2014-12-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* gfortran.dg/line_length_5.f90: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218410 138bc75d-0d04-0410-961f-82ee72b054a4
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218413 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/

	PR target/64056
	* doc/sourcebuild.texi: Add mempcpy and stpcpy for Effective-Target Keywords.

gcc/testsuite/

	PR target/64056
	* lib/target-supports.exp (check_effective_target_stpcpy): New.
	* gcc.target/i386/chkp-strlen-2.c: Add stpcpy target check.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218415 138bc75d-0d04-0410-961f-82ee72b054a4
	* include/bits/hashtable_policy.h (_Map_base::operator[],
	_Map_base::at): Simplify definitions with trailing return types.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218416 138bc75d-0d04-0410-961f-82ee72b054a4
2014-12-05  Martin Jambor  <mjambor@suse.cz>

	* cgraph.h (cgraph_node): New method expand_all_artificial_thunks.
	(cgraph_edge): New method redirect_callee_duplicating_thunks.
	* cgraphclones.c (duplicate_thunk_for_node): Donot expand newly
	created thunks.
	(redirect_edge_duplicating_thunks): Turned into edge method
	redirect_callee_duplicating_thunks.
	(cgraph_node::expand_all_artificial_thunks): New method.
	(create_clone): Call expand_all_artificial_thunks.
	* ipa-cp.c (perhaps_add_new_callers): Call
	redirect_callee_duplicating_thunks instead of redirect_callee.
	Also call expand_all_artificial_thunks.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218417 138bc75d-0d04-0410-961f-82ee72b054a4
2014-12-05  Andre Vehreschild  <vehre@gmx.de>

	PR fortran/60414
	* interface.c (compare_parameter): Remove class argument rank
	check short circuit.

2014-12-05  Andre Vehreschild  <vehre@gmx.de>

	PR fortran/60414
	* gfortran.dg/unlimited_polymorphism_18.f90: New test.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218422 138bc75d-0d04-0410-961f-82ee72b054a4