gcc.git
4 years agoc++: Fix ICE with lambda in operator function [PR93597]
Marek Polacek [Wed, 5 Feb 2020 17:53:06 +0000 (12:53 -0500)]
c++: Fix ICE with lambda in operator function [PR93597]

If we are going to use get_first_fn let's make sure we operate on
is_overloaded_fn, as the rest of the codebase does, and if lookup finds
any class-scope declaration, return early too.

PR c++/93597 - ICE with lambda in operator function.
* name-lookup.c (maybe_save_operator_binding): Check is_overloaded_fn.

* g++.dg/cpp0x/lambda/lambda-93597.C: New test.

4 years agoaarch64: ACLE intrinsics bfmmla and bfmlal<b/t>
Delia Burduv [Thu, 6 Feb 2020 09:45:52 +0000 (09:45 +0000)]
aarch64: ACLE intrinsics bfmmla and bfmlal<b/t>

This patch adds the ARMv8.6 ACLE intrinsics for bfmmla, bfmlalb and
bfmlalt as part of the BFloat16 extension.
(https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics)
The intrinsics are declared in arm_neon.h and the RTL patterns are
defined in aarch64-simd.md.  Two new tests are added to check assembler
output.

2020-02-06  Delia Burduv  <delia.burduv@arm.com>

gcc/
* config/aarch64/aarch64-simd-builtins.def
(bfmlaq): New built-in function.
(bfmlalb): New built-in function.
(bfmlalt): New built-in function.
(bfmlalb_lane): New built-in function.
(bfmlalt_lane): New built-in function.
* config/aarch64/aarch64-simd.md
(aarch64_bfmmlaqv4sf): New pattern.
(aarch64_bfmlal<bt>v4sf): New pattern.
(aarch64_bfmlal<bt>_lane<q>v4sf): New pattern.
* config/aarch64/arm_neon.h (vbfmmlaq_f32): New intrinsic.
(vbfmlalbq_f32): New intrinsic.
(vbfmlaltq_f32): New intrinsic.
(vbfmlalbq_lane_f32): New intrinsic.
(vbfmlaltq_lane_f32): New intrinsic.
(vbfmlalbq_laneq_f32): New intrinsic.
(vbfmlaltq_laneq_f32): New intrinsic.
* config/aarch64/iterators.md (BF_MLA): New int iterator.
(bt): New int attribute.

4 years agoEmit "#" instead of calling gcc_unreachable for invalid insns.
Uros Bizjak [Thu, 6 Feb 2020 16:34:21 +0000 (17:34 +0100)]
Emit "#" instead of calling gcc_unreachable for invalid insns.

Implement standard approach by emitting "#" for insns that have to be split.

* config/i386/i386.md (*pushtf): Emit "#" instead of
calling gcc_unreachable in insn output.
(*pushxf): Ditto.
(*pushdf): Ditto.
(*pushsf_rex64): Ditto for alternatives other than 1.
(*pushsf): Ditto for alternatives other than 1.

4 years agoFix PowerPC prototype documentation of __builtin_mtfsf (PR93570)
Bill Schmidt [Thu, 6 Feb 2020 13:58:42 +0000 (07:58 -0600)]
Fix PowerPC prototype documentation of __builtin_mtfsf (PR93570)

PR93570 reports that the documentation shows __builtin_mtfsf to
return a double, but this is incorrect.  The return signature
should be void.

2020-02-06  Bill Schmidt  <wschmidt@linux.ibm.com>

        PR target/93570
        * doc/extend.texi (Basic PowerPC Built-in Functions): Correct
prototype for __builtin_mtfsf.

4 years agoRevert mangling of names with -fprofile-generate=<dir>.
Martin Liska [Thu, 6 Feb 2020 13:53:28 +0000 (14:53 +0100)]
Revert mangling of names with -fprofile-generate=<dir>.

PR gcov-profile/91971
PR gcov-profile/93466
* coverage.c (coverage_init): Revert mangling of
path into filename.  It can lead to huge filename length.
Creation of subfolders seem more natural.

4 years agolibstdc++: Fix comment to refer to correct PR
Jonathan Wakely [Thu, 6 Feb 2020 11:33:12 +0000 (11:33 +0000)]
libstdc++: Fix comment to refer to correct PR

* include/bits/stl_iterator.h (__detail::__common_iter_ptr): Fix PR
number in comment. Fix indentation.

4 years agolibstdc++: decay in viewable_range should be remove_cvref (LWG 3375)
Jonathan Wakely [Thu, 6 Feb 2020 11:30:30 +0000 (11:30 +0000)]
libstdc++: decay in viewable_range should be remove_cvref (LWG 3375)

* include/bits/stl_algobase.h (__iter_swap, __iter_swap<true>): Remove
redundant _GLIBCXX20_CONSTEXPR.

4 years ago[Testsuite] – More fixes for remote execution: check_gc_sections_available, …
Tobias Burnus [Thu, 6 Feb 2020 12:27:45 +0000 (13:27 +0100)]
[Testsuite] – More fixes for remote execution: check_gc_sections_available, …

* gcc.target/arm/multilib.exp (multilib_config): Pass flags to
…_target_compile as (additional_flags=) option and not as source
filename to make it work with remote execution.
* lib/target-supports.exp (check_runtime, check_gc_sections_available,
check_effective_target_gas, check_effective_target_gld): Likewise.

4 years agolibstdc++: Remove redundant macro that is always empty
Jonathan Wakely [Thu, 6 Feb 2020 10:45:38 +0000 (10:45 +0000)]
libstdc++: Remove redundant macro that is always empty

The __iter_swap class template and explicit specialization are only
declared (and used) for C++03 so _GLIBCXX20_CONSTEXPR does nothing here.

* include/bits/stl_algobase.h (__iter_swap, __iter_swap<true>): Remove
redundant _GLIBCXX20_CONSTEXPR.

4 years ago [GCC][BUG][ARM] Fix ICE due to BFmode libfunc call (PR93300)
Stam Markianos-Wright [Wed, 5 Feb 2020 19:21:42 +0000 (19:21 +0000)]
[GCC][BUG][ARM] Fix ICE due to BFmode libfunc call (PR93300)

    This was sent and approved on gcc-patches as "[GCC][BUG][Aarch64][ARM]
    (PR93300) Fix ICE due to BFmode placement in GET_MODES_WIDER chain".

    The observed error came about because BFmode was placed between HFmode
    and SFmode in the GET_MODES_WIDER chain, resulting in convert_mode_scalar
    attempting to gen a libfunc for a HFmode -> BFmode conversion.

    This patch registers NULL for all libfuncs in BFmode, which stops the
    middle-end from attempting to generate them.

    gcc/ChangeLog:
    2020-02-06  Stam Markianos-Wright  <stam.markianos-wright@arm.com>

PR target/93300
* config/arm/arm.c (arm_block_arith_comp_libfuncs_for_mode): New.
(arm_init_libfuncs): Add BFmode support to block spurious BF libfuncs.
Use arm_block_arith_comp_libfuncs_for_mode for HFmode.

4 years agoi386: Improve avx* vector concatenation [PR93594]
Jakub Jelinek [Thu, 6 Feb 2020 10:08:59 +0000 (11:08 +0100)]
i386: Improve avx* vector concatenation [PR93594]

The following testcase shows that for _mm256_set*_m128i and similar
intrinsics, we sometimes generate bad code.  All 4 routines are expressing
the same thing, a 128-bit vector zero padded to 256-bit vector, but only the
3rd one actually emits the desired vmovdqa      %xmm0, %xmm0 insn, the
others vpxor    %xmm1, %xmm1, %xmm1; vinserti128        $0x1, %xmm1, %ymm0, %ymm0
The problem is that the cast builtins use UNSPEC_CAST which is after reload
simplified using a splitter, but during combine it prevents optimizations.
We do have avx_vec_concat* patterns that generate efficient code, both for
this low part + zero concatenation special case and for other cases too, so
the following define_insn_and_split just recognizes avx_vec_concat made of a
low half of a cast and some other reg.

2020-02-06  Jakub Jelinek  <jakub@redhat.com>

PR target/93594
* config/i386/predicates.md (avx_identity_operand): New predicate.
* config/i386/sse.md (*avx_vec_concat<mode>_1): New
define_insn_and_split.

* gcc.target/i386/avx2-pr93594.c: New test.

4 years agoopenmp: Fix handling of non-addressable shared scalars in parallel nested inside...
Jakub Jelinek [Thu, 6 Feb 2020 08:19:08 +0000 (09:19 +0100)]
openmp: Fix handling of non-addressable shared scalars in parallel nested inside of target [PR93515]

As the following testcase shows, we need to consider even target to be a construct
that forces not to use copy in/out for shared on parallel inside of the target.
E.g. for parallel nested inside another parallel or host teams, we already avoid
copy in/out and we need to treat target the same.

2020-02-06  Jakub Jelinek  <jakub@redhat.com>

PR libgomp/93515
* omp-low.c (use_pointer_for_field): For nested constructs, also
look for map clauses on target construct.
(scan_omp_1_stmt) <case GIMPLE_OMP_TARGET>: Bump temporarily
taskreg_nesting_level.

* testsuite/libgomp.c-c++-common/pr93515.c: New test.

4 years agoopenmp: Notice reduction decl in outer contexts after adding it to shared [PR93515]
Jakub Jelinek [Thu, 6 Feb 2020 08:15:13 +0000 (09:15 +0100)]
openmp: Notice reduction decl in outer contexts after adding it to shared [PR93515]

If we call omp_add_variable, following omp_notice_variable will already find it
on that construct and not go through outer constructs, the following patch fixes that.
Note, this still doesn't follow OpenMP 5.0 semantics on target combined with other
constructs with reduction/lastprivate/linear clauses, will handle that for GCC11.

2020-02-06  Jakub Jelinek  <jakub@redhat.com>

PR libgomp/93515
* gimplify.c (gimplify_scan_omp_clauses) <do_notice>: If adding
shared clause, call omp_notice_variable on outer context if any.

