1. 19 Dec, 2017 23 commits
  2. 18 Dec, 2017 17 commits
    • PR middle-end/83373 - False positive reported by -Wstringop-overflow · 06199618
      PR middle-end/83373 - False positive reported by -Wstringop-overflow
      PR tree-optimization/78450 - strlen(s) return value can be assumed to be less than the size of s
      
      gcc/ChangeLog:
      
      	PR middle-end/83373
      	PR tree-optimization/78450
      	* tree-ssa-strlen.c (maybe_set_strlen_range): New function.
      	(handle_builtin_strlen): Call it.
      
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/83373
      	PR tree-optimization/78450
      	* gcc.dg/pr83373.c: New test.
      	* gcc.dg/strlenopt-36.c: New test.
      	* gcc.dg/strlenopt-37.c: New test.
      
      From-SVN: r255790
      Martin Sebor committed
    • re PR libstdc++/80761 (std::set<T,C,A>::insert_return_type uses wrong iterator type) · adaefe2a
      2017-11-20  François Dumont  <fdumont@gcc.gnu.org>
      
      	PR libstdc++/80761
      	* include/debug/map.h
      	(std::__debug::map<>::insert_return_type): Define using
      	_Node_insert_return.
      	* include/debug/set.h (std::__debug::set<>::insert_return_type):
      	Likewise.
      	* include/debug/unordered_map:
      	(std::__debug::unordered_map<>::insert_return_type): Likewise.
      	* include/debug/unordered_set:
      	(std::__debug::unordered_set<>::insert_return_type): Likewise.
      
      From-SVN: r255789
      François Dumont committed
    • re PR c++/83116 (Statement with no effect causes wrong code of static object constexpr method) · 4a58d2fe
      	PR c++/83116
      	* constexpr.c (cxx_eval_call_expression): Only look into
      	constexpr_call_table if ctx->strict.
      
      	* g++.dg/cpp1y/constexpr-83116.C: New test.
      
      From-SVN: r255788
      Marek Polacek committed
    • rtlanal: dead_or_set_regno_p should handle CLOBBER (PR83424) · aa8ec7fb
      In PR83424 combine's move_deaths puts a REG_DEAD note in the wrong place
      because dead_or_set_regno_p does not account for CLOBBER insns.  This
      fixes it.
      
      
      	PR rtl-optimization/83424
      	* rtlanal.c (dead_or_set_regno_p): Handle CLOBBER just like SET.
      
      gcc/testsuite/
      	PR rtl-optimization/83424
      	* gcc.dg/pr83424.c: New testsuite.
      
      From-SVN: r255787
      Segher Boessenkool committed
    • testsuite: add coverage for diagnostics relating to inlining (PR tree-optimization/83336) · ab6e54a6
      In theory, the diagnostics subsystem can print context information on
      code inlining when diagnostics are emitted by the middle-end, describing
      the chain of inlined callsites that led to a particular warning,
      but PR tree-optimization/83336 describes various issues with this.
      
      An underlying issue is that we have very little automated testing for
      this code: gcc.dg/tm/pr52141.c has a test, but in general, prune.exp
      filters out the various "inlined from" lines.
      
      The following patch adds test coverage for it for C and C++ via a new
      testsuite plugin, which emits a warning from the middle-end; the test
      cases use dg-regexp to verify that the "inlined from" lines are
      emitted correctly, with the correct function names and source locations.
      
      Doing so requires a change to prune.exp: the dg-regexp lines have to
      be handled *before* the "inlined from" lines are stripped.
      
      gcc/testsuite/ChangeLog:
      	PR tree-optimization/83336
      	* g++.dg/cpp0x/missing-initializer_list-include.C: Update for
      	changes to prune.exp's handling of dg-regexp.
      	* g++.dg/plugin/diagnostic-test-inlining-1.C: New test case.
      	* g++.dg/plugin/plugin.exp (plugin_test_list): Add it, via
      	gcc.dg's plugin/diagnostic_plugin_test_inlining.c.
      	* gcc.dg/plugin/diagnostic-test-inlining-1.c: New test case.
      	* gcc.dg/plugin/diagnostic-test-inlining-2.c: Likewise.
      	* gcc.dg/plugin/diagnostic-test-inlining-3.c: Likewise.
      	* gcc.dg/plugin/diagnostic-test-inlining-4.c: Likewise.
      	* gcc.dg/plugin/diagnostic_plugin_test_inlining.c: New test
      	plugin.
      	* gcc.dg/plugin/plugin.exp (plugin_test_list): Add them.
      	* lib/prune.exp (prune_gcc_output): Move call to handle-dg-regexps
      	to before the various text stripping regsup invocations,
      	in particular, to before the stripping of "inlined from".
      
      From-SVN: r255786
      David Malcolm committed
    • re PR libstdc++/68430 (std::is_constructible<T>::value == true for unconstructible type T) · 5dd44f4e
      PR libstdc++/68430
      
      * testsuite/20_util/is_constructible/68430.cc: New.
      
      From-SVN: r255785
      Ville Voutilainen committed
    • re PR middle-end/83460 (FAIL: g++.dg/pr79095-4.C) · 59024129
      	PR middle-end/83460
      	* g++.dg/pr79095-4.C: Remove compromised test.
      
      From-SVN: r255784
      Jeff Law committed
    • re PR c++/83300 (Segmentation fault with template and __attribute__((vector_size… · 58cc7d79
      re PR c++/83300 (Segmentation fault with template and __attribute__((vector_size (sizeof(int) * N)));)
      
      	PR c++/83300
      	* decl2.c (save_template_attributes): Add flags argument, if
      	not ATTR_FLAG_TYPE_IN_PLACE, *decl_p is a type and we want to
      	modify TYPE_ATTRIBUTES, add them on type attribute variant.
      
      	* g++.dg/ext/vector33.C: New test.
      
      From-SVN: r255783
      Jakub Jelinek committed
    • c-warn.c (warn_logical_operator): Return early if -Wlogical-op is not in effect. · 82cfbd01
      	* c-warn.c (warn_logical_operator): Return early if -Wlogical-op is
      	not in effect.
      
      From-SVN: r255782
      Marek Polacek committed
    • re PR middle-end/83463 (ICE: tree check: expected integer_type or enumeral_type… · 066fc751
      re PR middle-end/83463 (ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have pointer_type in builtin_memr ef, at gimple-ssa-warn-restrict.c:297)
      
      	PR middle-end/83463
      	* gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref):
      	Check if TYPE is INTEGRAL_TYPE_P before accessing its min/max
      	values.
      
      	* gcc.dg/pr83463.c: New test.
      
      From-SVN: r255781
      Marek Polacek committed
    • [PR c++/59930] template friend injection · 02c7dd78
      https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01168.html
      	PR c++/59930
      	* name-lookup.c (name_lookup::search_unqualified): Don't search
      	parent namespace when looking for hidden things.
      	* pt.c (tsubst_friend_class): Always push to friend scope, drop
      	unneeded self-friend check. Inject new hidden friend into correct
      	scope.
      
      	PR c++/59930
      	* g++.dg/parse/pr81247-c.C: Adjust.
      	* g++.dg/template/pr59930-[123].C: New.
      
      From-SVN: r255780
      Nathan Sidwell committed
    • [ARC] Update (u)maddsidi patterns. · 0cf0bc67
      The accumulator registers are freely used by the compiler. However,
      there are a number of instructions which are having an intrinsic use
      of these registers. Update patterns to inform the compiler which ones.
      
      gcc/
      2017-09-19  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/arc.md (maddsidi4, maddsidi4_split): Update pattern.
      	(umaddsidi4,umaddsidi4): Likewise.
      
      gcc/testsuite
      2017-09-19  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* gcc.target/arc/tumaddsidi4.c: New test.
      
      From-SVN: r255779
      Claudiu Zissulescu committed
    • [ARC] Update legitimate constant hook. · 2bd36eba
      Make sure we check the constants in all cases.
      
      gcc/
      2017-10-14  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* config/arc/arc.c (arc_legitimate_constant_p): Always check all
      	constants.
      
      testsuite/
      2017-10-14  Claudiu Zissulescu  <claziss@synopsys.com>
      
      	* gcc.target/arc/tls-1.c: New test.
      
      From-SVN: r255778
      Claudiu Zissulescu committed
    • S/390: PR83420: Improve hotpatch option parsing. · 4aeba1b7
      With the attached patch we get rid of the following build failure:
      
      /home/andreas/build/../gcc/gcc/config/s390/s390.c: In function ‘void
      s390_option_override()’:
      /home/andreas/build/../gcc/gcc/config/s390/s390.c:15361:16: error: ‘char*
      strncpy(char*, const char*, size_t)’ specified bound 256 equals destination
      size [-Werror=stringop-truncation]
              strncpy (s, opt->arg, 256);
              ~~~~~~~~^~~~~~~~~~~~~~~~~~
      
      gcc/ChangeLog:
      
      2017-12-18  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
      
      	PR target/83420
      	* config/s390/s390.c (s390_option_override): Avoid strncpy.
      
      From-SVN: r255777
      Andreas Krebbel committed
    • re PR ipa/81877 (Incorrect results with lto and -fipa-cp and -fipa-cp-clone) · bcfaa720
      2017-12-18  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/81877
      	* tree-ssa-loop-im.c (ref_indep_loop_p): Remove safelen parameters.
      	(outermost_indep_loop): Adjust.
      	(ref_indep_loop_p_1): Likewise.  Remove safelen handling again.
      	(can_sm_ref_p): Adjust.
      
      	* g++.dg/torture/pr81877.C: New testcase.
      	* g++.dg/vect/pr70729.cc: XFAIL.
      	* g++.dg/vect/pr70729-nest.cc: XFAIL.
      
      From-SVN: r255776
      Richard Biener committed
    • re PR tree-optimization/77291 (False positive for -Warray-bounds) · 8c3563f3
      2017-12-18  Richard Biener  <rguenther@suse.de>
      
      	PR middle-end/77291
      	* tree.c (array_at_struct_end_p): Return true if the underlying
      	object has space for at least one element in excess of what
      	the array domain specifies.
      
      	* gcc.dg/Warray-bounds-26.c: New testcase.
      
      From-SVN: r255775
      Richard Biener committed
    • extend.texi (x86 Function Attributes): Reformat nocf_check example to avoid overfull hbox. · 040a4493
      2017-12-17  Sandra Loosemore  <sandra@codesourcery.com>
      
      	gcc/
      	* doc/extend.texi (x86 Function Attributes): Reformat nocf_check
      	example	to avoid overfull hbox.
      	* doc/invoke.texi (Option Summary): Add missing @gol.
      	(C++ Dialect Options): Reformat -Wnoexcept-type example to avoid 
      	overfull hbox.
      
      From-SVN: r255774
      Sandra Loosemore committed