1. 30 Aug, 2018 6 commits
  2. 29 Aug, 2018 23 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
    • MAINTAINERS (write after approval): Add myself. · e8a0276c
      2018-08-29  Vlad Lazar  <vlad.lazar@arm.com>
      
      	* MAINTAINERS (write after approval): Add myself.
      
      From-SVN: r263949
      Vlad Lazar committed
    • PR libstdc++/31413 fix test failure on Debian systems · 9111b083
      Debian uses a different D_FMT string for the zh_TW.UTF-8 locale, which
      caused this test to fail. Try to detect the Debian format and adjust
      the input being tested.
      
      	PR libstdc++/31413
      	* testsuite/22_locale/time_get/get_date/wchar_t/4.cc: Check D_FMT
      	string for alternative format.
      
      From-SVN: r263948
      Jonathan Wakely committed
    • Strenghten assumption about gswitch statements. · fb9cb536
      2018-08-29  Martin Liska  <mliska@suse.cz>
      
      	* tree-switch-conversion.c (switch_conversion::expand):
      	Strenghten assumption about gswitch statements.
      
      From-SVN: r263947
      Martin Liska committed
    • [AARCH64] Use stdint integers in vect_su_add_sub.c · aac8c550
      2018-08-29  Matthew Malcomson  <matthew.malcomson@arm.com>
      
      	* gcc.target/aarch64/simd/vect_su_add_sub.c: Use 32 and 64-bit types
      	where appropriate.
      
      From-SVN: r263946
      Matthew Malcomson committed
    • re PR tree-optimization/87117 (ICE in… · 95f0c816
      re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool) at gcc/gcc/tree-ssa-sccvn.c:5431 since r263875)
      
      2018-08-29  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/87117
      	* tree-ssa-sccvn.c (eliminate_dom_walker::eliminate_stmt): Only
      	re-value-number released SSA VDEFs.
      
      	* gfortran.dg/pr87117.f90: New testcase.
      
      From-SVN: r263945
      Richard Biener committed
    • re PR tree-optimization/87126 (ICE on valid code at -Os and above on… · e37f7da9
      re PR tree-optimization/87126 (ICE on valid code at -Os and above on x86_64-linux-gnu: in vn_reference_insert, at tree-ssa-sccvn.c:2698)
      
      2018-08-29  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/87126
      	* tree-ssa-sccvn.c (vn_reference_insert): Remove assert.
      
      	* gcc.dg/tree-ssa/pr87126.c: New testcase.
      
      From-SVN: r263944
      Richard Biener committed
    • Rewrite pic.md to improve medany and pic code size. · efc60124
      	gcc/
      	* config/riscv/pic.md: Rewrite.
      	* config/riscv/riscv.c (riscv_address_insns): Return cost of 3 for
      	invalid address.
      	* config/riscv/riscv.md (ZERO_EXTEND_LOAD): Delete.
      	(SOFTF, default_load, softload, softstore): New.
      
      From-SVN: r263943
      Jim Wilson committed
    • remove utf-8 from comment · 37170829
      From-SVN: r263942
      Jason Merrill committed
    • compiler, runtime: remove hmap field from maptypes · 347462bf
          
          This is the gofrontend version of https://golang.org/cl/91796.
          
          This is part of that CL, just the compiler change and required runtime
          changes, in preparation for updating libgo to 1.11.
          
          Relevant part of original CL description:
          
              The hmap field in the maptype is only used by the runtime to check the sizes of
              the hmap structure created by the compiler and runtime agree.
          
              Comments are already present about the hmap structure definitions in the
              compiler and runtime needing to be in sync.
          
          Reviewed-on: https://go-review.googlesource.com/130976
      
      From-SVN: r263941
      Ian Lance Taylor committed
    • Daily bump. · d16c446e
      From-SVN: r263940
      GCC Administrator committed
  3. 28 Aug, 2018 11 commits
    • * fold-const.c (fold_binary_loc): Remove recently added assert. · 78e93935
      From-SVN: r263936
      Jeff Law committed
    • genpreds.c (write_predicate_subfunction): Also add ATTRIBUTE_UNUSED to OP… · d0794d14
      genpreds.c (write_predicate_subfunction): Also add ATTRIBUTE_UNUSED to OP parmeter of generated function.
      
              * genpreds.c (write_predicate_subfunction): Also add ATTRIBUTE_UNUSED
              to OP parmeter of generated function.
      
      From-SVN: r263934
      Joern Rennecke committed
    • re PR middle-end/87009 (Can't find XOR pattern applying De Morgan sequentially) · fd8303a5
      	PR tree-optimization/87009
      	* match.pd: Add boolean optimizations.
      
      	PR tree-optimization/87009
      	* gcc.dg/pr87009.c: New test.
      
      From-SVN: r263931
      MCC CS committed
    • re PR middle-end/86631 (missing -Walloc-size-larger-than on ILP32 hosts) · 96c19db5
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/86631
      	* g++.dg/Walloca1.C: Adjust.
      
      From-SVN: r263930
      Martin Sebor committed
    • PR middle-end/86631 - missing -Walloc-size-larger-than on ILP32 hosts · 0aaafa5e
      gcc/ChangeLog:
      
      	PR middle-end/86631
      	* calls.c (alloc_max_size): Treat HOST_WIDE_INT special.
      	* gimple-ssa-warn-alloca.c (adjusted_warn_limit): New function.
      	(pass_walloca::gate): Use it.
      	(alloca_call_type): Same.
      	(pass_walloca::execute): Same.
      	* stor-layout.c (layout_decl): Treat HOST_WIDE_INT special.
      
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/86631
      	* g++.dg/Walloca1.C: Adjust.
      
      From-SVN: r263928
      Martin Sebor committed
    • PR libstdc++/87116 fix path::lexically_normal() handling of dot-dot · dd35da2c
      Previously the logic that turned "a/b/c/../.." into "a/" failed to
      preserve an empty path at the end of the iteration sequence, as required
      by the trailing slash. That meant the result didn't meet the class
      invariants, and that "a/b/c/d/../../.." would remove four components
      instead of the three that "../../.." should remove.
      
      	PR libstdc++/87116
      	* src/filesystem/std-path.cc (path::lexically_normal): When handling
      	a dot-dot filename, preserve an empty final component in the iteration
      	sequence.
      	[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Use preferred-separator for
      	root-directory.
      	* testsuite/27_io/filesystem/path/generation/normal.cc: Add new tests
      	for more than two adjacent dot-dot filenames.
      	[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Replace slashes with
      	preferred-separator in expected normalized strings.
      
      From-SVN: r263922
      Jonathan Wakely committed
    • re PR c++/86546 (ICE on invalid: tree_class_check_failed()) · f30bafb7
      /cp
      2018-08-28  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/86546
      	* decl.c (finish_case_label): If the type is erroneous early
      	return error_mark_node.
      
      /testsuite
      2018-08-28  Paolo Carlini  <paolo.carlini@oracle.com>
      
      	PR c++/86546
      	* g++.dg/other/switch4.C: New.
      
      From-SVN: r263921
      Paolo Carlini committed
    • Fix version check for ATTRIBUTE_GCC_DUMP_PRINTF · 19784080
      gcc/ChangeLog:
      	* dumpfile.h (ATTRIBUTE_GCC_DUMP_PRINTF): Change version check on
      	GCC_VERSION for usage of "__gcc_dump_printf__" format from
      	>= 3005 to >= 9000.
      
      From-SVN: r263920
      David Malcolm committed
    • re PR tree-optimization/87124 (ICE have integer_cst in SSA_VAL, at… · 49aecbeb
      re PR tree-optimization/87124 (ICE have integer_cst in SSA_VAL, at tree-ssa-sccvn.c:462 while building 541.leela_r from SPEC2017)
      
      2018-08-28  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/87124
      	* tree-ssa-sccvn.c (vn_lookup_simplify_result): Guard against
      	constants before looking up avail.
      
      	* g++.dg/torture/pr87124.C: New testcase.
      
      From-SVN: r263918
      Richard Biener committed
    • re PR fortran/80477 ([OOP] Polymorphic function result generates memory leak) · 1312bb90
      2017-08-28  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/80477
      	* trans-expr.c (gfc_conv_procedure_call): Allocatable class
      	scalar results being passed to a derived type formal argument
      	are finalized if possible. Otherwise, rely on existing code for
      	deallocation. Make the deallocation of allocatable result
      	components conditional on finalization not taking place. Make
      	the freeing of data components after finalization conditional
      	on the data being NULL.
      	(gfc_trans_arrayfunc_assign): Change the gcc_assert to a
      	condition to return NULL_TREE.
      	(gfc_trans_assignment_1): If the assignment is class to class
      	and the rhs expression must be finalized but the assignment
      	is not marked as a polymorphic assignment, use the vptr copy
      	function instead of gfc_trans_scalar_assign.
      
      	PR fortran/86481
      	* trans-expr.c (gfc_conv_expr_reference): Do not add the post
      	block to the pre block if the expression is to be finalized.
      	* trans-stmt.c (gfc_trans_allocate): If the expr3 must be
      	finalized, load the post block into a finalization block and
      	add it right at the end of the allocation block.
      
      2017-08-28  Paul Thomas  <pault@gcc.gnu.org>
      
      	PR fortran/80477
      	* gfortran.dg/class_result_7.f90: New test.
      	* gfortran.dg/class_result_8.f90: New test.
      	* gfortran.dg/class_result_9.f90: New test.
      
      	PR fortran/86481
      	* gfortran.dg/allocate_with_source_25.f90: New test.
      
      From-SVN: r263916
      Paul Thomas committed
    • re PR middle-end/87099 (internal compiler error: segmentation fault) · 2c8861b7
      	PR middle-end/87099
      	* calls.c (maybe_warn_nonstring_arg): Punt early if
      	warn_stringop_overflow is zero.  Don't call get_range_strlen
      	on 3rd argument, keep iterating until lenrng[1] is INTEGER_CST.
      	Swap comparison operands to have constants on rhs.  Only use
      	lenrng[1] if non-NULL and INTEGER_CST.  Don't uselessly
      	increment lenrng[0].
      
      	* gcc.dg/pr87099.c: New test.
      
      From-SVN: r263915
      Jakub Jelinek committed