1. 19 Feb, 2020 8 commits
    • Fix -save-temp leaking files in /tmp · 73d53120
      And avoid signal handler calling signal unsafe functions,
      and/or calling unlink with uninitialized memory pointer.
      
      2020-02-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
      	* collect2.c (c_file, o_file): Make const again.
      	(ldout,lderrout, dump_ld_file): Remove.
      	(tool_cleanup): Avoid calling not signal-safe functions.
      	(maybe_run_lto_and_relink): Avoid possible signal handler
      	access to unintialzed memory (lto_o_files).
      	(main): Avoid leaking temp files in $TMPDIR.
      	Initialize c_file/o_file with concat, which avoids exposing
      	uninitialized memory to signal handler, which calls unlink(!).
      	Avoid calling maybe_unlink when the main function returns,
      	since the atexit handler is already doing this.
      	* collect2.h (dump_ld_file, ldout, lderrout): Remove.
      Bernd Edlinger committed
    • sra: Do not create zero sized accesses (PR 93776) · 51faf07c
      SRA can get a bit confused with zero-sized accesses like the one in
      the testcase.  Since there is nothing in the access, nothing is
      scalarized, but we can get order of the structures wrong, which the
      verifier is not happy about.
      
      Fixed by simply ignoring such accesses.
      
      2020-02-19  Martin Jambor  <mjambor@suse.cz>
      
      	PR tree-optimization/93776
      	* tree-sra.c (create_access): Do not create zero size accesses.
      	(get_access_for_expr): Do not search for zero sized accesses.
      
      	testsuite/
      	* gcc.dg/tree-ssa/pr93776.c: New test.
      Martin Jambor committed
    • sra: Avoid totally scalarizing overallping field_decls (PR 93667) · 665c5bad
      [[no_unique_address]] C++ attribute can cause two fields of a
      RECORD_TYPE overlap, which currently confuses the totally scalarizing
      code into creating invalid access tree.  For GCC 10, I'd like to
      simply disable total scalarization of types where this happens.
      
      For GCC 11 I'll write down a TODO item to enable total scalarization
      of cases like this where the problematic fields are basically empty -
      despite having a non-zero size - i.e. when they are just RECORD_TYPEs
      without any data fields.
      
      2020-02-19  Martin Jambor  <mjambor@suse.cz>
      
      	gcc/
      
      	PR tree-optimization/93667
      	* tree-sra.c (scalarizable_type_p): Return false if record fields
      	do not follow wach other.
      
      	gcc/testsuite/
      
      	PR tree-optimization/93667
      	* g++.dg/tree-ssa/pr93667.C: New test.
      Martin Jambor committed
    • libgomp: Fixes + cleanup for OpenACC's Fortran module + openacc_lib.h · 8d1a1cb1
      2020-02-19  Tobias Burnus  <tobias@codesourcery.com>
      
      	* .gitattributes: New; whitespace handling for Fortran's openacc_lib.h.
      	* config/accel/openacc.f90 (openacc_kinds): Add acc_device_current.
      	(openacc_internal, acc_on_device_h): Fix argument name; minor cleanup.
      	* libgomp.texi (Enabling OpenACC): No longer mark as experimental.
      	(acc_set_device_num): Fix Fortran argument name, use same name for C.
      	(acc_get_property): Update Fortran interface to post-OpenACC 3.0
      	corrections; add note about the previous interface and named constant.
      	(OpenACC library and environment variables): Fix two typos.
      	* openacc.f90: Use for all procedures the argument names from the spec
      	as for …_h they are user visible.
      	(openacc_kinds): Rename acc_device_property to
      	acc_device_property_kinds and change value to int32 ; and update users.
      	Re-add acc_device_property for for backward compatibility.
      	(acc_get_property_string_h): Clean up as acc_device_property_kind
      	changed.
      	(acc_get_property_h): Likewise and return c_size_t instead of
      	acc_device_property.
      	(openacc): Also export acc_device_property_kinds.
      	(acc_async_test_h, acc_async_test_all_h, acc_on_device_h,
      	acc_is_present_32_h, acc_is_present_64_h): Simplify logical-return-value
      	handling; check against /= 0 instead of == 1 to match C.
      	* openacc_lib.h: Use for all procedures the argument names from the spec
      	as for …_h they are user visible. Place !GCC$ into the first column to
      	be active also for fixed-form souce form.
      	(acc_device_current, acc_device_property_kind, acc_device_property,
      	acc_property_memory, acc_property_free_memory, acc_property_name,
      	acc_property_vendor, acc_property_driver): New named constants.
      	(acc_get_property, acc_get_property_string): New generic interface.
      Tobias Burnus committed
    • RISC-V: Using fmv.x.w/fmv.w.x rather than fmv.x.s/fmv.s.x · bfe78b08
       - fmv.x.s/fmv.s.x renamed to fmv.x.w/fmv.w.x in the latest RISC-V ISA
         manual.
      
       - Tested rv32gc/rv64gc on bare-metal with qemu.
      
      ChangeLog
      
      gcc/
      
      Kito Cheng  <kito.cheng@sifive.com>
      
      	* config/riscv/riscv.c (riscv_output_move) Using fmv.x.w/fmv.w.x
      	rather than fmv.x.s/fmv.s.x.
      Kito Cheng committed
    • libstdc++: P1983R0 Wording for GB301, US296, US292, US291, and US283 · 242b4fb7
      Among other changes, P1983R0 resolves LWG 3278 in a different way, so this patch
      also reverts the already-applied wording of LWG 3278.
      
      The wording for US291 (the join_view::begin hunk) also required adding the
      friend _Iterator<!_Const> to join_view::_Iterator.  This friend is needed so
      that _Iterator's converting constructor can access the private members of an
      _Iterator of the opposite constness.
      
      The wording for US283 has already been applied it seems.
      
      libstdc++-v3/ChangeLog:
      
      	P1983R0 Wording for GB301, US296, US292, US291, and US283
      	* include/std/ranges (filter_view::pred): New member function.
      	(join_view::_Iterator::_Iterator): Remove now-redundant comment since
      	P1983R0 fixes the highlighted issue in the same way.
      	(join_view::_Iterator<_Const>): Add friend
      	join_view::_Iterator<!_Const>.
      	(join_view::_M_inner): Remove mutable specifier, effectively reverting
      	the proposed wording changes of P3278.
      	(join_view::begin): Refine the condition for when to return a const
      	iterator.
      	(split_view::_OuterIter::_OuterIter): Adjust constraints.
      	* testsuite/std/ranges/adaptors/filter.cc: Test that filter_view::pred
      	exists and works.
      Patrick Palka committed
    • Add -mavx512vbmi2 to i386-2.C and i386-3.C · 6fa35f0e
      2020-02-18  Hongtao Liu  <hongtao.liu@intel.com>
      
      gcc/testsuite/
      	* g++.dg/other/i386-2.C: add -mavx512vbmi2
      	* g++.dg/other/i386-3.C: Ditto.
      liuhongt committed
    • Daily bump. · 08ee555d
      GCC Administrator committed
  2. 18 Feb, 2020 32 commits
    • libstdc++: Fix compilation of <ranges> with Clang (PR 93818) · a5b213dd
      	PR libstdc++/93818
      	* include/std/ranges (_RangeAdaptor): Add deduction guide.
      	(filter_view::_Iterator): Add alias _Vp_iter and use in place of
      	iterator_t<_Vp>.
      	(filter_view::_Iterator::_S_iter_cat()): Add 'typename'.
      	(transform_view::_Iterator): Add alias _Base_iter and use in place of
      	iterator_t<_Base>.
      	(transform_view::_Iterator::_S_iter_cat()): Add 'typename'.
      	(join_view::_Iterator): Add _Outer_iter and _Inner_iter aliases.
      	(join_view::_Iterator::_S_iter_cat()): Add 'typename'.
      	(split_view::_InnerIter::_S_iter_cat()): Likewise.
      Jonathan Wakely committed
    • aarch64: Move vmull_<high_>* to intrinsics · 71c82d0e
      Move some arm_neon.h functions which currently use assembly over
      to intrinsics.
      
      2020-02-18  James Greenhalgh  <james.greenhalgh@arm.com>
      
      gcc/
      	* config/aarch64/aarch64-simd-builtins.def
      	(intrinsic_vec_smult_lo_): New.
      	(intrinsic_vec_umult_lo_): Likewise.
      	(vec_widen_smult_hi_): Likewise.
      	(vec_widen_umult_hi_): Likewise.
      	* config/aarch64/aarch64-simd.md
      	(aarch64_intrinsic_vec_<su>mult_lo_<mode>): New.
      	* config/aarch64/arm_neon.h (vmull_high_s8): Use intrinsics.
      	(vmull_high_s16): Likewise.
      	(vmull_high_s32): Likewise.
      	(vmull_high_u8): Likewise.
      	(vmull_high_u16): Likewise.
      	(vmull_high_u32): Likewise.
      	(vmull_s8): Likewise.
      	(vmull_s16): Likewise.
      	(vmull_s32): Likewise.
      	(vmull_u8): Likewise.
      	(vmull_u16): Likewise.
      	(vmull_u32): Likewise.
      
      gcc/testsuite/
      	* gcc.target/aarch64/vmull_high.c: New.
      James Greenhalgh committed
    • c++: Fix array-init1.C for ILP32 [PR93817] · b0271991
      I only tested LP64 targets and missed this maybe-long unsigned int.
      
      Tested with
      GXX_TESTSUITE_STDS=98,11,14,17,2a make check-c++ RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} dg.exp=array-init1.C'
      
      2020-02-18  Marek Polacek  <polacek@redhat.com>
      
      	PR c++/93817
      	* g++.dg/diagnostic/array-init1.C: Fix for ILP32.
      Marek Polacek committed
    • cmd/go: update -DGOPKGPATH to use current pkgpath encoding · 855b4aae
      This will need to be done in the gc version too, probably more cleverly.
      This version will ensure that the next GCC release works correctly
      when using the GCC version of the go tool.
      
      Updates golang/go#37272
      
      Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/219817
      Ian Lance Taylor committed
    • libstdc++: Fix new tests that fail for ILP32 targets · ce7b39d0
      	* testsuite/20_util/integer_comparisons/equal.cc: Fix invalid
      	assumption that long is wider than int.
      	* testsuite/20_util/integer_comparisons/greater_equal.cc: Likewise.
      	* testsuite/20_util/integer_comparisons/less.cc: Likewise.
      	* testsuite/20_util/integer_comparisons/less_equal.cc: Likewise.
      	* testsuite/20_util/integer_comparisons/not_equal.cc: Likewise.
      Jonathan Wakely committed
    • Use au->lock exclusively for locking in async I/O. · 3fe19105
      2020-02-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR fortran/93599
      	* io/async.c (destroy_adv_cond): Do not destroy lock.
      	(async_io): Make sure au->lock is locked for finishing of thread.
      	Do not lock/unlock around signalling emptysignal. Unlock au->lock
      	before return.
      	(init_adv_cond): Do not initialize lock.
      	(enqueue_transfer): Unlock after signal.
      	(enqueue_done_id): Likewise.
      	(enqueue_done): Likewise.
      	(enqueue_close): Likewise.
      	(enqueue_data_transfer): Likewise.
      	(async_wait_id): Do not lock/unlock around signalling au->work.
      	(async_wait): Unlock after signal.
      	* io/async.h (SIGNAL): Add comment about needed au->lock.
      	Remove locking/unlocking of advcond->lock.
      	(WAIT_SIGNAL_MUTEX): Add comment. Remove locking/unlocking of
      	advcond->lock.  Unlock mutex only at the end.  Loop on
      	__ghread_cond_wait returning zero.
      	(REVOKE_SIGNAL): Add comment. Remove locking/unlocking of
      	advcond->lock.
      	(struct adv_cond): Remove mutex from struct.
      
      asdf
      Thomas König committed
    • libstdc++: P1976R2 Fixed-size span construction from dynamic range · 9b8e2dea
      This includes fixes for first, last, as_bytes and as_writable_bytes
      which were missing from the paper.
      
      	* include/std/span (__cpp_lib_span): Update value.
      	(span(It, size_type), span(It, End)): Make conditionally explicit. Add
      	assertion.
      	(span(R&&), span(const span<OType, OExtent>&)): Likewise and relax
      	constraints.
      	(span::first<Count>(), span::last<Count>()): Use explicit type in
      	return statement.
      	(as_bytes, as_writable_bytes): Likewise.
      	* include/std/version (__cpp_lib_span): Update value.
      	* testsuite/23_containers/span/1.cc: Check new value.
      	* testsuite/23_containers/span/2.cc: Check new value.
      	* testsuite/23_containers/span/explicit.cc: New test.
      Jonathan Wakely committed
    • libstdc++: Fix and simplify constraints on std::span constructors · d6c9e372
      This makes the constraints consistent with the pre-Prague working paper.
      
      	* include/std/span (span::__is_compatible_array): Simplify alias
      	template by using requires-clause.
      	(span::__is_compatible_ref): New alias template for constraining
      	constructors.
      	(span::__is_compatible_iterator, span::__is_compatible_range): Remove.
      	(span(It, size_type), span(It, End)): Use __is_compatible_ref.
      	(span(T(&)[N], span(array<T, N>&), span(const array<T, N>&)): Remove
      	redundant parentheses.
      	(span(R&&)): Add missing constraints.
      Jonathan Wakely committed
    • libstdc++: Reorder declarations of std::span members · f09f3242
      I find it easier to work with this class when the declarations match the
      order in the C++2a working paper.
      
      There's no need to use long, descriptive template parameter names like
      _ContiguousIterator when the parameter is already constrained by the
      std::contiguous_iterator concept. This is also consistent with the
      naming conventions in the working paper.
      
      	* include/std/span (span): Reorder members and rename template
      	parameters to match declarations in the C++2a working paper.
      Jonathan Wakely committed
    • libstdc++: P2116R0 Remove tuple-like protocol support from fixed-extent span · f5b4dc38
      Following this change it's no longer possible to use std::span with
      structured bindings or with the tuple-like API. It will probably come
      back for C++23 though.
      
      	P2116R0 Remove tuple-like protocol support from fixed-extent span
      	* include/std/span (get, tuple_size, tuple_element): Remove.
      	* testsuite/23_containers/span/everything.cc: Remove checks for
      	tuple-like API.
      	* testsuite/23_containers/span/get_neg.cc: Remove.
      	* testsuite/23_containers/span/tuple_element_dynamic_neg.cc: Remove.
      	* testsuite/23_containers/span/tuple_element_oob_neg.cc: Remove.
      	* testsuite/23_containers/span/tuple_size_neg.cc: Remove.
      Jonathan Wakely committed
    • libstdc++: P2106R0 Alternative wording for GB315 and GB316 · aa667c3f
      libstdc++-v3/ChangeLog:
      
      	P2106R0 Alternative wording for GB315 and GB316
      	* include/bits/ranges_algo.h (in_fun_result): New.
      	(for_each_result, for_each_n_result): Change into an alias of
      	in_fun_result.
      	(in_in_result): New.
      	(mismatch_result): Change into an alias of in_in_result.
      	(copy_if_result): Change into an alias of in_out_result.
      	(swap_ranges_result): Change into an alias of in_in_result.
      	(unary_transform_result): Change into an alias of in_out_result.
      	(in_in_out_result): New.
      	(binary_transform_result): Change into an alias of in_in_out_result.
      	(replace_copy_result, replace_copy_if_result, remove_copy_if_result,
      	remove_copy_result, unique_copy_result, reverse_copy_result,
      	rotate_copy_result, partial_sort_copy_result): Change into an alias of
      	in_out_result.
      	(in_out_out_result): New.
      	(partition_copy_result, merge_result): Change into an alias of
      	in_out_out_result.
      	(set_union_result, set_intersection_result): Change into an alias of
      	in_in_out_result.
      	(set_difference_result): Change into an alias of in_out_result.
      	(set_symmetric_difference): Change into an alias of in_in_out_result.
      	(min_max_result): New.
      	(minmax_result, minmax_element_result): Change into an alias of
      	min_max_result.
      	(in_found_result): New.
      	(next_permutation_result, prev_permutation_result): Change into an alias
      	of in_found_result.
      	(__next_permutation_fn::operator(), __prev_permutation_fn::operator()):
      	Adjust following changes to next_permutation_result and
      	prev_permutation_result.
      	* include/bits/ranges_algobase.h (in_out_result): New.
      	(copy_result, move_result, move_backward_result, copy_backward_result,
      	copy_n_result): Change into an alias of in_out_result.
      	* include/bits/ranges_uninitialized.h (uninitialized_copy_result,
      	uninitialized_copy_n_result, uninitialized_move_result,
      	uninitialized_move_n_result): Likewise.
      	* testsuite/25_algorithms/next_permutation/constrained.cc: Adjust uses of
      	structured bindings.
      	* testsuite/25_algorithms/prev_permutation/constrained.cc: Likewise.
      Patrick Palka committed
    • libstdc++: P1243R4 Rangify new algorithms · f3169941
      This adds rangified overloads for for_each_n, sample and clamp as per P1243R4.
      
      libstdc++-v3/ChangeLog:
      
      	P1243R4 Rangify new algorithms
      	* include/bits/ranges_algo.h (for_each_n_result, __for_each_n_fn,
      	for_each_n, __sample_fn, sample, __clamp_fn, clamp): New.
      	* testsuite/25_algorithms/clamp/constrained.cc: New test.
      	* testsuite/25_algorithms/for_each/constrained.cc: Augment test.
      	* testsuite/25_algorithms/sample/constrained.cc: New test.
      Patrick Palka committed
    • [fortran] ICE assign character pointer to non target PR93714 · 06119d69
      An ICE occurred if an attempt was made to assign a pointer to a
      character variable that has an length incorrectly specified using
      a real constant and does not have the target attribute.
      
      gcc/fortran/ChangeLog
      
      	PR fortran/93714
      	* expr.c (gfc_check_pointer_assign): Move check for
      	matching character length to after checking the lvalue
      	attributes for target or pointer.
      
      gcc/testsuite/ChangeLog
      
      	PR fortran/93714
      	* gfortran.dg/char_pointer_assign_6.f90: Look for no target
      	message instead of length mismatch.
      	* gfortran.dg/pr93714_1.f90
      	* gfortran.dg/pr93714_2.f90
      Mark Eggleston committed
    • Restore LTO PGO bootstrap after ea0b1252. · fa1160f6
      	* value-prof.c (stream_out_histogram_value): Restore LTO PGO
      	bootstrap by missing removal of invalid sanity check.
      Martin Liska committed
    • [Fortran] ICE: Invalid expression in gfc_element_size PR93601 · 23d3f25c
      ICE occurs when assigning a BOZ constant to an class(*) variable
      with the allocatable attribute. Use of BOZ constants outside
      data statements and int/real/dble/cmplx intrinsics is not allowed.
      
      Original patch provided by Steven G. Kargl  <kargl@gcc.gnu.org>.
      
      gcc/fortran/ChangeLog
      
      	PR fortran/93601
      	* match.c (gfc_match_assignment) : Reject assignment if
      	the lhs stype is BT_CLASS and the rhs type is BT_BOZ.
      
      gcc/testsuite/ChangeLog
      
      	PR fortran/93601
      	* gfortran.dg/pr93601.f90 : New test.
      Mark Eggleston committed
    • Always compare types of LHS for gimple_assign in ICF. · 08afe87b
      	PR ipa/92518
      	* ipa-icf-gimple.c (func_checker::compare_gimple_assign):
      	Always compare LHS of gimple_assign.
      Martin Liska committed
    • Drop MALLOC attribute for void functions. · 33351ff9
      	PR ipa/93583
      	* cgraph.c (cgraph_node::verify_node): Verify MALLOC attribute
      	and return type of functions.
      	* ipa-param-manipulation.c (ipa_param_adjustments::adjust_decl):
      	Drop MALLOC attribute for void functions.
      	* ipa-pure-const.c (funct_state_summary_t::duplicate): Drop
      	malloc_state for a new VOID clone.
      	PR ipa/93583
      	* gcc.dg/ipa/pr93583.c: New test.
      Martin Liska committed
    • Introduce -fprofile-reproducibility and support it with TOP N. · ea0b1252
      	PR ipa/92924
      	* common.opt: Add -fprofile-reproducibility.
      	* doc/invoke.texi: Document it.
      	* value-prof.c (dump_histogram_value):
      	Document and support behavior for counters[0]
      	being a negative value.
      	(get_nth_most_common_value): Handle negative
      	counters[0] in respect to flag_profile_reproducible.
      	PR ipa/92924
      	* libgcov-merge.c (merge_topn_values_set): Record
      	when a TOP N counter becomes invalid.  When merging
      	remove a smallest value if the space is needed.
      Martin Liska committed
    • analyzer.opt: rewrite description of -fdump-analyzer-callgraph [PR 93692] · 0b2b45a6
      gcc/analyzer/ChangeLog:
      	PR analyzer/93692
      	* analyzer.opt (fdump-analyzer-callgraph): Rewrite description.
      David Malcolm committed
    • analyzer: fix ICE on failed casts [PR 93777] · 4f40164a
      PR analyzer/93777 reports ICEs in a Fortran and C++ case involving
      a cast of a NULL pointer to a REFERENCE_TYPE.
      
      In both cases the call to build_cast fails and returns a NULL type, but
      region_model::maybe_cast_1 asserts that a non-NULL type was returned.
      
      This patch fixes the ICEs by converting the assertion to a conditional.
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/93777
      	* region-model.cc (region_model::maybe_cast_1): Replace assertion
      	that build_cast returns non-NULL with a conditional, falling
      	through to the logic which returns a new unknown value of the
      	desired type if it fails.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/93777
      	* g++.dg/analyzer/pr93777.C: New test.
      	* gfortran.dg/analyzer/pr93777.f90: New test.
      David Malcolm committed
    • analyzer: fix ICE on COMPONENT_REF of ARRAY_TYPE [PR 93778] · 2e623393
      PR analyzer/93778 reports an ICE with -fanalyzer on a gfortran test case
      at this gimple stmt:
      
        _gfortran_st_set_nml_var (&dt_parm.0, &ro.xi.jq, &"ro%xi%jq"[1]{lb: 1 sz: 1}, 4, 0, D.3913);
      
      where ro.xi.jq is a COMPONENT_REF, but ro.xi is of type "struct bl[3]".
      
      The analyzer's handling of COMPONENT_REF assumes that the type of the
      1st argument is a RECORD_TYPE or UNION_TYPE, whereas in this case it's
      an ARRAY_TYPE, leading to a failed as_a inside
      region_model::get_field_region.
      
      This patch fixes the ICE by generalizing the "give up on this tree code"
      logic from r10-6667-gf76a88eb for
      PR analyzer/93388, so that the analyzer gives up when it needs to get an
      lvalue for a COMPONENT_REF on something other than a RECORD_TYPE or
      UNION_TYPE.
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/93778
      	* engine.cc (impl_region_model_context::on_unknown_tree_code):
      	Rename to...
      	(impl_region_model_context::on_unexpected_tree_code): ...this and
      	convert first argument from path_var to tree.
      	(exploded_node::on_stmt): Pass ctxt to purge_for_unknown_fncall.
      	* exploded-graph.h (region_model_context::on_unknown_tree_code):
      	Rename to...
      	(region_model_context::on_unexpected_tree_code): ...this and
      	convert first argument from path_var to tree.
      	* program-state.cc (sm_state_map::purge_for_unknown_fncall): Add
      	ctxt param and pass on to calls to get_rvalue.
      	* program-state.h (sm_state_map::purge_for_unknown_fncall): Add
      	ctxt param.
      	* region-model.cc (region_model::handle_unrecognized_call): Pass
      	ctxt on to call to get_rvalue.
      	(region_model::get_lvalue_1): Move body of default case to
      	region_model::make_region_for_unexpected_tree_code and call it.
      	Within COMPONENT_REF case, reject attempts to handle types other
      	than RECORD_TYPE and UNION_TYPE.
      	(region_model::make_region_for_unexpected_tree_code): New
      	function, based on default case of region_model::get_lvalue_1.
      	* region-model.h
      	(region_model::make_region_for_unexpected_tree_code): New decl.
      	(region_model::on_unknown_tree_code): Rename to...
      	(region_model::on_unexpected_tree_code): ...this and convert first
      	argument from path_var to tree.
      	(class test_region_model_context): Update vfunc implementation for
      	above change.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/93778
      	* gfortran.dg/analyzer/pr93778.f90: New test.
      David Malcolm committed
    • analyzer: fix ICE on pointer arithmetic with incomplete types [PR 93774] · a674c7b8
      PR analyzer/93774 reports an ICE in gfortran with -fanalyzer within
      region_model::convert_byte_offset_to_array_index on a pointer of
      incomplete type ("character(kind=1)[0:][1:0] * restrict").
      
      This patch bulletproofs the routine against incomplete types, fixing
      the ICE.
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/93774
      	* region-model.cc
      	(region_model::convert_byte_offset_to_array_index): Use
      	int_size_in_bytes before calling size_in_bytes, to gracefully fail
      	on incomplete types.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/93774
      	* gfortran.dg/analyzer/deferred_character_25.f90: New test,
      	based on gfortran.dg/deferred_character_25.f90.
      David Malcolm committed
    • analyzer: add test coverage for gfortran ICE fix [PR 93779] · 68f9c41d
      PR analyzer/93779 reports an ICE in gfortran with -fanalyzer
      that was fixed for GCC 10 by a workaround in
      f76a88eb; the tree code in
      question is a FUNCTION_DECL.
      
      Given that I want to rework the above patch at some point, it seems
      prudent to add test coverage to ensure the ICE doesn't come back,
      which this patch does.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/93779
      	* gfortran.dg/analyzer/pr88304-2.f90: New test, adapted from
      	gfortran.fortran-torture/compile/pr88304-2.f90
      David Malcolm committed
    • [Fortran] ICE in gfc_typenode_for_spec PR93603 · 8f55a0ee
      Associating a symbol with a BOZ constant caused an ICE.  Output
      an error message as an association target cannot be a BOZ
      constant.
      
      Original patch provided by Steven G. Kargl  <kargl@gcc.gnu.org>.
      
      gcc/fortran/ChangeLog
      
      	PR fortran/93603
      	* match.c (gfc_match_associate) : If target expression
      	has the type BT_BOZ output an error and goto
      	assocListError.
      
      gcc/testsuite/ChangeLog
      
      	PR fortran/93603
      	* gfortran.dg/pr93603.f90 : New test.
      Mark Eggleston committed
    • [fortran] ICE in gfc_validate_kind(): Got bad kind [PR93580] · d4c10c9f
      Caused by using invalid part_refs in kind specifications,
      e.g. %re or %im on non-complex expressions and %len on
      non character expressions.
      
      Check whether %re, %im and %len are valid when checking
      kind specification.
      
      The original patch from Steven G. Kargl  <kargl@gcc.gnu.org> only
      checked for %re and %im.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/93580
      	* primary.c (gfc_match_varspec): If the symbol following %
      	is re or im and the primary expression type is not BT_COMPLEX
      	issue an error. If the symbol is len and the primary
      	expression type is not BT_CHARACTER is an error.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/93580
      	* gfortran.dg/dg/pr93580.f90: New test.
      Mark Eggleston committed
    • ipa: Various diagnostic fixes [PR93797] · da67227b
      As the patch shows, various messages didn't match the field names they are
      talking about.
      
      2020-02-18  Jakub Jelinek  <jakub@redhat.com>
      
      	PR ipa/93797
      	* cgraph.c (verify_speculative_call): Use speculative_id instead of
      	speculative_uid in messages.  Remove trailing whitespace from error
      	message.  Use num_speculative_call_targets instead of
      	num_speculative_targets in a message.
      	(cgraph_node::verify_node): Use call_stmt instead of cal_stmt in
      	edge messages and stmt instead of cal_stmt in reference message.
      Jakub Jelinek committed
    • tree-ssa: Fix ICE in build_vector_type [PR93780] · be7c145a
      The following testcase ICEs, because execute_update_addresses_taken attempts
      to create a VECTOR_TYPE with non-power of 2 number of elts.
      Fixed by guarding it with the corresponding predicate.
      
      2020-02-18  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/93780
      	* tree-ssa.c (non_rewritable_lvalue_p): Check valid_vector_subparts_p
      	before calling build_vector_type.
      	(execute_update_addresses_taken): Likewise.
      
      	* gcc.dg/pr93780.c: New test.
      Jakub Jelinek committed
    • Typo fixes - functoin -> function [PR93796] · 8def1d52
      2020-02-18  Jakub Jelinek  <jakub@redhat.com>
      
      	PR driver/93796
      	* params.opt (-param=ipa-max-switch-predicate-bounds=): Fix help
      	typo, functoin -> function.
      	* tree.c (free_lang_data_in_decl): Fix comment typo,
      	functoin -> function.
      	* ipa-visibility.c (cgraph_externally_visible_p): Likewise.
      Jakub Jelinek committed
    • diagnostics: don't generate URLs that won't be used · abb48524
      The two places in diagnostics.c where URLs are printed both do
      non-trivial work to generate the URL strings (including malloc/free), so
      don't do this work if URL-printing is disabled.
      
      gcc/ChangeLog:
      	* diagnostic.c (print_any_cwe): Don't call get_cwe_url if URLs
      	won't be printed.
      	(print_option_information): Don't call get_option_url if URLs
      	won't be printed.
      David Malcolm committed
    • analyzer: fix ICE on function pointer casts [PR 93775] · d8cde6f9
      PR analyzer/93775 reports an ICE in cgraph_node::get when -fanalyzer is
      used on code that calls a function pointer that was generated via a cast
      from a non-function.
      
      This patch fixes it by bulletproofing region_model::get_fndecl_for_call
      for the case where the code_region's get_tree_for_child_region returns
      NULL.
      
      gcc/analyzer/ChangeLog:
      	PR analyzer/93775
      	* region-model.cc (region_model::get_fndecl_for_call): Handle the
      	case where the code_region's get_tree_for_child_region returns
      	NULL.
      
      gcc/testsuite/ChangeLog:
      	PR analyzer/93775
      	* gcc.dg/analyzer/20020129-1.c: New test.
      David Malcolm committed
    • Daily bump. · 1ee98e41
      GCC Administrator committed