1. 31 Aug, 2018 6 commits
  2. 30 Aug, 2018 21 commits
  3. 29 Aug, 2018 13 commits
    • re PR middle-end/87053 (wrong code with c_strlen) · 1ebf0641
      gcc:
      2018-08-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
      	PR middle-end/87053
      	* builtins.c (c_strlen): Improve range checks.
      
      testsuite:
      2018-08-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
      	PR middle-end/87053
      	* gcc.c-torture/execute/pr87053.c: New test.
      
      From-SVN: r263968
      Bernd Edlinger committed
    • re PR sanitizer/87095 (UndefinedBehaviorSanitizer vptr false positive with… · d66ab7d1
      re PR sanitizer/87095 (UndefinedBehaviorSanitizer vptr false positive with virtual inheritance only with -fno-sanitize-recover)
      
      	PR c++/87095
      	* decl.c (begin_destructor_body): If current_class_type has
      	virtual bases and the primary base is nearly empty virtual base,
      	voidify clearing of vptr and make it conditional on in-charge
      	argument.
      
      	* g++.dg/ubsan/vptr-13.C: New test.
      
      From-SVN: r263967
      Jakub Jelinek committed
    • re PR c++/85265 ([concepts] ICE with missing identifier) · 849ec6ca
      /cp
      2018-08-29  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/85265
      	* parser.c (cp_parser_introduction_list): If cp_parser_identifier
      	returns error_mark_node early exit the loop.
      	(cp_parser_template_introduction): Improve error-recovery, remove
      	error call about empty introduction-list.
      
      /testsuite
      2018-08-29  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/85265
      	* g++.dg/concepts/pr85265.C: New.
      
      From-SVN: r263966
      Paolo Carlini committed
    • re PR middle-end/86714 (tree-ssa-forwprop.c confused by too long initializer) · e84bf0ef
      	PR tree-optimization/86714
      	PR tree-optimization/86711
      	* builtins.c (c_strlen): Add arguments to call to string_constant.
      	* expr.c (string_constant): Add argument.  Detect missing nul
      	terminator and outermost declaration it's missing in.
      	* expr.h (string_constant): Add argument.
      	* fold-const.c (read_from_constant_string): Add arguments to call to
      	string_constant.
      	(c_getstr): Likewise.
      	* tree-ssa-forwprop.c (simplify_builtin_call): Likewise.
      	to string_constant.
      	* tree-ssa-strlen.c (get_stridx): Likewise.
      
      	PR tree-optimization/86714
      	PR tree-optimization/86711
      	* gcc.c-torture/execute/memchr-1.c: New test.
      	* gcc.c-torture/execute/pr86714.c: New test.
      	* gcc.c-torture/execute/widechar-3.c: New test.
      	* gcc.dg/strlenopt-58.c: New test.
      
      Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>
      Co-Authored-By: Jeff Law <law@redhat.com>
      
      From-SVN: r263963
      Martin Sebor committed
    • tree-streamer-in.c (lto_input_ts_function_decl_tree_pointers): Do not stream DECL_VINDEX. · b9a0baa9
      
      	* tree-streamer-in.c (lto_input_ts_function_decl_tree_pointers):
      	Do not stream DECL_VINDEX.
      	* tree-streamer-out.c (write_ts_function_decl_tree_pointers): Likewise.
      	* tree.c (free_lang_data_in_decl): Clear DECL_VINDEX.
      	(decl_function_context): Use DECL_VIRTUAL_P rather than DECL_VINDEX.
      
      From-SVN: r263962
      Jan Hubicka committed
    • tree-ssa-sccvn.c (vuse_ssa_val): Return NULL for unvisited virtual operands that… · d176b500
      tree-ssa-sccvn.c (vuse_ssa_val): Return NULL for unvisited virtual operands that are not default defs to honor...
      
      2018-08-29  Richard Biener  <rguenther@suse.de>
      
      	* tree-ssa-sccvn.c (vuse_ssa_val): Return NULL for unvisited
      	virtual operands that are not default defs to honor region
      	boundaries.
      	(rpo_vn_valueize): Remove ineffective code here.
      
      From-SVN: r263960
      Richard Biener committed
    • re PR tree-optimization/87132 (Gcc miscompiles at -O2 on valid code) · 8f70fdc3
      2018-08-29  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/87132
      	* tree-ssa-alias.c (get_continuation_for_phi): Do not translate
      	when skipping defs reachable over backedges.
      
      	* gcc.dg/torture/pr87132.c: New testcase.
      
      From-SVN: r263959
      Richard Biener committed
    • tree-core.h: Document use of deprecated_flag in SSA_NAME. · 6214d5c7
      2018-08-29  Richard Biener  <rguenther@suse.de>
      
      	* tree-core.h: Document use of deprecated_flag in SSA_NAME.
      	* tree.h (SSA_NAME_POINTS_TO_READONLY_MEMORY): Define.
      	* tree-into-ssa.c (pass_build_ssa::execute): Initialize
      	function parameters SSA_NAME_POINTS_TO_READONLY_MEMORY from fnspec.
      	* tree-ssa-sccvn.c (const_parms, init_const_parms): Remove.
      	(vn_reference_lookup_3): Remove use of const_parms.
      	(free_rpo_vn): Do not free const_parms.
      	(do_rpo_vn): Do not call init_const_parms.
      	* tree-ssa-alias.c (refs_may_alias_p_1): Honor
      	SSA_NAME_POINTS_TO_READONLY_MEMORY.
      	(call_may_clobber_ref_p_1): Likewise.
      
      From-SVN: r263958
      Richard Biener committed
    • C++: underline param in print_conversion_rejection (more PR c++/85110) · 66e58259
      Consider this bogus code (from g++.dg/diagnostic/param-type-mismatch-2.C):
      
      struct s4 { static int member_1 (int one, const char **two, float three); };
      
      int test_4 (int first, const char *second, float third)
      {
        return s4::member_1 (first, second, third);
      }
      
      Before this patch, g++ emits:
      
      demo.cc: In function 'int test_4(int, const char*, float)':
      demo.cc:5:44: error: no matching function for call to 's4::member_1(int&, const char*&, float&)'
      5 |   return s4::member_1 (first, second, third);
        |                                            ^
      demo.cc:1:24: note: candidate: 'static int s4::member_1(int, const char**, float)'
      1 | struct s4 { static int member_1 (int one, const char **two, float three); };
        |                        ^~~~~~~~
      demo.cc:1:24: note:   no known conversion for argument 2 from 'const char*' to 'const char**'
      
      With this patch, it highlights the pertinent parameter in the
      "no known conversion" note:
      
      demo.cc: In function 'int test_4(int, const char*, float)':
      demo.cc:5:44: error: no matching function for call to 's4::member_1(int&, const char*&, float&)'
      5 |   return s4::member_1 (first, second, third);
        |                                            ^
      demo.cc:1:24: note: candidate: 'static int s4::member_1(int, const char**, float)'
      1 | struct s4 { static int member_1 (int one, const char **two, float three); };
        |                        ^~~~~~~~
      demo.cc:1:56: note:   no known conversion for argument 2 from 'const char*' to 'const char**'
      1 | struct s4 { static int member_1 (int one, const char **two, float three); };
        |                                           ~~~~~~~~~~~~~^~~
      
      gcc/cp/ChangeLog:
      	PR c++/85110
      	* call.c (print_conversion_rejection): Add "fn" param and use it
      	for "no known conversion" messages to underline the pertinent
      	param.
      	(print_z_candidate): Supply "fn" to the new param above.
      
      gcc/testsuite/ChangeLog:
      	PR c++/85110
      	* g++.dg/diagnostic/param-type-mismatch-2.C: Update expected
      	output to reflect underlining of pertinent parameter in decl
      	for "no known conversion" messages.
      
      From-SVN: r263957
      David Malcolm committed
    • doc: document -ftree-scev-cprop · 1ca7a4d4
      	PR other/86726
      	* invoke.texi (Optimization Options): List -ftree-scev-cprop.
      	(-O): Ditto.
      	(-ftree-scev-cprop): Document.
      
      From-SVN: r263955
      Alexander Monakov committed
    • re PR c++/87122 (ICE in tsubst_decomp_names) · f5b219cc
      	PR c++/87122
      	* pt.c (tsubst_expr) <case RANGE_FOR_STMT>: If
      	processing_template_decl and decl is structured binding decl, call
      	cp_finish_decomp.
      
      	* g++.dg/cpp1z/decomp47.C: New test.
      
      From-SVN: r263953
      Jakub Jelinek committed
    • sreal.h (normalize, [...]): Add new_sig/new_exp parameters. · 7a1ce632
      
      	* sreal.h (normalize, normalize_up, normalize_down): Add new_sig/new_exp
      	parameters.
      	(sreal constructor): Update.
      	* sreal.c (sreal:operator+, sreal:operator-, sreal:operator*,
      	sreal:operator/): Update.
      
      From-SVN: r263952
      Jan Hubicka committed
    • Fix thinko in lto.c (PR bootstrap/87130). · 9ed6dbee
      2018-08-29  Martin Liska  <mliska@suse.cz>
      
      	PR bootstrap/87130
      	* lto.c (read_cgraph_and_symbols): Fix thinko, revert
      	to behavior before r263887.
      
      From-SVN: r263950
      Martin Liska committed