Commit Graph

134979 Commits

Author SHA1 Message Date
GCC Administrator
4cbc054ed6 Daily bump.
From-SVN: r218460
2014-12-07 00:16:29 +00:00
James Greenhalgh
50e9ff8378 extend jump thread for finite state automata
PR tree-optimization/54742
	* params.def (max-fsm-thread-path-insns, max-fsm-thread-length,
	max-fsm-thread-paths): New.

	* doc/invoke.texi (max-fsm-thread-path-insns, max-fsm-thread-length,
	max-fsm-thread-paths): Documented.

	* tree-cfg.c (split_edge_bb_loc): Export.
	* tree-cfg.h (split_edge_bb_loc): Declared extern.

	* tree-ssa-threadedge.c (simplify_control_stmt_condition): Restore the
	original value of cond when simplification fails.
	(fsm_find_thread_path): New.
	(fsm_find_control_statement_thread_paths): New.
	(thread_through_normal_block): Call find_control_statement_thread_paths.

	* tree-ssa-threadupdate.c (dump_jump_thread_path): Pretty print
	EDGE_FSM_THREAD.
	(verify_seme): New.
	(duplicate_seme_region): New.
	(thread_through_all_blocks): Generate code for EDGE_FSM_THREAD edges
	calling duplicate_seme_region.

	* tree-ssa-threadupdate.h (jump_thread_edge_type): Add EDGE_FSM_THREAD.

	* testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c: New test.
	* testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c: New test.

Co-Authored-By: Brian Rzycki <b.rzycki@samsung.com>
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r218451
2014-12-06 19:19:37 +00:00
Tobias Burnus
b5a9fd3e94 error.c (gfc_error_check): Use bool not int.
2014-12-06  Tobias Burnus  <burnus@net-b.de>

        * error.c (gfc_error_check): Use bool not int.
        * gfortran.h (gfc_error_check): Update prototype.
        * match.c (gfc_match_if): Update call.
        * parse.c (decode_statement, decode_omp_directive,
        decode_gcc_attribute): Ditto.

From-SVN: r218450
2014-12-06 17:53:40 +01:00
Tobias Burnus
0f447a6e33 error.c (gfc_buffer_error, [...]): Use bool not
2014-12-06  Tobias Burnus  <burnus@net-b.de>
            Manuel López-Ibáñez  <manu@gcc.gnu.org>

        * error.c (gfc_buffer_error, gfc_error_flag_test): Use bool not
        * int.
        (buffer_flag): Remove static variable.
        (buffered_p): Add static variable.
        (gfc_error_init_1): Call gfc_buffer_error.
        (gfc_warning_1, gfc_warning, gfc_warning_now_1, gfc_error,
        gfc_error_now_1): Update for static variable change.
        * gfortran.h (gfc_buffer_error, gfc_error_flag_test): Update
        prototype.
        * parse.c (use_modules, decode_specification_statement,
        next_fixed, next_statement, match_deferred_characteristics):
        Update calls.
        * decl.c (gfc_match_data_decl): Ditto.
        * match.c (gfc_match_name): Ditto.


Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>