4 years agoInitialize barrier_cache for ARM EH ABI compliance
Alexandre Oliva [Thu, 6 Feb 2020 06:59:45 +0000 (03:59 -0300)]
Initialize barrier_cache for ARM EH ABI compliance

The ARM Exception Handling ABI requires personality functions in
phase1 to initialize barrier_cache before returning
_URC_HANDLER_FOUND, and we don't.

Although our own ARM personality function does not use barrier_cache
at all, other languages' ARM personality functions, during phase2, are
allowed and expected to test barrier_cache.sp to check whether the
handler frame was reached, which implies that personality functions is
in charge of the frame, and the remaining fields of barrier_cache hold
whatever values it put there in phase1.

Since we did not set barrier_cache.sp, an earlier exception, already
handled by a non-Ada handler and then released, may have its storage
reused for a new exception, that phase1 matches to an Ada frame, but
if that leaves barrier_cache.sp alone, the phase2 personality function
that handled the earlier exception, upon reaching the frame that
handled the earlier exception, may believe the information in
barrier_cache applies to the current exception.  The C++ personality
function, for example, would take the information in the barrier_cache
and end up activating the handler that handled the earlier exception:

  try {
    throw 1;
  } catch (int i) {
    std::cout << "caught " << i << " by c++" << std::endl;
  }
  raise_ada_exception (); // might loop back to the handler above

for  gcc/ada/ChangeLog

* raise-gcc.c (personality_body) [__ARM_EABI_UNWINDER__]:
Initialize barrier_cache.sp when ending phase1.

4 years agocgraph: A COMDAT decl always has non-zero address.
Jason Merrill [Wed, 5 Feb 2020 06:02:22 +0000 (01:02 -0500)]
cgraph: A COMDAT decl always has non-zero address.

We should be able to assume that a template instantiation or other COMDAT
has non-zero address even if MAKE_DECL_ONE_ONLY for the target sets
DECL_WEAK and we haven't yet decided to emit a definition in this
translation unit.

PR c++/92003
* symtab.c (symtab_node::nonzero_address): A DECL_COMDAT decl has
non-zero address even if weak and not yet defined.

4 years agoDaily bump.
GCC Administrator [Thu, 6 Feb 2020 00:16:31 +0000 (00:16 +0000)]
Daily bump.

4 years agoRemove trailing comma to avoid pedantic warning in C++ 98 mode: comma at end of enume...
Martin Sebor [Thu, 6 Feb 2020 00:11:38 +0000 (17:11 -0700)]
Remove trailing comma to avoid pedantic warning in C++ 98 mode: comma at end of enumerator list

4 years agoPR tree-optimization/92765 - wrong code for strcmp of a union member
Martin Sebor [Wed, 5 Feb 2020 23:55:26 +0000 (16:55 -0700)]
PR tree-optimization/92765 - wrong code for strcmp of a union member

gcc/ChangeLog:

PR tree-optimization/92765
* gimple-fold.c (get_range_strlen_tree): Handle MEM_REF and PARM_DECL.
* tree-ssa-strlen.c (compute_string_length): Remove.
(determine_min_objsize): Remove.
(get_len_or_size): Add an argument.  Call get_range_strlen_dynamic.
Avoid using type size as the upper bound on string length.
(handle_builtin_string_cmp): Add an argument.  Adjust.
(strlen_check_and_optimize_call): Pass additional argument to
handle_builtin_string_cmp.

gcc/testsuite/ChangeLog:

PR tree-optimization/92765
* g++.dg/tree-ssa/strlenopt-1.C: New test.
* g++.dg/tree-ssa/strlenopt-2.C: New test.
* gcc.dg/Warray-bounds-58.c: New test.
* gcc.dg/Wrestrict-20.c: Avoid a valid -Wformat-overflow.
* gcc.dg/Wstring-compare.c: Xfail a test.
* gcc.dg/strcmpopt_2.c: Disable tests.
* gcc.dg/strcmpopt_4.c: Adjust tests.
* gcc.dg/strcmpopt_10.c: New test.
* gcc.dg/strcmpopt_11.c: New test.
* gcc.dg/strlenopt-69.c: Disable tests.
* gcc.dg/strlenopt-92.c: New test.
* gcc.dg/strlenopt-93.c: New test.
* gcc.dg/strlenopt.h: Declare calloc.
* gcc.dg/tree-ssa/pr92056.c: Xfail tests until pr93518 is resolved.
* gcc.dg/tree-ssa/builtin-sprintf-warn-23.c: Correct test (pr93517).

4 years agoc++: Fix decltype of empty pack expansion of parm.
Jason Merrill [Wed, 5 Feb 2020 22:59:28 +0000 (17:59 -0500)]
c++: Fix decltype of empty pack expansion of parm.

In unevaluated context, we only substitute a single PARM_DECL, not the
entire chain, but the handling of an empty pack expansion was missing that
check.

PR c++/93140
* pt.c (tsubst_decl) [PARM_DECL]: Check cp_unevaluated_operand in
handling of TREE_CHAIN for empty pack.

4 years agoSimplify post epilogue_completed splitters.
Uros Bizjak [Wed, 5 Feb 2020 23:13:00 +0000 (00:13 +0100)]
Simplify post epilogue_completed splitters.

