]> gcc.gnu.org Git - gcc.git/log
gcc.git
3 years agox86: Check cfun != NULL before accessing silent_p
H.J. Lu [Sat, 20 Mar 2021 12:17:36 +0000 (05:17 -0700)]
x86: Check cfun != NULL before accessing silent_p

Since construct_container may be called with cfun == NULL, check
cfun != NULL before accessing silent_p.

gcc/

PR target/99679
* config/i386/i386.c (construct_container): Check cfun != NULL
before accessing silent_p.

gcc/testsuite/

PR target/99679
* g++.target/i386/pr99679-1.C: New test.
* g++.target/i386/pr99679-2.C: Likewise.

3 years agoc-family: Fix PR94272 -fcompare-debug issue even for C [PR99230]
Jakub Jelinek [Sat, 20 Mar 2021 16:02:06 +0000 (17:02 +0100)]
c-family: Fix PR94272 -fcompare-debug issue even for C [PR99230]

The following testcase results in -fcompare-debug failure.
The problem is the similar like in PR94272
https://gcc.gnu.org/pipermail/gcc-patches/2020-March/542562.html
When genericizing, with -g0 we have just a TREE_SIDE_EFFECTS DO_STMT
in a branch of if, while with -g we have that wrapped into
TREE_SIDE_EFFECTS STATEMENT_LIST containing DEBUG_BEGIN_STMT and that
DO_STMT.
The do loop is empty with 0 condition, so c_genericize_control_stmt
turns it into an empty statement (without TREE_SIDE_EFFECTS).
For -g0 that means that suddenly the if branch doesn't have side effects
and is expanded differently.  But with -g we still have TREE_SIDE_EFFECTS
STATEMENT_LIST containing DEBUG_BEGIN_STMT and non-TREE_SIDE_EFFECTS stmt.
The following patch fixes that by detecting this case and removing
TREE_SIDE_EFFECTS.

And, so that we don't duplicate the same code, changes the C++ FE to
just call the c_genericize_control_stmt function that can now handle it.

2021-03-20  Jakub Jelinek  <jakub@redhat.com>

PR debug/99230
* c-gimplify.c (c_genericize_control_stmt): Handle STATEMENT_LIST.

* cp-gimplify.c (cp_genericize_r) <case STATEMENT_LIST>: Remove
special code, instead call c_genericize_control_stmt.

* gcc.dg/pr99230.c: New test.

3 years ago[PATCH] Fix typo in gcc/asan.c comment
Ahamed Husni [Sat, 20 Mar 2021 15:17:23 +0000 (09:17 -0600)]
[PATCH] Fix typo in gcc/asan.c comment

gcc/
* asan.c: Fix typos in comments.

3 years ago[PR99680] Check empty constraint before using CONSTRAINT_LEN.
Vladimir N. Makarov [Sat, 20 Mar 2021 14:50:03 +0000 (10:50 -0400)]
[PR99680] Check empty constraint before using CONSTRAINT_LEN.

It seems CONSTRAINT_LEN treats constraint '\0' as one having length 1.  Therefore we
read after the constraint string.  The patch fixes it.

gcc/ChangeLog:

PR rtl-optimization/99680
* lra-constraints.c (skip_contraint_modifiers): Rename to skip_constraint_modifiers.
(process_address_1): Check empty constraint before using
CONSTRAINT_LEN.

3 years agoDaily bump.
GCC Administrator [Sat, 20 Mar 2021 00:16:24 +0000 (00:16 +0000)]
Daily bump.

3 years agoc: Fix up -Wunused-but-set-* warnings for _Atomics [PR99588]
Jakub Jelinek [Fri, 19 Mar 2021 21:54:31 +0000 (22:54 +0100)]
c: Fix up -Wunused-but-set-* warnings for _Atomics [PR99588]

As the following testcases show, compared to -D_Atomic= case we have many
-Wunused-but-set-* warning false positives.
When an _Atomic variable/parameter is read, we call mark_exp_read on it in
convert_lvalue_to_rvalue, but build_atomic_assign does not.
For consistency with the non-_Atomic case where we mark_exp_read the lhs
for lhs op= ... but not for lhs = ..., this patch does that too.
But furthermore we need to pattern match the trees emitted by _Atomic store,
so that _Atomic store itself is not marked as being a variable read, but
when the result of the store is used, we mark it.

2021-03-19  Jakub Jelinek  <jakub@redhat.com>

PR c/99588
* c-typeck.c (mark_exp_read): Recognize what build_atomic_assign
with modifycode NOP_EXPR produces and mark the _Atomic var as read
if found.
(build_atomic_assign): For modifycode of NOP_EXPR, use COMPOUND_EXPRs
rather than STATEMENT_LIST.  Otherwise call mark_exp_read on lhs.
Set TREE_SIDE_EFFECTS on the TARGET_EXPR.

* gcc.dg/Wunused-var-5.c: New test.
* gcc.dg/Wunused-var-6.c: New test.

3 years agoRegenerate gcc.pot.
Joseph Myers [Fri, 19 Mar 2021 21:33:05 +0000 (21:33 +0000)]
Regenerate gcc.pot.

* gcc.pot: Regenerate.

3 years agoAdd Power10 scheduling description.
Pat Haugen [Fri, 19 Mar 2021 20:51:22 +0000 (15:51 -0500)]
Add Power10 scheduling description.

2021-03-19  Pat Haugen  <pthaugen@linux.ibm.com>

gcc/

* config/rs6000/rs6000.c (power10_cost): New.
(rs6000_option_override_internal): Set Power10 costs.
(rs6000_issue_rate): Set Power10 issue rate.
* config/rs6000/power10.md: Rewrite for Power10.

3 years agolibstdc++: Add std::is_scoped_enum for C++23
Jonathan Wakely [Fri, 19 Mar 2021 19:42:18 +0000 (19:42 +0000)]
libstdc++: Add std::is_scoped_enum for C++23

Implement this C++23 feature, as proposed by P1048R1.

This implementation assumes that a C++23 compiler supports concepts
already. I don't see any point in using preprocessor hacks to detect
compilers which define __cplusplus to a post-C++20 value but don't
support concepts yet.

libstdc++-v3/ChangeLog:

* include/std/type_traits (is_scoped_enum): Define.
* include/std/version (__cpp_lib_is_scoped_enum): Define.
* testsuite/20_util/is_scoped_enum/value.cc: New test.
* testsuite/20_util/is_scoped_enum/version.cc: New test.

3 years agoAdd size check to vector-matrix matmul.
Thomas Koenig [Fri, 19 Mar 2021 19:49:38 +0000 (20:49 +0100)]
Add size check to vector-matrix matmul.

It turns out the library version is much faster for vector-matrix
multiplications for large sizes than what inlining can produce.
Use size checks for switching between this and inlining for
that case to.

gcc/fortran/ChangeLog:

* frontend-passes.c (inline_limit_check): Add rank_a
argument. If a is rank 1, set the second dimension to 1.
(inline_matmul_assign): Pass rank_a argument to inline_limit_check.
(call_external_blas): Likewise.

gcc/testsuite/ChangeLog:

* gfortran.dg/inline_matmul_6.f90: Adjust count for
  _gfortran_matmul.

3 years ago[PR99663] Don't use unknown constraint for address constraint in process_address_1.
Vladimir N. Makarov [Fri, 19 Mar 2021 19:34:48 +0000 (15:34 -0400)]
[PR99663] Don't use unknown constraint for address constraint in process_address_1.

s390x has insns using several alternatives with address constraints.  Even
if we don't know at this stage what alternative will be used, we still can say
that is an address constraint.  So don't use unknown constraint in this
case when there are multiple constraints or/and alternative.

gcc/ChangeLog:

PR target/99663
* lra-constraints.c (process_address_1): Don't use unknown
constraint for address constraint.

gcc/testsuite/ChangeLog:

PR target/99663
* gcc.target/s390/pr99663.c: New.

3 years agoc++: Only reject reinterpret casts from pointers to integers for manifestly_const_eva...
Jakub Jelinek [Fri, 19 Mar 2021 17:36:56 +0000 (18:36 +0100)]
c++: Only reject reinterpret casts from pointers to integers for manifestly_const_eval evaluation [PR99456]

My PR82304/PR95307 fix moved reinterpret cast from pointer to integer
diagnostics from cxx_eval_outermost_constant_expr where it caught
invalid code only at the outermost level down into
cxx_eval_constant_expression.
Unfortunately, it regressed following testcase, we emit worse code
including dynamic initialization of some vars.
While the initializers are not constant expressions due to the
reinterpret_cast in there, there is no reason not to fold them as an
optimization.

I've tried to make this dependent on !ctx->quiet, but that regressed
two further tests, and on ctx->strict, which regressed other tests,
so this patch bases that on manifestly_const_eval.

The new testcase is now optimized as much as it used to be in GCC 10
and the only regression it causes is an extra -Wnarrowing warning
on vla22.C test on invalid code (which the patch adjusts).

2021-03-19  Jakub Jelinek  <jakub@redhat.com>

PR c++/99456
* constexpr.c (cxx_eval_constant_expression): For CONVERT_EXPR from
INDIRECT_TYPE_P to ARITHMETIC_TYPE_P, when !ctx->manifestly_const_eval
don't diagnose it, set *non_constant_p nor return t.

* g++.dg/opt/pr99456.C: New test.
* g++.dg/ext/vla22.C: Expect a -Wnarrowing warning for c++11 and
later.

3 years agoDarwin : Fix build failure for powerpc-darwin8 [PR99661].
Iain Sandoe [Fri, 19 Mar 2021 16:36:40 +0000 (16:36 +0000)]
Darwin : Fix build failure for powerpc-darwin8 [PR99661].

A hunk had been missed from r11-6417, fixed thus:

gcc/ChangeLog:

PR target/99661
* config.gcc (powerpc-*-darwin8): Delete the reference to
the now removed darwin8.h.

3 years agotarget/99660 - missing VX_CPU_PREFIX for vxworksae
Olivier Hainque [Fri, 19 Mar 2021 15:21:38 +0000 (15:21 +0000)]
target/99660 - missing VX_CPU_PREFIX for vxworksae

This fixes an oversight which causes make all-gcc
to fail for --target=*vxworksae or vxworksmils, a regression
introduced by the recent VxWorks7 related updates.

