1. 06 Dec, 2014 6 commits
  2. 05 Dec, 2014 21 commits
  3. 04 Dec, 2014 13 commits
    • error.c (gfc_diagnostic_build_locus_prefix): Use diagnostic_expand_location. · 99abe958
      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
      Manuel López-Ibáñez committed
    • Always define HAVE_LD_PIE_COPYRELOC · 1be71446
      	PR bootstrap/64189
      	* configure.ac (HAVE_LD_PIE_COPYRELOC): Always define.
      	* configure: Regenerated.
      
      From-SVN: r218408
      H.J. Lu committed
    • line-map.c (linemap_position_for_loc_and_offset): Add new linemap_assert_fails. · b93c0722
      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
      Manuel López-Ibáñez committed
    • diagnostic.c (diagnostic_color_init): New. · 97aa8bb6
      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
      Manuel López-Ibáñez committed
    • Avoid overuse of name "buffer" in tree-pretty-print.c · 87aca3a6
      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
      David Malcolm committed
    • PR jit/63854: Fix double-initialization within tree-pretty-print.c · c8a15f36
      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
      David Malcolm committed
    • PR jit/63854: Fix leak of ipa hooks · 953971cf
      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
      David Malcolm committed
    • re PR c++/64029 (const int (&in)[]{1,2,3,4,5}; results in internal compiler… · ef9f382c
      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
      Jason Merrill committed
    • re PR c++/64080 ([C++14]ICE in cxx_eval_store_expression) · a1408b7e
      	PR c++/64080
      	* constexpr.c (cxx_eval_store_expression): Handle non-decl store
      	targets.
      
      From-SVN: r218401
      Jason Merrill committed
    • fix comment · 6dc82110
      From-SVN: r218400
      Jason Merrill committed
    • Update docs to reflect use of gimple subclasses · 7004cce9
      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
      David Malcolm committed
    • x86-64: Optimize access to globals in PIE with copy reloc · 77ad54d9
      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
      Sriraman Tallam committed
    • re PR middle-end/56917 (-ftrapv detects a overflow wrongly.) · 3119ac29
      	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
      Marek Polacek committed