1. 05 May, 2017 28 commits
    • Get rid of macros for diagnostic_report_current_module · 26d5ed6c
      diagnostic.h has a couple of macros (diagnostic_last_module_changed
      and diagnostic_set_last_module) which are only used within
      diagnostic_report_current_module.
      
      This patch eliminates the macros in favor of static functions within
      diagnostic.c.
      
      No functional change intended.
      
      gcc/ChangeLog:
      	* diagnostic.c (last_module_changed_p): New function.
      	(set_last_module): New function.
      	(diagnostic_report_current_module): Convert macro usage to
      	the above functions.
      	* diagnostic.h (diagnostic_context::last_module): Strengthen
      	from const line_map * to const line_map_ordinary *.
      	(diagnostic_last_module_changed): Delete macro.
      	(diagnostic_set_last_module): Delete macro.
      
      From-SVN: r247664
      David Malcolm committed
    • Eliminate report_diagnostic macro · 56d35585
      This patch eliminates the report_diagnostic macro, manually
      expanding it in all sites in the code.
      
      No functional change intended.
      
      gcc/c-family/ChangeLog:
      	* c-common.c (c_cpp_error): Replace report_diagnostic
      	with diagnostic_report_diagnostic.
      
      gcc/c/ChangeLog:
      	* c-decl.c (warn_defaults_to): Replace report_diagnostic
      	with diagnostic_report_diagnostic.
      	* c-errors.c (pedwarn_c99): Likewise.
      	(pedwarn_c90): Likewise.
      
      gcc/cp/ChangeLog:
      	* error.c (pedwarn_cxx98): Replace report_diagnostic
      	with diagnostic_report_diagnostic.
      
      gcc/ChangeLog:
      	* diagnostic.c (diagnostic_impl): Replace report_diagnostic
      	with diagnostic_report_diagnostic.
      	(diagnostic_n_impl_richloc): Likewise.
      	* diagnostic.h (report_diagnostic): Delete macro.
      	* rtl-error.c (diagnostic_for_asm): Replace report_diagnostic
      	with diagnostic_report_diagnostic.
      	* substring-locations.c (format_warning_va): Likewise.
      
      gcc/fortran/ChangeLog:
      	* cpp.c (cb_cpp_error): Replace report_diagnostic
      	with diagnostic_report_diagnostic.
      	* error.c (gfc_warning): Likewise.
      	(gfc_warning_now_at): Likewise.
      	(gfc_warning_now): Likewise.
      	(gfc_warning_internal): Likewise.
      	(gfc_error_now): Likewise.
      	(gfc_fatal_error): Likewise.
      	(gfc_error_opt): Likewise.
      	(gfc_internal_error): Likewise.
      
      From-SVN: r247663
      David Malcolm committed
    • diagnostic.c: add print_option_information · 80ceac09
      This patch simplifies diagnostic_report_diagnostic by moving
      option-printing to a new subroutine.
      
      Doing so required a slight rewrite.  In both the old and new
      code, context->option_name returns a malloc-ed string.
      The old behavior was to then use ACONCAT to manipulate the
      format_spec, appending the option metadata.
      ACONCAT calcs the buffer size, then uses alloca, and then copies the
      data to the on-stack buffer.
      
      Given the alloca, this needs rewriting when moving the printing to
      a subroutine.  In the new version, the metadata is simply printed
      using pp_* calls (so it's hitting the obstack within the
      pretty_printer).
      
      This means we can get rid of the save/restore of format_spec: I don't
      believe anything else in the code modifies it.
      
      It also seems inherently simpler; it seems odd to me to be
      appending metadata to the formatting string, rather than simply
      printing the metadata after the formatted string is printed
      (the old code also assumed that no option name contained a '%').
      
      No functional change intended.
      
      gcc/ChangeLog:
      	* diagnostic.c (diagnostic_report_diagnostic): Eliminate
      	save/restor of format_spec.  Move option-printing code to...
      	(print_option_information): ...this new function, and
      	reimplement by simply printing to the pretty_printer,
      	rather than appending to the format string.
      
      From-SVN: r247661
      David Malcolm committed
    • diagnostic_report_diagnostic: refactor pragma-handling · dc41c9b0
      This patch simplifies diagnostic_report_diagnostic by moving the
      pragma-handling logic into a subroutine.
      
      No functional change intended.
      
      gcc/ChangeLog:
      	* diagnostic.c (diagnostic_report_diagnostic): Split out pragma
      	handling logic into...
      	(update_effective_level_from_pragmas): ...this new function.
      
      From-SVN: r247660
      David Malcolm committed
    • RISC-V: Add -mstrict-align option · 82285692
      The RISC-V user ISA permits misaligned accesses, but they may trap
      and be emulated.  That emulation software needs to be compiled assuming
      strict alignment.
      
      Even when strict alignment is not required, set SLOW_UNALIGNED_ACCESS
      based upon -mtune to avoid a performance pitfall.
      
      gcc/ChangeLog:
      
      2017-05-04  Andrew Waterman  <andrew@sifive.com>
      
      	* config/riscv/riscv.opt (mstrict-align): New option.
      	* config/riscv/riscv.h (STRICT_ALIGNMENT): Use it.  Update comment.
      	(SLOW_UNALIGNED_ACCESS): Define.
      	(riscv_slow_unaligned_access): Declare.
      	* config/riscv/riscv.c (riscv_tune_info): Add slow_unaligned_access
      	field.
      	(riscv_slow_unaligned_access): New variable.
      	(rocket_tune_info): Set slow_unaligned_access to true.
      	(optimize_size_tune_info): Set slow_unaligned_access to false.
      	(riscv_cpu_info_table): Add entry for optimize_size_tune_info.
      	(riscv_valid_lo_sum_p): Use TARGET_STRICT_ALIGN.
      	(riscv_option_override): Set riscv_slow_unaligned_access.
              * doc/invoke.texi: Add -mstrict-align to RISC-V.
      
      From-SVN: r247659
      Andrew Waterman committed
    • RISC-V: Unify indention in riscv.md · 248710c4
      This contains only whitespace changes.
      
      gcc/ChangeLog
      
      2017-05-04  Kito Cheng  <kito.cheng@gmail.com>
      
      	* config/riscv/riscv.md: Unify indentation.
      
      From-SVN: r247658
      Kito Cheng committed
    • re PR target/79038 (Improve PowerPC ISA 3.0 conversion between integers and hardware _Float128) · 8acb8575
      [gcc]
      2017-05-05  Michael Meissner  <meissner@linux.vnet.ibm.com>
      
      	PR target/79038
      	PR target/79202
      	PR target/79203
      	* config/rs6000/rs6000.md (u code attribute): Add FIX and
      	UNSIGNED_FIX.
      	(extendsi<mode>2): Add support for doing sign extension via
      	VUPKHSW and XXPERMDI if the value is in Altivec registers and we
      	don't have ISA 3.0 instructions.
      	(extendsi<mode>2 splitter): Likewise.
      	(fix_trunc<mode>si2): If we are at ISA 2.07 (VSX small integer),
      	generate the normal insns since SImode can now go in vector
      	registers.  Disallow the special UNSPECs needed for previous
      	machines to hide SImode being used.  Add new insns
      	fctiw{,w}_<mode>_smallint if SImode can go in vector registers.
      	(fix_trunc<mode>si2_stfiwx): Likewise.
      	(fix_trunc<mode>si2_internal): Likewise.
      	(fixuns_trunc<mode>si2): Likewise.
      	(fixuns_trunc<mode>si2_stfiwx): Likewise.
      	(fctiw<u>z_<mode>_smallint): Likewise.
      	(fctiw<u>z_<mode>_mem): New combiner pattern to prevent conversion
      	of floating point to 32-bit integer from doing a direct move to
      	the GPR registers to do a store.
      	(fctiwz_<mode>): Break long line.
      
      [gcc/testsuite]
      2017-05-05  Michael Meissner  <meissner@linux.vnet.ibm.com>
      
      	PR target/79038
      	PR target/79202
      	PR target/79203
      	* gcc.target/powerpc/ppc-round3.c: New test.
      	* gcc.target/powerpc/ppc-round2.c: Update expected code.
      
      From-SVN: r247657
      Michael Meissner committed
    • cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value. · 4b4b2e58
      	* cp-tree.h (IDENTIFIER_GLOBAL_VALUE): Use get_namespace_value.
      	(SET_IDENTIFIER_GLOBAL_VALUE): Use set_global_value.
      	(IDENTIFIER_NAMESPACE_VALUE): Delete.
      	* name-lookup.h (namespace_binding, set_namespace_binding):
      	Replace
      	with ...
      	(get_namespace_value, set_global_value): ... these.
      	(get_global_value_if_present, is_typename_at_global_scope):
      	Delete.
      	* decl.c (poplevel): Use get_namespace_value.
      	(grokdeclarator): Use IDENTIFIER_GLOBAL_VALUE.
      	* class.c (build_vtbl_initializer): Stash library decl in
      	static var. Use IDENTIFIER_GLOBAL_VALUE.
      	* except.c (do_get_exception_ptr, do_begin_catch, do_end_catch)
      	do_allocate_exception, do_free_exception, build_throw): Likewise.
      	* init.c (throw_bad_array_new_length): Likewise.
      	* rtti.c (throw_bad_cast, throw_bad_typeid): Likewise.
      	* name-lookup.c (arg_assoc_namespace, pushdecl_maybe_friend_1)
      	check_for_our_of_scope_variable, push_overloaded_decl_1): Use
      	get_namespace_value.
      	(set_namespace_binding_1): Rename to
      	(set_namespace_binding): ... here.
      	(set_global_value): New.
      	(lookup_name_innermost_nonclass_level_1, push_namespace): Use
      	get_namespace_value.
      	* pt.c (listify): Use get_namespace_value.
      ((--This line, and those below, will be ignored--
      
      M    cp/name-lookup.c
      M    cp/name-lookup.h
      M    cp/ChangeLog
      M    cp/except.c
      M    cp/class.c
      M    cp/pt.c
      M    cp/init.c
      M    cp/cp-tree.h
      M    cp/decl.c
      M    cp/rtti.c
      
      From-SVN: r247654
      Nathan Sidwell committed
    • Makefile.in (GTFILES): Add tree-ssa-loop-ivopts.c. · 359b060e
      	* Makefile.in (GTFILES): Add tree-ssa-loop-ivopts.c.
      	* tree-ssa-loop-ivopts.c (compute_max_addr_offset): Delete.
      	(addr_list, addr_offset_valid_p): New.
      	(split_address_groups): Check offset validity with above function.
      	(gt-tree-ssa-loop-ivopts.h): Include header file.
      
      From-SVN: r247653
      Bin Cheng committed
    • builtins.c (check_sizes, [...]): Fix typos introduced during merge conflict resolution. · 13c5654f
      gcc/ChangeLog:
      	* builtins.c (check_sizes, check_strncat_sizes): Fix typos
      	introduced during merge	conflict resolution.
      	(expand_builtin_strncat): Same.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/pr78138.c: Adjust text of expected diagnostics.
      	* gcc.dg/pr79214.c: Same.
      	* gcc.dg/pr79222.c: Same.
      	* gcc.dg/pr79223.c: Same.
      	* gcc.dg/tree-ssa/builtins-folding-gimple-ub.c: Expect warnings.
      
      From-SVN: r247652
      Martin Sebor committed
    • * config.gcc (arm*-*-*): Add missing 'fi'. · 2d66253d
      From-SVN: r247650
      Nathan Sidwell committed
    • invoke.texi (-fopt-info): Explicitly say order of options included in -fopt-info does not matter. · b4a3af07
      2017-05-05  Steve Ellcey  <sellcey@cavium.com>
      
      	* doc/invoke.texi (-fopt-info): Explicitly say order of options
      	included in -fopt-info does not matter.
      	* doc/optinfo.texi (-fopt-info): Fix description of default
      	behavour. Explicitly say order of options included in -fopt-info
      	does not matter.
      
      From-SVN: r247648
      Steve Ellcey committed
    • [ARM] Allow combination of aprofile and rmprofile multilibs · 2f738ca5
      2017-05-05  Thomas Preud'homme  <thomas.preudhomme@arm.com>
      
          gcc/
          * config.gcc: Allow combinations of aprofile and rmprofile values for
          --with-multilib-list.
          * config/arm/t-multilib: New file.
          * config/arm/t-aprofile: Remove initialization of MULTILIB_*
          variables.  Remove setting of ISA and floating-point ABI in
          MULTILIB_OPTIONS and MULTILIB_DIRNAMES.  Set architecture and FPU in
          MULTI_ARCH_OPTS_A and MULTI_ARCH_DIRS_A rather than MULTILIB_OPTIONS
          and MULTILIB_DIRNAMES respectively.  Add comment to introduce all
          matches.  Add architecture matches for marvel-pj4 and generic-armv7-a
          CPU options.
          * config/arm/t-rmprofile: Likewise except for the matches changes.
          * doc/install.texi (--with-multilib-list): Document the combination of
          aprofile and rmprofile values and warn about pitfalls in doing that.
      
      From-SVN: r247646
      Thomas Preud'homme committed
    • call.c (make_temporary_var_for_ref_to_temp): Push decl into current scope. · 77fa3ec1
      	* call.c (make_temporary_var_for_ref_to_temp): Push decl into
      	current scope.
      	* lex.c (unqualified_name_lookup_error): Likewise.
      
      From-SVN: r247645
      Nathan Sidwell committed
    • class.c (alter_class): Use retrofit_lang_decl directly. · 7187a6c8
      	* class.c (alter_class): Use retrofit_lang_decl directly.
      	* decl.c (push_local_name, dupliate_decls): Likewise.
      	* semantics.c (omp_privatize_field): Likewise.
      
      From-SVN: r247644
      Nathan Sidwell committed
    • Float to int moves currently generate inefficient code due to hacks used in the… · 8e10223f
      Float to int moves currently generate inefficient code due to hacks used in the movsi and movdi patterns.
      
      Float to int moves currently generate inefficient code due to
      hacks used in the movsi and movdi patterns.  The 'r = w' variant
      uses '*' which tells the register allocator to ignore it.
      As a result the float to int moves typically spill to the stack,
      which is extremely inefficient.
      
          gcc/
      	* config/aarch64/aarch64.md (movsi_aarch64): Remove '*' from r=w.
      	(movdi_aarch64): Likewise.
      
      From-SVN: r247643
      Wilco Dijkstra committed
    • re PR tree-optimization/80632 (error: invalid PHI argument with -O2) · 8dc6a926
      	PR tree-optimization/80632
      	* tree-switch-conversion.c (struct switch_conv_info): Add target_vop
      	field.
      	(build_arrays): Initialize it for virtual phis.
      	(fix_phi_nodes): Use it for virtual phis.
      
      	* gcc.dg/pr80632.c: New test.
      
      From-SVN: r247642
      Jakub Jelinek committed
    • re PR tree-optimization/80558 (VRP not handling x & -2 well) · ac699a04
      	PR tree-optimization/80558
      	* tree-vrp.c (extract_range_from_binary_expr_1): Optimize
      	[x, y] op z into [x op, y op z] for op & or | if conditions
      	are met.
      
      	* gcc.dg/tree-ssa/vrp115.c: New test.
      
      From-SVN: r247641
      Jakub Jelinek committed
    • [ARM] PR71607: Fix ICE when loading constant · 655b5fc8
      2017-05-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>
                  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
      
          gcc/
          PR target/71607
          * config/arm/arm.md (use_literal_pool): Remove.
          (64-bit immediate split): No longer takes cost into consideration
          if arm_disable_literal_pool is enabled.
          * config/arm/arm.c (arm_tls_referenced_p): Add diagnostic if TLS is
          used when arm_disable_literal_pool is enabled.
          (arm_max_const_double_inline_cost): Remove use of
          arm_disable_literal_pool.
          (push_minipool_fix): Add assert.
          (arm_reorg): Add return if arm_disable_literal_pool is enabled.
          * config/arm/vfp.md (no_literal_pool_df_immediate): New.
          (no_literal_pool_sf_immediate): New.
      
      2017-05-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>
              Thomas Preud'homme  <thomas.preudhomme@arm.com>
              Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
      
          gcc/testsuite/
          PR target/71607
          * gcc.target/arm/thumb2-slow-flash-data.c: Renamed to ...
          * gcc.target/arm/thumb2-slow-flash-data-1.c: ... this.
          * gcc.target/arm/thumb2-slow-flash-data-2.c: New.
          * gcc.target/arm/thumb2-slow-flash-data-3.c: New.
          * gcc.target/arm/thumb2-slow-flash-data-4.c: New.
          * gcc.target/arm/thumb2-slow-flash-data-5.c: New.
          * gcc.target/arm/tls-disable-literal-pool.c: New.
      
      Co-Authored-By: Prakhar Bahuguna <prakhar.bahuguna@arm.com>
      Co-Authored-By: Thomas Preud'homme <thomas.preudhomme@arm.com>
      
      From-SVN: r247640
      Andre Vieira committed
    • Kill walk_namespaces. · b6263c5d
      	* cp-tree.h (walk_namespaces_fn, walk_namespaces): Delete.
      	* decl.c (walk_namespaces_r, walk_namespaces): Delete.
      
      From-SVN: r247638
      Nathan Sidwell committed
    • re PR tree-optimization/80613 (ICE in is_gimple_reg_type with -O2) · c02d2d0a
      2017-05-05  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
      
      	PR tree-optimization/80613
      	* tree-ssa-dce.c (propagate_necessity): Remove cases for
      	BUILT_IN_STRDUP and BUILT_IN_STRNDUP.
      
      testsuite/
      	* gcc.dg/tree-ssa/pr79697.c (k): Remove.
      
      From-SVN: r247635
      Prathamesh Kulkarni committed
    • tree-ssa-pre.c (get_or_alloc_expr_for): Simplify. · 79bed25b
      2017-05-05  Richard Biener  <rguenther@suse.de>
      
      	* tree-ssa-pre.c (get_or_alloc_expr_for): Simplify.
      
      From-SVN: r247634
      Richard Biener committed
    • Kill per-namespace static_decls. · 30318029
      	* cp-tree.h (static_decls): Declare.
      	(wrapup_globals_for_namespace)
      	diagnose_inline_vars_for_namespace): Replace with ...
      	(wrapup_namespace_globals): ... this.
      	* decl.c (static_decls): Define.
      	(wrapup_globals_for_namespace)
      	diagnose_inline_vars_for_namespace): Replace with ...
      	(wrapup_namespace_globals): ... this.
      	(cxx_init_decl_processing): Initialize static_decls.
      	* decl2.c (c_parse_final_cleanups): Adjust.
      	* name-lookup.h (cp_binding_level): Remove static_decls member.
      	* name-lookup.c (add_decl_to_level): Adjust.
      	(begin_scope): Adjust.
      ((--This line, and those below, will be ignored--
      
      M    cp/cp-tree.h
      M    cp/name-lookup.c
      M    cp/name-lookup.h
      M    cp/ChangeLog
      M    cp/decl2.c
      M    cp/decl.c
      
      From-SVN: r247633
      Nathan Sidwell committed
    • avr.md [...]: Remove any occurence of this flag from insn conditions due to removal from r247495. · f7142522
      	* config/avr/avr.md [flag_strict_overflow]: Remove any occurence
      	of this flag from insn conditions due to removal from r247495.
      
      From-SVN: r247632
      Georg-Johann Lay committed
    • Code scheduling for Cortex-A53 isn't as good as it could be. · 9d29ae83
      Code scheduling for Cortex-A53 isn't as good as it could be.  It turns out
      code runs faster overall if we place loads and stores with a dependency
      closer together.  To achieve this effect, this patch adds a bypass between
      cortex_a53_load1 and cortex_a53_load*/cortex_a53_store* if the result of an
      earlier load is used in an address calculation.  This significantly improved
      benchmark scores in a proprietary benchmark suite.
      
          gcc/
      	* config/arm/aarch-common.c (arm_early_load_addr_dep_ptr):
      	New function.
      	(arm_early_store_addr_dep_ptr): Likewise.
      	* config/arm/aarch-common-protos.h
      	(arm_early_load_addr_dep_ptr): Add prototype.
      	(arm_early_store_addr_dep_ptr): Likewise.
      	* config/arm/cortex-a53.md: Add new bypasses.
      
      From-SVN: r247631
      Wilco Dijkstra committed
    • re PR c++/71577 (ICE on invalid C++11 code (with extra struct initializer): in… · dfae9048
      re PR c++/71577 (ICE on invalid C++11 code (with extra struct initializer): in digest_init_r, at cp/typeck2.c:1117)
      
      /cp
      2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/71577
      	* decl.c (reshape_init): Unconditionally return error_mark_node
      	upon error about too many initializers.
      
      /testsuite
      2017-05-05  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/71577
      	* g++.dg/cpp0x/pr71577.C: New.
      
      From-SVN: r247630
      Paolo Carlini committed
    • tree.c (next_type_uid): Change type to unsigned. · 56871768
      	* tree.c (next_type_uid): Change type to unsigned.
      	(type_hash_canon): Decrement back next_type_uid if
      	freeing a type node with the highest TYPE_UID.  For INTEGER_TYPEs
      	also ggc_free TYPE_MIN_VALUE, TYPE_MAX_VALUE and TYPE_CACHED_VALUES
      	if possible.
      
      From-SVN: r247628
      Jakub Jelinek committed
    • Daily bump. · 18c182ff
      From-SVN: r247627
      GCC Administrator committed
  2. 04 May, 2017 12 commits
    • builtins.c: Fix a trivial typo in a comment. · ded507ae
      gcc/ChangeLog:
      	* builtins.c: Fix a trivial typo in a comment.
      
      From-SVN: r247623
      Martin Sebor committed
    • PR libstdc++/54924 - Warn for std::string constructor with wrong size · d9c5a8b9
      PR libstdc++/54924 - Warn for std::string constructor with wrong size
      PR middle-end/79234 - warn on past the end reads by library functions
      
      gcc/ChangeLog:
      
      	PR middle-end/79234
      	* builtins.c (check_sizes): Adjust to handle reading past the end.
      	Avoid printing excessive upper bound of ranges.  Use %E to print
      	tree nodes instead of converting them to %wu.
      	(expand_builtin_memchr): New function.
      	(compute_dest_size): Rename...
      	(compute_objsize): ...to this.
      	(expand_builtin_memcpy): Adjust.
      	(expand_builtin_mempcpy): Adjust.
      	(expand_builtin_strcat): Adjust.
      	(expand_builtin_strcpy): Adjust.
      	(check_strncat_sizes): Adjust.
      	(expand_builtin_strncat): Adjust.
      	(expand_builtin_strncpy): Adjust and simplify.
      	(expand_builtin_memset): Adjust.
      	(expand_builtin_bzero): Adjust.
      	(expand_builtin_memcmp): Adjust.
      	(expand_builtin): Handle memcmp.
      	(maybe_emit_chk_warning): Check strncat just once.
      
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/79234
      	* gcc.dg/builtin-stringop-chk-8.c: New test.
      	* gcc.dg/builtin-stringop-chk-1.c: Adjust.
      	* gcc.dg/builtin-stringop-chk-4.c: Same.
      	* gcc.dg/builtin-strncat-chk-1.c: Same.
      	* g++.dg/ext/strncpy-chk1.C: Same.
      	* g++.dg/torture/Wsizeof-pointer-memaccess1.C: Same.
      	* gcc.dg/out-of-bounds-1.c: Same.
      	* gcc.dg/pr78138.c: Same.
      	* gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Same.
      	* gfortran.dg/mvbits_7.f90: Same.
      
      From-SVN: r247622
      Martin Sebor committed
    • Fix a typo. · 0f3587ec
      From-SVN: r247619
      Martin Sebor committed
    • PR preprocessor/79214 - -Wno-system-header defeats strncat buffer overflow warnings · e50d56a5
      PR preprocessor/79214 -  -Wno-system-header defeats strncat buffer overflow warnings
      PR middle-end/79222 - missing -Wstringop-overflow= on a stpcpy overflow
      PR middle-end/79223 - missing -Wstringop-overflow on a memmove overflow
      
      gcc/ChangeLog:
      
      	PR preprocessor/79214
      	PR middle-end/79222
      	PR middle-end/79223
      	* builtins.c (check_sizes): Add inlinining context and issue
      	warnings even when -Wno-system-headers is set.
      	(check_strncat_sizes): Same.
      	(expand_builtin_strncat): Same.
      	(expand_builtin_memmove): New function.
      	(expand_builtin_stpncpy): Same.
      	(expand_builtin): Handle memmove and stpncpy.
      
      gcc/testsuite/ChangeLog:
      
      	PR preprocessor/79214
      	PR middle-end/79222
      	PR middle-end/79223
      	* gcc.dg/pr79214.c: New test.
      	* gcc.dg/pr79214.h: New test header.
      	* gcc.dg/pr79222.c: New test.
      	* gcc.dg/pr79223.c: New test.
      	* gcc.dg/pr78138.c: Adjust.
      	* gfortran.dg/unconstrained_commons.f: Same.
      
      From-SVN: r247618
      Martin Sebor committed
    • * constraint.cc (diagnose_check_constraint): Fix %E thinko. · 0f05d905
      From-SVN: r247614
      Nathan Sidwell committed
    • tree-ssa-loop-ivopts.c (struct cost_pair): Remove field inv_expr which is not used any more. · 7e887487
      	* tree-ssa-loop-ivopts.c (struct cost_pair): Remove field inv_expr
      	which is not used any more.
      
      From-SVN: r247612
      Bin Cheng committed
    • Many supported cores use the AUTOPREFETCHER_WEAK setting which tries to order... · 3b4c0f7e
      Many supported cores use the AUTOPREFETCHER_WEAK setting which tries
      to order loads and stores to improve streaming performance.  Since significant
      gains were reported in http://patchwork.ozlabs.org/patch/534469/ it seems
      like a good idea to enable this setting too for -mcpu=generic.  Since the
      weak model only keeps the order if it doesn't make the schedule worse, it
      should not impact performance adversely on cores that don't show a gain.
      
          gcc/
              * config/aarch64/aarch64.c (generic_tunings): Update prefetch model.
      
      From-SVN: r247610
      Wilco Dijkstra committed
    • Set jump alignment to 4 for Cortex cores as it reduces codesize by 0.4% on... · 9779b2e8
      Set jump alignment to 4 for Cortex cores as it reduces codesize by 0.4% on
      average with no obvious performance difference.  See original discussion of
      the overheads of various alignments:
      https://gcc.gnu.org/ml/gcc-patches/2016-06/msg02075.html.
      
          gcc/
      	* config/aarch64/aarch64.c (cortexa35_tunings): Set jump alignment to 4.
      	(cortexa53_tunings): Likewise.
      	(cortexa57_tunings): Likewise.
      	(cortexa72_tunings): Likewise.
      	(cortexa73_tunings): Likewise.
      
      From-SVN: r247609
      Wilco Dijkstra committed
    • With -mcpu=generic the loop alignment is currently 4. · 6b13482b
      With -mcpu=generic the loop alignment is currently 4.  All but one of the
      supported cores use 8 or higher.  Since using 8 provides performance gains
      on several cores, it is best to use that by default.  As discussed in [1],
      the jump alignment has no effect on performance, yet has a relatively high
      codesize cost [2], so setting it to 4 is best.  This gives a 0.2% overall
      codesize improvement as well as performance gains in several benchmarks.
      
          gcc/
      	* config/aarch64/aarch64.c (generic_tunings): Set jump alignment to 4.
      	Set loop alignment to 8.
      
      [1] https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00574.html
      [2] https://gcc.gnu.org/ml/gcc-patches/2016-06/msg02075.html
      
      From-SVN: r247608
      Wilco Dijkstra committed
    • PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c · 0f2c4a8f
      gcc/c-family/ChangeLog:
      
      	PR translation/80280
      	* c-attribs.c (handle_alias_ifunc_attribute): Quote a %D directive.
      	(handle_weakref_attribute): Same.
      
      PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c
      
      gcc/ChangeLog:
      
      	PR translation/80280
      	* config/i386/i386.c (ix86_function_versions): Quote a %D directive.
      
      PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c
      
      gcc/cp/ChangeLog:
      
      	PR translation/80280
      	* call.c (print_z_candidate): Add missing quoting to %D and other
      	like directives.
      	(build_op_call_1): Same.
      	* constraint.cc (diagnose_check_constraint): Same.
      	* mangle.c (mangle_decl): Same.
      	* name-lookup.c (cp_binding_level_debug): Same.
      	(set_decl_namespace): Same.
      	* parser.c (cp_parser_tx_qualifier_opt): Same.
      	* pt.c (print_candidates_1): Same.
      	(check_template_variable): Same.
      	(tsubst_default_argument): Same.
      	(most_specialized_partial_spec): Same.
      	* semantics.c (omp_reduction_lookup): Same.
      	* tree.c (check_abi_tag_redeclaration): Same.
      	* typeck.c (comptypes): Same.
      	* typeck2.c (abstract_virtuals_error_sfinae): Same.
      
      PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c
      
      gcc/ChangeLog:
      
      	PR translation/80280
      	* builtins.c (expand_builtin_object_size): Add missing quoting to
      	%D and like directives.
      	* hsa-gen.c (hsa_type_for_scalar_tree_type): Same.
      	(hsa_type_for_tree_type): Same.
      	(verify_function_arguments): Same.
      	* symtab.c (symbol_table::change_decl_assembler_name): Same.
      	* varasm.c (get_section): Same.
      	(mark_weak): Same.
      
      PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c
      
      gcc/objc/ChangeLog:
      
      	PR translation/80280
      	* objc-gnu-runtime-abi-01.c (objc_eh_runtime_type): Add missing
      	quoting to directives.
      	* objc-next-runtime-abi-01.c (objc_eh_runtime_type): Ditto.
      	* objc-next-runtime-abi-02.c (next_runtime_02_eh_type): Ditto.
      
      PR translation/80280 - Missing closing quote (%>) c/semantics.c and c/c-typeck.c
      
      gcc/testsuite/ChangeLog:
      
      	PR translation/80280
      	* g++.dg/abi/Wabi-2-3.C: Adjust.
      	* g++.dg/abi/Wabi-3-2.C: Ditto.
      	* g++.dg/lookup/using17.C: Ditto.
      	* gcc.dg/format/gcc_diag-1.c (foo): Ditto.
      
      From-SVN: r247607
      Martin Sebor committed
    • All cores which add a cpu_addrcost_table use a non-zero value for HI and TI... · 2fae724a
      All cores which add a cpu_addrcost_table use a non-zero value for
      HI and TI mode shifts (a non-zero value for general indexing also
      applies to all shifts).  Given this, it makes no sense to use a
      different setting in generic_addrcost_table.  So change it so that
      all supported cores, including -mcpu=generic, now generate the same:
      
      int f(short *p, short *q, long x) { return p[x] + q[x]; }
      
              lsl     x2, x2, 1
              ldrsh   w3, [x0, x2]
              ldrsh   w0, [x1, x2]
              add     w0, w3, w0
              ret
      
          gcc/
      	* config/aarch64/aarch64.c (generic_addrcost_table):
      	Change HI/TI mode setting.
      
      From-SVN: r247606
      Wilco Dijkstra committed
    • [PR 80622] Treat const pools as initialized in SRA · 8eef6097
      2017-05-04  Martin Jambor  <mjambor@suse.cz>
      
      	PR tree-optimization/80622
      	* tree-sra.c (comes_initialized_p): New function.
      	(build_accesses_from_assign): Only set write lazily when
      	comes_initialized_p is false.
      	(analyze_access_subtree): Use comes_initialized_p.
      	(propagate_subaccesses_across_link): Assert !comes_initialized_p
      	instead of testing for PARM_DECL.
      
      testsuite/
      	* gcc.dg/tree-ssa/pr80622.c: New test.
      
      From-SVN: r247604
      Martin Jambor committed