Now that we have post epilogue_completed split point for all
optimization levels, we can simplify post epilogue_completed splitters
considerably. If corresponding define_peephole2 pattern fails to
allocate a temporary register (or if peephole2 pass isn't run at all),
we can now always split invalid RTX after epilogue_completed is set.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

* config/i386/i386.md (*pushdi2_rex64 peephole2): Remove.
(*pushdi2_rex64 peephole2): Unconditionally split after
epilogue_completed.
(*ashl<mode>3_doubleword): Ditto.
(*<shift_insn><mode>3_doubleword): Ditto.

4 years agoMove CL to the correct file.
Marek Polacek [Wed, 5 Feb 2020 22:45:16 +0000 (17:45 -0500)]
Move CL to the correct file.

4 years agoAdd missing CL.
Marek Polacek [Wed, 5 Feb 2020 22:44:06 +0000 (17:44 -0500)]
Add missing CL.

4 years agoc++: Mark __builtin_convertvector operand as read [PR93557]
Jakub Jelinek [Wed, 5 Feb 2020 22:35:08 +0000 (23:35 +0100)]
c++: Mark __builtin_convertvector operand as read [PR93557]

In C++ we weren't calling mark_exp_read on the __builtin_convertvector first
argument.  I guess it could misbehave even with lambda implicit captures.

Fixed by calling decay_conversion on the argument, we use the argument as
rvalue so we want the standard lvalue to rvalue conversions, but as the
argument must be a vector type, e.g. integral promotions aren't really
needed.

2020-02-05  Jakub Jelinek  <jakub@redhat.com>

PR c++/93557
* semantics.c (cp_build_vec_convert): Call decay_conversion on arg
prior to passing it to c_build_vec_convert.

* c-c++-common/Wunused-var-17.c: New test.

4 years agoFix PR 93568 (thinko)
Michael Meissner [Wed, 5 Feb 2020 21:45:05 +0000 (16:45 -0500)]
Fix PR 93568 (thinko)

2020-02-05  Michael Meissner  <meissner@linux.ibm.com>

PR target/93568
* config/rs6000/rs6000.c (get_vector_offset): Fix

4 years agoc++: Fix ICE with CONSTRUCTOR flags verification [PR93559]
Marek Polacek [Wed, 5 Feb 2020 17:25:01 +0000 (12:25 -0500)]
c++: Fix ICE with CONSTRUCTOR flags verification [PR93559]

Since reshape_init_array_1 can now reuse a single constructor for
an array of non-aggregate type, we might run into a scenario where
we reuse a constructor with TREE_SIDE_EFFECTS.  This broke this test
because we have something like { { expr } } and we try to reshape it,
so we recurse on the inner CONSTRUCTOR, reuse an existing CONSTRUCTOR
with TREE_SIDE_EFFECTS, and then ICE on the discrepancy because the
outermost CONSTRUCTOR doesn't have TREE_SIDE_EFFECTS.  In this case
EXPR was a call to an operator function so TREE_SIDE_EFFECTS should
be set.  Naturally one would want to fix this by calling
recompute_constructor_flags in an appropriate place so that the flags
on the CONSTRUCTORs match.  The appropriate place would be at the end
of reshape_init, but this breaks initlist109.C: there we are dealing
with { { TARGET_EXPR <{}> } } where the outermost { } is TREE_CONSTANT
but the inner { } is not, so recompute_constructor_flags would clear
the constant flag in the outermost { }.  Seems resonable but it upsets
check_initializer which then complains about "non-constant in-class
initialization invalid for static member".  TARGET_EXPRs are always
created with TREE_SIDE_EFFECTS on, but that is mutually exclusive
with TREE_CONSTANT.  So we're in a bind.

Fixed by not reusing a CONSTRUCTOR that has TREE_SIDE_EFFECTS; in the
grand scheme of things it isn't measurable: it only affects ~3 tests
in the testsuite.

PR c++/93559 - ICE with CONSTRUCTOR flags verification.
* decl.c (reshape_init_array_1): Don't reuse a CONSTRUCTOR with
TREE_SIDE_EFFECTS.

* g++.dg/cpp0x/initlist119.C: New test.
* g++.dg/cpp0x/initlist120.C: New test.

4 years agoc++: Fix SEGV with malformed constructor decl.
Jason Merrill [Tue, 4 Feb 2020 23:49:16 +0000 (18:49 -0500)]
c++: Fix SEGV with malformed constructor decl.

In the testcase, since there's no declaration of T, ref_view(T) declares a
non-static data member T of type ref_view, the same type as its enclosing
class.  Then when we try to do C++20 aggregate class template argument
deduction we recursively try to adjust the braced-init-list to match the
template class definition until we run out of stack.

Fixed by rejecting the template data member.

PR c++/92593
* decl.c (grokdeclarator): Reject field of current class type even
in a template.

4 years agoamdgcn: Remove redundant multilib
Andrew Stubbs [Wed, 5 Feb 2020 16:58:41 +0000 (16:58 +0000)]
amdgcn: Remove redundant multilib

2020-02-05  Andrew Stubbs  <ams@codesourcery.com>

gcc/
* config/gcn/t-gcn-hsa (MULTILIB_OPTIONS): Use / not space.

4 years agoFix testsuite "regression" on hppa after recent IRA changes.
Jeff Law [Wed, 5 Feb 2020 17:00:48 +0000 (10:00 -0700)]
Fix testsuite "regression" on hppa after recent IRA changes.

* gcc.target/hppa/shadd-3.c: Disable delay slot filling and
adjust expected shadd insn count appropriately.

4 years ago[libgomp] – Fix check_effective_target_offload_target_nvptx for remote execution
Tobias Burnus [Wed, 5 Feb 2020 16:40:48 +0000 (17:40 +0100)]
[libgomp] – Fix check_effective_target_offload_target_nvptx for remote execution

* testsuite/lib/libgomp.exp
(check_effective_target_offload_target_nvptx): Pass flags as 'options'
and not as 'source' argument to libgomp_target_compile.

4 years agolibstdc++: Remove workarounds for constraints on alias templates
Jonathan Wakely [Wed, 5 Feb 2020 10:35:19 +0000 (10:35 +0000)]
libstdc++: Remove workarounds for constraints on alias templates

The G++ bug has been fixed for a couple of months so we can remove these
workarounds that define alias templates in terms of constrained class
templates. We can just apply constraints directly to alias templates as
specified in the C++20 working draft.

* include/bits/iterator_concepts.h (iter_reference_t)
(iter_rvalue_reference_t, iter_common_reference_t, indirect_result_t):
Remove workarounds for PR c++/67704.
* testsuite/24_iterators/aliases.cc: New test.

4 years agoanalyzer: add enode status and revamp __analyzer_dump_exploded_nodes
David Malcolm [Tue, 4 Feb 2020 21:23:27 +0000 (16:23 -0500)]
analyzer: add enode status and revamp __analyzer_dump_exploded_nodes

The analyzer recognizes __analyzer_dump_exploded_nodes as a "magic"
function for use in DejaGnu tests: at the end of the pass, it issues
a warning at each such call, dumping the count of exploded nodes seen at
the call, which can be checked in test cases via dg-warning directives,
along with the IDs of the enodes (which is helpful when debugging).

My intent was to give a way of testing the results of the state-merging
code.

The state-merging code can generate duplicate exploded nodes at a point
when state merging occurs, taking a pair of enodes from the worklist
that share a program_point and sufficiently similar state.  For these
cases it generates a merged state, and adds edges from those enodes to
the merged-state enode (potentially a new or a pre-existing enode); the
input enodes don't have process_node called on them.

This means that at a CFG join point there can be an unpredictable number
of enodes that we don't care about, where the precise number depends on
the details of the state-merger code, immediately followed by a more
predictable number that we do care about.

I've been papering over this in the analyzer DejaGnu tests somewhat
by adding pairs of __analyzer_dump_exploded_nodes calls at CFG join
points, where the output at the first call is somewhat arbitrary, and
the second has the number we care about; the first number tends to
change "at random" as I tweak the state merging code, in ways that
aren't interesting, but require the tests to be updated.

See e.g. gcc.dg/analyzer/paths-6.c which had:

  __analyzer_dump_exploded_nodes (0); /* { dg-warning "2 exploded nodes" } */
  // FIXME: the above can vary between 2 and 3 exploded nodes
  __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 exploded node" } */

This patch remedies this situation by tracking which enodes are
processed, and which are merely "merger" enodes.  It updates the
output for __analyzer_dump_exploded_nodes so that count of enodes
only includes the *processed* enodes, and that the IDs are split
into "processed" and "merger" enodes.

The patch simplifies the testsuite by eliminating the redundant calls
described above; the example above becomes:

  __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */

where the output in question is now:

  warning: 1 processed enode: [EN: 94] merger(s): [EN: 93]

The patch also adds various checks on the status of enodes, to ensure
e.g. that each enode is processed at most once.

gcc/analyzer/ChangeLog:
* engine.cc (exploded_node::dump_dot): Show merger enodes.
(worklist::add_node): Assert that the node's m_status is
STATUS_WORKLIST.
(exploded_graph::process_worklist): Likewise for nodes from the
worklist.  Set status of merged nodes to STATUS_MERGER.
(exploded_graph::process_node): Set status of node to
STATUS_PROCESSED.
(exploded_graph::dump_exploded_nodes): Rework handling of
"__analyzer_dump_exploded_nodes", splitting enodes by status into
"processed" and "merger", showing the count of just the processed
enodes at the call, rather than the count of all enodes.
* exploded-graph.h (exploded_node::status): New enum.
(exploded_node::exploded_node): Initialize m_status to
STATUS_WORKLIST.
(exploded_node::get_status): New getter.
(exploded_node::set_status): New setter.
(exploded_node::m_status): New field.

gcc/ChangeLog:
* doc/analyzer.texi
(Special Functions for Debugging the Analyzer): Update description
of __analyzer_dump_exploded_nodes.

gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/data-model-1.c: Update for changed output to
__analyzer_dump_exploded_nodes, dropping redundant call at merger.
* gcc.dg/analyzer/data-model-7.c: Likewise.
* gcc.dg/analyzer/loop-2.c: Update for changed output format.
* gcc.dg/analyzer/loop-2a.c: Likewise.
* gcc.dg/analyzer/loop-4.c: Likewise.
* gcc.dg/analyzer/loop.c: Likewise.
* gcc.dg/analyzer/malloc-paths-10.c: Likewise; drop redundant
call at merger.
* gcc.dg/analyzer/malloc-vs-local-1a.c: Likewise.
* gcc.dg/analyzer/malloc-vs-local-1b.c: Likewise.
* gcc.dg/analyzer/malloc-vs-local-2.c: Likewise.
* gcc.dg/analyzer/malloc-vs-local-3.c: Likewise.
* gcc.dg/analyzer/paths-1.c: Likewise.
* gcc.dg/analyzer/paths-1a.c: Likewise.
* gcc.dg/analyzer/paths-2.c: Likewise.
* gcc.dg/analyzer/paths-3.c: Likewise.
* gcc.dg/analyzer/paths-4.c: Update for changed output format.
* gcc.dg/analyzer/paths-5.c: Likewise.
* gcc.dg/analyzer/paths-6.c: Likewise; drop redundant calls
at merger.
* gcc.dg/analyzer/paths-7.c: Likewise.
* gcc.dg/analyzer/torture/conditionals-2.c: Update for changed
output format.
* gcc.dg/analyzer/zlib-1.c: Likewise; drop redundant calls.
* gcc.dg/analyzer/zlib-5.c: Update for changed output format.

4 years agoi386: Omit clobbers from vzeroupper until final [PR92190]
Jakub Jelinek [Wed, 5 Feb 2020 14:38:49 +0000 (15:38 +0100)]
i386: Omit clobbers from vzeroupper until final [PR92190]

As mentioned in the PR, the CLOBBERs in vzeroupper are added there even for
registers that aren't ever live in the function before and break the
prologue/epilogue expansion with ms ABI (normal ABIs are fine, as they
consider all [xyz]mm registers call clobbered, but the ms ABI considers
xmm0-15 call used but the bits above low 128 ones call clobbered).
The following patch fixes it by not adding the clobbers during vzeroupper
pass (before pro_and_epilogue), but adding them for -fipa-ra purposes only
during the final output.  Perhaps we could add some CLOBBERs early (say for
df_regs_ever_live_p regs that aren't live in the live_regs bitmap, or
depending on the ABI either add all of them immediately, or for ms ABI add
CLOBBERs for xmm0-xmm5 if they don't have a SET) and add the rest later.
And the addition could be perhaps done at other spots, e.g. in an
epilogue_completed guarded splitter.

2020-02-05  Jakub Jelinek  <jakub@redhat.com>

PR target/92190
* config/i386/i386-features.c (ix86_add_reg_usage_to_vzeroupper): Only
include sets and not clobbers in the vzeroupper pattern.
* config/i386/sse.md (*avx_vzeroupper): Require in insn condition that
the parallel has 17 (64-bit) or 9 (32-bit) elts.
(*avx_vzeroupper_1): New define_insn_and_split.

* gcc.target/i386/pr92190.c: New test.

4 years agoi386: Schedule the only -O0 split pass on x86 after pro_and_epilogue/jump2 [PR92190]
Jakub Jelinek [Wed, 5 Feb 2020 14:35:46 +0000 (15:35 +0100)]
i386: Schedule the only -O0 split pass on x86 after pro_and_epilogue/jump2 [PR92190]

The problem is that x86 is the only target that defines HAVE_ATTR_length and
doesn't schedule any splitting pass at -O0 after pro_and_epilogue.

So, either we go back to handling this during vzeroupper output
(unconditionally, rather than flag_ipa_ra guarded), or we need to tweak the
split* passes for x86.

Seems there are 5 split passes, split1 is run unconditionally before reload,
split2 is run for optimize > 0 or STACK_REGS (x86) after ra but before
epilogue_completed, split3 is run before regstack for STACK_REGS and
optimize and -fno-schedule-insns2, split4 is run before sched2 if sched2 is
run and split5 is run before shorten_branches if HAVE_ATTR_length and not
STACK_REGS.

2020-02-05  Jakub Jelinek  <jakub@redhat.com>

PR target/92190
* recog.c (pass_split_after_reload::gate): For STACK_REGS targets,
don't run when !optimize.
(pass_split_before_regstack::gate): For STACK_REGS targets, run even
when !optimize.

4 years agotestsuite/92177 fix for SLP build changes
Richard Biener [Wed, 5 Feb 2020 13:10:50 +0000 (14:10 +0100)]
testsuite/92177 fix for SLP build changes

We're now consistently building SLP operations with only
scalar defs from scalars which makes the testcase no longer
testing multiplication vectorization.  The following smuggles
in a constant making the vector variant profitable for SLP build.

2020-02-05  Richard Biener  <rguenther@suse.de>

PR testsuite/92177
* gcc.dg/vect/bb-slp-22.c: Adjust.

4 years agomiddle-end/90648 fend off builtin calls with not enough arguments from match
Richard Biener [Wed, 5 Feb 2020 13:04:29 +0000 (14:04 +0100)]
middle-end/90648 fend off builtin calls with not enough arguments from match

This adds guards to genmatch generated code before accessing call
expression or stmt arguments that might be out of bounds when
the user provided bogus prototypes for what we consider builtins.

2020-02-05  Richard Biener  <rguenther@suse.de>

PR middle-end/90648
* genmatch.c (dt_node::gen_kids_1): Emit number of argument
checks before matching calls.

* gcc.dg/pr90648.c: New testcase.

4 years agolibiberty/hashtab: More const parameters
Andrew Burgess [Mon, 27 Jan 2020 22:06:35 +0000 (22:06 +0000)]
libiberty/hashtab: More const parameters

Makes some parameters const in libiberty's hashtab library.

include/ChangeLog:

        * hashtab.h (htab_remove_elt): Make a parameter const.
        (htab_remove_elt_with_hash): Likewise.

libiberty/ChangeLog:

        * hashtab.c (htab_remove_elt): Make a parameter const.
        (htab_remove_elt_with_hash): Likewise.

4 years agoIncrease index number for creating temp vars' name.
Bin Cheng [Wed, 5 Feb 2020 10:45:08 +0000 (18:45 +0800)]
Increase index number for creating temp vars' name.

gcc/cp
    * coroutines.cc (maybe_promote_captured_temps): Increase the index
    number for temporary variables' name.

4 years agoFix up comment typo.
Jakub Jelinek [Wed, 5 Feb 2020 10:36:25 +0000 (11:36 +0100)]
Fix up comment typo.

2020-02-05  Jakub Jelinek  <jakub@redhat.com>

* tree-ssa-alias.c (aliasing_matching_component_refs_p): Fix up
function comment typo.

4 years agoopenmp: Avoid ICEs with declare simd; declare simd inbranch [PR93555]
Jakub Jelinek [Wed, 5 Feb 2020 10:32:37 +0000 (11:32 +0100)]
openmp: Avoid ICEs with declare simd; declare simd inbranch [PR93555]

The testcases ICE because when processing the declare simd inbranch,
we don't create the i == 0 clone as it already exists, which means
clone_info->nargs is not adjusted, but we then rely on it being adjusted
when trying other clones.

2020-02-05  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/93555
* omp-simd-clone.c (expand_simd_clones): If simd_clone_mangle or
simd_clone_create failed when i == 0, adjust clone->nargs by
clone->inbranch.

* c-c++-common/gomp/pr93555-1.c: New test.
* c-c++-common/gomp/pr93555-2.c: New test.
* gfortran.dg/gomp/pr93555.f90: New test.

4 years agoDo not load body for alias symbols.
Martin Liska [Wed, 5 Feb 2020 08:56:31 +0000 (09:56 +0100)]
Do not load body for alias symbols.

PR lto/93489
* lto-dump.c (dump_list_functions): Do not
load body for aliases.
(dump_body): Likewise here.

4 years agoDocument ASLR for Precompiled Headers.
Martin Liska [Wed, 5 Feb 2020 08:55:09 +0000 (09:55 +0100)]
Document ASLR for Precompiled Headers.

PR c++/92717
* doc/invoke.texi: Document that one should
not combine ASLR and -fpch.

4 years agolibstdc++: Apply the move_iterator changes described in P1207R4
Patrick Palka [Wed, 22 Jan 2020 21:51:19 +0000 (16:51 -0500)]
libstdc++: Apply the move_iterator changes described in P1207R4

These changes are needed for some of the tests in the constrained algorithm
patch, because they use move_iterator with an uncopyable output_iterator.  The
other changes described in the paper are already applied, it seems.

libstdc++-v3/ChangeLog:

* include/bits/stl_iterator.h (move_iterator::move_iterator): Move __i
when initializing _M_current.
(move_iterator::base): Split into two overloads differing in
ref-qualifiers as in P1207R4 for C++20.

4 years agoHandle type deduction of auto and decltype(auto) with reference expression
JunMa [Tue, 21 Jan 2020 10:18:09 +0000 (18:18 +0800)]
Handle type deduction of auto and decltype(auto) with reference expression

gcc/cp
    * coroutines.cc (build_co_await): Call convert_from_reference
    to wrap co_await_expr with indirect_ref which avoid
    reference/non-reference type confusion.

    (co_await_expander):  Sink to call_expr if await_resume
    is wrapped by indirect_ref.

gcc/testsuite
    * g++.dg/coroutines/co-await-14-return-ref-to-auto.C: New test.

4 years agoDaily bump.
GCC Administrator [Wed, 5 Feb 2020 00:16:31 +0000 (00:16 +0000)]
Daily bump.

4 years agoc++: Fix error-recovery with concepts.
Jason Merrill [Tue, 4 Feb 2020 22:18:35 +0000 (17:18 -0500)]
c++: Fix error-recovery with concepts.

Here, push_tinst_level refused to push into the scope of Foo::Foo
because it was triggered from the ill-formed function fun.  But we didn't
check the return value and tried to pop the un-pushed level.

PR c++/93551
* constraint.cc (satisfy_declaration_constraints): Check return
value of push_tinst_level.

4 years agoc++: Fix constexpr vs. omitted aggregate init.
Jason Merrill [Tue, 4 Feb 2020 20:54:17 +0000 (15:54 -0500)]
c++: Fix constexpr vs. omitted aggregate init.

Value-initialization is importantly different from {}-initialization for
this testcase, where the former calls the deleted S constructor and the
latter initializes S happily.

PR c++/90951
* constexpr.c (cxx_eval_array_reference): {}-initialize missing
elements instead of value-initializing them.

4 years agoc++: Fix ({ ... }) array mem-initializer.
Jason Merrill [Tue, 4 Feb 2020 19:21:59 +0000 (14:21 -0500)]
c++: Fix ({ ... }) array mem-initializer.

Here, we were going down the wrong path in perform_member_init because of
the incorrect parens around the mem-initializer for the array.  And then
cxx_eval_vec_init_1 didn't know what to do with a CONSTRUCTOR as the
initializer.  The latter issue was a straightforward fix, but I also wanted
to fix us silently accepting the parens, which led to factoring out handling
of TREE_LIST and flexarrays.  The latter led to adjusting the expected
behavior on flexary29.C: we should complain about the initializer, but not
complain about a missing initializer.

As I commented on PR 92812, in this process I noticed that we weren't
handling C++20 parenthesized aggregate initialization as a mem-initializer.
So my TREE_LIST handling includes a commented out section that should
probably be part of a future fix for that issue; with it uncommented we
continue to crash on the testcase in C++20 mode, but should instead complain
about the braced-init-list not being a valid initializer for an A.

PR c++/86917
* init.c (perform_member_init): Simplify.
* constexpr.c (cx_check_missing_mem_inits): Allow uninitialized
flexarray.
(cxx_eval_vec_init_1): Handle CONSTRUCTOR.

4 years agoanalyzer: fix testsuite assumption that sizeof(int) > 2
David Malcolm [Mon, 3 Feb 2020 20:39:50 +0000 (15:39 -0500)]
analyzer: fix testsuite assumption that sizeof(int) > 2

Fix some failures on xstormy16-elf:
  gcc.dg/analyzer/data-model-1.c  (test for warnings, line 595)
  gcc.dg/analyzer/data-model-1.c  (test for warnings, line 642)
  gcc.dg/analyzer/data-model-1.c  (test for warnings, line 690)
  gcc.dg/analyzer/data-model-1.c  (test for warnings, line 738)

due to:

warning: overflow in conversion from ‘long int’ to ‘int’ changes
  value from ‘100024’ to ‘-31048’ [-Woverflow]
    20 |   p[0].x = 100024;
       |            ^~~~~~

gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/data-model-1.c (struct coord): Convert fields
from int to long.

4 years agoanalyzer: fix build error with clang (PR 93543)
David Malcolm [Tue, 28 Jan 2020 21:31:01 +0000 (16:31 -0500)]
analyzer: fix build error with clang (PR 93543)

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243681 reports a build
failure with clang 9.0.1:

gcc/analyzer/engine.cc:2971:13: error:
      reinterpret_cast from 'nullptr_t' to 'function *' is not allowed
  v.m_fun = reinterpret_cast<function *> (NULL);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
engine.cc:2983:21: error:
      reinterpret_cast from 'nullptr_t' to 'function *' is not allowed
  return v.m_fun == reinterpret_cast<function *> (NULL);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The casts appears to be unnecessary; eliminate them.

gcc/analyzer/ChangeLog:
PR analyzer/93543
* engine.cc (pod_hash_traits<function_call_string>::mark_empty):
Eliminate reinterpret_cast.
(pod_hash_traits<function_call_string>::is_empty): Likewise.

4 years agotree-optimization/93538 - add missing comparison folding case
Richard Biener [Tue, 4 Feb 2020 14:17:01 +0000 (15:17 +0100)]
tree-optimization/93538 - add missing comparison folding case

This adds back a folding that worked in GCC 4.5 times by amending
the pattern that handles other cases of address vs. SSA name
comparisons.

2020-02-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/93538
* match.pd (addr EQ/NE ptr): Amend to handle &ptr->x EQ/NE ptr.

* gcc.dg/tree-ssa/forwprop-38.c: New testcase.

4 years agolibstdc++: Fix name of macro in #undef directive
Jonathan Wakely [Tue, 4 Feb 2020 13:30:57 +0000 (13:30 +0000)]
libstdc++: Fix name of macro in #undef directive

The macro that is defined is _GLIBCXX_NOT_FN_CALL_OP but the macro that
was named in the #undef directive was _GLIBCXX_NOT_FN_CALL. This fixes
the #undef.

* include/std/functional (_GLIBCXX_NOT_FN_CALL_OP): Un-define after
use.

4 years agolibstdc++: Fix regressions in unique_ptr::swap (PR 93562)
Jonathan Wakely [Tue, 4 Feb 2020 12:59:14 +0000 (12:59 +0000)]
libstdc++: Fix regressions in unique_ptr::swap (PR 93562)

The requirements for this function are only that the deleter is
swappable, but we incorrectly require that the element type is complete
and that the deleter can be swapped using std::swap (which requires it
to be move cosntructible and move assignable).

The fix is to add __uniq_ptr_impl::swap which swaps the pointer and
deleter individually, instead of using the generic std::swap on the
tuple containing them.

PR libstdc++/93562
* include/bits/unique_ptr.h (__uniq_ptr_impl::swap): Define.
(unique_ptr::swap, unique_ptr<T[], D>::swap): Call it.
* testsuite/20_util/unique_ptr/modifiers/93562.cc: New test.

4 years agolibcpp: Diagnose __has_include outside of preprocessor directives [PR93545]
Jakub Jelinek [Tue, 4 Feb 2020 12:40:56 +0000 (13:40 +0100)]
libcpp: Diagnose __has_include outside of preprocessor directives [PR93545]

Add forgotten gcc/testsuite/c-c++-common/gomp/has-include-1.c.

2020-02-04  Jakub Jelinek  <jakub@redhat.com>

* macro.c (builtin_has_include): Diagnose __has_include* use outside
of preprocessing directives.

* c-c++-common/cpp/has-include-1.c: New test.
* c-c++-common/cpp/has-include-next-1.c: New test.
* c-c++-common/gomp/has-include-1.c: New test.

4 years agolibcpp: Diagnose __has_include outside of preprocessor directives [PR93545]
Jakub Jelinek [Tue, 4 Feb 2020 12:39:59 +0000 (13:39 +0100)]
libcpp: Diagnose __has_include outside of preprocessor directives [PR93545]

The standard says http://eel.is/c++draft/cpp.cond#7.sentence-2 that
__has_include can't appear at arbitrary places in the source.  As we have
not recognized __has_include* outside of preprocessing directives in the
past, accepting it there now would be a regression.  The patch does still
allow it in #define if it is then used in preprocessing directives, I guess
that use isn't strictly valid either, but clang seems to accept it.

2020-02-04  Jakub Jelinek  <jakub@redhat.com>

* macro.c (builtin_has_include): Diagnose __has_include* use outside
of preprocessing directives.

* c-c++-common/cpp/has-include-1.c: New test.
* c-c++-common/cpp/has-include-next-1.c: New test.
* c-c++-common/gomp/has-include-1.c: New test.

4 years agolibcpp: Fix ICEs on __has_include syntax errors [PR93545]
Jakub Jelinek [Tue, 4 Feb 2020 12:38:16 +0000 (13:38 +0100)]
libcpp: Fix ICEs on __has_include syntax errors [PR93545]

Some of the following testcases ICE, because one of the cpp_get_token
calls in builtin_has_include reads the CPP_EOF token but the caller isn't
aware that CPP_EOF has been reached and will do another cpp_get_token.
get_token_no_padding is something that is use by the
has_attribute/has_builtin callbacks, which will first peek and will not
consume CPP_EOF (but will consume other tokens).  The !SEEN_EOL ()
check on the other side doesn't work anymore and isn't really needed,
as we don't consume the EOF.  The change adds one further error to the
pr88974.c testcase, if we wanted just one error per __has_include,
we could add some boolean whether we've emitted errors already and
only emit the first one we encounter (not implemented).

2020-02-04  Jakub Jelinek  <jakub@redhat.com>

PR preprocessor/93545
* macro.c (cpp_get_token_no_padding): New function.
(builtin_has_include): Use it instead of cpp_get_token.  Don't check
SEEN_EOL.

* c-c++-common/cpp/pr88974.c: Expect another diagnostics during error
recovery.
* c-c++-common/cpp/pr93545-1.c: New test.
* c-c++-common/cpp/pr93545-2.c: New test.
* c-c++-common/cpp/pr93545-3.c: New test.
* c-c++-common/cpp/pr93545-4.c: New test.

4 years agocoroutines: Prevent repeated error messages for missing promise.
Iain Sandoe [Tue, 4 Feb 2020 09:36:30 +0000 (09:36 +0000)]
coroutines: Prevent repeated error messages for missing promise.

If the user's coroutine return type omits the mandatory promise
type then we will currently restate that error each time we see
a coroutine keyword, which doesn't provide any new information.
This suppresses all but the first instance in each coroutine.

gcc/cp/ChangeLog:

2020-02-04  Iain Sandoe  <iain@sandoe.co.uk>

* coroutines.cc (find_promise_type): Delete unused forward
declaration.
(struct coroutine_info): Add a bool for no promise type error.
(coro_promise_type_found_p): Only emit the error for a missing
promise once in each affected coroutine.

gcc/testsuite/ChangeLog:

2020-02-04  Iain Sandoe  <iain@sandoe.co.uk>

* g++.dg/coroutines/coro-missing-promise.C: New test.

4 years agotree-optimization/91123 - restore redundant store removal
Richard Biener [Fri, 31 Jan 2020 12:28:11 +0000 (13:28 +0100)]
tree-optimization/91123 - restore redundant store removal

Redundant store removal in FRE was restricted for correctness reasons.
The following extends correctness fixes required to memcpy/aggregate
copy translation.  The main change is that we no longer insert
references rewritten to cover such aggregate copies into the hashtable
but the original one.

2020-02-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/91123
* tree-ssa-sccvn.c (vn_walk_cb_data::finish): New method.
(vn_walk_cb_data::last_vuse): New member.
(vn_walk_cb_data::saved_operands): Likewsie.
(vn_walk_cb_data::~vn_walk_cb_data): Release saved_operands.
(vn_walk_cb_data::push_partial_def): Use finish.
(vn_reference_lookup_2): Update last_vuse and use finish if
we've saved operands.
(vn_reference_lookup_3): Use finish and update calls to
push_partial_defs everywhere.  When translating through
memcpy or aggregate copies save off operands and alias-set.
(eliminate_dom_walker::eliminate_stmt): Restore VN_WALKREWRITE
operation for redundant store removal.

* gcc.dg/tree-ssa/ssa-fre-85.c: New testcase.

4 years agotree-optimization/92819 restrict new vector CTOR canonicalization
Richard Biener [Tue, 4 Feb 2020 09:03:03 +0000 (10:03 +0100)]
tree-optimization/92819 restrict new vector CTOR canonicalization

The PR shows that code generation ends up pessimized by the new
canonicalization rules that end up nailing do-not-care elements
to specific values making it hard to generate good code later.

The temporary solution is to avoid this for the cases we also
obviously know the canonicalization will create more GIMPLE stmts than
before.

2020-02-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/92819
* tree-ssa-forwprop.c (simplify_vector_constructor): Avoid
generating more stmts than before.

* gcc.target/i386/pr92819.c: New testcase.
* gcc.target/i386/pr92803.c: Adjust.

4 years agoFix release checking build of ARM.
Martin Liska [Tue, 4 Feb 2020 08:23:22 +0000 (09:23 +0100)]
Fix release checking build of ARM.

* config/arm/arm.c (arm_gen_far_branch): Move the function
outside of selftests.

4 years agosyscall: fix riscv64 GNU/Linux build
Ian Lance Taylor [Mon, 3 Feb 2020 20:29:45 +0000 (12:29 -0800)]
syscall: fix riscv64 GNU/Linux build

Make syscall_linux_riscv64.go, new in the 1.14beta1 release, look like
the other syscall_linux_GOARCH.go files.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/217577

4 years agolibbacktrace: always pass -g when compiling test code
Ian Lance Taylor [Tue, 4 Feb 2020 00:44:33 +0000 (16:44 -0800)]
libbacktrace: always pass -g when compiling test code

This approach required adding a few casts to ztest.c, as it is now
compiled with -Wall.

Fixes PR libbacktrace/90636

4 years agoDaily bump.
GCC Administrator [Tue, 4 Feb 2020 00:16:49 +0000 (00:16 +0000)]
Daily bump.

4 years agoOptimize vec_extract of vectors in memory with a PC-relative address.
Michael Meissner [Mon, 3 Feb 2020 23:25:07 +0000 (18:25 -0500)]
Optimize vec_extract of vectors in memory with a PC-relative address.

2020-02-03  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/rs6000.c (adjust_vec_address_pcrel): New helper
function to adjust PC-relative vector addresses.
(rs6000_adjust_vec_address): Call adjust_vec_address_pcrel to
handle vectors with PC-relative addresses.

4 years agoRewrite convulated code to avoid adding r0.
Michael Meissner [Mon, 3 Feb 2020 23:22:18 +0000 (18:22 -0500)]
Rewrite convulated code to avoid adding r0.

2020-02-03  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/rs6000.c (reg_to_non_prefixed): Add forward
reference.
(hard_reg_and_mode_to_addr_mask): Delete.
(rs6000_adjust_vec_address): If the original vector address
was REG+REG or REG+OFFSET and the element is not zero, do the add
of the elements in the original address before adding the offset
for the vector element.  Use address_to_insn_form to validate the
address using the register being loaded, rather than guessing
whether the address is a DS-FORM or DQ-FORM address.

4 years agoAdjust how variable vector extraction is done.
Michael Meissner [Mon, 3 Feb 2020 22:57:57 +0000 (17:57 -0500)]
Adjust how variable vector extraction is done.

2020-02-03  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/rs6000.c (get_vector_offset): New helper function
to calculate the offset in memory from the start of a vector of a
particular element.  Add code to keep the element number in
bounds if the element number is variable.
(rs6000_adjust_vec_address): Move calculation of offset of the
vector element to get_vector_offset.
(rs6000_split_vec_extract_var): Do not do the initial AND of
element here, move the code to get_vector_offset.

4 years agoc++: Fix constexpr vs. reference parameter.
Jason Merrill [Mon, 3 Feb 2020 21:03:45 +0000 (16:03 -0500)]
c++: Fix constexpr vs. reference parameter.

[expr.const] specifically rules out mentioning a reference even if its
address is never used, because it implies indirection that is similarly
non-constant for a pointer variable.

PR c++/66477
* constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
defer loading the value of a reference.

4 years agoc++: Allow parm of empty class type in constexpr.
Jason Merrill [Mon, 3 Feb 2020 16:11:55 +0000 (11:11 -0500)]
c++: Allow parm of empty class type in constexpr.

Since copying a class object is defined in terms of the copy constructor,
copying an empty class is OK even if it would otherwise not be usable in a
constant expression.  Relatedly, using a parameter as an lvalue is no more
problematic than a local variable, and calling a member function uses the
object as an lvalue.

PR c++/91953
* constexpr.c (potential_constant_expression_1) [PARM_DECL]: Allow
empty class type.
[COMPONENT_REF]: A member function reference doesn't use the object
as an rvalue.

4 years agoAdd some gcc_asserts for vector extract processing.
Michael Meissner [Mon, 3 Feb 2020 20:50:39 +0000 (15:50 -0500)]
Add some gcc_asserts for vector extract processing.

2020-02-03  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/rs6000.c (rs6000_adjust_vec_address): Add some
gcc_asserts.

4 years agocoroutines: Fix ICE on invalid (PR93458).
Iain Sandoe [Mon, 3 Feb 2020 19:15:31 +0000 (19:15 +0000)]
coroutines: Fix ICE on invalid (PR93458).

Since coroutine-ness is discovered lazily, we encounter the diagnostics
during each keyword parse.  We were not handling the case where a user code
failed to include fundamental information (e.g. the traits) in a graceful
manner.

Once we've emitted an error for this level of fail, then we suppress
additional copies (otherwise the same thing will be reported for every
coroutine keyword seen).

gcc/cp/ChangeLog:

2020-02-03  Iain Sandoe  <iain@sandoe.co.uk>

* coroutines.cc (struct coroutine_info): Add a bool flag to note
that we emitted an error for a bad function return type.
(get_coroutine_info): Tolerate an unset info table in case of
missing traits.
(find_coro_traits_template_decl): In case of error or if we didn't
find a type template, note we emitted the error and suppress
duplicates.
(find_coro_handle_template_decl): Likewise.
(instantiate_coro_traits): Only check for error_mark_node in the
return from lookup_qualified_name.
(coro_promise_type_found_p): Reorder initialization so that we check
for the traits and their usability before allocation of the info
table.  Check for a suitable return type and emit a diagnostic for
here instead of relying on the lookup machinery.  This allows the
error to have a better location, and means we can suppress multiple
copies.
(coro_function_valid_p): Re-check for a valid promise (and thus the
traits) before proceeding.  Tolerate missing info as a fatal error.

gcc/testsuite/ChangeLog:

2020-02-03  Iain Sandoe  <iain@sandoe.co.uk>

* g++.dg/coroutines/pr93458-1-missing-traits.C: New test.
* g++.dg/coroutines/pr93458-2-bad-traits.C: New test.
* g++.dg/coroutines/pr93458-3-missing-handle.C: New test.
* g++.dg/coroutines/pr93458-4-bad-coro-handle.C: New test.
* g++.dg/coroutines/pr93458-5-bad-coro-type.C: New test.

4 years agoanalyzer: avoid use of fold_build2
David Malcolm [Thu, 30 Jan 2020 20:23:40 +0000 (15:23 -0500)]
analyzer: avoid use of fold_build2

Various places in the analyzer use fold_build2, test the result, then
discard it.  It's more efficient to use fold_binary, which avoids
building and GC-ing a redundant tree for the cases where folding fails.

gcc/analyzer/ChangeLog:
* constraint-manager.cc (range::constrained_to_single_element):
Replace fold_build2 with fold_binary.  Remove unnecessary newline.
(constraint_manager::get_or_add_equiv_class): Replace fold_build2
with fold_binary in two places, and remove out-of-date comment.
(constraint_manager::eval_condition): Replace fold_build2 with
fold_binary.
* region-model.cc (constant_svalue::eval_condition): Likewise.
(region_model::on_assignment): Likewise.

4 years agoanalyzer: detect zero-assignment in phis (PR 93544)
David Malcolm [Mon, 3 Feb 2020 16:23:09 +0000 (11:23 -0500)]
analyzer: detect zero-assignment in phis (PR 93544)

PR analyzer/93544 reports an ICE when attempting to report a double-free
within diagnostic_manager::prune_for_sm_diagnostic, in which the
variable of interest has become an INTEGER_CST.  Additionally, it picks
a nonsensical path through the function in which the pointer being
double-freed is known to be NULL, which we shouldn't complain about.

The dump shows that it picks the INTEGER_CST when updating var at a phi
node:
    considering event 4, with var: ‘iftmp.0_2’, state: ‘start’
    updating from ‘iftmp.0_2’ to ‘0B’ based on phi node
      phi: iftmp.0_2 = PHI <iftmp.0_6(3), 0B(2)>
    considering event 3, with var: ‘0B’, state: ‘start’
and that it has picked the shortest path through the exploded graph,
and on this path the pointer has been assigned NULL.

The root cause is that the state machine's on_stmt isn't called for phi
nodes (and wouldn't make much sense, as we wouldn't know which arg to
choose).  malloc state machine::on_stmt "sees" a GIMPLE_ASSIGN to NULL
and handles it by transitioning the lhs to the "null" state, but never
"sees" GIMPLE_PHI nodes.

This patch fixes the ICE by wiring up phi-handling with state machines,
so that state machines have an on_phi vfunc.  It updates the only current
user of "is_zero_assignment" (the malloc sm) to implement equivalent
logic for phi nodes.  Doing so ensures that the pointer is in a separate
sm-state for the NULL vs non-NULL cases, and so gets separate exploded
nodes, and hence the path-finding logic chooses the correct path, and
the correct non-NULL phi argument.

The patch also adds some bulletproofing to prune_for_sm_diagnostic to
avoid crashing in the event of a bad path.

gcc/analyzer/ChangeLog:
PR analyzer/93544
* diagnostic-manager.cc
(diagnostic_manager::prune_for_sm_diagnostic): Bulletproof
against bad choices due to bad paths.
* engine.cc (impl_region_model_context::on_phi): New.
* exploded-graph.h (impl_region_model_context::on_phi): New decl.
* region-model.cc (region_model::on_longjmp): Likewise.
(region_model::handle_phi): Add phi param.  Call the ctxt's on_phi
vfunc.
(region_model::update_for_phis): Pass phi to handle_phi.
* region-model.h (region_model::handle_phi): Add phi param.
(region_model_context::on_phi): New vfunc.
(test_region_model_context::on_phi): New.
* sm-malloc.cc (malloc_state_machine::on_phi): New.
(malloc_state_machine::on_zero_assignment): New.
* sm.h (state_machine::on_phi): New vfunc.

gcc/testsuite/ChangeLog:
PR analyzer/93544
* gcc.dg/analyzer/torture/pr93544.c: New test.

4 years agoanalyzer: show BBs in .dot dumps
David Malcolm [Mon, 3 Feb 2020 14:55:26 +0000 (09:55 -0500)]
analyzer: show BBs in .dot dumps

gcc/analyzer/ChangeLog:
* engine.cc (supernode_cluster::dump_dot): Show BB index as
well as SN index.
* supergraph.cc (supernode::dump_dot): Likewise.

4 years agoanalyzer: fix ICE merging models containing label pointers (PR 93546)
David Malcolm [Mon, 3 Feb 2020 13:30:54 +0000 (08:30 -0500)]
analyzer: fix ICE merging models containing label pointers (PR 93546)

PR analyzer/93546 reports an ICE within region_model::add_region_for_type
when merging two region_models each containing a label pointer.  The
two labels are stored as pointers to symbolic_regions, but these regions
were created with NULL type, leading to an assertion failure when a
merged copy is created.

The labels themselves have void (but not NULL) type.

This patch updates make_region_for_type to use the type of the decl when
creating such regions, rather than implicitly setting the region's type
to NULL, fixing the ICE.

gcc/analyzer/ChangeLog:
PR analyzer/93546
* region-model.cc (region_model::on_call_pre): Update for new
param of symbolic_region ctor.
(region_model::deref_rvalue): Likewise.
(region_model::add_new_malloc_region): Likewise.
(make_region_for_type): Likewise, preserving type.
* region-model.h (symbolic_region::symbolic_region): Add "type"
param and pass it to base class ctor.

gcc/testsuite/ChangeLog:
PR analyzer/93546
* gcc.dg/analyzer/pr93546.c: New test.

4 years agoanalyzer: fix ICE due to comparing int and real constants (PR 93547)
David Malcolm [Mon, 3 Feb 2020 11:34:20 +0000 (06:34 -0500)]
analyzer: fix ICE due to comparing int and real constants (PR 93547)

gcc/analyzer/ChangeLog:
PR analyzer/93547
* constraint-manager.cc
(constraint_manager::get_or_add_equiv_class): Ensure types are
compatible before comparing constants.

gcc/testsuite/ChangeLog:
PR analyzer/93547
* gcc.dg/analyzer/pr93547.c: New test.

4 years agors6000: Update constraint documentation
Segher Boessenkool [Fri, 31 Jan 2020 00:07:53 +0000 (00:07 +0000)]
rs6000: Update constraint documentation

This un-documents constraints that cannot (or should not) be used in
inline assembler.  It also improves markup, and presentation in general.

More work is needed, but gradual improvement is easier to do.

* config/rs6000/constraints.md: Improve documentation.
/
* doc/md.texi (PowerPC and IBM RS6000): Improve documentation.

4 years agoarm: Use move-if-change for updating regenerated files [PR93548]
Richard Earnshaw [Mon, 3 Feb 2020 17:40:55 +0000 (17:40 +0000)]
arm: Use move-if-change for updating regenerated files [PR93548]

The t-arm make fragment currently uses 'mv' to update some files that
are automatically regenerated, but this causes problems on read-only
filesystems if the date stamps are incorrect and the files have not
really changed.  So use move-if-change instead.

PR target/93548
* config/arm/t-arm: ($(srcdir)/config/arm/arm-tune.md,
$(srcdir)/config/arm/arm-tables.opt): Use move-if-change.

4 years agoRemove gfx801 "carrizo" support
Andrew Stubbs [Mon, 3 Feb 2020 15:02:22 +0000 (15:02 +0000)]
Remove gfx801 "carrizo" support

2020-02-03  Andrew Stubbs  <ams@codesourcery.com>

gcc/
* config.gcc: Remove "carrizo" support.
* config/gcn/gcn-opts.h (processor_type): Likewise.
* config/gcn/gcn.c (gcn_omp_device_kind_arch_isa): Likewise.
* config/gcn/gcn.opt (gpu_type): Likewise.
* config/gcn/t-omp-device: Likewise.

libgomp/
* plugin/plugin-gcn.c (EF_AMDGPU_MACH_AMDGCN_GFX801): Remove.
(gcn_gfx801_s): Remove.
(isa_hsa_name): Remove gfx801.
(isa_gcc_name): Remove gfx801/carizzo.
(isa_code): Remove gfx801.

4 years agoc++: Fix cast to pointer to VLA.
Jason Merrill [Sat, 1 Feb 2020 02:59:48 +0000 (21:59 -0500)]
c++: Fix cast to pointer to VLA.

The C front-end fixed this issue in r257620 by adding a DECL_EXPR from
grokdeclarator.  We don't have an easy way to do that in the C++ front-end,
but it works fine to create and prepend a DECL_EXPR when we are genericizing
the NOP_EXPR for the cast.

The C patch wraps the DECL_EXPR in a BIND_EXPR, but that seems unnecessary
in C++; this is just a hook to run gimplify_type_sizes, we aren't actually
declaring anything that we need to worry about scoping for.

PR c++/88256
* cp-gimplify.c (predeclare_vla): New.
(cp_genericize_r) [NOP_EXPR]: Call it.

4 years agoThis patch is for PR target/91816
Stam Markianos-Wright [Mon, 3 Feb 2020 10:25:46 +0000 (10:25 +0000)]
This patch is for PR target/91816

This is a patch for an issue where the compiler was generating a conditional
branch in Thumb2, which was too far for b{cond} to handle.

This was originally reported at binutils:
https://sourceware.org/bugzilla/show_bug.cgi?id=24991

And then raised for GCC:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91816

As can be seen here:

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489c/Cihfddaf.html

the range of a 32-bit Thumb B{cond} is +/-1MB.

This is now checked for in arm.md and an unconditional branch is generated if
the jump would be greater than 1MB.

gcc/ChangeLog

2020-02-03  Stam Markianos-Wright  <stam.markianos-wright@arm.com>

PR target/91816
* config/arm/arm-protos.h: New function arm_gen_far_branch prototype.
* config/arm/arm.c (arm_gen_far_branch): New function
arm_gen_far_branch.
* config/arm/arm.md: Update b<cond> for Thumb2 range checks.

gcc/testsuite/ChangeLog

2020-02-03  Stam Markianos-Wright  <stam.markianos-wright@arm.com>

PR target/91816
* gcc.target/arm/pr91816.c: New test.

4 years ago[OpenACC] bump version for 2.6 plus libgomp.texi update
Tobias Burnus [Mon, 3 Feb 2020 09:10:37 +0000 (10:10 +0100)]
[OpenACC] bump version for 2.6 plus libgomp.texi update

2020-02-03  Julian Brown  <julian@codesourcery.com>
            Tobias Burnus  <tobias@codesourcery.com>

gcc/c-family/
* c-cppbuiltin.c (c_cpp_builtins): Update _OPENACC define to 201711.

gcc/
* doc/invoke.texi: Update mention of OpenACC version to 2.6.

gcc/fortran/
* cpp.c (cpp_define_builtins): Update _OPENACC define to 201711.
* intrinsic.texi: Update mentions of OpenACC version to 2.6.
* gfortran.texi: Likewise. Remove experimental disclamer for OpenACC.
* invoke.texi: Remove experimental disclamer for OpenACC.

gcc/testsuite/
* c-c++-common/cpp/openacc-define-3.c: Update expected value for
_OPENACC define.
* gfortran.dg/openacc-define-3.f90: Likewise.

libgomp/
* libgomp.texi (OpenACC Runtime Library Routines): Document *_async
and *_finalize variants; document acc_attach and acc_detach; update
references from OpenACC 2.0 to 2.6.
* openacc.f90 (openacc_version): Update to 201711.
* openacc_lib.h (openacc_version): Update to 201711.
* testsuite/libgomp.oacc-fortran/openacc_version-1.f: Update expected
openacc_version to 201711.
* testsuite/libgomp.oacc-fortran/openacc_version-2.f90: Likewise.

4 years ago[OpenMP] Add missing parameters to omp_lib documentation (PR fortran/93541)
Tobias Burnus [Mon, 3 Feb 2020 09:02:47 +0000 (10:02 +0100)]
[OpenMP] Add missing parameters to omp_lib documentation (PR fortran/93541)

PR fortran/93541
* intrinisic.texi (OpenMP Modules OMP_LIB and OMP_LIB_KINDS):
Add undocumented parameters from omp_lib.f90.in.

4 years ago[Fortran] Fix to strict associate check (PR93427)
Tobias Burnus [Mon, 3 Feb 2020 09:00:07 +0000 (10:00 +0100)]
[Fortran] Fix to strict associate check (PR93427)

        PR fortran/93427
        * resolve.c (resolve_assoc_var): Remove too strict check.
        * gfortran.dg/associate_51.f90: Update test case.

        PR fortran/93427
        * gfortran.dg/associate_52.f90: New.

4 years agos390x: Fix popcounthi2_z196 expander [PR93533]
Jakub Jelinek [Mon, 3 Feb 2020 08:00:19 +0000 (09:00 +0100)]
s390x: Fix popcounthi2_z196 expander [PR93533]

The following testcase started to ICE when .POPCOUNT matching has been added
to match.pd; we had __builtin_popcount*, but nothing would use the
popcounthi2 expander before.

The problem is that the popcounthi2_z196 expander doesn't emit valid RTL:
error: unrecognizable insn:
(insn 138 137 139 27 (set (reg:SI 190)
        (ashift:SI (reg:HI 95 [ _105 ])
            (const_int 8 [0x8]))) -1
     (nil))
during RTL pass: vregs
The following patch is an attempt to fix that, furthermore I've tried to
slightly simplify it as well, it makes no sense to me to perform
(x + (x << 8)) >> 8 when we need to either zero extend or mask the result
at the end in order to avoid bits from above HImode to affect it, when we
can do
(x + (x >> 8)) & 0xff (or zero extension).

2020-02-03  Jakub Jelinek  <jakub@redhat.com>

PR target/93533
* config/s390/s390.md (popcounthi2_z196): Fix up expander to emit
valid RTL to sum up the lowest and second lowest bytes of the popcnt
result.

* gcc.c-torture/compile/pr93533.c: New test.
* gcc.target/s390/pr93533.c: New test.

4 years agocoroutines: Bind label_decl of original function to actor function
JunMa [Mon, 20 Jan 2020 09:46:32 +0000 (17:46 +0800)]
coroutines: Bind label_decl of original function to actor function

gcc/cp
    * coroutines.cc (transform_await_wrapper): Set actor funcion as
    new context of label_decl.
    (build_actor_fn): Fill new field of await_xform_data.

gcc/testsuite
    * g++.dg/coroutines/co-await-04-control-flow.C: Add label.

4 years agoDaily bump.
GCC Administrator [Mon, 3 Feb 2020 00:16:55 +0000 (00:16 +0000)]
Daily bump.

4 years agoc++: Fix ICE on invalid alignas in a template [PR93530]
Marek Polacek [Sat, 1 Feb 2020 00:28:10 +0000 (19:28 -0500)]
c++: Fix ICE on invalid alignas in a template [PR93530]

This fixes an ICE taking place in cp_default_conversion because we got
a SCOPE_REF that doesn't have a type and so checking
INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (exp)) will crash.
This happens since the recent Joseph's change in decl_attributes whereby
we don't skip C++11 attributes on types.

[dcl.align] is clear that alignas applied to a function is ill-formed.
That should be fixed, and we have PR90847 for that.  But I think a more
appropriate fix at this stage would be the following: in a template we
want to splice dependent attributes and save them for later, and by
doing so avoid this crash.

PR c++/93530 - ICE on invalid alignas in a template.
* decl.c (grokdeclarator): Call cplus_decl_attributes instead of
decl_attributes.

* g++.dg/cpp0x/alignas18.C: New test.

4 years agotestsuite,Darwin,PPC: Adjust darwin-abi-12.c for common section use.
Iain Sandoe [Sun, 2 Feb 2020 19:53:24 +0000 (19:53 +0000)]
testsuite,Darwin,PPC: Adjust darwin-abi-12.c for common section use.

This test explicitly tests for code generation that expects a
common section.

gcc/testsuite/ChangeLog:

2020-02-02  Iain Sandoe  <iain@sandoe.co.uk>

* gcc.target/powerpc/darwin-abi-12.c: Add '-fcommon' to the
options.

4 years agoOne more fix for PR 91333 - suboptimal register allocation for inline asm
Vladimir N. Makarov [Sun, 2 Feb 2020 16:23:25 +0000 (11:23 -0500)]
One more fix for PR 91333 - suboptimal register allocation for inline asm

2020-02-02  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/91333
* ira-color.c (struct allocno_color_data): Add member
hard_reg_prefs.
(init_allocno_threads): Set the member up.
(bucket_allocno_compare_func): Add compare hard reg
prefs.

2020-02-02  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/91333
* gcc.target/i386/pr91333.c: Add vmovsd to regexp.  Set up count
to 3.

4 years agoDaily bump.
GCC Administrator [Sun, 2 Feb 2020 00:16:33 +0000 (00:16 +0000)]
Daily bump.

4 years agofortran: Fix up TYPE_ARG_TYPES of procs with scalar VALUE optional args [PR92305]
Jakub Jelinek [Sat, 1 Feb 2020 09:02:20 +0000 (10:02 +0100)]
fortran: Fix up TYPE_ARG_TYPES of procs with scalar VALUE optional args [PR92305]

The following patch fixes
-FAIL: libgomp.fortran/use_device_addr-1.f90   -O0  execution test
-FAIL: libgomp.fortran/use_device_addr-2.f90   -O0  execution test
that has been FAILing for several months on powerpc64le-linux.
The problem is in the Fortran FE, which adds the artificial arguments
for scalar VALUE OPTIONAL dummy args only to DECL_ARGUMENTS where the
current function can see them, but not to TYPE_ARG_TYPES; if those functions
aren't varargs, this confuses calls.c to pass the remaining arguments
(which aren't named (== not covered by TYPE_ARG_TYPES) and aren't varargs
either) in a different spot from what the callee (which has proper
DECL_ARGUMENTS for all args) expects.  For the artificial length arguments
for character dummy args we already put them in both DECL_ARGUMENTS and
TYPE_ARG_TYPES.

2020-02-01  Jakub Jelinek  <jakub@redhat.com>

PR fortran/92305
* trans-types.c (gfc_get_function_type): Also push boolean_type_node
types for non-character scalar VALUE optional dummy arguments.
* trans-decl.c (create_function_arglist): Skip those in
hidden_typelist.  Formatting fix.

4 years agonios2: Support for GOT-relative DW_EH_PE_datarel encoding.
Sandra Loosemore [Sat, 1 Feb 2020 00:46:50 +0000 (16:46 -0800)]
nios2: Support for GOT-relative DW_EH_PE_datarel encoding.

On nios2-linux-gnu, there has been a long-standing bug in C++ exception
handling that sometimes resulted in link errors like

../nios2-linux-gnu/bin/ld: FDE encoding in /tmp/cccfpQ2l.o(.eh_frame) prevents .eh_frame_hdr table being created

when building some shared libraries or PIE executables.  The root of
the problem is that GCC was incorrectly emitting an absolute encoding
in EH tables for PIC.  This patch changes it to use either
DW_EH_PE_indirect (for global) or DW_EH_PE_datarel (for local), and
fixes libgcc so it can find the address of the GOT as the base address
for DW_EH_PE_datarel.

Complicating matters somewhat, GAS was missing support for
%gotoff(symbol) relocation syntax.  I have just pushed a fix for that,
but I've added a configure check to test for presence of the binutils
support and fall back to the current absolute encoding (which works
most of the time) if it is not available.  Once the fix makes it into
an official binutils release it might be appropriate to make this
error out instead.

Since this is a wrong-code bug and affects only nios2 target, I think
this is appropriate for Stage 4.  I regression-tested on both
nios2-linux-gnu and nios2-elf, with and without the binutils support
present, before committing this.

2020-01-31  Sandra Loosemore  <sandra@codesourcery.com>

gcc/
* configure.ac [nios2-*-*]: Check HAVE_AS_NIOS2_GOTOFF_RELOCATION.
* config.in: Regenerated.
* configure: Regenerated.
* config/nios2/nios2.h (ASM_PREFERRED_EH_DATA_FORMAT): Fix handling
for PIC when HAVE_AS_NIOS2_GOTOFF_RELOCATION.
(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New.

gcc/testsuite/
* g++.target/nios2/hello-pie.C: New.
* g++.target/nios2/nios2.exp: New.

libgcc/
* config.host [nios2-*-linux*] (tmake_file, tm_file): Adjust.
* config/nios2-elf-lib.h: New.
* unwind-dw2-fde-dip.c (_Unwind_IteratePhdrCallback): Use existing
code for finding GOT base for nios2.

4 years agoFixes after recent configure changes relating to static libraries
Andrew Burgess [Thu, 30 Jan 2020 12:18:13 +0000 (12:18 +0000)]
Fixes after recent configure changes relating to static libraries

This commit:

  commit e7c26e04b2dd6266d62d5a5825ff7eb44d1cf14e (tjteru/master)
  Date:   Wed Jan 22 14:54:26 2020 +0000

      gcc: Add new configure options to allow static libraries to be selected

contains a couple of issues.  First I failed to correctly regenerate
all of the configure files it should have done.  Second, there was a
mistake in lib-link.m4, one of the conditions didn't use pure sh
syntax, I wrote this:

  if x$lib_type = xauto || x$lib_type = xshared; then

When I should have written this:

  if test "x$lib_type" = "xauto" || test "x$lib_type" = "xshared"; then

These issues were raised on the mailing list in these messages:

  https://gcc.gnu.org/ml/gcc-patches/2020-01/msg01827.html
  https://gcc.gnu.org/ml/gcc-patches/2020-01/msg01921.html

config/ChangeLog:

* lib-link.m4 (AC_LIB_LINKFLAGS_BODY): Update shell syntax.

gcc/ChangeLog:

* configure: Regenerate.

intl/ChangeLog:

* configure: Regenerate.

libcpp/ChangeLog:

* configure: Regenerate.

libstdc++-v3/ChangeLog:

* configure: Regenerate.

4 years agoDaily bump.
GCC Administrator [Sat, 1 Feb 2020 00:16:32 +0000 (00:16 +0000)]
Daily bump.

4 years agoc++: Fix sizeof VLA lambda capture.
Jason Merrill [Fri, 31 Jan 2020 22:10:30 +0000 (17:10 -0500)]
c++: Fix sizeof VLA lambda capture.

sizeof a VLA type is not a constant in C or the GNU C++ extension, so we
need to capture the VLA even in unevaluated context.  For PR60855 we stopped
looking through a previous capture, but we also need to capture the first
time the variable is mentioned.

PR c++/86216
* semantics.c (process_outer_var_ref): Capture VLAs even in
unevaluated context.

4 years agoc++: Reduce memory consumption for arrays of non-aggregate type.
Jason Merrill [Fri, 31 Jan 2020 05:21:44 +0000 (00:21 -0500)]
c++: Reduce memory consumption for arrays of non-aggregate type.

The remaining low-hanging fruit for improvement on memory consumption in the
14179 testcase was the duplication of the CONSTRUCTOR for the array by
reshape_init.  This patch changes reshape_init to reuse a single constructor
for an array of non-aggregate type such as the one in the testcase.

PR c++/14179
* decl.c (reshape_init_array_1): Reuse a single CONSTRUCTOR with
non-aggregate elements.
(reshape_init_array): Add first_initializer_p parm.
(reshape_init_r): Change first_initializer_p from bool to tree.
(reshape_init): Pass init to it.

4 years agoc++: Reduce memory consumption for large static arrays.
Jason Merrill [Thu, 30 Jan 2020 23:49:29 +0000 (18:49 -0500)]
c++: Reduce memory consumption for large static arrays.

PR14179 and the C counterpart PR12245 are about memory consumption of very
large file-scope arrays.  Recently, location wrappers increased memory
consumption significantly: in an array of integer constants, each one will
have a location wrapper, which added up to over 500MB in the 14179
testcase.  For this kind of testcase tracking these locations isn't worth
the cost, so this patch turns the wrappers off after 256 elements; any array
that size or larger isn't likely to be interested in the location of
individual integer constants.

PR c++/14179
* parser.c (cp_parser_initializer_list): Suppress location wrappers
after 256 elements.

4 years agoanalyzer: fix ICE with 'const void *' (PR 93457)
David Malcolm [Fri, 31 Jan 2020 19:05:17 +0000 (14:05 -0500)]
analyzer: fix ICE with 'const void *' (PR 93457)

gcc/analyzer/ChangeLog:
PR analyzer/93457
* region-model.cc (make_region_for_type): Use VOID_TYPE_P rather
than checking against void_type_node.

gcc/testsuite/ChangeLog:
PR analyzer/93457
* gcc.dg/analyzer/pr93457.c: New test.

4 years agoanalyzer: fix ICE handling void-type (PR 93373)
David Malcolm [Wed, 22 Jan 2020 18:08:26 +0000 (13:08 -0500)]
analyzer: fix ICE handling void-type (PR 93373)

gcc/analyzer/ChangeLog:
PR analyzer/93373
* region-model.cc (ASSERT_COMPAT_TYPES): Convert to...
(assert_compat_types): ...this, and bail when either type is NULL,
or when VOID_TYPE_P (dst_type).
(region_model::get_lvalue): Update for above conversion.
(region_model::get_rvalue): Likewise.

gcc/testsuite/ChangeLog:
PR analyzer/93373
* gcc.dg/analyzer/torture/pr93373.c: New test.

4 years ago Fix for PR 91333 - suboptimal register allocation for inline asm
Vladimir N. Makarov [Fri, 31 Jan 2020 19:26:26 +0000 (14:26 -0500)]
Fix for PR 91333 - suboptimal register allocation for inline asm

    2020-01-31  Vladimir Makarov  <vmakarov@redhat.com>

            PR rtl-optimization/91333
            * ira-color.c (bucket_allocno_compare_func): Move conflict hard
            reg preferences comparison up.

    2020-01-31  Vladimir Makarov  <vmakarov@redhat.com>

            PR rtl-optimization/91333
            * gcc.target/i386/pr91333.c: New.

4 years agoanalyzer: fix ICE getting void return value (PR 93379)
David Malcolm [Fri, 31 Jan 2020 17:05:03 +0000 (12:05 -0500)]
analyzer: fix ICE getting void return value (PR 93379)

PR analyzer/93379 reports an ICE within
region_model::update_for_return_superedge when writing the
returned svalue_id to the lhs of the call_stmt

The root cause is that this analyzer code assumed that for any call
with a non-NULL gimple_call_lhs, the called fndecl would have non-void
return type, and thus that a non-null svalue_id would be returned from
region_model::pop_frame.  This isn't the case e.g. for a call with
conflicting types where the callee returns void but the caller assumes
int.

This patch fixes the ICE by moving the check for null result so that
it also guards setting the lhs.

gcc/analyzer/ChangeLog:
PR analyzer/93379
* region-model.cc (region_model::update_for_return_superedge):
Move check for null result so that it also guards setting the
lhs.

gcc/testsuite/ChangeLog:
PR analyzer/93379
* gcc.dg/analyzer/torture/pr93379-2.c: New test.
* gcc.dg/analyzer/torture/pr93379.c: New test.