Both AE and MILS variants resort to a common config/vxworksae.h,
which misses a definition of VX_CPU_PREFIX expected by port
specific headers.

The change just provides the missing definition.

2021-03-19  Olivier Hainque  <hainque@adacore.com>

gcc/
PR target/99660
* config/vxworksae.h (VX_CPU_PREFIX): Define.

3 years agoUse memcpy instead of strncpy to avoid error with -Werror=stringop-truncation.
John David Anglin [Fri, 19 Mar 2021 15:57:06 +0000 (15:57 +0000)]
Use memcpy instead of strncpy to avoid error with -Werror=stringop-truncation.

gcc/ChangeLog:

* config/pa/pa.c (import_milli): Use memcpy instead of strncpy.

3 years agoslp: remove unneeded permute calculation (PR99656)
Tamar Christina [Fri, 19 Mar 2021 14:29:36 +0000 (14:29 +0000)]
slp: remove unneeded permute calculation (PR99656)

The attach testcase ICEs because as you showed on the PR we have one child
which is an internal with a PERM of EVENEVEN and one with TOP.

The problem is while we can conceptually merge the permute itself into EVENEVEN,
merging the lanes don't really make sense.

That said, we no longer even require the merged lanes as we create the permutes
based on the KIND directly.

This patch just removes all of that code.

Unfortunately it still won't vectorize with the cost model enabled due to the
blend that's created combining the load and the external

note: node 0x51f2ce8 (max_nunits=1, refcnt=1)
note: op: VEC_PERM_EXPR
note:       { }
note:       lane permutation { 0[0] 1[1] }
note:       children 0x51f23e0 0x51f2578
note: node 0x51f23e0 (max_nunits=2, refcnt=1)
note: op template: _16 = REALPART_EXPR <*t1_9(D)>;
note:       stmt 0 _16 = REALPART_EXPR <*t1_9(D)>;
note:       stmt 1 _16 = REALPART_EXPR <*t1_9(D)>;
note:       load permutation { 0 0 }
note: node (external) 0x51f2578 (max_nunits=1, refcnt=1)
note:       { _18, _18 }

which costs the cost for the load-and-split and the cost of the external splat,
and the one for blending them while in reality it's just a scalar load and
insert.

The compiler (with the cost model disabled) generates

ldr     q1, [x19]
dup     v1.2d, v1.d[0]
ldr     d0, [x19, 8]
fneg    d0, d0
ins     v1.d[1], v0.d[0]

while really it should be

ldp     d1, d0, [x19]
fneg    d0, d0
ins     v1.d[1], v0.d[0]

but that's for another time.

gcc/ChangeLog:

PR tree-optimization/99656
* tree-vect-slp-patterns.c (linear_loads_p,
complex_add_pattern::matches, is_eq_or_top,
vect_validate_multiplication, complex_mul_pattern::matches,
complex_fms_pattern::matches): Remove complex_perm_kinds_t.
* tree-vectorizer.h: (complex_load_perm_t): Removed.
(slp_tree_to_load_perm_map_t): Use complex_perm_kinds_t instead of
complex_load_perm_t.

gcc/testsuite/ChangeLog:

PR tree-optimization/99656
* gfortran.dg/vect/pr99656.f90: New test.

3 years agox86: Issue error for return/argument only with function body
H.J. Lu [Thu, 18 Mar 2021 18:47:46 +0000 (11:47 -0700)]
x86: Issue error for return/argument only with function body

If we never generate function body, we shouldn't issue errors for return
nor argument.  Add silent_p to i386 machine_function to avoid issuing
errors for return and argument without function body.

gcc/

PR target/99652
* config/i386/i386-options.c (ix86_init_machine_status): Set
silent_p to true.
* config/i386/i386.c (init_cumulative_args): Set silent_p to
false.
(construct_container): Return early for return and argument
errors if silent_p is true.
* config/i386/i386.h (machine_function): Add silent_p.

gcc/testsuite/

PR target/99652
* gcc.dg/torture/pr99652-1.c: New test.
* gcc.dg/torture/pr99652-2.c: Likewise.
* gcc.target/i386/pr57655.c: Adjusted.
* gcc.target/i386/pr59794-6.c: Likewise.
* gcc.target/i386/pr70738-1.c: Likewise.
* gcc.target/i386/pr96744-1.c: Likewise.

3 years agoanalyzer: mark epath_finder with DISABLE_COPY_AND_ASSIGN [PR99614]
David Malcolm [Fri, 19 Mar 2021 13:01:57 +0000 (09:01 -0400)]
analyzer: mark epath_finder with DISABLE_COPY_AND_ASSIGN [PR99614]

cppcheck warns that class epath_finder does dynamic memory allocation, but
is missing a copy constructor and operator=.

This class isn't meant to be copied or assigned, so mark it with
DISABLE_COPY_AND_ASSIGN.

gcc/analyzer/ChangeLog:
PR analyzer/99614
* diagnostic-manager.cc (class epath_finder): Add
DISABLE_COPY_AND_ASSIGN.

3 years agoarm: Fix mve_vshlq* [PR99593]
Jakub Jelinek [Fri, 19 Mar 2021 12:48:44 +0000 (13:48 +0100)]
arm: Fix mve_vshlq* [PR99593]

As mentioned in the PR, before the r11-6708-gbfab355012ca0f5219da8beb04f2fdaf757d34b7
change v[al]shr<mode>3 expanders were expanding the shifts by register
to gen_ashl<mode>3_{,un}signed which don't support immediate CONST_VECTOR
shift amounts, but now expand to mve_vshlq_<supf><mode> which does.
The testcase ICEs, because the constraint doesn't match the predicate and
because LRA works solely with the constraints, so it can e.g. from REG_EQUAL
propagate there a CONST_VECTOR which matches the constraint but fails the
predicate and only later on other passes will notice the predicate fails
and ICE.

Fixed by adding a constraint that matches the immediate part of the
predicate.

PR target/99593
* config/arm/constraints.md (Ds): New constraint.
* config/arm/vec-common.md (mve_vshlq_<supf><mode>): Use w,Ds
constraint instead of w,Dm.

* g++.target/arm/pr99593.C: New test.

3 years agoamdgcn: Typo fix
Andrew Stubbs [Fri, 19 Mar 2021 10:42:37 +0000 (10:42 +0000)]
amdgcn: Typo fix

gcc/ChangeLog:

* config/gcn/gcn.c (gcn_parse_amdgpu_hsa_kernel_attribute): Fix quotes
in error message.

3 years agosubstitute @tie{} with a space for the man pages
Matthias Klose [Fri, 19 Mar 2021 10:03:02 +0000 (10:03 +0000)]
substitute @tie{} with a space for the man pages

contrib/

2021-03-19  Matthias Klose  <doko@ubuntu.com>

* texi2pod.pl: Substitute @tie{} with a space for the man pages.

3 years agoRequire linker plugin for another LTO test
Eric Botcazou [Fri, 19 Mar 2021 08:23:28 +0000 (09:23 +0100)]
Require linker plugin for another LTO test

If it is not present, fat LTO is generated with an additional warning.

gcc/testsuite/
* g++.dg/lto/pr89335_0.C: Require the linker plugin.

3 years agoFix segfault during encoding of CONSTRUCTORs
Eric Botcazou [Fri, 19 Mar 2021 08:21:11 +0000 (09:21 +0100)]
Fix segfault during encoding of CONSTRUCTORs