From-SVN: r218449
2014-12-06 17:33:11 +01:00
Bruce Korb
b8a82c9dc6 clarification
From-SVN: r218448
2014-12-06 15:08:55 +00:00
Marek Polacek
7fb66c1527 re PR tree-optimization/64183 (Complete unroll doesn't happen for a while-loop)
PR tree-optimization/64183
	* c-gimplify.c (c_gimplify_expr): Don't convert the RHS of a
	shift-expression if it is integer_type_node.  Use types_compatible_p.

	* gcc.dg/tree-ssa/pr64183.c: New test.

From-SVN: r218447
2014-12-06 13:10:31 +00:00
H.J. Lu
c7c8164083 Don't assert "alg != libcall" for -minline-stringops-dynamically
gcc/

	PR target/64200
	* config/i386/i386.c (decide_alg): Don't assert "alg != libcall"
	for TARGET_INLINE_STRINGOPS_DYNAMICALLY.

gcc/testsuite/

	PR target/64200
	* gcc.target/i386/memcpy-strategy-4.c: New test.

From-SVN: r218446
2014-12-06 03:32:46 -08:00
Tim Shen
00d6d5b1e7 Fix ChangeLog format.
From-SVN: r218444
2014-12-06 11:31:12 +00:00
GCC Administrator
909c02814b Daily bump.
From-SVN: r218443
2014-12-06 00:16:31 +00:00
Jakub Jelinek
06dd2aceb1 re PR sanitizer/64170 (ICE compiling Linux Kernel drivers/media/rc/imon.c in imon_incoming_packet)
PR sanitizer/64170
	* sanopt.c (maybe_optimize_asan_check_ifn): If base_checks is
	non-NULL, call maybe_get_dominating_check on it even if g is
	non-NULL.

	* gcc.dg/asan/pr64170.c: New test.

From-SVN: r218440
2014-12-06 00:00:09 +01:00
Jeff Law
40da08e0dd md.texi: Note problems using function calls to determine insn lengths and point readers...
* doc/md.texi: Note problems using function calls to determine
        insn lengths and point readers to a potential workaround.

From-SVN: r218439
2014-12-05 15:19:26 -07:00
Andreas Schwab
4b97b9f771 * combine.c (is_parallel_of_n_reg_sets)
(can_split_parallel_of_n_reg_sets): Only define if !HAVE_cc0.

From-SVN: r218436
2014-12-05 20:25:19 +00:00
Andrew Pinski
7eb2bd5718 aarch64-simd-builtins.def (bswap): Use CF2 rather than CF10 so 2 is appended on the code.
2014-12-05  Andrew Pinski  <apinski@cavium.com>

        * config/aarch64/aarch64-simd-builtins.def (bswap): Use CF2 rather
        than CF10 so 2 is appended on the code.
        * config/aarch64/aarch64-simd.md (bswap<mode>): Rename to ...
        (bswap<mode>2): This so it matches for the optabs.

From-SVN: r218435
2014-12-05 11:44:47 -08:00
Thomas Preud'homme
63edbb04b2 regrename.c (find_best_rename_reg): Rename to ...
2014-12-05  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * regrename.c (find_best_rename_reg): Rename to ...
    (find_rename_reg): This. Also add a parameter to skip tick check.
    * regrename.h: Likewise.
    * config/c6x/c6x.c (try_rename_operands): Adapt to above renaming.

From-SVN: r218434
2014-12-05 18:36:57 +00:00
Martin Jambor
fda3e2851e re PR ipa/64192 (r218369 causes some regressions with -m32.)
2014-12-05  Martin Jambor  <mjambor@suse.cz>

	PR ipa/64192
	* ipa-prop.c (ipa_compute_jump_functions_for_edge): Convert alignment
	from bits to bytes after checking they are byte-aligned.

From-SVN: r218433
2014-12-05 19:14:37 +01:00
Renlin Li
d86cb6d5c7 [AArch64]Clarify the usage of SCHED in AARCH64_CORE macro
gcc/

2014-12-05  Renlin Li  <renlin.li@arm.com>

	* config/aarch64/aarch64-opts.h (AARCH64_CORE): Rename IDENT to SCHED.
	* config/aarch64/aarch64.h (AARCH64_CORE): Likewise.
	* config/aarch64/aarch64.c (AARCH64_CORE): Rename X to IDENT,
	IDENT to SCHED.

From-SVN: r218432
2014-12-05 18:00:55 +00:00
Michael Meissner
663dfcf34e re PR target/53199 (__builtin_bswap64 and __builtin_bswap32 generate errors if -mcpu=power6)
2014-12-05  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/53199
	* gcc.target/powerpc/pr53199.c: Limit tests to 64-bit.

From-SVN: r218431
2014-12-05 17:50:40 +00:00
Bin Cheng
350013bc49 [AArch64]load store pair optimization using sched_fusion pass.
From-SVN: r218430
2014-12-05 17:06:33 +00:00
Olivier Hainque
a66272f6d2 defaults.h: (DWARF_REG_TO_UNWIND_COLUMN): Define default.
2014-12-05  Olivier Hainque  <hainque@adacore.com>

        gcc/
        * defaults.h: (DWARF_REG_TO_UNWIND_COLUMN): Define default.
        * dwarf2cfi.c (init_one_dwarf_reg_size): Honor
        DWARF_REG_TO_UNWIND_COLUMN.

        libgcc/
        * unwind-dw2.c (DWARF_REG_TO_UNWIND_COLUMN): Remove default def,
        now provided by defaults.h.

From-SVN: r218429
2014-12-05 17:01:42 +00:00
Olivier Hainque
edbbaf3b1b dwarf2cfi.c (init_one_dwarf_reg_size): New helper, processing one particular reg for expand_builtin_init_dwarf_reg_sizes.
2014-12-05  Olivier Hainque  <hainque@adacore.com>

        * dwarf2cfi.c (init_one_dwarf_reg_size): New helper, processing
        one particular reg for expand_builtin_init_dwarf_reg_sizes.
        (expand_builtin_init_dwarf_reg_sizes): Rework to use helper and
        account for dwarf register spans.

From-SVN: r218428
2014-12-05 16:53:22 +00:00
Sandra Loosemore
e425f87428 pr63341-1.c: Remove explicit "dg-do run".
2014-12-05  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/testsuite/
	* gcc.dg/vect/pr63341-1.c: Remove explicit "dg-do run".
	* gcc.dg/vect/pr63341-2.c: Likewise.
	* gcc.dg/vect/pr63379.c: Likewise.
	* gcc.dg/vect/pr63605.c: Likewise.

From-SVN: r218427
2014-12-05 11:18:30 -05:00
Ilya Enkovich
65fdb418d1 re PR target/64003 (valgrind complains about get_attr_length_nobnd in insn-attrtab.c from i386.md)
PR target/64003
	* config/i386/i386.md (*jcc_1_bnd): New.
	(*jcc_2_bnd): New.
	(jump_bnd): New.
	(*jcc_1): Remove bnd prefix.
	(*jcc_2): Likewise.
	(jump): Likewise.

From-SVN: r218426
2014-12-05 16:00:52 +00:00
Renlin Li
3edaf26de0 [AArch64] Use selected cpu's tuning when no tuning parameter is specified
gcc/

2014-12-05  Renlin Li  <renlin.li@arm.com>

	* config/aarch64/aarch64.c (aarch64_parse_cpu): Don't define
	selected_tune.
	(aarch64_override_options): Use selected_cpu's tuning.

From-SVN: r218425
2014-12-05 15:54:57 +00:00
David Edelsohn
0b78b90e51 xcoff.h (ASM_OUTPUT_ALIGNED_LOCAL): Append alignment to section name.
* config/rs6000/xcoff.h (ASM_OUTPUT_ALIGNED_LOCAL): Append
alignment to section name. Increase default alignment to word.

From-SVN: r218424
2014-12-05 10:04:55 -05:00
Andre Vehreschild
201678234c re PR fortran/60414 (internal compiler error: tree check)
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.

From-SVN: r218422
2014-12-05 15:15:27 +01:00
Martin Jambor
6a4bad955f cgraph.h (cgraph_node): New method expand_all_artificial_thunks.
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.

From-SVN: r218417
2014-12-05 12:06:26 +01:00
Jonathan Wakely
612b47110a hashtable_policy.h (_Map_base::operator[], [...]): Simplify definitions with trailing return types.
* include/bits/hashtable_policy.h (_Map_base::operator[],
	_Map_base::at): Simplify definitions with trailing return types.

From-SVN: r218416
2014-12-05 10:35:51 +00:00
Ilya Enkovich
37b12f5804 re PR target/64056 (gcc.target/i386/chkp-strlen-4.c etc. FAIL)
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.

From-SVN: r218415
2014-12-05 10:01:33 +00:00
GCC Administrator
0e0aa6c671 Daily bump.
From-SVN: r218413
2014-12-05 00:16:33 +00:00
Manuel López-Ibáñez
ec0fa4f64d 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.

From-SVN: r218410
2014-12-05 00:01:35 +00:00
Manuel López-Ibáñez
99abe958d8 error.c (gfc_diagnostic_build_locus_prefix): Use diagnostic_expand_location.
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.

From-SVN: r218409
2014-12-04 23:59:35 +00:00
H.J. Lu
1be7144689 Always define HAVE_LD_PIE_COPYRELOC
PR bootstrap/64189
	* configure.ac (HAVE_LD_PIE_COPYRELOC): Always define.
	* configure: Regenerated.

From-SVN: r218408
2014-12-04 15:53:24 -08:00
Manuel López-Ibáñez
b93c07227e line-map.c (linemap_position_for_loc_and_offset): Add new linemap_assert_fails.
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.

From-SVN: r218407
2014-12-04 23:35:29 +00:00
Manuel López-Ibáñez
97aa8bb6e2 diagnostic.c (diagnostic_color_init): New.
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.

From-SVN: r218406
2014-12-04 23:09:41 +00:00
David Malcolm
87aca3a6ae 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.

From-SVN: r218405
2014-12-04 21:33:22 +00:00
David Malcolm
c8a15f362a 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.

From-SVN: r218404
2014-12-04 21:23:57 +00:00
David Malcolm
953971cf7d 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".

From-SVN: r218403
2014-12-04 21:11:04 +00:00
Jason Merrill
ef9f382ca5 re PR c++/64029 (const int (&in)[]{1,2,3,4,5}; results in internal compiler error: Segmentation fault)
PR c++/64029
	* decl.c (grok_reference_init): Complete array type.

From-SVN: r218402
2014-12-04 15:37:30 -05:00
Jason Merrill
a1408b7e41 re PR c++/64080 ([C++14]ICE in cxx_eval_store_expression)
PR c++/64080
	* constexpr.c (cxx_eval_store_expression): Handle non-decl store
	targets.

From-SVN: r218401
2014-12-04 15:37:24 -05:00
Jason Merrill
6dc8211094 fix comment
From-SVN: r218400
2014-12-04 15:37:14 -05:00
David Malcolm
7004cce9fb 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.

From-SVN: r218399
2014-12-04 20:00:25 +00:00
Sriraman Tallam
77ad54d911 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.

Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com>

From-SVN: r218397
2014-12-04 11:40:50 -08:00
Marek Polacek
3119ac2925 re PR middle-end/56917 (-ftrapv detects a overflow wrongly.)
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.

From-SVN: r218395
2014-12-04 19:20:12 +00:00
Tobias Burnus
d348be26b9 Makefile.in: Remove CLOOGLIB and CLOOGINC.
2014-12-04  Tobias Burnus  <burnus@net-b.de>

        * Makefile.in: Remove CLOOGLIB and CLOOGINC.

From-SVN: r218389
2014-12-04 19:18:21 +01:00
Thomas Preud'homme
83f41b2484 check_GNU_style.sh: Warn for incorrect number of spaces in function call only if 0 or 2+ spaces found.
2014-12-04  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    contrib/
    * check_GNU_style.sh: Warn for incorrect number of spaces in function
    call only if 0 or 2+ spaces found.

From-SVN: r218382
2014-12-04 16:39:47 +00:00
Richard Biener
881083d629 match-and-simplify.texi: Update for recent changes.
2014-12-04  Richard Biener  <rguenther@suse.de>

	* doc/match-and-simplify.texi: Update for recent changes.

From-SVN: r218372
2014-12-04 14:44:57 +00:00
Martin Jambor
04be694e4d ipa-prop.h (ipa_alignment): New type.
2014-12-04  Martin Jambor  <mjambor@suse.cz>

	* ipa-prop.h (ipa_alignment): New type.
	(ipa_jump_func): New field alignment.
	(ipcp_transformation_summary) New type.
	(ipcp_grow_transformations_if_necessary): Declare.
	(ipa_node_agg_replacements): Removed.
	(ipcp_transformations): Declare.
	(ipcp_get_transformation_summary): New function.
	(ipa_get_agg_replacements_for_node): Use it.
	* ipa-cp.c (ipcp_param_lattices): New field alignment.
	(print_all_lattices): Also print alignment.
	(alignment_bottom_p): New function.
	(set_alignment_to_bottom): Likewise.
	(set_all_contains_variable): Also set alignment to bottom.
	(initialize_node_lattices): Likewise.
	(propagate_alignment_accross_jump_function): New function.
	(propagate_constants_accross_call): Call it.
	(ipcp_store_alignment_results): New function.
	(ipcp_driver): Call it.
	* ipa-prop.c (ipa_node_agg_replacements): Removed.
	(ipcp_transformations): New.
	(ipa_print_node_jump_functions_for_edge): Also print alignment.
	(ipa_set_jf_unknown): New function.
	(detect_type_change_from_memory_writes): Use ipa_set_jf_unknown.
	(ipa_compute_jump_functions_for_edge): Also calculate alignment.
	(update_jump_functions_after_inlining): Use ipa_set_jf_unknown.
	(ipcp_grow_transformations_if_necessary): New function.
	(ipa_set_node_agg_value_chain): Use ipcp_transformations.
	(ipa_node_removal_hook): Likewise.
	(ipa_node_duplication_hook): Also duplicate alignment results.
	(ipa_write_jump_function): Also stream alignments.
	(ipa_read_jump_function): Use ipa_set_jf_unknown, also stream
	alignments.
	(write_agg_replacement_chain): Renamed to
	write_ipcp_transformation_info, also stream alignments.
	(read_agg_replacement_chain): Renamed to
	read_ipcp_transformation_info, also stream alignments.
	(ipa_prop_write_all_agg_replacement): Renamed to
	ipcp_write_transformation_summaries. Stream always.
	(ipa_prop_read_all_agg_replacement): Renamed to
	ipcp_read_transformation_summaries.
	(ipcp_update_alignments): New function.
	(ipcp_transform_function): Call it, free also alignments.

testsuite/
	* gcc.dg/ipa/propalign-1.c: New test.
	* gcc.dg/ipa/propalign-2.c: Likewise.

From-SVN: r218369
2014-12-04 15:37:01 +01:00
Richard Biener
de665bbd93 gimple-fold.c (replace_stmt_with_simplification): Properly fail when maybe_push_res_to_seq fails.
2014-12-04  Richard Biener  <rguenther@suse.de>

	* gimple-fold.c (replace_stmt_with_simplification): Properly
	fail when maybe_push_res_to_seq fails.

From-SVN: r218353
2014-12-04 12:35:42 +00:00
Ganesh Gopalasubramanian
79c6bb5f20 Add prefetch support for aarch64
From-SVN: r218349
2014-12-04 10:51:54 +00:00
Francois-Xavier Coudert
8495b8f693 install.texi: Remove mentions of cloog and ppl.
* doc/install.texi: Remove mentions of cloog and ppl.
	* doc/invoke.texi: Likewise

From-SVN: r218348
2014-12-04 10:31:56 +00:00