1. 12 Mar, 2020 12 commits
    • tree-optimization/94103 avoid CSE of loads with padding · 1dc00a8e
      VN currently replaces a load of a 16 byte entity 128 bits of precision
      (TImode) with the result of a load of a 16 byte entity with 80 bits of
      mode precision (XFmode).  That will go downhill since if the padding
      bits are not actually filled with memory contents those bits are
      missing.
      
      2020-03-12  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/94103
      	* tree-ssa-sccvn.c (visit_reference_op_load): Avoid type
      	punning when the mode precision is not sufficient.
      
      	* gcc.target/i386/pr94103.c: New testcase.
      Richard Biener committed
    • libstdc++: Fix test failure due to -Wnonnull warnings · fcc443b9
      This test fails in the Fedora RPM build (but not elsewhere, for unknown
      reasons). The warning is correct, we're passing a null pointer.
      
      	* testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Do not pass
      	a null pointer to functions with nonnull(1) attribute.
      Jonathan Wakely committed
    • i386: Use ix86_output_ssemov for MMX TYPE_SSEMOV · 54f46d82
      There is no need to set mode attribute to XImode since ix86_output_ssemov
      can properly encode xmm16-xmm31 registers with and without AVX512VL.
      
      	PR target/89229
      	* config/i386/i386.c (ix86_output_ssemov): Handle MODE_DI,
      	MODE_V1DF and MODE_V2SF.
      	* config/i386/mmx.md (MMXMODE:*mov<mode>_internal): Call
      	ix86_output_ssemov for TYPE_SSEMOV.  Remove ext_sse_reg_operand
      	check.
      H.J. Lu committed
    • [Fortran, OpenACC] Reject vars of different scope in $acc declare (PR94120) · 98aeb1ef
      2020-03-12  Tobias Burnus  <tobias@codesourcery.com>
      
              PR middle-end/94120
              * openmp.c (gfc_match_oacc_declare): Accept function-result
              variables; reject variables declared in a different scoping unit.
      
      2020-03-12  Tobias Burnus  <tobias@codesourcery.com>
      
              PR middle-end/94120
              * gfortran.dg/goacc/pr78260-2.f90: Correct scan-tree-dump-times.
              Extend test case to result variables.
              * gfortran.dg/goacc/declare-2.f95: Actually check module-declaration
              restriction of OpenACC.
              * gfortran.dg/goacc/declare-3.f95: Remove case where this
              restriction is violated.
              * gfortran.dg/goacc/pr94120-1.f90: New.
              * gfortran.dg/goacc/pr94120-2.f90: New.
              * gfortran.dg/goacc/pr94120-3.f90: New.
      Tobias Burnus committed
    • doc: Fix up ASM_OUTPUT_ALIGNED_DECL_LOCAL description · b73f6902
      When looking into PR94134, I've noticed bugs in the
      ASM_OUTPUT_ALIGNED_DECL_LOCAL documentation.  varasm.c has:
        #if defined ASM_OUTPUT_ALIGNED_DECL_LOCAL
          unsigned int align = symtab_node::get (decl)->definition_alignment ();
          ASM_OUTPUT_ALIGNED_DECL_LOCAL (asm_out_file, decl, name,
                                         size, align);
          return true;
        #elif defined ASM_OUTPUT_ALIGNED_LOCAL
          unsigned int align = symtab_node::get (decl)->definition_alignment ();
          ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, align);
          return true;
        #else
          ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
          return false;
        #endif
      and the ASM_OUTPUT_ALIGNED_LOCAL documentation properly mentions:
      Like @code{ASM_OUTPUT_LOCAL} and mentions the same macro in another place.
      The ASM_OUTPUT_ALIGNED_DECL_LOCAL description mentions non-existing macros
      ASM_OUTPUT_ALIGNED_DECL and ASM_OUTPUT_DECL instead of the right ones
      ASM_OUTPUT_ALIGNED_LOCAL and ASM_OUTPUT_LOCAL.
      
      2020-03-12  Jakub Jelinek  <jakub@redhat.com>
      
      	* doc/tm.texi.in (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Change
      	ASM_OUTPUT_ALIGNED_DECL in description to ASM_OUTPUT_ALIGNED_LOCAL
      	and ASM_OUTPUT_DECL to ASM_OUTPUT_LOCAL.
      	* doc/tm.texi: Regenerated.
      Jakub Jelinek committed
    • tree-dse: Fix mem* head trimming if call has lhs [PR94130] · 349ab34d
      As the testcase shows, if DSE decides to head trim {mem{set,cpy,move},strncpy}
      and the call has lhs, it is incorrect to leave the lhs as is, because it
      will then point to the adjusted address (base + head_trim) instead of the
      original base.
      The following patch fixes that by dropping the lhs of the call and assigning
      lhs the original base in a following statement.
      
      2020-03-12  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/94130
      	* tree-ssa-dse.c: Include gimplify.h.
      	(increment_start_addr): If stmt has lhs, drop the lhs from call and
      	set it after the call to the original value of the first argument.
      	Formatting fixes.
      	(decrement_count): Formatting fix.
      
      	* gcc.c-torture/execute/pr94130.c: New test.
      Jakub Jelinek committed
    • c++: Tweak reshape_init_array_1 [PR94124] · 4069adf4
      Isn't it wasteful to first copy perhaps a large constructor (recursively)
      and then truncate it to very few elts (zero in this case)?
      
      > We should certainly avoid copying if they're the same.  The code above for
      > only copying the bits that aren't going to be thrown away seems pretty
      > straightforward, might as well use it even if the savings aren't likely to
      > be large.
      
      Calling vec_safe_truncate with the same number of elts the vector already
      has is a nop, so IMHO we just should make sure we only unshare if it
      changed.
      
      2020-03-12  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/94124
      	* decl.c (reshape_init_array_1): Don't unshare constructor if there
      	aren't any trailing zero elts, otherwise only unshare the first
      	nelts.
      Jakub Jelinek committed
    • Update myself to MAINTAINERS · aedb4c8f
      This updates myself to the right place in MAINTAINERS.
      
      gcc/ChangeLog
      
      2020-03-11  Bin Bin Lv  <shlb@linux.ibm.com>
      
      	* MAINTAINERS (Write After Approval): Update myself.
      Bin Bin Lv committed
    • [rs6000] Fix a wrong GC issue · f457ae22
      The source file rs6000.c was split up into several smaller source files
      through commit 1acf0246.  However, variable "altivec_builtin_mask_for_load" and
      "builtin_mode_to_type[MAX_MACHINE_MODE][2]" were marked with the wrong syntax
      "GTY(([options])) type name", which led these two variables were not marked as
      roots correctly and wrongly GCed.  And when "altivec_builtin_mask_for_load"
      was wrongly GCed, the compiling for openJDK is failed with ICEs enabling
      precompiled header under mcpu=power7.  So roots must be declared using one of
      the following syntaxes: "extern GTY(([options])) type name;" and "static
      GTY(([options])) type name;".
      
      And the following patch adds variable "altivec_builtin_mask_for_load" and
      "builtin_mode_to_type[MAX_MACHINE_MODE][2]" into the roots array.
      
      Bootstrap and regression tests were done on powerpc64le-linux-gnu (LE) with no
      regressions.
      
      gcc/ChangeLog
      
      2020-03-11  Bin Bin Lv  <shlb@linux.ibm.com>
      
      	* config/rs6000/rs6000-internal.h (altivec_builtin_mask_for_load,
      	builtin_mode_to_type): Remove the declaration.
      	* config/rs6000/rs6000.h (altivec_builtin_mask_for_load,
      	builtin_mode_to_type): Add an extern GTY(()) declaration.
      	* config/rs6000/rs6000.c (altivec_builtin_mask_for_load,
      	builtin_mode_to_type): Remove the GTY(()) declaration.
      Bin Bin Lv committed
    • Add myself to MAINTAINERS · 9c1281d9
      This adds myself to MAINTAINERS in the Write After Approval section.
      
      gcc/ChangeLog
      
      2020-03-11  Bin Bin Lv  <shlb@linux.ibm.com>
      
      	* MAINTAINERS (Write After Approval): Add myself.
      Bin Bin Lv committed
    • testsuite: Fix concepts-using2.C failure on 32-bit targets [PR93907] · 690de2b7
      The test FAILs on 32-bit targets that don't have __int128 type.
      
      2020-03-12  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/93907
      	* g++.dg/cpp2a/concepts-using2.C (cc): Use long long instead of
      	__int128 if __SIZEOF_INT128__ isn't defined.
      Jakub Jelinek committed
    • Daily bump. · 923e1785
      GCC Administrator committed
  2. 11 Mar, 2020 21 commits
    • c++: Fix ICE with concepts and aliases [PR93907]. · bde31a76
      The problem here was that we were checking satisfaction once with 'e', a
      typedef of 'void', and another time with 'void' directly, and treated them
      as different for hashing based on the assumption that
      canonicalize_type_argument would have already removed a typedef that wasn't
      a complex dependent alias.  But that wasn't happening here, so let's add a
      call.
      
      gcc/cp/ChangeLog
      2020-03-11  Jason Merrill  <jason@redhat.com>
      
      	PR c++/93907
      	* constraint.cc (tsubst_parameter_mapping): Canonicalize type
      	argument.
      Jason Merrill committed
    • c++: Fix wrong modifying const object error for COMPONENT_REF [PR94074] · 7eb5be6a
      I got a report that building Chromium fails with the "modifying a const
      object" error.  After some poking I realized it's a bug in GCC, not in
      their codebase.
      
      Much like with ARRAY_REFs, which can be const even though the array
      itself isn't, COMPONENT_REFs can be const although neither the object
      nor the field were declared const.  So let's dial down the checking.
      Here the COMPONENT_REF was const because of the "const_cast<const U &>(m)"
      thing -- cxx_eval_component_reference then builds a COMPONENT_REF with
      TREE_TYPE (t).
      
      While looking into this I noticed that we don't detect modifying a const
      object in certain cases like in
      <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94074#c2>.  That's because
      we never evaluate an X::X() CALL_EXPR -- there's none.  Fixed as per
      Jason's suggestion by setting TREE_READONLY on a CONSTRUCTOR after
      initialization in cxx_eval_store_expression.
      
      2020-03-11  Marek Polacek  <polacek@redhat.com>
      	    Jason Merrill  <jason@redhat.com>
      
      	PR c++/94074 - wrong modifying const object error for COMPONENT_REF.
      	* constexpr.c (cref_has_const_field): New function.
      	(modifying_const_object_p): Consider a COMPONENT_REF
      	const only if any of its fields are const.
      	(cxx_eval_store_expression): Mark a CONSTRUCTOR of a const type
      	as readonly after its initialization has been done.
      
      	* g++.dg/cpp1y/constexpr-tracking-const17.C: New test.
      	* g++.dg/cpp1y/constexpr-tracking-const18.C: New test.
      	* g++.dg/cpp1y/constexpr-tracking-const19.C: New test.
      	* g++.dg/cpp1y/constexpr-tracking-const20.C: New test.
      	* g++.dg/cpp1y/constexpr-tracking-const21.C: New test.
      	* g++.dg/cpp1y/constexpr-tracking-const22.C: New test.
      Marek Polacek committed
    • libstdc++: Add a test that takes the split_view of a non-forward range · 4512b7d8
      This adds a tests that verifies taking the split_view of a non-forward range
      works correctly.  Doing so revealed a typo in one of _OuterIter's constructors.
      
      It also revealed that the default constructor of
      __gnu_test::test_range::iterator misbehaves, because by delegating to
      Iter<T>(nullptr, nullptr) we perform a null-pointer deref at runtime in
      input_iterator_wrapper's constructor due to the ITERATOR_VERIFY check therein.
      Instead of delegating to this constructor it seems we can just inherit the
      protected default constructor, which does not contain this ITERATOR_VERIFY
      check.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/ranges (split_view::_OuterIter::_OuterIter): Typo fix,
      	'address' -> 'std::__addressof'.
      	* testsuite/std/ranges/adaptors/split.cc: Test taking the split_view of
      	a non-forward input_range.
      	* testsuite/util/testsuite_iterators.h (output_iterator_wrapper): Make
      	default constructor protected instead of deleted, like with
      	input_iterator_wrapper.
      	(test_range::iterator): Add comment explaining that this type is used
      	only when the underlying wrapper is input_iterator_wrapper or
      	output_iterator_wrapper.  Remove delegating defaulted constructor so
      	that the inherited default constructor is used instead.
      Patrick Palka committed
    • Bug fix: cannot convert 'const short int*' to 'const __bf16*' · 1c43ee69
      This patch fixes a bug introduced by my earlier patch (
      https://gcc.gnu.org/pipermail/gcc-patches/2020-March/541680.html ).
      It introduces a new scalar builtin type that was missing in the original
      patch.
      
      Bootstrapped cleanly on arm-none-linux-gnueabihf.
      Tested for regression on arm-none-linux-gnueabihf. No regression from
      before the original patch.
      Tests that failed or became unsupported because of the original tests
      now work as they did before it.
      
      	* config/arm/arm-builtins.c
      	(arm_init_simd_builtin_scalar_types): New.
      	* config/arm/arm_neon.h (vld2_bf16): Used new builtin type.
      	(vld2q_bf16): Used new builtin type.
      	(vld3_bf16): Used new builtin type.
      	(vld3q_bf16): Used new builtin type.
      	(vld4_bf16): Used new builtin type.
      	(vld4q_bf16): Used new builtin type.
      	(vld2_dup_bf16): Used new builtin type.
      	(vld2q_dup_bf16): Used new builtin type.
      	(vld3_dup_bf16): Used new builtin type.
      	(vld3q_dup_bf16): Used new builtin type.
      	(vld4_dup_bf16): Used new builtin type.
      	(vld4q_dup_bf16): Used new builtin type.
      Delia Burduv committed
    • pdp11: Fix handling of common (local and global) vars [PR94134] · d42ff1d3
      As mentioned in the PR, the generic code decides to put the a variable into
      lcomm_section, which is a NOSWITCH section and thus the generic code doesn't
      switch into a particular section before using
      ASM_OUTPUT{_ALIGNED{,_DECL}_}_LOCAL, on many targets that results just in
      .lcomm (or for non-local .comm) directives which don't need a switch to some
      section, other targets put switch_to_section (bss_section) at the start of
      that macro.
      pdp11 doesn't do that (and doesn't have bss_section), and so emits the
      lcomm/comm variables in whatever section is current (it has only .text/.data
      and for DEC assembler rodata).
      
      The following patch fixes that by putting it always into data section, and
      additionally avoids emitting an empty line in the assembly for the lcomm
      vars.
      
      2020-03-11  Jakub Jelinek  <jakub@redhat.com>
      
      	PR target/94134
      	* config/pdp11/pdp11.c (pdp11_asm_output_var): Call switch_to_section
      	at the start to switch to data section.  Don't print extra newline if
      	.globl directive has not been emitted.
      
      	* gcc.c-torture/execute/pr94134.c: New test.
      Jakub Jelinek committed
    • RISC-V: Fix testsuite regression due to recent IRA changes. · 5fea87cc
      After IRA changes, atomic version will use one more register, but
      non-atomic still use 2 registers, however this testcase isn't testing for
      atomic feature, so I decide change the testcase to always use COUNT++
      to test.
      
      ChangeLog
      
      gcc/testsuite/
      
      Kito Cheng  <kito.cheng@sifive.com>
      
      	* gcc.target/riscv/interrupt-2.c: Update testcase and expected output.
      Kito Cheng committed
    • fold undefined pointer offsetting · cb99630f
      This avoids breaking the old broken pointer offsetting via
      (T)(ptr - ((T)0)->x) which should have used offsetof.  Breakage
      was exposed by the introduction of POINTER_DIFF_EXPR and making
      PTA not considering that producing a pointer.  The mitigation
      for simple cases is to canonicalize
      
        _2 = _1 - 8B;
        o_9 = (struct obj *) _2;
      
      to
      
        o_9 = &MEM[_1 + -8B];
      
      eliding one statement and the offending pointer subtraction.
      
      2020-03-11  Richard Biener  <rguenther@suse.de>
      
      	* match.pd ((T *)(ptr - ptr-cst) -> &MEM[ptr + -ptr-cst]):
      	New pattern.
      
      	* gcc.dg/torture/20200311-1.c: New testcase.
      Richard Biener committed
    • [testsuite] Add @ lines to check-function-bodies fluff · d564c5e2
      When using `check-function-bodies`, the subroutine `parse_function_bodies` uses
      the `fluff` regexp to remove uninteresting assembly lines.
      
      Arm targets generate assembly with some lines prefixed by `@`, these lines are
      left by this process.
      
      As an example of some lines prefixed by `@': the assembly output from the
      `stacktest1` function in "bfloat16_simd_3_1.c" is:
      
              .align  2
              .global stacktest1
              .arch armv8.2-a
              .syntax unified
              .arm
              .fpu neon-fp-armv8
              .type   stacktest1, %function
      stacktest1:
              @ args = 0, pretend = 0, frame = 8
              @ frame_needed = 0, uses_anonymous_args = 0
              @ link register save eliminated.
              sub     sp, sp, #8
              add     r3, sp, #6
              vst1.16 {d0[0]}, [r3]
              vld1.16 {d0[0]}, [r3]
              add     sp, sp, #8
              @ sp needed
              bx      lr
              .size   stacktest1, .-stacktest1
      
      It seems that previous uses of `check-function-bodies` in the arm backend have
      avoided problems with such lines since they use the `...` regexp in each place
      such fluff occurs.
      
      I'm currently writing a patch that I'd like to match the entire function body,
      so I'd like to remove such `@` lines automatically.
      
      gcc/testsuite/ChangeLog:
      
      2020-03-11  Matthew Malcomson  <matthew.malcomson@arm.com>
      
      	* lib/scanasm.exp (parse_function_bodies): Lines starting with '@' also
      	counted as fluff.
      Matthew Malcomson committed
    • Fix GIMPLE verification failure in LTO mode on Ada code · e835226b
      The issue is that tree_is_indexable doesn't return the same result for
      a FIELD_DECL with QUAL_UNION_TYPE and the QUAL_UNION_TYPE, resulting
      in two instances of the QUAL_UNION_TYPE in the bytecode.  The result
      for the type is the correct one (false, since it is variably modified)
      while the result for the field is falsely true because:
      
        else if (TREE_CODE (t) == FIELD_DECL
                 && lto_variably_modified_type_p (DECL_CONTEXT (t)))
          return false;
      
      is not satisfied.  The reason for this is that the DECL_QUALIFIER of
      fields of a QUAL_UNION_TYPE depends on a discriminant in Ada, which
      means that the size of the type does too (CONTAINS_PLACEHOLDER_P),
      which in turn means that it is reset to a mere PLACEHOLDER_EXPR by
      free_lang_data, which finally means that the size of DECL_CONTEXT is
      too, so RETURN_TRUE_IF_VAR is false.
      
      In other words, the CONTAINS_PLACEHOLDER_P property of the DECL_QUALIFIER
      of fields of a QUAL_UNION_TYPE hides the variably_modified_type_p property
      of  these fields, if you look from the outside.
      
      	PR middle-end/93961
      	* tree.c (variably_modified_type_p) <RECORD_TYPE>: Recurse into
      	fields whose type is a qualified union.
      Eric Botcazou committed
    • Fix internal error on locally-defined subpools · a5aac267
      If the type is derived in the current compilation unit, and Allocate
      is not overridden on derivation (as is typically the case with
      Root_Storage_Pool_With_Subpools), the entity for Allocate of the
      derived type is an alias for System.Storage_Pools.Subpools.Allocate.
      
      The main assertion in gnat_to_gnu_entity fails in this case, since
      this is not a definition and Is_Public is false (since the entity
      is nested in the same compilation unit).
      
      2020-03-11  Richard Wai  <richard@annexi-strayline.com>
      
      	* gcc-interface/decl.c (gnat_to_gnu_entity): Also test Is_Public on
      	the Alias of the entitiy, if is present, in the main assertion.
      Eric Botcazou committed
    • aarch64: Fix ICE in aarch64_add_offset_1 [PR94121] · 42bc589e
      abs_hwi asserts that the argument is not HOST_WIDE_INT_MIN and as the
      (invalid) testcase shows, the function can be called with such an offset.
      The following patch is IMHO minimal fix, absu_hwi unlike abs_hwi allows even
      that value and will return (unsigned HOST_WIDE_INT) HOST_WIDE_INT_MIN
      in that case.  The function then uses moffset in two spots which wouldn't
      care if the value is (unsigned HOST_WIDE_INT) HOST_WIDE_INT_MIN or
      HOST_WIDE_INT_MIN and wouldn't accept it (!moffset and
      aarch64_uimm12_shift (moffset)), then in one spot where the signedness of
      moffset does matter and using unsigned is the right thing -
      moffset < 0x1000000 - and finally has code which will handle even this
      value right; the assembler doesn't really care for DImode immediates if
              mov     x1, -9223372036854775808
      or
              mov     x1, 9223372036854775808
      is used and similarly it doesn't matter if we add or sub it in DImode.
      
      2020-03-11  Jakub Jelinek  <jakub@redhat.com>
      
      	PR target/94121
      	* config/aarch64/aarch64.c (aarch64_add_offset_1): Use absu_hwi
      	instead of abs_hwi, change moffset type to unsigned HOST_WIDE_INT.
      
      	* gcc.dg/pr94121.c: New test.
      Jakub Jelinek committed
    • value-prof: Fix abs uses in value-prof.c [PR93962] · 60342fdb
      Jeff has recently fixed dump_histogram_value to use std::abs instead of abs,
      because on FreeBSD apparently the ::abs isn't overloaded and only has
      int abs (int);
      Seems on Solaris /usr/include/iso/stdlib_iso.h abs has:
      int abs (int);
      long abs (long);
      overloads but already not
      long long abs (long long);
      and there is another abs use in get_nth_most_common_value, also on int64_t.
      The long long std::abs (long long); overload is there only in C++11 and we
      in GCC10 still support C++98.
      
      Martin has said that a counter should never be INT64_MIN, so IMHO it is
      better to use abs_hwi which will assert that.
      
      2020-03-11  Jakub Jelinek  <jakub@redhat.com>
      
      	PR bootstrap/93962
      	* value-prof.c (dump_histogram_value): Use abs_hwi instead of
      	std::abs.
      	(get_nth_most_common_value): Use abs_hwi instead of abs.
      Jakub Jelinek committed
    • dfp: Fix decimal_to_binary [PR94111] · 312992f5
      As e.g. decimal_from_decnumber shows, the REAL_VALUE_TYPE representation
      contains a decimal128 embedded in ->sig only if it is rvc_normal, for
      other kinds like rvc_inf or rvc_nan, ->sig is ignored and everything is
      contained in the REAL_VALUE_TYPE flags (cl, sign, signalling and decimal).
      decimal_to_binary which is used when folding a decimal{32,64,128} constant
      to a binary floating point type ignores this and thus folds infinities and
      NaNs into +0.0.
      The following patch fixes that by only doing that for rvc_normal.
      Similarly to the binary to decimal folding, it goes through a string, in
      order to e.g. deal with canonical NaN mantissas, or binary float formats
      that don't support infinities and/or NaNs.
      
      2020-03-11  Jakub Jelinek  <jakub@redhat.com>
      
      	PR middle-end/94111
      	* dfp.c (decimal_to_binary): Only use decimal128ToString if from->cl
      	is rvc_normal, otherwise use real_to_decimal to print the number to
      	string.
      
      	* gcc.dg/dfp/pr94111.c: New test.
      Jakub Jelinek committed
    • ldist: Further fixes for -ftrapv [PR94114] · 05ac4d9c
      As the testcase shows, arithmetics that for -ftrapv would need multiple
      basic blocks can show up not just in nb_bytes expressions where we
      are calling rewrite_to_non_trapping_overflow for a while already,
      but also in the pointer expression to the start of the region.
      While the testcase covers just the first hunk and I've failed to create
      a testcase for the latter, it is at least in theory possible too, so I've
      adjusted that hunk too.
      
      2020-03-11  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/94114
      	* tree-loop-distribution.c (generate_memset_builtin): Call
      	rewrite_to_non_trapping_overflow even on mem.
      	(generate_memcpy_builtin): Call rewrite_to_non_trapping_overflow even
      	on dest and src.
      
      	* gcc.dg/pr94114.c: New test.
      Jakub Jelinek committed
    • libstdc++: LWG 3286 ranges::size is not required to be valid after ... · 8f0d8cd8
      ... a call to ranges::begin on an input range.
      
      This implements LWG 3286.  The new wording for the single-argument constructor
      for subrange is implemented by splitting the constructor into two delegating
      constructors, one constrained by _S_store_size and the other by !_S_store_size.
      
      Tested on x86_64-pc-linux-gnu, both added tests fail before the patch and pass
      with the patch.
      
      libstdc++-v3/ChangeLog:
      
      	LWG 3286 ranges::size is not required to be valid after a call to
      	ranges::begin on an input range
      	* include/std/ranges (subrange::subrange): Split single-argument
      	constructor into two, one constrained by _S_store_size and another by
      	!_S_store_size.
      	(take_view::begin): Call size() before calling ranges::begin(_M_base).
      	* testsuite/std/ranges/adaptors/lwg3286.cc: New test.
      	* testsuite/std/ranges/subrange/lwg3286.cc: New test.
      Patrick Palka committed
    • Fix length computation for movsi_insv which resulted in regressions due to out… · 5115542a
      Fix length computation for movsi_insv which resulted in regressions due to out of range branches on the bfin port.
      
      	* config/bfin/bfin.md (movsi_insv): Add length attribute.
      Jeff Law committed
    • c++: Fix wrong conversion error with non-viable overload [PR94124] · e11d05c1
      This is a bad interaction between sharing a constructor for an array
      and stripping its trailing zero-initializers.  Here we reuse a ctor
      and then strip its 0s.  This breaks overload resolution in this test:
      D can be initialized from {} but not from {0}, so if we truncate the
      constructor not to include the zero, the F(D) overload becomes valid
      and then we get the ambiguous conversion error.
      
      	PR c++/94124 - wrong conversion error with non-viable overload.
      	* decl.c (reshape_init_array_1): Unshare a constructor if we
      	stripped trailing zero-initializers.
      
      	* g++.dg/cpp0x/initlist-overload1.C: New test.
      Marek Polacek committed
    • c++: Fix deferred noexcept on constructor [PR93901]. · 481fcfe6
      My change in r10-4394 to only update clones when we actually instantiate a
      deferred noexcept-spec broke this because deferred parsing updates the
      primary function but not the clones.  For GCC 10, let's just revert it.
      
      gcc/cp/ChangeLog
      2020-03-10  Jason Merrill  <jason@redhat.com>
      
      	PR c++/93901
      	* pt.c (maybe_instantiate_noexcept): Always update clones.
      Jason Merrill committed
    • c++: Fix ICE with omitted template args [PR93956]. · df15a828
      reshape_init only wants to work on BRACE_ENCLOSED_INITIALIZER_P, i.e. raw
      initializer lists, and here was getting a CONSTRUCTOR that had already been
      processed for type A<int>.  maybe_aggr_guide should also use that test.
      
      gcc/cp/ChangeLog
      2020-03-10  Jason Merrill  <jason@redhat.com>
      
      	PR c++/93956
      	* pt.c (maybe_aggr_guide): Check BRACE_ENCLOSED_INITIALIZER_P.
      Jason Merrill committed
    • rs6000: Check -+0 and NaN for smax/smin generation · 37e0df8a
      PR93709 mentioned regressions on maxlocval_4.f90 and minlocval_f.f90 which
      relates to max of '-inf' and 'nan'. This regression occur on P9 because
      P9 new instruction 'xsmaxcdp' is generated. 
      And for C code `a < b ? b : a` is also generated as `xsmaxcdp` under -O2
      for P9. While this instruction behavior more like C/C++ semantic (a>b?a:b).
      
      This generates prevents 'xsmaxcdp' to be generated for those cases.
      'xsmincdp' also is handled in patch.
      
      gcc/
      2020-03-10  Jiufu Guo  <guojiufu@linux.ibm.com>
      
      	PR target/93709
      	* gcc/config/rs6000/rs6000.c (rs6000_emit_p9_fp_minmax): Check
      	NAN and SIGNED_ZEROR for smax/smin.
      
      gcc/testsuite
      2020-03-10  Jiufu Guo  <guojiufu@linux.ibm.com>
      
      	PR target/93709
      	* gcc.target/powerpc/p9-minmax-3.c: New test.
      Jiufu Guo committed
    • Daily bump. · 76743c8a
      GCC Administrator committed
  3. 10 Mar, 2020 7 commits
    • libstdc++: Fix uses of _M_current in split_view's outer iterator · 0b7f1e24
      These direct uses of _M_current should all be __current() so they are
      valid when the base type doesn't satisfy the forward_range concept.
      
      	* include/std/ranges (split_view::_OuterIter::__at_end): Use __current
      	instead of _M_current.
      	(split_view::_OuterIter::operator++): Likewise.
      Jonathan Wakely committed
    • c++: Partially revert patch for PR66139. · 14af5d9b
      The patch for 66139 exposed a long-standing bug with
      split_nonconstant_init (since 4.7, apparently): initializion of individual
      elements of an aggregate are not a full-expressions, but
      split_nonconstant_init was making full-expressions out of them.  My fix for
      66139 extended the use of split_nonconstant_init, and thus the bug, to
      aggregate initialization of temporaries within an expression, in which
      context (PR94041) the bug is more noticeable.  PR93922 is a problem with my
      implementation strategy of splitting out at gimplification time, introducing
      function calls that weren't in the GENERIC.  So I'm going to revert the
      patch now and try again for GCC 11.
      
      gcc/cp/ChangeLog
      2020-03-10  Jason Merrill  <jason@redhat.com>
      
      	PR c++/93922
      	PR c++/94041
      	PR c++/52320
      	PR c++/66139
      	* cp-gimplify.c (cp_gimplify_init_expr): Partially revert patch for
      	66139: Don't split_nonconstant_init.  Remove pre_p parameter.
      Jason Merrill committed
    • PR90763: PowerPC vec_xl_len should take const argument. · e00cb200
      PR target/90763
      	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Add
      	clause to handle P9V_BUILTIN_VEC_LXVL with const arguments.
      
      	* gcc.target/powerpc/pr90763.c: New.
      Will Schmidt committed
    • libstdc++: Fix noexcept guarantees for ranges::split_view · cf0c3a45
      Also introduce the _M_i_current() accessors to solve the problem of
      access to the private member of _OuterIter from the iter_move and
      iter_swap overloads (which are only friends of _InnerIter not
      _OuterIter).
      
      	* include/std/ranges (transform_view::_Iterator::__iter_move): Remove.
      	(transform_view::_Iterator::operator*): Add noexcept-specifier.
      	(transform_view::_Iterator::iter_move): Inline __iter_move body here.
      	(split_view::_OuterIter::__current): Add noexcept.
      	(split_view::_InnerIter::__iter_swap): Remove.
      	(split_view::_InnerIter::__iter_move): Remove.
      	(split_view::_InnerIter::_M_i_current): New accessors.
      	(split_view::_InnerIter::__at_end): Use _M_i_current().
      	(split_view::_InnerIter::operator*): Likewise.
      	(split_view::_InnerIter::operator++): Likewise.
      	(iter_move(const _InnerIter&)): Likewise.
      	(iter_swap(const _InnerIter&, const _InnerIter&)): Likewise.
      	* testsuite/std/ranges/adaptors/split.cc: Check noexcept-specifier
      	for iter_move and iter_swap on split_view's inner iterator.
      Jonathan Wakely committed
    • loop-iv: make find_simple_exit static · b888a051
      Function 'find_simple_exit' is used only from loop-iv.c
      In 2004-2006 it was also used in predict.c, but since r118694
      (992c31e6) it does not.
      
      gcc/ChangeLog:
      	* loop-iv.c (find_simple_exit): Make it static.
      	* cfgloop.h: Remove the corresponding prototype.
      Roman Zhuykov committed
    • minor: fix intendation in ddg.c · 90b5ebd7
      gcc/ChangeLog:
      	* ddg.c (create_ddg): Fix intendation.
      	(set_recurrence_length): Likewise.
      	(create_ddg_all_sccs): Likewise.
      Roman Zhuykov committed