]> gcc.gnu.org Git - gcc.git/log
gcc.git
3 years agoFortran - improve error recovery determining array element from constructor
Harald Anlauf [Tue, 7 Sep 2021 18:51:49 +0000 (20:51 +0200)]
Fortran - improve error recovery determining array element from constructor

gcc/fortran/ChangeLog:

PR fortran/101327
* expr.c (find_array_element): When bounds cannot be determined as
constant, return error instead of aborting.

gcc/testsuite/ChangeLog:

PR fortran/101327
* gfortran.dg/pr101327.f90: New test.

(cherry picked from commit 2a1537a19cb2fa85823cfa18ed40baa4b259b4e3)

3 years agoDaily bump.
GCC Administrator [Sat, 11 Sep 2021 00:18:00 +0000 (00:18 +0000)]
Daily bump.

3 years agocompiler: correct condition for calling memclrHasPointers
Ian Lance Taylor [Fri, 10 Sep 2021 18:14:25 +0000 (11:14 -0700)]
compiler: correct condition for calling memclrHasPointers

When compiling append(s, make([]typ, ln)...), where typ has a pointer,
and the append fits within the existing capacity of s, the condition
used to clear out the new elements was reversed.

Fixes golang/go#47771

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

3 years agoDaily bump.
GCC Administrator [Fri, 10 Sep 2021 00:17:54 +0000 (00:17 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 9 Sep 2021 00:18:03 +0000 (00:18 +0000)]
Daily bump.

3 years agoc++: Fix docs on assignment of virtual bases [PR60318]
Jonathan Wakely [Tue, 31 Aug 2021 08:46:41 +0000 (09:46 +0100)]
c++: Fix docs on assignment of virtual bases [PR60318]

The description of behaviour is incorrect, the virtual base gets
assigned before entering the bodies of A::operator= and B::operator=,
not after.

The example is also ill-formed (passing a string literal to char*) and
undefined (missing return from Base::operator=).

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
gcc/ChangeLog:

PR c++/60318
* doc/trouble.texi (Copy Assignment): Fix description of
behaviour and fix code in example.

(cherry picked from commit 3c64582372cf445eabc4f9e99def7e33fb0270ee)

3 years agoi386: Fix up @xorsign<mode>3_1 [PR102224]
Jakub Jelinek [Wed, 8 Sep 2021 09:25:31 +0000 (11:25 +0200)]
i386: Fix up @xorsign<mode>3_1 [PR102224]

As the testcase shows, we miscompile @xorsign<mode>3_1 if both input
operands are in the same register, because the splitter overwrites op1
before with op1 & mask before using op0.

For dest = xorsign op0, op0 we can actually simplify it from
dest = (op0 & mask) ^ op0 to dest = op0 & ~mask (aka abs).

The expander change is an optimization improvement, if we at expansion
time know it is xorsign op0, op0, we can emit abs right away and get better
code through that.

The @xorsign<mode>3_1 is a fix for the case where xorsign wouldn't be known
to have same operands during expansion, but during RTL optimizations they
would appear.  We need to use earlyclobber, we require dest and op1 to be
the same but op0 must be different because we overwrite
op1 first.

2021-09-08  Jakub Jelinek  <jakub@redhat.com>

PR target/102224
* config/i386/i386.md (xorsign<mode>3): If operands[1] is equal to
operands[2], emit abs<mode>2 instead.
(@xorsign<mode>3_1): Add early-clobber for output operand.

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

(cherry picked from commit a7b626d98a9a821ffb33466818d6aa86cac1d6fd)

3 years agotestsuite: Allow .sdata in more cases in gcc.dg/array-quals-1.c
Joseph Myers [Wed, 8 Sep 2021 15:38:18 +0000 (15:38 +0000)]
testsuite: Allow .sdata in more cases in gcc.dg/array-quals-1.c

When testing for Nios II (gcc-testresults shows this for MIPS as
well), failures of gcc.dg/array-quals-1.c appear where a symbol was
found in .sdata rather than one of the expected sections.

FAIL: gcc.dg/array-quals-1.c scan-assembler-symbol-section symbol ^_?a$ (found a) has section ^\\.(const|rodata|srodata)|\\[RO\\] (found .sdata)
FAIL: gcc.dg/array-quals-1.c scan-assembler-symbol-section symbol ^_?b$ (found b) has section ^\\.(const|rodata|srodata)|\\[RO\\] (found .sdata)
FAIL: gcc.dg/array-quals-1.c scan-assembler-symbol-section symbol ^_?c$ (found c) has section ^\\.(const|rodata|srodata)|\\[RO\\] (found .sdata)
FAIL: gcc.dg/array-quals-1.c scan-assembler-symbol-section symbol ^_?d$ (found d) has section ^\\.(const|rodata|srodata)|\\[RO\\] (found .sdata)

Jakub's commit 0b34dbc0a24864b1674bff7a92fa3cf0f1cbcea1 allowed .sdata
for many variables in that test where use of .sdata caused a failure
on powerpc-linux.  I'm presuming the choice of which variables had
.sdata allowed was based only on the code generated for powerpc-linux,
not on any reason it would be wrong to allow it for the other
variables; thus, this patch adjusts the test to allow .sdata for some
more variables where that is needed on Nios II (and in one case where
it's not needed on Nios II, but the test results on gcc-testresults
suggest that it is needed on MIPS).

Tested with no regressions with cross to nios2-elf.

* gcc.dg/array-quals-1.c: Allow .sdata section in more cases.

(cherry picked from commit d27d694151c5604d2daba23dd2a328ae70b65194)

3 years agotestsuite: Use explicit -ftree-cselim in tests using -fdump-tree-cselim-details
Joseph Myers [Wed, 8 Sep 2021 14:59:41 +0000 (14:59 +0000)]
testsuite: Use explicit -ftree-cselim in tests using -fdump-tree-cselim-details

When testing for Nios II (gcc-testresults shows this for various other
targets as well), tests scanning cselim dumps produce an UNRESOLVED
result because those dumps do not exist.

cselim is enabled conditionally by code in toplev.c:

  if (flag_tree_cselim == AUTODETECT_VALUE)
    {
      if (HAVE_conditional_move)
flag_tree_cselim = 1;
      else
flag_tree_cselim = 0;
    }

Add explicit -ftree-cselim to dg-options in the affected tests (as
already used by some other tests of cselim dumps) so that this dump
exists on all architectures.

Tested with no regressions with cross to nios2-elf, where this causes
the tests in question to PASS instead of being UNRESOLVED.

* gcc.dg/tree-ssa/pr89430-1.c, gcc.dg/tree-ssa/pr89430-2.c,
gcc.dg/tree-ssa/pr89430-3.c, gcc.dg/tree-ssa/pr89430-4.c,
gcc.dg/tree-ssa/pr89430-5.c, gcc.dg/tree-ssa/pr89430-6.c,
gcc.dg/tree-ssa/pr89430-7-comp-ref.c,
gcc.dg/tree-ssa/pr89430-8-mem-ref-size.c: Use -ftree-cselim.

(cherry picked from commit d081516ae1771984bfacb9f2c402a1973fa70d69)

3 years agoDaily bump.
GCC Administrator [Wed, 8 Sep 2021 00:18:01 +0000 (00:18 +0000)]
Daily bump.

3 years agogcc: xtensa: fix PR target/102115
Max Filippov [Tue, 7 Sep 2021 22:40:00 +0000 (15:40 -0700)]
gcc: xtensa: fix PR target/102115

2021-09-07  Takayuki 'January June' Suwa  <jjsuwa_sys3175@yahoo.co.jp>
gcc/
PR target/102115
* config/xtensa/xtensa.c (xtensa_emit_move_sequence): Add
'CONST_INT_P (src)' to the condition of the block that tries to
eliminate literal when loading integer contant.

(cherry picked from commit b552c4e601c7fdc4d341e29cc1ed6081d42b00d0)

3 years agoc++: Fix up constexpr evaluation of deleting dtors [PR100495]
Jakub Jelinek [Tue, 7 Sep 2021 17:33:28 +0000 (19:33 +0200)]
c++: Fix up constexpr evaluation of deleting dtors [PR100495]

We do not save bodies of constexpr clones and instead evaluate the bodies
of the constexpr functions they were cloned from.
I believe that is just fine for constructors because complete vs. base
ctors differ only in classes that have virtual bases and such constructors
aren't constexpr, similarly complete/base destructors.
But as the testcase below shows, for deleting destructors it is not fine,
deleting dtors while marked as clones in fact are just artificial functions
with synthetized body which calls the user destructor and deallocation.

So, either we'd need to evaluate the destructor and afterwards synthetize
and evaluate the deallocation, or we can just save and use the deleting
dtors bodies.  The latter seems much easier to me.

2021-09-07  Jakub Jelinek  <jakub@redhat.com>

PR c++/100495
* constexpr.c (maybe_save_constexpr_fundef): Save body even for
constexpr deleting dtors.
(cxx_eval_call_expression): Don't use DECL_CLONED_FUNCTION for
deleting dtors.

* g++.dg/cpp2a/constexpr-new21.C: New test.

(cherry picked from commit 81f9718139cb1cc164ada411ada8cca9f32b8be8)

3 years agoDaily bump.
GCC Administrator [Tue, 7 Sep 2021 00:17:59 +0000 (00:17 +0000)]
Daily bump.

3 years agotree-optimization/102046 - fix SLP build from scalars with patterns
Richard Biener [Wed, 25 Aug 2021 08:06:01 +0000 (10:06 +0200)]
tree-optimization/102046 - fix SLP build from scalars with patterns

When we swap operands for SLP builds we lose track where exactly
pattern defs are - but we fail to update the any_pattern member
of the operands info.  Do so conservatively.

2021-08-25  Richard Biener  <rguenther@suse.de>

PR tree-optimization/102046
* tree-vect-slp.c (vect_build_slp_tree_2): Conservatively
update ->any_pattern when swapping operands.

* gcc.dg/vect/pr102046.c: New testcase.

(cherry picked from commit 29c77454e5ab33ce06a741eacdfbd5348fbccc95)

3 years agotree-optimization/101925 - fix VN with reverse storage order
Richard Biener [Mon, 16 Aug 2021 13:17:08 +0000 (15:17 +0200)]
tree-optimization/101925 - fix VN with reverse storage order

This fixes value-numbering breaking reverse storage order accesses
due to a missed check.  It adds a new overload for
reverse_storage_order_for_component_p and sets reversed on the
VN IL ops for component and array accesses accordingly.
It also compares the reversed reference ops flag on reference
lookup.

2021-08-16  Richard Biener  <rguenther@suse.de>

PR tree-optimization/101925
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Set
reverse on COMPONENT_REF and ARRAY_REF according to
what reverse_storage_order_for_component_p does.
(vn_reference_eq): Compare reversed on reference ops.
(reverse_storage_order_for_component_p): New overload.
(vn_reference_lookup_3): Check reverse_storage_order_for_component_p
on the reference looked up.

* gcc.dg/sso-16.c: New testcase.

(cherry picked from commit 0215b3559e55f39f38e10984a804c53907f7491c)

3 years agomiddle-end/101824 - properly handle volatiles in nested fn lowering
Richard Biener [Mon, 9 Aug 2021 08:19:10 +0000 (10:19 +0200)]
middle-end/101824 - properly handle volatiles in nested fn lowering

When we build the COMPONENT_REF of a formerly volatile local off
the FRAME decl we have to make sure to mark the COMPONENT_REF
as TREE_THIS_VOLATILE.  While the GIMPLE operand scanner looks
at the FIELD_DECL this is not how volatile GENERIC refs work.

2021-08-09  Richard Biener  <rguenther@suse.de>

PR middle-end/101824
* tree-nested.c (get_frame_field): Mark the COMPONENT_REF as
volatile in case the variable was.

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

(cherry picked from commit bb169406cdc9e044eaec500dd742c2fed40f5488)

3 years agoDaily bump.
GCC Administrator [Mon, 6 Sep 2021 00:17:59 +0000 (00:17 +0000)]
Daily bump.

3 years agoFortran - extend set of substring expressions handled in length simplification
Harald Anlauf [Tue, 31 Aug 2021 19:00:53 +0000 (21:00 +0200)]
Fortran - extend set of substring expressions handled in length simplification

gcc/fortran/ChangeLog:

PR fortran/100950
* simplify.c (substring_has_constant_len): Minimize checks for
substring expressions being allowed.

gcc/testsuite/ChangeLog:

PR fortran/100950
* gfortran.dg/pr100950.f90: Extend coverage.

(cherry picked from commit e4cb3bb9ac11b4126ffa718287dd509a4b10a658)

3 years agoFortran - simplify length of substring with constant bounds
Harald Anlauf [Thu, 19 Aug 2021 19:00:45 +0000 (21:00 +0200)]
Fortran - simplify length of substring with constant bounds

gcc/fortran/ChangeLog:

PR fortran/100950
* simplify.c (substring_has_constant_len): New.
(gfc_simplify_len): Handle case of substrings with constant
bounds.

gcc/testsuite/ChangeLog:

PR fortran/100950
* gfortran.dg/pr100950.f90: New test.

(cherry picked from commit d881460deb1f0bdfc3e8fa2d391a03a9763cbff4)

3 years agoDaily bump.
GCC Administrator [Sun, 5 Sep 2021 00:17:58 +0000 (00:17 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 4 Sep 2021 00:18:02 +0000 (00:18 +0000)]
Daily bump.

3 years agoFortran - correct check for constraint F2008:C628 / F2018:C932
Harald Anlauf [Mon, 30 Aug 2021 20:41:01 +0000 (22:41 +0200)]
Fortran - correct check for constraint F2008:C628 / F2018:C932

gcc/fortran/ChangeLog:

PR fortran/101349
* resolve.c (resolve_allocate_expr): An unlimited polymorphic
argument to ALLOCATE must be ALLOCATABLE or a POINTER.  Fix the
corresponding check.

gcc/testsuite/ChangeLog:

PR fortran/101349
* gfortran.dg/unlimited_polymorphic_33.f90: New test.

(cherry picked from commit 9213ff13247739d6d335064a6b568278a872a991)

3 years agoFortran - fix whitespace issue during parsing of assigned goto
Harald Anlauf [Mon, 30 Aug 2021 21:07:56 +0000 (23:07 +0200)]
Fortran - fix whitespace issue during parsing of assigned goto

gcc/fortran/ChangeLog:

PR fortran/102113
* match.c (gfc_match_goto): Allow for whitespace in parsing list
of labels.

gcc/testsuite/ChangeLog:

PR fortran/102113
* gfortran.dg/goto_9.f90: New test.

(cherry picked from commit a7083b83e45852540a4a09ee11b74dc28d777399)

3 years agoUse UNSPSEC_XXSPLTIDP instead of UNSPEC_XXSPLTID
Michael Meissner [Fri, 3 Sep 2021 18:12:38 +0000 (14:12 -0400)]
Use UNSPSEC_XXSPLTIDP instead of UNSPEC_XXSPLTID

Backport from master:  2021-08-24  Michael Meissner  <meissner@linux.ibm.com>

2021-09-03  Michael Meissner  <meissner@linux.ibm.com>

gcc/

* config/rs6000/altivec.md (UNSPEC_XXSPLTIDP): Rename from
UNSPEC_XXSPLTID.
(xxspltidp_v2df): Likewise.
(xxspltidp_v2df_inst): Likewise.

3 years agoMake xxsplti*, xpermx, xxeval be vecperm type.
Michael Meissner [Fri, 3 Sep 2021 18:03:45 +0000 (14:03 -0400)]
Make xxsplti*, xpermx, xxeval be vecperm type.

Backport from master: 2021-08-24  Michael Meissner  <meissner@linux.ibm.com>

gcc/

* config/rs6000/altivec.md (xxspltiw_v4si): Use vecperm type
attribute.  Backport from master, 2021-08-24.
(xxspltiw_v4si_inst): Likewise.
(xxspltiw_v4sf_inst): Likewise.
(xxspltidp_v2df): Likewise.
(xxspltidp_v2df_inst): Likewise.
(xxsplti32dx_v4si): Likewise.
(xxsplti32dx_v4si_inst): Likewise.
(xxsplti32dx_v4sf_inst): Likewise.
(xxblend_<mode>): Likewise.
(xxpermx): Likewise.
(xxpermx_inst): Likewise.
(xxeval): Likewise.

3 years agoFix tests that require IBM 128-bit long double
Michael Meissner [Fri, 3 Sep 2021 16:59:47 +0000 (12:59 -0400)]
Fix tests that require IBM 128-bit long double

2021-09-03  Michael Meissner  <meissner@linux.ibm.com>

gcc/testsuite/
PR target/94630
* gcc.target/powerpc/pr70117.c: Specify that we need the long double
type to be IBM 128-bit.  Remove the code to use __ibm128.
Backport from master 2021-08-25.
* c-c++-common/dfp/convert-bfp-11.c: Specify that we need the long
double type to be IBM 128-bit.  Run the test at -O2 optimization.
Backport from master 2021-08-25.
* lib/target-supports.exp (add_options_for_long_double_ibm128): New
function.  Backport from master 2021-08-25.
(check_effective_target_long_double_ibm128): New function.
(add_options_for_long_double_ieee128): New function.
(check_effective_target_long_double_ieee128): New function.
(add_options_for_long_double_64bit): New function.
(check_effective_target_long_double_64bit): New function.

3 years agoRemove macro check for __AMX_BF16/INT8/TILE__ in header file.
liuhongt [Thu, 2 Sep 2021 04:49:46 +0000 (12:49 +0800)]
Remove macro check for __AMX_BF16/INT8/TILE__ in header file.

gcc/ChangeLog:

PR target/102166
* config/i386/amxbf16intrin.h : Remove macro check for __AMX_BF16__.
* config/i386/amxint8intrin.h : Remove macro check for __AMX_INT8__.
* config/i386/amxtileintrin.h : Remove macro check for __AMX_TILE__.

gcc/testsuite/ChangeLog:

PR target/102166
* g++.target/i386/pr102166.C: New test.

3 years agoDaily bump.
GCC Administrator [Fri, 3 Sep 2021 00:17:58 +0000 (00:17 +0000)]
Daily bump.

3 years agors6000: Fix ICE expanding lxvp and stxvp gimple built-ins [PR101849]
Peter Bergner [Thu, 19 Aug 2021 22:33:29 +0000 (17:33 -0500)]
rs6000: Fix ICE expanding lxvp and stxvp gimple built-ins [PR101849]

PR101849 shows we ICE on a test case when we pass a non __vector_pair *
pointer to the __builtin_vsx_lxvp and __builtin_vsx_stxvp built-ins
that is cast to __vector_pair *.  The problem is that when we expand
the built-in, the cast has already been removed from gimple and we are
only given the base pointer.  The solution used here (which fixes the ICE)
is to catch this case and convert the pointer to a __vector_pair * pointer
when expanding the built-in.

2021-08-19  Peter Bergner  <bergner@linux.ibm.com>

gcc/
PR target/101849
* config/rs6000/rs6000-call.c (rs6000_gimple_fold_mma_builtin): Cast
pointer to __vector_pair *.

gcc/testsuite/
PR target/101849
* gcc.target/powerpc/pr101849.c: New test.

(cherry picked from commit b0963c4379becafaebd8e52b0b42698ff151c293)

3 years agoDaily bump.
GCC Administrator [Thu, 2 Sep 2021 00:18:41 +0000 (00:18 +0000)]
Daily bump.

3 years agoc++: Fix ICE with nullptr comparison (GCC 11) [PR101592]
Marek Polacek [Wed, 1 Sep 2021 20:47:44 +0000 (16:47 -0400)]
c++: Fix ICE with nullptr comparison (GCC 11) [PR101592]

On trunk, PR101592 was fixed by r12-2537, but that change shouldn't be
backported to GCC 11.  In the PR Jakub suggested this fix, so here it
is, after the usual testing.

PR c++/101592

gcc/ChangeLog:

* fold-const.c (make_range_step): Return NULL_TREE for NULLPTR_TYPE.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wlogical-op-3.C: New test.

Co-authored-by: Jakub Jelinek <jakub@redhat.com>
3 years agovectorizer: Fix up vectorization using WIDEN_MINUS_EXPR [PR102124]
Jakub Jelinek [Wed, 1 Sep 2021 11:30:51 +0000 (13:30 +0200)]
vectorizer: Fix up vectorization using WIDEN_MINUS_EXPR [PR102124]

The following testcase is miscompiled on aarch64-linux at -O3 since the
introduction of WIDEN_MINUS_EXPR.
The problem is if the inner type (half_type) is unsigned and the result
type in which the subtraction is performed (type) has precision more than
twice as larger as the inner type's precision.
For other widening operations like WIDEN_{PLUS,MULT}_EXPR, if half_type
is unsigned, the addition/multiplication result in itype is also unsigned
and needs to be zero-extended to type.
But subtraction is special, even when half_type is unsigned, the subtraction
behaves as signed (also regardless of whether the result type is signed or
unsigned), 0xfeU - 0xffU is -1 or 0xffffffffU, not 0x0000ffff.

I think it is better not to use mixed signedness of types in
WIDEN_MINUS_EXPR (have unsigned vector of operands and signed result
vector), so this patch instead adds another cast to make sure we always
sign-extend the result from itype to type if type is wider than itype.

2021-09-01  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/102124
* tree-vect-patterns.c (vect_recog_widen_op_pattern): For ORIG_CODE
MINUS_EXPR, if itype is unsigned with smaller precision than type,
add an extra cast to signed variant of itype to ensure sign-extension.

* gcc.dg/torture/pr102124.c: New test.

(cherry picked from commit bea07159d1d4c9a61c8f7097e9f88c2b206b1b2f)

3 years agoDaily bump.
GCC Administrator [Wed, 1 Sep 2021 00:18:36 +0000 (00:18 +0000)]
Daily bump.

3 years agoFix 'OMP_CLAUSE_TILE' operands handling in 'gcc/tree.c:walk_tree_1'
Thomas Schwinge [Fri, 27 Aug 2021 05:49:35 +0000 (07:49 +0200)]
Fix 'OMP_CLAUSE_TILE' operands handling in 'gcc/tree.c:walk_tree_1'

In r245300 (commit 02889d23ee3b02854dff203dd87b9a25e30b61b4)
"OpenACC tile clause support" that one had changed to three operands,
similar to 'OMP_CLAUSE_COLLAPSE'.

There is no (existing) test case where this seems to matter (likewise
for 'OMP_CLAUSE_COLLAPSE'), but it's good to be consistent.

gcc/
* tree.c (walk_tree_1) <OMP_CLAUSE_TILE>: Handle three operands.

(cherry picked from commit 92dc5d844a2088db79bc4521be3ecb4e2f284444)

3 years agolibgcc: Add missing runtime exception notices
Richard Sandiford [Tue, 31 Aug 2021 09:57:48 +0000 (10:57 +0100)]
libgcc: Add missing runtime exception notices

Quoting from https://gcc.gnu.org/pipermail/gcc/2021-July/236716.html:

--------------------------------------------------------------------
It was pointed out to me off-list that config/aarch64/value-unwind.h
is missing the runtime exception.  It looks like a few other files
are too; a fuller list is:

libgcc/config/aarch64/value-unwind.h
libgcc/config/frv/frv-abi.h
libgcc/config/i386/value-unwind.h
libgcc/config/pa/pa64-hpux-lib.h

Certainly for the aarch64 file this was simply a mistake;
it seems to have been copied from the i386 version, both of which
reference the runtime exception but don't actually include it.
--------------------------------------------------------------------

Similarly, frv-abi.h referenced the exception but didn't include it.
pa64-hpux-lib.h was missing any reference to the exception.

The decision was that this was simply a mistake
[https://gcc.gnu.org/pipermail/gcc/2021-July/236717.html]:

--------------------------------------------------------------------
[…] It generally is
considered a textual omission.  The runtime library components of GCC
are intended to be licensed under the runtime exception, which was
granted and approved at the time of introduction.
--------------------------------------------------------------------

and that we should simply change all of the files above
[https://gcc.gnu.org/pipermail/gcc/2021-July/236719.html]:

--------------------------------------------------------------------
Please correct the text in the files. The files in libgcc used in the
GCC runtime are intended to be licensed with the runtime exception and
GCC previously was granted approval for that licensing and purpose.

[…]

The runtime exception explicitly was intended for this purpose and
usage at the time that GCC received approval to apply the exception.
--------------------------------------------------------------------

libgcc/
* config/aarch64/value-unwind.h: Add missing runtime exception
paragraph.
* config/frv/frv-abi.h: Likewise.
* config/i386/value-unwind.h: Likewise.
* config/pa/pa64-hpux-lib.h: Likewise.

(cherry picked from commit de7a795c321e76826d123c92b99e73e144666b60)

3 years agoDaily bump.
GCC Administrator [Tue, 31 Aug 2021 00:18:36 +0000 (00:18 +0000)]
Daily bump.

3 years agoFortran - reject function entries with mismatched characteristics
Harald Anlauf [Sat, 28 Aug 2021 18:09:44 +0000 (20:09 +0200)]
Fortran - reject function entries with mismatched characteristics

gcc/fortran/ChangeLog:

PR fortran/87737
* resolve.c (resolve_entries): For functions of type CHARACTER
tighten the checks for matching characteristics.

gcc/testsuite/ChangeLog:

PR fortran/87737
* gfortran.dg/entry_24.f90: New test.

(cherry picked from commit f9809ef57005409ee658294d6e8dad9ee8897e88)

3 years agoUpdate gcc sv.po.
Joseph Myers [Mon, 30 Aug 2021 19:11:32 +0000 (19:11 +0000)]
Update gcc sv.po.

* sv.po: Update.

3 years agoFix failed test cases caused by disabling mode promotion for pseudos [PR100952]
Haochen Gui [Thu, 29 Jul 2021 06:56:12 +0000 (14:56 +0800)]
Fix failed test cases caused by disabling mode promotion for pseudos [PR100952]

gcc/testsuite
PR target/100952
* gcc.target/powerpc/pr56605.c: Change matching
conditions.
* gcc.target/powerpc/pr81348.c: Likewise.

(cherry picked from commit f0529d96f56758e56151f409c55bab3034163210)

3 years agors6000: Expand PROMOTE_MODE marco in rs6000_promote_function_mode
Haochen Gui [Fri, 4 Jun 2021 03:04:31 +0000 (11:04 +0800)]
rs6000: Expand PROMOTE_MODE marco in rs6000_promote_function_mode

This patch prepares for the patch which disables mode
promotion of pseudos on rs6000.

gcc/ChangeLog:
* config/rs6000/rs6000-call.c (rs6000_promote_function_mode):
Replace PROMOTE_MODE marco with its content.

(cherry picked from commit a3f6bd7891495a0ed65f7da7a55d36c730328692)

3 years agors6000: Disable mode promotion for pseudos
Haochen Gui [Fri, 4 Jun 2021 06:38:53 +0000 (14:38 +0800)]
rs6000: Disable mode promotion for pseudos

rs6000 has instructions that can do almost everything 32 bit
at least as efficiently as corresponding 64 bit things. The
mode promotion can be defered to when a wide mode is necessary.
So it helps a lot not promote mode for pseudos. SPECint test
shows that the overall performance improvement (by geomean) is
more than 2% with this patch.

testsuite/gcc.target/powerpc/not-promote-mode.c illustrates how
the patch eliminates the redundant extensions and do further
optimization by disabling mode promotion for pseduos.

gcc/ChangeLog

* config/rs6000/rs6000.h (PROMOTE_MODE): Remove.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/not-promote-mode.c: New.

(cherry picked from commit 9080a3bf23297885fdc47221da37a71d6dec93c5)

3 years agoDaily bump.
GCC Administrator [Mon, 30 Aug 2021 00:18:14 +0000 (00:18 +0000)]
Daily bump.

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

3 years agoFortran: Assumed and explicit size class arrays [PR46691/99819].
Paul Thomas [Thu, 6 May 2021 13:41:33 +0000 (14:41 +0100)]
Fortran: Assumed and explicit size class arrays [PR46691/99819].

2021-05-06  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran/ChangeLog

PR fortran/46691
PR fortran/99819
* class.c (gfc_build_class_symbol): Remove the error that
disables assumed size class arrays. Class array types that are
not deferred shape or assumed rank are given a unique name and
placed in the procedure namespace.
* trans-array.c (gfc_trans_g77_array): Obtain the data pointer
for class arrays.
(gfc_trans_dummy_array_bias): Suppress the runtime error for
extent violations in explicit shape class arrays because it
always fails.
* trans-expr.c (gfc_conv_procedure_call): Handle assumed size
class actual arguments passed to non-descriptor formal args by
using the data pointer, stored as the symbol's backend decl.

gcc/testsuite/ChangeLog

PR fortran/46691
PR fortran/99819
* gfortran.dg/class_dummy_6.f90: New test.
* gfortran.dg/class_dummy_7.f90: New test.

(cherry picked from commit a2c593009fef1564dbef2237ee71e9fd08f5361e)

3 years agoDaily bump.
GCC Administrator [Sat, 28 Aug 2021 00:18:31 +0000 (00:18 +0000)]
Daily bump.

3 years agoi386: Fix wrong optimization for consecutive masked scatters [PR 101472]
konglin1 [Mon, 9 Aug 2021 03:37:52 +0000 (11:37 +0800)]
i386: Fix wrong optimization for consecutive masked scatters [PR 101472]

gcc/ChangeLog:

PR target/101472
* config/i386/sse.md: (<avx512>scattersi<mode>): Add mask operand to
UNSPEC_VSIBADDR.
(<avx512>scattersi<mode>): Likewise.
(*avx512f_scattersi<VI48F:mode>): Merge mask operand to set_dest.
(*avx512f_scatterdi<VI48F:mode>): Likewise

gcc/testsuite/ChangeLog:

PR target/101472
* gcc.target/i386/avx512f-pr101472.c: New test.
* gcc.target/i386/avx512vl-pr101472.c: New test.

3 years agoDaily bump.
GCC Administrator [Fri, 27 Aug 2021 00:18:01 +0000 (00:18 +0000)]
Daily bump.

3 years agoFortran: fix pointless warning for static variables
Harald Anlauf [Tue, 24 Aug 2021 19:07:50 +0000 (21:07 +0200)]
Fortran: fix pointless warning for static variables

gcc/fortran/ChangeLog:

PR fortran/98411
* trans-decl.c (gfc_finish_var_decl): Adjust check to handle
implicit SAVE as well as variables in the main program.  Improve
warning message text.

gcc/testsuite/ChangeLog:

PR fortran/98411
* gfortran.dg/pr98411.f90: Adjust testcase options to restrict to
F2008, and verify case of implicit SAVE.

(cherry picked from commit f95946afd160e2a1f4beac4ee5e6d5633307f39a)

3 years agoDaily bump.
GCC Administrator [Thu, 26 Aug 2021 00:18:46 +0000 (00:18 +0000)]
Daily bump.

3 years agodiagnostics: Fix sporadic test failure
Bernd Edlinger [Fri, 28 May 2021 12:26:02 +0000 (14:26 +0200)]
diagnostics: Fix sporadic test failure

it turns out to be reproducible this way:

COLUMNS=80 make check-gcc-c RUNTESTFLAGS="plugin.exp=diagnostic*"

Running /home/ed/gnu/gcc-trunk/gcc/testsuite/gcc.dg/plugin/plugin.exp ...
FAIL: gcc.dg/plugin/diagnostic-test-expressions-1.c
 -fplugin=./diagnostic_plugin_test_tree_expression_range.so  1 blank line(s) in output
FAIL: gcc.dg/plugin/diagnostic-test-expressions-1.c
 -fplugin=./diagnostic_plugin_test_tree_expression_range.so  expected multiline pattern lines 550-551 not found: "                            __builtin_types_compatible_p \(long, int\) \+ f \(i\)\);.*\n                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\^~~~~~~\n"
FAIL: gcc.dg/plugin/diagnostic-test-expressions-1.c
 -fplugin=./diagnostic_plugin_test_tree_expression_range.so (test for excess errors)

a lot more errors happen with COLUMNS=20.

2021-05-29  Bernd Edlinger  <bernd.edlinger@hotmail.de>

* gcc.dg/plugin/diagnostic_plugin_show_trees.c (plugin_init): Fix caret_max_with.
* gcc.dg/plugin/diagnostic_plugin_test_inlining.c
(plugin_init): Likewise.
* gcc.dg/plugin/diagnostic_plugin_test_paths.c (plugin_init): Likewise.
* gcc.dg/plugin/diagnostic_plugin_test_string_literals.c
(plugin_init): Likewise.
* gcc.dg/plugin/diagnostic_plugin_test_tree_expression_range.c
(plugin_init): Likewise.

(cherry picked from commit ade5ac7c7966c8e88a25f448fa737457364935a4)

3 years ago<x86gprintrin.h>: Add pragma GCC target("general-regs-only")
H.J. Lu [Sat, 17 Jul 2021 14:44:45 +0000 (07:44 -0700)]
<x86gprintrin.h>: Add pragma GCC target("general-regs-only")

1. Intrinsics in <x86gprintrin.h> only require GPR ISAs.  Add

 #if defined __MMX__ || defined __SSE__
 #pragma GCC push_options
 #pragma GCC target("general-regs-only")
 #define __DISABLE_GENERAL_REGS_ONLY__
 #endif

and

 #ifdef __DISABLE_GENERAL_REGS_ONLY__
 #undef __DISABLE_GENERAL_REGS_ONLY__
 #pragma GCC pop_options
 #endif /* __DISABLE_GENERAL_REGS_ONLY__ */

to <x86gprintrin.h> to disable non-GPR ISAs so that they can be used in
functions with __attribute__ ((target("general-regs-only"))).
2. When checking always_inline attribute, if callee only uses GPRs,
ignore MASK_80387 since enable MASK_80387 in caller has no impact on
callee inline.

gcc/

PR target/99744
* config/i386/i386.c (ix86_can_inline_p): Ignore MASK_80387 if
callee only uses GPRs.
* config/i386/ia32intrin.h: Revert commit 5463cee2770.
* config/i386/serializeintrin.h: Revert commit 71958f740f1.
* config/i386/x86gprintrin.h: Add
#pragma GCC target("general-regs-only") and #pragma GCC pop_options
to disable non-GPR ISAs.

gcc/testsuite/

PR target/99744
* gcc.target/i386/pr99744-3.c: New test.
* gcc.target/i386/pr99744-4.c: Likewise.
* gcc.target/i386/pr99744-5.c: Likewise.
* gcc.target/i386/pr99744-6.c: Likewise.
* gcc.target/i386/pr99744-7.c: Likewise.
* gcc.target/i386/pr99744-8.c: Likewise.

(cherry picked from commit 72264a639729a5dcc21dbee304717ce22b338bfd)

3 years agox86: Enable the GPR only instructions for -mgeneral-regs-only
H.J. Lu [Sat, 17 Jul 2021 21:38:39 +0000 (14:38 -0700)]
x86: Enable the GPR only instructions for -mgeneral-regs-only

For -mgeneral-regs-only, enable the GPR only instructions which are
enabled implicitly by SSE ISAs unless they have been disabled explicitly.

gcc/

PR target/101492
* common/config/i386/i386-common.c (ix86_handle_option): For
-mgeneral-regs-only, enable the GPR only instructions which are
enabled implicitly by SSE ISAs unless they have been disabled
explicitly.

gcc/testsuite/

PR target/101492
* gcc.target/i386/pr101492-1.c: New test.
* gcc.target/i386/pr101492-2.c: Likewise.
* gcc.target/i386/pr101492-3.c: Likewise.
* gcc.target/i386/pr101492-4.c: Likewise.

(cherry picked from commit 6ae8aac19cdbdbd96d90f86e4d8505fe121bdf06)

3 years agox86: Remove OPTION_MASK_ISA_SSE4_2 from CRC32 _builtin functions
H.J. Lu [Wed, 21 Jul 2021 12:15:55 +0000 (05:15 -0700)]
x86: Remove OPTION_MASK_ISA_SSE4_2 from CRC32 _builtin functions

Since

commit 39671f87b2df6a1894cc11a161e4a7949d1ddccd
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Apr 15 05:59:48 2021 -0700

    x86: Use crc32 target option for CRC32 intrinsics

enabled OPTION_MASK_ISA_CRC32 for -msse4 and removed TARGET_SSE4_2 check
in sse4_2_crc32<mode> pattens, remove OPTION_MASK_ISA_SSE4_2 from CRC32
_builtin functions.

gcc/

PR target/101549
* config/i386/i386-builtin.def: Remove OPTION_MASK_ISA_SSE4_2
from CRC32 _builtin functions.

gcc/testsuite/

PR target/101549
* gcc.target/i386/crc32-6.c: New test.

(cherry picked from commit 7aa28dbc371cf3c09c05c68672b00d9006391595)

3 years agox86: Use crc32 target option for CRC32 intrinsics
H.J. Lu [Thu, 15 Apr 2021 12:59:48 +0000 (05:59 -0700)]
x86: Use crc32 target option for CRC32 intrinsics

Use crc32 target option for CRC32 intrinsics to support CRC32 intrinsics
without enabling SSE vector instructions.

* config/i386/i386-c.c (ix86_target_macros_internal): Define
__CRC32__ for -mcrc32.
* config/i386/i386-options.c (ix86_option_override_internal):
Enable crc32 instruction for -msse4.2.
* config/i386/i386.md (sse4_2_crc32<mode>): Remove TARGET_SSE4_2
check.
(sse4_2_crc32di): Likewise.
* config/i386/ia32intrin.h: Use crc32 target option for CRC32
intrinsics.

(cherry picked from commit 39671f87b2df6a1894cc11a161e4a7949d1ddccd)

3 years agox86: Add -mmwait for -mgeneral-regs-only
H.J. Lu [Thu, 15 Apr 2021 18:19:32 +0000 (11:19 -0700)]
x86: Add -mmwait for -mgeneral-regs-only

Add -mmwait so that the MWAIT and MONITOR intrinsics can be used with
-mgeneral-regs-only and make -msse3 to imply -mmwait.

gcc/

* config.gcc: Install mwaitintrin.h for i[34567]86-*-* and
x86_64-*-* targets.
* lto-streamer.h (LTO_minor_version): Bump.
* common/config/i386/i386-common.c (OPTION_MASK_ISA2_MWAIT_SET):
New.
(OPTION_MASK_ISA2_MWAIT_UNSET): Likewise.
(ix86_handle_option): Handle -mmwait.
* config/i386/i386-builtins.c (ix86_init_mmx_sse_builtins):
Replace OPTION_MASK_ISA_SSE3 with OPTION_MASK_ISA2_MWAIT on
__builtin_ia32_monitor and __builtin_ia32_mwait.
* config/i386/i386-options.c (isa2_opts): Add -mmwait.
(ix86_valid_target_attribute_inner_p): Likewise.
(ix86_option_override_internal): Enable mwait/monitor
instructions for -msse3.
* config/i386/i386.h (TARGET_MWAIT): New.
(TARGET_MWAIT_P): Likewise.
* config/i386/i386.opt: Add -mmwait.
* config/i386/mwaitintrin.h: New file.
* config/i386/pmmintrin.h: Include <mwaitintrin.h>.
* config/i386/sse.md (sse3_mwait): Replace TARGET_SSE3 with
TARGET_MWAIT.
(@sse3_monitor_<mode>): Likewise.
* config/i386/x86gprintrin.h: Include <mwaitintrin.h>.
* doc/extend.texi: Document mwait target attribute.
* doc/invoke.texi: Document -mmwait.

gcc/testsuite/

* gcc.target/i386/monitor-2.c: New test.

(cherry picked from commit d8c6cc2ca35489bc41bb58ec96c1195928826922)

3 years agoi386: Fix _mm512_fpclass_ps_mask in O0 [PR 101471]
konglin1 [Mon, 9 Aug 2021 02:58:24 +0000 (10:58 +0800)]
i386: Fix _mm512_fpclass_ps_mask in O0 [PR 101471]

gcc/ChangeLog:

PR target/101471
* config/i386/avx512dqintrin.h (_mm512_fpclass_ps_mask): Fix
macro define in O0.
(_mm512_mask_fpclass_ps_mask): Ditto.

gcc/testsuite/ChangeLog:

PR target/101471
* gcc.target/i386/avx512f-pr101471.c: New test.

3 years agoDaily bump.
GCC Administrator [Wed, 25 Aug 2021 00:18:39 +0000 (00:18 +0000)]
Daily bump.

3 years agolibstdc++: Don't check always-true condition [PR101965]
Jonathan Wakely [Thu, 19 Aug 2021 12:05:54 +0000 (13:05 +0100)]
libstdc++: Don't check always-true condition [PR101965]

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/101965
* include/std/charconv (__to_chars_i): Remove redundant check.

(cherry picked from commit 85a709595005b5df4b2ee9d81717a5df19c0023f)

3 years agolibstdc++: Test std::seed_seq construction from input iterators
Jonathan Wakely [Tue, 17 Aug 2021 13:18:58 +0000 (14:18 +0100)]
libstdc++: Test std::seed_seq construction from input iterators

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* testsuite/26_numerics/random/seed_seq/cons/range.cc: Check
construction from input iterators.

(cherry picked from commit 20698ec5b681e23fa3404ed0ef78e3367b28e16d)

3 years agolibstdc++: Restore __gnu_debug::array [PR100682]
Jonathan Wakely [Thu, 22 Jul 2021 10:45:32 +0000 (11:45 +0100)]
libstdc++: Restore __gnu_debug::array [PR100682]

As the PR points out, we removed the debug version of std::array without
any period of deprecation. Although std::array contains all the actual
debug checks now, removing the <debug/arrray> header breaks any code
that was using that explicitly. The manual still lists doing that as
supported.

This restores the <debug/array> header, but simply defines
__gnu_debug::array as an alias for std::array, and declares the alias
with the deprecated attribute. The docs are updated to match.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/100682
* doc/xml/manual/debug_mode.xml: Update documentation about
debug capability of std::array.
* doc/html/*: Regenerate.
* include/debug/array: New file.

(cherry picked from commit 254e5d19a177af23a77b67fd51d0d1a25eaabfc7)

3 years agolibstdc++: Only define basic_string::contains for C++23
Jonathan Wakely [Mon, 16 Aug 2021 19:42:54 +0000 (20:42 +0100)]
libstdc++: Only define basic_string::contains for C++23

The new contains member of the COW string is defined for non-strict
gnu++20 mode as well as for C++23 modes. I think that was left in the
committed patch unintentionally. It is inconsistent with the SSO string,
and doesn't actually compile because it uses the
basic_string_view::contains member which only defined for C++23.

This makes it only defined for C++23.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/basic_string.h (basic_string::contains): Do not
define for -std=gnu++20.

(cherry picked from commit 3b3f2f7c265ef9f176cb811a8049b24538d954d9)

3 years agolibstdc++: Add missing headers for errno and std::terminate
Jonathan Wakely [Mon, 26 Apr 2021 11:28:37 +0000 (12:28 +0100)]
libstdc++: Add missing headers for errno and std::terminate

libstdc++-v3/ChangeLog:

* include/bits/semaphore_base.h: Include <exception> and <errno.h>.

(cherry picked from commit a38b1a59f8eb6f41a885f8a7c8838378be717b02)

3 years agolibstdc++: Implement LWG 3422 for std::seed_seq
Jonathan Wakely [Tue, 22 Jun 2021 17:05:11 +0000 (18:05 +0100)]
libstdc++: Implement LWG 3422 for std::seed_seq

This ensures that the std::seed_seq initializer-list constructor will
not be used for list-initialization unless the initializers in the list
are integers. This allows list-initialization syntax to be used with a
pair of pointers and for that to use the appropriate constructor.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/random.h (seed_seq): Constrain initializer-list
constructor.
* include/bits/random.tcc (seed_seq): Add template parameter.
* testsuite/26_numerics/random/seed_seq/cons/default.cc: Check
for noexcept.
* testsuite/26_numerics/random/seed_seq/cons/initlist.cc: Check
constraints.

(cherry picked from commit 6c63cb231e4cf99552bb7904ebe402f7adcafda4)

3 years agolibstdc++: Use <sys/socket.h> features conditionally [PR 100285]
Jonathan Wakely [Fri, 30 Apr 2021 13:25:25 +0000 (14:25 +0100)]
libstdc++: Use <sys/socket.h> features conditionally [PR 100285]

This makes the uses of getsockopt and setsockopt in
<experimental/socket> conditional on the availability of <sys/socket.h>.

It also fixes a test to check for <sys/socket.h> instead of <socket.h>.

libstdc++-v3/ChangeLog:

PR libstdc++/100285
* include/experimental/socket (__basic_socket_impl::set_option)
(__basic_socket_impl::get_option) [!_GLIBCXX_HAVE_SYS_SOCKET_H]:
Just set error code.
* testsuite/experimental/net/socket/socket_base.cc: CHeck
for <sys/socket.h> not <socket.h>.

(cherry picked from commit 0d501c338548152f9d2728d383eec3e9cef16784)

3 years agolibstdc++: Define effective-target for net::ip features [PR 100351]
Jonathan Wakely [Fri, 30 Apr 2021 10:45:07 +0000 (11:45 +0100)]
libstdc++: Define effective-target for net::ip features [PR 100351]

Define a new effective-target keyword so that tests for the Networking
TS <experimental/internet> header can be skipped on targets where none
of it can be usefully defined.

libstdc++-v3/ChangeLog:

PR libstdc++/100180
PR libstdc++/100286
PR libstdc++/100351
* testsuite/experimental/net/internet/address/v4/comparisons.cc:
Use new effective-target keyword.
* testsuite/experimental/net/internet/address/v4/cons.cc:
Likewise.
* testsuite/experimental/net/internet/address/v4/creation.cc:
Likewise.
* testsuite/experimental/net/internet/address/v4/members.cc:
Likewise.
* testsuite/experimental/net/internet/address/v6/members.cc:
Likewise.
* testsuite/experimental/net/internet/resolver/base.cc:
Likewise.
* testsuite/experimental/net/internet/resolver/ops/lookup.cc:
Likewise.
* testsuite/experimental/net/internet/resolver/ops/reverse.cc:
Likewise.
* testsuite/experimental/net/internet/socket/opt.cc:
Likewise.
* testsuite/experimental/net/internet/tcp.cc:
Likewise.
* testsuite/experimental/net/internet/udp.cc:
Likewise.
* testsuite/lib/libstdc++.exp (check_effective_target_net_ts_ip):
New proc to check net_ts_ip et.

(cherry picked from commit 57028ff2d3f56deec25498f83e99c39478acc02f)

3 years agolibstdc++: Minor refactoring in <experimental/internet>
Jonathan Wakely [Tue, 27 Apr 2021 12:43:23 +0000 (13:43 +0100)]
libstdc++: Minor refactoring in <experimental/internet>

libstdc++-v3/ChangeLog:

* include/experimental/internet (address_v6::bytes_type): Adjust
formatting.
(basic_endpoint): Define _M_is_v6() to put all checks for
AF_INET6 in one place.
(basic_endpoint::resize): Simplify.
(operator==(const tcp&, const tcp&)): Add constexpr and noexcept.
(operator!=(const tcp&, const tcp&)): Likewise.
(operator==(const udp&, const udp&)): Likewise.
(operator!=(const udp&, const udp&)): Likewise.
* testsuite/experimental/net/internet/tcp.cc: New test.
* testsuite/experimental/net/internet/udp.cc: New test.

(cherry picked from commit 39073938b4e85fdbdc897c32e56fb5fc59ded9b5)

3 years agolibstdc++: Better preprocessor conditions in net::ip [PR 100286]
Jonathan Wakely [Tue, 27 Apr 2021 12:06:43 +0000 (13:06 +0100)]
libstdc++: Better preprocessor conditions in net::ip [PR 100286]

This improves the use of preprocessor conditionas to enable/disable
members of namespace net::ip according to what is supported by the
target. This fixes PR 100286 by ensuring that the to_string member
functions are always defined for the address_v4 and address_v6 classes.
On the other hand, the IP protocol classes and internet socket option
classes aren't useful at all if the corresponding constants (such as
IPPROTO_TCP or IPV6_MULTICAST_HOPS) aren't define. So those types are
not defined at all if they can't be used.

The net/internet/socket/opt.cc test uses __has_include to check whether
or not to expect the types to be available.

libstdc++-v3/ChangeLog:

PR libstdc++/100286
* include/experimental/internet (resolver_errc, resolver_category())
(make_error_code, make_error_condition): Define unconditionally,
only make enumerators and use of gai_strerror depend on the
availability of <netdb.h>.
(address_v4::to_string): Use correct constant for string length.
(address_v4::to_string, address_v6::to_string): Define
unconditionally, throw if unsupported.
(make_address_v4, make_address_v6): Define unconditionally.
Return an error if unsupported.
(tcp, udp, v6_only, unicast::hops, multicast::*): Define
conditionally,
* testsuite/experimental/net/internet/socket/opt.cc: Check for
<netinet/in.h> and <netinet/tcp.h> before using types from
namespace net::ip.

(cherry picked from commit 9ee35a8685ee174c6914059143aceb7009d3e920)

3 years agolibstdc++: Define net::socket_base::message_flags operators as friends [PR 100285]
Jonathan Wakely [Tue, 27 Apr 2021 10:07:47 +0000 (11:07 +0100)]
libstdc++: Define net::socket_base::message_flags operators as friends [PR 100285]

The overloaded operators for socket_base::message_flags should only be
defined when the message_flags type itself is defined. Rather than
duplicate the preprocessor conditional, this moves the operators into
the same scope as the type, defining them as hidden friends.

As well as fixing the bug, this has all the usual advantages of hidden
friends (they are not visible to normal name lookup for unrelated
types).

For consistency, do the same for the resolver_base::flags bitmask
operators too.

libstdc++-v3/ChangeLog:

PR libstdc++/100285
* include/experimental/internet (resolver_base::flags):
Define overloaded operators as hidden friends.
* include/experimental/socket (socket_base::message_flags):
Likewise.

(cherry picked from commit 8aadb4fedb17e7a44583a7a5a4e96b1874e1ce98)

3 years agolibstdc++: Fix internet socket option classes
Jonathan Wakely [Mon, 26 Apr 2021 20:16:21 +0000 (21:16 +0100)]
libstdc++: Fix internet socket option classes

Similar to the previous commit, this fixes various problems with the
socket options classes in the <internet> header:

- The constructors were not noexcept.
- The __sockopt_base<T>::value() member function was present
  unconditionally (so was defined for socket_base::linger which is
  incorrect).
- The __socket_crtp<C, T>::operator=(T) assignment operator was not
  noexcept, and was hidden in the derived classes.
- The MulticastSocketOptions incorrectly used a union, incorrectly
  defined resize and const data() member functions, and their
  constructors were unimplemented.

Also, where appropriate:

- Use class instead of struct for the socket option types.
- Define the _S_level and _S_name constants as private.
- Declare the __socket_crtp base as a friend.

libstdc++-v3/ChangeLog:

* include/experimental/internet (tcp::no_delay, v6_only)
(unicast::hops, multicast::hops, multicast::enable_loopback):
Change access of base class and static data members. Add
using-declaration for __socket_crtp::operator=(_Tp).
(multicast::__mcastopt): New type.
(multicast::join_group, multicast::leave_group): Derive from
__mcastopt for common implementation.
* include/experimental/socket: Add comment.
* testsuite/experimental/net/internet/socket/opt.cc: New test.
* testsuite/experimental/net/socket/socket_base.cc: Check for
protected constructor/destructor of socket_base. Check for
explicit constructors of socket option classes.

(cherry picked from commit 2e0b1c6ce3afe0670b96444c6b955ce184ed0046)

3 years agolibstdc++: Fix socket option classes
Jonathan Wakely [Mon, 26 Apr 2021 20:16:21 +0000 (21:16 +0100)]
libstdc++: Fix socket option classes

This fixes some flaws in the socket option types defined in
net::socket_base:

- The constructors were not noexcept.
- The __sockopt_base<T>::value() member function was present
  unconditionally (so was defined for socket_base::linger which is
  incorrect).
- The __socket_crtp<C, T>::operator=(T) assignment operator was not
  noexcept, and was hidden in the derived classes.

Also:

- Use class instead of struct for the socket option types.
- Define the _S_level and _S_name constants as private.
- Declare the __socket_crtp base as a friend.

libstdc++-v3/ChangeLog:

* include/experimental/bits/net.h (__socket_base): Add
bool template parameter to allow BooleanSocketOption and
IntegerSocketOption to have different __socket_base<int>
base classes.
(__socket_base<bool>): Adjust base class.
(__socket_base<int>): Add partial specialization.
(__socket_crtp::operator=(_Tp)): Add noexcept-specifier.
* include/experimental/socket (socket_base::broadcast)
(socket_base::debug, socket_base::do_not_route)
(socket_base::keep_alive, socket_base::linger)
(socket_base::out_of_band_inline)
(socket_base::receive_buffer_size)
(socket_base::receive_low_watermark)
(socket_base::reuse_address, socket_base::send_buffer_size)
(socket_base::send_low_watermark): Add using-declaration for
__socket_crtp::operator=(_Tp).
* testsuite/experimental/net/socket/socket_base.cc: Check
properties of socket option types.

(cherry picked from commit 06c86a4f210c76a157512a2963e6c31302d161cb)

3 years agolibstdc++: Simplify definition of net::ip::resolver_base constants
Jonathan Wakely [Mon, 26 Apr 2021 20:16:20 +0000 (21:16 +0100)]
libstdc++: Simplify definition of net::ip::resolver_base constants

libstdc++-v3/ChangeLog:

* include/experimental/internet (resolver_base::flags): Remove
enumerators. Initialize constants directly with desired values.
Make all operators constexpr and noexcept.
* testsuite/experimental/net/internet/resolver/base.cc: Use
__gnu_test::test_bitmask_values for bitmask type. Check
construction and destruction is protected.

(cherry picked from commit 49adc066729bda093b0658e3926bbf64cd4628b3)

3 years agolibstdc++: Allow net::io_context to compile without <poll.h> [PR 100180]
Jonathan Wakely [Fri, 23 Apr 2021 12:38:05 +0000 (13:38 +0100)]
libstdc++: Allow net::io_context to compile without <poll.h> [PR 100180]

This adds dummy placeholders to net::io_context so that it can still be
compiled on targets without <poll.h>.

libstdc++-v3/ChangeLog:

PR libstdc++/100180
* include/experimental/io_context (io_context): Define
dummy_pollfd type so that most member functions still compile
without <poll.h> and struct pollfd.

(cherry picked from commit 0e1e7b77904f1fe2a6dbfe84bb4fc026584ba480)

3 years agolibstdc++: Clarify argument to net::io_context::async_wait
Jonathan Wakely [Fri, 23 Apr 2021 12:31:33 +0000 (13:31 +0100)]
libstdc++: Clarify argument to net::io_context::async_wait

Add a comment documenting the __w parameter of the private
ios_context::async_wait function. Add casts to callers, making the
conversions explicit.

libstdc++-v3/ChangeLog:

* include/experimental/io_context (io_context::async_wait): Add
comment.
* include/experimental/socket (basic_socket::async_connect):
Cast wait_type constant to int.
(basic_datagram_socket::async_receive): Likewise.
(basic_datagram_socket::async_receive_from): Likewise.
(basic_datagram_socket::async_send): Likewise.
(basic_datagram_socket::async_send_to): Likewise.
(basic_stream_socket::async_receive): Likewise.
(basic_stream_socket::async_send): Likewise. Use io_context
parameter directly, instead of via an executor.
(basic_socket_acceptor::async_accept): Likewise.

(cherry picked from commit 3517dfe05c05a48885149334143230fcf0ebe6be)

3 years agolibstdc++: Simplify definition of net::socket_base constants
Jonathan Wakely [Fri, 23 Apr 2021 12:25:56 +0000 (13:25 +0100)]
libstdc++: Simplify definition of net::socket_base constants

libstdc++-v3/ChangeLog:

* include/experimental/socket (socket_base::shutdown_type):
(socket_base::wait_type, socket_base::message_flags):
Remove enumerators. Initialize constants directly with desired
values.
(socket_base::message_flags): Make all operators constexpr and
noexcept.
* testsuite/util/testsuite_common_types.h (test_bitmask_values):
New test utility.
* testsuite/experimental/net/socket/socket_base.cc: New test.

(cherry picked from commit a752a43073dc49909c017fd52feacd7526ed31c0)

3 years agoarm: Add tests for VLLDM mitigation [PR102035]
Richard Earnshaw [Tue, 6 Jul 2021 14:10:18 +0000 (15:10 +0100)]
arm: Add tests for VLLDM mitigation [PR102035]

New tests for the erratum mitigation.

gcc/testsuite:
PR target/102035
* gcc.target/arm/cmse/mainline/8_1m/soft/cmse-13a.c: New test.
* gcc.target/arm/cmse/mainline/8_1m/soft/cmse-7a.c: Likewise.
* gcc.target/arm/cmse/mainline/8_1m/soft/cmse-8a.c: Likewise.
* gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-7a.c: Likewise.
* gcc.target/arm/cmse/mainline/8_1m/softfp-sp/cmse-8a.c: Likewise.
* gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-13a.c: Likewise.
* gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-7a.c: Likewise.
* gcc.target/arm/cmse/mainline/8_1m/softfp/cmse-8a.c: Likewise.

(cherry picked from commit 809330ab8450261e05919b472783bf15e4b000f7)

3 years agoarm: fix vlldm erratum for Armv8.1-m [PR102035]
Richard Earnshaw [Fri, 18 Jun 2021 16:18:37 +0000 (17:18 +0100)]
arm: fix vlldm erratum for Armv8.1-m [PR102035]

For Armv8.1-m we generate code that emits VLLDM directly and do not
rely on support code in the library, so emit the mitigation directly
as well, when required.  In this case, we can use the compiler options
to determine when to apply the fix and when it is safe to omit it.

gcc:
PR target/102035
* config/arm/arm.md (attribute arch): Add fix_vlldm.
(arch_enabled): Use it.
* config/arm/vfp.md (lazy_store_multiple_insn): Add alternative to
use when erratum mitigation is needed.
(cherry picked from commit 30461cf8dba3d3adb15a125e4da48800eb2b9b8f)

3 years agoarm: add erratum mitigation to __gnu_cmse_nonsecure_call [PR102035]
Richard Earnshaw [Fri, 18 Jun 2021 16:16:25 +0000 (17:16 +0100)]
arm: add erratum mitigation to __gnu_cmse_nonsecure_call [PR102035]

Add the recommended erratum mitigation sequence to
__gnu_cmse_nonsecure_call for use on Armv8-m.main devices. Since this
is in the library code we cannot know in advance whether the core we
are running on will be affected by this, so always enable it.

libgcc:
PR target/102035
* config/arm/cmse_nonsecure_call.S (__gnu_cmse_nonsecure_call):
Add vlldm erratum work-around.
(cherry picked from commit 574e7950bd6b34e9e2cacce18c802b45505d1d0a)

3 years agoarm: Add command-line option for enabling CVE-2021-35465 mitigation [PR102035]
Richard Earnshaw [Fri, 11 Jun 2021 15:02:05 +0000 (16:02 +0100)]
arm: Add command-line option for enabling CVE-2021-35465 mitigation [PR102035]

Add a new option, -mfix-cmse-cve-2021-35465 and document it.  Enable it
automatically for cortex-m33, cortex-m35p and cortex-m55.

gcc:
PR target/102035
* config/arm/arm.opt (mfix-cmse-cve-2021-35465): New option.
* doc/invoke.texi (Arm Options): Document it.
* config/arm/arm-cpus.in (quirk_vlldm): New feature bit.
(ALL_QUIRKS): Add quirk_vlldm.
(cortex-m33): Add quirk_vlldm.
(cortex-m35p, cortex-m55): Likewise.
* config/arm/arm.c (arm_option_override): Enable fix_vlldm if
targetting an affected CPU and not explicitly controlled on
the command line.
(cherry picked from commit 3929bca9ca95de9d35e82ae8828b188029e3eb70)

3 years agoarm: testsuite: improve detection of CMSE hardware.
Richard Earnshaw [Fri, 18 Jun 2021 16:13:04 +0000 (17:13 +0100)]
arm: testsuite: improve detection of CMSE hardware.

The test for CMSE support being available in hardware currently
relies on the compiler not optimizing away a secure gateway operation.
But even that is suspect, because the SG instruction is just a NOP
on armv8-m implementations that do not support the security extension.

Replace the existing test with a new one that reads and checks
the appropriate hardware feature register (memory mapped).  This has
to be run from secure mode, but that shouldn't matter, because if we
can't do that we can't really test the CMSE extensions anyway.  We
retain the SG instruction to ensure the test can't pass accidentally
if run on pre-armv8-m devices.

gcc/testsuite:
* lib/target-supports.exp (check_effective_target_arm_cmse_hw):
New function.

(cherry picked from commit 79fb2700bdbab4212346d907be6063c5a32d3836)

3 years agoarm: Fix general issues with patterns for VLLDM and VLSTM
Richard Earnshaw [Fri, 11 Jun 2021 16:18:12 +0000 (17:18 +0100)]
arm: Fix general issues with patterns for VLLDM and VLSTM

Both lazy_store_multiple_insn and lazy_load_multiple_insn contain
invalid RTL (eg they contain a post_inc statement outside of a mem).
What's more, the instructions concerned do not modify their input
address register.  We probably got away with this because they are
generated so late in the compilation that no subsequent pass needed to
understand them.  Nevertheless, this could cause problems someday, so
fixed to use a simple legal unspec.

gcc:
* config/arm/vfp.md (lazy_store_multiple_insn): Rewrite as valid RTL.
(lazy_load_multiple_insn): Likewise.
(cherry picked from commit 4702d3cf044924970a9a00142542da1edacfd76c)

3 years agoFix previous ipa-modref patch
Jan Hubicka [Mon, 23 Aug 2021 14:16:25 +0000 (16:16 +0200)]
Fix previous ipa-modref patch

gcc/ChangeLog:

PR middle-end/101949
* ipa-modref.c (analyze_ssa_name_flags): Fix merging of
EAF_NOCLOBBER

(cherry picked from commit 5bd4ab91660c8f5534c46979d4846a4f1a0972b0)

3 years agoClear EAF_NOCLOBBER for indirect calls
Jan Hubicka [Sun, 22 Aug 2021 18:57:19 +0000 (20:57 +0200)]
Clear EAF_NOCLOBBER for indirect calls

gcc/ChangeLog:

2021-08-22  Jan Hubicka  <hubicka@ucw.cz>
    Martin Liska  <mliska@suse.cz>

PR middle-end/101949
* ipa-modref.c (analyze_ssa_name_flags): Indirect call implies
~EAF_NOCLOBBER.

gcc/testsuite/ChangeLog:

2021-08-22  Jan Hubicka  <hubicka@ucw.cz>
    Martin Liska  <mliska@suse.cz>

* gcc.dg/lto/pr101949_0.c: New test.
* gcc.dg/lto/pr101949_1.c: New test.

(cherry picked from commit 9b08f7764cecd16cba84944f2a8b67a7f73a7ce7)

3 years agoipa/97565 - fix IPA PTA body availability check
Richard Biener [Mon, 23 Aug 2021 13:37:48 +0000 (15:37 +0200)]
ipa/97565 - fix IPA PTA body availability check

Looks like the existing check using has_gimple_body_p isn't enough
at LTRANS time but I need to check in_other_partition as well.

2021-08-23  Richard Biener  <rguenther@suse.de>

PR ipa/97565
* tree-ssa-structalias.c (ipa_pta_execute): Check in_other_partition
in addition to has_gimple_body.

* g++.dg/lto/pr97565_0.C: New testcase.
* g++.dg/lto/pr97565_1.C: Likewise.

(cherry picked from commit 0230e69a3fabe6ad1d80cdf308ad1bf1934c4381)

3 years agoDaily bump.
GCC Administrator [Tue, 24 Aug 2021 00:18:52 +0000 (00:18 +0000)]
Daily bump.

3 years agolibstdc++: Add default template argument to basic_istream_view
Jonathan Wakely [Mon, 23 Aug 2021 15:16:05 +0000 (16:16 +0100)]
libstdc++: Add default template argument to basic_istream_view

The standard shows this default template argument in the <ranges>
synopsis, but it was missing in libstdc++.

libstdc++-v3/ChangeLog:

* include/std/ranges (basic_istream_view): Add default template
argument.
* testsuite/std/ranges/istream_view.cc: Check it.

(cherry picked from commit 1a129376bbc26d3c30af3c1ae6036e2e1446db40)

3 years agoarm: Fix __arm_vctp16q return type in arm_mve.h
Christophe Lyon [Mon, 23 Aug 2021 09:47:14 +0000 (09:47 +0000)]
arm: Fix __arm_vctp16q return type in arm_mve.h

__arm_vctp16q actually returns mve_pred16_t rather than int64_t.

2021-08-23  Christophe Lyon  <christophe.lyon@foss.st.com>

gcc/
* config/arm/arm_mve.h: Fix __arm_vctp16q return type.

(cherry picked from commit ac3bcc813f26e6dc4c3b037d9d5c5a84f7f62cf4)

3 years agodwarf2out: Emit DW_AT_location for global register vars during early dwarf [PR101905]
Jakub Jelinek [Mon, 23 Aug 2021 09:50:14 +0000 (11:50 +0200)]
dwarf2out: Emit DW_AT_location for global register vars during early dwarf [PR101905]

The following patch emits DW_AT_location for global register variables
already during early dwarf, since usually late_global_decl hook isn't even
called for those, as nothing needs to be emitted for them.

2021-08-23  Jakub Jelinek  <jakub@redhat.com>

PR debug/101905
* dwarf2out.c (gen_variable_die): Add DW_AT_location for global
register variables already during early_dwarf if possible.

* gcc.dg/guality/pr101905.c: New test.

(cherry picked from commit b284053bb75661fc1bf13c275f3ba5364bb17608)

3 years agogcov: fix output location for JSON mode.
Martin Liska [Tue, 17 Aug 2021 14:24:26 +0000 (16:24 +0200)]
gcov: fix output location for JSON mode.

PR gcov-profile/89961

gcc/ChangeLog:

* gcov.c (make_gcov_file_name): Rewrite using std::string.
(mangle_name): Simplify, do not used the second argument.
(strip_extention): New function.
(get_md5sum): Likewise.
(get_gcov_intermediate_filename): Handle properly -p and -x
options.
(output_gcov_file): Use string type.
(generate_results): Likewise.
(md5sum_to_hex): Remove.

(cherry picked from commit b777f228b481ae881a7fbb09de367a053740932c)

3 years agoDaily bump.
GCC Administrator [Mon, 23 Aug 2021 00:18:05 +0000 (00:18 +0000)]
Daily bump.

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

3 years agoDaily bump.
GCC Administrator [Sat, 21 Aug 2021 00:18:05 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 20 Aug 2021 00:18:08 +0000 (00:18 +0000)]
Daily bump.

3 years agolibstdc++: Move status table entry to be with other ranges papers
Jonathan Wakely [Thu, 19 Aug 2021 14:03:21 +0000 (15:03 +0100)]
libstdc++: Move status table entry to be with other ranges papers

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* doc/xml/manual/status_cxx2020.xml: Move row  earlier in table.
* doc/html/manual/status.html: Regenerate.

(cherry picked from commit c5e0f954aef8caf4ee54b185e0fbfa88aeab62c6)

3 years agolibstdc++: Document P1739R4 status [PR100139]
Jonathan Wakely [Thu, 19 Aug 2021 10:44:57 +0000 (11:44 +0100)]
libstdc++: Document P1739R4 status [PR100139]

We should document the status of this unimplemented feature.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/100139
* doc/xml/manual/status_cxx2020.xml: Add P1739R4 to status table.
* doc/html/manual/status.html: Regenerate.

(cherry picked from commit 926d4a71c7e5a2f7d17a4f943d6e7fe9f1e3ba55)

3 years agoFix up 'gcc.dg/pr78213.c' for '--enable-checking=release' etc.
Thomas Schwinge [Thu, 19 Aug 2021 06:25:47 +0000 (08:25 +0200)]
Fix up 'gcc.dg/pr78213.c' for '--enable-checking=release' etc.

Fix up for r242748 (commit 3615816da830d41f67a5d8955ae588eba7f0b6fb)
"[PR target/78213] Do not ICE on non-empty -fself-test", as made
apparent by recent commit a42467bdb70650cd2f421e67b6c3418f74feaec2
"Restore 'gcc.dg/pr78213.c' testing", after the test case had gotten
disabled in r243681 (commit ecfc21ff34ddc6f8aa517251fb51494c68ff741f)
"Introduce selftest::locate_file" shortly after its original introduction.

gcc/testsuite/
PR testsuite/101969
* gcc.dg/pr78213.c: Fix up for '--enable-checking=release' etc.

(cherry picked from commit b7fc42073c04813f6b63e0641d3f6765424857c9)

3 years agoDaily bump.
GCC Administrator [Thu, 19 Aug 2021 00:18:33 +0000 (00:18 +0000)]
Daily bump.

3 years agoarm: Fix pr69245.c testcase for reorder assembler architecture directives [PR101723]
Christophe Lyon [Fri, 6 Aug 2021 14:25:47 +0000 (14:25 +0000)]
arm: Fix pr69245.c testcase for reorder assembler architecture directives [PR101723]

In gcc.target/arm/pr69245.c, to have a .fpu neon-vfpv4 directive, make
sure code for fn1() is emitted, by removing the static keyword.

Fix a typo in gcc.target/arm/pr69245.c, where \s should be \\s.

2021-08-06  Christophe Lyon  <christophe.lyon@foss.st.com>

gcc/testsuite/

PR target/101723
* gcc.target/arm/pr69245.c: Make sure to emit code for fn1, fix
typo.

(cherry picked from commit aff75af3b50f8c039ed6fbfa3f313ba45d44f6e6)

3 years agoarm: Fix typos for reorder assembler architecture directives [PR101723]
Christophe Lyon [Fri, 6 Aug 2021 14:06:44 +0000 (14:06 +0000)]
arm: Fix typos for reorder assembler architecture directives [PR101723]

Two tests had typos preventing them from passing, committed as obvious.

2021-08-06  Christophe Lyon  <christophe.lyon@foss.st.com>

gcc/testsuite/
PR target/101723
* gcc.target/arm/attr-neon3.c: Fix typo.
* gcc.target/arm/pragma_fpu_attribute_2.c: Fix typo.

(cherry picked from commit a22b3e022c2b45047a28d901042888eb77620499)

3 years agoarm: reorder assembler architecture directives [PR101723]
Richard Earnshaw [Thu, 29 Jul 2021 10:00:31 +0000 (11:00 +0100)]
arm: reorder assembler architecture directives [PR101723]

A change to the way gas interprets the .fpu directive in binutils-2.34
means that issuing .fpu will clear any features set by .arch_extension
that apply to the floating point or simd units.  This unfortunately
causes problems for more recent versions of the architecture because
we currently emit .arch, .arch_extension and .fpu directives at
different times and try to suppress redundant changes.

This change addresses this by firstly unifying all the places where we
emit these directives to a single block of code and secondly
(re)emitting all the directives if any changes have been made to the
target options.  Whilst this is slightly more than the strict minimum
it should be enough to catch all cases where a change could have
happened.  The new code also emits the directives in the order: .arch,
.fpu, .arch_extension.  This ensures that the additional architectural
extensions are not removed by a later .fpu directive.

Whilst writing this patch I also noticed that in the corner case where
the last function to be compiled had a non-standard set of
architecture flags, the assembler would add an incorrect set of
derived attributes for the file as a whole.  Instead of reflecting the
command-line options it would reflect the flags from the last file in
the function.  To address this I've also added a call to re-emit the
flags from the asm_file_end callback so the assembler will be in the
correct state when it finishes processing the intput.

There's some slight churn to the testsuite as a consequence of this,
because previously we had a hack to suppress emitting a .fpu directive
for one specific case, but with the new order this is no-longer
necessary.

gcc/ChangeLog:

PR target/101723
* config/arm/arm-cpus.in (generic-armv7-a): Add quirk to suppress
writing .cpu directive in asm output.
* config/arm/arm.c (arm_identify_fpu_from_isa): New variable.
(arm_last_printed_arch_string): Delete.
(arm_last-printed_fpu_string): Delete.
(arm_configure_build_target): If use of floating-point/SIMD is
disabled, remove all fp/simd related features from the target ISA.
(last_arm_targ_options): New variable.
(arm_print_asm_arch_directives): Add new parameters.  Change order
of emitted directives and handle all cases here.
(arm_file_start): Always call arm_print_asm_arch_directives, move
all generation of .arch/.arch_extension here.
(arm_file_end): Call arm_print_asm_arch.
(arm_declare_function_name): Call arm_print_asm_arch_directives
instead of printing .arch/.fpu directives directly.

gcc/testsuite/ChangeLog:

PR target/101723
* gcc.target/arm/cortex-m55-nofp-flag-hard.c: Update expected output.
* gcc.target/arm/cortex-m55-nofp-flag-softfp.c: Likewise.
* gcc.target/arm/cortex-m55-nofp-nomve-flag-softfp.c: Likewise.
* gcc.target/arm/mve/intrinsics/mve_fpu1.c: Convert to dg-do assemble.
Add a non-no-op function body.
* gcc.target/arm/mve/intrinsics/mve_fpu2.c: Likewise.
* gcc.target/arm/pr98636.c (dg-options): Add -mfloat-abi=softfp.
* gcc.target/arm/attr-neon.c: Tighten scan-assembler tests.
* gcc.target/arm/attr-neon2.c: Use -Ofast, convert test to use
check-function-bodies.
* gcc.target/arm/attr-neon3.c: Likewise.
* gcc.target/arm/pr69245.c: Tighten scan-assembler match, but allow
multiple instances.
* gcc.target/arm/pragma_fpu_attribute.c: Likewise.
* gcc.target/arm/pragma_fpu_attribute_2.c: Likewise.

(cherry picked from commit c1cdabe3aab817d95a8db00a8b5e9f6bcdea936f)

3 years agoarm: Don't reconfigure globals in arm_configure_build_target
Richard Earnshaw [Tue, 27 Jul 2021 14:44:57 +0000 (15:44 +0100)]
arm: Don't reconfigure globals in arm_configure_build_target

arm_configure_build_target is usually used to reconfigure the
arm_active_target structure, which is then used to reconfigure a
number of other global variables describing the current target.
Occasionally, however, we need to use arm_configure_build_target to
construct a temporary target structure and in that case it is wrong to
try to reconfigure the global variables (although probably harmless,
since arm_option_reconfigure_globals() only looks at
arm_active_target).  At the very least, however, this is wasted work,
so it is best not to do it unless needed.  What's more, several
callers of arm_configure_build target call
arm_option_reconfigure_globals themselves within a few lines, making
the call from within arm_configure_build_target completely redundant.

So this patch moves the responsibility of calling of
arm_configure_build_target to its callers (only two places needed
updating).

gcc:
* config/arm/arm.c (arm_configure_build_target): Don't call
arm_option_reconfigure_globals.
(arm_option_restore): Call arm_option_reconfigure_globals after
reconfiguring the target.
* config/arm/arm-c.c (arm_pragma_target_parse): Likewise.
(cherry picked from commit 6a37d0331c25f23628d4308e5a75624005c223b2)

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