The segfault occurs in native_encode_initializer when it is encoding the
CONSTRUCTOR for an array whose lower bound is negative (it's OK in Ada).
The computation of the current position is done in HOST_WIDE_INT and this
does not work for arrays whose original range has a negative lower bound
and a positive upper bound; the computation must be done in sizetype
instead so that it may wrap around.

gcc/
PR middle-end/99641
* fold-const.c (native_encode_initializer) <CONSTRUCTOR>: For an
array type, do the computation of the current position in sizetype.

3 years agoDaily bump.
GCC Administrator [Fri, 19 Mar 2021 00:16:26 +0000 (00:16 +0000)]
Daily bump.

3 years agoc++: Fix error-recovery with requires expression [PR99500]
Marek Polacek [Wed, 10 Mar 2021 01:55:14 +0000 (20:55 -0500)]
c++: Fix error-recovery with requires expression [PR99500]

This fixes an ICE on invalid code where one of the parameters was
error_mark_node and thus resetting its DECL_CONTEXT crashed.

gcc/cp/ChangeLog:

PR c++/99500
* parser.c (cp_parser_requirement_parameter_list): Handle
error_mark_node.

gcc/testsuite/ChangeLog:

PR c++/99500
* g++.dg/cpp2a/concepts-err3.C: New test.

3 years agoc++: Remove FLOAT_EXPR assert in tsubst.
Marek Polacek [Thu, 18 Mar 2021 21:19:17 +0000 (17:19 -0400)]
c++: Remove FLOAT_EXPR assert in tsubst.

This assert triggered when pr85013.C was compiled with -fchecking=2
which the usual testing doesn't exercise.  Let's remove it for now
and revisit in GCC 12.

gcc/cp/ChangeLog:

* pt.c (tsubst_copy_and_build) <case FLOAT_EXPR>: Remove.

3 years ago[PR99422] LRA: Use lookup_constraint only for a single constraint in process_address_1.
Vladimir N. Makarov [Thu, 18 Mar 2021 19:58:26 +0000 (15:58 -0400)]
[PR99422] LRA: Use lookup_constraint only for a single constraint in process_address_1.

This is an additional patch for PR99422.  In process_address_1 we
look only at the first constraint in the 1st alternative
and ignore all other possibilities.  As we don't know what
alternative and constraint will be used at this stage, we can be sure
only for a single constraint with one alternative and should use unknown
constraint for all other cases.

gcc/ChangeLog:

PR target/99422
* lra-constraints.c (process_address_1): Use lookup_constraint
only for a single constraint.

3 years agoPR middle-end/99502 - missing -Warray-bounds on partial out of bounds
Martin Sebor [Thu, 18 Mar 2021 19:36:09 +0000 (13:36 -0600)]
PR middle-end/99502 - missing -Warray-bounds on partial out of bounds

gcc/ChangeLog:

PR middle-end/99502
* gimple-array-bounds.cc (inbounds_vbase_memaccess_p): Rename...
(inbounds_memaccess_p): ...to this.  Check the ending offset of
the accessed member.

gcc/testsuite/ChangeLog:

PR middle-end/99502
* g++.dg/warn/Warray-bounds-22.C: New test.
* g++.dg/warn/Warray-bounds-23.C: New test.
* g++.dg/warn/Warray-bounds-24.C: New test.

3 years agoc++: Add assert to tsubst.
Marek Polacek [Wed, 17 Mar 2021 23:39:10 +0000 (19:39 -0400)]
c++: Add assert to tsubst.

As discussed in the r11-7709 patch, we can now make sure that tsubst
never sees a FLOAT_EXPR, much like its counterpart FIX_TRUNC_EXPR.

gcc/cp/ChangeLog:

* pt.c (tsubst_copy_and_build): Add assert.

3 years agoamdgcn: Silence warnings in gcn.c
Andrew Stubbs [Wed, 17 Mar 2021 14:13:10 +0000 (14:13 +0000)]
amdgcn: Silence warnings in gcn.c

This fixes a few cases of "unquoted identifier or keyword", one "spurious
trailing punctuation sequence", and a "may be used uninitialized".

gcc/ChangeLog:

* config/gcn/gcn.c (gcn_parse_amdgpu_hsa_kernel_attribute): Add %< and
  %> quote markers to error messages.
(gcn_goacc_validate_dims): Likewise.
(gcn_conditional_register_usage): Remove exclaimation mark from error
message.
(gcn_vectorize_vec_perm_const): Ensure perm is fully uninitialized.

3 years agoFix idiv latencies for znver3
Jan Hubicka [Thu, 18 Mar 2021 16:15:34 +0000 (17:15 +0100)]
Fix idiv latencies for znver3

update costs of integer divides to match actual latencies (the scheduler model
already does the right thing).  It is essentially no-op, since we end up
expanding idiv for all sensible constants, so this only may end up disabling
vectorization in some cases, but I did not find any such examples.  However in
general it is better ot have actual latencies than random numbers.

gcc/ChangeLog:

2021-03-18  Jan Hubicka  <hubicka@ucw.cz>

* config/i386/x86-tune-costs.h (struct processor_costs): Fix costs of
integer divides1.

3 years agoPR target/99314: Fix integer signedness issue for cpymem pattern expansion.
Sinan Lin [Thu, 4 Mar 2021 10:02:39 +0000 (18:02 +0800)]
PR target/99314: Fix integer signedness issue for cpymem pattern expansion.

Third operand of cpymem pattern is unsigned HOST_WIDE_INT, however we
are interpret that as signed HOST_WIDE_INT, that not a problem in
most case, but when the value is large than signed HOST_WIDE_INT, it
might screw up since we have using that value to calculate the buffer
size.

2021-03-05  Sinan Lin  <sinan@isrc.iscas.ac.cn>
    Kito Cheng  <kito.cheng@sifive.com>

gcc/ChangeLog:

* config/riscv/riscv.c (riscv_block_move_straight): Change type
to unsigned HOST_WIDE_INT for parameter and local variable with
HOST_WIDE_INT type.
(riscv_adjust_block_mem): Ditto.
(riscv_block_move_loop): Ditto.
(riscv_expand_block_move): Ditto.

3 years agotestsuite: Fix up strlenopt-80.c on powerpc [PR99636]
Jakub Jelinek [Thu, 18 Mar 2021 15:14:47 +0000 (16:14 +0100)]
testsuite: Fix up strlenopt-80.c on powerpc [PR99636]

Similar issue as in strlenopt-73.c, various spots in this test rely
on MOVE_MAX >= 8, this time it uses a target selector to pick up a couple
of targets, and all of them but powerpc 32-bit satisfy it, but powerpc
32-bit have MOVE_MAX just 4.

2021-03-18  Jakub Jelinek  <jakub@redhat.com>

PR testsuite/99636
* gcc.dg/strlenopt-80.c: For powerpc*-*-*, only enable for lp64.

3 years agotestsuite: Fix up strlenopt-73.c on powerpc [PR99626]
Jakub Jelinek [Thu, 18 Mar 2021 15:11:46 +0000 (16:11 +0100)]
testsuite: Fix up strlenopt-73.c on powerpc [PR99626]

As mentioned in the testcase as well as in the PR, this testcase relies on
MOVE_MAX being sufficiently large that the memcpy call is folded early into
load + store.  Some popular targets define MOVE_MAX to 8 or even 16 (e.g.
x86_64 or some options on s390x), but many other targets define it to just 4
(e.g. powerpc 32-bit), or even 2.

The testcase has already one test routine guarded on one particular target
with MOVE_MAX 16 (but does it incorrectly, __i386__ is only defined on
32-bit x86 and __SIZEOF_INT128__ is only defined on 64-bit targets), this
patch fixes that, and guards another test that relies on memcpy (, , 8)
being folded that way (which therefore needs MOVE_MAX >= 8) on a couple of
common targets that are known to have such MOVE_MAX.

2021-03-18  Jakub Jelinek  <jakub@redhat.com>

PR testsuite/99626
* gcc.dg/strlenopt-73.c: Ifdef out test_copy_cond_unequal_length_i64
on targets other than x86, aarch64, s390 and 64-bit powerpc.  Use
test_copy_cond_unequal_length_i128 for __x86_64__ with int128 support
rather than __i386__.

3 years agoUpdate email address for primary entry
Jeff Law [Thu, 18 Mar 2021 14:33:20 +0000 (08:33 -0600)]
Update email address for primary entry

/
* MAINTAINERS: Update primary entry.

3 years agotestsuite: Skip c-c++-common/zero-scratch-regs-10.c on arm
Christophe Lyon [Thu, 18 Mar 2021 09:58:52 +0000 (09:58 +0000)]
testsuite: Skip c-c++-common/zero-scratch-regs-10.c on arm

As discussed in PR 97680, -fzero-call-used-regs is not supported on
arm.

Skip this test to avoid failure reports.

2021-03-18  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/testsuite/
PR testsuite/97680
* c-c++-common/zero-scratch-regs-10.c: Skip on arm

3 years agoFix building the V850 port using recent versions of gcc.
Nick Clifton [Thu, 18 Mar 2021 12:57:25 +0000 (12:57 +0000)]
Fix building the V850 port using recent versions of gcc.

gcc/
* config/v850/v850.c (construct_restore_jr): Increase static
 buffer size.
(construct_save_jarl): Likewise.
* config/v850/v850.h (DWARF2_DEBUGGING_INFO): Define.

3 years agoObjective-C++ : Fix handling of unnamed message parms [PR49070].
Iain Sandoe [Fri, 26 Feb 2021 10:21:02 +0000 (10:21 +0000)]
Objective-C++ : Fix handling of unnamed message parms [PR49070].

When we are parsing an Objective-C++ message, a colon is a valid
terminator for a assignment-expression.  That is:

[receiver meth:x:x:x:x];

Is a valid, if somewhat unreadable, construction; corresponding
to a method declaration like:

- (id) meth:(id)arg0 :(id)arg1 :(id)arg2 :(id)arg3;

Where three of the message params have no selector name.

If fact, although it might be unintentional, Objective-C/C++ can
accept message selectors with all the parms unnamed (this applies
to the clang implementation too, which is taken as the reference
for the language).

For regular C++, the pattern x:x is not valid in that position an
an error is emitted with a fixit for the expected scope token.

If we simply made that error conditional on !c_dialect_objc()
that would regress Objective-C++ diagnostics for cases outside a
message selector, so we add a state flag for this.

gcc/cp/ChangeLog:

PR objc++/49070
* parser.c (cp_debug_parser): Add Objective-C++ message
state flag.
(cp_parser_nested_name_specifier_opt): Allow colon to
terminate an assignment-expression when parsing Objective-
C++ messages.
(cp_parser_objc_message_expression): Set and clear message
parsing state on entry and exit.
* parser.h (struct cp_parser): Add a context flag for
Objective-C++ message state.

gcc/testsuite/ChangeLog:

PR objc++/49070
* obj-c++.dg/pr49070.mm: New test.
* objc.dg/unnamed-parms.m: New test.

3 years agoaarch64: Improve generic SVE tuning defaults
Kyrylo Tkachov [Thu, 18 Mar 2021 08:57:01 +0000 (08:57 +0000)]
aarch64: Improve generic SVE tuning defaults

This patch adds the recently-added tweak to split some SVE VL-based scalar
operations [1] to the generic tuning used for SVE, as enabled by adding +sve
to the -march flag, for example -march=armv8.2-a+sve.

The recommendation for best performance on a particular CPU remains unchanged:
use the -mcpu option for that CPU, where possible. -mcpu=native makes this
straightforward for native compilation.

The tweak to split out SVE VL-based scalar operations is a consistent win for
the Neoverse V1 CPU and should be neutral for the Fujitsu A64FX. A run of
SPEC2017 on A64FX with this tweak on didn't show any non-noise differences.
It is also expected to be neutral on SVE2 implementations.

Therefore, the patch enables the tweak for generic +sve tuning e.g.
-march=armv8.2-a+sve. No SVE2 CPUs are expected to benefit from it,
therefore the tweak is disabled for generic tuning when +sve2 is in
-march e.g. -march=armv8.2-a+sve2.

The implementation of this approach requires a bit of custom logic in
aarch64_override_options_internal to handle these kinds of
architecture-dependent decisions, but we do believe the user-facing principle
here is important to implement.

In general, for the generic target we're using a decision framework that looks
like:

* If all cores that are known to benefit from an optimization
are of architecture X, and all other cores that implement X or above
are not impacted, or have a very slight impact, we will consider it for
generic tuning for architecture X.
* We will not enable that optimisation for generic tuning for architecture X+1
if no known cores of architecture X+1 or above will benefit.

This framework allows us to improve generic tuning for CPUs of generation X
while avoiding accumulating tweaks for future CPUs of generation X+1, X+2...
that do not need them, and thus avoid even the slight negative effects of
these optimisations if the user is willing to tell us the desired architecture
accurately.

X above can mean either annual architecture updates (Armv8.2-a, Armv8.3-a etc)
or optional architecture extensions (like SVE, SVE2).

[1] http://gcc.gnu.org/g:a65b9ad863c5fc0aea12db58557f4d286a1974d7

gcc/ChangeLog:

* config/aarch64/aarch64.c (aarch64_adjust_generic_arch_tuning): Define.
(aarch64_override_options_internal): Use it.
(generic_tunings): Add AARCH64_EXTRA_TUNE_CSE_SVE_VL_CONSTANTS to
tune_flags.

gcc/testsuite/ChangeLog:

* g++.target/aarch64/sve/aarch64-sve.exp: Add -moverride=tune=none to
sve_flags.
* g++.target/aarch64/sve/acle/aarch64-sve-acle-asm.exp: Likewise.
* g++.target/aarch64/sve/acle/aarch64-sve-acle.exp: Likewise.
* gcc.target/aarch64/sve/aarch64-sve.exp: Likewise.
* gcc.target/aarch64/sve/acle/aarch64-sve-acle-asm.exp: Likewise.
* gcc.target/aarch64/sve/acle/aarch64-sve-acle.exp: Likewise.

3 years agocoroutines: init struct members to NULL
Martin Liska [Tue, 16 Mar 2021 12:26:09 +0000 (13:26 +0100)]
coroutines: init struct members to NULL

gcc/cp/ChangeLog:

PR c++/99617
* coroutines.cc (struct var_nest_node): Init then_cl and else_cl
to NULL.

3 years agotestsuite: Fix up pr98099.c testcase for big endian [PR98099]
Jakub Jelinek [Thu, 18 Mar 2021 08:53:24 +0000 (09:53 +0100)]
testsuite: Fix up pr98099.c testcase for big endian [PR98099]

The testcase fails on big-endian without int128 support, because
due to -fsso-struct=big-endian no swapping is needed for big endian.
This patch restricts the testcase to big or little endian (but not pdp)
and uses -fsso-struct=little-endian for big endian, so that it is
swapping everywhere.

2021-03-18  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/98099
* gcc.dg/pr98099.c: Don't compile the test on pdp endian.
For big endian use -fsso-struct=little-endian dg-options.

3 years agoDaily bump.
GCC Administrator [Thu, 18 Mar 2021 00:16:24 +0000 (00:16 +0000)]
Daily bump.

3 years agoc++: ICE with real-to-int conversion in template [PR97973]
Marek Polacek [Wed, 3 Mar 2021 23:37:49 +0000 (18:37 -0500)]
c++: ICE with real-to-int conversion in template [PR97973]

In this test we are building a call in a template, but since neither
the function nor any of its arguments are dependent, we go down the
normal path in finish_call_expr.  convert_arguments sees that we're
binding a reference to int to double and therein convert_to_integer
creates a FIX_TRUNC_EXPR.  Later, we call check_function_arguments
which folds the arguments, and, in a template, fold_for_warn calls
fold_non_dependent_expr.  But tsubst_copy_and_build should not see
a FIX_TRUNC_EXPR (see the patch discussed in
<https://gcc.gnu.org/pipermail/gcc-patches/2018-March/496183.html>)
or we crash.

So let's not create a FIX_TRUNC_EXPR in a template in the first place
and instead use IMPLICIT_CONV_EXPR.

gcc/cp/ChangeLog:

PR c++/97973
* call.c (conv_unsafe_in_template_p): New.
(convert_like): Use it.

gcc/testsuite/ChangeLog:

PR c++/97973
* g++.dg/conversion/real-to-int1.C: New test.

3 years agoc++: Private parent access check for using decls [PR19377]
Anthony Sharp [Wed, 10 Mar 2021 20:36:03 +0000 (20:36 +0000)]
c++: Private parent access check for using decls [PR19377]

This bug was already mostly fixed by the patch for PR17314. This
patch continues that by ensuring that where a using decl is used,
causing an access failure to a child class because the using decl is
private, the compiler correctly points to the using decl as the
source of the problem.

gcc/cp/ChangeLog:

2021-03-10  Anthony Sharp  <anthonysharp15@gmail.com>

* semantics.c (get_class_access_diagnostic_decl): New
function that examines special cases when a parent
class causes a private access failure.
(enforce_access): Slightly modified to call function
above.

gcc/testsuite/ChangeLog:

2021-03-10  Anthony Sharp  <anthonysharp15@gmail.com>

* g++.dg/cpp1z/using9.C: New using decl test.

Co-authored-by: Jason Merrill <jason@redhat.com>
3 years agonios2: Fix format complaints and similar diagnostics.
Sandra Loosemore [Wed, 17 Mar 2021 21:37:05 +0000 (14:37 -0700)]
nios2: Fix format complaints and similar diagnostics.

The nios2 back end has not been building with newer versions of host
GCC due to several complaints about diagnostic formatting, along with
a couple other warnings.  This patch fixes the errors seen when
building with a host compiler from current mainline head.  I also made
a pass through all the error messages in this file to make them use
more consistent formatting, even where the host compiler was not
specifically complaining.

gcc/
* config/nios2/nios2.c (nios2_custom_check_insns): Clean up
error message format issues.
(nios2_option_override): Likewise.
(nios2_expand_fpu_builtin): Likewise.
(nios2_init_custom_builtins): Adjust to avoid bogus strncpy
truncation warning.
(nios2_expand_custom_builtin): More error message format fixes.
(nios2_expand_rdwrctl_builtin): Likewise.
(nios2_expand_rdprs_builtin): Likewise.
(nios2_expand_eni_builtin): Likewise.
(nios2_expand_builtin): Likewise.
(nios2_register_custom_code): Likewise.
(nios2_valid_target_attribute_rec): Likewise.
(nios2_add_insn_asm): Fix uninitialized variable warning.

3 years agoEnable gather on zen3 hardware.
Jan Hubicka [Wed, 17 Mar 2021 21:37:11 +0000 (22:37 +0100)]
Enable gather on zen3 hardware.

For TSVC it get used by 5 benchmarks with following runtime improvements:

s4114: 1.424 -> 1.209  (84.9017%)
s4115: 2.021 -> 1.065  (52.6967%)
s4116: 1.549 -> 0.854  (55.1323%)
s4117: 1.386 -> 1.193  (86.075%)
vag: 2.741 -> 1.940  (70.7771%)

there is regression in

s4112: 1.115 -> 1.184  (106.188%)

The internal loop is:

        for (int i = 0; i < LEN_1D; i++) {
            a[i] += b[ip[i]] * s;
        }

(so a standard accmulate and add with indirect addressing)

  40a400:       c5 fe 6f 24 03          vmovdqu (%rbx,%rax,1),%ymm4
  40a405:       c5 fc 28 da             vmovaps %ymm2,%ymm3
  40a409:       48 83 c0 20             add    $0x20,%rax
  40a40d:       c4 e2 65 92 04 a5 00    vgatherdps %ymm3,0x594100(,%ymm4,4),%ymm0
  40a414:       41 59 00
  40a417:       c4 e2 75 a8 80 e0 34    vfmadd213ps 0x5b34e0(%rax),%ymm1,%ymm0
  40a41e:       5b 00
  40a420:       c5 fc 29 80 e0 34 5b    vmovaps %ymm0,0x5b34e0(%rax)
  40a427:       00
  40a428:       48 3d 00 f4 01 00       cmp    $0x1f400,%rax
  40a42e:       75 d0                   jne    40a400 <s4112+0x60>

compared to:

  40a280:       49 63 14 04             movslq (%r12,%rax,1),%rdx
  40a284:       48 83 c0 04             add    $0x4,%rax
  40a288:       c5 fa 10 04 95 00 41    vmovss 0x594100(,%rdx,4),%xmm0
  40a28f:       59 00
  40a291:       c4 e2 71 a9 80 fc 34    vfmadd213ss 0x5b34fc(%rax),%xmm1,%xmm0
  40a298:       5b 00
  40a29a:       c5 fa 11 80 fc 34 5b    vmovss %xmm0,0x5b34fc(%rax)
  40a2a1:       00
  40a2a2:       48 3d 00 f4 01 00       cmp    $0x1f400,%rax
  40a2a8:       75 d6                   jne    40a280 <s4112+0x40>

Looking at instructions latencies

 - fmadd is 4 cycles
 - vgatherdps is 39

So vgather iself is 4.8 cycle per iteration and probably CPU is able to execute
rest out of order getting clos to 4 cycles per iteration (it can do 2 loads in
parallel, one store and rest fits easily to execution resources). That would
explain 20% slowdown.

gimple internal loop is:
  _2 = a[i_38];
  _3 = (long unsigned int) i_38;
  _4 = _3 * 4;
  _5 = ip_18 + _4;
  _6 = *_5;
  _7 = b[_6];
  _8 = _7 * s_19;
  _9 = _2 + _8;
  a[i_38] = _9;
  i_28 = i_38 + 1;
  ivtmp_52 = ivtmp_53 - 1;
  if (ivtmp_52 != 0)
    goto <bb 8>; [98.99%]
  else
    goto <bb 4>; [1.01%]

0x25bac30 a[i_38] 1 times scalar_load costs 12 in body
0x25bac30 *_5 1 times scalar_load costs 12 in body
0x25bac30 b[_6] 1 times scalar_load costs 12 in body
0x25bac30 _7 * s_19 1 times scalar_stmt costs 12 in body
0x25bac30 _2 + _8 1 times scalar_stmt costs 12 in body
0x25bac30 _9 1 times scalar_store costs 16 in body

so 19 cycles estimate of scalar load

0x2668630 a[i_38] 1 times vector_load costs 12 in body
0x2668630 *_5 1 times unaligned_load (misalign -1) costs 12 in body
0x2668630 b[_6] 8 times scalar_load costs 96 in body
0x2668630 _7 * s_19 1 times scalar_to_vec costs 4 in prologue
0x2668630 _7 * s_19 1 times vector_stmt costs 12 in body
0x2668630 _2 + _8 1 times vector_stmt costs 12 in body
0x2668630 _9 1 times vector_store costs 16 in body

so 40 cycles per 8x vectorized body

tsvc.c:3450:27: note:  operating only on full vectors.
tsvc.c:3450:27: note:  Cost model analysis:
  Vector inside of loop cost: 160
  Vector prologue cost: 4
  Vector epilogue cost: 0
  Scalar iteration cost: 76
  Scalar outside cost: 0
  Vector outside cost: 4
  prologue iterations: 0
  epilogue iterations: 0
  Calculated minimum iters for profitability: 1

I think this generally suffers from GIGO principle.
One problem seems to be that we do not know about fmadd yet and compute it as
two instructions (6 cycles instead of 4). More importnat problem is that we do
not account the parallelism at all.  I do not see how to disable the
vecotrization here without bumping gather costs noticeably off reality and thus
we probably can try to experiment with this if more similar problems are found.

Icc is also using gather in s1115 and s128.
For s1115 the vectorization does not seem to help and s128 gets slower.

Clang and aocc does not use gathers.

* config/i386/x86-tune-costs.h (struct processor_costs): Update costs
of gather to match reality.
* config/i386/x86-tune.def (X86_TUNE_USE_GATHER): Enable for znver3.

3 years agocompiler: copy receiver argument for go/defer of method call
Ian Lance Taylor [Wed, 17 Mar 2021 05:34:20 +0000 (22:34 -0700)]
compiler: copy receiver argument for go/defer of method call

Test case is https://golang.org/cl/302371.

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

3 years agotestsuite, Darwin : Fix the asan/strncpy-overflow-1 test.
Iain Sandoe [Wed, 17 Mar 2021 13:05:47 +0000 (13:05 +0000)]
testsuite, Darwin : Fix the asan/strncpy-overflow-1 test.

1. To be more compatible with Linux, Darwin testcases that include
string.h should set _FORTIFY_SOURCE=0 since, otherwise, it will be
defaulted on and the _chk versions of the string builtins will be
used.  This testcase fails otherwise because there's no convenient
way to disable the _chk builtins.

2. The system tool that handles symbolization (atos) is not reliable
with GCC's DWARF-2 output but, fortunately, all the platform
versions that support the current sanitizers are able to handle
dwarf-3 for this testcase.

gcc/testsuite/ChangeLog:

* c-c++-common/asan/strncpy-overflow-1.c: Add _FORTIFY_SOURCE=0 and
-gdwarf-3 to the command line options. Adjust the expected line
numbers for the revised options header.

3 years agotestsuite, Darwin : Fix match output for asan/memcmp-1.c.
Iain Sandoe [Wed, 17 Mar 2021 12:56:49 +0000 (12:56 +0000)]
testsuite, Darwin : Fix match output for asan/memcmp-1.c.

The Darwin part of libasan produces different output for memcmp
cases from other ports.  The GCC implementation does produce the
same output for this test as the clang one (modulo the two points
below).

1. To be more compatible with Linux, Darwin testcases that include
string.h should set _FORTIFY_SOURCE=0 since, otherwise, it will be
defaulted on and the _chk versions of the string builtins will be
used.

2. The system tool that handles symbolization (atos) is not reliable
with GCC's DWARF-2 output but, fortunately, all the platform
versions that support the current sanitizers are able to handle
dwarf-3 for this testcase.

gcc/testsuite/ChangeLog:

* c-c++-common/asan/memcmp-1.c: Add _FORTIFY_SOURCE=0 and
-gdwarf-3 to the command line options.  Provide Darwin-
specific match lines for the expected output.

3 years agoaarch64: Fix status return logic in RNG intrinsics
Kyrylo Tkachov [Wed, 17 Mar 2021 18:21:05 +0000 (18:21 +0000)]
aarch64: Fix status return logic in RNG intrinsics

There is a bug with the RNG intrinsics in their return code. The definition says:

"Stores a 64-bit random number into the object pointed to by the argument and returns zero.
If the implementation could not generate a random number within a reasonable period of time
the object pointed to by the input is set to zero and a non-zero value is returned."

This means we should be testing whether to return non-zero with:
CSET W0, EQ
rather than NE.

This patch fixes that.

gcc/ChangeLog:

* config/aarch64/aarch64-builtins.c (aarch64_expand_rng_builtin): Use EQ
to compare against CC_REG rather than NE.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/acle/rng_2.c: New test.

3 years agox86: Update 'P' operand modifier for -fno-plt
H.J. Lu [Thu, 11 Mar 2021 14:48:24 +0000 (06:48 -0800)]
x86: Update 'P' operand modifier for -fno-plt

Update 'P' operand modifier for -fno-plt to support inline assembly
statements.  In 64-bit, we can always load function address with
@GOTPCREL.  In 32-bit, we load function address with @GOT only for
non-PIC since PIC register may not be available at call site.

gcc/

PR target/99504
* config/i386/i386.c (ix86_force_load_from_GOT_p): Support
inline assembly statements.
(ix86_print_operand): Update 'P' handling for -fno-plt.

gcc/testsuite/

PR target/99504
* gcc.target/i386/pr99530-1.c: New test.
* gcc.target/i386/pr99530-2.c: Likewise.
* gcc.target/i386/pr99530-3.c: Likewise.
* gcc.target/i386/pr99530-4.c: Likewise.
* gcc.target/i386/pr99530-5.c: Likewise.
* gcc.target/i386/pr99530-6.c: Likewise.

3 years agoAArch64: Fix -Werror issue in aarch64_simd_clone_compute_vecsize_and_simdlen
Tamar Christina [Wed, 17 Mar 2021 11:12:25 +0000 (11:12 +0000)]
AArch64: Fix -Werror issue in aarch64_simd_clone_compute_vecsize_and_simdlen

g:fcefc59befd396267b824c170b6a37acaf10874e introduced a new variable named
arg_type which shadows the function scoped one.

The function scoped one is now unused and so causes bootstrap to fail due to
-Werror.

This patch removes the unused variable.

gcc/ChangeLog:

PR target/99542
* config/aarch64/aarch64.c
(aarch64_simd_clone_compute_vecsize_and_simdlen): Remove unused var.

3 years agoDaily bump.
GCC Administrator [Wed, 17 Mar 2021 00:16:25 +0000 (00:16 +0000)]
Daily bump.

3 years agoaarch64: Fix up aarch64_simd_clone_compute_vecsize_and_simdlen [PR99542]
Christophe Lyon [Tue, 16 Mar 2021 21:48:10 +0000 (21:48 +0000)]
aarch64: Fix up aarch64_simd_clone_compute_vecsize_and_simdlen [PR99542]

The gcc.dg/declare-simd.c test does not emit a warning with
-mabi=ilp32.

2021-03-16  Christophe Lyon  <christophe.lyon@linaro.org>

PR target/99542
gcc/testsuite/
* gcc.dg/declare-simd.c (fn2): Expect a warning only under lp64.

3 years agoc++: Fix NaN as C++20 template argument
Jason Merrill [Tue, 16 Mar 2021 20:06:27 +0000 (16:06 -0400)]
c++: Fix NaN as C++20 template argument

C++20 allows floating-point types for non-type template parameters;
floating-point values are considered to be equivalent template arguments if
they are "identical", which conveniently seems to map onto an existing GCC
predicate.

gcc/cp/ChangeLog:

* tree.c (cp_tree_equal): Use real_identical.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/nontype-float1.C: New test.

3 years agoc++: Ensure correct destruction order of local statics [PR99613]
Jakub Jelinek [Tue, 16 Mar 2021 20:17:44 +0000 (21:17 +0100)]
c++: Ensure correct destruction order of local statics [PR99613]

As mentioned in the PR, if end of two constructions of local statics
is strongly ordered, their destructors should be run in the reverse order.
As we run __cxa_guard_release before calling __cxa_atexit, it is possible
that we have two threads that access two local statics in the same order
for the first time, one thread wins the __cxa_guard_acquire on the first
one but is rescheduled in between the __cxa_guard_release and __cxa_atexit
calls, then the other thread is scheduled and wins __cxa_guard_acquire
on the second one and calls __cxa_quard_release and __cxa_atexit and only
afterwards the first thread calls its __cxa_atexit.  This means a variable
whose completion of the constructor strongly happened after the completion
of the other one will be destructed after the other variable is destructed.

The following patch fixes that by swapping the __cxa_guard_release and
__cxa_atexit calls.

2021-03-16  Jakub Jelinek  <jakub@redhat.com>

PR c++/99613
* decl.c (expand_static_init): For thread guards, call __cxa_atexit
before calling __cxa_guard_release rather than after it.  Formatting
fixes.

3 years agors6000: Workaround for PR98092
Segher Boessenkool [Tue, 16 Mar 2021 18:29:11 +0000 (18:29 +0000)]
rs6000: Workaround for PR98092

The bcdinvalid_<mode> RTL instruction uses the "unordered" comparison,
which cannot be used if we have -ffinite-math-only.  We really need
CCMODEs that describe what bits in a CR field are set by other insns
than just comparisons, but that is a lot more surgery, and it is stage 4
now.  This patch does a simple workaround.

2021-03-16  Segher Boessenkool  <segher@kernel.crashing.org>

PR target/98092
* config/rs6000/predicates.md (branch_comparison_operator): Allow
ordered and unordered for CCFPmode, if flag_finite_math_only.

gcc/testsuite/
PR target/98092
* gcc.target/powerpc/pr98092.c: New.

3 years agoi386: Avoid mutual recursion between two peephole2s [PR99600]
Jakub Jelinek [Tue, 16 Mar 2021 17:46:20 +0000 (18:46 +0100)]
i386: Avoid mutual recursion between two peephole2s [PR99600]

As the testcase shows, the compiler hangs and eats all memory when compiling
it.  This is because in r11-7274-gdecd8fb0128870d0d768ba53dae626913d6d9c54
I have changed the ix86_avoid_lea_for_addr splitting from a splitter
into a peephole2 (because during splitting passes we don't have guaranteed
df, while during peephole2 we do).
The problem is we have another peephole2 that works in the opposite way,
when seeing split lea (in particular ASHIFT followed by PLUS) it attempts
to turn it back into a lea.
In the past, they were fighting against each other, but as they were in
different passes, simply the last one won.  So, split after reload
split the lea into shift left and plus, peephole2 reverted that (but, note
not perfectly, the peephole2 doesn't understand that something can be placed
into lea disp; to be fixed for GCC12) and then another split pass split the
lea appart again.
But my changes and the way peephole2 works means that we endlessly iterate
over those two, the first peephole2 splits the lea, the second one reverts
it, the first peephole2 splits the new lea back into new 2 insns and so
forth forever.
So, we need to break the cycle somehow.  This patch does that by not emitting
an ASHIFT insn from ix86_split_lea_for_addr but emitting a corresponding
MULT by constant instead, and splitting that later back into ASHIFT.

2021-03-16  Jakub Jelinek  <jakub@redhat.com>

PR target/99600
* config/i386/i386-expand.c (ix86_split_lea_for_addr): Emit a MULT
rather than ASHIFT.
* config/i386/i386.md (mult by 1248 into ashift): New splitter.

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

3 years agoc++: support target attr for DECL_LOCAL_DECL_P fns [PR99108]
Martin Liska [Wed, 3 Mar 2021 08:38:55 +0000 (09:38 +0100)]
c++: support target attr for DECL_LOCAL_DECL_P fns [PR99108]

We crash when target attribute get_function_versions_dispatcher is called
for a function that is not registered in call graph.  This was happening
because we were calling it for the function-local decls that aren't in the
symbol table, instead of the corresponding namespace-scope decls that are.

gcc/cp/ChangeLog:

PR c++/99108
* call.c (get_function_version_dispatcher): Handle
DECL_LOCAL_DECL_P.
* decl.c (maybe_version_functions): Likewise.
(maybe_mark_function_versioned): New.
* name-lookup.c (push_local_extern_decl_alias): No longer static.
* name-lookup.h (push_local_extern_decl_alias): Adjust.

gcc/testsuite/ChangeLog:

PR c++/99108
* g++.target/i386/pr99108.C: New test.

Co-authored-by: Jason Merrill <jason@redhat.com>
3 years agoFix potentially undefined behaviour when computing a sha1 value.
Nick Clifton [Tue, 16 Mar 2021 14:43:17 +0000 (14:43 +0000)]
Fix potentially undefined behaviour when computing a sha1 value.

libiberty/
* sha1.c (sha1_process_bytes): Use memmove in place of memcpy.

3 years agooptions: ignore flag_ipa_ra in cl_optimization_compare
Martin Liska [Tue, 16 Mar 2021 13:42:01 +0000 (14:42 +0100)]
options: ignore flag_ipa_ra in cl_optimization_compare

gcc/ChangeLog:

PR target/99592
* optc-save-gen.awk: Add flag_ipa_ra to exceptions for
cl_optimization_compare function.

gcc/testsuite/ChangeLog:

PR target/99592
* gcc.target/arm/pr99592.c: New test.

3 years agoIBM Z: Fix "+fvm" constraint with long doubles
Ilya Leoshkevich [Thu, 10 Dec 2020 14:43:59 +0000 (15:43 +0100)]
IBM Z: Fix "+fvm" constraint with long doubles

When a long double is passed to an asm statement with a "+fvm"
constraint, a LRA loop occurs.  This happens, because LRA chooses the
widest register class in this case (VEC_REGS), but the code generated
by s390_md_asm_adjust() always wants FP_REGS.  Mismatching register
classes cause infinite reloading.

Fix by treating "fv" constraints as "v" in s390_md_asm_adjust().

gcc/ChangeLog:

* config/s390/s390.c (f_constraint_p): Treat "fv" constraints
as "v".

gcc/testsuite/ChangeLog:

* gcc.target/s390/vector/long-double-asm-fprvrmem.c: New test.

3 years agolibstdc++: Remove symbols for new std::call_once implementation [PR 99341]
Jonathan Wakely [Fri, 12 Mar 2021 11:47:20 +0000 (11:47 +0000)]
libstdc++: Remove symbols for new std::call_once implementation [PR 99341]

This removes the new symbols added for the new futex-based
std::call_once implementation. These symbols were new on trunk, so not
in any released version. However, they are already present in some
beta distro releases (Fedora Linux 34) and in Fedora Linux rawhide. This
change can be locally reverted by distros that need to keep the symbols
present until affected packages have been rebuilt.

libstdc++-v3/ChangeLog:

PR libstdc++/99341
* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Remove
std::once_flag symbols.
* config/abi/post/ia64-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/m68k-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/riscv64-linux-gnu/baseline_symbols.txt:
Likewise.
* config/abi/pre/gnu.ver: Likewise.
* src/c++11/mutex.cc [_GLIBCXX_HAVE_LINUX_FUTEX]
(struct __once_flag_compat): Remove.
(_ZNSt9once_flag11_M_activateEv): Remove.
(_ZNSt9once_flag9_M_finishEb): Remove.

3 years agolibstdc++: Revert to old std::call_once implementation [PR 99341]
Jonathan Wakely [Fri, 12 Mar 2021 11:47:20 +0000 (11:47 +0000)]
libstdc++: Revert to old std::call_once implementation [PR 99341]

The new std::call_once implementation is not backwards compatible,
contrary to my intention. Because std::once_flag::_M_active() doesn't
write glibc's "fork generation" into the pthread_once_t object, it's
possible for glibc and libstdc++ to run two active executions
concurrently. This violates the primary invariant of the feature!

This patch reverts std::once_flag and std::call_once to the old
implementation that uses pthread_once. This means PR 66146 is a problem
again, but glibc has been changed to solve that. A new API similar to
pthread_once but supporting failure and resetting the pthread_once_t
will be proposed for inclusion in glibc and other C libraries.

This change doesn't simply revert r11-4691 because I want to retain the
new implementation for non-ghtreads targets (which didn't previously
support std::call_once at all, so there's no backwards compatibility
concern). This also leaves the new std::call_once::_M_activate() and
std::call_once::_M_finish(bool) symbols present in libstdc++.so.6 so
that code already compiled against GCC 11 can still use them. Those
symbols will be removed in a subsequent commit (which distros can choose
to temporarily revert if needed).

libstdc++-v3/ChangeLog:

PR libstdc++/99341
* include/std/mutex [_GLIBCXX_HAVE_LINUX_FUTEX] (once_flag):
Revert to pthread_once_t implementation.
[_GLIBCXX_HAVE_LINUX_FUTEX] (call_once): Likewise.
* src/c++11/mutex.cc [_GLIBCXX_HAVE_LINUX_FUTEX]
(struct __once_flag_compat): New type matching the reverted
implementation of once_flag using futexes.
(once_flag::_M_activate): Remove, replace with ...
(_ZNSt9once_flag11_M_activateEv): ... alias symbol.
(once_flag::_M_finish): Remove, replace with ...
(_ZNSt9once_flag9_M_finishEb): ... alias symbol.
* testsuite/30_threads/call_once/66146.cc: Removed.

3 years agoc++: Incorrect type equivalence [PR 99496]
Nathan Sidwell [Mon, 15 Mar 2021 18:25:46 +0000 (11:25 -0700)]
c++: Incorrect type equivalence [PR 99496]

This bug was caused by not marking dependent template aliases
correctly -- these things look like typedefs, but are not
(necessarily) equivalent to the canonical type.  We need to record that.

PR c++/99496
gcc/cp/
* module.cc (trees_out::decl_value): Adjust typedef streaming,
indicate whether it is a dependent alias.
(trees_in::decl_value): Likewise.  Set as dependent alias, if it
is one.
gcc/testsuite/
* g++.dg/modules/pr99496_a.H: New.
* g++.dg/modules/pr99496_b.C: New.

3 years agoDaily bump.
GCC Administrator [Tue, 16 Mar 2021 10:55:35 +0000 (10:55 +0000)]
Daily bump.

3 years agogcc-changelog: skip broken commit in git_update_version.py.
Martin Liska [Tue, 16 Mar 2021 08:35:32 +0000 (09:35 +0100)]
gcc-changelog: skip broken commit in git_update_version.py.

contrib/ChangeLog:

* gcc-changelog/git_update_version.py: Skip one problematic
commit.

3 years agoi386: Fix up _mm256_vzeroupper() handling [PR99563]
Jakub Jelinek [Tue, 16 Mar 2021 10:16:15 +0000 (11:16 +0100)]
i386: Fix up _mm256_vzeroupper() handling [PR99563]

My r10-6451-gb7b3378f91c0641f2ef4d88db22af62a571c9359 fix for
vzeroupper vs. ms ABI apparently broke the explicit vzeroupper handling
when the implicit vzeroupper handling is disabled.
The epilogue_completed splitter for vzeroupper now adds clobbers for all
registers which don't have explicit sets in the pattern and the sets are
added during vzeroupper pass.  Before my changes, for explicit user
vzeroupper, we just weren't modelling its effects at all, it was just
unspec that didn't tell that it clobbers the upper parts of all XMM < %xmm16
registers.  But now the splitter will even for those add clobbers and as
it has no sets, it will add clobbers for all registers, which means
we optimize away anything that lived across that vzeroupper.

The vzeroupper pass has two parts, one is the mode switching that computes
where to put the implicit vzeroupper calls and puts them there, and then
another that uses df to figure out what sets to add to all the vzeroupper.
The former part should be done only under the conditions we have in the
gate, but the latter as this PR shows needs to happen either if we perform
the implicit vzeroupper additions, or if there are (or could be) any
explicit vzeroupper instructions.  As that function does df_analyze and
walks the whole IL, I think it would be too expensive to run it always
whenever TARGET_AVX, so this patch remembers if we've expanded at least
one __builtin_ia32_vzeroupper in the function and runs that part of the
vzeroupper pass both when the old condition is true or when this new
flag is set.

2021-03-16  Jakub Jelinek  <jakub@redhat.com>

PR target/99563
* config/i386/i386.h (struct machine_function): Add
has_explicit_vzeroupper bitfield.
* config/i386/i386-expand.c (ix86_expand_builtin): Set
cfun->machine->has_explicit_vzeroupper when expanding
IX86_BUILTIN_VZEROUPPER.
* config/i386/i386-features.c (rest_of_handle_insert_vzeroupper):
Do the mode switching only when TARGET_VZEROUPPER, expensive
optimizations turned on and not optimizing for size.
(pass_insert_vzeroupper::gate): Enable even when
cfun->machine->has_explicit_vzeroupper is set.

* gcc.target/i386/avx-pr99563.c: New test.

3 years agoaarch64: Fix up aarch64_simd_clone_compute_vecsize_and_simdlen [PR99542]
Jakub Jelinek [Tue, 16 Mar 2021 09:34:44 +0000 (10:34 +0100)]
aarch64: Fix up aarch64_simd_clone_compute_vecsize_and_simdlen [PR99542]

As the patch shows, there are several bugs in
aarch64_simd_clone_compute_vecsize_and_simdlen.
One is that unlike for function declarations that aren't definitions
it completely ignores argument types.  Such decls don't have DECL_ARGUMENTS,
but we can walk TYPE_ARG_TYPES instead, like the i386 backend does or like
the simd cloning code in the middle end does too.

Another problem is that it checks types of uniform arguments.  That is
unnecessary, uniform arguments are passed the way it normally is, it is
a scalar argument rather than vector, so there is no reason not to support
uniform argument of different size, or long double, structure etc.

2021-03-16  Jakub Jelinek  <jakub@redhat.com>

PR target/99542
* config/aarch64/aarch64.c
(aarch64_simd_clone_compute_vecsize_and_simdlen): If not a function
definition, walk TYPE_ARG_TYPES list if non-NULL for argument types
instead of DECL_ARGUMENTS.  Ignore types for uniform arguments.

* gcc.dg/gomp/pr99542.c: New test.
* gcc.dg/gomp/pr59669-2.c (bar): Don't expect a warning on aarch64.
* gcc.dg/gomp/simd-clones-2.c (setArray): Likewise.
* g++.dg/vect/simd-clone-7.cc (bar): Likewise.
* g++.dg/gomp/declare-simd-1.C (f37): Expect a different warning
on aarch64.
* gcc.dg/declare-simd.c (fn2): Expect a new warning on aarch64.

3 years agotestsuite: Fix up target selector syntax errors in modules/builtin-3*.C [PR99601]
Jakub Jelinek [Mon, 15 Mar 2021 23:24:15 +0000 (00:24 +0100)]
testsuite: Fix up target selector syntax errors in modules/builtin-3*.C [PR99601]

Without this patch I'm seeing:
ERROR: tcl error sourcing /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp.
ERROR: unmatched open brace in list
    while executing
"foreach op $tmp {
        switch [lindex $op 0] {
            "dg-options" {
                set std_prefix "-std=gnu++"
                if { [string match "*-std=*" [lindex $op 2]] } {
                    ..."
    (procedure "module-init" line 7)
    invoked from within
"module-init $src"
    invoked from within
"if [runtest_file_p $runtests $src] {
        set tests [lsort [find [file dirname $src]  [regsub {_a.[CHX]$} [file tail $src] {_[a-z].[CHX]}]]]

        set std_lis..."
    ("foreach" body line 3)
    invoked from within
"foreach src [lsort [find $srcdir/$subdir {*_a.[CHX}]] {
    # use the FOO_a.C name as the parallelization key
    if [runtest_file_p $runtests $src] {..."
    (file "/home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp" line 304)
    invoked from within
"source /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source /home/jakub/src/gcc/gcc/testsuite/g++.dg/modules/modules.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""

2021-03-16  Jakub Jelinek  <jakub@redhat.com>

PR c++/99601
* g++.dg/modules/builtin-3_a.C: Fix target selector syntax errors.
* g++.dg/modules/builtin-3_b.C: Likewise.

3 years agolibgo: update to Go 1.16.2 release
Ian Lance Taylor [Sat, 13 Mar 2021 03:44:12 +0000 (19:44 -0800)]
libgo: update to Go 1.16.2 release

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

3 years agoUpdate gcc sv.po.
Joseph Myers [Mon, 15 Mar 2021 20:30:40 +0000 (20:30 +0000)]
Update gcc sv.po.

* sv.po: Update.

3 years agoc++: Fix 2 testcases [PR 99601]
Nathan Sidwell [Mon, 15 Mar 2021 19:25:32 +0000 (15:25 -0400)]
c++: Fix 2 testcases [PR 99601]

I'd failed to correctly restrict some checks to lp64 x86 targets.

PR c++/99601
gcc/testsuite/
* g++.dg/modules/builtin-3_a.C: Fix lp64 x86 detection.
* g++.dg/modules/builtin-3_b.C: Fix lp64 x86 detection.

3 years agolibstdc++-v3: Update VTV vars for libtool link commands [PR99172]
Caroline Tice [Fri, 12 Mar 2021 15:34:36 +0000 (07:34 -0800)]
libstdc++-v3: Update VTV vars for libtool link commands [PR99172]

This fixes PR 99172

Currently when GCC is configured with --enable-vtable-verify, the
libstdc++-v3 Makefiles add "-fvtable-verify=std
-Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end" to libtool link
commands. The "-fvtable-verify=std" piece causes alternate versions of
libtool (such as slibtool) to fail, unable to find "-lvtv" (GNU
libtool just removes that piece).

This patch updates the libstdc++-v3 Makefiles to not pass
"-fvtable-verify=std" to the libtool link commands.

3 years agocoroutines : Convert await_ready () expressions to bool [PR99047].
Iain Sandoe [Sun, 14 Mar 2021 14:42:52 +0000 (14:42 +0000)]
coroutines : Convert await_ready () expressions to bool [PR99047].

The awaiter.await_ready() should be converted per [expr.await]/3

(3.6) await-ready is the expression e.await_ready(), contextually
      converted to bool.

gcc/cp/ChangeLog:

PR c++/99047
* coroutines.cc (expand_one_await_expression): If the
await_ready() expression is not a boolean then convert it
as required.

gcc/testsuite/ChangeLog:

PR c++/99047
* g++.dg/coroutines/pr99047.C: New test.

3 years agocoroutines : Handle rethrow from unhandled_exception [PR98704].
Iain Sandoe [Thu, 11 Mar 2021 17:04:14 +0000 (17:04 +0000)]
coroutines : Handle rethrow from unhandled_exception [PR98704].

Although there is still some discussion in CWG 2451 on this, the
implementors are agreed on the intent.

When promise.unhandled_exception () is entered, the coroutine is
considered to be still running - returning from the method will
cause the final await expression to be evaluated.

If the method throws, that action is considered to make the
coroutine suspend (since, otherwise, it would be impossible to
reclaim its resources, since one cannot destroy a running coro).

The wording issue is to do with how to represent the place at
which the coroutine should be considered suspended.

For the implementation here, that place is immediately before the
promise life-time ends. A handler for the rethrown exception, can
thus call xxxx.destroy() which will run DTORs for the promise and
any parameter copies [as needed] then the coroutine frame will be
deallocated.

At present, we also set "done=true" in this case (for compatibility
with other current implementations).  One might consider 'done()'
to be misleading in the case of an abnormal termination - that is
also part of the CWG 2451 discussion.

gcc/cp/ChangeLog:

PR c++/98704
* coroutines.cc (build_actor_fn): Make destroy index 1
correspond to the abnormal unhandled_exception() exit.
Substitute the proxy for the resume index.
(coro_rewrite_function_body): Arrange to reset the resume
index and make done = true for a rethrown exception from
unhandled_exception ().
(morph_fn_to_coro): Adjust calls to build_actor_fn and
coro_rewrite_function_body.

gcc/testsuite/ChangeLog:

PR c++/98704
* g++.dg/coroutines/torture/pr98704.C: New test.

3 years agocoroutines : Handle for await expressions in for stmts [PR98480].
Iain Sandoe [Thu, 11 Mar 2021 14:22:37 +0000 (14:22 +0000)]
coroutines : Handle for await expressions in for stmts [PR98480].

The handling of await expressions in the init, condition and iteration
expressions of for loops had been omitted.  Fixed thus.

gcc/cp/ChangeLog:

PR c++/98480
* coroutines.cc (replace_continue): Rewrite continue into
'goto label'.
(await_statement_walker): Handle await expressions in the
initializer, condition and iteration expressions of for
loops.

gcc/testsuite/ChangeLog:

PR c++/98480
* g++.dg/coroutines/pr98480.C: New test.
* g++.dg/coroutines/torture/co-await-24-for-init.C: New test.
* g++.dg/coroutines/torture/co-await-25-for-condition.C: New test.
* g++.dg/coroutines/torture/co-await-26-for-iteration-expr.C: New test.

3 years agocoroutines : Avoid generating empty statements [PR96749].
Iain Sandoe [Tue, 2 Mar 2021 10:12:58 +0000 (10:12 +0000)]
coroutines : Avoid generating empty statements [PR96749].

In the compiler-only idiom:
" a = (target expr creats temp, op uses temp) "
the target expression variable needs to be promoted to a frame one
(if the expression has a suspend point).  However, the only uses of
the var are in the second part of the compound expression - and we
were creating an empty statement corresponding to the (now unused)
first arm.  This then produces the spurious warnings noted.

Fixed by avoiding generation of a separate variable nest for
isolated target expressions (or similarly isolated co_awaits used
in a function call).

gcc/cp/ChangeLog:

PR c++/96749
* coroutines.cc (flatten_await_stmt): Allow for the case
where a target expression variable only has uses in the
second part of a compound expression.
(maybe_promote_temps): Avoid emiting empty statements.

gcc/testsuite/ChangeLog:

PR c++/96749
* g++.dg/coroutines/pr96749-1.C: New test.
* g++.dg/coroutines/pr96749-2.C: New test.

3 years agolibstdc++, testsuite, Darwin : Adjust for names used in system headers.
Iain Sandoe [Mon, 15 Mar 2021 00:34:27 +0000 (00:34 +0000)]
libstdc++, testsuite, Darwin : Adjust for names used in system headers.

For all current Darwin SDKs inttypes.h has:
extern intmax_t imaxabs(intmax_t j);

So we need to exclude j from the defined test symbols.

libstdc++-v3/ChangeLog:

* testsuite/17_intro/names.cc: Exclude j from the list
of test symbols for Darwin.

3 years agolibstdc++, Darwin, ppc : Add new long double symbols.
Iain Sandoe [Mon, 15 Mar 2021 00:30:07 +0000 (00:30 +0000)]
libstdc++, Darwin, ppc : Add new long double symbols.

We need to add the symbols for to_chars and from_chars for the
long double cases.

libstdc++-v3/ChangeLog:

* config/os/bsd/darwin/ppc-extra.ver: Add matching for
to_chars and from_chars for long double.

3 years agotree-optimization/98834 - fix optimization regression with _b_c_p
Richard Biener [Mon, 15 Mar 2021 12:44:07 +0000 (13:44 +0100)]
tree-optimization/98834 - fix optimization regression with _b_c_p

The following makes FRE optimize a load we formerly required
SRA + CCP for which now run after we get rid of all __builtin_constant_p
calls.

2021-03-15  Richard Biener  <rguenther@suse.de>

PR tree-optimization/98834
* tree-ssa-sccvn.c (vn_reference_lookup_3): Handle missing
subsetting by truncating the access size.

* g++.dg/opt/pr98834.C: New testcase.

3 years agolibstdc++: Implement missing operator overloads in max_size_type.h
Patrick Palka [Mon, 15 Mar 2021 14:31:45 +0000 (10:31 -0400)]
libstdc++: Implement missing operator overloads in max_size_type.h

This implements operator++, operator-- and operator<=> for the
integer-class types defined in max_size_type.h, which I overlooked
when originally implementing the class.

libstdc++-v3/ChangeLog:

* include/bits/max_size_type.h (__max_size_type::operator _Tp):
Fix formatting.
(__max_size_type::operator++): Define.
(__max_size_type::operator--): Likewise.
(__max_size_type::operator<=>): Conditionally define (in place
of the other comparison operators).
(__max_diff_type::operator _Tp): Fix formatting.
(__max_diff_type::operator++): Define.
(__max_diff_type::operator--): Likewise.
(__max_diff_type::operator<=>): Conditionally define (in place
of the other comparison operators).
* testsuite/std/ranges/iota/max_size_type.cc (test01): Test
these operator overloads.

3 years agoanalyzer: fix missing comma in initializer
Martin Liska [Mon, 15 Mar 2021 08:29:48 +0000 (09:29 +0100)]
analyzer: fix missing comma in initializer

Fixes the following valid warning:

gcc/analyzer/sm-file.cc:250:5: warning: suspicious concatenation of string literals in an array initialization;
did you mean to separate the elements with a comma? [-Wstring-concatenation]

gcc/analyzer/ChangeLog:

* sm-file.cc (get_file_using_fns): Add missing comma in initializer.

3 years agoznver3 tuning part 1
Jan Hubicka [Mon, 15 Mar 2021 10:36:52 +0000 (11:36 +0100)]
znver3 tuning part 1

2021-03-15  Jan Hubicka  <hubicka@ucw.cz>

* config/i386/i386-options.c (processor_cost_table): Add znver3_cost.
* config/i386/x86-tune-costs.h (znver3_cost): New gobal variable; copy
of znver2_cost.

3 years agoHandle EXEC_IOLENGTH in doloop_contained_procedure_code.
Thomas Koenig [Mon, 15 Mar 2021 10:02:02 +0000 (11:02 +0100)]
Handle EXEC_IOLENGTH in doloop_contained_procedure_code.

This rather obvious patch fixes an ICE on valid which came about
because I did not handle EXEC_IOLENGTH as start of an I/O statement
when checking for the DO loop variable.  This is an 11 regression.

gcc/fortran/ChangeLog:

PR fortran/99345
* frontend-passes.c (doloop_contained_procedure_code):
Properly handle EXEC_IOLENGTH.

gcc/testsuite/ChangeLog:

PR fortran/99345
* gfortran.dg/do_check_16.f90: New test.
* gfortran.dg/do_check_17.f90: New test.

3 years agoFortran: Fix problem with allocate initialization [PR99545].
Paul Thomas [Mon, 15 Mar 2021 09:32:52 +0000 (09:32 +0000)]
Fortran: Fix problem with allocate initialization [PR99545].

2021-03-15  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran/ChangeLog

PR fortran/99545
* trans-stmt.c (gfc_trans_allocate): Mark the initialization
assignment by setting init_flag.

gcc/testsuite/ChangeLog

PR fortran/99545
* gfortran.dg/pr99545.f90: New test.

3 years agoOpenMP: Fix 'omp declare target' handling for vars [PR99509]
Tobias Burnus [Mon, 15 Mar 2021 09:12:58 +0000 (10:12 +0100)]
OpenMP: Fix 'omp declare target' handling for vars [PR99509]

For variables with 'declare target' attribute,
varpool_node::get_create marks variables as offload; however,
if the node already exists, it is not updated. C/C++ may tag
decl with 'declare target implicit', which may only be after
varpool creation turned into 'declare target' or 'declare target link';
in this case, the tagging has to happen in the FE.

gcc/c/ChangeLog:

PR c++/99509
* c-decl.c (finish_decl): For 'omp declare target implicit' vars,
ensure that the varpool node is marked as offloadable.

gcc/cp/ChangeLog:

PR c++/99509
* decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
ensure that the varpool node is marked as offloadable.

libgomp/ChangeLog:

PR c++/99509
* testsuite/libgomp.c-c++-common/declare_target-1.c: New test.

3 years agoFix -Wstring-concatenation warning.
Martin Liska [Mon, 15 Mar 2021 08:27:32 +0000 (09:27 +0100)]
Fix -Wstring-concatenation warning.

Fix the following clang warning:
gcc/spellcheck.c:477:3: warning: suspicious concatenation of string literals in an array initialization;
did you mean to separate the elements with a comma? [-Wstring-concatenation]

gcc/ChangeLog:

* spellcheck.c: Add missing comma in initialization.

3 years agotestsuite: fix typo in testcase pr99492.c
David Edelsohn [Mon, 15 Mar 2021 00:29:14 +0000 (20:29 -0400)]
testsuite: fix typo in testcase pr99492.c

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/pr99492.c: Fix typo.

3 years agoDaily bump.
GCC Administrator [Mon, 15 Mar 2021 00:16:26 +0000 (00:16 +0000)]
Daily bump.

3 years agoPR fortran/99112 - ICE with runtime diagnostics for SIZE intrinsic function
Harald Anlauf [Sun, 14 Mar 2021 19:39:58 +0000 (20:39 +0100)]
PR fortran/99112 - ICE with runtime diagnostics for SIZE intrinsic function

Add/fix handling of runtime checks for CLASS arguments with ALLOCATABLE
or POINTER attribute.

gcc/fortran/ChangeLog:

* trans-expr.c (gfc_conv_procedure_call): Fix runtime checks for
CLASS arguments.
* trans-intrinsic.c (gfc_conv_intrinsic_size): Likewise.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr99112.f90: New test.

Co-authored-by: Paul Thomas <pault@gcc.gnu.org>
3 years agoi386: Some more -mavx512vl -mno-avx512bw fixes [PR99321]
Uros Bizjak [Sun, 14 Mar 2021 17:51:14 +0000 (18:51 +0100)]
i386: Some more -mavx512vl -mno-avx512bw fixes [PR99321]

2021-03-14  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
* config/i386/sse.md (*vec_extract<mode>): Merge alternative 0 with
alternative 2 and alternative 1 with alternative 3 using
YW register constraint.
(*vec_extract<PEXTR_MODE12:mode>_zext): Merge alternatives
using YW register constraint.
(*vec_extractv16qi_zext): Ditto.
(*vec_extractv4si): Merge alternatives 4 and 5
using Yw register constraint.
(*ssse3_palignr<mode>_perm): Use Yw instead of v for alternative 3.

3 years agoDaily bump.
GCC Administrator [Sun, 14 Mar 2021 00:16:18 +0000 (00:16 +0000)]
Daily bump.

3 years agoPR tree-optimization/99489 - ICE calling strncat after strcat
Martin Sebor [Tue, 9 Mar 2021 22:02:35 +0000 (15:02 -0700)]
PR tree-optimization/99489 - ICE calling strncat after strcat

gcc/ChangeLog:

PR tree-optimization/99489
* builtins.c (gimple_call_alloc_size): Fail gracefully when argument
is not a call statement.

gcc/testsuite/ChangeLog:

PR tree-optimization/99489
* gcc.dg/Wstringop-truncation-9.c: New test.

3 years agoFortran: Fix for class defined operators [PR99125].
Paul Thomas [Sat, 13 Mar 2021 11:39:57 +0000 (11:39 +0000)]
Fortran: Fix for class defined operators [PR99125].

2021-03-13  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/99125
* trans-array.c (gfc_conv_expr_descriptor): For deferred length
length components use the ss_info string length instead of
gfc_get_expr_charlen. Make sure that the deferred string length
is a variable before assigning to it. Otherwise use the expr.
* trans-expr.c (gfc_conv_string_length): Make sure that the
deferred string length is a variable before assigning to it.

gcc/testsuite/
PR fortran/99125
* gfortran.dg/alloc_deferred_comp_1.f90: New test.

3 years agomatch.pd: Don't optimize vector X + (X << C) -> X * (1 + (1 << C)) if there is no...
Jakub Jelinek [Sat, 13 Mar 2021 07:56:15 +0000 (08:56 +0100)]
match.pd: Don't optimize vector X + (X << C) -> X * (1 + (1 << C)) if there is no mult support [PR99544]

E.g. on aarch64, the target has V2DImode addition and shift by scalar
optabs, but doesn't have V2DImode multiply.  The following testcase
ICEs because this simplification is done after last lowering, but
generally, even if it is done before that, turning it into a multiplication
will not be an improvement because that means scalarization, while the former
can be done in vectors.

It would be nice if we added expansion support for vector multiplication
by uniform constants using shifts and additions like we have for scalar
multiplication, but that is something that can be done in stage1.

2021-03-13  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/99544
* match.pd (X + (X << C) -> X * (1 + (1 << C))): Don't simplify
if for vector types multiplication can't be done in type's mode.

* gcc.dg/gomp/pr99544.c: New test.

3 years agomisc/cgo/testcarchive: don't use == for string equality in C code
Ian Lance Taylor [Sat, 13 Mar 2021 03:17:09 +0000 (19:17 -0800)]
misc/cgo/testcarchive: don't use == for string equality in C code

Backport of https://golang.org/cl/300993.

For PR go/99553

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

3 years agoMAINTAINERS: Add myself for write after approval
Eugene Rozenfeld [Sat, 13 Mar 2021 01:34:54 +0000 (17:34 -0800)]
MAINTAINERS: Add myself for write after approval

ChangeLog:

2021-03-12  Eugene Rozenfeld  <erozen@microsoft.com>

* MAINTAINERS (Write After Approval): Add myself.

3 years agosim: drop dep on configure-gdb
Mike Frysinger [Sun, 28 Feb 2021 06:43:21 +0000 (01:43 -0500)]
sim: drop dep on configure-gdb

I'm not entirely sure why this is here since the sim doesn't use
anything from the gdb/ dir directly, and the commit that added it
included a bunch more changes and doesn't seem to call out this
dep specifically.

ChangeLog:

* Makefile.def: Remove all-sim dependency on configure-gdb.
* Makefile.in: Regenerated.

3 years agoDaily bump.
GCC Administrator [Sat, 13 Mar 2021 00:16:20 +0000 (00:16 +0000)]
Daily bump.

This page took 0.117973 seconds and 5 git commands to generate.