aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-03-17 12:19:01 -0700
committerIan Lance Taylor <iant@golang.org>2021-03-17 12:19:01 -0700
commitf10c7c4596dda99d2ee872c995ae4aeda65adbdf (patch)
treea3451277603bc8fbe2eddce5f4ad63f790129a01
parentbc636c218f2b28da06cd1404d5b35d1f8cc43fd1 (diff)
parentf3e9c98a9f40fc24bb4ecef6aaa94ff799c8d587 (diff)
downloadgcc-f10c7c4596dda99d2ee872c995ae4aeda65adbdf.zip
gcc-f10c7c4596dda99d2ee872c995ae4aeda65adbdf.tar.gz
gcc-f10c7c4596dda99d2ee872c995ae4aeda65adbdf.tar.bz2
Merge from trunk revision f3e9c98a9f40fc24bb4ecef6aaa94ff799c8d587.
-rw-r--r--ChangeLog18
-rw-r--r--MAINTAINERS1
-rw-r--r--Makefile.def1
-rw-r--r--Makefile.in1
-rw-r--r--contrib/ChangeLog14
-rwxr-xr-xcontrib/gcc-changelog/git_commit.py3
-rwxr-xr-xcontrib/gcc-changelog/git_email.py2
-rwxr-xr-xcontrib/gcc-changelog/git_update_version.py4
-rw-r--r--contrib/gcc-changelog/setup.cfg3
-rwxr-xr-xcontrib/gcc-changelog/test_email.py4
-rw-r--r--contrib/gcc-changelog/test_patches.txt30
-rw-r--r--gcc/ChangeLog235
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/analyzer/ChangeLog60
-rw-r--r--gcc/analyzer/sm-file.cc2
-rw-r--r--gcc/builtins.c2
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-decl.c22
-rw-r--r--gcc/config/aarch64/aarch64-builtins.c2
-rw-r--r--gcc/config/aarch64/aarch64.c14
-rw-r--r--gcc/config/i386/constraints.md6
-rw-r--r--gcc/config/i386/i386-expand.c11
-rw-r--r--gcc/config/i386/i386-features.c31
-rw-r--r--gcc/config/i386/i386-options.c2
-rw-r--r--gcc/config/i386/i386.c32
-rw-r--r--gcc/config/i386/i386.h4
-rw-r--r--gcc/config/i386/i386.md12
-rw-r--r--gcc/config/i386/mmx.md179
-rw-r--r--gcc/config/i386/sse.md350
-rw-r--r--gcc/config/i386/x86-tune-costs.h134
-rw-r--r--gcc/config/rs6000/predicates.md9
-rw-r--r--gcc/config/s390/s390.c12
-rw-r--r--gcc/config/sparc/constraints.md9
-rw-r--r--gcc/config/sparc/sparc.c9
-rw-r--r--gcc/config/sparc/sparc.md12
-rw-r--r--gcc/config/sparc/sync.md6
-rw-r--r--gcc/cp/ChangeLog117
-rw-r--r--gcc/cp/call.c7
-rw-r--r--gcc/cp/coroutines.cc273
-rw-r--r--gcc/cp/decl.c80
-rw-r--r--gcc/cp/module.cc69
-rw-r--r--gcc/cp/name-lookup.c83
-rw-r--r--gcc/cp/name-lookup.h1
-rw-r--r--gcc/cp/tree.c2
-rw-r--r--gcc/doc/invoke.texi4
-rw-r--r--gcc/fortran/ChangeLog35
-rw-r--r--gcc/fortran/frontend-passes.c7
-rw-r--r--gcc/fortran/resolve.c10
-rw-r--r--gcc/fortran/trans-array.c10
-rw-r--r--gcc/fortran/trans-expr.c16
-rw-r--r--gcc/fortran/trans-intrinsic.c28
-rw-r--r--gcc/fortran/trans-stmt.c2
-rw-r--r--gcc/gimplify.c2
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/expressions.cc2
-rw-r--r--gcc/go/gofrontend/statements.cc27
-rw-r--r--gcc/match.pd10
-rw-r--r--gcc/optc-save-gen.awk1
-rw-r--r--gcc/po/ChangeLog4
-rw-r--r--gcc/po/sv.po721
-rw-r--r--gcc/spellcheck.c2
-rw-r--r--gcc/testsuite/ChangeLog211
-rw-r--r--gcc/testsuite/c-c++-common/asan/memcmp-1.c8
-rw-r--r--gcc/testsuite/c-c++-common/asan/strncpy-overflow-1.c5
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr96749-1.C42
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr96749-2.C37
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr98480.C20
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr99047.C83
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/co-await-24-for-init.C101
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/co-await-25-for-condition.C94
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/co-await-26-for-iteration-expr.C87
-rw-r--r--gcc/testsuite/g++.dg/coroutines/torture/pr98704.C91
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/consteval19.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/nontype-float1.C12
-rw-r--r--gcc/testsuite/g++.dg/gomp/declare-simd-1.C2
-rw-r--r--gcc/testsuite/g++.dg/modules/builtin-3_a.C4
-rw-r--r--gcc/testsuite/g++.dg/modules/builtin-3_b.C2
-rw-r--r--gcc/testsuite/g++.dg/modules/pr99238.h1
-rw-r--r--gcc/testsuite/g++.dg/modules/pr99238_a.H4
-rw-r--r--gcc/testsuite/g++.dg/modules/pr99238_b.H8
-rw-r--r--gcc/testsuite/g++.dg/modules/pr99496_a.H17
-rw-r--r--gcc/testsuite/g++.dg/modules/pr99496_b.C3
-rw-r--r--gcc/testsuite/g++.dg/opt/pr98834.C71
-rw-r--r--gcc/testsuite/g++.dg/vect/simd-clone-7.cc2
-rw-r--r--gcc/testsuite/g++.target/i386/pr99108.C19
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-truncation-9.c41
-rw-r--r--gcc/testsuite/gcc.dg/declare-simd.c1
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr59669-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr99542.c17
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr99544.c13
-rw-r--r--gcc/testsuite/gcc.dg/gomp/simd-clones-2.c1
-rw-r--r--gcc/testsuite/gcc.target/aarch64/acle/rng_2.c12
-rw-r--r--gcc/testsuite/gcc.target/arm/pr99592.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-pr99563.c38
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512vl-pr99321-2.c94
-rw-r--r--gcc/testsuite/gcc.target/i386/pr99530-1.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr99530-2.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr99530-3.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr99530-4.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr99530-5.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr99530-6.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr99600.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr98092.c7
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr99492.c6
-rw-r--r--gcc/testsuite/gcc.target/s390/vector/long-double-asm-fprvrmem.c11
-rw-r--r--gcc/testsuite/gfortran.dg/alloc_deferred_comp_1.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/do_check_16.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/do_check_17.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/threadprivate-1.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/pr99112.f9027
-rw-r--r--gcc/testsuite/gfortran.dg/pr99545.f9040
-rw-r--r--gcc/tree-ssa-sccvn.c12
-rw-r--r--libgfortran/ChangeLog9
-rw-r--r--libgfortran/io/transfer.c32
-rw-r--r--libgfortran/io/unit.c1
-rw-r--r--libgo/MERGE2
-rw-r--r--libgo/VERSION2
-rw-r--r--libgo/go/archive/zip/reader.go2
-rw-r--r--libgo/go/archive/zip/reader_test.go35
-rw-r--r--libgo/go/cmd/go.mod2
-rw-r--r--libgo/go/cmd/go/internal/get/get.go30
-rw-r--r--libgo/go/cmd/go/internal/modcmd/tidy.go9
-rw-r--r--libgo/go/cmd/go/internal/modcmd/vendor.go9
-rw-r--r--libgo/go/cmd/go/internal/modget/get.go2
-rw-r--r--libgo/go/cmd/go/internal/modget/query.go2
-rw-r--r--libgo/go/cmd/go/internal/modload/import.go18
-rw-r--r--libgo/go/cmd/go/internal/modload/init.go11
-rw-r--r--libgo/go/cmd/go/internal/modload/list.go2
-rw-r--r--libgo/go/cmd/go/internal/modload/load.go13
-rw-r--r--libgo/go/cmd/go/internal/run/run.go20
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_convert_dep.txt2
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_edit.txt16
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_find.txt2
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_outside.txt52
-rw-r--r--libgo/go/cmd/go/testdata/script/mod_tidy_error.txt4
-rw-r--r--libgo/go/cmd/vendor/modules.txt2
-rw-r--r--libgo/go/encoding/xml/xml.go19
-rw-r--r--libgo/go/encoding/xml/xml_test.go104
-rw-r--r--libgo/go/go/build/build_test.go2
-rw-r--r--libgo/go/golang.org/x/mod/modfile/rule.go167
-rw-r--r--libgo/go/golang.org/x/mod/module/module.go40
-rw-r--r--libgo/go/time/zoneinfo.go6
-rw-r--r--libgo/go/time/zoneinfo_test.go60
-rw-r--r--libgo/misc/cgo/testcarchive/testdata/main_unix.c2
-rw-r--r--libgo/misc/cgo/testplugin/plugin_test.go13
-rw-r--r--libgo/misc/cgo/testplugin/testdata/method2/main.go32
-rw-r--r--libgo/misc/cgo/testplugin/testdata/method2/p/p.go9
-rw-r--r--libgo/misc/cgo/testplugin/testdata/method2/plugin.go11
-rw-r--r--libgomp/ChangeLog10
-rw-r--r--libgomp/testsuite/libgomp.c-c++-common/declare_target-1.c22
-rw-r--r--libgomp/testsuite/libgomp.fortran/use_device_ptr-3.f9091
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/sha1.c2
-rw-r--r--libstdc++-v3/ChangeLog133
-rw-r--r--libstdc++-v3/config/abi/post/aarch64-linux-gnu/baseline_symbols.txt2
-rw-r--r--libstdc++-v3/config/abi/post/ia64-linux-gnu/baseline_symbols.txt2
-rw-r--r--libstdc++-v3/config/abi/post/m68k-linux-gnu/baseline_symbols.txt2
-rw-r--r--libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt2
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver5
-rw-r--r--libstdc++-v3/config/os/bsd/darwin/ppc-extra.ver3
-rw-r--r--libstdc++-v3/include/bits/max_size_type.h78
-rw-r--r--libstdc++-v3/include/std/mutex242
-rw-r--r--libstdc++-v3/src/Makefile.am4
-rw-r--r--libstdc++-v3/src/Makefile.in3
-rw-r--r--libstdc++-v3/src/c++11/mutex.cc59
-rw-r--r--libstdc++-v3/testsuite/17_intro/names.cc5
-rw-r--r--libstdc++-v3/testsuite/30_threads/call_once/66146.cc53
-rw-r--r--libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc36
168 files changed, 4275 insertions, 1384 deletions
diff --git a/ChangeLog b/ChangeLog
index c022b4d..e39cfd8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2021-03-13 Eugene Rozenfeld <erozen@microsoft.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2021-03-13 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.def: Remove all-sim dependency on configure-gdb.
+ * Makefile.in: Regenerated.
+
+2021-03-11 Jeff Law <law@redhat.com>
+
+ * MAINTAINERS: Update entries for a few ex-ImgTec employees
+
+2021-03-11 Martin Liska <mliska@suse.cz>
+
+ * Makefile.tpl: The change was done Makefile.in which
+ is generated file.
+
2021-03-08 Jeff Law <law@redhat.com>
* MAINTAINERS: Update my email address
diff --git a/MAINTAINERS b/MAINTAINERS
index f95640f..41924eb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -581,6 +581,7 @@ Craig Rodrigues <rodrigc@gcc.gnu.org>
Erven Rohou <erven.rohou@inria.fr>
Ira Rosen <irar@il.ibm.com>
Yvan Roux <yvan.roux@linaro.org>
+Eugene Rozenfeld <erozen@microsoft.com>
Maciej W. Rozycki <macro@orcam.me.uk>
Silvius Rus <rus@google.com>
Matthew Sachs <msachs@apple.com>
diff --git a/Makefile.def b/Makefile.def
index 3e38f61..df8ccfb 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -547,7 +547,6 @@ dependencies = { module=all-sim; on=all-libiberty; };
dependencies = { module=all-sim; on=all-bfd; };
dependencies = { module=all-sim; on=all-opcodes; };
dependencies = { module=all-sim; on=all-readline; };
-dependencies = { module=all-sim; on=configure-gdb; };
// Other host modules.
dependencies = { module=all-fastjar; on=all-zlib; };
diff --git a/Makefile.in b/Makefile.in
index 0378520..047be02 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -61522,7 +61522,6 @@ install-strip-sid: maybe-install-strip-tcl
install-sid: maybe-install-tk
install-strip-sid: maybe-install-strip-tk
all-sim: maybe-all-readline
-all-sim: maybe-configure-gdb
all-fastjar: maybe-all-build-texinfo
all-libctf: all-libiberty
all-stage1-libctf: all-stage1-libiberty
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 0bc2fee..acf530e 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,17 @@
+2021-03-16 Martin Liska <mliska@suse.cz>
+
+ * gcc-changelog/git_update_version.py: Skip one problematic
+ commit.
+
+2021-03-12 Martin Liska <mliska@suse.cz>
+
+ * gcc-changelog/git_commit.py: Allow deletion of ChangeLog
+ files.
+ * gcc-changelog/setup.cfg: Set line limit to 120 characters.
+ * gcc-changelog/test_email.py: Add test.
+ * gcc-changelog/test_patches.txt: Likewise.
+ * gcc-changelog/git_email.py: Fix parsing of deleted files.
+
2021-02-08 Mike Frysinger <vapier@gentoo.org>
* mklog.py (generated_files): New set.
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index e9dae0a..43fa7f4 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -314,8 +314,9 @@ class GitCommit:
if self.revert_commit:
self.info = self.commit_to_info_hook(self.revert_commit)
+ # Allow complete deletion of ChangeLog files in a commit
project_files = [f for f in self.info.modified_files
- if self.is_changelog_filename(f[0], allow_suffix=True)
+ if (self.is_changelog_filename(f[0], allow_suffix=True) and f[1] != 'D')
or f[0] in misc_files]
ignored_files = [f for f in self.info.modified_files
if self.in_ignored_location(f[0])]
diff --git a/contrib/gcc-changelog/git_email.py b/contrib/gcc-changelog/git_email.py
index 00ad004..b0547b3 100755
--- a/contrib/gcc-changelog/git_email.py
+++ b/contrib/gcc-changelog/git_email.py
@@ -66,7 +66,7 @@ class GitEmail(GitCommit):
t = 'A'
else:
t = 'M'
- modified_files.append((target, t))
+ modified_files.append((target if t != 'D' else source, t))
git_info = GitInfo(None, date, author, body, modified_files)
super().__init__(git_info, strict=strict,
commit_to_info_hook=lambda x: None)
diff --git a/contrib/gcc-changelog/git_update_version.py b/contrib/gcc-changelog/git_update_version.py
index d2cadb8..1e2b22b 100755
--- a/contrib/gcc-changelog/git_update_version.py
+++ b/contrib/gcc-changelog/git_update_version.py
@@ -26,6 +26,9 @@ from git_repository import parse_git_revisions
current_timestamp = datetime.datetime.now().strftime('%Y%m%d\n')
+# Skip the following commits, they cannot be correctly processed
+IGNORED_COMMITS = ('c2be82058fb40f3ae891c68d185ff53e07f14f45')
+
def read_timestamp(path):
with open(path) as f:
@@ -98,6 +101,7 @@ def update_current_branch():
head = head.parents[1]
commits = parse_git_revisions(args.git_path, '%s..%s'
% (commit.hexsha, head.hexsha))
+ commits = [c for c in commits if c.info.hexsha not in IGNORED_COMMITS]
for git_commit in reversed(commits):
prepend_to_changelog_files(repo, args.git_path, git_commit,
not args.dry_mode)
diff --git a/contrib/gcc-changelog/setup.cfg b/contrib/gcc-changelog/setup.cfg
index 9e4a0f6..efc313f 100644
--- a/contrib/gcc-changelog/setup.cfg
+++ b/contrib/gcc-changelog/setup.cfg
@@ -1,2 +1,5 @@
+[flake8]
+max-line-length = 120
+
[tool:pytest]
addopts = -vv --flake8
diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py
index b81548f..9d052e0 100755
--- a/contrib/gcc-changelog/test_email.py
+++ b/contrib/gcc-changelog/test_email.py
@@ -416,3 +416,7 @@ class TestGccChangelog(unittest.TestCase):
def test_multiline_bad_parentheses(self):
email = self.from_patch_glob('0002-Wrong-macro-changelog.patch')
assert email.errors[0].message == 'bad parentheses wrapping'
+
+ def test_changelog_removal(self):
+ email = self.from_patch_glob('0001-ChangeLog-removal.patch', strict=True)
+ assert not email.errors
diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt
index 9de2897..012573b 100644
--- a/contrib/gcc-changelog/test_patches.txt
+++ b/contrib/gcc-changelog/test_patches.txt
@@ -3481,3 +3481,33 @@ index ac63591b33f..ff4d61764e7 100644
+
--
2.29.2
+
+=== 0001-ChangeLog-removal.patch ===
+From b39fadf9df1a9510afcab0a391182da7dc68de24 Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Fri, 12 Mar 2021 09:10:55 +0100
+Subject: [PATCH] Test ChangeLog removal.
+
+gcc/ChangeLog:
+
+ * ipa-icf.c (make_pass_ipa_icf): Add line.
+---
+diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog
+deleted file mode 100644
+index 94e87f6bcde..00000000000
+--- a/gcc/analyzer/ChangeLog
++++ /dev/null
+@@ -1,1 +0,0 @@
+- foo
+diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
+index 5dd33a75c3a..c4ce432cb98 100644
+--- a/gcc/ipa-icf.c
++++ b/gcc/ipa-icf.c
+@@ -3655,3 +3655,4 @@ make_pass_ipa_icf (gcc::context *ctxt)
+ {
+ return new ipa_icf::pass_ipa_icf (ctxt);
+ }
++
+--
+2.30.1
+
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f1f3405..ef93c56 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,238 @@
+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.
+
+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.
+
+2021-03-16 Martin Liska <mliska@suse.cz>
+
+ PR target/99592
+ * optc-save-gen.awk: Add flag_ipa_ra to exceptions for
+ cl_optimization_compare function.
+
+2021-03-16 Ilya Leoshkevich <iii@linux.ibm.com>
+
+ * config/s390/s390.c (f_constraint_p): Treat "fv" constraints
+ as "v".
+
+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.
+
+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.
+
+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.
+
+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.
+
+2021-03-15 Martin Liska <mliska@suse.cz>
+
+ * spellcheck.c: Add missing comma in initialization.
+
+2021-03-14 Uroš Bizjak <ubizjak@gmail.com>
+
+ * 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.
+
+2021-03-13 Martin Sebor <msebor@redhat.com>
+
+ PR tree-optimization/99489
+ * builtins.c (gimple_call_alloc_size): Fail gracefully when argument
+ is not a call statement.
+
+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.
+
+2021-03-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/99422
+ * config/sparc/constraints.md (w): Rename to...
+ (W): ... this and ditch previous implementation.
+ * config/sparc/sparc.md (*movdi_insn_sp64): Replace W with m.
+ (*movdf_insn_sp64): Likewise.
+ (*mov<VM64:mode>_insn_sp64): Likewise.
+ * config/sparc/sync.md (*atomic_compare_and_swap<mode>_1): Replace
+ w with W.
+ (atomic_compare_and_swap_leon3_1): Likewise.
+ (*atomic_compare_and_swapdi_v8plus): Likewise.
+ * config/sparc/sparc.c (memory_ok_for_ldd): Remove useless test on
+ architecture and add missing address validity check during LRA.
+
+2021-03-12 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/98858
+ * gimplify.c (omp_add_variable): Handle NULL_TREE as size
+ occuring for assumed-size arrays in use_device_{ptr,addr}.
+
+2021-03-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/99321
+ * config/i386/constraints.md (YW): New internal constraint.
+ * config/i386/sse.md (v_Yw): Add V4TI, V2TI, V1TI and TI cases.
+ (*<sse2_avx2>_<insn><mode>3<mask_name>,
+ *<sse2_avx2>_uavg<mode>3<mask_name>, *abs<mode>2,
+ *<s>mul<mode>3_highpart<mask_name>): Use <v_Yw> instead of v in
+ constraints.
+ (<sse2_avx2>_psadbw): Use YW instead of v in constraints.
+ (*avx2_pmaddwd, *sse2_pmaddwd, *<code>v8hi3, *<code>v16qi3,
+ avx2_pmaddubsw256, ssse3_pmaddubsw128): Merge last two alternatives
+ into one, use Yw instead of former x,v.
+ (ashr<mode>3, <insn><mode>3): Use <v_Yw> instead of x in constraints of
+ the last alternative.
+ (<sse2_avx2>_packsswb<mask_name>, <sse2_avx2>_packssdw<mask_name>,
+ <sse2_avx2>_packuswb<mask_name>, <sse4_1_avx2>_packusdw<mask_name>,
+ *<ssse3_avx2>_pmulhrsw<mode>3<mask_name>, <ssse3_avx2>_palignr<mode>,
+ <ssse3_avx2>_pshufb<mode>3<mask_name>): Merge last two alternatives
+ into one, use <v_Yw> instead of former x,v.
+ (avx2_interleave_highv32qi<mask_name>,
+ vec_interleave_highv16qi<mask_name>): Use Yw instead of v in
+ constraints. Add && <mask_avx512bw_condition> to condition.
+ (avx2_interleave_lowv32qi<mask_name>,
+ vec_interleave_lowv16qi<mask_name>,
+ avx2_interleave_highv16hi<mask_name>,
+ vec_interleave_highv8hi<mask_name>,
+ avx2_interleave_lowv16hi<mask_name>, vec_interleave_lowv8hi<mask_name>,
+ avx2_pshuflw_1<mask_name>, sse2_pshuflw_1<mask_name>,
+ avx2_pshufhw_1<mask_name>, sse2_pshufhw_1<mask_name>,
+ avx2_<code>v16qiv16hi2<mask_name>, sse4_1_<code>v8qiv8hi2<mask_name>,
+ *sse4_1_<code>v8qiv8hi2<mask_name>_1, <sse2_avx2>_<insn><mode>3): Use
+ Yw instead of v in constraints.
+ * config/i386/mmx.md (Yv_Yw): New define_mode_attr.
+ (*mmx_<insn><mode>3, mmx_ashr<mode>3, mmx_<insn><mode>3): Use <Yv_Yw>
+ instead of Yv in constraints.
+ (*mmx_<insn><mode>3, *mmx_mulv4hi3, *mmx_smulv4hi3_highpart,
+ *mmx_umulv4hi3_highpart, *mmx_pmaddwd, *mmx_<code>v4hi3,
+ *mmx_<code>v8qi3, mmx_pack<s_trunsuffix>swb, mmx_packssdw,
+ mmx_punpckhbw, mmx_punpcklbw, mmx_punpckhwd, mmx_punpcklwd,
+ *mmx_uavgv8qi3, *mmx_uavgv4hi3, mmx_psadbw): Use Yw instead of Yv in
+ constraints.
+ (*mmx_pinsrw, *mmx_pinsrb, *mmx_pextrw, *mmx_pextrw_zext, *mmx_pextrb,
+ *mmx_pextrb_zext): Use YW instead of Yv in constraints.
+ (*mmx_eq<mode>3, mmx_gt<mode>3): Use x instead of Yv in constraints.
+ (mmx_andnot<mode>3, *mmx_<code><mode>3): Split last alternative into
+ two, one with just x, another isa avx512vl with v.
+
+2021-03-12 Martin Liska <mliska@suse.cz>
+
+ * doc/invoke.texi: Add missing param documentation.
+
+2021-03-11 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/96374
+ * Makefile.in (ANALYZER_OBJS): Add analyzer/feasible-graph.o and
+ analyzer/trimmed-graph.o.
+ * doc/analyzer.texi (Analyzer Paths): Rewrite description of
+ feasibility checking to reflect new implementation.
+ * doc/invoke.texi (-fdump-analyzer-feasibility): Document new
+ option.
+ * shortest-paths.h (shortest_paths::get_shortest_distance): New.
+
+2021-03-11 David Malcolm <dmalcolm@redhat.com>
+
+ * digraph.cc (selftest::test_shortest_paths): Update
+ shortest_paths init for new param. Add test of
+ SPS_TO_GIVEN_TARGET.
+ * shortest-paths.h (enum shortest_path_sense): New.
+ (shortest_paths::shortest_paths): Add "sense" param.
+ Update for renamings. Generalize to use "sense" param.
+ (shortest_paths::get_shortest_path): Rename param.
+ (shortest_paths::m_sense): New field.
+ (shortest_paths::m_prev): Rename...
+ (shortest_paths::m_best_edge): ...to this.
+ (shortest_paths::get_shortest_path): Update for renamings.
+ Conditionalize flipping of path on sense of traversal.
+
+2021-03-11 David Malcolm <dmalcolm@redhat.com>
+
+ * digraph.cc (selftest::test_shortest_paths): Add test coverage
+ for paths from B and C.
+ * shortest-paths.h (shortest_paths::shortest_paths): Handle
+ unreachable nodes, rather than asserting.
+
+2021-03-11 David Edelsohn <dje.gcc@gmail.com>
+
+ PR target/99094
+ * config/rs6000/rs6000.c (rs6000_xcoff_file_start): Don't create
+ xcoff_tbss_section_name.
+ * config/rs6000/xcoff.h (ASM_OUTPUT_TLS_COMMON): Use .lcomm.
+ * xcoffout.c (xcoff_tbss_section_name): Delete.
+ * xcoffout.h (xcoff_tbss_section_name): Delete.
+
+2021-03-11 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/99523
+ * tree-cfg.c (dump_function_to_file): Dump SSA names
+ w/o identifier to the decls section as well, not only those
+ without a VAR_DECL.
+
+2021-03-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR ipa/99517
+ * ipa-icf-gimple.c (func_checker::compare_gimple_call): For internal
+ function calls with lhs fail if the lhs don't have compatible types.
+
+2021-03-11 Hans-Peter Nilsson <hp@axis.com>
+
+ * config/cris/cris.h (HARD_FRAME_POINTER_REGNUM): Define.
+ Change FRAME_POINTER_REGNUM to correspond to a new faked
+ register faked_fp, part of GENNONACR_REGS like faked_ap.
+ (CRIS_FAKED_REGS_CONTENTS): New helper macro.
+ (FIRST_PSEUDO_REGISTER, FIXED_REGISTERS, CALL_USED_REGISTERS):
+ (REG_ALLOC_ORDER, REG_CLASS_CONTENTS, REGNO_OK_FOR_BASE_P)
+ (ELIMINABLE_REGS, REGISTER_NAMES): Adjust accordingly.
+ * config/cris/cris.md (CRIS_FP_REGNUM): Renumber to new faked
+ register.
+ (CRIS_REAL_FP_REGNUM): New constant.
+ * config/cris/cris.c (cris_reg_saved_in_regsave_area): Check
+ for HARD_FRAME_POINTER_REGNUM instead of FRAME_POINTER_REGNUM.
+ (cris_initial_elimination_offset): Handle elimination changes
+ to HARD_FRAME_POINTER_REGNUM instead of FRAME_POINTER_REGNUM
+ and add one from FRAME_POINTER_REGNUM to
+ HARD_FRAME_POINTER_REGNUM.
+ (cris_expand_prologue, cris_expand_epilogue): Emit code for
+ hard_frame_pointer_rtx instead of frame_pointer_rtx.
+
2021-03-10 David Edelsohn <dje.gcc@gmail.com>
PR target/99492
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index f2ed86a..609f807 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20210311
+20210317
diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog
index 9ed1624..58b0fbb 100644
--- a/gcc/analyzer/ChangeLog
+++ b/gcc/analyzer/ChangeLog
@@ -1,3 +1,63 @@
+2021-03-15 Martin Liska <mliska@suse.cz>
+
+ * sm-file.cc (get_file_using_fns): Add missing comma in initializer.
+
+2021-03-11 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/96374
+ * analyzer.opt (-param=analyzer-max-infeasible-edges=): New param.
+ (fdump-analyzer-feasibility): New flag.
+ * diagnostic-manager.cc: Include "analyzer/trimmed-graph.h" and
+ "analyzer/feasible-graph.h".
+ (epath_finder::epath_finder): Convert m_sep to a pointer and
+ only create it if !flag_analyzer_feasibility.
+ (epath_finder::~epath_finder): New.
+ (epath_finder::m_sep): Convert to a pointer.
+ (epath_finder::get_best_epath): Add param "diag_idx" and use it
+ when logging. Rather than finding the shortest path and then
+ checking feasibility, instead use explore_feasible_paths unless
+ !flag_analyzer_feasibility, in which case simply use the shortest
+ path, and note if it is infeasible. Update for m_sep becoming a
+ pointer.
+ (class feasible_worklist): New.
+ (epath_finder::explore_feasible_paths): New.
+ (epath_finder::process_worklist_item): New.
+ (class dump_eg_with_shortest_path): New.
+ (epath_finder::dump_trimmed_graph): New.
+ (epath_finder::dump_feasible_graph): New.
+ (saved_diagnostic::saved_diagnostic): Add "idx" param, using it
+ on new field m_idx.
+ (saved_diagnostic::to_json): Dump m_idx.
+ (saved_diagnostic::calc_best_epath): Pass m_idx to get_best_epath.
+ Remove assertion that m_problem was set when m_best_epath is NULL.
+ (diagnostic_manager::add_diagnostic): Pass an index when created
+ saved_diagnostic instances.
+ * diagnostic-manager.h (saved_diagnostic::saved_diagnostic): Add
+ "idx" param.
+ (saved_diagnostic::get_index): New accessor.
+ (saved_diagnostic::m_idx): New field.
+ * engine.cc (exploded_node::dump_dot): Call args.dump_extra_info.
+ Move code to...
+ (exploded_node::dump_processed_stmts): ...this new function and...
+ (exploded_node::dump_saved_diagnostics): ...this new function.
+ Add index of each diagnostic.
+ (exploded_edge::dump_dot): Move bulk of code to...
+ (exploded_edge::dump_dot_label): ...this new function.
+ * exploded-graph.h (eg_traits::dump_args_t::dump_extra_info): New
+ vfunc.
+ (exploded_node::dump_processed_stmts): New decl.
+ (exploded_node::dump_saved_diagnostics): New decl.
+ (exploded_edge::dump_dot_label): New decl.
+ * feasible-graph.cc: New file.
+ * feasible-graph.h: New file.
+ * trimmed-graph.cc: New file.
+ * trimmed-graph.h: New file.
+
+2021-03-11 David Malcolm <dmalcolm@redhat.com>
+
+ * diagnostic-manager.cc (epath_finder::epath_finder):
+ Update shortest_paths init for new param.
+
2021-03-10 David Malcolm <dmalcolm@redhat.com>
PR analyzer/96374
diff --git a/gcc/analyzer/sm-file.cc b/gcc/analyzer/sm-file.cc
index 48ef4aa..7a81c8f 100644
--- a/gcc/analyzer/sm-file.cc
+++ b/gcc/analyzer/sm-file.cc
@@ -246,7 +246,7 @@ get_file_using_fns ()
"__fbufsize",
"__flbf",
"__fpending",
- "__fpurge"
+ "__fpurge",
"__freadable",
"__freading",
"__fsetlocking",
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 41e336c..196dda3 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -4924,7 +4924,7 @@ tree
gimple_call_alloc_size (gimple *stmt, wide_int rng1[2] /* = NULL */,
range_query * /* = NULL */)
{
- if (!stmt)
+ if (!stmt || !is_gimple_call (stmt))
return NULL_TREE;
tree allocfntype;
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 214e57b..e1da067 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2021-03-15 Tobias Burnus <tobias@codesourcery.com>
+
+ PR c++/99509
+ * c-decl.c (finish_decl): For 'omp declare target implicit' vars,
+ ensure that the varpool node is marked as offloadable.
+
2021-03-05 Tobias Burnus <tobias@codesourcery.com>
PR c/99137
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index b559ed5..3b2241b 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -58,6 +58,9 @@ along with GCC; see the file COPYING3. If not see
#include "c-family/name-hint.h"
#include "c-family/known-headers.h"
#include "c-family/c-spellcheck.h"
+#include "context.h" /* For 'g'. */
+#include "omp-general.h"
+#include "omp-offload.h" /* For offload_vars. */
#include "tree-pretty-print.h"
@@ -5658,9 +5661,22 @@ finish_decl (tree decl, location_t init_loc, tree init,
DECL_ATTRIBUTES (decl))
&& !lookup_attribute ("omp declare target link",
DECL_ATTRIBUTES (decl)))
- DECL_ATTRIBUTES (decl)
- = tree_cons (get_identifier ("omp declare target"),
- NULL_TREE, DECL_ATTRIBUTES (decl));
+ {
+ DECL_ATTRIBUTES (decl)
+ = tree_cons (get_identifier ("omp declare target"),
+ NULL_TREE, DECL_ATTRIBUTES (decl));
+ symtab_node *node = symtab_node::get (decl);
+ if (node != NULL)
+ {
+ node->offloadable = 1;
+ if (ENABLE_OFFLOADING)
+ {
+ g->have_offload = true;
+ if (is_a <varpool_node *> (node))
+ vec_safe_push (offload_vars, decl);
+ }
+ }
+ }
}
/* This is the last point we can lower alignment so give the target the
diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c
index 25ab866..acdea2a 100644
--- a/gcc/config/aarch64/aarch64-builtins.c
+++ b/gcc/config/aarch64/aarch64-builtins.c
@@ -1954,7 +1954,7 @@ aarch64_expand_rng_builtin (tree exp, rtx target, int fcode, int ignore)
return target;
rtx cc_reg = gen_rtx_REG (CC_Zmode, CC_REGNUM);
- rtx cmp_rtx = gen_rtx_fmt_ee (NE, SImode, cc_reg, const0_rtx);
+ rtx cmp_rtx = gen_rtx_fmt_ee (EQ, SImode, cc_reg, const0_rtx);
emit_insn (gen_aarch64_cstoresi (target, cmp_rtx, cc_reg));
return target;
}
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 8a86889..7838d99 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -23372,7 +23372,7 @@ aarch64_simd_clone_compute_vecsize_and_simdlen (struct cgraph_node *node,
struct cgraph_simd_clone *clonei,
tree base_type, int num)
{
- tree t, ret_type, arg_type;
+ tree t, ret_type;
unsigned int elt_bits, count;
unsigned HOST_WIDE_INT const_simdlen;
poly_uint64 vec_bits;
@@ -23412,11 +23412,17 @@ aarch64_simd_clone_compute_vecsize_and_simdlen (struct cgraph_node *node,
return 0;
}
- for (t = DECL_ARGUMENTS (node->decl); t; t = DECL_CHAIN (t))
+ int i;
+ tree type_arg_types = TYPE_ARG_TYPES (TREE_TYPE (node->decl));
+ bool decl_arg_p = (node->definition || type_arg_types == NULL_TREE);
+
+ for (t = (decl_arg_p ? DECL_ARGUMENTS (node->decl) : type_arg_types), i = 0;
+ t && t != void_list_node; t = TREE_CHAIN (t), i++)
{
- arg_type = TREE_TYPE (t);
+ tree arg_type = decl_arg_p ? TREE_TYPE (t) : TREE_VALUE (t);
- if (!currently_supported_simd_type (arg_type, base_type))
+ if (clonei->args[i].arg_type != SIMD_CLONE_ARG_TYPE_UNIFORM
+ && !currently_supported_simd_type (arg_type, base_type))
{
if (TYPE_SIZE (arg_type) != TYPE_SIZE (base_type))
warning_at (DECL_SOURCE_LOCATION (node->decl), 0,
diff --git a/gcc/config/i386/constraints.md b/gcc/config/i386/constraints.md
index a8db33e..eaa582d 100644
--- a/gcc/config/i386/constraints.md
+++ b/gcc/config/i386/constraints.md
@@ -111,6 +111,8 @@
;; otherwise any SSE register
;; w any EVEX encodable SSE register for AVX512BW with TARGET_AVX512VL
;; target, otherwise any SSE register.
+;; W any EVEX encodable SSE register for AVX512BW target,
+;; otherwise any SSE register.
(define_register_constraint "Yz" "TARGET_SSE ? SSE_FIRST_REG : NO_REGS"
"First SSE register (@code{%xmm0}).")
@@ -151,6 +153,10 @@
"TARGET_AVX512BW && TARGET_AVX512VL ? ALL_SSE_REGS : TARGET_SSE ? SSE_REGS : NO_REGS"
"@internal Any EVEX encodable SSE register (@code{%xmm0-%xmm31}) for AVX512BW with TARGET_AVX512VL target, otherwise any SSE register.")
+(define_register_constraint "YW"
+ "TARGET_AVX512BW ? ALL_SSE_REGS : TARGET_SSE ? SSE_REGS : NO_REGS"
+ "@internal Any EVEX encodable SSE register (@code{%xmm0-%xmm31}) for AVX512BW target, otherwise any SSE register.")
+
;; We use the B prefix to denote any number of internal operands:
;; f FLAGS_REG
;; g GOT memory operand.
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index 02d3142..ac69eed 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -1348,9 +1348,10 @@ ix86_split_lea_for_addr (rtx_insn *insn, rtx operands[], machine_mode mode)
if (regno0 != regno2)
emit_insn (gen_rtx_SET (target, parts.index));
- /* Use shift for scaling. */
- ix86_emit_binop (ASHIFT, mode, target,
- GEN_INT (exact_log2 (parts.scale)));
+ /* Use shift for scaling, but emit it as MULT instead
+ to avoid it being immediately peephole2 optimized back
+ into lea. */
+ ix86_emit_binop (MULT, mode, target, GEN_INT (parts.scale));
if (parts.base)
ix86_emit_binop (PLUS, mode, target, parts.base);
@@ -13210,6 +13211,10 @@ rdseed_step:
return 0;
+ case IX86_BUILTIN_VZEROUPPER:
+ cfun->machine->has_explicit_vzeroupper = true;
+ break;
+
default:
break;
}
diff --git a/gcc/config/i386/i386-features.c b/gcc/config/i386/i386-features.c
index 41891c9..77783a1 100644
--- a/gcc/config/i386/i386-features.c
+++ b/gcc/config/i386/i386-features.c
@@ -1837,19 +1837,22 @@ ix86_add_reg_usage_to_vzerouppers (void)
static unsigned int
rest_of_handle_insert_vzeroupper (void)
{
- int i;
-
- /* vzeroupper instructions are inserted immediately after reload to
- account for possible spills from 256bit or 512bit registers. The pass
- reuses mode switching infrastructure by re-running mode insertion
- pass, so disable entities that have already been processed. */
- for (i = 0; i < MAX_386_ENTITIES; i++)
- ix86_optimize_mode_switching[i] = 0;
+ if (TARGET_VZEROUPPER
+ && flag_expensive_optimizations
+ && !optimize_size)
+ {
+ /* vzeroupper instructions are inserted immediately after reload to
+ account for possible spills from 256bit or 512bit registers. The pass
+ reuses mode switching infrastructure by re-running mode insertion
+ pass, so disable entities that have already been processed. */
+ for (int i = 0; i < MAX_386_ENTITIES; i++)
+ ix86_optimize_mode_switching[i] = 0;
- ix86_optimize_mode_switching[AVX_U128] = 1;
+ ix86_optimize_mode_switching[AVX_U128] = 1;
- /* Call optimize_mode_switching. */
- g->get_passes ()->execute_pass_mode_switching ();
+ /* Call optimize_mode_switching. */
+ g->get_passes ()->execute_pass_mode_switching ();
+ }
ix86_add_reg_usage_to_vzerouppers ();
return 0;
}
@@ -1880,8 +1883,10 @@ public:
virtual bool gate (function *)
{
return TARGET_AVX
- && TARGET_VZEROUPPER && flag_expensive_optimizations
- && !optimize_size;
+ && ((TARGET_VZEROUPPER
+ && flag_expensive_optimizations
+ && !optimize_size)
+ || cfun->machine->has_explicit_vzeroupper);
}
virtual unsigned int execute (function *)
diff --git a/gcc/config/i386/i386-options.c b/gcc/config/i386/i386-options.c
index e93935f..7865bc1 100644
--- a/gcc/config/i386/i386-options.c
+++ b/gcc/config/i386/i386-options.c
@@ -743,7 +743,7 @@ static const struct processor_costs *processor_cost_table[] =
&btver2_cost,
&znver1_cost,
&znver2_cost,
- &znver2_cost
+ &znver3_cost
};
/* Guarantee that the array is aligned with enum processor_type. */
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2603333..540d4f4 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -10265,15 +10265,20 @@ darwin_local_data_pic (rtx disp)
&& XINT (disp, 1) == UNSPEC_MACHOPIC_OFFSET);
}
-/* True if operand X should be loaded from GOT. */
+/* True if the function symbol operand X should be loaded from GOT.
+
+ NB: In 32-bit mode, only non-PIC is allowed in inline assembly
+ statements, since a PIC register could not be available at the
+ call site. */
bool
ix86_force_load_from_GOT_p (rtx x)
{
- return ((TARGET_64BIT || HAVE_AS_IX86_GOT32X)
+ return ((TARGET_64BIT || (!flag_pic && HAVE_AS_IX86_GOT32X))
&& !TARGET_PECOFF && !TARGET_MACHO
- && !flag_pic
+ && (!flag_pic || this_is_asm_operands)
&& ix86_cmodel != CM_LARGE
+ && ix86_cmodel != CM_LARGE_PIC
&& GET_CODE (x) == SYMBOL_REF
&& SYMBOL_REF_FUNCTION_P (x)
&& (!flag_plt
@@ -12701,7 +12706,8 @@ print_reg (rtx x, int code, FILE *file)
y -- print "st(0)" instead of "st" as a register.
d -- print duplicated register operand for AVX instruction.
D -- print condition for SSE cmp instruction.
- P -- if PIC, print an @PLT suffix.
+ P -- if PIC, print an @PLT suffix. For -fno-plt, load function
+ address from GOT.
p -- print raw symbol name.
X -- don't print any sort of PIC '@' suffix for a symbol.
& -- print some in-use local-dynamic symbol name.
@@ -13445,7 +13451,23 @@ ix86_print_operand (FILE *file, rtx x, int code)
x = const0_rtx;
}
- if (code != 'P' && code != 'p')
+ if (code == 'P')
+ {
+ if (ix86_force_load_from_GOT_p (x))
+ {
+ /* For inline assembly statement, load function address
+ from GOT with 'P' operand modifier to avoid PLT. */
+ x = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x),
+ (TARGET_64BIT
+ ? UNSPEC_GOTPCREL
+ : UNSPEC_GOT));
+ x = gen_rtx_CONST (Pmode, x);
+ x = gen_const_mem (Pmode, x);
+ ix86_print_operand (file, x, 'A');
+ return;
+ }
+ }
+ else if (code != 'p')
{
if (CONST_INT_P (x))
{
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 69fddca..4874910 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2941,6 +2941,10 @@ struct GTY(()) machine_function {
/* True if the function needs a stack frame. */
BOOL_BITFIELD stack_frame_required : 1;
+ /* True if __builtin_ia32_vzeroupper () has been expanded in current
+ function. */
+ BOOL_BITFIELD has_explicit_vzeroupper : 1;
+
/* The largest alignment, in bytes, of stack slot actually used. */
unsigned int max_used_stack_alignment;
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 2820f6d..9ff35d9 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -5219,6 +5219,18 @@
DONE;
})
+
+;; ix86_split_lea_for_addr emits the shifts as MULT to avoid it from being
+;; peephole2 optimized back into a lea. Split that into the shift during
+;; the following split pass.
+(define_split
+ [(set (match_operand:SWI48 0 "general_reg_operand")
+ (mult:SWI48 (match_dup 0) (match_operand:SWI48 1 "const1248_operand")))
+ (clobber (reg:CC FLAGS_REG))]
+ "reload_completed"
+ [(parallel [(set (match_dup 0) (ashift:SWI48 (match_dup 0) (match_dup 1)))
+ (clobber (reg:CC FLAGS_REG))])]
+ "operands[1] = GEN_INT (exact_log2 (INTVAL (operands[1])));")
;; Add instructions
diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
index c6a2882..4c2b724 100644
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
@@ -61,6 +61,9 @@
(define_mode_attr mmxdoublemode
[(V8QI "V8HI") (V4HI "V4SI")])
+(define_mode_attr Yv_Yw
+ [(V8QI "Yw") (V4HI "Yw") (V2SI "Yv") (V1DI "Yv") (V2SF "Yv")])
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Move patterns
@@ -1152,10 +1155,10 @@
"ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
(define_insn "*mmx_<insn><mode>3"
- [(set (match_operand:MMXMODEI8 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:MMXMODEI8 0 "register_operand" "=y,x,<Yv_Yw>")
(plusminus:MMXMODEI8
- (match_operand:MMXMODEI8 1 "register_mmxmem_operand" "<comm>0,0,Yv")
- (match_operand:MMXMODEI8 2 "register_mmxmem_operand" "ym,x,Yv")))]
+ (match_operand:MMXMODEI8 1 "register_mmxmem_operand" "<comm>0,0,<Yv_Yw>")
+ (match_operand:MMXMODEI8 2 "register_mmxmem_operand" "ym,x,<Yv_Yw>")))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
"@
@@ -1176,10 +1179,10 @@
"ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
(define_insn "*mmx_<insn><mode>3"
- [(set (match_operand:MMXMODE12 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:MMXMODE12 0 "register_operand" "=y,x,Yw")
(sat_plusminus:MMXMODE12
- (match_operand:MMXMODE12 1 "register_mmxmem_operand" "<comm>0,0,Yv")
- (match_operand:MMXMODE12 2 "register_mmxmem_operand" "ym,x,Yv")))]
+ (match_operand:MMXMODE12 1 "register_mmxmem_operand" "<comm>0,0,Yw")
+ (match_operand:MMXMODE12 2 "register_mmxmem_operand" "ym,x,Yw")))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
"@
@@ -1206,9 +1209,9 @@
"ix86_fixup_binary_operands_no_copy (MULT, V4HImode, operands);")
(define_insn "*mmx_mulv4hi3"
- [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yv")
- (mult:V4HI (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yv")
- (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yv")))]
+ [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yw")
+ (mult:V4HI (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yw")
+ (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yw")))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& ix86_binary_operator_ok (MULT, V4HImode, operands)"
"@
@@ -1234,14 +1237,14 @@
"ix86_fixup_binary_operands_no_copy (MULT, V4HImode, operands);")
(define_insn "*mmx_smulv4hi3_highpart"
- [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yw")
(truncate:V4HI
(lshiftrt:V4SI
(mult:V4SI
(sign_extend:V4SI
- (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yv"))
+ (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yw"))
(sign_extend:V4SI
- (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yv")))
+ (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yw")))
(const_int 16))))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& ix86_binary_operator_ok (MULT, V4HImode, operands)"
@@ -1269,14 +1272,14 @@
"ix86_fixup_binary_operands_no_copy (MULT, V4HImode, operands);")
(define_insn "*mmx_umulv4hi3_highpart"
- [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yw")
(truncate:V4HI
(lshiftrt:V4SI
(mult:V4SI
(zero_extend:V4SI
- (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yv"))
+ (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yw"))
(zero_extend:V4SI
- (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yv")))
+ (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yw")))
(const_int 16))))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& (TARGET_SSE || TARGET_3DNOW_A)
@@ -1313,16 +1316,16 @@
"ix86_fixup_binary_operands_no_copy (MULT, V4HImode, operands);")
(define_insn "*mmx_pmaddwd"
- [(set (match_operand:V2SI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V2SI 0 "register_operand" "=y,x,Yw")
(plus:V2SI
(mult:V2SI
(sign_extend:V2SI
(vec_select:V2HI
- (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yv")
+ (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yw")
(parallel [(const_int 0) (const_int 2)])))
(sign_extend:V2SI
(vec_select:V2HI
- (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yv")
+ (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yw")
(parallel [(const_int 0) (const_int 2)]))))
(mult:V2SI
(sign_extend:V2SI
@@ -1432,10 +1435,10 @@
"ix86_fixup_binary_operands_no_copy (<CODE>, V4HImode, operands);")
(define_insn "*mmx_<code>v4hi3"
- [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yw")
(smaxmin:V4HI
- (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yv")
- (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yv")))]
+ (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yw")
+ (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yw")))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& (TARGET_SSE || TARGET_3DNOW_A)
&& ix86_binary_operator_ok (<CODE>, V4HImode, operands)"
@@ -1466,10 +1469,10 @@
"ix86_fixup_binary_operands_no_copy (<CODE>, V8QImode, operands);")
(define_insn "*mmx_<code>v8qi3"
- [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yw")
(umaxmin:V8QI
- (match_operand:V8QI 1 "register_mmxmem_operand" "%0,0,Yv")
- (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yv")))]
+ (match_operand:V8QI 1 "register_mmxmem_operand" "%0,0,Yw")
+ (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yw")))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& (TARGET_SSE || TARGET_3DNOW_A)
&& ix86_binary_operator_ok (<CODE>, V8QImode, operands)"
@@ -1483,10 +1486,10 @@
(set_attr "mode" "DI,TI,TI")])
(define_insn "mmx_ashr<mode>3"
- [(set (match_operand:MMXMODE24 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:MMXMODE24 0 "register_operand" "=y,x,<Yv_Yw>")
(ashiftrt:MMXMODE24
- (match_operand:MMXMODE24 1 "register_operand" "0,0,Yv")
- (match_operand:DI 2 "nonmemory_operand" "yN,xN,YvN")))]
+ (match_operand:MMXMODE24 1 "register_operand" "0,0,<Yv_Yw>")
+ (match_operand:DI 2 "nonmemory_operand" "yN,xN,<Yv_Yw>N")))]
"TARGET_MMX || TARGET_MMX_WITH_SSE"
"@
psra<mmxvecsize>\t{%2, %0|%0, %2}
@@ -1509,10 +1512,10 @@
"TARGET_MMX_WITH_SSE")
(define_insn "mmx_<insn><mode>3"
- [(set (match_operand:MMXMODE248 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:MMXMODE248 0 "register_operand" "=y,x,<Yv_Yw>")
(any_lshift:MMXMODE248
- (match_operand:MMXMODE248 1 "register_operand" "0,0,Yv")
- (match_operand:DI 2 "nonmemory_operand" "yN,xN,YvN")))]
+ (match_operand:MMXMODE248 1 "register_operand" "0,0,<Yv_Yw>")
+ (match_operand:DI 2 "nonmemory_operand" "yN,xN,<Yv_Yw>N")))]
"TARGET_MMX || TARGET_MMX_WITH_SSE"
"@
p<vshift><mmxvecsize>\t{%2, %0|%0, %2}
@@ -1549,10 +1552,10 @@
"ix86_fixup_binary_operands_no_copy (EQ, <MODE>mode, operands);")
(define_insn "*mmx_eq<mode>3"
- [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,x")
(eq:MMXMODEI
- (match_operand:MMXMODEI 1 "register_mmxmem_operand" "%0,0,Yv")
- (match_operand:MMXMODEI 2 "register_mmxmem_operand" "ym,x,Yv")))]
+ (match_operand:MMXMODEI 1 "register_mmxmem_operand" "%0,0,x")
+ (match_operand:MMXMODEI 2 "register_mmxmem_operand" "ym,x,x")))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& ix86_binary_operator_ok (EQ, <MODE>mode, operands)"
"@
@@ -1565,10 +1568,10 @@
(set_attr "mode" "DI,TI,TI")])
(define_insn "mmx_gt<mode>3"
- [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,x")
(gt:MMXMODEI
- (match_operand:MMXMODEI 1 "register_operand" "0,0,Yv")
- (match_operand:MMXMODEI 2 "register_mmxmem_operand" "ym,x,Yv")))]
+ (match_operand:MMXMODEI 1 "register_operand" "0,0,x")
+ (match_operand:MMXMODEI 2 "register_mmxmem_operand" "ym,x,x")))]
"TARGET_MMX || TARGET_MMX_WITH_SSE"
"@
pcmpgt<mmxvecsize>\t{%2, %0|%0, %2}
@@ -1594,19 +1597,20 @@
"operands[2] = force_reg (<MODE>mode, CONSTM1_RTX (<MODE>mode));")
(define_insn "mmx_andnot<mode>3"
- [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,x,v")
(and:MMXMODEI
- (not:MMXMODEI (match_operand:MMXMODEI 1 "register_operand" "0,0,Yv"))
- (match_operand:MMXMODEI 2 "register_mmxmem_operand" "ym,x,Yv")))]
+ (not:MMXMODEI (match_operand:MMXMODEI 1 "register_operand" "0,0,x,v"))
+ (match_operand:MMXMODEI 2 "register_mmxmem_operand" "ym,x,x,v")))]
"TARGET_MMX || TARGET_MMX_WITH_SSE"
"@
pandn\t{%2, %0|%0, %2}
pandn\t{%2, %0|%0, %2}
- vpandn\t{%2, %1, %0|%0, %1, %2}"
- [(set_attr "isa" "*,sse2_noavx,avx")
- (set_attr "mmx_isa" "native,*,*")
- (set_attr "type" "mmxadd,sselog,sselog")
- (set_attr "mode" "DI,TI,TI")])
+ vpandn\t{%2, %1, %0|%0, %1, %2}
+ vpandnd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "isa" "*,sse2_noavx,avx,avx512vl")
+ (set_attr "mmx_isa" "native,*,*,*")
+ (set_attr "type" "mmxadd,sselog,sselog,sselog")
+ (set_attr "mode" "DI,TI,TI,TI")])
(define_expand "mmx_<code><mode>3"
[(set (match_operand:MMXMODEI 0 "register_operand")
@@ -1625,20 +1629,21 @@
"ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
(define_insn "*mmx_<code><mode>3"
- [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,x,v")
(any_logic:MMXMODEI
- (match_operand:MMXMODEI 1 "register_mmxmem_operand" "%0,0,Yv")
- (match_operand:MMXMODEI 2 "register_mmxmem_operand" "ym,x,Yv")))]
+ (match_operand:MMXMODEI 1 "register_mmxmem_operand" "%0,0,x,v")
+ (match_operand:MMXMODEI 2 "register_mmxmem_operand" "ym,x,x,v")))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
"@
p<logic>\t{%2, %0|%0, %2}
p<logic>\t{%2, %0|%0, %2}
- vp<logic>\t{%2, %1, %0|%0, %1, %2}"
- [(set_attr "isa" "*,sse2_noavx,avx")
- (set_attr "mmx_isa" "native,*,*")
- (set_attr "type" "mmxadd,sselog,sselog")
- (set_attr "mode" "DI,TI,TI")])
+ vp<logic>\t{%2, %1, %0|%0, %1, %2}
+ vp<logic>d\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "isa" "*,sse2_noavx,avx,avx512vl")
+ (set_attr "mmx_isa" "native,*,*,*")
+ (set_attr "type" "mmxadd,sselog,sselog,sselog")
+ (set_attr "mode" "DI,TI,TI,TI")])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
@@ -1652,12 +1657,12 @@
(define_code_attr s_trunsuffix [(ss_truncate "s") (us_truncate "u")])
(define_insn_and_split "mmx_pack<s_trunsuffix>swb"
- [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yw")
(vec_concat:V8QI
(any_s_truncate:V4QI
- (match_operand:V4HI 1 "register_operand" "0,0,Yv"))
+ (match_operand:V4HI 1 "register_operand" "0,0,Yw"))
(any_s_truncate:V4QI
- (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yv"))))]
+ (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yw"))))]
"TARGET_MMX || TARGET_MMX_WITH_SSE"
"@
pack<s_trunsuffix>swb\t{%2, %0|%0, %2}
@@ -1672,12 +1677,12 @@
(set_attr "mode" "DI,TI,TI")])
(define_insn_and_split "mmx_packssdw"
- [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yw")
(vec_concat:V4HI
(ss_truncate:V2HI
- (match_operand:V2SI 1 "register_operand" "0,0,Yv"))
+ (match_operand:V2SI 1 "register_operand" "0,0,Yw"))
(ss_truncate:V2HI
- (match_operand:V2SI 2 "register_mmxmem_operand" "ym,x,Yv"))))]
+ (match_operand:V2SI 2 "register_mmxmem_operand" "ym,x,Yw"))))]
"TARGET_MMX || TARGET_MMX_WITH_SSE"
"@
packssdw\t{%2, %0|%0, %2}
@@ -1692,11 +1697,11 @@
(set_attr "mode" "DI,TI,TI")])
(define_insn_and_split "mmx_punpckhbw"
- [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yw")
(vec_select:V8QI
(vec_concat:V16QI
- (match_operand:V8QI 1 "register_operand" "0,0,Yv")
- (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yv"))
+ (match_operand:V8QI 1 "register_operand" "0,0,Yw")
+ (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yw"))
(parallel [(const_int 4) (const_int 12)
(const_int 5) (const_int 13)
(const_int 6) (const_int 14)
@@ -1715,11 +1720,11 @@
(set_attr "mode" "DI,TI,TI")])
(define_insn_and_split "mmx_punpcklbw"
- [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yw")
(vec_select:V8QI
(vec_concat:V16QI
- (match_operand:V8QI 1 "register_operand" "0,0,Yv")
- (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yv"))
+ (match_operand:V8QI 1 "register_operand" "0,0,Yw")
+ (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yw"))
(parallel [(const_int 0) (const_int 8)
(const_int 1) (const_int 9)
(const_int 2) (const_int 10)
@@ -1738,11 +1743,11 @@
(set_attr "mode" "DI,TI,TI")])
(define_insn_and_split "mmx_punpckhwd"
- [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yw")
(vec_select:V4HI
(vec_concat:V8HI
- (match_operand:V4HI 1 "register_operand" "0,0,Yv")
- (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yv"))
+ (match_operand:V4HI 1 "register_operand" "0,0,Yw")
+ (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yw"))
(parallel [(const_int 2) (const_int 6)
(const_int 3) (const_int 7)])))]
"TARGET_MMX || TARGET_MMX_WITH_SSE"
@@ -1759,11 +1764,11 @@
(set_attr "mode" "DI,TI,TI")])
(define_insn_and_split "mmx_punpcklwd"
- [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yw")
(vec_select:V4HI
(vec_concat:V8HI
- (match_operand:V4HI 1 "register_operand" "0,0,Yv")
- (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yv"))
+ (match_operand:V4HI 1 "register_operand" "0,0,Yw")
+ (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yw"))
(parallel [(const_int 0) (const_int 4)
(const_int 1) (const_int 5)])))]
"TARGET_MMX || TARGET_MMX_WITH_SSE"
@@ -1866,11 +1871,11 @@
})
(define_insn "*mmx_pinsrw"
- [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V4HI 0 "register_operand" "=y,x,YW")
(vec_merge:V4HI
(vec_duplicate:V4HI
(match_operand:HI 2 "nonimmediate_operand" "rm,rm,rm"))
- (match_operand:V4HI 1 "register_operand" "0,0,Yv")
+ (match_operand:V4HI 1 "register_operand" "0,0,YW")
(match_operand:SI 3 "const_int_operand")))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& (TARGET_SSE || TARGET_3DNOW_A)
@@ -1902,11 +1907,11 @@
(set_attr "mode" "DI,TI,TI")])
(define_insn "*mmx_pinsrb"
- [(set (match_operand:V8QI 0 "register_operand" "=x,Yv")
+ [(set (match_operand:V8QI 0 "register_operand" "=x,YW")
(vec_merge:V8QI
(vec_duplicate:V8QI
(match_operand:QI 2 "nonimmediate_operand" "rm,rm"))
- (match_operand:V8QI 1 "register_operand" "0,Yv")
+ (match_operand:V8QI 1 "register_operand" "0,YW")
(match_operand:SI 3 "const_int_operand")))]
"TARGET_MMX_WITH_SSE && TARGET_SSE4_1
&& ((unsigned) exact_log2 (INTVAL (operands[3]))
@@ -1940,7 +1945,7 @@
(define_insn "*mmx_pextrw"
[(set (match_operand:HI 0 "register_sse4nonimm_operand" "=r,r,m")
(vec_select:HI
- (match_operand:V4HI 1 "register_operand" "y,Yv,Yv")
+ (match_operand:V4HI 1 "register_operand" "y,YW,YW")
(parallel [(match_operand:SI 2 "const_0_to_3_operand" "n,n,n")])))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& (TARGET_SSE || TARGET_3DNOW_A)"
@@ -1959,7 +1964,7 @@
[(set (match_operand:SWI48 0 "register_operand" "=r,r")
(zero_extend:SWI48
(vec_select:HI
- (match_operand:V4HI 1 "register_operand" "y,Yv")
+ (match_operand:V4HI 1 "register_operand" "y,YW")
(parallel [(match_operand:SI 2 "const_0_to_3_operand" "n,n")]))))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& (TARGET_SSE || TARGET_3DNOW_A)"
@@ -1976,7 +1981,7 @@
(define_insn "*mmx_pextrb"
[(set (match_operand:QI 0 "nonimmediate_operand" "=r,m")
(vec_select:QI
- (match_operand:V8QI 1 "register_operand" "Yv,Yv")
+ (match_operand:V8QI 1 "register_operand" "YW,YW")
(parallel [(match_operand:SI 2 "const_0_to_7_operand" "n,n")])))]
"TARGET_MMX_WITH_SSE && TARGET_SSE4_1"
"@
@@ -1993,7 +1998,7 @@
[(set (match_operand:SWI248 0 "register_operand" "=r")
(zero_extend:SWI248
(vec_select:QI
- (match_operand:V8QI 1 "register_operand" "Yv")
+ (match_operand:V8QI 1 "register_operand" "YW")
(parallel [(match_operand:SI 2 "const_0_to_7_operand" "n")]))))]
"TARGET_MMX_WITH_SSE && TARGET_SSE4_1"
"%vpextrb\t{%2, %1, %k0|%k0, %1, %2}"
@@ -2394,15 +2399,15 @@
})
(define_insn "*mmx_uavgv8qi3"
- [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V8QI 0 "register_operand" "=y,x,Yw")
(truncate:V8QI
(lshiftrt:V8HI
(plus:V8HI
(plus:V8HI
(zero_extend:V8HI
- (match_operand:V8QI 1 "register_mmxmem_operand" "%0,0,Yv"))
+ (match_operand:V8QI 1 "register_mmxmem_operand" "%0,0,Yw"))
(zero_extend:V8HI
- (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yv")))
+ (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yw")))
(const_vector:V8HI [(const_int 1) (const_int 1)
(const_int 1) (const_int 1)
(const_int 1) (const_int 1)
@@ -2440,15 +2445,15 @@
(set_attr "mode" "DI,TI,TI")])
(define_insn "*mmx_uavgv4hi3"
- [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yv")
+ [(set (match_operand:V4HI 0 "register_operand" "=y,x,Yw")
(truncate:V4HI
(lshiftrt:V4SI
(plus:V4SI
(plus:V4SI
(zero_extend:V4SI
- (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yv"))
+ (match_operand:V4HI 1 "register_mmxmem_operand" "%0,0,Yw"))
(zero_extend:V4SI
- (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yv")))
+ (match_operand:V4HI 2 "register_mmxmem_operand" "ym,x,Yw")))
(const_vector:V4SI [(const_int 1) (const_int 1)
(const_int 1) (const_int 1)]))
(const_int 1))))]
@@ -2483,9 +2488,9 @@
})
(define_insn "mmx_psadbw"
- [(set (match_operand:V1DI 0 "register_operand" "=y,x,Yv")
- (unspec:V1DI [(match_operand:V8QI 1 "register_operand" "0,0,Yv")
- (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yv")]
+ [(set (match_operand:V1DI 0 "register_operand" "=y,x,Yw")
+ (unspec:V1DI [(match_operand:V8QI 1 "register_operand" "0,0,Yw")
+ (match_operand:V8QI 2 "register_mmxmem_operand" "ym,x,Yw")]
UNSPEC_PSADBW))]
"(TARGET_MMX || TARGET_MMX_WITH_SSE)
&& (TARGET_SSE || TARGET_3DNOW_A)"
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index ca4372d..43e4d57 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -566,7 +566,8 @@
(V4SI "v") (V8SI "v") (V16SI "v")
(V2DI "v") (V4DI "v") (V8DI "v")
(V4SF "v") (V8SF "v") (V16SF "v")
- (V2DF "v") (V4DF "v") (V8DF "v")])
+ (V2DF "v") (V4DF "v") (V8DF "v")
+ (TI "Yw") (V1TI "Yw") (V2TI "Yw") (V4TI "v")])
(define_mode_attr sse2_avx_avx512f
[(V16QI "sse2") (V32QI "avx") (V64QI "avx512f")
@@ -11736,10 +11737,10 @@
"ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
(define_insn "*<sse2_avx2>_<insn><mode>3<mask_name>"
- [(set (match_operand:VI12_AVX2_AVX512BW 0 "register_operand" "=x,v")
+ [(set (match_operand:VI12_AVX2_AVX512BW 0 "register_operand" "=x,<v_Yw>")
(sat_plusminus:VI12_AVX2_AVX512BW
- (match_operand:VI12_AVX2_AVX512BW 1 "vector_operand" "<comm>0,v")
- (match_operand:VI12_AVX2_AVX512BW 2 "vector_operand" "xBm,vm")))]
+ (match_operand:VI12_AVX2_AVX512BW 1 "vector_operand" "<comm>0,<v_Yw>")
+ (match_operand:VI12_AVX2_AVX512BW 2 "vector_operand" "xBm,<v_Yw>m")))]
"TARGET_SSE2 && <mask_mode512bit_condition> && <mask_avx512bw_condition>
&& ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
"@
@@ -11827,14 +11828,14 @@
"ix86_fixup_binary_operands_no_copy (MULT, <MODE>mode, operands);")
(define_insn "*<s>mul<mode>3_highpart<mask_name>"
- [(set (match_operand:VI2_AVX2 0 "register_operand" "=x,v")
+ [(set (match_operand:VI2_AVX2 0 "register_operand" "=x,<v_Yw>")
(truncate:VI2_AVX2
(lshiftrt:<ssedoublemode>
(mult:<ssedoublemode>
(any_extend:<ssedoublemode>
- (match_operand:VI2_AVX2 1 "vector_operand" "%0,v"))
+ (match_operand:VI2_AVX2 1 "vector_operand" "%0,<v_Yw>"))
(any_extend:<ssedoublemode>
- (match_operand:VI2_AVX2 2 "vector_operand" "xBm,vm")))
+ (match_operand:VI2_AVX2 2 "vector_operand" "xBm,<v_Yw>m")))
(const_int 16))))]
"TARGET_SSE2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))
&& <mask_mode512bit_condition> && <mask_avx512bw_condition>"
@@ -12128,19 +12129,19 @@
"ix86_fixup_binary_operands_no_copy (MULT, V16HImode, operands);")
(define_insn "*avx2_pmaddwd"
- [(set (match_operand:V8SI 0 "register_operand" "=x,v")
+ [(set (match_operand:V8SI 0 "register_operand" "=Yw")
(plus:V8SI
(mult:V8SI
(sign_extend:V8SI
(vec_select:V8HI
- (match_operand:V16HI 1 "nonimmediate_operand" "%x,v")
+ (match_operand:V16HI 1 "nonimmediate_operand" "%Yw")
(parallel [(const_int 0) (const_int 2)
(const_int 4) (const_int 6)
(const_int 8) (const_int 10)
(const_int 12) (const_int 14)])))
(sign_extend:V8SI
(vec_select:V8HI
- (match_operand:V16HI 2 "nonimmediate_operand" "xm,vm")
+ (match_operand:V16HI 2 "nonimmediate_operand" "Ywm")
(parallel [(const_int 0) (const_int 2)
(const_int 4) (const_int 6)
(const_int 8) (const_int 10)
@@ -12161,8 +12162,7 @@
"TARGET_AVX2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"vpmaddwd\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sseiadd")
- (set_attr "isa" "*,avx512bw")
- (set_attr "prefix" "vex,evex")
+ (set_attr "prefix" "vex")
(set_attr "mode" "OI")])
(define_expand "sse2_pmaddwd"
@@ -12192,17 +12192,17 @@
"ix86_fixup_binary_operands_no_copy (MULT, V8HImode, operands);")
(define_insn "*sse2_pmaddwd"
- [(set (match_operand:V4SI 0 "register_operand" "=x,x,v")
+ [(set (match_operand:V4SI 0 "register_operand" "=x,Yw")
(plus:V4SI
(mult:V4SI
(sign_extend:V4SI
(vec_select:V4HI
- (match_operand:V8HI 1 "vector_operand" "%0,x,v")
+ (match_operand:V8HI 1 "vector_operand" "%0,Yw")
(parallel [(const_int 0) (const_int 2)
(const_int 4) (const_int 6)])))
(sign_extend:V4SI
(vec_select:V4HI
- (match_operand:V8HI 2 "vector_operand" "xBm,xm,vm")
+ (match_operand:V8HI 2 "vector_operand" "xBm,Ywm")
(parallel [(const_int 0) (const_int 2)
(const_int 4) (const_int 6)]))))
(mult:V4SI
@@ -12217,13 +12217,12 @@
"TARGET_SSE2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
pmaddwd\t{%2, %0|%0, %2}
- vpmaddwd\t{%2, %1, %0|%0, %1, %2}
vpmaddwd\t{%2, %1, %0|%0, %1, %2}"
- [(set_attr "isa" "noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,avx")
(set_attr "type" "sseiadd")
(set_attr "atom_unit" "simul")
- (set_attr "prefix_data16" "1,*,*")
- (set_attr "prefix" "orig,vex,evex")
+ (set_attr "prefix_data16" "1,*")
+ (set_attr "prefix" "orig,vex")
(set_attr "mode" "TI")])
(define_insn "avx512dq_mul<mode>3<mask_name>"
@@ -12449,10 +12448,10 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "ashr<mode>3"
- [(set (match_operand:VI24_AVX2 0 "register_operand" "=x,x")
+ [(set (match_operand:VI24_AVX2 0 "register_operand" "=x,<v_Yw>")
(ashiftrt:VI24_AVX2
- (match_operand:VI24_AVX2 1 "register_operand" "0,x")
- (match_operand:DI 2 "nonmemory_operand" "xN,xN")))]
+ (match_operand:VI24_AVX2 1 "register_operand" "0,<v_Yw>")
+ (match_operand:DI 2 "nonmemory_operand" "xN,YwN")))]
"TARGET_SSE2"
"@
psra<ssemodesuffix>\t{%2, %0|%0, %2}
@@ -12496,10 +12495,10 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<insn><mode>3"
- [(set (match_operand:VI248_AVX2 0 "register_operand" "=x,x")
+ [(set (match_operand:VI248_AVX2 0 "register_operand" "=x,<v_Yw>")
(any_lshift:VI248_AVX2
- (match_operand:VI248_AVX2 1 "register_operand" "0,x")
- (match_operand:DI 2 "nonmemory_operand" "xN,xN")))]
+ (match_operand:VI248_AVX2 1 "register_operand" "0,<v_Yw>")
+ (match_operand:DI 2 "nonmemory_operand" "xN,YwN")))]
"TARGET_SSE2"
"@
p<vshift><ssemodesuffix>\t{%2, %0|%0, %2}
@@ -12571,9 +12570,9 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<sse2_avx2>_<insn><mode>3"
- [(set (match_operand:VIMAX_AVX2 0 "register_operand" "=x,v")
+ [(set (match_operand:VIMAX_AVX2 0 "register_operand" "=x,Yw")
(any_lshift:VIMAX_AVX2
- (match_operand:VIMAX_AVX2 1 "register_operand" "0,v")
+ (match_operand:VIMAX_AVX2 1 "register_operand" "0,Yw")
(match_operand:SI 2 "const_0_to_255_mul_8_operand" "n,n")))]
"TARGET_SSE2"
{
@@ -12771,20 +12770,19 @@
(set_attr "mode" "TI")])
(define_insn "*<code>v8hi3"
- [(set (match_operand:V8HI 0 "register_operand" "=x,x,v")
+ [(set (match_operand:V8HI 0 "register_operand" "=x,Yw")
(smaxmin:V8HI
- (match_operand:V8HI 1 "vector_operand" "%0,x,v")
- (match_operand:V8HI 2 "vector_operand" "xBm,xm,vm")))]
+ (match_operand:V8HI 1 "vector_operand" "%0,Yw")
+ (match_operand:V8HI 2 "vector_operand" "xBm,Ywm")))]
"TARGET_SSE2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
p<maxmin_int>w\t{%2, %0|%0, %2}
- vp<maxmin_int>w\t{%2, %1, %0|%0, %1, %2}
vp<maxmin_int>w\t{%2, %1, %0|%0, %1, %2}"
- [(set_attr "isa" "noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,avx")
(set_attr "type" "sseiadd")
- (set_attr "prefix_data16" "1,*,*")
- (set_attr "prefix_extra" "*,1,1")
- (set_attr "prefix" "orig,vex,evex")
+ (set_attr "prefix_data16" "1,*")
+ (set_attr "prefix_extra" "*,1")
+ (set_attr "prefix" "orig,vex")
(set_attr "mode" "TI")])
(define_expand "<code><mode>3"
@@ -12856,20 +12854,19 @@
(set_attr "mode" "TI")])
(define_insn "*<code>v16qi3"
- [(set (match_operand:V16QI 0 "register_operand" "=x,x,v")
+ [(set (match_operand:V16QI 0 "register_operand" "=x,Yw")
(umaxmin:V16QI
- (match_operand:V16QI 1 "vector_operand" "%0,x,v")
- (match_operand:V16QI 2 "vector_operand" "xBm,xm,vm")))]
+ (match_operand:V16QI 1 "vector_operand" "%0,Yw")
+ (match_operand:V16QI 2 "vector_operand" "xBm,Ywm")))]
"TARGET_SSE2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
p<maxmin_int>b\t{%2, %0|%0, %2}
- vp<maxmin_int>b\t{%2, %1, %0|%0, %1, %2}
vp<maxmin_int>b\t{%2, %1, %0|%0, %1, %2}"
- [(set_attr "isa" "noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,avx")
(set_attr "type" "sseiadd")
- (set_attr "prefix_data16" "1,*,*")
- (set_attr "prefix_extra" "*,1,1")
- (set_attr "prefix" "orig,vex,evex")
+ (set_attr "prefix_data16" "1,*")
+ (set_attr "prefix_extra" "*,1")
+ (set_attr "prefix" "orig,vex")
(set_attr "mode" "TI")])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -13888,57 +13885,54 @@
})
(define_insn "<sse2_avx2>_packsswb<mask_name>"
- [(set (match_operand:VI1_AVX512 0 "register_operand" "=x,x,v")
+ [(set (match_operand:VI1_AVX512 0 "register_operand" "=x,<v_Yw>")
(vec_concat:VI1_AVX512
(ss_truncate:<ssehalfvecmode>
- (match_operand:<sseunpackmode> 1 "register_operand" "0,x,v"))
+ (match_operand:<sseunpackmode> 1 "register_operand" "0,<v_Yw>"))
(ss_truncate:<ssehalfvecmode>
- (match_operand:<sseunpackmode> 2 "vector_operand" "xBm,xm,vm"))))]
+ (match_operand:<sseunpackmode> 2 "vector_operand" "xBm,<v_Yw>m"))))]
"TARGET_SSE2 && <mask_mode512bit_condition> && <mask_avx512bw_condition>"
"@
packsswb\t{%2, %0|%0, %2}
- vpacksswb\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}
vpacksswb\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
- [(set_attr "isa" "noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,avx")
(set_attr "type" "sselog")
- (set_attr "prefix_data16" "1,*,*")
- (set_attr "prefix" "orig,<mask_prefix>,evex")
+ (set_attr "prefix_data16" "1,*")
+ (set_attr "prefix" "orig,<mask_prefix>")
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<sse2_avx2>_packssdw<mask_name>"
- [(set (match_operand:VI2_AVX2 0 "register_operand" "=x,x,v")
+ [(set (match_operand:VI2_AVX2 0 "register_operand" "=x,<v_Yw>")
(vec_concat:VI2_AVX2
(ss_truncate:<ssehalfvecmode>
- (match_operand:<sseunpackmode> 1 "register_operand" "0,x,v"))
+ (match_operand:<sseunpackmode> 1 "register_operand" "0,<v_Yw>"))
(ss_truncate:<ssehalfvecmode>
- (match_operand:<sseunpackmode> 2 "vector_operand" "xBm,xm,vm"))))]
+ (match_operand:<sseunpackmode> 2 "vector_operand" "xBm,<v_Yw>m"))))]
"TARGET_SSE2 && <mask_mode512bit_condition> && <mask_avx512bw_condition>"
"@
packssdw\t{%2, %0|%0, %2}
- vpackssdw\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}
vpackssdw\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
- [(set_attr "isa" "noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,avx")
(set_attr "type" "sselog")
- (set_attr "prefix_data16" "1,*,*")
- (set_attr "prefix" "orig,<mask_prefix>,evex")
+ (set_attr "prefix_data16" "1,*")
+ (set_attr "prefix" "orig,<mask_prefix>")
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<sse2_avx2>_packuswb<mask_name>"
- [(set (match_operand:VI1_AVX512 0 "register_operand" "=x,x,v")
+ [(set (match_operand:VI1_AVX512 0 "register_operand" "=x,<v_Yw>")
(vec_concat:VI1_AVX512
(us_truncate:<ssehalfvecmode>
- (match_operand:<sseunpackmode> 1 "register_operand" "0,x,v"))
+ (match_operand:<sseunpackmode> 1 "register_operand" "0,<v_Yw>"))
(us_truncate:<ssehalfvecmode>
- (match_operand:<sseunpackmode> 2 "vector_operand" "xBm,xm,vm"))))]
+ (match_operand:<sseunpackmode> 2 "vector_operand" "xBm,<v_Yw>m"))))]
"TARGET_SSE2 && <mask_mode512bit_condition> && <mask_avx512bw_condition>"
"@
packuswb\t{%2, %0|%0, %2}
- vpackuswb\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}
vpackuswb\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
- [(set_attr "isa" "noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,avx")
(set_attr "type" "sselog")
- (set_attr "prefix_data16" "1,*,*")
- (set_attr "prefix" "orig,<mask_prefix>,evex")
+ (set_attr "prefix_data16" "1,*")
+ (set_attr "prefix" "orig,<mask_prefix>")
(set_attr "mode" "<sseinsnmode>")])
(define_insn "avx512bw_interleave_highv64qi<mask_name>"
@@ -13986,11 +13980,11 @@
(set_attr "mode" "XI")])
(define_insn "avx2_interleave_highv32qi<mask_name>"
- [(set (match_operand:V32QI 0 "register_operand" "=v")
+ [(set (match_operand:V32QI 0 "register_operand" "=Yw")
(vec_select:V32QI
(vec_concat:V64QI
- (match_operand:V32QI 1 "register_operand" "v")
- (match_operand:V32QI 2 "nonimmediate_operand" "vm"))
+ (match_operand:V32QI 1 "register_operand" "Yw")
+ (match_operand:V32QI 2 "nonimmediate_operand" "Ywm"))
(parallel [(const_int 8) (const_int 40)
(const_int 9) (const_int 41)
(const_int 10) (const_int 42)
@@ -14007,18 +14001,18 @@
(const_int 29) (const_int 61)
(const_int 30) (const_int 62)
(const_int 31) (const_int 63)])))]
- "TARGET_AVX2 && <mask_avx512vl_condition>"
+ "TARGET_AVX2 && <mask_avx512vl_condition> && <mask_avx512bw_condition>"
"vpunpckhbw\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
[(set_attr "type" "sselog")
(set_attr "prefix" "<mask_prefix>")
(set_attr "mode" "OI")])
(define_insn "vec_interleave_highv16qi<mask_name>"
- [(set (match_operand:V16QI 0 "register_operand" "=x,v")
+ [(set (match_operand:V16QI 0 "register_operand" "=x,Yw")
(vec_select:V16QI
(vec_concat:V32QI
- (match_operand:V16QI 1 "register_operand" "0,v")
- (match_operand:V16QI 2 "vector_operand" "xBm,vm"))
+ (match_operand:V16QI 1 "register_operand" "0,Yw")
+ (match_operand:V16QI 2 "vector_operand" "xBm,Ywm"))
(parallel [(const_int 8) (const_int 24)
(const_int 9) (const_int 25)
(const_int 10) (const_int 26)
@@ -14027,7 +14021,7 @@
(const_int 13) (const_int 29)
(const_int 14) (const_int 30)
(const_int 15) (const_int 31)])))]
- "TARGET_SSE2 && <mask_avx512vl_condition>"
+ "TARGET_SSE2 && <mask_avx512vl_condition> && <mask_avx512bw_condition>"
"@
punpckhbw\t{%2, %0|%0, %2}
vpunpckhbw\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
@@ -14082,11 +14076,11 @@
(set_attr "mode" "XI")])
(define_insn "avx2_interleave_lowv32qi<mask_name>"
- [(set (match_operand:V32QI 0 "register_operand" "=v")
+ [(set (match_operand:V32QI 0 "register_operand" "=Yw")
(vec_select:V32QI
(vec_concat:V64QI
- (match_operand:V32QI 1 "register_operand" "v")
- (match_operand:V32QI 2 "nonimmediate_operand" "vm"))
+ (match_operand:V32QI 1 "register_operand" "Yw")
+ (match_operand:V32QI 2 "nonimmediate_operand" "Ywm"))
(parallel [(const_int 0) (const_int 32)
(const_int 1) (const_int 33)
(const_int 2) (const_int 34)
@@ -14110,11 +14104,11 @@
(set_attr "mode" "OI")])
(define_insn "vec_interleave_lowv16qi<mask_name>"
- [(set (match_operand:V16QI 0 "register_operand" "=x,v")
+ [(set (match_operand:V16QI 0 "register_operand" "=x,Yw")
(vec_select:V16QI
(vec_concat:V32QI
- (match_operand:V16QI 1 "register_operand" "0,v")
- (match_operand:V16QI 2 "vector_operand" "xBm,vm"))
+ (match_operand:V16QI 1 "register_operand" "0,Yw")
+ (match_operand:V16QI 2 "vector_operand" "xBm,Ywm"))
(parallel [(const_int 0) (const_int 16)
(const_int 1) (const_int 17)
(const_int 2) (const_int 18)
@@ -14162,11 +14156,11 @@
(set_attr "mode" "XI")])
(define_insn "avx2_interleave_highv16hi<mask_name>"
- [(set (match_operand:V16HI 0 "register_operand" "=v")
+ [(set (match_operand:V16HI 0 "register_operand" "=Yw")
(vec_select:V16HI
(vec_concat:V32HI
- (match_operand:V16HI 1 "register_operand" "v")
- (match_operand:V16HI 2 "nonimmediate_operand" "vm"))
+ (match_operand:V16HI 1 "register_operand" "Yw")
+ (match_operand:V16HI 2 "nonimmediate_operand" "Ywm"))
(parallel [(const_int 4) (const_int 20)
(const_int 5) (const_int 21)
(const_int 6) (const_int 22)
@@ -14182,11 +14176,11 @@
(set_attr "mode" "OI")])
(define_insn "vec_interleave_highv8hi<mask_name>"
- [(set (match_operand:V8HI 0 "register_operand" "=x,v")
+ [(set (match_operand:V8HI 0 "register_operand" "=x,Yw")
(vec_select:V8HI
(vec_concat:V16HI
- (match_operand:V8HI 1 "register_operand" "0,v")
- (match_operand:V8HI 2 "vector_operand" "xBm,vm"))
+ (match_operand:V8HI 1 "register_operand" "0,Yw")
+ (match_operand:V8HI 2 "vector_operand" "xBm,Ywm"))
(parallel [(const_int 4) (const_int 12)
(const_int 5) (const_int 13)
(const_int 6) (const_int 14)
@@ -14230,11 +14224,11 @@
(set_attr "mode" "XI")])
(define_insn "avx2_interleave_lowv16hi<mask_name>"
- [(set (match_operand:V16HI 0 "register_operand" "=v")
+ [(set (match_operand:V16HI 0 "register_operand" "=Yw")
(vec_select:V16HI
(vec_concat:V32HI
- (match_operand:V16HI 1 "register_operand" "v")
- (match_operand:V16HI 2 "nonimmediate_operand" "vm"))
+ (match_operand:V16HI 1 "register_operand" "Yw")
+ (match_operand:V16HI 2 "nonimmediate_operand" "Ywm"))
(parallel [(const_int 0) (const_int 16)
(const_int 1) (const_int 17)
(const_int 2) (const_int 18)
@@ -14250,11 +14244,11 @@
(set_attr "mode" "OI")])
(define_insn "vec_interleave_lowv8hi<mask_name>"
- [(set (match_operand:V8HI 0 "register_operand" "=x,v")
+ [(set (match_operand:V8HI 0 "register_operand" "=x,Yw")
(vec_select:V8HI
(vec_concat:V16HI
- (match_operand:V8HI 1 "register_operand" "0,v")
- (match_operand:V8HI 2 "vector_operand" "xBm,vm"))
+ (match_operand:V8HI 1 "register_operand" "0,Yw")
+ (match_operand:V8HI 2 "vector_operand" "xBm,Ywm"))
(parallel [(const_int 0) (const_int 8)
(const_int 1) (const_int 9)
(const_int 2) (const_int 10)
@@ -15190,9 +15184,9 @@
})
(define_insn "avx2_pshuflw_1<mask_name>"
- [(set (match_operand:V16HI 0 "register_operand" "=v")
+ [(set (match_operand:V16HI 0 "register_operand" "=Yw")
(vec_select:V16HI
- (match_operand:V16HI 1 "nonimmediate_operand" "vm")
+ (match_operand:V16HI 1 "nonimmediate_operand" "Ywm")
(parallel [(match_operand 2 "const_0_to_3_operand")
(match_operand 3 "const_0_to_3_operand")
(match_operand 4 "const_0_to_3_operand")
@@ -15264,9 +15258,9 @@
})
(define_insn "sse2_pshuflw_1<mask_name>"
- [(set (match_operand:V8HI 0 "register_operand" "=v")
+ [(set (match_operand:V8HI 0 "register_operand" "=Yw")
(vec_select:V8HI
- (match_operand:V8HI 1 "vector_operand" "vBm")
+ (match_operand:V8HI 1 "vector_operand" "YwBm")
(parallel [(match_operand 2 "const_0_to_3_operand")
(match_operand 3 "const_0_to_3_operand")
(match_operand 4 "const_0_to_3_operand")
@@ -15347,9 +15341,9 @@
})
(define_insn "avx2_pshufhw_1<mask_name>"
- [(set (match_operand:V16HI 0 "register_operand" "=v")
+ [(set (match_operand:V16HI 0 "register_operand" "=Yw")
(vec_select:V16HI
- (match_operand:V16HI 1 "nonimmediate_operand" "vm")
+ (match_operand:V16HI 1 "nonimmediate_operand" "Ywm")
(parallel [(const_int 0)
(const_int 1)
(const_int 2)
@@ -15421,9 +15415,9 @@
})
(define_insn "sse2_pshufhw_1<mask_name>"
- [(set (match_operand:V8HI 0 "register_operand" "=v")
+ [(set (match_operand:V8HI 0 "register_operand" "=Yw")
(vec_select:V8HI
- (match_operand:V8HI 1 "vector_operand" "vBm")
+ (match_operand:V8HI 1 "vector_operand" "YwBm")
(parallel [(const_int 0)
(const_int 1)
(const_int 2)
@@ -15489,18 +15483,16 @@
[(V16QI "TARGET_SSE4_1") V8HI])
(define_insn "*vec_extract<mode>"
- [(set (match_operand:<ssescalarmode> 0 "register_sse4nonimm_operand" "=r,m,r,m")
+ [(set (match_operand:<ssescalarmode> 0 "register_sse4nonimm_operand" "=r,m")
(vec_select:<ssescalarmode>
- (match_operand:PEXTR_MODE12 1 "register_operand" "x,x,v,v")
+ (match_operand:PEXTR_MODE12 1 "register_operand" "YW,YW")
(parallel
[(match_operand:SI 2 "const_0_to_<ssescalarnummask>_operand")])))]
"TARGET_SSE2"
"@
%vpextr<ssemodesuffix>\t{%2, %1, %k0|%k0, %1, %2}
- %vpextr<ssemodesuffix>\t{%2, %1, %0|%0, %1, %2}
- vpextr<ssemodesuffix>\t{%2, %1, %k0|%k0, %1, %2}
- vpextr<ssemodesuffix>\t{%2, %1, %0|%0, %1, %2}"
- [(set_attr "isa" "*,sse4,avx512bw,avx512bw")
+ %vpextr<ssemodesuffix>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "isa" "*,sse4")
(set_attr "type" "sselog1")
(set_attr "prefix_data16" "1")
(set (attr "prefix_extra")
@@ -15510,23 +15502,20 @@
(const_string "*")
(const_string "1")))
(set_attr "length_immediate" "1")
- (set_attr "prefix" "maybe_vex,maybe_vex,evex,evex")
+ (set_attr "prefix" "maybe_vex,maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*vec_extract<PEXTR_MODE12:mode>_zext"
- [(set (match_operand:SWI48 0 "register_operand" "=r,r")
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
(zero_extend:SWI48
(vec_select:<PEXTR_MODE12:ssescalarmode>
- (match_operand:PEXTR_MODE12 1 "register_operand" "x,v")
+ (match_operand:PEXTR_MODE12 1 "register_operand" "YW")
(parallel
[(match_operand:SI 2
"const_0_to_<PEXTR_MODE12:ssescalarnummask>_operand")]))))]
"TARGET_SSE2"
- "@
- %vpextr<PEXTR_MODE12:ssemodesuffix>\t{%2, %1, %k0|%k0, %1, %2}
- vpextr<PEXTR_MODE12:ssemodesuffix>\t{%2, %1, %k0|%k0, %1, %2}"
- [(set_attr "isa" "*,avx512bw")
- (set_attr "type" "sselog1")
+ "%vpextr<PEXTR_MODE12:ssemodesuffix>\t{%2, %1, %k0|%k0, %1, %2}"
+ [(set_attr "type" "sselog1")
(set_attr "prefix_data16" "1")
(set (attr "prefix_extra")
(if_then_else
@@ -15538,18 +15527,15 @@
(set_attr "mode" "TI")])
(define_insn "*vec_extractv16qi_zext"
- [(set (match_operand:HI 0 "register_operand" "=r,r")
+ [(set (match_operand:HI 0 "register_operand" "=r")
(zero_extend:HI
(vec_select:QI
- (match_operand:V16QI 1 "register_operand" "x,v")
+ (match_operand:V16QI 1 "register_operand" "YW")
(parallel
[(match_operand:SI 2 "const_0_to_15_operand")]))))]
"TARGET_SSE4_1"
- "@
- %vpextrb\t{%2, %1, %k0|%k0, %1, %2}
- vpextrb\t{%2, %1, %k0|%k0, %1, %2}"
- [(set_attr "isa" "*,avx512bw")
- (set_attr "type" "sselog1")
+ "%vpextrb\t{%2, %1, %k0|%k0, %1, %2}"
+ [(set_attr "type" "sselog1")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
@@ -15656,9 +15642,9 @@
"operands[1] = gen_lowpart (SImode, operands[1]);")
(define_insn "*vec_extractv4si"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm,Yr,*x,x,Yv")
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,rm,Yr,*x,Yw")
(vec_select:SI
- (match_operand:V4SI 1 "register_operand" "x,v,0,0,x,v")
+ (match_operand:V4SI 1 "register_operand" " x, v, 0, 0,Yw")
(parallel [(match_operand:SI 2 "const_0_to_3_operand")])))]
"TARGET_SSE4_1"
{
@@ -15674,7 +15660,6 @@
return "psrldq\t{%2, %0|%0, %2}";
case 4:
- case 5:
operands[2] = GEN_INT (INTVAL (operands[2]) * 4);
return "vpsrldq\t{%2, %1, %0|%0, %1, %2}";
@@ -15682,14 +15667,14 @@
gcc_unreachable ();
}
}
- [(set_attr "isa" "*,avx512dq,noavx,noavx,avx,avx512bw")
- (set_attr "type" "sselog1,sselog1,sseishft1,sseishft1,sseishft1,sseishft1")
+ [(set_attr "isa" "*,avx512dq,noavx,noavx,avx")
+ (set_attr "type" "sselog1,sselog1,sseishft1,sseishft1,sseishft1")
(set (attr "prefix_extra")
(if_then_else (eq_attr "alternative" "0,1")
(const_string "1")
(const_string "*")))
(set_attr "length_immediate" "1")
- (set_attr "prefix" "maybe_vex,evex,orig,orig,vex,evex")
+ (set_attr "prefix" "maybe_vex,evex,orig,orig,maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*vec_extractv4si_zext"
@@ -16213,15 +16198,15 @@
})
(define_insn "*<sse2_avx2>_uavg<mode>3<mask_name>"
- [(set (match_operand:VI12_AVX2_AVX512BW 0 "register_operand" "=x,v")
+ [(set (match_operand:VI12_AVX2_AVX512BW 0 "register_operand" "=x,<v_Yw>")
(truncate:VI12_AVX2_AVX512BW
(lshiftrt:<ssedoublemode>
(plus:<ssedoublemode>
(plus:<ssedoublemode>
(zero_extend:<ssedoublemode>
- (match_operand:VI12_AVX2_AVX512BW 1 "vector_operand" "%0,v"))
+ (match_operand:VI12_AVX2_AVX512BW 1 "vector_operand" "%0,<v_Yw>"))
(zero_extend:<ssedoublemode>
- (match_operand:VI12_AVX2_AVX512BW 2 "vector_operand" "xBm,vm")))
+ (match_operand:VI12_AVX2_AVX512BW 2 "vector_operand" "xBm,<v_Yw>m")))
(match_operand:<ssedoublemode> <mask_expand_op3> "const1_operand"))
(const_int 1))))]
"TARGET_SSE2 && <mask_mode512bit_condition> && <mask_avx512bw_condition>
@@ -16238,10 +16223,10 @@
;; The correct representation for this is absolutely enormous, and
;; surely not generally useful.
(define_insn "<sse2_avx2>_psadbw"
- [(set (match_operand:VI8_AVX2_AVX512BW 0 "register_operand" "=x,v")
+ [(set (match_operand:VI8_AVX2_AVX512BW 0 "register_operand" "=x,YW")
(unspec:VI8_AVX2_AVX512BW
- [(match_operand:<ssebytemode> 1 "register_operand" "0,v")
- (match_operand:<ssebytemode> 2 "vector_operand" "xBm,vm")]
+ [(match_operand:<ssebytemode> 1 "register_operand" "0,YW")
+ (match_operand:<ssebytemode> 2 "vector_operand" "xBm,YWm")]
UNSPEC_PSADBW))]
"TARGET_SSE2"
"@
@@ -16815,12 +16800,12 @@
(set_attr "mode" "DI,TI,TI")])
(define_insn "avx2_pmaddubsw256"
- [(set (match_operand:V16HI 0 "register_operand" "=x,v")
+ [(set (match_operand:V16HI 0 "register_operand" "=Yw")
(ss_plus:V16HI
(mult:V16HI
(zero_extend:V16HI
(vec_select:V16QI
- (match_operand:V32QI 1 "register_operand" "x,v")
+ (match_operand:V32QI 1 "register_operand" "Yw")
(parallel [(const_int 0) (const_int 2)
(const_int 4) (const_int 6)
(const_int 8) (const_int 10)
@@ -16831,7 +16816,7 @@
(const_int 28) (const_int 30)])))
(sign_extend:V16HI
(vec_select:V16QI
- (match_operand:V32QI 2 "nonimmediate_operand" "xm,vm")
+ (match_operand:V32QI 2 "nonimmediate_operand" "Ywm")
(parallel [(const_int 0) (const_int 2)
(const_int 4) (const_int 6)
(const_int 8) (const_int 10)
@@ -16863,10 +16848,9 @@
(const_int 29) (const_int 31)]))))))]
"TARGET_AVX2"
"vpmaddubsw\t{%2, %1, %0|%0, %1, %2}"
- [(set_attr "isa" "*,avx512bw")
- (set_attr "type" "sseiadd")
+ [(set_attr "type" "sseiadd")
(set_attr "prefix_extra" "1")
- (set_attr "prefix" "vex,evex")
+ (set_attr "prefix" "vex")
(set_attr "mode" "OI")])
;; The correct representation for this is absolutely enormous, and
@@ -16919,19 +16903,19 @@
(set_attr "mode" "XI")])
(define_insn "ssse3_pmaddubsw128"
- [(set (match_operand:V8HI 0 "register_operand" "=x,x,v")
+ [(set (match_operand:V8HI 0 "register_operand" "=x,Yw")
(ss_plus:V8HI
(mult:V8HI
(zero_extend:V8HI
(vec_select:V8QI
- (match_operand:V16QI 1 "register_operand" "0,x,v")
+ (match_operand:V16QI 1 "register_operand" "0,Yw")
(parallel [(const_int 0) (const_int 2)
(const_int 4) (const_int 6)
(const_int 8) (const_int 10)
(const_int 12) (const_int 14)])))
(sign_extend:V8HI
(vec_select:V8QI
- (match_operand:V16QI 2 "vector_operand" "xBm,xm,vm")
+ (match_operand:V16QI 2 "vector_operand" "xBm,Ywm")
(parallel [(const_int 0) (const_int 2)
(const_int 4) (const_int 6)
(const_int 8) (const_int 10)
@@ -16952,14 +16936,13 @@
"TARGET_SSSE3"
"@
pmaddubsw\t{%2, %0|%0, %2}
- vpmaddubsw\t{%2, %1, %0|%0, %1, %2}
vpmaddubsw\t{%2, %1, %0|%0, %1, %2}"
- [(set_attr "isa" "noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,avx")
(set_attr "type" "sseiadd")
(set_attr "atom_unit" "simul")
- (set_attr "prefix_data16" "1,*,*")
+ (set_attr "prefix_data16" "1,*")
(set_attr "prefix_extra" "1")
- (set_attr "prefix" "orig,vex,evex")
+ (set_attr "prefix" "orig,vex")
(set_attr "mode" "TI")])
(define_insn "ssse3_pmaddubsw"
@@ -17065,16 +17048,16 @@
})
(define_insn "*<ssse3_avx2>_pmulhrsw<mode>3<mask_name>"
- [(set (match_operand:VI2_AVX2 0 "register_operand" "=x,x,v")
+ [(set (match_operand:VI2_AVX2 0 "register_operand" "=x,<v_Yw>")
(truncate:VI2_AVX2
(lshiftrt:<ssedoublemode>
(plus:<ssedoublemode>
(lshiftrt:<ssedoublemode>
(mult:<ssedoublemode>
(sign_extend:<ssedoublemode>
- (match_operand:VI2_AVX2 1 "vector_operand" "%0,x,v"))
+ (match_operand:VI2_AVX2 1 "vector_operand" "%0,<v_Yw>"))
(sign_extend:<ssedoublemode>
- (match_operand:VI2_AVX2 2 "vector_operand" "xBm,xm,vm")))
+ (match_operand:VI2_AVX2 2 "vector_operand" "xBm,<v_Yw>m")))
(const_int 14))
(match_operand:VI2_AVX2 3 "const1_operand"))
(const_int 1))))]
@@ -17082,13 +17065,12 @@
&& !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
pmulhrsw\t{%2, %0|%0, %2}
- vpmulhrsw\t{%2, %1, %0<mask_operand4>|%0<mask_operand4>, %1, %2}
vpmulhrsw\t{%2, %1, %0<mask_operand4>|%0<mask_operand4>, %1, %2}"
- [(set_attr "isa" "noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,avx")
(set_attr "type" "sseimul")
- (set_attr "prefix_data16" "1,*,*")
+ (set_attr "prefix_data16" "1,*")
(set_attr "prefix_extra" "1")
- (set_attr "prefix" "orig,maybe_evex,evex")
+ (set_attr "prefix" "orig,maybe_evex")
(set_attr "mode" "<sseinsnmode>")])
(define_expand "smulhrsv4hi3"
@@ -17160,21 +17142,20 @@
(set_attr "mode" "DI,TI,TI")])
(define_insn "<ssse3_avx2>_pshufb<mode>3<mask_name>"
- [(set (match_operand:VI1_AVX512 0 "register_operand" "=x,x,v")
+ [(set (match_operand:VI1_AVX512 0 "register_operand" "=x,<v_Yw>")
(unspec:VI1_AVX512
- [(match_operand:VI1_AVX512 1 "register_operand" "0,x,v")
- (match_operand:VI1_AVX512 2 "vector_operand" "xBm,xm,vm")]
+ [(match_operand:VI1_AVX512 1 "register_operand" "0,<v_Yw>")
+ (match_operand:VI1_AVX512 2 "vector_operand" "xBm,<v_Yw>m")]
UNSPEC_PSHUFB))]
"TARGET_SSSE3 && <mask_mode512bit_condition> && <mask_avx512bw_condition>"
"@
pshufb\t{%2, %0|%0, %2}
- vpshufb\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}
vpshufb\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
- [(set_attr "isa" "noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,avx")
(set_attr "type" "sselog1")
- (set_attr "prefix_data16" "1,*,*")
+ (set_attr "prefix_data16" "1,*")
(set_attr "prefix_extra" "1")
- (set_attr "prefix" "orig,maybe_evex,evex")
+ (set_attr "prefix" "orig,maybe_evex")
(set_attr "btver2_decode" "vector")
(set_attr "mode" "<sseinsnmode>")])
@@ -17274,11 +17255,11 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<ssse3_avx2>_palignr<mode>"
- [(set (match_operand:SSESCALARMODE 0 "register_operand" "=x,x,v")
+ [(set (match_operand:SSESCALARMODE 0 "register_operand" "=x,<v_Yw>")
(unspec:SSESCALARMODE
- [(match_operand:SSESCALARMODE 1 "register_operand" "0,x,v")
- (match_operand:SSESCALARMODE 2 "vector_operand" "xBm,xm,vm")
- (match_operand:SI 3 "const_0_to_255_mul_8_operand" "n,n,n")]
+ [(match_operand:SSESCALARMODE 1 "register_operand" "0,<v_Yw>")
+ (match_operand:SSESCALARMODE 2 "vector_operand" "xBm,<v_Yw>m")
+ (match_operand:SI 3 "const_0_to_255_mul_8_operand" "n,n")]
UNSPEC_PALIGNR))]
"TARGET_SSSE3"
{
@@ -17289,19 +17270,18 @@
case 0:
return "palignr\t{%3, %2, %0|%0, %2, %3}";
case 1:
- case 2:
return "vpalignr\t{%3, %2, %1, %0|%0, %1, %2, %3}";
default:
gcc_unreachable ();
}
}
- [(set_attr "isa" "noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,avx")
(set_attr "type" "sseishft")
(set_attr "atom_unit" "sishuf")
- (set_attr "prefix_data16" "1,*,*")
+ (set_attr "prefix_data16" "1,*")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
- (set_attr "prefix" "orig,vex,evex")
+ (set_attr "prefix" "orig,vex")
(set_attr "mode" "<sseinsnmode>")])
(define_insn_and_split "ssse3_palignrdi"
@@ -17367,9 +17347,9 @@
(V8DI "TARGET_AVX512F") (V4DI "TARGET_AVX512VL") (V2DI "TARGET_AVX512VL")])
(define_insn "*abs<mode>2"
- [(set (match_operand:VI1248_AVX512VL_AVX512BW 0 "register_operand" "=v")
+ [(set (match_operand:VI1248_AVX512VL_AVX512BW 0 "register_operand" "=<v_Yw>")
(abs:VI1248_AVX512VL_AVX512BW
- (match_operand:VI1248_AVX512VL_AVX512BW 1 "vector_operand" "vBm")))]
+ (match_operand:VI1248_AVX512VL_AVX512BW 1 "vector_operand" "<v_Yw>Bm")))]
"TARGET_SSSE3"
"%vpabs<ssemodesuffix>\t{%1, %0|%0, %1}"
[(set_attr "type" "sselog1")
@@ -17731,22 +17711,21 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<sse4_1_avx2>_packusdw<mask_name>"
- [(set (match_operand:VI2_AVX2 0 "register_operand" "=Yr,*x,x,v")
+ [(set (match_operand:VI2_AVX2 0 "register_operand" "=Yr,*x,<v_Yw>")
(vec_concat:VI2_AVX2
(us_truncate:<ssehalfvecmode>
- (match_operand:<sseunpackmode> 1 "register_operand" "0,0,x,v"))
+ (match_operand:<sseunpackmode> 1 "register_operand" "0,0,<v_Yw>"))
(us_truncate:<ssehalfvecmode>
- (match_operand:<sseunpackmode> 2 "vector_operand" "YrBm,*xBm,xm,vm"))))]
+ (match_operand:<sseunpackmode> 2 "vector_operand" "YrBm,*xBm,<v_Yw>m"))))]
"TARGET_SSE4_1 && <mask_mode512bit_condition> && <mask_avx512bw_condition>"
"@
packusdw\t{%2, %0|%0, %2}
packusdw\t{%2, %0|%0, %2}
- vpackusdw\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}
vpackusdw\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
- [(set_attr "isa" "noavx,noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,noavx,avx")
(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
- (set_attr "prefix" "orig,orig,<mask_prefix>,evex")
+ (set_attr "prefix" "orig,orig,<mask_prefix>")
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<sse4_1_avx2>_pblendvb"
@@ -17867,9 +17846,9 @@
(set_attr "mode" "TI")])
(define_insn "avx2_<code>v16qiv16hi2<mask_name>"
- [(set (match_operand:V16HI 0 "register_operand" "=v")
+ [(set (match_operand:V16HI 0 "register_operand" "=Yw")
(any_extend:V16HI
- (match_operand:V16QI 1 "nonimmediate_operand" "vm")))]
+ (match_operand:V16QI 1 "nonimmediate_operand" "Ywm")))]
"TARGET_AVX2 && <mask_avx512bw_condition> && <mask_avx512vl_condition>"
"vpmov<extsuffix>bw\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}"
[(set_attr "type" "ssemov")
@@ -17935,10 +17914,10 @@
"TARGET_AVX512BW")
(define_insn "sse4_1_<code>v8qiv8hi2<mask_name>"
- [(set (match_operand:V8HI 0 "register_operand" "=Yr,*x,v")
+ [(set (match_operand:V8HI 0 "register_operand" "=Yr,*x,Yw")
(any_extend:V8HI
(vec_select:V8QI
- (match_operand:V16QI 1 "register_operand" "Yr,*x,v")
+ (match_operand:V16QI 1 "register_operand" "Yr,*x,Yw")
(parallel [(const_int 0) (const_int 1)
(const_int 2) (const_int 3)
(const_int 4) (const_int 5)
@@ -17952,7 +17931,7 @@
(set_attr "mode" "TI")])
(define_insn "*sse4_1_<code>v8qiv8hi2<mask_name>_1"
- [(set (match_operand:V8HI 0 "register_operand" "=Yr,*x,v")
+ [(set (match_operand:V8HI 0 "register_operand" "=Yr,*x,Yw")
(any_extend:V8HI
(match_operand:V8QI 1 "memory_operand" "m,m,m")))]
"TARGET_SSE4_1 && <mask_avx512bw_condition> && <mask_avx512vl_condition>"
@@ -21611,11 +21590,11 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "*ssse3_palignr<mode>_perm"
- [(set (match_operand:V_128 0 "register_operand" "=x,x,v")
+ [(set (match_operand:V_128 0 "register_operand" "=x,Yw")
(vec_select:V_128
- (match_operand:V_128 1 "register_operand" "0,x,v")
+ (match_operand:V_128 1 "register_operand" "0,Yw")
(match_parallel 2 "palignr_operand"
- [(match_operand 3 "const_int_operand" "n,n,n")])))]
+ [(match_operand 3 "const_int_operand" "n,n")])))]
"TARGET_SSSE3"
{
operands[2] = (GEN_INT (INTVAL (operands[3])
@@ -21626,19 +21605,18 @@
case 0:
return "palignr\t{%2, %1, %0|%0, %1, %2}";
case 1:
- case 2:
return "vpalignr\t{%2, %1, %1, %0|%0, %1, %1, %2}";
default:
gcc_unreachable ();
}
}
- [(set_attr "isa" "noavx,avx,avx512bw")
+ [(set_attr "isa" "noavx,avx")
(set_attr "type" "sseishft")
(set_attr "atom_unit" "sishuf")
- (set_attr "prefix_data16" "1,*,*")
+ (set_attr "prefix_data16" "1,*")
(set_attr "prefix_extra" "1")
(set_attr "length_immediate" "1")
- (set_attr "prefix" "orig,vex,evex")])
+ (set_attr "prefix" "orig,maybe_evex")])
(define_expand "avx512vl_vinsert<mode>"
[(match_operand:VI48F_256 0 "register_operand")
diff --git a/gcc/config/i386/x86-tune-costs.h b/gcc/config/i386/x86-tune-costs.h
index cc27c79..e655e66 100644
--- a/gcc/config/i386/x86-tune-costs.h
+++ b/gcc/config/i386/x86-tune-costs.h
@@ -1688,6 +1688,140 @@ struct processor_costs znver2_cost = {
"16", /* Func alignment. */
};
+struct processor_costs znver3_cost = {
+ {
+ /* Start of register allocator costs. integer->integer move cost is 2. */
+
+ /* reg-reg moves are done by renaming and thus they are even cheaper than
+ 1 cycle. Because reg-reg move cost is 2 and following tables correspond
+ to doubles of latencies, we do not model this correctly. It does not
+ seem to make practical difference to bump prices up even more. */
+ 6, /* cost for loading QImode using
+ movzbl. */
+ {6, 6, 6}, /* cost of loading integer registers
+ in QImode, HImode and SImode.
+ Relative to reg-reg move (2). */
+ {8, 8, 8}, /* cost of storing integer
+ registers. */
+ 2, /* cost of reg,reg fld/fst. */
+ {6, 6, 16}, /* cost of loading fp registers
+ in SFmode, DFmode and XFmode. */
+ {8, 8, 16}, /* cost of storing fp registers
+ in SFmode, DFmode and XFmode. */
+ 2, /* cost of moving MMX register. */
+ {6, 6}, /* cost of loading MMX registers
+ in SImode and DImode. */
+ {8, 8}, /* cost of storing MMX registers
+ in SImode and DImode. */
+ 2, 2, 3, /* cost of moving XMM,YMM,ZMM
+ register. */
+ {6, 6, 6, 6, 12}, /* cost of loading SSE registers
+ in 32,64,128,256 and 512-bit. */
+ {8, 8, 8, 8, 16}, /* cost of storing SSE registers
+ in 32,64,128,256 and 512-bit. */
+ 6, 6, /* SSE->integer and integer->SSE
+ moves. */
+ 8, 8, /* mask->integer and integer->mask moves */
+ {6, 6, 6}, /* cost of loading mask register
+ in QImode, HImode, SImode. */
+ {8, 8, 8}, /* cost if storing mask register
+ in QImode, HImode, SImode. */
+ 2, /* cost of moving mask register. */
+ /* End of register allocator costs. */
+ },
+
+ COSTS_N_INSNS (1), /* cost of an add instruction. */
+ COSTS_N_INSNS (1), /* cost of a lea instruction. */
+ COSTS_N_INSNS (1), /* variable shift costs. */
+ COSTS_N_INSNS (1), /* constant shift costs. */
+ {COSTS_N_INSNS (3), /* cost of starting multiply for QI. */
+ COSTS_N_INSNS (3), /* HI. */
+ COSTS_N_INSNS (3), /* SI. */
+ COSTS_N_INSNS (3), /* DI. */
+ COSTS_N_INSNS (3)}, /* other. */
+ 0, /* cost of multiply per each bit
+ set. */
+ /* Depending on parameters, idiv can get faster on ryzen. This is upper
+ bound. */
+ {COSTS_N_INSNS (16), /* cost of a divide/mod for QI. */
+ COSTS_N_INSNS (22), /* HI. */
+ COSTS_N_INSNS (30), /* SI. */
+ COSTS_N_INSNS (45), /* DI. */
+ COSTS_N_INSNS (45)}, /* other. */
+ COSTS_N_INSNS (1), /* cost of movsx. */
+ COSTS_N_INSNS (1), /* cost of movzx. */
+ 8, /* "large" insn. */
+ 9, /* MOVE_RATIO. */
+ 6, /* CLEAR_RATIO */
+ {6, 6, 6}, /* cost of loading integer registers
+ in QImode, HImode and SImode.
+ Relative to reg-reg move (2). */
+ {8, 8, 8}, /* cost of storing integer
+ registers. */
+ {6, 6, 6, 6, 12}, /* cost of loading SSE registers
+ in 32bit, 64bit, 128bit, 256bit and 512bit */
+ {8, 8, 8, 8, 16}, /* cost of storing SSE register
+ in 32bit, 64bit, 128bit, 256bit and 512bit */
+ {6, 6, 6, 6, 12}, /* cost of unaligned loads. */
+ {8, 8, 8, 8, 16}, /* cost of unaligned stores. */
+ 2, 2, 3, /* cost of moving XMM,YMM,ZMM
+ register. */
+ 6, /* cost of moving SSE register to integer. */
+ /* VGATHERDPD is 23 uops and throughput is 9, VGATHERDPD is 35 uops,
+ throughput 12. Approx 9 uops do not depend on vector size and every load
+ is 7 uops. */
+ 18, 8, /* Gather load static, per_elt. */
+ 18, 10, /* Gather store static, per_elt. */
+ 32, /* size of l1 cache. */
+ 512, /* size of l2 cache. */
+ 64, /* size of prefetch block. */
+ /* New AMD processors never drop prefetches; if they cannot be performed
+ immediately, they are queued. We set number of simultaneous prefetches
+ to a large constant to reflect this (it probably is not a good idea not
+ to limit number of prefetches at all, as their execution also takes some
+ time). */
+ 100, /* number of parallel prefetches. */
+ 3, /* Branch cost. */
+ COSTS_N_INSNS (5), /* cost of FADD and FSUB insns. */
+ COSTS_N_INSNS (5), /* cost of FMUL instruction. */
+ /* Latency of fdiv is 8-15. */
+ COSTS_N_INSNS (15), /* cost of FDIV instruction. */
+ COSTS_N_INSNS (1), /* cost of FABS instruction. */
+ COSTS_N_INSNS (1), /* cost of FCHS instruction. */
+ /* Latency of fsqrt is 4-10. */
+ COSTS_N_INSNS (10), /* cost of FSQRT instruction. */
+
+ COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */
+ COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */
+ COSTS_N_INSNS (3), /* cost of MULSS instruction. */
+ COSTS_N_INSNS (3), /* cost of MULSD instruction. */
+ COSTS_N_INSNS (5), /* cost of FMA SS instruction. */
+ COSTS_N_INSNS (5), /* cost of FMA SD instruction. */
+ COSTS_N_INSNS (10), /* cost of DIVSS instruction. */
+ /* 9-13. */
+ COSTS_N_INSNS (13), /* cost of DIVSD instruction. */
+ COSTS_N_INSNS (10), /* cost of SQRTSS instruction. */
+ COSTS_N_INSNS (15), /* cost of SQRTSD instruction. */
+ /* Zen can execute 4 integer operations per cycle. FP operations
+ take 3 cycles and it can execute 2 integer additions and 2
+ multiplications thus reassociation may make sense up to with of 6.
+ SPEC2k6 bencharks suggests
+ that 4 works better than 6 probably due to register pressure.
+
+ Integer vector operations are taken by FP unit and execute 3 vector
+ plus/minus operations per cycle but only one multiply. This is adjusted
+ in ix86_reassociation_width. */
+ 4, 4, 3, 6, /* reassoc int, fp, vec_int, vec_fp. */
+ znver2_memcpy,
+ znver2_memset,
+ COSTS_N_INSNS (4), /* cond_taken_branch_cost. */
+ COSTS_N_INSNS (2), /* cond_not_taken_branch_cost. */
+ "16", /* Loop alignment. */
+ "16", /* Jump alignment. */
+ "0:0:8", /* Label alignment. */
+ "16", /* Func alignment. */
+};
+
/* skylake_cost should produce code tuned for Skylake familly of CPUs. */
static stringop_algs skylake_memcpy[2] = {
{libcall, {{1024, rep_prefix_4_byte, true}, {-1, libcall, false}}},
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index 69f3c70..859af75 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -1208,10 +1208,11 @@
(define_predicate "branch_comparison_operator"
(and (match_operand 0 "comparison_operator")
(match_test "GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) == MODE_CC")
- (if_then_else (match_test "GET_MODE (XEXP (op, 0)) == CCFPmode
- && !flag_finite_math_only")
- (match_code "lt,gt,eq,unordered,unge,unle,ne,ordered")
- (match_code "lt,ltu,le,leu,gt,gtu,ge,geu,eq,ne"))
+ (if_then_else (match_test "GET_MODE (XEXP (op, 0)) == CCFPmode")
+ (if_then_else (match_test "flag_finite_math_only")
+ (match_code "lt,le,gt,ge,eq,ne,unordered,ordered")
+ (match_code "lt,gt,eq,unordered,unge,unle,ne,ordered"))
+ (match_code "lt,ltu,le,leu,gt,gtu,ge,geu,eq,ne"))
(match_test "validate_condition_mode (GET_CODE (op),
GET_MODE (XEXP (op, 0))),
1")))
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 151136b..f7b1c03 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -16714,13 +16714,21 @@ s390_shift_truncation_mask (machine_mode mode)
static bool
f_constraint_p (const char *constraint)
{
+ bool seen_f_p = false;
+ bool seen_v_p = false;
+
for (size_t i = 0, c_len = strlen (constraint); i < c_len;
i += CONSTRAINT_LEN (constraint[i], constraint + i))
{
if (constraint[i] == 'f')
- return true;
+ seen_f_p = true;
+ if (constraint[i] == 'v')
+ seen_v_p = true;
}
- return false;
+
+ /* Treat "fv" constraints as "v", because LRA will choose the widest register
+ * class. */
+ return seen_f_p && !seen_v_p;
}
/* Implement TARGET_MD_ASM_ADJUST hook in order to fix up "f"
diff --git a/gcc/config/sparc/constraints.md b/gcc/config/sparc/constraints.md
index 82bbba9..7ddf014 100644
--- a/gcc/config/sparc/constraints.md
+++ b/gcc/config/sparc/constraints.md
@@ -19,7 +19,7 @@
;;; Unused letters:
;;; B
-;;; a jkl uv xyz
+;;; a jkl uvwxyz
;; Register constraints
@@ -190,14 +190,7 @@
(match_test "TARGET_ARCH32")
(match_test "register_ok_for_ldd (op)")))
-;; Equivalent to 'T' but in 64-bit mode without alignment requirement
(define_memory_constraint "W"
- "Memory reference for 'e' constraint floating-point register"
- (and (match_code "mem")
- (match_test "TARGET_ARCH64")
- (match_test "memory_ok_for_ldd (op)")))
-
-(define_memory_constraint "w"
"A memory with only a base register"
(match_operand 0 "mem_noofs_operand"))
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index f150417..42ba415 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -9223,14 +9223,17 @@ register_ok_for_ldd (rtx reg)
int
memory_ok_for_ldd (rtx op)
{
- /* In 64-bit mode, we assume that the address is word-aligned. */
- if (TARGET_ARCH32 && !mem_min_alignment (op, 8))
+ if (!mem_min_alignment (op, 8))
return 0;
- if (! can_create_pseudo_p ()
+ /* We need to perform the job of a memory constraint. */
+ if ((reload_in_progress || reload_completed)
&& !strict_memory_address_p (Pmode, XEXP (op, 0)))
return 0;
+ if (lra_in_progress && !memory_address_p (Pmode, XEXP (op, 0)))
+ return 0;
+
return 1;
}
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 02b7c8d..c5d3696 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -1869,8 +1869,8 @@ visl")
(set_attr "lra" "*,*,disabled,disabled,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*")])
(define_insn "*movdi_insn_sp64"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r, m, r,*e,?*e,?*e, W,b,b")
- (match_operand:DI 1 "input_operand" "rI,N,m,rJ,*e, r, *e, W,?*e,J,P"))]
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r, m, r,*e,?*e,?*e, m,b,b")
+ (match_operand:DI 1 "input_operand" "rI,N,m,rJ,*e, r, *e, m,?*e,J,P"))]
"TARGET_ARCH64
&& (register_operand (operands[0], DImode)
|| register_or_zero_or_all_ones_operand (operands[1], DImode))"
@@ -2498,8 +2498,8 @@ visl")
(set_attr "lra" "*,*,*,*,*,*,*,*,*,*,disabled,disabled,*,*,*,*,*")])
(define_insn "*movdf_insn_sp64"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=b,b,e,*r, e, e,W, *r,*r, m,*r")
- (match_operand:DF 1 "input_operand" "G,C,e, e,*r,W#F,e,*rG, m,*rG, F"))]
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=b,b,e,*r, e, e,m, *r,*r, m,*r")
+ (match_operand:DF 1 "input_operand" "G,C,e, e,*r,m#F,e,*rG, m,*rG, F"))]
"TARGET_ARCH64
&& (register_operand (operands[0], DFmode)
|| register_or_zero_or_all_ones_operand (operands[1], DFmode))"
@@ -8467,8 +8467,8 @@ visl")
(set_attr "cpu_feature" "vis,vis,vis,*,*,*,*,*,*,vis3,vis3")])
(define_insn "*mov<VM64:mode>_insn_sp64"
- [(set (match_operand:VM64 0 "nonimmediate_operand" "=e,e,e,e,W,m,*r, m,*r, e,*r")
- (match_operand:VM64 1 "input_operand" "Y,Z,e,W,e,Y, m,*r, e,*r,*r"))]
+ [(set (match_operand:VM64 0 "nonimmediate_operand" "=e,e,e,e,m,m,*r, m,*r, e,*r")
+ (match_operand:VM64 1 "input_operand" "Y,Z,e,m,e,Y, m,*r, e,*r,*r"))]
"TARGET_VIS
&& TARGET_ARCH64
&& (register_operand (operands[0], <VM64:MODE>mode)
diff --git a/gcc/config/sparc/sync.md b/gcc/config/sparc/sync.md
index c578e95..c0a20ef 100644
--- a/gcc/config/sparc/sync.md
+++ b/gcc/config/sparc/sync.md
@@ -202,7 +202,7 @@
(define_insn "*atomic_compare_and_swap<mode>_1"
[(set (match_operand:I48MODE 0 "register_operand" "=r")
- (match_operand:I48MODE 1 "mem_noofs_operand" "+w"))
+ (match_operand:I48MODE 1 "mem_noofs_operand" "+W"))
(set (match_dup 1)
(unspec_volatile:I48MODE
[(match_operand:I48MODE 2 "register_operand" "r")
@@ -214,7 +214,7 @@
(define_insn "atomic_compare_and_swap_leon3_1"
[(set (match_operand:SI 0 "register_operand" "=r")
- (match_operand:SI 1 "mem_noofs_operand" "+w"))
+ (match_operand:SI 1 "mem_noofs_operand" "+W"))
(set (match_dup 1)
(unspec_volatile:SI
[(match_operand:SI 2 "register_operand" "r")
@@ -235,7 +235,7 @@
(define_insn "*atomic_compare_and_swapdi_v8plus"
[(set (match_operand:DI 0 "register_operand" "=h")
- (match_operand:DI 1 "mem_noofs_operand" "+w"))
+ (match_operand:DI 1 "mem_noofs_operand" "+W"))
(set (match_dup 1)
(unspec_volatile:DI
[(match_operand:DI 2 "register_operand" "h")
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 06c6dfa..0f91414 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,120 @@
+2021-03-16 Jason Merrill <jason@redhat.com>
+
+ * tree.c (cp_tree_equal): Use real_identical.
+
+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.
+
+2021-03-16 Martin Liska <mliska@suse.cz>
+ Jason Merrill <jason@redhat.com>
+
+ 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.
+
+2021-03-16 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/99496
+ * 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.
+
+2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/99047
+ * coroutines.cc (expand_one_await_expression): If the
+ await_ready() expression is not a boolean then convert it
+ as required.
+
+2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ 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.
+
+2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ 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.
+
+2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ 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.
+
+2021-03-15 Tobias Burnus <tobias@codesourcery.com>
+
+ PR c++/99509
+ * decl.c (cp_finish_decl): For 'omp declare target implicit' vars,
+ ensure that the varpool node is marked as offloadable.
+
+2021-03-12 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/99238
+ * module.cc (depset::hash::add_binding_entity): Assert not
+ visited.
+ (depset::add::add_specializations): Likewise.
+ * name-lookup.c (name_lookup::dedup): New.
+ (name_lookup::~name_lookup): Assert not deduping.
+ (name_lookup::restore_state): Likewise.
+ (name_lookup::add_overload): Replace outlined code with dedup
+ call.
+ (name_lookup::add_value): Likewise.
+ (name_lookup::search_namespace_only): Likewise.
+ (name_lookup::adl_namespace_fns): Likewise.
+ (name_lookup::adl_class_fns): Likewise.
+ (name_lookup::search_adl): Likewise. Add clearing dedup call.
+ (name_lookup::search_qualified): Likewise.
+ (name_lookup::search_unqualified): Likewise.
+
+2021-03-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/99507
+ * call.c (build_over_call): For immediate evaluation of functions
+ that return references, undo convert_from_reference effects before
+ calling cxx_constant_value and call convert_from_reference
+ afterwards.
+
+2021-03-11 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/99248
+ * name-lookup.c (lookup_elaborated_type_1): Access slot not bind
+ when there's a binding vector.
+ * ptree.c (cxx_print_xnode): Lazy flags are no longer a thing.
+
+2021-03-11 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/99528
+ * module.cc (enum merge_kind): Delete MK_type_tmpl_spec,
+ MK_decl_tmpl_spec.
+ (trees_in::decl_value): Adjust add_mergeable_specialization call.
+ (trees_out::get_merge_kind): Adjust detecting a partial template
+ instantiation.
+ (trees_out::key_mergeable): Adjust handling same.
+ (trees_in::key_mergeabvle): Likewise.
+
2021-03-10 Nathan Sidwell <nathan@acm.org>
PR c++/99423
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 7d12fea..29f4b50 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -8469,6 +8469,9 @@ get_function_version_dispatcher (tree fn)
{
tree dispatcher_decl = NULL;
+ if (DECL_LOCAL_DECL_P (fn))
+ fn = DECL_LOCAL_DECL_ALIAS (fn);
+
gcc_assert (TREE_CODE (fn) == FUNCTION_DECL
&& DECL_FUNCTION_VERSIONED (fn));
@@ -9504,6 +9507,9 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
if (immediate_invocation_p (fndecl, nargs))
{
tree obj_arg = NULL_TREE;
+ /* Undo convert_from_reference called by build_cxx_call. */
+ if (REFERENCE_REF_P (call))
+ call = TREE_OPERAND (call, 0);
if (DECL_CONSTRUCTOR_P (fndecl))
obj_arg = cand->first_arg ? cand->first_arg : (*args)[0];
if (obj_arg && is_dummy_object (obj_arg))
@@ -9527,6 +9533,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
call = cxx_constant_value (call, obj_arg);
if (obj_arg && !error_operand_p (call))
call = build2 (INIT_EXPR, void_type_node, obj_arg, call);
+ call = convert_from_reference (call);
}
}
return call;
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index c5aeb66..51984ef 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -1586,7 +1586,13 @@ expand_one_await_expression (tree *stmt, tree *await_expr, void *d)
/* Use the await_ready() call to test if we need to suspend. */
tree ready_cond = TREE_VEC_ELT (awaiter_calls, 0); /* await_ready(). */
- ready_cond = build1_loc (loc, TRUTH_NOT_EXPR, boolean_type_node, ready_cond);
+ /* Convert to bool, if necessary. */
+ if (TREE_CODE (TREE_TYPE (ready_cond)) != BOOLEAN_TYPE)
+ ready_cond = cp_convert (boolean_type_node, ready_cond,
+ tf_warning_or_error);
+ /* Be aggressive in folding here, since there are a significant number of
+ cases where the ready condition is constant. */
+ ready_cond = invert_truthvalue_loc (loc, ready_cond);
ready_cond
= build1_loc (loc, CLEANUP_POINT_EXPR, boolean_type_node, ready_cond);
@@ -2145,7 +2151,7 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody,
tree orig, hash_map<tree, param_info> *param_uses,
hash_map<tree, local_var_info> *local_var_uses,
vec<tree, va_gc> *param_dtor_list, tree resume_fn_field,
- unsigned body_count, tree frame_size)
+ tree resume_idx_field, unsigned body_count, tree frame_size)
{
verify_stmt_tree (fnbody);
/* Some things we inherit from the original function. */
@@ -2267,6 +2273,17 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody,
b = coro_build_cvt_void_expr_stmt (b, loc);
add_stmt (b);
+ /* The destroy point numbered #1 is special, in that it is reached from a
+ coroutine that is suspended after re-throwing from unhandled_exception().
+ This label just invokes the cleanup of promise, param copies and the
+ frame itself. */
+ tree del_promise_label
+ = create_named_label_with_ctx (loc, "coro.delete.promise", actor);
+ b = build_case_label (build_int_cst (short_unsigned_type_node, 1), NULL_TREE,
+ create_anon_label_with_ctx (loc, actor));
+ add_stmt (b);
+ add_stmt (build_stmt (loc, GOTO_EXPR, del_promise_label));
+
short unsigned lab_num = 3;
for (unsigned destr_pt = 0; destr_pt < body_count; destr_pt++)
{
@@ -2371,9 +2388,10 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody,
p_data.to = ap;
cp_walk_tree (&fnbody, replace_proxy, &p_data, NULL);
- /* Set the actor pointer to null, so that 'done' will work.
- Resume from here is UB anyway - although a 'ready' await will
- branch to the final resume, and fall through to the destroy. */
+ /* The rewrite of the function adds code to set the __resume field to
+ nullptr when the coroutine is done and also the index to zero when
+ calling an unhandled exception. These are represented by two proxies
+ in the function, so rewrite them to the proper frame access. */
tree resume_m
= lookup_member (coro_frame_type, get_identifier ("__resume"),
/*protect=*/1, /*want_type=*/0, tf_warning_or_error);
@@ -2383,12 +2401,14 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody,
p_data.to = res_x;
cp_walk_tree (&fnbody, replace_proxy, &p_data, NULL);
+ p_data.from = resume_idx_field;
+ p_data.to = rat;
+ cp_walk_tree (&fnbody, replace_proxy, &p_data, NULL);
+
/* Add in our function body with the co_returns rewritten to final form. */
add_stmt (fnbody);
/* now do the tail of the function. */
- tree del_promise_label
- = create_named_label_with_ctx (loc, "coro.delete.promise", actor);
r = build_stmt (loc, LABEL_EXPR, del_promise_label);
add_stmt (r);
@@ -2955,7 +2975,9 @@ flatten_await_stmt (var_nest_node *n, hash_set<tree> *promoted,
break;
case TARGET_EXPR:
{
- /* We have a temporary; promote it. */
+ /* We have a temporary; promote it, but allow for the idiom in code
+ generated by the compiler like
+ a = (target_expr produces temp, op uses temp). */
tree init = t;
temps_used->add (init);
tree var_type = TREE_TYPE (init);
@@ -2976,20 +2998,35 @@ flatten_await_stmt (var_nest_node *n, hash_set<tree> *promoted,
}
else
init = build2 (INIT_EXPR, var_type, var, init);
- var_nest_node *ins
- = new var_nest_node (var, init, n->prev, n);
- /* We have to replace the target expr... */
- *v.entry = var;
- /* ... and any uses of its var. */
- proxy_replace pr = {TREE_OPERAND (t, 0), var};
- cp_walk_tree (&n->init, replace_proxy, &pr, NULL);
- /* Compiler-generated temporaries can also have uses in following
- arms of compound expressions, which will be listed in 'replace_in'
- if present. */
- if (replace_in)
- cp_walk_tree (replace_in, replace_proxy, &pr, NULL);
- flatten_await_stmt (ins, promoted, temps_used, NULL);
- flatten_await_stmt (n, promoted, temps_used, NULL);
+ /* Simplify for the case that we have an init containing the temp
+ alone. */
+ if (t == n->init && n->var == NULL_TREE)
+ {
+ n->var = var;
+ proxy_replace pr = {TREE_OPERAND (t, 0), var};
+ cp_walk_tree (&init, replace_proxy, &pr, NULL);
+ n->init = init;
+ if (replace_in)
+ cp_walk_tree (replace_in, replace_proxy, &pr, NULL);
+ flatten_await_stmt (n, promoted, temps_used, NULL);
+ }
+ else
+ {
+ var_nest_node *ins
+ = new var_nest_node (var, init, n->prev, n);
+ /* We have to replace the target expr... */
+ *v.entry = var;
+ /* ... and any uses of its var. */
+ proxy_replace pr = {TREE_OPERAND (t, 0), var};
+ cp_walk_tree (&n->init, replace_proxy, &pr, NULL);
+ /* Compiler-generated temporaries can also have uses in
+ following arms of compound expressions, which will be listed
+ in 'replace_in' if present. */
+ if (replace_in)
+ cp_walk_tree (replace_in, replace_proxy, &pr, NULL);
+ flatten_await_stmt (ins, promoted, temps_used, NULL);
+ flatten_await_stmt (n, promoted, temps_used, NULL);
+ }
return;
}
break;
@@ -3178,7 +3215,6 @@ maybe_promote_temps (tree *stmt, void *d)
gcc_checking_assert (root->next == NULL);
tree vlist = NULL_TREE;
var_nest_node *t = root;
- gcc_checking_assert (!t->var);
/* We build the bind scope expression from the bottom-up.
EXPR_LIST holds the inner expression nest at the current cleanup
level (becoming the final expression list when we've exhausted the
@@ -3214,9 +3250,12 @@ maybe_promote_temps (tree *stmt, void *d)
add_stmt (cl); /* push this onto the level above. */
}
else if (expr_list)
- add_stmt (expr_list);
- else
- gcc_unreachable ();
+ {
+ if (TREE_CODE (expr_list) != STATEMENT_LIST)
+ add_stmt (expr_list);
+ else if (!tsi_end_p (tsi_start (expr_list)))
+ add_stmt (expr_list);
+ }
}
else
{
@@ -3225,7 +3264,12 @@ maybe_promote_temps (tree *stmt, void *d)
else
finish_expr_stmt (t->init);
if (expr_list)
- add_stmt (expr_list);
+ {
+ if (TREE_CODE (expr_list) != STATEMENT_LIST)
+ add_stmt (expr_list);
+ else if (!tsi_end_p (tsi_start (expr_list)))
+ add_stmt (expr_list);
+ }
}
expr_list = pop_stmt_list (new_list);
var_nest_node *old = t;
@@ -3407,6 +3451,50 @@ coro_build_add_if_not_cond_break (tree cond)
finish_if_stmt (if_stmt);
}
+/* Tree walk callback to replace continue statements with goto label. */
+static tree
+replace_continue (tree *stmt, int *do_subtree, void *d)
+{
+ tree expr = *stmt;
+ if (TREE_CODE (expr) == CLEANUP_POINT_EXPR)
+ expr = TREE_OPERAND (expr, 0);
+ if (CONVERT_EXPR_P (expr) && VOID_TYPE_P (expr))
+ expr = TREE_OPERAND (expr, 0);
+ STRIP_NOPS (expr);
+ if (!STATEMENT_CLASS_P (expr))
+ return NULL_TREE;
+
+ switch (TREE_CODE (expr))
+ {
+ /* Unless it's a special case, just walk the subtrees as usual. */
+ default: return NULL_TREE;
+
+ case CONTINUE_STMT:
+ {
+ tree *label = (tree *)d;
+ location_t loc = EXPR_LOCATION (expr);
+ /* re-write a continue to goto label. */
+ *stmt = build_stmt (loc, GOTO_EXPR, *label);
+ *do_subtree = 0;
+ return NULL_TREE;
+ }
+
+ /* Statements that do not require recursion. */
+ case DECL_EXPR:
+ case BREAK_STMT:
+ case GOTO_EXPR:
+ case LABEL_EXPR:
+ case CASE_LABEL_EXPR:
+ case ASM_EXPR:
+ /* These must break recursion. */
+ case FOR_STMT:
+ case WHILE_STMT:
+ case DO_STMT:
+ *do_subtree = 0;
+ return NULL_TREE;
+ }
+}
+
/* Tree walk callback to analyze, register and pre-process statements that
contain await expressions. */
@@ -3510,6 +3598,88 @@ await_statement_walker (tree *stmt, int *do_subtree, void *d)
return res;
}
break;
+ case FOR_STMT:
+ {
+ /* for loops only need special treatment if the condition or the
+ iteration expression contain a co_await. */
+ tree for_stmt = *stmt;
+ /* Sanity check. */
+ if ((res = cp_walk_tree (&FOR_INIT_STMT (for_stmt),
+ analyze_expression_awaits, d, &visited)))
+ return res;
+ gcc_checking_assert (!awpts->saw_awaits);
+
+ if ((res = cp_walk_tree (&FOR_COND (for_stmt),
+ analyze_expression_awaits, d, &visited)))
+ return res;
+ bool for_cond_await = awpts->saw_awaits != 0;
+ unsigned save_awaits = awpts->saw_awaits;
+
+ if ((res = cp_walk_tree (&FOR_EXPR (for_stmt),
+ analyze_expression_awaits, d, &visited)))
+ return res;
+ bool for_expr_await = awpts->saw_awaits > save_awaits;
+
+ /* If the condition has an await, then we will need to rewrite the
+ loop as
+ for (init expression;true;iteration expression) {
+ condition = await expression;
+ if (condition)
+ break;
+ ...
+ }
+ */
+ if (for_cond_await)
+ {
+ tree insert_list = push_stmt_list ();
+ /* This will be expanded when the revised body is handled. */
+ coro_build_add_if_not_cond_break (FOR_COND (for_stmt));
+ /* .. add the original for body. */
+ add_stmt (FOR_BODY (for_stmt));
+ /* To make the new for body. */
+ FOR_BODY (for_stmt) = pop_stmt_list (insert_list);
+ FOR_COND (for_stmt) = boolean_true_node;
+ }
+ /* If the iteration expression has an await, it's a bit more
+ tricky.
+ for (init expression;condition;) {
+ ...
+ iteration_expr_label:
+ iteration expression with await;
+ }
+ but, then we will need to re-write any continue statements into
+ 'goto iteration_expr_label:'.
+ */
+ if (for_expr_await)
+ {
+ location_t sloc = EXPR_LOCATION (FOR_EXPR (for_stmt));
+ tree insert_list = push_stmt_list ();
+ /* The original for body. */
+ add_stmt (FOR_BODY (for_stmt));
+ char *buf = xasprintf ("for.iter.expr.%u", awpts->cond_number++);
+ tree it_expr_label
+ = create_named_label_with_ctx (sloc, buf, NULL_TREE);
+ free (buf);
+ add_stmt (build_stmt (sloc, LABEL_EXPR, it_expr_label));
+ add_stmt (FOR_EXPR (for_stmt));
+ FOR_EXPR (for_stmt) = NULL_TREE;
+ FOR_BODY (for_stmt) = pop_stmt_list (insert_list);
+ /* rewrite continue statements to goto label. */
+ hash_set<tree> visited_continue;
+ if ((res = cp_walk_tree (&FOR_BODY (for_stmt),
+ replace_continue, &it_expr_label, &visited_continue)))
+ return res;
+ }
+
+ /* So now walk the body statement (list), if there were no await
+ expressions, then this handles the original body - and either
+ way we will have finished with this statement. */
+ res = cp_walk_tree (&FOR_BODY (for_stmt),
+ await_statement_walker, d, NULL);
+ *do_subtree = 0; /* Done subtrees. */
+ return res;
+ }
+ break;
case WHILE_STMT:
{
/* We turn 'while (cond with awaits) stmt' into
@@ -3872,9 +4042,9 @@ act_des_fn (tree orig, tree fn_type, tree coro_frame_ptr, const char* name)
/* Re-write the body as per [dcl.fct.def.coroutine] / 5. */
static tree
-coro_rewrite_function_body (location_t fn_start, tree fnbody,
- tree orig, tree resume_fn_ptr_type,
- tree& resume_fn_field, tree& fs_label)
+coro_rewrite_function_body (location_t fn_start, tree fnbody, tree orig,
+ tree resume_fn_ptr_type, tree& resume_fn_field,
+ tree& resume_idx_field, tree& fs_label)
{
/* This will be our new outer scope. */
tree update_body = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
@@ -3918,6 +4088,25 @@ coro_rewrite_function_body (location_t fn_start, tree fnbody,
tree return_void
= get_coroutine_return_void_expr (current_function_decl, fn_start, false);
+ /* We will need to be able to set the resume function pointer to nullptr
+ to signal that the coroutine is 'done'. */
+ resume_fn_field
+ = build_lang_decl (VAR_DECL, get_identifier ("resume.fn.ptr.proxy"),
+ resume_fn_ptr_type);
+ DECL_ARTIFICIAL (resume_fn_field) = true;
+ tree zero_resume
+ = build1 (CONVERT_EXPR, resume_fn_ptr_type, integer_zero_node);
+ zero_resume
+ = build2 (INIT_EXPR, resume_fn_ptr_type, resume_fn_field, zero_resume);
+ /* Likewise, the resume index needs to be reset. */
+ resume_idx_field
+ = build_lang_decl (VAR_DECL, get_identifier ("resume.index.proxy"),
+ short_unsigned_type_node);
+ DECL_ARTIFICIAL (resume_idx_field) = true;
+ tree zero_resume_idx = build_int_cst (short_unsigned_type_node, 0);
+ zero_resume_idx = build2 (INIT_EXPR, short_unsigned_type_node,
+ resume_idx_field, zero_resume_idx);
+
if (flag_exceptions)
{
/* Build promise.unhandled_exception(); */
@@ -3976,7 +4165,13 @@ coro_rewrite_function_body (location_t fn_start, tree fnbody,
IF_SCOPE (not_iarc_if) = NULL;
not_iarc_if = do_poplevel (iarc_scope);
add_stmt (not_iarc_if);
- /* ... else call the promise unhandled exception method. */
+ /* ... else call the promise unhandled exception method
+ but first we set done = true and the resume index to 0.
+ If the unhandled exception method returns, then we continue
+ to the final await expression (which duplicates the clearing of
+ the field). */
+ finish_expr_stmt (zero_resume);
+ finish_expr_stmt (zero_resume_idx);
ueh = maybe_cleanup_point_expr_void (ueh);
add_stmt (ueh);
finish_handler (handler);
@@ -4013,14 +4208,6 @@ coro_rewrite_function_body (location_t fn_start, tree fnbody,
/* Before entering the final suspend point, we signal that this point has
been reached by setting the resume function pointer to zero (this is
what the 'done()' builtin tests) as per the current ABI. */
- resume_fn_field
- = build_lang_decl (VAR_DECL, get_identifier ("resume.fn.ptr.proxy"),
- resume_fn_ptr_type);
- DECL_ARTIFICIAL (resume_fn_field) = true;
- tree zero_resume
- = build1 (CONVERT_EXPR, resume_fn_ptr_type, integer_zero_node);
- zero_resume
- = build2 (INIT_EXPR, resume_fn_ptr_type, resume_fn_field, zero_resume);
finish_expr_stmt (zero_resume);
finish_expr_stmt (build_init_or_final_await (fn_start, true));
BIND_EXPR_BODY (update_body) = pop_stmt_list (BIND_EXPR_BODY (update_body));
@@ -4164,9 +4351,11 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer)
the requirements for the coroutine frame. */
tree resume_fn_field = NULL_TREE;
+ tree resume_idx_field = NULL_TREE;
tree fs_label = NULL_TREE;
- fnbody = coro_rewrite_function_body (fn_start, fnbody, orig, act_des_fn_ptr,
- resume_fn_field, fs_label);
+ fnbody = coro_rewrite_function_body (fn_start, fnbody, orig,
+ act_des_fn_ptr, resume_fn_field,
+ resume_idx_field, fs_label);
/* Build our dummy coro frame layout. */
coro_frame_type = begin_class_definition (coro_frame_type);
@@ -5048,7 +5237,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer)
/* Build the actor... */
build_actor_fn (fn_start, coro_frame_type, actor, fnbody, orig, param_uses,
&local_var_uses, param_dtor_list, resume_fn_field,
- body_aw_points.await_number, frame_size);
+ resume_idx_field, body_aw_points.await_number, frame_size);
/* Destroyer ... */
build_destroy_fn (fn_start, coro_frame_type, destroy, actor);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 9c7f6e5..8e8f37d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -53,7 +53,9 @@ along with GCC; see the file COPYING3. If not see
#include "asan.h"
#include "gcc-rich-location.h"
#include "langhooks.h"
+#include "context.h" /* For 'g'. */
#include "omp-general.h"
+#include "omp-offload.h" /* For offload_vars. */
/* Possible cases of bad specifiers type used by bad_specifiers. */
enum bad_spec_place {
@@ -1108,6 +1110,21 @@ decls_match (tree newdecl, tree olddecl, bool record_versions /* = true */)
return types_match;
}
+/* Mark DECL as versioned if it isn't already. */
+
+static void
+maybe_mark_function_versioned (tree decl)
+{
+ if (!DECL_FUNCTION_VERSIONED (decl))
+ {
+ DECL_FUNCTION_VERSIONED (decl) = 1;
+ /* If DECL_ASSEMBLER_NAME has already been set, re-mangle
+ to include the version marker. */
+ if (DECL_ASSEMBLER_NAME_SET_P (decl))
+ mangle_decl (decl);
+ }
+}
+
/* NEWDECL and OLDDECL have identical signatures. If they are
different versions adjust them and return true.
If RECORD is set to true, record function versions. */
@@ -1118,18 +1135,22 @@ maybe_version_functions (tree newdecl, tree olddecl, bool record)
if (!targetm.target_option.function_versions (newdecl, olddecl))
return false;
- if (!DECL_FUNCTION_VERSIONED (olddecl))
+ maybe_mark_function_versioned (olddecl);
+ if (DECL_LOCAL_DECL_P (olddecl))
{
- DECL_FUNCTION_VERSIONED (olddecl) = 1;
- if (DECL_ASSEMBLER_NAME_SET_P (olddecl))
- mangle_decl (olddecl);
+ olddecl = DECL_LOCAL_DECL_ALIAS (olddecl);
+ maybe_mark_function_versioned (olddecl);
}
- if (!DECL_FUNCTION_VERSIONED (newdecl))
+ maybe_mark_function_versioned (newdecl);
+ if (DECL_LOCAL_DECL_P (newdecl))
{
- DECL_FUNCTION_VERSIONED (newdecl) = 1;
- if (DECL_ASSEMBLER_NAME_SET_P (newdecl))
- mangle_decl (newdecl);
+ /* Unfortunately, we can get here before pushdecl naturally calls
+ push_local_extern_decl_alias, so we need to call it directly. */
+ if (!DECL_LOCAL_DECL_ALIAS (newdecl))
+ push_local_extern_decl_alias (newdecl);
+ newdecl = DECL_LOCAL_DECL_ALIAS (newdecl);
+ maybe_mark_function_versioned (newdecl);
}
if (record)
@@ -8176,9 +8197,22 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
DECL_ATTRIBUTES (decl))
&& !lookup_attribute ("omp declare target link",
DECL_ATTRIBUTES (decl)))
- DECL_ATTRIBUTES (decl)
- = tree_cons (get_identifier ("omp declare target"),
- NULL_TREE, DECL_ATTRIBUTES (decl));
+ {
+ DECL_ATTRIBUTES (decl)
+ = tree_cons (get_identifier ("omp declare target"),
+ NULL_TREE, DECL_ATTRIBUTES (decl));
+ symtab_node *node = symtab_node::get (decl);
+ if (node != NULL)
+ {
+ node->offloadable = 1;
+ if (ENABLE_OFFLOADING)
+ {
+ g->have_offload = true;
+ if (is_a <varpool_node *> (node))
+ vec_safe_push (offload_vars, decl);
+ }
+ }
+ }
}
/* This is the last point we can lower alignment so give the target the
@@ -9231,17 +9265,25 @@ expand_static_init (tree decl, tree init)
/* Do the initialization itself. */
init = add_stmt_to_compound (begin, init);
- init = add_stmt_to_compound
- (init, build2 (MODIFY_EXPR, void_type_node, flag, boolean_true_node));
- init = add_stmt_to_compound
- (init, build_call_n (release_fn, 1, guard_addr));
+ init = add_stmt_to_compound (init,
+ build2 (MODIFY_EXPR, void_type_node,
+ flag, boolean_true_node));
+
+ /* Use atexit to register a function for destroying this static
+ variable. Do this before calling __cxa_guard_release. */
+ init = add_stmt_to_compound (init, register_dtor_fn (decl));
+
+ init = add_stmt_to_compound (init, build_call_n (release_fn, 1,
+ guard_addr));
}
else
- init = add_stmt_to_compound (init, set_guard (guard));
+ {
+ init = add_stmt_to_compound (init, set_guard (guard));
- /* Use atexit to register a function for destroying this static
- variable. */
- init = add_stmt_to_compound (init, register_dtor_fn (decl));
+ /* Use atexit to register a function for destroying this static
+ variable. */
+ init = add_stmt_to_compound (init, register_dtor_fn (decl));
+ }
finish_expr_stmt (init);
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 03359db..6dbdc92 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -7719,18 +7719,35 @@ trees_out::decl_value (tree decl, depset *dep)
}
}
- bool is_typedef = (!type && inner
- && TREE_CODE (inner) == TYPE_DECL
- && DECL_ORIGINAL_TYPE (inner)
- && TYPE_NAME (TREE_TYPE (inner)) == inner);
- if (is_typedef)
+ bool is_typedef = false;
+ if (!type && inner && TREE_CODE (inner) == TYPE_DECL)
{
- /* A typedef type. */
- int type_tag = insert (TREE_TYPE (inner));
+ tree t = TREE_TYPE (inner);
+ unsigned tdef_flags = 0;
+ if (DECL_ORIGINAL_TYPE (inner)
+ && TYPE_NAME (TREE_TYPE (inner)) == inner)
+ {
+ tdef_flags |= 1;
+ if (TYPE_STRUCTURAL_EQUALITY_P (t)
+ && TYPE_DEPENDENT_P_VALID (t)
+ && TYPE_DEPENDENT_P (t))
+ tdef_flags |= 2;
+ }
if (streaming_p ())
- dump (dumper::TREE)
- && dump ("Cloned:%d typedef %C:%N", type_tag,
- TREE_CODE (TREE_TYPE (inner)), TREE_TYPE (inner));
+ u (tdef_flags);
+
+ if (tdef_flags & 1)
+ {
+ /* A typedef type. */
+ int type_tag = insert (t);
+ if (streaming_p ())
+ dump (dumper::TREE)
+ && dump ("Cloned:%d %s %C:%N", type_tag,
+ tdef_flags & 2 ? "depalias" : "typedef",
+ TREE_CODE (t), t);
+
+ is_typedef = true;
+ }
}
if (streaming_p () && DECL_MAYBE_IN_CHARGE_CDTOR_P (decl))
@@ -7993,12 +8010,6 @@ trees_in::decl_value ()
dump (dumper::TREE) && dump ("Read:%d %C:%N", tag, TREE_CODE (decl), decl);
- /* Regular typedefs will have a NULL TREE_TYPE at this point. */
- bool is_typedef = (!type && inner
- && TREE_CODE (inner) == TYPE_DECL
- && DECL_ORIGINAL_TYPE (inner)
- && !TREE_TYPE (inner));
-
existing = back_refs[~tag];
bool installed = install_entity (existing);
bool is_new = existing == decl;
@@ -8030,6 +8041,16 @@ trees_in::decl_value ()
}
}
+ /* Regular typedefs will have a NULL TREE_TYPE at this point. */
+ unsigned tdef_flags = 0;
+ bool is_typedef = false;
+ if (!type && inner && TREE_CODE (inner) == TYPE_DECL)
+ {
+ tdef_flags = u ();
+ if (tdef_flags & 1)
+ is_typedef = true;
+ }
+
if (is_new)
{
/* A newly discovered node. */
@@ -8076,6 +8097,14 @@ trees_in::decl_value ()
TREE_TYPE (inner) = DECL_ORIGINAL_TYPE (inner);
DECL_ORIGINAL_TYPE (inner) = NULL_TREE;
set_underlying_type (inner);
+ if (tdef_flags & 2)
+ {
+ /* Match instantiate_alias_template's handling. */
+ tree type = TREE_TYPE (inner);
+ TYPE_DEPENDENT_P (type) = true;
+ TYPE_DEPENDENT_P_VALID (type) = true;
+ SET_TYPE_STRUCTURAL_EQUALITY (type);
+ }
}
if (inner_tag)
@@ -10661,6 +10690,9 @@ trees_in::key_mergeable (int tag, merge_kind mk, tree decl, tree inner,
spec.tmpl = tree_node ();
spec.args = tree_node ();
+ if (get_overrun ())
+ return error_mark_node;
+
DECL_NAME (decl) = DECL_NAME (spec.tmpl);
DECL_CONTEXT (decl) = DECL_CONTEXT (spec.tmpl);
DECL_NAME (inner) = DECL_NAME (decl);
@@ -12706,6 +12738,9 @@ depset::hash::add_binding_entity (tree decl, WMB_Flags flags, void *data_)
*slot = data->binding;
}
+ /* Make sure nobody left a tree visited lying about. */
+ gcc_checking_assert (!TREE_VISITED (decl));
+
if (flags & WMB_Using)
{
decl = ovl_make (decl, NULL_TREE);
@@ -13000,6 +13035,8 @@ depset::hash::add_specializations (bool decl_p)
have_spec:;
#endif
+ /* Make sure nobody left a tree visited lying about. */
+ gcc_checking_assert (!TREE_VISITED (spec));
depset *dep = make_dependency (spec, depset::EK_SPECIALIZATION);
if (dep->is_special ())
{
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index d8839e2..a6257f5 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -464,6 +464,7 @@ public:
}
~name_lookup ()
{
+ gcc_checking_assert (!deduping);
restore_state ();
}
@@ -471,6 +472,17 @@ private: /* Uncopyable, unmovable, unassignable. I am a rock. */
name_lookup (const name_lookup &);
name_lookup &operator= (const name_lookup &);
+ public:
+ /* Turn on or off deduping mode. */
+ void dedup (bool state)
+ {
+ if (deduping != state)
+ {
+ deduping = state;
+ lookup_mark (value, state);
+ }
+ }
+
protected:
static bool seen_p (tree scope)
{
@@ -605,8 +617,7 @@ name_lookup::preserve_state ()
void
name_lookup::restore_state ()
{
- if (deduping)
- lookup_mark (value, false);
+ gcc_checking_assert (!deduping);
/* Unmark and empty this lookup's scope stack. */
for (unsigned ix = vec_safe_length (scopes); ix--;)
@@ -703,12 +714,9 @@ name_lookup::add_overload (tree fns)
probe = ovl_skip_hidden (probe);
if (probe && TREE_CODE (probe) == OVERLOAD
&& OVL_DEDUP_P (probe))
- {
- /* We're about to add something found by multiple paths, so
- need to engage deduping mode. */
- lookup_mark (value, true);
- deduping = true;
- }
+ /* We're about to add something found by multiple paths, so need to
+ engage deduping mode. */
+ dedup (true);
}
value = lookup_maybe_add (fns, value, deduping);
@@ -737,12 +745,8 @@ name_lookup::add_value (tree new_val)
value = ORIGINAL_NAMESPACE (value);
else
{
- if (deduping)
- {
- /* Disengage deduping mode. */
- lookup_mark (value, false);
- deduping = false;
- }
+ /* Disengage deduping mode. */
+ dedup (false);
value = ambiguous (new_val, value);
}
}
@@ -951,10 +955,7 @@ name_lookup::search_namespace_only (tree scope)
if ((hit & 1 && BINDING_VECTOR_GLOBAL_DUPS_P (val))
|| (hit & 2
&& BINDING_VECTOR_PARTITION_DUPS_P (val)))
- {
- lookup_mark (value, true);
- deduping = true;
- }
+ dedup (true);
}
dup_detect |= dup;
}
@@ -1076,6 +1077,8 @@ name_lookup::search_qualified (tree scope, bool usings)
found = search_usings (scope);
}
+ dedup (false);
+
return found;
}
@@ -1177,6 +1180,8 @@ name_lookup::search_unqualified (tree scope, cp_binding_level *level)
break;
}
+ dedup (false);
+
/* Restore to incoming length. */
vec_safe_truncate (queue, length);
@@ -1284,15 +1289,10 @@ name_lookup::adl_namespace_fns (tree scope, bitmap imports)
else if (MODULE_BINDING_PARTITION_P (bind))
dup = 2;
if (unsigned hit = dup_detect & dup)
- {
- if ((hit & 1 && BINDING_VECTOR_GLOBAL_DUPS_P (val))
- || (hit & 2
- && BINDING_VECTOR_PARTITION_DUPS_P (val)))
- {
- lookup_mark (value, true);
- deduping = true;
- }
- }
+ if ((hit & 1 && BINDING_VECTOR_GLOBAL_DUPS_P (val))
+ || (hit & 2
+ && BINDING_VECTOR_PARTITION_DUPS_P (val)))
+ dedup (true);
dup_detect |= dup;
}
@@ -1328,11 +1328,7 @@ name_lookup::adl_class_fns (tree type)
if (CP_DECL_CONTEXT (fn) != context)
continue;
- if (!deduping)
- {
- lookup_mark (value, true);
- deduping = true;
- }
+ dedup (true);
/* Template specializations are never found by name lookup.
(Templates themselves can be found, but not template
@@ -1634,12 +1630,9 @@ name_lookup::search_adl (tree fns, vec<tree, va_gc> *args)
if (vec_safe_length (scopes))
{
/* Now do the lookups. */
- if (fns)
- {
- deduping = true;
- lookup_mark (fns, true);
- }
value = fns;
+ if (fns)
+ dedup (true);
/* INST_PATH will be NULL, if this is /not/ 2nd-phase ADL. */
bitmap inst_path = NULL;
@@ -1697,14 +1690,9 @@ name_lookup::search_adl (tree fns, vec<tree, va_gc> *args)
if (tree bind = *mslot)
{
- if (!deduping)
- {
- /* We must turn on deduping, because some
- other class from this module might also
- be in this namespace. */
- deduping = true;
- lookup_mark (value, true);
- }
+ /* We must turn on deduping, because some other class
+ from this module might also be in this namespace. */
+ dedup (true);
/* Add the exported fns */
if (STAT_HACK_P (bind))
@@ -1715,6 +1703,7 @@ name_lookup::search_adl (tree fns, vec<tree, va_gc> *args)
}
fns = value;
+ dedup (false);
}
return fns;
@@ -3385,7 +3374,7 @@ set_decl_context_in_fn (tree ctx, tree decl)
/* DECL is a local extern decl. Find or create the namespace-scope
decl that it aliases. Also, determines the linkage of DECL. */
-static void
+void
push_local_extern_decl_alias (tree decl)
{
if (dependent_type_p (TREE_TYPE (decl)))
@@ -3419,7 +3408,7 @@ push_local_extern_decl_alias (tree decl)
if (binding && TREE_CODE (binding) != TREE_LIST)
for (ovl_iterator iter (binding); iter; ++iter)
- if (decls_match (*iter, decl))
+ if (decls_match (decl, *iter, /*record_versions*/false))
{
alias = *iter;
break;
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
index 67e923f..f63c4f5 100644
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -453,6 +453,7 @@ extern void cp_emit_debug_info_for_using (tree, tree);
extern void finish_nonmember_using_decl (tree scope, tree name);
extern void finish_using_directive (tree target, tree attribs);
+void push_local_extern_decl_alias (tree decl);
extern tree pushdecl (tree, bool hiding = false);
extern tree pushdecl_outermost_localscope (tree);
extern tree pushdecl_top_level (tree);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 3c46975..3acb643 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -3740,7 +3740,7 @@ cp_tree_equal (tree t1, tree t2)
return tree_int_cst_equal (t1, t2);
case REAL_CST:
- return real_equal (&TREE_REAL_CST (t1), &TREE_REAL_CST (t2));
+ return real_identical (&TREE_REAL_CST (t1), &TREE_REAL_CST (t2));
case STRING_CST:
return TREE_STRING_LENGTH (t1) == TREE_STRING_LENGTH (t2)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4a3c1e2..7a36895 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -14362,6 +14362,10 @@ recurse deeper.
The maximum depth of a symbolic value, before approximating
the value as unknown.
+@item analyzer-max-infeasible-edges
+The maximum number of infeasible edges to reject before declaring
+a diagnostic as infeasible.
+
@item gimple-fe-computed-hot-bb-threshold
The number of executions of a basic block which is considered hot.
The parameter is used only in GIMPLE FE.
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index a78e724..8cc9403 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,38 @@
+2021-03-15 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/99345
+ * frontend-passes.c (doloop_contained_procedure_code):
+ Properly handle EXEC_IOLENGTH.
+
+2021-03-15 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/99545
+ * trans-stmt.c (gfc_trans_allocate): Mark the initialization
+ assignment by setting init_flag.
+
+2021-03-14 Harald Anlauf <anlauf@gmx.de>
+ Paul Thomas <pault@gcc.gnu.org>
+
+ * trans-expr.c (gfc_conv_procedure_call): Fix runtime checks for
+ CLASS arguments.
+ * trans-intrinsic.c (gfc_conv_intrinsic_size): Likewise.
+
+2021-03-13 Paul Thomas <pault@gcc.gnu.org>
+
+ 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.
+
+2021-03-12 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/99514
+ * resolve.c (resolve_symbol): Accept vars which are in DATA
+ and hence (either) implicit SAVE (or in common).
+
2021-03-10 Harald Anlauf <anlauf@gmx.de>
PR fortran/99205
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c
index 2b9c2d1..cfc4747 100644
--- a/gcc/fortran/frontend-passes.c
+++ b/gcc/fortran/frontend-passes.c
@@ -2405,6 +2405,7 @@ doloop_contained_procedure_code (gfc_code **c,
case EXEC_READ:
case EXEC_WRITE:
case EXEC_INQUIRE:
+ case EXEC_IOLENGTH:
saved_io_op = last_io_op;
last_io_op = co->op;
break;
@@ -2460,6 +2461,12 @@ doloop_contained_procedure_code (gfc_code **c,
info->procedure->name, &info->where_do);
break;
+ case EXEC_IOLENGTH:
+ if (co->expr1 && co->expr1->symtree->n.sym == do_var)
+ gfc_error_now (errmsg, do_var->name, &co->expr1->where,
+ info->procedure->name, &info->where_do);
+ break;
+
default:
gcc_unreachable ();
}
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 2a91ae7..32015c2 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -16024,12 +16024,12 @@ resolve_symbol (gfc_symbol *sym)
}
/* Check threadprivate restrictions. */
- if (sym->attr.threadprivate && !sym->attr.save
+ if (sym->attr.threadprivate
+ && !(sym->attr.save || sym->attr.data || sym->attr.in_common)
&& !(sym->ns->save_all && !sym->attr.automatic)
- && (!sym->attr.in_common
- && sym->module == NULL
- && (sym->ns->proc_name == NULL
- || sym->ns->proc_name->attr.flavor != FL_MODULE)))
+ && sym->module == NULL
+ && (sym->ns->proc_name == NULL
+ || sym->ns->proc_name->attr.flavor != FL_MODULE))
gfc_error ("Threadprivate at %L isn't SAVEd", &sym->declared_at);
/* Check omp declare target restrictions. */
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 478cddd..be5eb89 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -7670,15 +7670,21 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
/* Set the string_length for a character array. */
if (expr->ts.type == BT_CHARACTER)
{
- se->string_length = gfc_get_expr_charlen (expr);
+ if (deferred_array_component)
+ se->string_length = ss_info->string_length;
+ else
+ se->string_length = gfc_get_expr_charlen (expr);
+
if (VAR_P (se->string_length)
&& expr->ts.u.cl->backend_decl == se->string_length)
tmp = ss_info->string_length;
else
tmp = se->string_length;
- if (expr->ts.deferred)
+ if (expr->ts.deferred && VAR_P (expr->ts.u.cl->backend_decl))
gfc_add_modify (&se->pre, expr->ts.u.cl->backend_decl, tmp);
+ else
+ expr->ts.u.cl->backend_decl = tmp;
}
/* If we have an array section, are assigning or passing an array
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 85c16d7..bffe080 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -2485,7 +2485,7 @@ gfc_conv_string_length (gfc_charlen * cl, gfc_expr * expr, stmtblock_t * pblock)
se.expr, build_zero_cst (TREE_TYPE (se.expr)));
gfc_add_block_to_block (pblock, &se.pre);
- if (cl->backend_decl)
+ if (cl->backend_decl && VAR_P (cl->backend_decl))
gfc_add_modify (pblock, cl->backend_decl, se.expr);
else
cl->backend_decl = gfc_evaluate_now (se.expr, pblock);
@@ -6662,6 +6662,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
symbol_attribute attr;
char *msg;
tree cond;
+ tree tmp;
if (e->expr_type == EXPR_VARIABLE || e->expr_type == EXPR_FUNCTION)
attr = gfc_expr_attr (e);
@@ -6732,11 +6733,20 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
else
goto end_pointer_check;
- tmp = parmse.expr;
+ if (fsym && fsym->ts.type == BT_CLASS)
+ {
+ tmp = build_fold_indirect_ref_loc (input_location,
+ parmse.expr);
+ tmp = gfc_class_data_get (tmp);
+ if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (tmp)))
+ tmp = gfc_conv_descriptor_data_get (tmp);
+ }
+ else
+ tmp = parmse.expr;
/* If the argument is passed by value, we need to strip the
INDIRECT_REF. */
- if (!POINTER_TYPE_P (TREE_TYPE (parmse.expr)))
+ if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
tmp = gfc_build_addr_expr (NULL_TREE, tmp);
cond = fold_build2_loc (input_location, EQ_EXPR,
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 9cf3642..5e53d11 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -8006,8 +8006,10 @@ gfc_conv_intrinsic_size (gfc_se * se, gfc_expr * expr)
{
symbol_attribute attr;
char *msg;
+ tree temp;
+ tree cond;
- attr = gfc_expr_attr (e);
+ attr = sym ? sym->attr : gfc_expr_attr (e);
if (attr.allocatable)
msg = xasprintf ("Allocatable argument '%s' is not allocated",
e->symtree->n.sym->name);
@@ -8017,14 +8019,24 @@ gfc_conv_intrinsic_size (gfc_se * se, gfc_expr * expr)
else
goto end_arg_check;
- argse.descriptor_only = 1;
- gfc_conv_expr_descriptor (&argse, actual->expr);
- tree temp = gfc_conv_descriptor_data_get (argse.expr);
- tree cond = fold_build2_loc (input_location, EQ_EXPR,
- logical_type_node, temp,
- fold_convert (TREE_TYPE (temp),
- null_pointer_node));
+ if (sym)
+ {
+ temp = gfc_class_data_get (sym->backend_decl);
+ temp = gfc_conv_descriptor_data_get (temp);
+ }
+ else
+ {
+ argse.descriptor_only = 1;
+ gfc_conv_expr_descriptor (&argse, actual->expr);
+ temp = gfc_conv_descriptor_data_get (argse.expr);
+ }
+
+ cond = fold_build2_loc (input_location, EQ_EXPR,
+ logical_type_node, temp,
+ fold_convert (TREE_TYPE (temp),
+ null_pointer_node));
gfc_trans_runtime_check (true, false, cond, &argse.pre, &e->where, msg);
+
free (msg);
}
end_arg_check:
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 547468f..7cbdef7 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -7001,7 +7001,7 @@ gfc_trans_allocate (gfc_code * code)
gfc_expr *init_expr = gfc_expr_to_initialize (expr);
gfc_expr *rhs = e3rhs ? e3rhs : gfc_copy_expr (code->expr3);
flag_realloc_lhs = 0;
- tmp = gfc_trans_assignment (init_expr, rhs, false, false, true,
+ tmp = gfc_trans_assignment (init_expr, rhs, true, false, true,
false);
flag_realloc_lhs = realloc_lhs;
/* Free the expression allocated for init_expr. */
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index caf25cc..6da6698 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -7078,7 +7078,7 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags)
if ((flags & GOVD_SHARED) == 0)
{
t = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (decl)));
- if (DECL_P (t))
+ if (t && DECL_P (t))
omp_notice_variable (ctx, t, true);
}
}
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 58c881a..a3eef23 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-bf35249a7c752836741b1cab43a312f87916fcb0
+4bdff733a0c2a9ddc3eff104b1be03df058a79c4
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 101cbe7..5409d26 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -11017,7 +11017,7 @@ Call_expression::do_lower(Gogo* gogo, Named_object* function,
// If this is call to a method, call the method directly passing the
// object as the first parameter.
Bound_method_expression* bme = this->fn_->bound_method_expression();
- if (bme != NULL)
+ if (bme != NULL && !this->is_deferred_ && !this->is_concurrent_)
{
Named_object* methodfn = bme->function();
Function_type* mft = (methodfn->is_function()
diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc
index 7ad7339..b066011 100644
--- a/gcc/go/gofrontend/statements.cc
+++ b/gcc/go/gofrontend/statements.cc
@@ -2524,6 +2524,8 @@ Thunk_statement::is_constant_function() const
return fn->func_expression()->closure() == NULL;
if (fn->interface_field_reference_expression() != NULL)
return true;
+ if (fn->bound_method_expression() != NULL)
+ return true;
return false;
}
@@ -2566,6 +2568,7 @@ Thunk_statement::simplify_statement(Gogo* gogo, Named_object* function,
Expression* fn = ce->fn();
Interface_field_reference_expression* interface_method =
fn->interface_field_reference_expression();
+ Bound_method_expression* bme = fn->bound_method_expression();
Location location = this->location();
@@ -2594,6 +2597,8 @@ Thunk_statement::simplify_statement(Gogo* gogo, Named_object* function,
if (interface_method != NULL)
vals->push_back(interface_method->expr());
+ if (bme != NULL)
+ vals->push_back(bme->first_argument());
if (ce->args() != NULL)
{
@@ -2714,6 +2719,16 @@ Thunk_statement::build_struct(Function_type* fntype)
fields->push_back(Struct_field(tid));
}
+ // If this thunk statement calls a bound method expression, as in
+ // "go s.m()", we pass the bound method argument to the thunk,
+ // to ensure that we make a copy of it if needed.
+ Bound_method_expression* bme = fn->bound_method_expression();
+ if (bme != NULL)
+ {
+ Typed_identifier tid("object", bme->first_argument()->type(), location);
+ fields->push_back(Struct_field(tid));
+ }
+
// The predeclared recover function has no argument. However, we
// add an argument when building recover thunks. Handle that here.
if (ce->is_recover_call())
@@ -2843,6 +2858,7 @@ Thunk_statement::build_thunk(Gogo* gogo, const std::string& thunk_name)
Interface_field_reference_expression* interface_method =
ce->fn()->interface_field_reference_expression();
+ Bound_method_expression* bme = ce->fn()->bound_method_expression();
Expression* func_to_call;
unsigned int next_index;
@@ -2870,6 +2886,17 @@ Thunk_statement::build_thunk(Gogo* gogo, const std::string& thunk_name)
next_index = 1;
}
+ if (bme != NULL)
+ {
+ // This is a call to a method.
+ go_assert(next_index == 0);
+ Expression* r = Expression::make_field_reference(thunk_parameter, 0,
+ location);
+ func_to_call = Expression::make_bound_method(r, bme->method(),
+ bme->function(), location);
+ next_index = 1;
+ }
+
Expression_list* call_params = new Expression_list();
const Struct_field_list* fields = this->struct_type_->fields();
Struct_field_list::const_iterator p = fields->begin();
diff --git a/gcc/match.pd b/gcc/match.pd
index a34c283..036f92f 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -2788,7 +2788,10 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(plus:c @0 (lshift:s @0 INTEGER_CST@1))
(if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (@0))
&& tree_fits_uhwi_p (@1)
- && tree_to_uhwi (@1) < element_precision (type))
+ && tree_to_uhwi (@1) < element_precision (type)
+ && (INTEGRAL_TYPE_P (TREE_TYPE (@0))
+ || optab_handler (smul_optab,
+ TYPE_MODE (type)) != CODE_FOR_nothing))
(with { tree t = type;
if (!TYPE_OVERFLOW_WRAPS (t)) t = unsigned_type_for (t);
wide_int w = wi::set_bit_in_zero (tree_to_uhwi (@1),
@@ -2804,7 +2807,10 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& tree_fits_uhwi_p (@1)
&& tree_to_uhwi (@1) < element_precision (type)
&& tree_fits_uhwi_p (@2)
- && tree_to_uhwi (@2) < element_precision (type))
+ && tree_to_uhwi (@2) < element_precision (type)
+ && (INTEGRAL_TYPE_P (TREE_TYPE (@0))
+ || optab_handler (smul_optab,
+ TYPE_MODE (type)) != CODE_FOR_nothing))
(with { tree t = type;
if (!TYPE_OVERFLOW_WRAPS (t)) t = unsigned_type_for (t);
unsigned int prec = element_precision (type);
diff --git a/gcc/optc-save-gen.awk b/gcc/optc-save-gen.awk
index 14b8d03..19afa89 100644
--- a/gcc/optc-save-gen.awk
+++ b/gcc/optc-save-gen.awk
@@ -1445,6 +1445,7 @@ checked_options["TARGET_CASE_VECTOR_PC_RELATIVE"]++
checked_options["arc_size_opt_level"]++
# arm exceptions
checked_options["arm_fp16_format"]++
+checked_options["flag_ipa_ra"]++
# s390 exceptions
checked_options["param_max_completely_peel_times"]++
checked_options["param_max_completely_peeled_insns"]++
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 2fce3ac..6430bcf 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,7 @@
+2021-03-15 Joseph Myers <joseph@codesourcery.com>
+
+ * sv.po: Update.
+
2021-03-08 Joseph Myers <joseph@codesourcery.com>
* de.po, sv.po: Update.
diff --git a/gcc/po/sv.po b/gcc/po/sv.po
index 82601cc..97a5104 100644
--- a/gcc/po/sv.po
+++ b/gcc/po/sv.po
@@ -28,7 +28,7 @@ msgstr ""
"Project-Id-Version: gcc 11.1-b20210207\n"
"Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n"
"POT-Creation-Date: 2021-02-05 21:38+0000\n"
-"PO-Revision-Date: 2021-03-07 22:23+0100\n"
+"PO-Revision-Date: 2021-03-14 21:14+0100\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
"Language: sv\n"
@@ -33220,10 +33220,9 @@ msgid "previously declared as a variable length array %s"
msgstr "tidigare deklarerad som en vektor %s med variabel längd"
#: c-family/c-warn.c:3475
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "previously declared here"
+#, gcc-internal-format, gfc-internal-format
msgid "previously declared as an array %s"
-msgstr "tidigare deklarerad här"
+msgstr "tidigare deklarerad som en vektor %s"
#: c-family/c-warn.c:3484
#, gcc-internal-format, gfc-internal-format
@@ -33231,20 +33230,18 @@ msgid "argument %u of type %s declared as an ordinary array"
msgstr "argument %u av typen %s deklarerat som en vanlig vektor"
#: c-family/c-warn.c:3512
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "argument of type %qT not permitted with -mgeneral-regs-only"
+#, gcc-internal-format, gfc-internal-format
msgid "argument %u of type %s declared with %u variable bound"
msgid_plural "argument %u of type %s declared with %u variable bounds"
-msgstr[0] "argument av typen %qT är inte tillåtna med -mgeneral-regs-only"
-msgstr[1] "argument av typen %qT är inte tillåtna med -mgeneral-regs-only"
+msgstr[0] "argument %u av typen %s deklarerad med %u variabelgräns"
+msgstr[1] "argument %u av typen %s deklarerad med %u variabelgränser"
#: c-family/c-warn.c:3519
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "previously declared here"
+#, gcc-internal-format, gfc-internal-format
msgid "previously declared as %s with %u variable bound"
msgid_plural "previously declared as %s with %u variable bounds"
-msgstr[0] "tidigare deklarerad här"
-msgstr[1] "tidigare deklarerad här"
+msgstr[0] "tidigare deklarerad som %s med %u variabelgräns"
+msgstr[1] "tidigare deklarerad som %s med %u variabelgränser"
#: c-family/c-warn.c:3543
#, gcc-internal-format, gfc-internal-format
@@ -33273,28 +33270,24 @@ msgid "argument %u of type %s declared with mismatched bound argument %E"
msgstr "argument %u av typen %s deklarerat med gränsargument %E som inte stämmer"
#: c-family/c-warn.c:3619 c-family/c-warn.c:3652
-#, fuzzy, gcc-internal-format
-#| msgid "ignoring returned value of type %qT, declared with attribute %<nodiscard%>: %<%s%>"
+#, gcc-internal-format
msgid "argument %u of type %s declared with mismatched bound %<%s%>"
-msgstr "ignorerar returnerat värde av typen %qT, deklarerat med attributet %<nodiscard%>: %<%s%>"
+msgstr "argument %u av typen %s deklarerat med gräns %<%s%> inte stämmer"
#: c-family/c-warn.c:3631
-#, fuzzy, gcc-internal-format
-#| msgid "previously declared here"
+#, gcc-internal-format
msgid "previously declared as %s with bound argument %E"
-msgstr "tidigare deklarerad här"
+msgstr "tidigare deklarerad %s med bundet argument %E"
#: c-family/c-warn.c:3636
-#, fuzzy, gcc-internal-format
-#| msgid "previous declaration of %<%c%s%>"
+#, gcc-internal-format
msgid "previously declared as %s with bound %<%s%>"
-msgstr "tidigare deklaration av %<%c%s%>"
+msgstr "tidigare deklaration som %s med gränsen %<%s%>"
#: c-family/c-warn.c:3655
-#, fuzzy, gcc-internal-format
-#| msgid "previous declaration %qD"
+#, gcc-internal-format
msgid "previously declared as %s with bound %qs"
-msgstr "tidigare deklaration %qD"
+msgstr "tidigare deklaration som %s med gränsen %qs"
#: c-family/c-warn.c:3674
#, gcc-internal-format, gfc-internal-format
@@ -33307,16 +33300,14 @@ msgid "expression does not compute the number of elements in this array; element
msgstr "uttrycket beräknar inte antalet element i denna vektor; elementtypen är %qT, inte %qT"
#: c-family/c-warn.c:3715
-#, fuzzy, gcc-internal-format
-#| msgid "add parentheses around left hand side expression to silence this warning"
+#, gcc-internal-format
msgid "add parentheses around %qE to silence this warning"
-msgstr "lägg till parenteser runt uttrycket på vänster hand för att tysta denna varning"
+msgstr "lägg till parenteser runt %qE för att tysta denna varning"
#: c-family/c-warn.c:3719
-#, fuzzy, gcc-internal-format
-#| msgid "add parentheses around left hand side expression to silence this warning"
+#, gcc-internal-format
msgid "add parentheses around the second %<sizeof%> to silence this warning"
-msgstr "lägg till parenteser runt uttrycket på vänster hand för att tysta denna varning"
+msgstr "lägg till parenteser runt den andra %<sizeof%> för att tysta denna varning"
#: c-family/cppspec.c:94
#, gcc-internal-format
@@ -33552,10 +33543,9 @@ msgid "%<-march=%s%>: ISA string is not in canonical order. %<%c%>"
msgstr "%<-march=%s%>: ISA-strängen är inte i kanonisk ordning. %<%c%>"
#: common/config/riscv/riscv-common.c:773
-#, fuzzy, gcc-internal-format
-#| msgid "%<-march=%s%>: %s must separate with _"
+#, gcc-internal-format
msgid "%<-march=%s%>: name of %s must be more than 1 letter"
-msgstr "%<-march=%s%>: %s måste separeras med _"
+msgstr "%<-march=%s%>: namnet på %s måste vara mer än 1 bokstav"
#: common/config/riscv/riscv-common.c:785
#, gcc-internal-format
@@ -33573,10 +33563,9 @@ msgid "%<-march=%s%>: unexpected ISA string at end: %qs"
msgstr "%<-march=%s%>: oväntad ISA-sträng på slutet: %qs"
#: common/config/riscv/riscv-common.c:979
-#, fuzzy, gcc-internal-format
-#| msgid "%<%s%> is unknown"
+#, gcc-internal-format
msgid "%<-mcpu=%s%>: unknown CPU"
-msgstr "%<%s%> är okänd"
+msgstr "%<-mcpu=%s%>: okänd CPU"
#: common/config/rs6000/rs6000-common.c:184 config/sparc/sparc.c:1740
#, gcc-internal-format
@@ -33690,8 +33679,7 @@ msgid "couldn%'t understand kern.osversion %q.*s"
msgstr "kunde inte förstå kern.osversion %q.*s"
#: config/darwin-driver.c:232
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "couldn%'t understand version %s"
+#, gcc-internal-format, gfc-internal-format
msgid "could not understand version %s"
msgstr "kunde inte förstå version %s"
@@ -33701,10 +33689,9 @@ msgid "this compiler does not support %s"
msgstr "denna målarkitektur stödjer inte %s"
#: config/darwin-driver.c:351
-#, fuzzy, gcc-internal-format
-#| msgid "%qs is not valid for %<mmacosx-version-min%>"
+#, gcc-internal-format
msgid "%qs is not valid for %<-mmacosx-version-min%>"
-msgstr "%qs är inte ett giltigt värde till %<mmacosx-version-min%>"
+msgstr "%qs är inte ett giltigt värde till %<-mmacosx-version-min%>"
#: config/darwin-driver.c:385
#, gcc-internal-format
@@ -34105,22 +34092,19 @@ msgid "invalid feature modifier %qs in %<-mcpu=%s%>"
msgstr "ogiltig funktionsmodifierare %qs i %<-mcpu=%s%>"
#: config/aarch64/aarch64.c:14836
-#, fuzzy, gcc-internal-format
-#| msgid "invalid argument %qs to %qs"
+#, gcc-internal-format
msgid "invalid argument given to %<-mharden-sls=%>"
-msgstr "ogiltigt argument %qs till %qs"
+msgstr "ogiltigt argument givet till %<-mharden-sls=%>"
#: config/aarch64/aarch64.c:14847
-#, fuzzy, gcc-internal-format
-#| msgid "%<-mmsa%> must be used with %<-mfp64%> and %<-mhard-float%>"
+#, gcc-internal-format
msgid "%<%s%> must be by itself for %<-mharden-sls=%>"
-msgstr "%<-mmsa%> måste användas med %<-mfp64%> och %<-mhard-float%>"
+msgstr "%<%s%> måste vara ensamt till %<-mharden-sls=%>"
#: config/aarch64/aarch64.c:14852
-#, fuzzy, gcc-internal-format
-#| msgid "invalid argument %<%s%> for %<-mbranch-protection=%>"
+#, gcc-internal-format
msgid "invalid argument %<%s%> for %<-mharden-sls=%>"
-msgstr "ogiltigt argument %<%s%> till %<-mbranch-protection=%>"
+msgstr "ogiltigt argument %<%s%> till %<-mharden-sls=%>"
#: config/aarch64/aarch64.c:14958
#, gcc-internal-format
@@ -34288,10 +34272,9 @@ msgstr "bana %wd utanför intervallet %wd - %wd"
#: config/aarch64/aarch64.c:23369 config/i386/i386.c:22509
#: config/i386/i386.c:22637
-#, fuzzy, gcc-internal-format
-#| msgid "unsupported simdlen %d"
+#, gcc-internal-format
msgid "unsupported simdlen %wd"
-msgstr "ej stödd simdlen: %d"
+msgstr "ej stödd simdlen %wd"
#: config/aarch64/aarch64.c:23379 config/aarch64/aarch64.c:23400
#, gcc-internal-format
@@ -34314,10 +34297,9 @@ msgid "GCC does not currently support argument type %qT for %<simd%> functions"
msgstr "GCC stödjer för närvarande inte argumenttypen %qT för %<simd%>-funktioner"
#: config/aarch64/aarch64.c:23429
-#, fuzzy, gcc-internal-format
-#| msgid "GCC does not currently support simdlen %d for type %qT"
+#, gcc-internal-format
msgid "GCC does not currently support simdlen %wd for type %qT"
-msgstr "GCC stödjer för närvarande inte simdlen %d för typen %qT"
+msgstr "GCC stödjer för närvarande inte simdlen %wd för typen %qT"
#: config/alpha/alpha.c:420
#, gcc-internal-format
@@ -35143,10 +35125,9 @@ msgid "no low registers available for popping high registers"
msgstr "inga låga register tillgängliga för att poppa höga register"
#: config/arm/arm.c:26643
-#, fuzzy, gcc-internal-format
-#| msgid "interrupt Service Routines cannot be coded in Thumb mode"
+#, gcc-internal-format
msgid "Interrupt Service Routines cannot be coded in Thumb-1 mode"
-msgstr "avbrottshanteringsrutiner kan inte kodas i Thumb-läge"
+msgstr "Avbrottshanteringsrutiner kan inte kodas i Thumb-läge"
#: config/arm/arm.c:26889
#, gcc-internal-format
@@ -35497,16 +35478,14 @@ msgid "can%'t apply both longcall and shortcall attributes to the same function"
msgstr "det går inte att tillämpa både attributet longcall och shortcall på samma funktion"
#: config/bpf/bpf.c:92
-#, fuzzy, gcc-internal-format
-#| msgid "%qE attribute requires an integer constant argument"
+#, gcc-internal-format
msgid "%qE attribute requires an integer argument"
-msgstr "attributet %qE kräver en heltalskonstant som argument"
+msgstr "attributet %qE kräver ett heltalsargument"
#: config/bpf/bpf.c:99
-#, fuzzy, gcc-internal-format
-#| msgid "%qE attribute requires a string argument"
+#, gcc-internal-format
msgid "%qE requires an argument"
-msgstr "attributet %qE behöver ett strängargument"
+msgstr "%qE behöver ett argument"
#: config/bpf/bpf.c:297
#, gcc-internal-format
@@ -35603,10 +35582,9 @@ msgstr "okänd CRIS-cpu-version angiven i %<-mtune=%> : %s"
#. detectable. Still change to the values we expect, to avoid
#. further errors.
#: config/cris/cris.c:2339
-#, fuzzy, gcc-internal-format
-#| msgid "%<-fPIC%>/%<-fpic%> not supported for this target"
+#, gcc-internal-format
msgid "%<-fPIC%> and %<-fpic%> are not supported on this target"
-msgstr "%<-fPIC%>/%<-fpic%> stödjs inte av denna målarkitektur"
+msgstr "%<-fPIC%> och %<-fpic%> stödjs inte på denna målarkitektur"
#: config/cris/cris.c:2540
#, gcc-internal-format
@@ -36242,10 +36220,9 @@ msgid "%<-mstringop-strategy=rep_8byte%> not supported for 32-bit code"
msgstr "%<-mstringop-strategy=rep_8byte%> stödjs inte för 32-bitarskod"
#: config/i386/i386-options.c:1913
-#, fuzzy, gcc-internal-format
-#| msgid "%<-mstringop-strategy=rep_8byte%> not supported for 32-bit code"
+#, gcc-internal-format
msgid "%<-muintr%> not supported for 32-bit code"
-msgstr "%<-mstringop-strategy=rep_8byte%> stödjs inte för 32-bitarskod"
+msgstr "%<-muintr%> stödjs inte för 32-bitarskod"
#: config/i386/i386-options.c:1928
#, gcc-internal-format
@@ -36509,10 +36486,9 @@ msgid "%qs is not a valid base register in %<-mstack-protector-guard-reg=%>"
msgstr "%qs är inte ett giltigt basregister i %<-mstack-protector-guard-reg=%>"
#: config/i386/i386-options.c:3022
-#, fuzzy, gcc-internal-format
-#| msgid "%<-mnop-mcount%> is not compatible with this target"
+#, gcc-internal-format
msgid "%<-fcf-protection%> is not compatible with this target"
-msgstr "%<-mnop-mcount%> är inte kompatibelt med denna målarkitektur"
+msgstr "%<-fcf-protection%> är inte kompatibelt med denna målarkitektur"
#: config/i386/i386-options.c:3149
#, gcc-internal-format
@@ -36844,10 +36820,9 @@ msgid "the alignment of %<_Atomic %T%> fields changed in %{GCC 11.1%}"
msgstr "justeringen av %<_Atomic %T%>-fält ändrades i %{GCC 11.1%}"
#: config/i386/i386.c:20817
-#, fuzzy, gcc-internal-format
-#| msgid "%<-mcmodel=%> is not supported in 32-bit mode"
+#, gcc-internal-format
msgid "profiling %<-mcmodel=large%> with PIC is not supported"
-msgstr "%<-mcmodel=%> stödjs inte i 32-bitarsläge"
+msgstr "profileringen %<-mcmodel=large%> med PIC stödjs inte"
#: config/i386/i386.c:22470
#, gcc-internal-format
@@ -37551,15 +37526,12 @@ msgid "MCU %qs supports %s hardware multiply, but %<-mhwmult%> is set to f5serie
msgstr "MCU %qs stödjer %s-hårdvarumultiplikation, men %<-mhwmult%> är satt till f5series"
#: config/msp430/msp430.c:225
-#, fuzzy, gcc-internal-format
-#| msgid ""
-#| "Unrecognized MCU name %qs, assuming that it is just a MSP430 with no hardware multiply.\n"
-#| "Use the %<-mcpu%> and %<-mhwmult%> options to set these explicitly."
+#, gcc-internal-format
msgid ""
"Unrecognized MCU name %qs, assuming that it is just a MSP430X with no hardware multiply.\n"
"Use the %<-mcpu%> and %<-mhwmult%> options to set these explicitly."
msgstr ""
-"Okänt MCU-namn %qs, antar att det bara är en MSP430 utan hårdvarumultiplikation.\n"
+"Okänt MCU-namn %qs, antar att det bara är en MSP430X utan hårdvarumultiplikation.\n"
"Använd flaggorna %<-mcpu%> och %<-mhwmult%> för att sätta dessa explicit."
#: config/msp430/msp430.c:232
@@ -37572,15 +37544,12 @@ msgstr ""
"använd flaggan %<-mhwmult%> för att sätta detta explicit."
#: config/msp430/msp430.c:244
-#, fuzzy, gcc-internal-format
-#| msgid ""
-#| "Unrecognized MCU name %qs, assuming that it just supports the MSP430 ISA.\n"
-#| "Use the %<-mcpu%> option to set the ISA explicitly."
+#, gcc-internal-format
msgid ""
"Unrecognized MCU name %qs, assuming that it just supports the MSP430X ISA.\n"
"Use the %<-mcpu%> option to set the ISA explicitly."
msgstr ""
-"Okänt MCU-namn %qs, antar att den bara stödjer ISA:n MSP430.\n"
+"Okänt MCU-namn %qs, antar att den bara stödjer ISA:n MSP430X.\n"
"Använd flaggan %<-mcpu%> för att sätta ISA:n explicit."
#: config/msp430/msp430.c:250
@@ -38383,10 +38352,9 @@ msgid "passing argument %d of %qE discards qualifiers from pointer target type"
msgstr "att skicka argument %d till %qE kastar kvalificerare från pekarmåltyp"
#: config/rs6000/rs6000-c.c:1837
-#, fuzzy, gcc-internal-format
-#| msgid "builtin %qs requires builtin %qs"
+#, gcc-internal-format
msgid "builtin %qs requires 4 arguments"
-msgstr "den inbyggda %qs behöver den inbyggda %qs"
+msgstr "den inbyggda %qs behöver 4 argument"
#: config/rs6000/rs6000-c.c:1913
#, gcc-internal-format
@@ -38404,10 +38372,9 @@ msgid "invalid parameter combination for AltiVec intrinsic %qs"
msgstr "ogiltig parameterkombination för inbyggd %qs i AltiVec"
#: config/rs6000/rs6000-call.c:6385
-#, fuzzy, gcc-internal-format
-#| msgid "deduced class type %qD in function return type"
+#, gcc-internal-format
msgid "invalid use of MMA type %qs as a function return value"
-msgstr "härledd klasstyp %qD i funktionens returtyp"
+msgstr "felaktig användning av MMA-typen %qs i funktionens returvärde"
#: config/rs6000/rs6000-call.c:6437
#, gcc-internal-format
@@ -38430,10 +38397,9 @@ msgid "cannot pass argument in vector register because altivec instructions are
msgstr "det går inte att skicka argument i vektorregister för att altivec-instruktioner är avaktiverade, använd %qs för att aktivera dem"
#: config/rs6000/rs6000-call.c:7598
-#, fuzzy, gcc-internal-format
-#| msgid "invalid operands of types %qT and %qT to binary %qO"
+#, gcc-internal-format
msgid "invalid use of MMA operand of type %qs as a function parameter"
-msgstr "ogiltiga operander av typ %qT och %qT till binär %qO"
+msgstr "felaktig användning av MMA-operand av typ %qs som en funktionsparameter"
#: config/rs6000/rs6000-call.c:7822
#, gcc-internal-format
@@ -38511,10 +38477,9 @@ msgid "argument 2 must be a 2-bit unsigned literal"
msgstr "argument 2 måste vara en 2-bitars litteral utan tecken"
#: config/rs6000/rs6000-call.c:9537
-#, fuzzy, gcc-internal-format
-#| msgid "argument %d must be an unsigned literal"
+#, gcc-internal-format
msgid "argument 2 must be unsigned literal between 2 and 7 inclusive"
-msgstr "argument %d måste vara en litteral utan tecken"
+msgstr "argument 2 måste vara en litteral utan tecken mellan 2 och 7"
#: config/rs6000/rs6000-call.c:9549
#, gcc-internal-format
@@ -38589,34 +38554,29 @@ msgid "builtin %qs needs GLIBC (2.23 and newer) that exports hardware capability
msgstr "den inbyggda %qs behöver GLIBC (2.23 och nyare) som exporterar bitar om hårdvaruegenskaper"
#: config/rs6000/rs6000-call.c:10530
-#, fuzzy, gcc-internal-format
-#| msgid "argument 2 must be a 1-bit unsigned literal"
+#, gcc-internal-format
msgid "argument 4 must be an 8-bit unsigned literal"
-msgstr "argument 2 måste vara en 1-bits litteral utan tecken"
+msgstr "argument 4 måste vara en 8-bitars litteral utan tecken"
#: config/rs6000/rs6000-call.c:10542
-#, fuzzy, gcc-internal-format
-#| msgid "argument 2 must be a 3-bit unsigned literal"
+#, gcc-internal-format
msgid "argument 4 must be a 3-bit unsigned literal"
-msgstr "argument 2 måste vara en 3-bitars litteral utan tecken"
+msgstr "argument 4 måste vara en 3-bitars litteral utan tecken"
#: config/rs6000/rs6000-call.c:10556
-#, fuzzy, gcc-internal-format
-#| msgid "argument 3 must be in the range [0, 15]"
+#, gcc-internal-format
msgid "argument 3 must be in the range 0 to 3"
-msgstr "argument 3 måste vara i intervallet [0, 15]"
+msgstr "argument 3 måste vara i intervallet 0 till 3"
#: config/rs6000/rs6000-call.c:10570
-#, fuzzy, gcc-internal-format
-#| msgid "argument 3 must be in the range [0, 15]"
+#, gcc-internal-format
msgid "argument 3 must be in the range 0 to 12"
-msgstr "argument 3 måste vara i intervallet [0, 15]"
+msgstr "argument 3 måste vara i intervallet 0 till 12"
#: config/rs6000/rs6000-call.c:10590
-#, fuzzy, gcc-internal-format
-#| msgid "argument 3 must be in the range [0, 15]"
+#, gcc-internal-format
msgid "argument 3 must be a constant in the range 0 to 7"
-msgstr "argument 3 måste vara i intervallet [0, 15]"
+msgstr "argument 3 måste vara en konstant i intervallet 0 till 7"
#: config/rs6000/rs6000-call.c:10660
#, gcc-internal-format
@@ -38679,10 +38639,9 @@ msgid "third argument to %qs must be [0, 12]"
msgstr "tredje argumentet till %qs måste vara [0, 12]"
#: config/rs6000/rs6000-call.c:11269
-#, fuzzy, gcc-internal-format
-#| msgid "argument 3 must be in the range [0, 15]"
+#, gcc-internal-format
msgid "Second argument of %qs must be in the range [0, 3]."
-msgstr "argument 3 måste vara i intervallet [0, 15]"
+msgstr "Andra argumentet till %qs måste vara i intervallet [0, 3]."
#: config/rs6000/rs6000-call.c:11487
#, gcc-internal-format
@@ -39129,10 +39088,9 @@ msgid "multiple fast interrupt routines seen: %qE and %qE"
msgstr "flera snabba avbrottsrutiner sedda: %qE och %qE"
#: config/rx/rx.c:2480
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "unrecognized control register number: %d - using %<psw%>"
+#, gcc-internal-format, gfc-internal-format
msgid "invalid control register for mvtc : %d - using 'psw'"
-msgstr "okänt styrregisternummer: %d – använder %<psw%>"
+msgstr "felaktigt styrregister för mvtc : %d – använder ”psw”"
#: config/rx/rx.c:2602
#, gcc-internal-format
@@ -39938,22 +39896,19 @@ msgid "prototype for %q+D follows non-prototype definition"
msgstr "prototyp för %q+D följer på en icke-prototypdefinition"
#: c/c-decl.c:1919
-#, fuzzy, gcc-internal-format
-#| msgid "previous definition of %qD here"
+#, gcc-internal-format
msgid "previous definition of %q+D with type %qT"
-msgstr "tidigare definition av %qD här"
+msgstr "tidigare definition av %qD med typen %qT"
#: c/c-decl.c:1923
-#, fuzzy, gcc-internal-format
-#| msgid "previous implicit declaration of %q+D was here"
+#, gcc-internal-format
msgid "previous implicit declaration of %q+D with type %qT"
-msgstr "tidigare implicit deklaration av %q+D var här"
+msgstr "tidigare implicit deklaration av %q+D med typen %qT"
#: c/c-decl.c:1927
-#, fuzzy, gcc-internal-format
-#| msgid "previous declaration of %qD here"
+#, gcc-internal-format
msgid "previous declaration of %q+D with type %qT"
-msgstr "tidigare deklaration av %qD här"
+msgstr "tidigare deklaration av %q+D med typen %qT"
#: c/c-decl.c:1967
#, gcc-internal-format
@@ -40001,10 +39956,9 @@ msgid "conflicting types for %q+D"
msgstr "motstridiga typer på %q+D"
#: c/c-decl.c:2093 c/c-decl.c:2130
-#, fuzzy, gcc-internal-format
-#| msgid "conflicting types for %q+D"
+#, gcc-internal-format
msgid "conflicting types for %q+D; have %qT"
-msgstr "motstridiga typer på %q+D"
+msgstr "motstridiga typer för %q+D; har %qT"
#: c/c-decl.c:2110
#, gcc-internal-format
@@ -40158,10 +40112,9 @@ msgid "implicit declaration of function %qE"
msgstr "implicit deklaration av funktionen %qE"
#: c/c-decl.c:3402
-#, fuzzy, gcc-internal-format
-#| msgid "include %qs or provide a declaration of %qD"
+#, gcc-internal-format
msgid "include %qs or provide a declaration of %qE"
-msgstr "inkludera %qs eller ge en deklaration av %qD"
+msgstr "inkludera %qs eller ge en deklaration av %qE"
#: c/c-decl.c:3672
#, gcc-internal-format
@@ -40269,10 +40222,9 @@ msgid "%qE attribute applied to %qD with void return type"
msgstr "attributet %qE tillämpat på %qD med returtypen void"
#: c/c-decl.c:4430
-#, fuzzy, gcc-internal-format
-#| msgid "%qE attribute can only be applied to functions or to class or enumeration types"
+#, gcc-internal-format
msgid "%qE attribute can only be applied to functions or to structure, union or enumeration types"
-msgstr "attributet %qE kan bara användas på funktioner eller på klass- eller uppräkningstyper"
+msgstr "attributet %qE kan bara användas på funktioner eller på struktur-, union- eller uppräkningstyper"
#: c/c-decl.c:4695
#, gcc-internal-format
@@ -41280,10 +41232,9 @@ msgid "traditional C rejects ISO C style function definitions"
msgstr "traditionell C tillåter inte ISO C:s stil av funktionsdefinitioner"
#: c/c-decl.c:9674
-#, fuzzy, gcc-internal-format
-#| msgid "ISO C does not support decimal floating-point before C2X"
+#, gcc-internal-format
msgid "ISO C does not support omitting parameter names in function definitions before C2X"
-msgstr "ISO C stödjer inte decimala flyttal före C2X"
+msgstr "ISO C stödjer inte att utelämna parameternamn i funktionsdefinitioner före C2X"
#: c/c-decl.c:9714 c/c-decl.c:9718
#, gcc-internal-format
@@ -42532,22 +42483,19 @@ msgid "no type or storage class may be specified here,"
msgstr "ingen typ eller lagringsklass kan anges här,"
#: c/c-parser.c:11957 cp/parser.c:34642
-#, fuzzy, gcc-internal-format
-#| msgid "unknown property attribute"
+#, gcc-internal-format
msgid "empty property attribute list"
-msgstr "okänt egenskapsattribut"
+msgstr "tom egenskapsattributslista"
#: c/c-parser.c:11971 cp/parser.c:34655
-#, fuzzy, gcc-internal-format
-#| msgid "unknown property attribute"
+#, gcc-internal-format
msgid "missing property attribute"
-msgstr "okänt egenskapsattribut"
+msgstr "saknat egenskapsattribut"
#: c/c-parser.c:12010
-#, fuzzy, gcc-internal-format
-#| msgid "unknown property attribute"
+#, gcc-internal-format
msgid "unknown property attribute %<%s%s%>"
-msgstr "okänt egenskapsattribut"
+msgstr "okänt egenskapsattribut %<%s%s%>"
#: c/c-parser.c:12013 cp/parser.c:34692
#, gcc-internal-format
@@ -42555,22 +42503,19 @@ msgid "unknown property attribute"
msgstr "okänt egenskapsattribut"
#: c/c-parser.c:12022 cp/parser.c:34701
-#, fuzzy, gcc-internal-format
-#| msgid "repeated %<@%> before Objective-C string"
+#, gcc-internal-format
msgid "expected %<=%> after Objective-C %qE"
-msgstr "upprepat %<@%> före Objective-C++-sträng"
+msgstr "%<=%> förväntades efter Objective-C %qE"
#: c/c-parser.c:12033 cp/parser.c:34715
-#, fuzzy, gcc-internal-format
-#| msgid "expected trait selector name"
+#, gcc-internal-format
msgid "expected %qE selector name"
-msgstr "trait-väljarnamn förväntades"
+msgstr "%qE-väljarnamn förväntades"
#: c/c-parser.c:12049 cp/parser.c:34734
-#, fuzzy, gcc-internal-format
-#| msgid "setter name must terminate with %<:%>"
+#, gcc-internal-format
msgid "setter method names must terminate with %<:%>"
-msgstr "setter-namn måste avslutas med %<:%>"
+msgstr "setter-metodnamn måste avslutas med %<:%>"
#: c/c-parser.c:12263 cp/parser.c:44770
#, gcc-internal-format
@@ -42716,10 +42661,9 @@ msgid "%<priority%> value must be non-negative"
msgstr "%<priority%>-värdet måste vara positivt"
#: c/c-parser.c:13891 cp/parser.c:36297
-#, fuzzy, gcc-internal-format
-#| msgid "expected constant integer expression"
+#, gcc-internal-format
msgid "expected constant integer expression with valid sync-hint value"
-msgstr "konstant heltalsuttryck förväntades"
+msgstr "konstant heltalsuttryck med giltigt sync-hint-värde förväntades"
#: c/c-parser.c:13931 cp/parser.c:36339
#, gcc-internal-format
@@ -42997,10 +42941,9 @@ msgid "%<#pragma acc update%> must contain at least one %<device%> or %<host%> o
msgstr "%<#pragma acc update%> måste innehålla åtminstone en %<device%>- eller %<host%>- eller %<self%>-klausul"
#: c/c-parser.c:17328 cp/parser.c:38672
-#, fuzzy, gcc-internal-format
-#| msgid "expected %<operator%>"
+#, gcc-internal-format
msgid "expected %<allocator%>"
-msgstr "%<operator%> förväntades"
+msgstr "%<allocator%> förväntades"
#: c/c-parser.c:17344
#, gcc-internal-format
@@ -43008,16 +42951,14 @@ msgid "%<allocator%> clause allocator expression has type %qT rather than %<omp_
msgstr "%<allocator%>-klausulens allokeraruttryck har typen %qT istället för %<omp_allocator_handle_t%>"
#: c/c-parser.c:17359 cp/parser.c:38687
-#, fuzzy, gcc-internal-format
-#| msgid "%<#pragma vtable%> no longer supported"
+#, gcc-internal-format
msgid "%<#pragma omp allocate%> not yet supported"
-msgstr "%<#pragma vtable%> stödjs inte längre"
+msgstr "%<#pragma omp allocate%> stödjs inte ännu"
#: c/c-parser.c:17458 cp/parser.c:38780
-#, fuzzy, gcc-internal-format
-#| msgid "expected %<depend%>, %<destroy%> or %<update%> clause"
+#, gcc-internal-format
msgid "expected %<read%>, %<write%>, %<update%>, or %<capture%> clause"
-msgstr "%<depend%>-, %<destroy%>- eller %<update%>-klausul förväntades"
+msgstr "%<read%>-, %<write%>-, %<update%>- eller %<capture%>-klausul förväntades"
#: c/c-parser.c:17480 cp/parser.c:38802
#, gcc-internal-format
@@ -43924,28 +43865,24 @@ msgid "type mismatch in conditional expression"
msgstr "typer stämmer inte i villkorsuttryck"
#: c/c-typeck.c:5534
-#, fuzzy, gcc-internal-format
-#| msgid "ignoring return value of %qD, declared with attribute %<nodiscard%>%s"
+#, gcc-internal-format
msgid "ignoring return value of %qD, declared with attribute %<nodiscard%>: %E"
-msgstr "ignorerar returvärdet av %qD, deklarerad med attributet %<nodiscard%>%s"
+msgstr "ignorerar returvärdet av %qD, deklarerad med attributet %<nodiscard%>: %E"
#: c/c-typeck.c:5538
-#, fuzzy, gcc-internal-format
-#| msgid "ignoring return value of %qD, declared with attribute %<nodiscard%>%s"
+#, gcc-internal-format
msgid "ignoring return value of %qD, declared with attribute %<nodiscard%>"
-msgstr "ignorerar returvärdet av %qD, deklarerad med attributet %<nodiscard%>%s"
+msgstr "ignorerar returvärdet av %qD, deklarerad med attributet %<nodiscard%>"
#: c/c-typeck.c:5556
-#, fuzzy, gcc-internal-format
-#| msgid "ignoring returned value of type %qT, declared with attribute %<nodiscard%>%s"
+#, gcc-internal-format
msgid "ignoring return value of type %qT, declared with attribute %<nodiscard%>: %E"
-msgstr "ignorerar returnerat värde av typen %qT, deklarerat med attributet %<nodiscard%>%s"
+msgstr "ignorerar returnerat värde av typen %qT, deklarerat med attributet %<nodiscard%>: %E"
#: c/c-typeck.c:5561
-#, fuzzy, gcc-internal-format
-#| msgid "ignoring returned value of type %qT, declared with attribute %<nodiscard%>%s"
+#, gcc-internal-format
msgid "ignoring return value of type %qT, declared with attribute %<nodiscard%>"
-msgstr "ignorerar returnerat värde av typen %qT, deklarerat med attributet %<nodiscard%>%s"
+msgstr "ignorerar returnerat värde av typen %qT, deklarerat med attributet %<nodiscard%>"
#: c/c-typeck.c:5570 cp/cvt.c:1098
#, gcc-internal-format
@@ -44203,28 +44140,24 @@ msgid "return type might be a candidate for a format attribute"
msgstr "returtypen kan vara en kandidat för ett formatattribut"
#: c/c-typeck.c:7245
-#, fuzzy, gcc-internal-format
-#| msgid "passing argument %d of %qE from incompatible pointer type"
+#, gcc-internal-format
msgid "passing argument %d of %qE from incompatible scalar storage order"
-msgstr "skickar argument %d till %qE från inkompatibel pekartyp"
+msgstr "skickar argument %d till %qE från inkompatibel skalär lagringsordning"
#: c/c-typeck.c:7250
-#, fuzzy, gcc-internal-format
-#| msgid "assignment to %qT from pointer to %qD with incompatible type %qT"
+#, gcc-internal-format
msgid "assignment to %qT from pointer type %qT with incompatible scalar storage order"
-msgstr "tilldelning till %qT från pekare till %qD med inkompatibel typ %qT"
+msgstr "tilldelning till %qT från pekartypen %qT med inkompatibel skalär lagringsordning"
#: c/c-typeck.c:7255
-#, fuzzy, gcc-internal-format
-#| msgid "initialization of %qT from pointer to %qD with incompatible type %qT"
+#, gcc-internal-format
msgid "initialization of %qT from pointer type %qT with incompatible scalar storage order"
-msgstr "initiering av %qT från pekare till %qD med inkompatibel typ %qT"
+msgstr "initiering av %qT från pekartypen %qT med inkompatibel skalär lagringsordning"
#: c/c-typeck.c:7260
-#, fuzzy, gcc-internal-format
-#| msgid "returning %qT from a function with incompatible return type %qT"
+#, gcc-internal-format
msgid "returning %qT from pointer type with incompatible scalar storage order %qT"
-msgstr "returnerar %qT från en funktion med inkompatibel returtyp %qT"
+msgstr "returnerar %qT från en pekartyp med inkompatibel skalär lagringsordning %qT"
#: c/c-typeck.c:7309
#, gcc-internal-format
@@ -44846,10 +44779,9 @@ msgid "high bound %qE above array section size in %qs clause"
msgstr "övre gräns %qE ovanför storleken på vektorsektionen i en %qs-klausul"
#: c/c-typeck.c:13295 cp/semantics.c:5144
-#, fuzzy, gcc-internal-format
-#| msgid "for unknown bound array type length expression must be specified"
+#, gcc-internal-format
msgid "for array function parameter length expression must be specified"
-msgstr "för en vektor med okänd gräns måste ett längduttryck anges"
+msgstr "för en vektorfunktionsparameter måste ett längduttryck anges"
#: c/c-typeck.c:13299 cp/semantics.c:5148
#, gcc-internal-format
@@ -45066,16 +44998,14 @@ msgid "%qE appears more than once in %<nontemporal%> clauses"
msgstr "%qE förekommer mer än en gång i %<nontemporal%>-klausuler"
#: c/c-typeck.c:14432 cp/semantics.c:7283
-#, fuzzy, gcc-internal-format
-#| msgid "%qE is not a variable in %<aligned%> clause"
+#, gcc-internal-format
msgid "%qE is not a variable in %<allocate%> clause"
-msgstr "%qE är inte en variabel i %<aligned%>-klausul"
+msgstr "%qE är inte en variabel i %<allocate%>-klausul"
#: c/c-typeck.c:14438
-#, fuzzy, gcc-internal-format
-#| msgid "%qE appears more than once in %<aligned%> clauses"
+#, gcc-internal-format
msgid "%qE appears more than once in %<allocate%> clauses"
-msgstr "%qE förekommer mer än en gång i %<aligned%>-klausuler"
+msgstr "%qE förekommer mer än en gång i %<allocate%>-klausuler"
#: c/c-typeck.c:14507 cp/semantics.c:7369
#, gcc-internal-format
@@ -45161,10 +45091,9 @@ msgid "%<order%> clause must not be used together with %<ordered%>"
msgstr "en %<order%>-klausul får inte användas tillsammans med %<ordered%>"
#: c/c-typeck.c:14951 cp/semantics.c:7456
-#, fuzzy, gcc-internal-format
-#| msgid "too many %qs clauses"
+#, gcc-internal-format
msgid "too many %qs clauses on a task construct"
-msgstr "för många %qs-klausuler"
+msgstr "för många %qs-klausuler på en task-konstruktion"
#: c/c-typeck.c:15044 cp/semantics.c:8096
#, gcc-internal-format
@@ -45208,10 +45137,9 @@ msgid "%<nogroup%> clause must not be used together with %<reduction%> clause"
msgstr "en %<nogroup%>-klausul får inte användas tillsammans med en %<reduction%>-klausul"
#: c/c-typeck.c:15263 cp/semantics.c:8281
-#, fuzzy, gcc-internal-format
-#| msgid "%<order%> clause must not be used together with %<ordered%>"
+#, gcc-internal-format
msgid "%<detach%> clause must not be used together with %<mergeable%> clause"
-msgstr "en %<order%>-klausul får inte användas tillsammans med %<ordered%>"
+msgstr "en %<detach%>-klausul får inte användas tillsammans med en %<mergeable%>-klausul"
#: c/c-typeck.c:15281 cp/semantics.c:8456
#, gcc-internal-format
@@ -45703,16 +45631,14 @@ msgid "enumerated mismatch in conditional expression: %qT vs %qT"
msgstr "uppräkningsmissmatch i villkorsuttryck: %qT kontra %qT"
#: cp/call.c:5706
-#, fuzzy, gcc-internal-format
-#| msgid "conditional expression between distinct pointer types %qT and %qT lacks a cast"
+#, gcc-internal-format
msgid "conditional expression between enumeration type %qT and floating-point type %qT is deprecated"
-msgstr "villkorsuttryck mellan olika pekartyper %qT och %qT saknar en typkonvertering"
+msgstr "villkorsuttryck mellan uppräkningstypen %qT och flyttalstypen %qT bör undvikas"
#: cp/call.c:5711
-#, fuzzy, gcc-internal-format
-#| msgid "conditional expression between distinct pointer types %qT and %qT lacks a cast"
+#, gcc-internal-format
msgid "conditional expression between floating-point type %qT and enumeration type %qT is deprecated"
-msgstr "villkorsuttryck mellan olika pekartyper %qT och %qT saknar en typkonvertering"
+msgstr "villkorsuttryck mellan flyttalstypen %qT och uppräkningstypen %qT bör undvikas"
#: cp/call.c:5727
#, gcc-internal-format
@@ -45830,10 +45756,9 @@ msgid " initializing argument %P of %qD"
msgstr " initierar argument %P till %qD"
#: cp/call.c:7379
-#, fuzzy, gcc-internal-format
-#| msgid "conversions to arrays of unknown bound are only available with %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "conversions to arrays of unknown bound are only available with %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "konverteringar till vektorer med okänd gräns är endast tillgängliga med %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "konverteringar till vektorer med okänd gräns är endast tillgängliga med %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/call.c:7429
#, gcc-internal-format
@@ -46849,10 +46774,9 @@ msgid "dynamic type %qT of its operand does not have a base class of type %qT"
msgstr "den dynamiska typen %qT av sin operand har inte en basklass av typen %qT"
#: cp/constexpr.c:2014
-#, fuzzy, gcc-internal-format
-#| msgid "virtual table of type %qD violates one definition rule"
+#, gcc-internal-format
msgid "virtual table pointer is used uninitialized"
-msgstr "den virtuella tabellen för typen %qD bryter mot endefinitionsregeln"
+msgstr "den virtuella tabellpekaren används oinitierad"
#: cp/constexpr.c:2045 cp/constexpr.c:2077
#, gcc-internal-format
@@ -46885,10 +46809,9 @@ msgid "array deallocation of object allocated with non-array allocation"
msgstr "vektordeallokering av objekt allokerade med icke-vektor-allokering"
#: cp/constexpr.c:2366 cp/constexpr.c:2388
-#, fuzzy, gcc-internal-format
-#| msgid "allocated here"
+#, gcc-internal-format
msgid "allocation performed here"
-msgstr "allokerad här"
+msgstr "allokeringen utförd här"
#: cp/constexpr.c:2384
#, gcc-internal-format
@@ -47007,70 +46930,59 @@ msgid "accessing %qD member instead of initialized %qD member in constant expres
msgstr "använder medlem %qD istället för initierad medlem %qD i ett konstant uttryck"
#: cp/constexpr.c:3983
-#, fuzzy, gcc-internal-format
-#| msgid "%<typeid%> is not a constant expression because %qE is of polymorphic type"
+#, gcc-internal-format
msgid "%qs is not a constant expression because %qT is a union type"
-msgstr "%<typeid%> är inte ett konstant uttryck eftersom %qE har polymorf typ"
+msgstr "%qs är inte ett konstant uttryck eftersom %qT är en uniontyp"
#: cp/constexpr.c:3986
-#, fuzzy, gcc-internal-format
-#| msgid "%<typeid%> is not a constant expression because %qE is of polymorphic type"
+#, gcc-internal-format
msgid "%qs is not a constant expression because %qT contains a union type"
-msgstr "%<typeid%> är inte ett konstant uttryck eftersom %qE har polymorf typ"
+msgstr "%qs är inte ett konstant uttryck eftersom %qT innehåller en uniontyp"
#: cp/constexpr.c:3997
-#, fuzzy, gcc-internal-format
-#| msgid "%<typeid%> is not a constant expression because %qE is of polymorphic type"
+#, gcc-internal-format
msgid "%qs is not a constant expression because %qT is a pointer type"
-msgstr "%<typeid%> är inte ett konstant uttryck eftersom %qE har polymorf typ"
+msgstr "%qs är inte ett konstant uttryck eftersom %qT är en pekartyp"
#: cp/constexpr.c:4000
-#, fuzzy, gcc-internal-format
-#| msgid "%<typeid%> is not a constant expression because %qE is of polymorphic type"
+#, gcc-internal-format
msgid "%qs is not a constant expression because %qT contains a pointer type"
-msgstr "%<typeid%> är inte ett konstant uttryck eftersom %qE har polymorf typ"
+msgstr "%qs är inte ett konstant uttryck eftersom %qT innehåller en pekartyp"
#: cp/constexpr.c:4011
-#, fuzzy, gcc-internal-format
-#| msgid "%<typeid%> is not a constant expression because %qE is of polymorphic type"
+#, gcc-internal-format
msgid "%qs is not a constant expression because %qT is a reference type"
-msgstr "%<typeid%> är inte ett konstant uttryck eftersom %qE har polymorf typ"
+msgstr "%qs är inte ett konstant uttryck eftersom %qT är en referenstyp"
#: cp/constexpr.c:4014
-#, fuzzy, gcc-internal-format
-#| msgid "%<typeid%> is not a constant expression because %qE is of polymorphic type"
+#, gcc-internal-format
msgid "%qs is not a constant expression because %qT contains a reference type"
-msgstr "%<typeid%> är inte ett konstant uttryck eftersom %qE har polymorf typ"
+msgstr "%qs är inte ett konstant uttryck eftersom %qT innehåller en referenstyp"
#: cp/constexpr.c:4025
-#, fuzzy, gcc-internal-format
-#| msgid "%<typeid%> is not a constant expression because %qE is of polymorphic type"
+#, gcc-internal-format
msgid "%qs is not a constant expression because %qT is a pointer to member type"
-msgstr "%<typeid%> är inte ett konstant uttryck eftersom %qE har polymorf typ"
+msgstr "%qs är inte ett konstant uttryck eftersom %qT är en pekare-till-medlem-typ"
#: cp/constexpr.c:4029
-#, fuzzy, gcc-internal-format
-#| msgid "%<typeid%> is not a constant expression because %qE is of polymorphic type"
+#, gcc-internal-format
msgid "%qs is not a constant expression because %qT contains a pointer to member type"
-msgstr "%<typeid%> är inte ett konstant uttryck eftersom %qE har polymorf typ"
+msgstr "%qs är inte ett konstant uttryck eftersom %qT innehåller en pekare-till-medlem-typ"
#: cp/constexpr.c:4040
-#, fuzzy, gcc-internal-format
-#| msgid "%<typeid%> is not a constant expression because %qE is of polymorphic type"
+#, gcc-internal-format
msgid "%qs is not a constant expression because %qT is volatile"
-msgstr "%<typeid%> är inte ett konstant uttryck eftersom %qE har polymorf typ"
+msgstr "%qs är inte ett konstant uttryck eftersom %qT är volatil"
#: cp/constexpr.c:4043
-#, fuzzy, gcc-internal-format
-#| msgid "%qE is not a constant expression because it refers to mutable subobjects of %qT"
+#, gcc-internal-format
msgid "%qs is not a constant expression because %qT contains a volatile subobject"
-msgstr "%qE är inte ett konstant uttryck eftersom det har referenser till muterbara delobjekt av %qT"
+msgstr "%qs är inte ett konstant uttryck eftersom %qT innehåller ett volatilt delobjekt"
#: cp/constexpr.c:4084
-#, fuzzy, gcc-internal-format
-#| msgid "%qs is not supported on this target"
+#, gcc-internal-format
msgid "%qs cannot be constant evaluated on the target"
-msgstr "%qs stödjs inte på denna målarkitektur"
+msgstr "%qs kan inte inte beräknas konstant på denna målarkitektur"
#: cp/constexpr.c:4093 cp/constexpr.c:4103
#, gcc-internal-format
@@ -47078,22 +46990,19 @@ msgid "%qs cannot be constant evaluated because the type is too large"
msgstr "%qs kan inte vara konstant beräknat eftersom typen är för stor"
#: cp/constexpr.c:4123
-#, fuzzy, gcc-internal-format
-#| msgid "%qE is not a constant expression because allocated storage has not been deallocated"
+#, gcc-internal-format
msgid "%qs cannot be constant evaluated because the argument cannot be encoded"
-msgstr "%qE är inte ett konstant uttryck eftersom allokerad lagring inte har avallokerats"
+msgstr "%qs kan inte beräknas konstant eftersom argumentet inte kan kodas"
#: cp/constexpr.c:4147
-#, fuzzy, gcc-internal-format
-#| msgid "accessing uninitialized member %qD"
+#, gcc-internal-format
msgid "%qs accessing uninitialized byte at offset %d"
-msgstr "använder oinitierad medlem %qD"
+msgstr "%qs använder oinitierad byte vid avståndet %d"
#: cp/constexpr.c:4159
-#, fuzzy, gcc-internal-format
-#| msgid "%qE is not a constant expression because allocated storage has not been deallocated"
+#, gcc-internal-format
msgid "%qs cannot be constant evaluated because the argument cannot be interpreted"
-msgstr "%qE är inte ett konstant uttryck eftersom allokerad lagring inte har avallokerats"
+msgstr "%qs kan inte beräknas konstant eftersom argumentet inte kan tolkas"
#: cp/constexpr.c:4882 cp/constexpr.c:6667
#, gcc-internal-format
@@ -47186,10 +47095,9 @@ msgid "inline assembly is not a constant expression"
msgstr "inline-assembler är inte ett konstant uttryck"
#: cp/constexpr.c:5927
-#, fuzzy, gcc-internal-format
-#| msgid "only unevaluated inline assembly is allowed in a %<constexpr%> function in C++2a"
+#, gcc-internal-format
msgid "only unevaluated inline assembly is allowed in a %<constexpr%> function in C++20"
-msgstr "endast oevaluerad inline:ad assembler är tillåten i en %<constexpr%>-funktion i C++2a"
+msgstr "endast oevaluerad inline:ad assembler är tillåten i en %<constexpr%>-funktion i C++20"
#: cp/constexpr.c:5992
#, gcc-internal-format
@@ -47242,10 +47150,9 @@ msgid "function concept must be called"
msgstr "funktionskoncept måste anropas"
#: cp/constexpr.c:6924
-#, fuzzy, gcc-internal-format
-#| msgid "size of array %qE is not a constant expression"
+#, gcc-internal-format
msgid "address of a call to %qs is not a constant expression"
-msgstr "storlek på vektorn %qE är inte ett konstant uttryck"
+msgstr "adressen för ett anrop av %qs är inte ett konstant uttryck"
#: cp/constexpr.c:6943
#, gcc-internal-format
@@ -47313,10 +47220,9 @@ msgid "lambda-expression is not a constant expression before C++17"
msgstr "lambdauttryck är inte ett konstant uttryck före C++17"
#: cp/constexpr.c:8384
-#, fuzzy, gcc-internal-format
-#| msgid "virtual functions cannot be %<constexpr%> before C++2a"
+#, gcc-internal-format
msgid "virtual functions cannot be %<constexpr%> before C++20"
-msgstr "virtuella funktioner kan inte %<constexpr%> före C++2a"
+msgstr "virtuella funktioner kan inte %<constexpr%> före C++20"
#: cp/constexpr.c:8399
#, gcc-internal-format
@@ -47359,10 +47265,9 @@ msgid "%<goto%> is not a constant expression"
msgstr "%<goto%> är inte ett konstant uttryck"
#: cp/constexpr.c:8795
-#, fuzzy, gcc-internal-format
-#| msgid "statement is not a constant expression"
+#, gcc-internal-format
msgid "label definition is not a constant expression"
-msgstr "satsen är inte ett konstant uttryck"
+msgstr "etiketdefinitionen är inte ett konstant uttryck"
# ast = abstract syntax tree
#: cp/constexpr.c:8814
@@ -48011,34 +47916,29 @@ msgid "previous specification in %q#D here"
msgstr "tidigare specifikation i %q#D här"
#: cp/decl.c:2025
-#, fuzzy, gcc-internal-format
-#| msgid "declaration of %q#D conflicts with built-in declaration %q#D"
+#, gcc-internal-format
msgid "declaration %qD conflicts with builtin"
-msgstr "deklaration av %q#D står i konflikt med inbyggd deklaration %q#D"
+msgstr "deklarationen %qD står i konflikt med inbyggd"
#: cp/decl.c:2033
-#, fuzzy, gcc-internal-format
-#| msgid "declaration of %q#D conflicts with built-in declaration %q#D"
+#, gcc-internal-format
msgid "declaration %qD conflicts with import"
-msgstr "deklaration av %q#D står i konflikt med inbyggd deklaration %q#D"
+msgstr "deklaration %qD står i konflikt med import"
#: cp/decl.c:2034
-#, fuzzy, gcc-internal-format
-#| msgid "%qT first declared as %qs here"
+#, gcc-internal-format
msgid "import declared %q#D here"
-msgstr "%qT är först deklarerad som %qs här"
+msgstr "importdeklarerad %q#D här"
#: cp/decl.c:2042
-#, fuzzy, gcc-internal-format
-#| msgid "conflicting declaration %q#D"
+#, gcc-internal-format
msgid "conflicting exporting declaration %qD"
-msgstr "motstridande deklaration av %q#D"
+msgstr "motstridande exporterande deklaration av %qD"
#: cp/decl.c:2043
-#, fuzzy, gcc-internal-format
-#| msgid "previous declaration of %qD here"
+#, gcc-internal-format
msgid "previous declaration %q#D here"
-msgstr "tidigare deklaration av %qD här"
+msgstr "tidigare deklaration %q#D här"
#: cp/decl.c:2068
#, gcc-internal-format
@@ -48061,10 +47961,9 @@ msgid "redundant redeclaration of %qD in same scope"
msgstr "överflödig omdeklaration av %qD i samma definitionsområde"
#: cp/decl.c:2144
-#, fuzzy, gcc-internal-format
-#| msgid "deleted definition of %qD"
+#, gcc-internal-format
msgid "deleted definition of %qD is not first declaration"
-msgstr "borttagen definition av %qD"
+msgstr "borttagen definition av %qD är inte första deklarationen"
#. From [temp.expl.spec]:
#.
@@ -48111,10 +48010,9 @@ msgid "%q+D redeclared inline without %<gnu_inline%> attribute"
msgstr "%q+D omdeklarerad inline utan attributet %<gnu_inline%>"
#: cp/decl.c:3080 cp/decl.c:3138
-#, fuzzy, gcc-internal-format
-#| msgid "deduction guide %qD must be declared at namespace scope"
+#, gcc-internal-format
msgid "deduction guide %q+D redeclared"
-msgstr "härledningsguiden %qD måste deklareras med namnrymdsräckvidd"
+msgstr "härledningsguiden %q+D omdeklarerad"
#: cp/decl.c:3087
#, gcc-internal-format
@@ -48608,10 +48506,9 @@ msgid "missing braces around initializer for %qT"
msgstr "klamrar saknas runt initierare för %qT"
#: cp/decl.c:6779
-#, fuzzy, gcc-internal-format
-#| msgid "structured binding refers to incomplete type %qT"
+#, gcc-internal-format
msgid "structured binding has incomplete type %qT"
-msgstr "strukturerad bindning refererar till ofullständig typ %qT"
+msgstr "strukturerad bindning har en ofullständig typ %qT"
#: cp/decl.c:6793
#, gcc-internal-format
@@ -49495,10 +49392,9 @@ msgid "member %qD cannot be declared both %<virtual%> and %<static%>"
msgstr "medlem %qD kan inte deklareras både %<virtual%> och %<static%>"
#: cp/decl.c:11866
-#, fuzzy, gcc-internal-format
-#| msgid "member %qD can be declared both %<virtual%> and %<constexpr%> only in %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "member %qD can be declared both %<virtual%> and %<constexpr%> only in %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "medlem %qD kan deklareras både %<virtual%> och %<constexpr%> endast i %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "medlem %qD kan deklareras både %<virtual%> och %<constexpr%> endast i %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/decl.c:11879
#, gcc-internal-format
@@ -49532,10 +49428,9 @@ msgid "structured binding declaration cannot be %qs"
msgstr "deklaration av strukturerad bindning får inte vara %qs"
#: cp/decl.c:11957 cp/decl.c:11979
-#, fuzzy, gcc-internal-format
-#| msgid "structured binding declaration can be %qs only in %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "structured binding declaration can be %qs only in %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "strukturerade bindningsdeklarationer kan vara %qs endast i %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "strukturerade bindningsdeklarationer kan vara %qs endast i %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/decl.c:11967
#, gcc-internal-format
@@ -49603,10 +49498,9 @@ msgid "unnecessary parentheses in declaration of %qs"
msgstr "onödiga parenteser i deklaration av %qs"
#: cp/decl.c:12203
-#, fuzzy, gcc-internal-format
-#| msgid "Expected left parenthesis"
+#, gcc-internal-format
msgid "remove parentheses"
-msgstr "Vänsterparentes förväntades"
+msgstr "ta port parenteser"
#: cp/decl.c:12252
#, gcc-internal-format
@@ -49694,10 +49588,9 @@ msgid "%qT as type rather than plain %<decltype(auto)%>"
msgstr "%qT som en typ snarare en enkel %<decltype(auto)%>"
#: cp/decl.c:12418 cp/pt.c:29493
-#, fuzzy, gcc-internal-format
-#| msgid "destructors may not be cv-qualified"
+#, gcc-internal-format
msgid "%<decltype(auto)%> cannot be cv-qualified"
-msgstr "destruerare får inte vara cv-kvalificerade"
+msgstr "%<decltype(auto)%> får inte vara cv-kvalificerad"
#: cp/decl.c:12450
#, gcc-internal-format
@@ -49980,16 +49873,14 @@ msgid "cannot declare a parameter with %<decltype(auto)%>"
msgstr "det går inte att deklarera en parameter med %<decltype(auto)%>"
#: cp/decl.c:13263
-#, fuzzy, gcc-internal-format
-#| msgid "%<auto%> parameter not permitted in this context"
+#, gcc-internal-format
msgid "class template placeholder %qE not permitted in this context"
-msgstr "en %<auto%>-parameter är tillåten i detta sammanhang"
+msgstr "klassmallplatshållaren %qE är tillåten i detta sammanhang"
#: cp/decl.c:13266
-#, fuzzy, gcc-internal-format
-#| msgid "%qD is not a function template"
+#, gcc-internal-format
msgid "use %<auto%> for an abbreviated function template"
-msgstr "%qD är inte en funktionsmall"
+msgstr "använd %<auto%> för en förkortad funktionsmall"
#: cp/decl.c:13271
#, gcc-internal-format
@@ -50058,10 +49949,9 @@ msgid "a destructor cannot be %qs"
msgstr "en destruerare kan inte vara %qs"
#: cp/decl.c:13444
-#, fuzzy, gcc-internal-format
-#| msgid "%<constexpr%> destructors only available with %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "%<constexpr%> destructors only available with %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "%<constexpr%>-destruerare är endast tillgängliga med %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "%<constexpr%>-destruerare är endast tillgängliga med %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/decl.c:13457
#, gcc-internal-format
@@ -50284,8 +50174,7 @@ msgid "%qD may not be declared as static"
msgstr "%qD får inte deklareras som statisk"
#: cp/decl.c:14658
-#, fuzzy, gcc-internal-format
-#| msgid "%qD must be a nonstatic member function"
+#, gcc-internal-format
msgid "%qD must be a non-static member function"
msgstr "%qD måste vara en icke-statisk medlemsfunktion"
@@ -50476,10 +50365,9 @@ msgid "redeclaration of %qT as a non-template"
msgstr "omdeklaration av %qT som en icke-mall"
#: cp/decl.c:15241 cp/semantics.c:3266
-#, fuzzy, gcc-internal-format
-#| msgid "cannot declare %qD to be a bit-field type"
+#, gcc-internal-format
msgid "cannot declare %qD in a different module"
-msgstr "det går inte att deklarera %qD att vara en bitfältstyp"
+msgstr "det går inte att deklarera %qD i en annan modul"
#: cp/decl.c:15369
#, gcc-internal-format
@@ -50533,10 +50421,9 @@ msgid "different underlying type in enum %q#T"
msgstr "olika underliggande typ i enum %q#T"
#: cp/decl.c:15618
-#, fuzzy, gcc-internal-format
-#| msgid "option %s with different values"
+#, gcc-internal-format
msgid "cannot define %qD in different module"
-msgstr "flaggan %s med olika värden"
+msgstr "det går inte att definiera %qD i en annan modul"
#: cp/decl.c:15692
#, gcc-internal-format
@@ -50608,10 +50495,9 @@ msgid "only plain %<auto%> return type can be deduced to %<void%>"
msgstr "endast enkel returtyp %<auto%> kan härledas till %<void%>"
#: cp/decl.c:17323
-#, fuzzy, gcc-internal-format
-#| msgid "no return statement in function returning non-void"
+#, gcc-internal-format
msgid "no return statement in %<constexpr%> function returning non-void"
-msgstr "ingen retursats i funktion som returnerar icke-void"
+msgstr "ingen retursats i %<constexpr%>-funktion som returnerar icke-void"
#: cp/decl.c:17505
#, gcc-internal-format
@@ -51169,16 +51055,14 @@ msgid "cannot catch type %qT because it involves types of variable size"
msgstr "det går inte att fånga typen %qT eftersom typer av variabel storlek är inblandade"
#: cp/except.c:982
-#, fuzzy, gcc-internal-format
-#| msgid "exception of type %qT will be caught"
+#, gcc-internal-format
msgid "exception of type %qT will be caught by earlier handler"
-msgstr "undantag av typ %qT kommer att fångas"
+msgstr "undantag av typ %qT kommer att fångas av en tidigare hanterare"
#: cp/except.c:984
-#, fuzzy, gcc-internal-format
-#| msgid "forming type of %qs"
+#, gcc-internal-format
msgid "for type %qT"
-msgstr "formar typen av %qs"
+msgstr "för typen %qT"
#: cp/except.c:1013
#, gcc-internal-format
@@ -51508,10 +51392,9 @@ msgid "placement new constructing an object of type %<%T [%wu]%> and size %qwu i
msgstr "placerande new konstruerar ett objekt av typen %<%T [%wu]%> och storleken %qwu i en region av typen %qT och storleken %qwi"
#: cp/init.c:2636
-#, fuzzy, gcc-internal-format
-#| msgid "placement new constructing an object of type %<%T [%wu]%> and size %qwu in a region of type %qT and size %qwi"
+#, gcc-internal-format
msgid "placement new constructing an object of type %<%T [%wu]%> and size %qwu in a region of type %qT and size at most %qwu"
-msgstr "placerande new konstruerar ett objekt av typen %<%T [%wu]%> och storleken %qwu i en region av typen %qT och storleken %qwi"
+msgstr "placerande new konstruerar ett objekt av typen %<%T [%wu]%> och storleken %qwu i en region av typen %qT och storleken högst %qwu"
#: cp/init.c:2646
#, gcc-internal-format
@@ -51519,10 +51402,9 @@ msgid "placement new constructing an array of objects of type %qT and size %qwu
msgstr "placerande new konstruerar en vektor av objekt av typen %qT och storleken %qwu i en region av typen %qT och storleken %qwi"
#: cp/init.c:2649
-#, fuzzy, gcc-internal-format
-#| msgid "placement new constructing an array of objects of type %qT and size %qwu in a region of type %qT and size %qwi"
+#, gcc-internal-format
msgid "placement new constructing an array of objects of type %qT and size %qwu in a region of type %qT and size at most %qwu"
-msgstr "placerande new konstruerar en vektor av objekt av typen %qT och storleken %qwu i en region av typen %qT och storleken %qwi"
+msgstr "placerande new konstruerar en vektor av objekt av typen %qT och storleken %qwu i en region av typen %qT och storleken högst %qwu"
#: cp/init.c:2658
#, gcc-internal-format
@@ -51530,22 +51412,19 @@ msgid "placement new constructing an object of type %qT and size %qwu in a regio
msgstr "placerande new konstruerar ett objekt av typen %qT och storleken %qwu i en region av typen %qT och storleken %qwi"
#: cp/init.c:2661
-#, fuzzy, gcc-internal-format
-#| msgid "placement new constructing an object of type %qT and size %qwu in a region of type %qT and size %qwi"
+#, gcc-internal-format
msgid "placement new constructing an object of type %qT and size %qwu in a region of type %qT and size at most %qwu"
-msgstr "placerande new konstruerar ett objekt av typen %qT och storleken %qwu i en region av typen %qT och storleken %qwi"
+msgstr "placerande new konstruerar ett objekt av typen %qT och storleken %qwu i en region av typen %qT och storleken högst %qwu"
#: cp/init.c:2678
-#, fuzzy, gcc-internal-format
-#| msgid "at offset %s to object %qD declared here"
+#, gcc-internal-format
msgid "at offset %wi from %qD declared here"
-msgstr "vid avstånd %s till objekt %qD deklarerat här"
+msgstr "vid avståndet %wi från %qD deklarerad här"
#: cp/init.c:2682
-#, fuzzy, gcc-internal-format
-#| msgid "at offset %s to object %qD declared here"
+#, gcc-internal-format
msgid "at offset [%wi, %wi] from %qD declared here"
-msgstr "vid avstånd %s till objekt %qD deklarerat här"
+msgstr "vid avståndet [%wi, %wi] från %qD deklarerad här"
#: cp/init.c:2897
#, gcc-internal-format
@@ -51858,10 +51737,9 @@ msgid "forming type of %qs"
msgstr "formar typen av %qs"
#: cp/method.c:1140
-#, fuzzy, gcc-internal-format
-#| msgid "defaulted %qD only available with %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "defaulted %qD only available with %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "standarddefinierad %qD är endast tillgänglig med %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "standarddefinierad %qD är endast tillgänglig med %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/method.c:1155
#, gcc-internal-format
@@ -51914,10 +51792,9 @@ msgid "cannot default compare anonymous union member"
msgstr "det går inte att standardjämföra en anonym unions medlem"
#: cp/method.c:1436
-#, fuzzy, gcc-internal-format
-#| msgid "cannot default compare reference member %qD"
+#, gcc-internal-format
msgid "cannot default compare flexible array member"
-msgstr "det går inte att standardjämföra referensmedlemmen %qD"
+msgstr "det går inte att standardjämföra en flexibel vektormedlem"
#. Return type is auto, suggest changing it.
#: cp/method.c:1487
@@ -51931,10 +51808,9 @@ msgid "three-way comparison of %qD has type %qT, not a comparison category type"
msgstr "trevägsjämförelsen av %qD har typen %qT, inte en jämförelsekategorityp"
#: cp/method.c:1522
-#, fuzzy, gcc-internal-format
-#| msgid "three-way comparison of %qD has type %qT, not a comparison category type"
+#, gcc-internal-format
msgid "three-way comparison of %qD has type %qT, which does not convert to %qT"
-msgstr "trevägsjämförelsen av %qD har typen %qT, inte en jämförelsekategorityp"
+msgstr "trevägsjämförelsen av %qD har typen %qT, som inte konverterar till %qT"
#: cp/method.c:1779
#, gcc-internal-format
@@ -52097,10 +51973,9 @@ msgid "%s %s %p %d"
msgstr "%s %s %p %d"
#: cp/name-lookup.c:4962
-#, fuzzy, gcc-internal-format
-#| msgid "%qD does not have integral type"
+#, gcc-internal-format
msgid "%q#D does not have external linkage"
-msgstr "%qD har inte heltalstyp"
+msgstr "%q#D har inte extern länkning"
#: cp/name-lookup.c:4964 cp/parser.c:11125 cp/parser.c:11135
#: cp/semantics.c:3718 cp/semantics.c:3730
@@ -52109,10 +51984,9 @@ msgid "%q#D declared here"
msgstr "%q#D är deklarerad här"
#: cp/name-lookup.c:5706
-#, fuzzy, gcc-internal-format
-#| msgid "%<%T::%D%> names destructor"
+#, gcc-internal-format
msgid "%<%T%s%D%> names destructor"
-msgstr "%<%T::%D%> namnger en destruerare"
+msgstr "%<%T%s%D%> namnger en destruerare"
#: cp/name-lookup.c:5722
#, gcc-internal-format
@@ -52120,22 +51994,19 @@ msgid "using-declaration for non-member at class scope"
msgstr "using-deklaration för icke-medlem vid klassräckvidd"
#: cp/name-lookup.c:5730
-#, fuzzy, gcc-internal-format
-#| msgid "%<asm%> in %<constexpr%> function only available with %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "%<using%> with enumeration scope %q#T only available with %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "%<asm%> i en %<constexpr%>-funktion är endast tillgängligt med %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "%<using%> med uppräkningsräckvidd %qT är endast tillgängligt med %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/name-lookup.c:5746 cp/pt.c:18183
-#, fuzzy, gcc-internal-format
-#| msgid "%qE is not a class, namespace, or enumeration"
+#, gcc-internal-format
msgid "%qT is not a class, namespace, or enumeration"
-msgstr "%qE är inte en klass, namnrymd eller uppräkning"
+msgstr "%qT är inte en klass, namnrymd eller uppräkning"
#: cp/name-lookup.c:5756
-#, fuzzy, gcc-internal-format
-#| msgid "non-member-template declaration of %qD"
+#, gcc-internal-format
msgid "non-member using-declaration names constructor of %qT"
-msgstr "icke-medlemsmalldeklaration av %qD"
+msgstr "icke-medlems using-deklaration namnger konstrueraren för %qT"
#: cp/name-lookup.c:5767 cp/name-lookup.c:5825
#, gcc-internal-format
@@ -52143,22 +52014,19 @@ msgid "using-declaration for member at non-class scope"
msgstr "using-deklaration för medlem vid icke-klass-räckvidd"
#: cp/name-lookup.c:5790
-#, fuzzy, gcc-internal-format
-#| msgid "type %qT is not a direct base of %qT"
+#, gcc-internal-format
msgid "%qT is not a direct base of %qT"
-msgstr "typ %qT är inte en direkt bas till %qT"
+msgstr "%qT är inte en direkt bas till %qT"
#: cp/name-lookup.c:5835
-#, fuzzy, gcc-internal-format
-#| msgid "did you mean to use logical not (%<!%>)?"
+#, gcc-internal-format
msgid "did you mean %<using enum %T::%D%>?"
-msgstr "tänkte du använda logiskt icke (%<!%>)?"
+msgstr "menade du %<using enum %T::%D%>?"
#: cp/name-lookup.c:5847
-#, fuzzy, gcc-internal-format
-#| msgid "%qD has not been declared in %qE"
+#, gcc-internal-format
msgid "%qD has not been declared in %qD"
-msgstr "%qD har inte deklarerats i %qE"
+msgstr "%qD har inte deklarerats i %qD"
#: cp/name-lookup.c:5861
#, gcc-internal-format
@@ -52299,16 +52167,14 @@ msgid "%qD defined here"
msgstr "%qD definierades här"
#: cp/name-lookup.c:9063
-#, fuzzy, gcc-internal-format
-#| msgid "%qD conflicts with used function"
+#, gcc-internal-format
msgid "%s namespace %qD conflicts with reachable definition"
-msgstr "%qD står i konflikt med använd funktion"
+msgstr "%s-namnrymd %qD står i konflikt med nåbar definition"
#: cp/name-lookup.c:9065
-#, fuzzy, gcc-internal-format, gfc-internal-format
-#| msgid "previous definition here"
+#, gcc-internal-format, gfc-internal-format
msgid "reachable %s definition here"
-msgstr "tidigare definition här"
+msgstr "nåbar %s-definition här"
#: cp/name-lookup.c:9145
#, gcc-internal-format
@@ -52552,16 +52418,14 @@ msgid "C++11 %<noexcept%> only available with %<-std=c++11%> or %<-std=gnu++11%>
msgstr "C++11 %<noexcept%> är endast tillgängligt med %<-std=c++11%> eller %<-std=gnu++11%>"
#: cp/parser.c:3473
-#, fuzzy, gcc-internal-format
-#| msgid "%<__GIMPLE%> only valid with %<-fgimple%>"
+#, gcc-internal-format
msgid "%qE only available with %<-fmodules-ts%>"
-msgstr "%<__GIMPLE%> är endast giltigt med %<-fgimple%>"
+msgstr "%qE är endast tillgängligt med %<-fmodules-ts%>"
#: cp/parser.c:3475
-#, fuzzy, gcc-internal-format
-#| msgid "%qE is an unrecognized format function type"
+#, gcc-internal-format
msgid "%qE was not recognized as a module control-line"
-msgstr "%qE är en okänd funktionsformattyp"
+msgstr "%qE kändes inte igen som en modulstyrrad"
#: cp/parser.c:3481
#, gcc-internal-format
@@ -52569,22 +52433,19 @@ msgid "C++11 %<thread_local%> only available with %<-std=c++11%> or %<-std=gnu++
msgstr "C++11 %<thread_local%> är endast tillgängligt med %<-std=c++11%> eller %<-std=gnu++11%>"
#: cp/parser.c:3484
-#, fuzzy, gcc-internal-format
-#| msgid "C++20 %<constinit%> only available with %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "C++20 %<constinit%> only available with %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "C++20 %<constinit%> är endast tillgängligt med %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "C++20 %<constinit%> är endast tillgängligt med %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/parser.c:3487
-#, fuzzy, gcc-internal-format
-#| msgid "%<concept%> only available with %<-std=c++2a%> or %<-fconcepts%>"
+#, gcc-internal-format
msgid "%<concept%> only available with %<-std=c++20%> or %<-fconcepts%>"
-msgstr "%<concept%> är endast tillgängligt med %<-std=c++2a%> eller %<-fconcepts%>"
+msgstr "%<concept%> är endast tillgängligt med %<-std=c++20%> eller %<-fconcepts%>"
#: cp/parser.c:3490 cp/parser.c:28654
-#, fuzzy, gcc-internal-format
-#| msgid "%<requires%> only available with %<-std=c++2a%> or %<-fconcepts%>"
+#, gcc-internal-format
msgid "%<requires%> only available with %<-std=c++20%> or %<-fconcepts%>"
-msgstr "%<requires%> är endast tillgängligt med %<-std=c++2a%> eller %<-fconcepts%>"
+msgstr "%<requires%> är endast tillgängligt med %<-std=c++20%> eller %<-fconcepts%>"
#: cp/parser.c:3512
#, gcc-internal-format
@@ -52792,10 +52653,9 @@ msgid "%<~auto%> only available with %<-std=c++14%> or %<-std=gnu++14%>"
msgstr "%<~auto%> är endast tillgängligt med %<-std=c++14%> eller %<-std=gnu++14%>"
#: cp/parser.c:6334
-#, fuzzy, gcc-internal-format
-#| msgid "keyword %<template%> not allowed in declarator-id"
+#, gcc-internal-format
msgid "template-id not allowed for destructor"
-msgstr "nyckelordet %<template%> är inte tillåtet i deklarerar-id"
+msgstr "mall-id är inte tillåtet för destruerare"
#: cp/parser.c:6443
#, gcc-internal-format
@@ -52978,16 +52838,14 @@ msgid "types may not be defined within %<__builtin_offsetof%>"
msgstr "typer får inte definieras i %<__builtin_offsetof%>"
#: cp/parser.c:10790
-#, fuzzy, gcc-internal-format
-#| msgid "lambda-expression in unevaluated context only available with %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "lambda-expression in unevaluated context only available with %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "lambdauttryck i oberäknade sammanhang är endast tillgängliga med %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "lambdauttryck i oberäknade sammanhang är endast tillgängliga med %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/parser.c:10800
-#, fuzzy, gcc-internal-format
-#| msgid "lambda-expression in template-argument only available with %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "lambda-expression in template-argument only available with %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "lambdauttryck i mallargument är endast tillgängliga med %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "lambdauttryck i mallargument är endast tillgängliga med %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/parser.c:10952
#, gcc-internal-format
@@ -53020,10 +52878,9 @@ msgid "%<this%> cannot be captured by reference"
msgstr "det går inte att fånga %<this%> via referens"
#: cp/parser.c:11048
-#, fuzzy, gcc-internal-format
-#| msgid "pack init-capture only available with %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "pack init-capture only available with %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "pack init-fångst är endast tillgängliga med %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "pack init-fångst är endast tillgängliga med %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/parser.c:11059
#, gcc-internal-format
@@ -53071,10 +52928,9 @@ msgid "lambda templates are only available with %<-std=c++14%> or %<-std=gnu++14
msgstr "lambdamallar är endast tillgängliga med %<-std=c++14%> eller %<-std=gnu++14%>"
#: cp/parser.c:11266
-#, fuzzy, gcc-internal-format
-#| msgid "lambda templates are only available with %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "lambda templates are only available with %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "lambdamallar är endast tillgängliga med %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "lambdamallar är endast tillgängliga med %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/parser.c:11334
#, gcc-internal-format
@@ -53169,10 +53025,9 @@ msgid "use non-reference type %qT to make the copy explicit or %qT to prevent co
msgstr "användning av icke-referens-typ %qT för att göra kopieringen explicit eller %qT för att förhindra kopiering"
#: cp/parser.c:12904
-#, fuzzy, gcc-internal-format
-#| msgid "Loop variable at %C cannot be a coarray"
+#, gcc-internal-format
msgid "loop variable %qD creates a copy from type %qT"
-msgstr "Slingvariabel vid %C får inte vara en co-vektor"
+msgstr "slingvariabeln %qD skapar en kopia från typen %qT"
#: cp/parser.c:12909
#, gcc-internal-format
@@ -53195,10 +53050,9 @@ msgid "expected iteration-statement"
msgstr "iterationssats förväntades"
#: cp/parser.c:13325
-#, fuzzy, gcc-internal-format
-#| msgid "range-based %<for%> loops with initializer only available with %<-std=c++2a%> or %<-std=gnu++2a%>"
+#, gcc-internal-format
msgid "range-based %<for%> loops with initializer only available with %<-std=c++20%> or %<-std=gnu++20%>"
-msgstr "intervallbaserade %<for%>-slingor med initierare är endast tillgängliga med %<-std=c++2a%> eller %<-std=gnu++2a%>"
+msgstr "intervallbaserade %<for%>-slingor med initierare är endast tillgängliga med %<-std=c++20%> eller %<-std=gnu++20%>"
#: cp/parser.c:13349
#, gcc-internal-format
@@ -53222,10 +53076,9 @@ msgid "expected jump-statement"
msgstr "hoppsats förväntades"
#: cp/parser.c:13678
-#, fuzzy, gcc-internal-format
-#| msgid "expected template-name"
+#, gcc-internal-format
msgid "expected module-name"
-msgstr "mallnamn förväntades"
+msgstr "modulnamn förväntades"
#: cp/parser.c:13732
#, gcc-internal-format
diff --git a/gcc/spellcheck.c b/gcc/spellcheck.c
index f76e094..c39c507 100644
--- a/gcc/spellcheck.c
+++ b/gcc/spellcheck.c
@@ -473,7 +473,7 @@ static const char * const test_data[] = {
"foo",
"food",
"boo",
- "1234567890123456789012345678901234567890123456789012345678901234567890"
+ "1234567890123456789012345678901234567890123456789012345678901234567890",
"abc",
"ac",
"ca",
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7ed0052..5e6b536 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,214 @@
+2021-03-16 Christophe Lyon <christophe.lyon@linaro.org>
+
+ PR target/99542
+ * gcc.dg/declare-simd.c (fn2): Expect a warning only under lp64.
+
+2021-03-16 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/nontype-float1.C: New test.
+
+2021-03-16 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/98092
+ PR target/98092
+ * gcc.target/powerpc/pr98092.c: New.
+
+2021-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/99600
+ * gcc.target/i386/pr99600.c: New test.
+
+2021-03-16 Martin Liska <mliska@suse.cz>
+ Jason Merrill <jason@redhat.com>
+
+ PR c++/99108
+ * g++.target/i386/pr99108.C: New test.
+
+2021-03-16 Martin Liska <mliska@suse.cz>
+
+ PR target/99592
+ * gcc.target/arm/pr99592.c: New test.
+
+2021-03-16 Ilya Leoshkevich <iii@linux.ibm.com>
+
+ * gcc.target/s390/vector/long-double-asm-fprvrmem.c: New test.
+
+2021-03-16 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/99496
+ * g++.dg/modules/pr99496_a.H: New.
+ * g++.dg/modules/pr99496_b.C: New.
+
+2021-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/99563
+ * gcc.target/i386/avx-pr99563.c: New test.
+
+2021-03-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/99542
+ * 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.
+
+2021-03-15 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.
+
+2021-03-15 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/99601
+ * g++.dg/modules/builtin-3_a.C: Fix lp64 x86 detection.
+ * g++.dg/modules/builtin-3_b.C: Fix lp64 x86 detection.
+
+2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/99047
+ * g++.dg/coroutines/pr99047.C: New test.
+
+2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/98704
+ * g++.dg/coroutines/torture/pr98704.C: New test.
+
+2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ 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.
+
+2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR c++/96749
+ * g++.dg/coroutines/pr96749-1.C: New test.
+ * g++.dg/coroutines/pr96749-2.C: New test.
+
+2021-03-15 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/98834
+ * g++.dg/opt/pr98834.C: New testcase.
+
+2021-03-15 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/99345
+ * gfortran.dg/do_check_16.f90: New test.
+ * gfortran.dg/do_check_17.f90: New test.
+
+2021-03-15 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/99545
+ * gfortran.dg/pr99545.f90: New test.
+
+2021-03-15 David Edelsohn <dje.gcc@gmail.com>
+
+ * gcc.target/powerpc/pr99492.c: Fix typo.
+
+2021-03-14 Harald Anlauf <anlauf@gmx.de>
+ Paul Thomas <pault@gcc.gnu.org>
+
+ * gfortran.dg/pr99112.f90: New test.
+
+2021-03-13 Martin Sebor <msebor@redhat.com>
+
+ PR tree-optimization/99489
+ * gcc.dg/Wstringop-truncation-9.c: New test.
+
+2021-03-13 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/99125
+ * gfortran.dg/alloc_deferred_comp_1.f90: New test.
+
+2021-03-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/99544
+ * gcc.dg/gomp/pr99544.c: New test.
+
+2021-03-12 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/99238
+ * g++.dg/modules/pr99238.h: New.
+ * g++.dg/modules/pr99238_a.H: New.
+ * g++.dg/modules/pr99238_b.H: New.
+
+2021-03-12 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/99514
+ * gfortran.dg/gomp/threadprivate-1.f90: New test.
+
+2021-03-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/99321
+ * gcc.target/i386/avx512vl-pr99321-2.c: New test.
+
+2021-03-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/99507
+ * g++.dg/cpp2a/consteval19.C: New test.
+
+2021-03-11 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/96374
+ * gcc.dg/analyzer/dot-output.c: Add -fdump-analyzer-feasibility
+ to options.
+ * gcc.dg/analyzer/feasibility-1.c (test_6): Remove xfail.
+ (test_7): New.
+ * gcc.dg/analyzer/pr93355-localealias-feasibility-2.c: Remove xfail.
+ * gcc.dg/analyzer/pr93355-localealias-feasibility-3.c: Remove xfails.
+ * gcc.dg/analyzer/pr93355-localealias-feasibility.c: Remove
+ -fno-analyzer-feasibility from options.
+ * gcc.dg/analyzer/pr93355-localealias.c: Likewise.
+ * gcc.dg/analyzer/unknown-fns-4.c: Remove xfail.
+
+2021-03-11 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/99248
+ * g++.dg/modules/pr99248.h: New.
+ * g++.dg/modules/pr99248_a.H: New.
+ * g++.dg/modules/pr99248_b.H: New.
+
+2021-03-11 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/99528
+ * g++.dg/modules/pr99528.h: New.
+ * g++.dg/modules/pr99528_a.H: New.
+ * g++.dg/modules/pr99528_b.H: New.
+ * g++.dg/modules/pr99528_c.C: New.
+
+2021-03-11 Richard Biener <rguenther@suse.de>
+
+ PR testsuite/98245
+ * gcc.dg/vect/bb-slp-46.c: Scan for the scalar compute
+ instead of verifying the total number of adds.
+
+2021-03-11 Richard Biener <rguenther@suse.de>
+
+ PR testsuite/97494
+ * gcc.dg/vect/pr97428.c: XFAIL on !vect_hw_misalign.
+
+2021-03-11 Richard Biener <rguenther@suse.de>
+
+ PR testsuite/97494
+ * gcc.dg/vect/vect-complex-5.c: XFAIL on !vect_hw_misalign.
+
+2021-03-11 Richard Biener <rguenther@suse.de>
+
+ PR testsuite/97494
+ * gcc.dg/vect/slp-21.c: Adjust for powerpc64*-*-*.
+
+2021-03-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR ipa/99517
+ * gcc.target/i386/avx2-pr99517-1.c: New test.
+ * gcc.target/i386/avx2-pr99517-2.c: New test.
+
2021-03-10 David Edelsohn <dje.gcc@gmail.com>
PR target/99492
diff --git a/gcc/testsuite/c-c++-common/asan/memcmp-1.c b/gcc/testsuite/c-c++-common/asan/memcmp-1.c
index 0403ad7..0d08c09 100644
--- a/gcc/testsuite/c-c++-common/asan/memcmp-1.c
+++ b/gcc/testsuite/c-c++-common/asan/memcmp-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-fno-builtin-memcmp" } */
+/* { dg-additional-options "-D_FORTIFY_SOURCE=0 -gdwarf-3" { target *-*-darwin* } } */
/* { dg-shouldfail "asan" } */
#include <string.h>
@@ -16,5 +17,8 @@ main ()
}
/* { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow.*(\n|\r\n|\r)" } */
-/* { dg-output " #\[1-9\] 0x\[0-9a-f\]+ +(in _*(interceptor_|wrap_|)memcmp|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output " #\[2-9\] 0x\[0-9a-f\]+ +(in _*main|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
+/* { dg-output " #\[1-9\] 0x\[0-9a-f\]+ +(in _*(interceptor_|wrap_|)memcmp|\[(\])\[^\n\r]*(\n|\r\n|\r)" { target { ! *-*-darwin* } } } */
+/* { dg-output " #\[2-9\] 0x\[0-9a-f\]+ +(in _*main|\[(\])\[^\n\r]*(\n|\r\n|\r)" { target { ! *-*-darwin* } } } */
+
+/* { dg-output " #\[0-9\] 0x\[0-9a-f\]+ +(in MemcmpInterceptorCommon|\[(\])\[^\n\r]*(\n|\r\n|\r)" { target *-*-darwin* } } */
+/* { dg-output " #\[1-9\] 0x\[0-9a-f\]+ +(in wrap_(memcmp|bcmp)|\[(\])\[^\n\r]*(\n|\r\n|\r)" { target *-*-darwin* } } */
diff --git a/gcc/testsuite/c-c++-common/asan/strncpy-overflow-1.c b/gcc/testsuite/c-c++-common/asan/strncpy-overflow-1.c
index a9c9b18..3d43916 100644
--- a/gcc/testsuite/c-c++-common/asan/strncpy-overflow-1.c
+++ b/gcc/testsuite/c-c++-common/asan/strncpy-overflow-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-fno-builtin-malloc -fno-builtin-strncpy" } */
+/* { dg-additional-options "-D_FORTIFY_SOURCE=0 -gdwarf-3" { target *-*-darwin* } } */
/* { dg-shouldfail "asan" } */
#include <string.h>
@@ -14,8 +15,8 @@ int main(int argc, char **argv) {
/* { dg-output "WRITE of size \[0-9\]* at 0x\[0-9a-f\]+ thread T0\[^\n\r]*(\n|\r\n|\r)" } */
/* { dg-output " #0 0x\[0-9a-f\]+ +(in _*(interceptor_|wrap_|)strncpy|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output " #1 0x\[0-9a-f\]+ +(in _*main (\[^\n\r]*strncpy-overflow-1.c:11|\[^\n\r]*:0|\[^\n\r]*\\+0x\[0-9a-z\]*)|\[(\]).*(\n|\r\n|\r)" } */
+/* { dg-output " #1 0x\[0-9a-f\]+ +(in _*main (\[^\n\r]*strncpy-overflow-1.c:12|\[^\n\r]*:0|\[^\n\r]*\\+0x\[0-9a-z\]*)|\[(\]).*(\n|\r\n|\r)" } */
/* { dg-output "\[^\n\r]*0x\[0-9a-f\]+ is located 0 bytes to the right of 9-byte region\[^\n\r]*(\n|\r\n|\r)" } */
/* { dg-output "\[^\n\r]*allocated by thread T0 here:\[^\n\r]*(\n|\r\n|\r)" } */
/* { dg-output " #0 0x\[0-9a-f\]+ +(in _*(interceptor_|wrap_|)malloc|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
-/* { dg-output " #1 0x\[0-9a-f\]+ +(in _*main (\[^\n\r]*strncpy-overflow-1.c:10|\[^\n\r]*:0|\[^\n\r]*\\+0x\[0-9a-z\]*)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
+/* { dg-output " #1 0x\[0-9a-f\]+ +(in _*main (\[^\n\r]*strncpy-overflow-1.c:11|\[^\n\r]*:0|\[^\n\r]*\\+0x\[0-9a-z\]*)|\[(\])\[^\n\r]*(\n|\r\n|\r)" } */
diff --git a/gcc/testsuite/g++.dg/coroutines/pr96749-1.C b/gcc/testsuite/g++.dg/coroutines/pr96749-1.C
new file mode 100644
index 0000000..941a64e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr96749-1.C
@@ -0,0 +1,42 @@
+// { dg-additional-options "-Wall" }
+
+#include <coroutine>
+
+template <typename _Tp> struct promise;
+template <typename _Tp> struct task {
+ using promise_type = promise<_Tp>;
+ bool await_ready() noexcept { return false; }
+ void await_suspend(std::coroutine_handle<> awaiter) noexcept { m_a = awaiter; }
+ auto await_resume() { return _Tp(); }
+ std::coroutine_handle<> m_a;
+};
+
+template <typename _Tp> struct promise {
+ auto get_return_object() noexcept { return task<_Tp>(); }
+ auto initial_suspend() noexcept { return std::suspend_always(); }
+ auto final_suspend() noexcept { return std::suspend_always(); }
+ void return_value(_Tp value) noexcept { m_v = value; }
+ void unhandled_exception() noexcept {}
+ _Tp m_v;
+};
+
+task<int> test_coro(void) {
+ int r = 0;
+#if 1
+ // this code causes the unexpected warning below
+ r += co_await task<int>();
+#else
+ // this code causes no warning
+ auto b = co_await task<int>();
+ r += b;
+#endif
+ co_return r;
+ // test1.cpp: In function ‘task<int> test_coro(int)’:
+ // test1.cpp:36:1: warning: statement has no effect [-Wunused-value]
+ // 36 | }
+ // | ^
+}
+
+int main(void) {
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr96749-2.C b/gcc/testsuite/g++.dg/coroutines/pr96749-2.C
new file mode 100644
index 0000000..43052b5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr96749-2.C
@@ -0,0 +1,37 @@
+// { dg-additional-options "-Wall" }
+
+#include <coroutine>
+
+#if 1
+// with a struct, GCC emits "statement has no effect"
+struct S {};
+#else
+// no warning with built-in types
+using S = int;
+#endif
+
+S Func1(int);
+
+struct C {
+ auto operator co_await() {
+ struct Awaitable final {
+ bool await_ready() const { return true; }
+ std::coroutine_handle<> await_suspend(std::coroutine_handle<>) { return {}; }
+ int await_resume() { return 42; }
+ };
+ return Awaitable{};
+ }
+};
+
+struct Task {
+ struct promise_type {
+ auto initial_suspend() { return std::suspend_always{}; }
+ auto final_suspend() noexcept { return std::suspend_always{}; }
+ void get_return_object() {}
+ void unhandled_exception() {}
+ };
+};
+
+Task Func2() {
+ Func1(co_await C());
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr98480.C b/gcc/testsuite/g++.dg/coroutines/pr98480.C
new file mode 100644
index 0000000..2d87261
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr98480.C
@@ -0,0 +1,20 @@
+#include <coroutine>
+
+struct future {
+ struct promise_type {
+ void return_value(int) {}
+ auto initial_suspend() { return std::suspend_never{}; }
+ auto final_suspend() noexcept { return std::suspend_never{}; }
+ void unhandled_exception() {}
+ future get_return_object() { return {}; }
+ };
+ bool await_ready() { return true; }
+ void await_suspend(std::coroutine_handle<>) {}
+ int await_resume() { return 0; }
+};
+
+future co_foo() {
+ for( int i = 0; i < co_await future{}; ++i );
+ // ICE -------------^
+ co_return 0;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/pr99047.C b/gcc/testsuite/g++.dg/coroutines/pr99047.C
new file mode 100644
index 0000000..124633a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr99047.C
@@ -0,0 +1,83 @@
+#include <optional>
+#include <coroutine>
+
+template <typename T>
+struct [[nodiscard]] task {
+ struct promise_type {
+ std::suspend_always initial_suspend() {
+ return {};
+ }
+ auto final_suspend() noexcept {
+ struct awaiter {
+#if 1
+ std::false_type await_ready() noexcept {
+ return {};
+ }
+#else
+ bool await_ready() noexcept {
+ return false;
+ }
+#endif
+ std::coroutine_handle<> await_suspend(std::coroutine_handle<>) noexcept {
+ return next;
+ }
+ void await_resume() noexcept {
+ }
+ std::coroutine_handle<> next;
+ };
+ return awaiter{next};
+ }
+
+ void unhandled_exception() noexcept {
+ std::terminate();
+ }
+ auto get_return_object() {
+ return task(this);
+ }
+ auto coro() {
+ return std::coroutine_handle<promise_type>::from_promise(*this);
+ }
+ void return_value(T val) {
+ result.emplace(std::move(val));
+ }
+
+ std::coroutine_handle<> next;
+ std::optional<T> result;
+ };
+
+ task(task&& source) : p(std::exchange(source.p, nullptr)) {}
+ explicit task(promise_type* p) : p(p) {}
+ ~task() {
+ if (p)
+ p->coro().destroy();
+ }
+
+ bool await_ready() noexcept {
+ return p->coro().done();
+ }
+ std::coroutine_handle<> await_suspend(std::coroutine_handle<> next) noexcept {
+ p->next = next;
+ return p->coro();
+ }
+ const T& await_resume() const& noexcept {
+ return *p->result;
+ }
+
+ promise_type* p;
+};
+
+task<int> five() {
+ co_return 5;
+}
+
+task<int> six() {
+ co_return co_await five() + 1;
+}
+
+
+int main() {
+ auto task = six();
+ task.p->next = std::noop_coroutine();
+ task.p->coro().resume();
+ return *task.p->result;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-24-for-init.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-24-for-init.C
new file mode 100644
index 0000000..1bf2f6d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-24-for-init.C
@@ -0,0 +1,101 @@
+// { dg-do run }
+
+// Test co-await in while condition.
+
+#include "../coro.h"
+
+// boiler-plate for tests of codegen
+#include "../coro1-ret-int-yield-int.h"
+
+/* An awaiter that suspends always and returns an int as the
+ await_resume output. */
+struct IntAwaiter {
+ int v;
+ IntAwaiter (int _v) : v(_v) {}
+ bool await_ready () { return false; }
+ void await_suspend (coro::coroutine_handle<>) {}
+ int await_resume () { return v; }
+};
+
+struct coro1
+coro_a (bool t)
+{
+ int accum = 0;
+ for (int x = co_await IntAwaiter (3); x < 10; x++)
+ accum += x;
+
+ co_return accum;
+}
+
+struct coro1
+coro_b (bool t)
+{
+ int accum = 0;
+ int x;
+ for (x = co_await IntAwaiter (3); x < 10; x++)
+ accum += x;
+
+ co_return accum;
+}
+
+struct coro1
+coro_c (bool t)
+{
+ int accum = 0;
+ int x = 3;
+ for (co_await IntAwaiter (3); x < 10; x++)
+ accum += x;
+
+ co_return accum;
+}
+
+void
+check_a_coro (struct coro1& x)
+{
+ if (x.handle.done())
+ {
+ PRINT ("check_a_coro: apparently done when we shouldn't be...");
+ abort ();
+ }
+
+ PRINT ("check_a_coro: resume initial suspend");
+ x.handle.resume();
+
+ // will be false - so no yield expected.
+ PRINT ("check_a_coro: resume for init");
+ x.handle.resume();
+
+ int y = x.handle.promise().get_value();
+ if ( y != 42 )
+ {
+ PRINTF ("check_a_coro: apparently wrong value : %d\n", y);
+ abort ();
+ }
+
+ if (!x.handle.done())
+ {
+ PRINT ("check_a_coro: apparently not done...");
+ abort ();
+ }
+}
+
+int main ()
+{
+ {
+ struct coro1 x = coro_a (false);
+ check_a_coro (x);
+ }
+
+ {
+ struct coro1 x = coro_b (false);
+ check_a_coro (x);
+ }
+
+ {
+ struct coro1 x = coro_c (false);
+ check_a_coro (x);
+ }
+
+ PRINT ("main: done");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-25-for-condition.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-25-for-condition.C
new file mode 100644
index 0000000..2208e34
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-25-for-condition.C
@@ -0,0 +1,94 @@
+// { dg-do run }
+
+// Test co-await in while condition.
+
+#include "../coro.h"
+
+// boiler-plate for tests of codegen
+#include "../coro1-ret-int-yield-int.h"
+
+/* An awaiter that suspends always and returns an int as the
+ await_resume output. */
+struct IntAwaiter {
+ int v;
+ IntAwaiter (int _v) : v(_v) {}
+ bool await_ready () { return false; }
+ void await_suspend (coro::coroutine_handle<>) {}
+ int await_resume () { return v; }
+};
+
+struct coro1
+coro_a (bool t)
+{
+ int accum = 0;
+ for (int x = 3; x < co_await IntAwaiter (10); x++)
+ accum += x;
+
+ co_return accum;
+}
+
+/* An awaiter that suspends always and returns an int as the
+ await_resume output. */
+struct TenAwaiter {
+ int v;
+ TenAwaiter (int _v) : v(_v) {}
+ bool await_ready () { return false; }
+ void await_suspend (coro::coroutine_handle<>) {}
+ bool await_resume () { return v < 10; }
+};
+
+struct coro1
+coro_b (bool t)
+{
+ int accum = 0;
+ for (int x = 3; co_await TenAwaiter (x); x++)
+ accum += x;
+
+ co_return accum;
+}
+
+void
+check_a_coro (struct coro1& x)
+{
+ if (x.handle.done())
+ {
+ PRINT ("check_a_coro: apparently done when we shouldn't be...");
+ abort ();
+ }
+
+ PRINT ("check_a_coro: resume initial suspend");
+ x.handle.resume();
+
+ // will be false - so no yield expected.
+ PRINT ("check_a_coro: resume loops");
+ while (!x.handle.done())
+ x.handle.resume();
+
+ int y = x.handle.promise().get_value();
+ if ( y != 42 )
+ {
+ PRINTF ("check_a_coro: apparently wrong value : %d\n", y);
+ abort ();
+ }
+
+ if (!x.handle.done())
+ {
+ PRINT ("check_a_coro: apparently not done...");
+ abort ();
+ }
+}
+
+int main ()
+{
+ {
+ struct coro1 x = coro_a (false);
+ check_a_coro (x);
+ }
+ {
+ struct coro1 x = coro_b (false);
+ check_a_coro (x);
+ }
+
+ PRINT ("main: returning");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/co-await-26-for-iteration-expr.C b/gcc/testsuite/g++.dg/coroutines/torture/co-await-26-for-iteration-expr.C
new file mode 100644
index 0000000..f361fb5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/co-await-26-for-iteration-expr.C
@@ -0,0 +1,87 @@
+// { dg-do run }
+
+// Test co-await in while condition.
+
+#include "../coro.h"
+
+// boiler-plate for tests of codegen
+#include "../coro1-ret-int-yield-int.h"
+
+/* An awaiter that suspends always and returns an int as the
+ await_resume output. */
+struct IntAwaiter {
+ int v;
+ IntAwaiter (int _v) : v(_v) {}
+ bool await_ready () { return false; }
+ void await_suspend (coro::coroutine_handle<>) {}
+ int await_resume () { return v; }
+};
+
+coro1
+coro_a (bool t)
+{
+ int accum = 0;
+ for (int x = 3; x < 10; x += co_await IntAwaiter (1))
+ accum += x;
+
+ co_return accum;
+}
+
+coro1
+coro_b (bool t)
+{
+ int accum = 0;
+ for (int x = 3; x < 10; x += co_await IntAwaiter (1))
+ {
+ if (x & 1)
+ continue;
+ accum += x;
+ }
+
+ co_return accum;
+}
+
+void check_a_coro (coro1& x, int expected_answer)
+{
+ if (x.handle.done())
+ {
+ PRINT ("check_a_coro: apparently done when we shouldn't be...");
+ abort ();
+ }
+
+ PRINT ("check_a_coro: resume initial suspend");
+ x.handle.resume();
+
+ // will be false - so no yield expected.
+ PRINT ("check_a_coro: resume for init");
+ while (!x.handle.done())
+ x.handle.resume();
+
+ int y = x.handle.promise().get_value();
+ if ( y != expected_answer )
+ {
+ PRINTF ("check_a_coro: apparently wrong value : %d\n", y);
+ abort ();
+ }
+
+ if (!x.handle.done())
+ {
+ PRINT ("check_a_coro: apparently not done...");
+ abort ();
+ }
+}
+
+int main ()
+{
+ {
+ coro1 x = coro_a (false);
+ check_a_coro (x, 42);
+ }
+ {
+ coro1 x = coro_b (false);
+ check_a_coro (x, 18);
+ }
+
+ PRINT ("main: done");
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr98704.C b/gcc/testsuite/g++.dg/coroutines/torture/pr98704.C
new file mode 100644
index 0000000..15db250
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr98704.C
@@ -0,0 +1,91 @@
+// { dg-do run }
+#include "../coro.h"
+
+#include <stdexcept>
+
+int frame_live = 0;
+int promise_live = 0;
+int task_live = 0;
+
+struct Task
+{
+ struct promise_type;
+ using handle = std::coroutine_handle<promise_type>;
+
+ struct promise_type
+ {
+ promise_type () { promise_live++; PRINT ("promise_type ()"); }
+ ~promise_type () { promise_live--; PRINT ("~promise_type ()"); }
+ void* operator new(size_t sz) {
+ PRINT("operator new()");
+ frame_live++;
+ return ::operator new(sz);
+ }
+ void operator delete(void* p, size_t sz) {
+ PRINT("operator delete");
+ frame_live--;
+ return ::operator delete(p, sz);
+ }
+
+ Task get_return_object() { return handle::from_promise(*this); }
+ auto initial_suspend() noexcept { return std::suspend_always{}; }
+ auto final_suspend() noexcept { return std::suspend_always{}; }
+ void return_void() noexcept {}
+
+ auto yield_value(int x) noexcept
+ {
+ PRINTF ("yield_value(%d)\n", x);
+ return std::suspend_always{};
+ }
+
+ void unhandled_exception()
+ {
+ PRINT ("unhandled_exception()");
+ throw;
+ }
+ };
+
+ Task(handle h) : coro(h) { task_live++; PRINT ("Task(handle h)"); }
+ ~Task() { task_live--; PRINT ("~Task()"); if (coro) coro.destroy(); }
+
+ handle coro;
+};
+
+Task myco()
+{
+ co_yield 42;
+ throw std::out_of_range("TEST EXCEPTION");
+}
+
+int main()
+{
+ {
+ Task task = myco();
+ PRINT ("START");
+ try {
+ PRINTF ("done #0 = %d\n", task.coro.done());
+ if (task.coro.done())
+ abort();
+ task.coro.resume(); // will yield 42
+ PRINTF ("done #1 = %d\n", task.coro.done());
+ if (task.coro.done())
+ abort();
+ task.coro.resume(); // will throw exception
+ PRINT ("should not be reached");
+ abort ();
+ }
+ catch (const std::exception&) {
+ PRINTF ("done exc = %d\n", task.coro.done());
+ if (!task.coro.done())
+ abort();
+ }
+ if (!task.coro.done())
+ abort();
+ } // should cause cause the destroy () to run.
+ if (task_live || promise_live || frame_live)
+ {
+ PRINTF ("task_live = %d, promise_live = %d, frame_live = %d\n",
+ task_live, promise_live, frame_live);
+ abort ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/consteval19.C b/gcc/testsuite/g++.dg/cpp2a/consteval19.C
new file mode 100644
index 0000000..d742f59
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/consteval19.C
@@ -0,0 +1,6 @@
+// PR c++/99507
+// { dg-do compile { target c++20 } }
+
+constexpr int i{0};
+consteval const int &iref () { return i; }
+const int *a{&iref ()};
diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-float1.C b/gcc/testsuite/g++.dg/cpp2a/nontype-float1.C
new file mode 100644
index 0000000..4fafac1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/nontype-float1.C
@@ -0,0 +1,12 @@
+// { dg-do compile { target c++20 } }
+
+#include <cmath>
+
+template<auto> class MyClass { };
+
+static_assert(__is_same(MyClass<NAN>, MyClass<NAN>));
+
+constexpr auto mynan = NAN;
+static_assert(__is_same(MyClass<mynan>, MyClass<mynan>));
+
+static_assert(__is_same(MyClass<NAN>, MyClass<mynan>));
diff --git a/gcc/testsuite/g++.dg/gomp/declare-simd-1.C b/gcc/testsuite/g++.dg/gomp/declare-simd-1.C
index dcffaec..00996b6 100644
--- a/gcc/testsuite/g++.dg/gomp/declare-simd-1.C
+++ b/gcc/testsuite/g++.dg/gomp/declare-simd-1.C
@@ -287,7 +287,7 @@ struct D
int f37 (int a);
int e;
};
-// { dg-warning "GCC does not currently support simdlen 16 for type 'int'" "" { target aarch64*-*-* } .-3 }
+// { dg-warning "GCC does not currently support mixed size types for 'simd' functions" "" { target aarch64*-*-* } .-3 }
void
f38 (D &d)
diff --git a/gcc/testsuite/g++.dg/modules/builtin-3_a.C b/gcc/testsuite/g++.dg/modules/builtin-3_a.C
index ad30ccf..fb7da61 100644
--- a/gcc/testsuite/g++.dg/modules/builtin-3_a.C
+++ b/gcc/testsuite/g++.dg/modules/builtin-3_a.C
@@ -30,8 +30,8 @@ export inline int count (int a, ...)
// The implementation details of va_list's are target-specific.
// Usually one of two patterns though
// { dg-final { scan-lang-dump-not { Cluster members:\n \[0\]=decl declaration '::__builtin_va_list'\n \[1\]=binding '::__builtin_va_list'\n} module { target i?86-*-linux* x86_64-*-linux* } } }
-// { dg-final { scan-lang-dump {Wrote GMF:-[0-9]* type_decl:'::__builtin_va_list'@builtins} module { target x86_64-*-linux* } } }
-// { dg-final { scan-lang-dump {Writing:-[0-9]*'s named merge key \(decl\) type_decl:'::__builtin_va_list'} module { target x86_64-*-linux* } } }
+// { dg-final { scan-lang-dump {Wrote GMF:-[0-9]* type_decl:'::__builtin_va_list'@builtins} module { target { { x86_64-*-linux* i?86-*-linux* } && lp64 } } } }
+// { dg-final { scan-lang-dump {Writing:-[0-9]*'s named merge key \(decl\) type_decl:'::__builtin_va_list'} module { target { { x86_64-*-linux* i?86-*-linux* } && lp64 } } } }
// { dg-final { scan-lang-dump {Writing:-1's named merge key \(decl\) type_decl:'::__gnuc_va_list'} module { target i?86-*-linux* *-*-darwin* } } }
// { dg-final { scan-lang-dump {Wrote GMF:-3 type_decl:'::__gnuc_va_list'@builtins} module { target i?86-*-linux* *-*-darwin* } } }
diff --git a/gcc/testsuite/g++.dg/modules/builtin-3_b.C b/gcc/testsuite/g++.dg/modules/builtin-3_b.C
index 93489bd..e0e6306 100644
--- a/gcc/testsuite/g++.dg/modules/builtin-3_b.C
+++ b/gcc/testsuite/g++.dg/modules/builtin-3_b.C
@@ -8,6 +8,6 @@ int main ()
}
// { dg-final { scan-lang-dump {Read:-[0-9]*'s named merge key \(matched\) function_decl:'::__builtin_strlen'} module } }
-// { dg-final { scan-lang-dump {Read:-[0-9]*'s named merge key \(matched\) type_decl:'::__builtin_va_list'} module { target { x86_64-*-linux* } } } }
+// { dg-final { scan-lang-dump {Read:-[0-9]*'s named merge key \(matched\) type_decl:'::__builtin_va_list'} module { target { { x86_64-*-linux* i?86-*-linux* } && lp64 } } } }
// { dg-final { scan-lang-dump {Read:-[0-9]*'s named merge key \(new\) type_decl:'::va_list'} module } }
// { dg-final { scan-lang-dump {Read:-[0-9]*'s named merge key \(new\) type_decl:'::__gnuc_va_list'} module } }
diff --git a/gcc/testsuite/g++.dg/modules/pr99238.h b/gcc/testsuite/g++.dg/modules/pr99238.h
new file mode 100644
index 0000000..312641f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/pr99238.h
@@ -0,0 +1 @@
+struct tm;
diff --git a/gcc/testsuite/g++.dg/modules/pr99238_a.H b/gcc/testsuite/g++.dg/modules/pr99238_a.H
new file mode 100644
index 0000000..b594c09
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/pr99238_a.H
@@ -0,0 +1,4 @@
+// PR 99238 ICE with using decl
+// { dg-additional-options -fmodule-header }
+// { dg-module-cmi {} }
+#include "pr99238.h"
diff --git a/gcc/testsuite/g++.dg/modules/pr99238_b.H b/gcc/testsuite/g++.dg/modules/pr99238_b.H
new file mode 100644
index 0000000..070ee36
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/pr99238_b.H
@@ -0,0 +1,8 @@
+// { dg-additional-options -fmodule-header }
+// { dg-module-cmi {} }
+#include "pr99238.h"
+import "pr99238_a.H";
+namespace std
+{
+ using ::tm;
+}
diff --git a/gcc/testsuite/g++.dg/modules/pr99496_a.H b/gcc/testsuite/g++.dg/modules/pr99496_a.H
new file mode 100644
index 0000000..71b77fb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/pr99496_a.H
@@ -0,0 +1,17 @@
+// PR 99496 different types with same canonical
+// (requires spec hasher to be a constant, so we get collisions)
+// { dg-additional-options -fmodule-header }
+// { dg-module-cmi {} }
+
+template<typename...> using __void_t = void;
+
+template<typename _Tp, typename = void>
+struct __is_referenceable
+{ };
+
+template<typename _Tp>
+struct __is_referenceable<_Tp, __void_t<_Tp&>>
+{ };
+
+template<typename _Tp, bool = __is_referenceable<_Tp>::value>
+struct __is_copy_constructible_impl;
diff --git a/gcc/testsuite/g++.dg/modules/pr99496_b.C b/gcc/testsuite/g++.dg/modules/pr99496_b.C
new file mode 100644
index 0000000..57b71d1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/pr99496_b.C
@@ -0,0 +1,3 @@
+// { dg-additional-options {-fmodules-ts -fno-module-lazy} }
+
+import "pr99496_a.H";
diff --git a/gcc/testsuite/g++.dg/opt/pr98834.C b/gcc/testsuite/g++.dg/opt/pr98834.C
new file mode 100644
index 0000000..fafd322
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr98834.C
@@ -0,0 +1,71 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target c++17 } */
+/* { dg-options "-O2 -fdump-tree-fre3" } */
+
+struct _Base
+{
+ int _M_data = 0;
+};
+
+struct _Wrapper : _Base
+{
+ _Wrapper(int) {}
+
+ bool _M_is_constprop() { return __builtin_constant_p(_M_data); }
+};
+
+struct _Impl
+{
+ _Wrapper _S_multiplies(_Wrapper __x, _Wrapper __y)
+ {
+ if (__x._M_is_constprop() || __y._M_is_constprop())
+ return __y;
+ return 0;
+ }
+};
+
+struct _TupleData
+{
+ _Wrapper first;
+ int second;
+};
+
+struct _Tuple : _TupleData
+{
+ template <typename _Fp>
+ _Tuple _M_apply_per_chunk(_Fp __fun, _Tuple __y)
+ {
+ return {__fun(first, __y.first), second};
+ }
+};
+
+struct _ImplFixed
+{
+ static _Tuple _S_multiplies(_Tuple __x, _Tuple __y)
+ {
+ return __x._M_apply_per_chunk(
+ []( auto __xx, auto __yy) {
+ return _Impl()._S_multiplies(__xx, __yy);
+ },
+ __y);
+ }
+};
+
+class simd
+{
+public:
+ [[__gnu__::__always_inline__]] friend simd operator*(simd __x, simd __y)
+ { return _ImplFixed::_S_multiplies(__x._M_data, __y._M_data); }
+
+ simd(_Tuple __init) : _M_data(__init) {}
+
+ _Tuple _M_data;
+};
+
+int main()
+{
+ simd({0, 0}) * simd({0, 0});
+}
+
+/* FRE3 should elide all conditionals in the remaining main. */
+/* { dg-final { scan-tree-dump-times "<bb" 1 "fre3" } } */
diff --git a/gcc/testsuite/g++.dg/vect/simd-clone-7.cc b/gcc/testsuite/g++.dg/vect/simd-clone-7.cc
index 527bbd9..fd5751b 100644
--- a/gcc/testsuite/g++.dg/vect/simd-clone-7.cc
+++ b/gcc/testsuite/g++.dg/vect/simd-clone-7.cc
@@ -8,5 +8,3 @@ bar (float x, float *y, int)
{
return y[0] + y[1] * x;
}
-// { dg-warning "GCC does not currently support mixed size types for 'simd' functions" "" { target { { aarch64*-*-* } && lp64 } } .-4 }
-
diff --git a/gcc/testsuite/g++.target/i386/pr99108.C b/gcc/testsuite/g++.target/i386/pr99108.C
new file mode 100644
index 0000000..b1f0a71
--- /dev/null
+++ b/gcc/testsuite/g++.target/i386/pr99108.C
@@ -0,0 +1,19 @@
+/* PR c++/99108 */
+/* { dg-require-ifunc "" } */
+
+struct A {
+ template <class T>
+ void foo(T);
+};
+template <class T>
+void A::foo(T)
+{
+ int f(void) __attribute__((target("default")));
+ int f(void) __attribute__((target("arch=atom")));
+ int b = f();
+}
+void bar(void)
+{
+ A c;
+ c.foo(7);
+}
diff --git a/gcc/testsuite/gcc.dg/Wstringop-truncation-9.c b/gcc/testsuite/gcc.dg/Wstringop-truncation-9.c
new file mode 100644
index 0000000..6361480
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstringop-truncation-9.c
@@ -0,0 +1,41 @@
+/* PR tree-optimization/99489 - ICE calling strncat after strncat
+ { dg-do compile }
+ { dg-options "-O2 -Wall" } */
+
+// Important -- see pr82429.
+char *stpcpy (char *, const char *);
+
+void fchar (char *d, char c, char *s)
+{
+ __builtin_strcat (d, s);
+ __builtin_strncat (d, &c, 1);
+}
+
+void fcstchar (char *d, char *s)
+{
+ __builtin_strcat (d, s);
+
+ const char c = 'x';
+ __builtin_strncat (d, &c, 1); // { dg-warning "-Wstringop-truncation" }
+}
+
+void fstr (char *d, char *s)
+{
+ __builtin_strcat (d, s);
+ __builtin_strncat (d, s, 1);
+}
+
+void farr (char *d, char *s)
+{
+ __builtin_strcat (d, s);
+
+ char a[] = "x";
+ __builtin_strncat (d, a, 1); // { dg-warning "-Wstringop-truncation" }
+}
+
+void flit (char *d, char *s)
+{
+ __builtin_strcat (d, s);
+ __builtin_strncat (d, "x", 1); // { dg-warning "-Wstringop-truncation" "pr?????" { xfail *-*-*} }
+ // { dg-warning "-Wstringop-overflow" "actual" { target *-*-*} .-1 }
+}
diff --git a/gcc/testsuite/gcc.dg/declare-simd.c b/gcc/testsuite/gcc.dg/declare-simd.c
index 1c71b60..2c8c1b7 100644
--- a/gcc/testsuite/gcc.dg/declare-simd.c
+++ b/gcc/testsuite/gcc.dg/declare-simd.c
@@ -3,6 +3,7 @@
#pragma omp declare simd linear (p2, p3)
extern void fn2 (float p1, float *p2, float *p3);
+/* { dg-warning "GCC does not currently support mixed size types for 'simd' functions" "" { target { { aarch64*-*-* } && lp64 } } .-1 } */
float *a, *b;
void fn1 (float *p1)
diff --git a/gcc/testsuite/gcc.dg/gomp/pr59669-2.c b/gcc/testsuite/gcc.dg/gomp/pr59669-2.c
index 26a30f4..f6aad89 100644
--- a/gcc/testsuite/gcc.dg/gomp/pr59669-2.c
+++ b/gcc/testsuite/gcc.dg/gomp/pr59669-2.c
@@ -7,4 +7,3 @@ void
bar (int *a)
{
}
-/* { dg-warning "GCC does not currently support mixed size types for 'simd' functions" "" { target aarch64*-*-* } .-3 } */
diff --git a/gcc/testsuite/gcc.dg/gomp/pr99542.c b/gcc/testsuite/gcc.dg/gomp/pr99542.c
new file mode 100644
index 0000000..b67ff5a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr99542.c
@@ -0,0 +1,17 @@
+/* PR middle-end/89246 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O0 -fopenmp-simd" } */
+
+#pragma omp declare simd
+extern int foo (__int128 x); /* { dg-warning "GCC does not currently support mixed size types for 'simd' function" "" { target aarch64*-*-* } } */
+/* { dg-warning "unsupported argument type '__int128' for simd" "" { target i?86-*-* x86_64-*-* } .-1 } */
+
+#pragma omp declare simd uniform (x)
+extern int baz (__int128 x);
+
+#pragma omp declare simd
+int
+bar (int x)
+{
+ return x + foo (0) + baz (0);
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/pr99544.c b/gcc/testsuite/gcc.dg/gomp/pr99544.c
new file mode 100644
index 0000000..4ea07cf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr99544.c
@@ -0,0 +1,13 @@
+/* PR tree-optimization/99544 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fopenmp" } */
+
+long
+foo (long a, long b, long c)
+{
+ long d, e;
+ #pragma omp teams distribute parallel for simd firstprivate (a, b, c) lastprivate(e)
+ for (d = a; d < b; d++)
+ e = c + d * 5;
+ return e;
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/simd-clones-2.c b/gcc/testsuite/gcc.dg/gomp/simd-clones-2.c
index 844b80b..75554de 100644
--- a/gcc/testsuite/gcc.dg/gomp/simd-clones-2.c
+++ b/gcc/testsuite/gcc.dg/gomp/simd-clones-2.c
@@ -15,7 +15,6 @@ float setArray(float *a, float x, int k)
return a[k];
}
-/* { dg-warning "GCC does not currently support mixed size types for 'simd' functions" "" { target aarch64*-*-* } .-6 } */
/* { dg-final { scan-tree-dump "_ZGVbN4ua32vl_setArray" "optimized" { target i?86-*-* x86_64-*-* } } } */
/* { dg-final { scan-tree-dump "_ZGVbN4vvva32_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
/* { dg-final { scan-tree-dump "_ZGVbM4vl66u_addit" "optimized" { target i?86-*-* x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/acle/rng_2.c b/gcc/testsuite/gcc.target/aarch64/acle/rng_2.c
new file mode 100644
index 0000000..206136c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/acle/rng_2.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=armv8.5-a+rng" } */
+
+#include <arm_acle.h>
+
+int test_rndr (uint64_t *addr)
+{
+ return __rndr (addr);
+}
+
+/* { dg-final { scan-assembler-times {cset\t...?, eq} 1 } } */
+
diff --git a/gcc/testsuite/gcc.target/arm/pr99592.c b/gcc/testsuite/gcc.target/arm/pr99592.c
new file mode 100644
index 0000000..23d6591
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr99592.c
@@ -0,0 +1,7 @@
+/* PR target/99592 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -pg" } */
+
+#pragma GCC push_options
+#pragma GCC target ""
+#pragma GCC pop_options
diff --git a/gcc/testsuite/gcc.target/i386/avx-pr99563.c b/gcc/testsuite/gcc.target/i386/avx-pr99563.c
new file mode 100644
index 0000000..e2e863b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx-pr99563.c
@@ -0,0 +1,38 @@
+/* PR target/99563 */
+/* { dg-do run { target avx } } */
+/* { dg-options "-O2 -mavx -mno-vzeroupper" } */
+
+#include "avx-check.h"
+#include <immintrin.h>
+
+
+__attribute__((noipa)) float
+compute_generic (void)
+{
+ return 0.0f;
+}
+
+static inline __attribute__((always_inline))
+float compute_avx (unsigned long block_count)
+{
+ __m128d mm_res = _mm_set1_pd (256.0);
+ float res = (float) (_mm_cvtsd_f64 (mm_res) / (double) block_count);
+ _mm256_zeroupper ();
+ return res;
+}
+
+__attribute__((noipa)) float
+compute (unsigned long block_count)
+{
+ if (block_count >= 64)
+ return compute_avx (block_count);
+ else
+ return compute_generic ();
+}
+
+static void
+avx_test (void)
+{
+ if (compute (128) != 2.0f || compute (32) != 0.0f)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512vl-pr99321-2.c b/gcc/testsuite/gcc.target/i386/avx512vl-pr99321-2.c
new file mode 100644
index 0000000..8bb3a03
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512vl-pr99321-2.c
@@ -0,0 +1,94 @@
+/* PR target/99321 */
+/* { dg-do assemble { target lp64 } } */
+/* { dg-require-effective-target avx512vl } */
+/* { dg-require-effective-target assembler_march_noavx512bw } */
+/* { dg-options "-O2 -mavx512vl -mno-avx512bw -Wa,-march=+noavx512bw" } */
+
+#include <x86intrin.h>
+
+typedef unsigned char V1 __attribute__((vector_size (16)));
+typedef unsigned char V2 __attribute__((vector_size (32)));
+typedef unsigned short V3 __attribute__((vector_size (16)));
+typedef unsigned short V4 __attribute__((vector_size (32)));
+
+void f1 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_abs_epi8 ((__m128i) b); __asm ("" : : "v" (a)); }
+void f2 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_abs_epi8 ((__m256i) b); __asm ("" : : "v" (a)); }
+void f3 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_abs_epi16 ((__m128i) b); __asm ("" : : "v" (a)); }
+void f4 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_abs_epi16 ((__m256i) b); __asm ("" : : "v" (a)); }
+void f5 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_adds_epi8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f6 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_adds_epi8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f7 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_adds_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f8 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_adds_epi16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f9 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_subs_epi8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f10 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_subs_epi8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f11 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_subs_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f12 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_subs_epi16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f13 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_adds_epu8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f14 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_adds_epu8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f15 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_adds_epu16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f16 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_adds_epu16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f17 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_subs_epu8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f18 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_subs_epu8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f19 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_subs_epu16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f20 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_subs_epu16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f21 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_alignr_epi8 ((__m128i) a, (__m128i) b, 5); __asm ("" : : "v" (a)); }
+void f22 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_alignr_epi8 ((__m256i) a, (__m256i) b, 5); __asm ("" : : "v" (a)); }
+void f23 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_adds_epu16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f24 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_avg_epu8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f25 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_avg_epu8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f26 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_avg_epu16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f27 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_avg_epu16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f28 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_broadcastb_epi8 ((__m128i) b); __asm ("" : : "v" (a)); }
+void f29 (void) { register V2 a __asm ("%xmm16"); register V1 b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_broadcastb_epi8 ((__m128i) b); __asm ("" : : "v" (a)); }
+void f30 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_broadcastw_epi16 ((__m128i) b); __asm ("" : : "v" (a)); }
+void f31 (void) { register V4 a __asm ("%xmm16"); register V3 b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_broadcastw_epi16 ((__m128i) b); __asm ("" : : "v" (a)); }
+int f32 (void) { register V1 a __asm ("%xmm16"); __asm ("" : "=v" (a)); return _mm_extract_epi8 ((__m128i) a, 3); }
+int f33 (void) { register V3 a __asm ("%xmm16"); __asm ("" : "=v" (a)); return _mm_extract_epi16 ((__m128i) a, 3); }
+void f34 (int c) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_insert_epi8 ((__m128i) b, c, 5); __asm ("" : : "v" (a)); }
+void f35 (int c) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_insert_epi16 ((__m128i) b, c, 5); __asm ("" : : "v" (a)); }
+void f36 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_maddubs_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f37 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_maddubs_epi16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f38 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_madd_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f39 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_madd_epi16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f40 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_cvtepi8_epi16 ((__m128i) b); __asm ("" : : "v" (a)); }
+void f41 (void) { register V4 a __asm ("%xmm16"); register V3 b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_cvtepi8_epi16 ((__m128i) b); __asm ("" : : "v" (a)); }
+void f42 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_cvtepu8_epi16 ((__m128i) b); __asm ("" : : "v" (a)); }
+void f43 (void) { register V4 a __asm ("%xmm16"); register V3 b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_cvtepu8_epi16 ((__m128i) b); __asm ("" : : "v" (a)); }
+void f44 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_mulhrs_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f45 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_mulhrs_epi16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f46 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_mulhi_epu16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f47 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_mulhi_epu16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f48 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_mulhi_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f49 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_mulhi_epi16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f50 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_sad_epu8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f51 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_sad_epu8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f52 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_shuffle_epi8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f53 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_shuffle_epi8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f54 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_shufflehi_epi16 ((__m128i) b, 0x5b); __asm ("" : : "v" (a)); }
+void f55 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_shufflehi_epi16 ((__m256i) b, 0x5b); __asm ("" : : "v" (a)); }
+void f56 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_shufflelo_epi16 ((__m128i) b, 0x5b); __asm ("" : : "v" (a)); }
+void f57 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_shufflelo_epi16 ((__m256i) b, 0x5b); __asm ("" : : "v" (a)); }
+void f58 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_slli_si128 ((__m128i) b, 3); __asm ("" : : "v" (a)); }
+void f59 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_slli_si256 ((__m256i) b, 3); __asm ("" : : "v" (a)); }
+void f60 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_srli_si128 ((__m128i) b, 3); __asm ("" : : "v" (a)); }
+void f61 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_srli_si256 ((__m256i) b, 3); __asm ("" : : "v" (a)); }
+void f62 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_sll_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f63 (void) { register V4 a __asm ("%xmm16"); register V3 b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_sll_epi16 ((__m256i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f64 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_slli_epi16 ((__m128i) b, 7); __asm ("" : : "v" (a)); }
+void f65 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_slli_epi16 ((__m256i) b, 7); __asm ("" : : "v" (a)); }
+void f66 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_srl_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f67 (void) { register V4 a __asm ("%xmm16"); register V3 b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_srl_epi16 ((__m256i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f68 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_srli_epi16 ((__m128i) b, 7); __asm ("" : : "v" (a)); }
+void f69 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_srli_epi16 ((__m256i) b, 7); __asm ("" : : "v" (a)); }
+void f70 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_sra_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f71 (void) { register V4 a __asm ("%xmm16"); register V3 b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_sra_epi16 ((__m256i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f72 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_srai_epi16 ((__m128i) b, 7); __asm ("" : : "v" (a)); }
+void f73 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_srai_epi16 ((__m256i) b, 7); __asm ("" : : "v" (a)); }
+void f74 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_unpackhi_epi8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f75 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_unpackhi_epi8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f76 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_unpackhi_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f77 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_unpackhi_epi16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f78 (void) { register V1 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V1) _mm_unpacklo_epi8 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f79 (void) { register V2 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V2) _mm256_unpacklo_epi8 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
+void f80 (void) { register V3 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V3) _mm_unpacklo_epi16 ((__m128i) a, (__m128i) b); __asm ("" : : "v" (a)); }
+void f81 (void) { register V4 a __asm ("%xmm16"), b __asm ("%xmm17"); __asm ("" : "=v" (a), "=v" (b)); a = (V4) _mm256_unpacklo_epi16 ((__m256i) a, (__m256i) b); __asm ("" : : "v" (a)); }
diff --git a/gcc/testsuite/gcc.target/i386/pr99530-1.c b/gcc/testsuite/gcc.target/i386/pr99530-1.c
new file mode 100644
index 0000000..080d7cc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr99530-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -fpic -mcmodel=large -fno-plt" } */
+/* { dg-final { scan-assembler-not "foo@GOTPCREL" } } */
+
+extern void foo (void);
+void
+bar (void)
+{
+ asm ("call %P0" : : "X" (foo));
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr99530-2.c b/gcc/testsuite/gcc.target/i386/pr99530-2.c
new file mode 100644
index 0000000..9808957
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr99530-2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-O2 -fno-pic -mcmodel=large -fno-plt" } */
+/* { dg-final { scan-assembler-not "foo@GOTPCREL" } } */
+
+extern void foo (void);
+void
+bar (void)
+{
+ asm ("call %P0" : : "X" (foo));
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr99530-3.c b/gcc/testsuite/gcc.target/i386/pr99530-3.c
new file mode 100644
index 0000000..22fe81b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr99530-3.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } */
+/* { dg-options "-O2 -fno-pic -fno-plt" } */
+/* { dg-final { scan-assembler "call\[ \t\]+\[*\]foo@GOTPCREL" { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler "call\[ \t\]+\[*\]foo@GOT" { target { ia32 && got32x_reloc } } } } */
+
+extern void foo (void);
+void
+bar (void)
+{
+ asm ("call %P0" : : "X" (foo));
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr99530-4.c b/gcc/testsuite/gcc.target/i386/pr99530-4.c
new file mode 100644
index 0000000..aba0b5d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr99530-4.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } */
+/* { dg-options "-O2 -fpic -fno-plt" } */
+/* { dg-final { scan-assembler "call\[ \t\]+\[*\]foo@GOTPCREL" { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler-not "foo@GOT" { target { ia32 } } } } */
+
+extern void foo (void);
+void
+bar (void)
+{
+ asm ("call %P0" : : "X" (foo));
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr99530-5.c b/gcc/testsuite/gcc.target/i386/pr99530-5.c
new file mode 100644
index 0000000..02c5799
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr99530-5.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } */
+/* { dg-options "-O2 -fno-pic" } */
+/* { dg-final { scan-assembler "call\[ \t\]+\[*\]foo@GOTPCREL" { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler "call\[ \t\]+\[*\]foo@GOT" { target { ia32 && got32x_reloc } } } } */
+
+extern void foo (void) __attribute__ ((noplt));
+void
+bar (void)
+{
+ asm ("call %P0" : : "X" (foo));
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr99530-6.c b/gcc/testsuite/gcc.target/i386/pr99530-6.c
new file mode 100644
index 0000000..0dfdd37
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr99530-6.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } */
+/* { dg-options "-O2 -fpic" } */
+/* { dg-final { scan-assembler "call\[ \t\]+\[*\]foo@GOTPCREL" { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler-not "foo@GOT" { target { ia32 } } } } */
+
+extern void foo (void) __attribute__ ((noplt));
+void
+bar (void)
+{
+ asm ("call %P0" : : "X" (foo));
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr99600.c b/gcc/testsuite/gcc.target/i386/pr99600.c
new file mode 100644
index 0000000..c2f2b22
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr99600.c
@@ -0,0 +1,16 @@
+/* PR target/99600 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=atom" } */
+
+char a, b;
+long c;
+
+long
+foo (void)
+{
+ if (a)
+ c = b == 1 ? 1 << 3 : 1 << 2;
+ else
+ c = 0;
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr98092.c b/gcc/testsuite/gcc.target/powerpc/pr98092.c
new file mode 100644
index 0000000..03eab5a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr98092.c
@@ -0,0 +1,7 @@
+/* { dg-options "-mdejagnu-cpu=power9 -ffinite-math-only" } */
+
+int
+h9 (__attribute__ ((altivec (vector__))) char un)
+{
+ return (__builtin_vec_bcdinvalid (un));
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr99492.c b/gcc/testsuite/gcc.target/powerpc/pr99492.c
index ae36cb3..37a1d07 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr99492.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr99492.c
@@ -1,7 +1,7 @@
/* { dg-do run { target { powerpc*-ibm-aix* } } } */
/* { dg-options "" } */
-void abort (void);
+extern void abort (void);
struct A {
double _Complex a[64];
@@ -26,10 +26,10 @@ int main() {
abort();
if (__alignof(struct A) != 8)
- abort;
+ abort();
if (__alignof(struct C) != 4)
- abort;
+ abort();
if (__builtin_offsetof(struct C, c2) != 4)
abort();
diff --git a/gcc/testsuite/gcc.target/s390/vector/long-double-asm-fprvrmem.c b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-fprvrmem.c
new file mode 100644
index 0000000..f95656c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/vector/long-double-asm-fprvrmem.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z14 -mzarch" } */
+
+long double
+foo (long double x)
+{
+ x = x * x;
+ asm("# %0" : "+fvm"(x));
+ x = x + x;
+ return x;
+}
diff --git a/gcc/testsuite/gfortran.dg/alloc_deferred_comp_1.f90 b/gcc/testsuite/gfortran.dg/alloc_deferred_comp_1.f90
new file mode 100644
index 0000000..0fc54d5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/alloc_deferred_comp_1.f90
@@ -0,0 +1,18 @@
+! { dg-do run }
+!
+! Test the fix for PR99125, where the array reference in the print
+! statement caused an ICE because the gimplifier complained about '0'
+! being used as an lvalue.
+!
+! Contributed by Gerhard Steinmetz <gscfq@t-online.de>
+!
+program p
+ type t
+ character(:), allocatable :: a(:)
+ end type
+ type(t) :: x
+ character(8) :: c(3) = ['12 45 78','23 56 89','34 67 90']
+ x%a = c
+ if (any (x%a(2:3) .ne. ['23 56 89','34 67 90'])) stop 1
+ if (any (x%a(2:3)(4:5) .ne. ['56','67'])) stop 2 ! Bizarrely this worked.
+end
diff --git a/gcc/testsuite/gfortran.dg/do_check_16.f90 b/gcc/testsuite/gfortran.dg/do_check_16.f90
new file mode 100644
index 0000000..db0d45c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/do_check_16.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+program main
+ implicit none
+ integer :: iq,nq,recl
+ DO iq = 1, nq
+ call foobar ! { dg-error "redefined" }
+ ENDDO
+CONTAINS
+
+ subroutine foobar
+ inquire (iolength=nq) iq ! { dg-error "redefined" }
+ end subroutine foobar
+END program main
diff --git a/gcc/testsuite/gfortran.dg/do_check_17.f90 b/gcc/testsuite/gfortran.dg/do_check_17.f90
new file mode 100644
index 0000000..02b8993
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/do_check_17.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! PR 99345 - this used to cause an ICE.
+! Original test case by Matthias Klose
+program main
+ implicit none
+ integer :: iq,nq,recl
+ DO iq = 1, nq
+ CALL calc_upper_fan (iq)
+ ENDDO
+CONTAINS
+ SUBROUTINE calc_upper_fan (iq)
+ INTEGER :: iq
+ INTEGER :: recl
+ INQUIRE(IOLENGTH=recl) iq
+ END SUBROUTINE calc_upper_fan
+END
diff --git a/gcc/testsuite/gfortran.dg/gomp/threadprivate-1.f90 b/gcc/testsuite/gfortran.dg/gomp/threadprivate-1.f90
new file mode 100644
index 0000000..59656c2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/threadprivate-1.f90
@@ -0,0 +1,11 @@
+! PR fortran/99514
+!
+! NTest in DATA is implicitly SAVE, unless in COMMON
+! Was failing before as the implicit SAVE was not
+! honoured by the threadprivate check.
+!
+
+program main
+ DATA NTest /1/
+ !$omp threadprivate(Ntest)
+end program main
diff --git a/gcc/testsuite/gfortran.dg/pr99112.f90 b/gcc/testsuite/gfortran.dg/pr99112.f90
new file mode 100644
index 0000000..9401061
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr99112.f90
@@ -0,0 +1,27 @@
+! { dg-do compile }
+! { dg-options "-fcheck=pointer -fdump-tree-original" }
+! PR99112 - ICE with runtime diagnostics for SIZE intrinsic function
+
+module m
+ type t
+ end type
+contains
+ function f (x, y) result(z)
+ class(t) :: x(:)
+ class(t) :: y(size(x))
+ type(t) :: z(size(x))
+ end
+ function g (x) result(z)
+ class(*) :: x(:)
+ type(t) :: z(size(x))
+ end
+ subroutine s ()
+ class(t), allocatable :: a(:), b(:), c(:), d(:)
+ class(t), pointer :: p(:)
+ c = f (a, b)
+ d = g (p)
+ end
+end
+! { dg-final { scan-tree-dump-times "_gfortran_runtime_error_at" 3 "original" } }
+! { dg-final { scan-tree-dump-times "Allocatable actual argument" 2 "original" } }
+! { dg-final { scan-tree-dump-times "Pointer actual argument" 1 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/pr99545.f90 b/gcc/testsuite/gfortran.dg/pr99545.f90
new file mode 100644
index 0000000..1b5ed5d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr99545.f90
@@ -0,0 +1,40 @@
+! { dg-do compile }
+! { dg-options "-fcheck=mem" }
+!
+! Test the fix for PR99545, in which the allocate statements caused an ICE.
+!
+! Contributed by Juergen Reuter <juergen.reuter@desy.de>
+!
+module commands
+ implicit none
+ private
+
+ type, abstract :: range_t
+ integer :: step_mode = 0
+ integer :: n_step = 0
+ end type range_t
+
+ type, extends (range_t) :: range_int_t
+ integer :: i_step = 0
+ end type range_int_t
+
+ type, extends (range_t) :: range_real_t
+ real :: lr_step = 0
+end type range_real_t
+
+ type :: cmd_scan_t
+ private
+ class(range_t), dimension(:), allocatable :: range
+ contains
+ procedure :: compile => cmd_scan_compile
+ end type cmd_scan_t
+
+contains
+
+ subroutine cmd_scan_compile (cmd)
+ class(cmd_scan_t), intent(inout) :: cmd
+ allocate (range_int_t :: cmd%range (3))
+ allocate (range_real_t :: cmd%range (3))
+ end subroutine cmd_scan_compile
+
+end module commands
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 65b3967..99759a8 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -3215,7 +3215,17 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_,
return (void *)-1;
/* This can happen with bitfields. */
if (maybe_ne (ref->size, r.size))
- return (void *)-1;
+ {
+ /* If the access lacks some subsetting simply apply that by
+ shortening it. That in the end can only be successful
+ if we can pun the lookup result which in turn requires
+ exact offsets. */
+ if (known_eq (r.size, r.max_size)
+ && known_lt (ref->size, r.size))
+ r.size = r.max_size = ref->size;
+ else
+ return (void *)-1;
+ }
*ref = r;
/* Do not update last seen VUSE after translating. */
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 819be39..93e788f 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,12 @@
+2021-03-12 Tobias Burnus <tobias@codesourcery.com>
+
+ * io/transfer.c (st_read_done_worker, st_write_done_worker):
+ Call unlock_unit here, add unit_lock lock around newunit_free call.
+ (st_read_done, st_write_done): Only call unlock_unit when not
+ calling the worker function.
+ * io/unit.c (set_internal_unit): Don't reset the unit_number
+ to the same number as this cause race warnings.
+
2021-03-05 Harald Anlauf <anlauf@gmx.de>
PR libfortran/99218
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 27bee9d..71a9356 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -4339,6 +4339,7 @@ export_proto(st_read_done);
void
st_read_done_worker (st_parameter_dt *dtp)
{
+ bool free_newunit = false;
finalize_transfer (dtp);
free_ionml (dtp);
@@ -4358,7 +4359,7 @@ st_read_done_worker (st_parameter_dt *dtp)
free (dtp->u.p.current_unit->ls);
dtp->u.p.current_unit->ls = NULL;
}
- newunit_free (dtp->common.unit);
+ free_newunit = true;
}
if (dtp->u.p.unit_is_internal || dtp->u.p.format_not_saved)
{
@@ -4366,6 +4367,14 @@ st_read_done_worker (st_parameter_dt *dtp)
free_format (dtp);
}
}
+ unlock_unit (dtp->u.p.current_unit);
+ if (free_newunit)
+ {
+ /* Avoid inverse lock issues by placing after unlock_unit. */
+ LOCK (&unit_lock);
+ newunit_free (dtp->common.unit);
+ UNLOCK (&unit_lock);
+ }
}
void
@@ -4382,11 +4391,10 @@ st_read_done (st_parameter_dt *dtp)
if (dtp->u.p.async)
enqueue_done (dtp->u.p.current_unit->au, AIO_READ_DONE);
}
+ unlock_unit (dtp->u.p.current_unit);
}
else
- st_read_done_worker (dtp);
-
- unlock_unit (dtp->u.p.current_unit);
+ st_read_done_worker (dtp); /* Calls unlock_unit. */
}
library_end ();
@@ -4406,6 +4414,7 @@ st_write (st_parameter_dt *dtp)
void
st_write_done_worker (st_parameter_dt *dtp)
{
+ bool free_newunit = false;
finalize_transfer (dtp);
if (dtp->u.p.current_unit != NULL
@@ -4446,7 +4455,7 @@ st_write_done_worker (st_parameter_dt *dtp)
free (dtp->u.p.current_unit->ls);
dtp->u.p.current_unit->ls = NULL;
}
- newunit_free (dtp->common.unit);
+ free_newunit = true;
}
if (dtp->u.p.unit_is_internal || dtp->u.p.format_not_saved)
{
@@ -4454,6 +4463,14 @@ st_write_done_worker (st_parameter_dt *dtp)
free_format (dtp);
}
}
+ unlock_unit (dtp->u.p.current_unit);
+ if (free_newunit)
+ {
+ /* Avoid inverse lock issues by placing after unlock_unit. */
+ LOCK (&unit_lock);
+ newunit_free (dtp->common.unit);
+ UNLOCK (&unit_lock);
+ }
}
extern void st_write_done (st_parameter_dt *);
@@ -4476,11 +4493,10 @@ st_write_done (st_parameter_dt *dtp)
if (dtp->u.p.async)
enqueue_done (dtp->u.p.current_unit->au, AIO_WRITE_DONE);
}
+ unlock_unit (dtp->u.p.current_unit);
}
else
- st_write_done_worker (dtp);
-
- unlock_unit (dtp->u.p.current_unit);
+ st_write_done_worker (dtp); /* Calls unlock_unit. */
}
library_end ();
diff --git a/libgfortran/io/unit.c b/libgfortran/io/unit.c
index 2ea6643..b0cc6ab 100644
--- a/libgfortran/io/unit.c
+++ b/libgfortran/io/unit.c
@@ -456,7 +456,6 @@ set_internal_unit (st_parameter_dt *dtp, gfc_unit *iunit, int kind)
{
gfc_offset start_record = 0;
- iunit->unit_number = dtp->common.unit;
iunit->recl = dtp->internal_unit_len;
iunit->internal_unit = dtp->internal_unit;
iunit->internal_unit_len = dtp->internal_unit_len;
diff --git a/libgo/MERGE b/libgo/MERGE
index 183b024..a52dceb 100644
--- a/libgo/MERGE
+++ b/libgo/MERGE
@@ -1,4 +1,4 @@
-f21be2fdc6f1becdbed1592ea0b245cdeedc5ac8
+3979fb9af9ccfc0b7ccb613dcf256b18c2c295f0
The first line of this file holds the git revision number of the
last merge done from the master library sources.
diff --git a/libgo/VERSION b/libgo/VERSION
index 4befab2..d0b0a90 100644
--- a/libgo/VERSION
+++ b/libgo/VERSION
@@ -1 +1 @@
-go1.16
+go1.16.2
diff --git a/libgo/go/archive/zip/reader.go b/libgo/go/archive/zip/reader.go
index 8b4e778..c288ad9 100644
--- a/libgo/go/archive/zip/reader.go
+++ b/libgo/go/archive/zip/reader.go
@@ -664,7 +664,7 @@ func toValidName(name string) string {
if strings.HasPrefix(p, "/") {
p = p[len("/"):]
}
- for strings.HasPrefix(name, "../") {
+ for strings.HasPrefix(p, "../") {
p = p[len("../"):]
}
return p
diff --git a/libgo/go/archive/zip/reader_test.go b/libgo/go/archive/zip/reader_test.go
index 34e96f7..5faf1f4 100644
--- a/libgo/go/archive/zip/reader_test.go
+++ b/libgo/go/archive/zip/reader_test.go
@@ -1081,3 +1081,38 @@ func TestFS(t *testing.T) {
t.Fatal(err)
}
}
+
+func TestCVE202127919(t *testing.T) {
+ // Archive containing only the file "../test.txt"
+ data := []byte{
+ 0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x08, 0x00,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x2e, 0x2e,
+ 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74, 0x78,
+ 0x74, 0x0a, 0xc9, 0xc8, 0x2c, 0x56, 0xc8, 0x2c,
+ 0x56, 0x48, 0x54, 0x28, 0x49, 0x2d, 0x2e, 0x51,
+ 0x28, 0x49, 0xad, 0x28, 0x51, 0x48, 0xcb, 0xcc,
+ 0x49, 0xd5, 0xe3, 0x02, 0x04, 0x00, 0x00, 0xff,
+ 0xff, 0x50, 0x4b, 0x07, 0x08, 0xc0, 0xd7, 0xed,
+ 0xc3, 0x20, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00,
+ 0x00, 0x50, 0x4b, 0x01, 0x02, 0x14, 0x00, 0x14,
+ 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0xd7, 0xed, 0xc3, 0x20, 0x00, 0x00,
+ 0x00, 0x1a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e,
+ 0x2e, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x74,
+ 0x78, 0x74, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x39, 0x00,
+ 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00,
+ }
+ r, err := NewReader(bytes.NewReader([]byte(data)), int64(len(data)))
+ if err != nil {
+ t.Fatalf("Error reading the archive: %v", err)
+ }
+ _, err = r.Open("test.txt")
+ if err != nil {
+ t.Errorf("Error reading file: %v", err)
+ }
+}
diff --git a/libgo/go/cmd/go.mod b/libgo/go/cmd/go.mod
index 235e28f..35582f3 100644
--- a/libgo/go/cmd/go.mod
+++ b/libgo/go/cmd/go.mod
@@ -6,7 +6,7 @@ require (
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2
golang.org/x/arch v0.0.0-20201008161808-52c3e6f60cff
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
- golang.org/x/mod v0.4.1
+ golang.org/x/mod v0.4.2-0.20210302225053-d515b24adc21
golang.org/x/sys v0.0.0-20201204225414-ed752295db88 // indirect
golang.org/x/tools v0.0.0-20210107193943-4ed967dd8eff
)
diff --git a/libgo/go/cmd/go/internal/get/get.go b/libgo/go/cmd/go/internal/get/get.go
index 38ff382..329a2f5 100644
--- a/libgo/go/cmd/go/internal/get/get.go
+++ b/libgo/go/cmd/go/internal/get/get.go
@@ -431,7 +431,7 @@ func downloadPackage(p *load.Package) error {
}
importPrefix = importPrefix[:slash]
}
- if err := module.CheckImportPath(importPrefix); err != nil {
+ if err := checkImportPath(importPrefix); err != nil {
return fmt.Errorf("%s: invalid import path: %v", p.ImportPath, err)
}
security := web.SecureOnly
@@ -591,3 +591,31 @@ func selectTag(goVersion string, tags []string) (match string) {
}
return ""
}
+
+// checkImportPath is like module.CheckImportPath, but it forbids leading dots
+// in path elements. This can lead to 'go get' creating .git and other VCS
+// directories in places we might run VCS tools later.
+func checkImportPath(path string) error {
+ if err := module.CheckImportPath(path); err != nil {
+ return err
+ }
+ checkElem := func(elem string) error {
+ if elem[0] == '.' {
+ return fmt.Errorf("malformed import path %q: leading dot in path element", path)
+ }
+ return nil
+ }
+ elemStart := 0
+ for i, r := range path {
+ if r == '/' {
+ if err := checkElem(path[elemStart:]); err != nil {
+ return err
+ }
+ elemStart = i + 1
+ }
+ }
+ if err := checkElem(path[elemStart:]); err != nil {
+ return err
+ }
+ return nil
+}
diff --git a/libgo/go/cmd/go/internal/modcmd/tidy.go b/libgo/go/cmd/go/internal/modcmd/tidy.go
index 3b83d87..8bc9ed5 100644
--- a/libgo/go/cmd/go/internal/modcmd/tidy.go
+++ b/libgo/go/cmd/go/internal/modcmd/tidy.go
@@ -62,10 +62,11 @@ func runTidy(ctx context.Context, cmd *base.Command, args []string) {
modload.RootMode = modload.NeedRoot
modload.LoadPackages(ctx, modload.PackageOpts{
- Tags: imports.AnyTags(),
- ResolveMissingImports: true,
- LoadTests: true,
- AllowErrors: tidyE,
+ Tags: imports.AnyTags(),
+ ResolveMissingImports: true,
+ LoadTests: true,
+ AllowErrors: tidyE,
+ SilenceMissingStdImports: true,
}, "all")
modload.TidyBuildList()
diff --git a/libgo/go/cmd/go/internal/modcmd/vendor.go b/libgo/go/cmd/go/internal/modcmd/vendor.go
index d3ed9e0..ac1fb77 100644
--- a/libgo/go/cmd/go/internal/modcmd/vendor.go
+++ b/libgo/go/cmd/go/internal/modcmd/vendor.go
@@ -64,10 +64,11 @@ func runVendor(ctx context.Context, cmd *base.Command, args []string) {
modload.RootMode = modload.NeedRoot
loadOpts := modload.PackageOpts{
- Tags: imports.AnyTags(),
- ResolveMissingImports: true,
- UseVendorAll: true,
- AllowErrors: vendorE,
+ Tags: imports.AnyTags(),
+ ResolveMissingImports: true,
+ UseVendorAll: true,
+ AllowErrors: vendorE,
+ SilenceMissingStdImports: true,
}
_, pkgs := modload.LoadPackages(ctx, loadOpts, "all")
diff --git a/libgo/go/cmd/go/internal/modget/get.go b/libgo/go/cmd/go/internal/modget/get.go
index dccacd3..5a98408 100644
--- a/libgo/go/cmd/go/internal/modget/get.go
+++ b/libgo/go/cmd/go/internal/modget/get.go
@@ -1514,7 +1514,7 @@ func (r *resolver) checkPackagesAndRetractions(ctx context.Context, pkgPatterns
}
}
if retractPath != "" {
- fmt.Fprintf(os.Stderr, "go: to switch to the latest unretracted version, run:\n\tgo get %s@latest", retractPath)
+ fmt.Fprintf(os.Stderr, "go: to switch to the latest unretracted version, run:\n\tgo get %s@latest\n", retractPath)
}
}
diff --git a/libgo/go/cmd/go/internal/modget/query.go b/libgo/go/cmd/go/internal/modget/query.go
index d8364c8..1a5a60f 100644
--- a/libgo/go/cmd/go/internal/modget/query.go
+++ b/libgo/go/cmd/go/internal/modget/query.go
@@ -186,7 +186,7 @@ func (q *query) validate() error {
if q.pattern == "all" {
// If there is no main module, "all" is not meaningful.
if !modload.HasModRoot() {
- return fmt.Errorf(`cannot match "all": working directory is not part of a module`)
+ return fmt.Errorf(`cannot match "all": %v`, modload.ErrNoModRoot)
}
if !versionOkForMainModule(q.version) {
// TODO(bcmills): "all@none" seems like a totally reasonable way to
diff --git a/libgo/go/cmd/go/internal/modload/import.go b/libgo/go/cmd/go/internal/modload/import.go
index 182429a..995641c 100644
--- a/libgo/go/cmd/go/internal/modload/import.go
+++ b/libgo/go/cmd/go/internal/modload/import.go
@@ -51,7 +51,7 @@ func (e *ImportMissingError) Error() string {
if e.isStd {
return fmt.Sprintf("package %s is not in GOROOT (%s)", e.Path, filepath.Join(cfg.GOROOT, "src", e.Path))
}
- if e.QueryErr != nil {
+ if e.QueryErr != nil && e.QueryErr != ErrNoModRoot {
return fmt.Sprintf("cannot find module providing package %s: %v", e.Path, e.QueryErr)
}
if cfg.BuildMod == "mod" || (cfg.BuildMod == "readonly" && allowMissingModuleImports) {
@@ -66,13 +66,11 @@ func (e *ImportMissingError) Error() string {
return fmt.Sprintf("module %s provides package %s and is replaced but not required; to add it:\n\tgo get %s", e.replaced.Path, e.Path, suggestArg)
}
- suggestion := ""
- if !HasModRoot() {
- suggestion = ": working directory is not part of a module"
- } else {
- suggestion = fmt.Sprintf("; to add it:\n\tgo get %s", e.Path)
+ message := fmt.Sprintf("no required module provides package %s", e.Path)
+ if e.QueryErr != nil {
+ return fmt.Sprintf("%s: %v", message, e.QueryErr)
}
- return fmt.Sprintf("no required module provides package %s%s", e.Path, suggestion)
+ return fmt.Sprintf("%s; to add it:\n\tgo get %s", message, e.Path)
}
if e.newMissingVersion != "" {
@@ -318,7 +316,11 @@ func importFromBuildList(ctx context.Context, path string, buildList []module.Ve
return mods[0], dirs[0], nil
}
- return module.Version{}, "", &ImportMissingError{Path: path, isStd: pathIsStd}
+ var queryErr error
+ if !HasModRoot() {
+ queryErr = ErrNoModRoot
+ }
+ return module.Version{}, "", &ImportMissingError{Path: path, QueryErr: queryErr, isStd: pathIsStd}
}
// queryImport attempts to locate a module that can be added to the current
diff --git a/libgo/go/cmd/go/internal/modload/init.go b/libgo/go/cmd/go/internal/modload/init.go
index bc8d17e..8ec1c86 100644
--- a/libgo/go/cmd/go/internal/modload/init.go
+++ b/libgo/go/cmd/go/internal/modload/init.go
@@ -177,7 +177,7 @@ func Init() {
base.Fatalf("go: cannot find main module, but -modfile was set.\n\t-modfile cannot be used to set the module root directory.")
}
if RootMode == NeedRoot {
- base.Fatalf("go: cannot find main module; see 'go help modules'")
+ base.Fatalf("go: %v", ErrNoModRoot)
}
if !mustUseModules {
// GO111MODULE is 'auto', and we can't find a module root.
@@ -338,9 +338,11 @@ func die() {
}
base.Fatalf("go: cannot find main module, but found %s in %s\n\tto create a module there, run:\n\t%sgo mod init", name, dir, cdCmd)
}
- base.Fatalf("go: cannot find main module; see 'go help modules'")
+ base.Fatalf("go: %v", ErrNoModRoot)
}
+var ErrNoModRoot = errors.New("go.mod file not found in current directory or any parent directory; see 'go help modules'")
+
// LoadModFile sets Target and, if there is a main module, parses the initial
// build list from its go.mod file.
//
@@ -539,9 +541,10 @@ func fixVersion(ctx context.Context, fixed *bool) modfile.VersionFixer {
}
}
if vers != "" && module.CanonicalVersion(vers) == vers {
- if err := module.CheckPathMajor(vers, pathMajor); err == nil {
- return vers, nil
+ if err := module.CheckPathMajor(vers, pathMajor); err != nil {
+ return "", module.VersionError(module.Version{Path: path, Version: vers}, err)
}
+ return vers, nil
}
info, err := Query(ctx, path, vers, "", nil)
diff --git a/libgo/go/cmd/go/internal/modload/list.go b/libgo/go/cmd/go/internal/modload/list.go
index 3491f94..7b1aa7f 100644
--- a/libgo/go/cmd/go/internal/modload/list.go
+++ b/libgo/go/cmd/go/internal/modload/list.go
@@ -73,7 +73,7 @@ func listModules(ctx context.Context, args []string, listVersions, listRetracted
base.Fatalf("go: cannot use relative path %s to specify module", arg)
}
if !HasModRoot() && (arg == "all" || strings.Contains(arg, "...")) {
- base.Fatalf("go: cannot match %q: working directory is not part of a module", arg)
+ base.Fatalf("go: cannot match %q: %v", arg, ErrNoModRoot)
}
if i := strings.Index(arg, "@"); i >= 0 {
path := arg[:i]
diff --git a/libgo/go/cmd/go/internal/modload/load.go b/libgo/go/cmd/go/internal/modload/load.go
index 6d87acc..154fc3c 100644
--- a/libgo/go/cmd/go/internal/modload/load.go
+++ b/libgo/go/cmd/go/internal/modload/load.go
@@ -170,6 +170,12 @@ type PackageOpts struct {
// that occur while loading packages. SilenceErrors implies AllowErrors.
SilenceErrors bool
+ // SilenceMissingStdImports indicates that LoadPackages should not print
+ // errors or terminate the process if an imported package is missing, and the
+ // import path looks like it might be in the standard library (perhaps in a
+ // future version).
+ SilenceMissingStdImports bool
+
// SilenceUnmatchedWarnings suppresses the warnings normally emitted for
// patterns that did not match any packages.
SilenceUnmatchedWarnings bool
@@ -287,8 +293,13 @@ func LoadPackages(ctx context.Context, opts PackageOpts, patterns ...string) (ma
sumErr.importerIsTest = importer.testOf != nil
}
}
+ silence := opts.SilenceErrors
+ if stdErr := (*ImportMissingError)(nil); errors.As(pkg.err, &stdErr) &&
+ stdErr.isStd && opts.SilenceMissingStdImports {
+ silence = true
+ }
- if !opts.SilenceErrors {
+ if !silence {
if opts.AllowErrors {
fmt.Fprintf(os.Stderr, "%s: %v\n", pkg.stackText(), pkg.err)
} else {
diff --git a/libgo/go/cmd/go/internal/run/run.go b/libgo/go/cmd/go/internal/run/run.go
index 99578b2..666b1a0 100644
--- a/libgo/go/cmd/go/internal/run/run.go
+++ b/libgo/go/cmd/go/internal/run/run.go
@@ -96,28 +96,12 @@ func runRun(ctx context.Context, cmd *base.Command, args []string) {
base.Fatalf("go run: no go files listed")
}
cmdArgs := args[i:]
- if p.Error != nil {
- base.Fatalf("%s", p.Error)
- }
+ load.CheckPackageErrors([]*load.Package{p})
- p.Internal.OmitDebug = true
- if len(p.DepsErrors) > 0 {
- // Since these are errors in dependencies,
- // the same error might show up multiple times,
- // once in each package that depends on it.
- // Only print each once.
- printed := map[*load.PackageError]bool{}
- for _, err := range p.DepsErrors {
- if !printed[err] {
- printed[err] = true
- base.Errorf("%s", err)
- }
- }
- }
- base.ExitIfErrors()
if p.Name != "main" {
base.Fatalf("go run: cannot run non-main package")
}
+ p.Internal.OmitDebug = true
p.Target = "" // must build - not up to date
if p.Internal.CmdlineFiles {
//set executable name if go file is given as cmd-argument
diff --git a/libgo/go/cmd/go/testdata/script/mod_convert_dep.txt b/libgo/go/cmd/go/testdata/script/mod_convert_dep.txt
index ad22aca..875a836 100644
--- a/libgo/go/cmd/go/testdata/script/mod_convert_dep.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_convert_dep.txt
@@ -18,7 +18,7 @@ stdout '^m$'
# Test that we ignore directories when trying to find alternate config files.
cd $WORK/gopkgdir/x
! go list .
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
! stderr 'Gopkg.lock'
-- $WORK/test/Gopkg.lock --
diff --git a/libgo/go/cmd/go/testdata/script/mod_edit.txt b/libgo/go/cmd/go/testdata/script/mod_edit.txt
index d7e681e..9da6930 100644
--- a/libgo/go/cmd/go/testdata/script/mod_edit.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_edit.txt
@@ -16,9 +16,9 @@ cmpenv go.mod $WORK/go.mod.init
cmpenv go.mod $WORK/go.mod.init
# go mod edits
-go mod edit -droprequire=x.1 -require=x.1@v1.0.0 -require=x.2@v1.1.0 -droprequire=x.2 -exclude='x.1 @ v1.2.0' -exclude=x.1@v1.2.1 -replace=x.1@v1.3.0=y.1@v1.4.0 -replace='x.1@v1.4.0 = ../z' -retract=v1.6.0 -retract=[v1.1.0,v1.2.0] -retract=[v1.3.0,v1.4.0] -retract=v1.0.0
+go mod edit -droprequire=x.1 -require=x.1@v1.0.0 -require=x.2@v1.1.0 -droprequire=x.2 -exclude='x.1 @ v1.2.0' -exclude=x.1@v1.2.1 -exclude=x.1@v2.0.0+incompatible -replace=x.1@v1.3.0=y.1@v1.4.0 -replace='x.1@v1.4.0 = ../z' -retract=v1.6.0 -retract=[v1.1.0,v1.2.0] -retract=[v1.3.0,v1.4.0] -retract=v1.0.0
cmpenv go.mod $WORK/go.mod.edit1
-go mod edit -droprequire=x.1 -dropexclude=x.1@v1.2.1 -dropreplace=x.1@v1.3.0 -require=x.3@v1.99.0 -dropretract=v1.0.0 -dropretract=[v1.1.0,v1.2.0]
+go mod edit -droprequire=x.1 -dropexclude=x.1@v1.2.1 -dropexclude=x.1@v2.0.0+incompatible -dropreplace=x.1@v1.3.0 -require=x.3@v1.99.0 -dropretract=v1.0.0 -dropretract=[v1.1.0,v1.2.0]
cmpenv go.mod $WORK/go.mod.edit2
# -exclude and -retract reject invalid versions.
@@ -27,6 +27,17 @@ stderr '^go mod: -exclude=example.com/m@bad: version "bad" invalid: must be of t
! go mod edit -retract=bad
stderr '^go mod: -retract=bad: version "bad" invalid: must be of the form v1.2.3$'
+! go mod edit -exclude=example.com/m@v2.0.0
+stderr '^go mod: -exclude=example.com/m@v2\.0\.0: version "v2\.0\.0" invalid: should be v2\.0\.0\+incompatible \(or module example\.com/m/v2\)$'
+
+! go mod edit -exclude=example.com/m/v2@v1.0.0
+stderr '^go mod: -exclude=example.com/m/v2@v1\.0\.0: version "v1\.0\.0" invalid: should be v2, not v1$'
+
+! go mod edit -exclude=gopkg.in/example.v1@v2.0.0
+stderr '^go mod: -exclude=gopkg\.in/example\.v1@v2\.0\.0: version "v2\.0\.0" invalid: should be v1, not v2$'
+
+cmpenv go.mod $WORK/go.mod.edit2
+
# go mod edit -json
go mod edit -json
cmpenv stdout $WORK/go.mod.json
@@ -88,6 +99,7 @@ require x.1 v1.0.0
exclude (
x.1 v1.2.0
x.1 v1.2.1
+ x.1 v2.0.0+incompatible
)
replace (
diff --git a/libgo/go/cmd/go/testdata/script/mod_find.txt b/libgo/go/cmd/go/testdata/script/mod_find.txt
index 9468acf..1e01973 100644
--- a/libgo/go/cmd/go/testdata/script/mod_find.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_find.txt
@@ -49,7 +49,7 @@ rm go.mod
# Test that we ignore directories when trying to find go.mod.
cd $WORK/gomoddir
! go list .
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
[!symlink] stop
diff --git a/libgo/go/cmd/go/testdata/script/mod_outside.txt b/libgo/go/cmd/go/testdata/script/mod_outside.txt
index 8f01b5d..5655892 100644
--- a/libgo/go/cmd/go/testdata/script/mod_outside.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_outside.txt
@@ -12,13 +12,13 @@ stdout 'NUL|/dev/null'
# 'go list' without arguments implicitly operates on the current directory,
# which is not in a module.
! go list
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
go list -m
stdout '^command-line-arguments$'
# 'go list' in the working directory should fail even if there is a a 'package
# main' present: without a main module, we do not know its package path.
! go list ./needmod
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go list all' lists the transitive import graph of the main module,
# which is empty if there is no main module.
@@ -41,7 +41,7 @@ stdout 'command-line-arguments'
# 'go list' on a package from a module should fail.
! go list example.com/printversion
-stderr '^no required module provides package example.com/printversion: working directory is not part of a module$'
+stderr '^no required module provides package example.com/printversion: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go list -m' with an explicit version should resolve that version.
@@ -54,19 +54,19 @@ stdout 'v1.0.0\s+v1.0.1\s+v1.1.0'
# 'go list -m all' should fail. "all" is not meaningful outside of a module.
! go list -m all
-stderr 'go: cannot match "all": working directory is not part of a module'
+stderr 'go: cannot match "all": go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go list -m <mods> all' should also fail.
! go list -m example.com/printversion@v1.0.0 all
-stderr 'go: cannot match "all": working directory is not part of a module'
+stderr 'go: cannot match "all": go.mod file not found in current directory or any parent directory; see ''go help modules''$'
! stdout 'example.com/version'
# 'go list -m' with wildcards should fail. Wildcards match modules in the
# build list, so they aren't meaningful outside a module.
! go list -m ...
-stderr 'go: cannot match "...": working directory is not part of a module'
+stderr 'go: cannot match "...": go.mod file not found in current directory or any parent directory; see ''go help modules''$'
! go list -m rsc.io/quote/...
-stderr 'go: cannot match "rsc.io/quote/...": working directory is not part of a module'
+stderr 'go: cannot match "rsc.io/quote/...": go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go clean' should skip the current directory if it isn't in a module.
@@ -76,20 +76,20 @@ go clean -n
# 'go mod graph' should fail, since there's no module graph.
! go mod graph
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go mod why' should fail, since there is no main module to depend on anything.
! go mod why -m example.com/version
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go mod edit', 'go mod tidy', and 'go mod fmt' should fail:
# there is no go.mod file to edit.
! go mod tidy
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
! go mod edit -fmt
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
! go mod edit -require example.com/version@v1.0.0
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go mod download' without arguments should report an error.
@@ -104,33 +104,33 @@ exists $GOPATH/pkg/mod/cache/download/example.com/printversion/@v/v1.0.0.zip
# 'go mod download all' should fail. "all" is not meaningful outside of a module.
! go mod download all
-stderr 'go: cannot match "all": working directory is not part of a module'
+stderr 'go: cannot match "all": go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go mod vendor' should fail: it starts by clearing the existing vendor
# directory, and we don't know where that is.
! go mod vendor
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go mod verify' should fail: we have no modules to verify.
! go mod verify
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go get' without arguments implicitly operates on the main module, and thus
# should fail.
! go get
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
! go get -u
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
! go get -u ./needmod
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go get -u all' upgrades the transitive import graph of the main module,
# which is empty.
! go get -u all
-stderr 'go get: cannot match "all": working directory is not part of a module'
+stderr '^go get: cannot match "all": go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go get' should check the proposed module graph for consistency,
# even though we won't write it anywhere.
@@ -147,16 +147,16 @@ exists $GOPATH/pkg/mod/example.com/version@v1.0.0
# 'go build' without arguments implicitly operates on the current directory, and should fail.
cd needmod
! go build
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
cd ..
# 'go build' of a non-module directory should fail too.
! go build ./needmod
-stderr 'cannot find main module'
+stderr '^go: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go build' of source files should fail if they import anything outside std.
! go build -n ./needmod/needmod.go
-stderr '^needmod[/\\]needmod.go:10:2: no required module provides package example.com/version: working directory is not part of a module$'
+stderr '^needmod[/\\]needmod.go:10:2: no required module provides package example.com/version: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go build' of source files should succeed if they do not import anything outside std.
go build -n -o ignore ./stdonly/stdonly.go
@@ -179,7 +179,7 @@ go doc fmt
# 'go doc' should fail for a package path outside a module.
! go doc example.com/version
-stderr 'doc: no required module provides package example.com/version: working directory is not part of a module'
+stderr 'doc: no required module provides package example.com/version: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go install' with a version should succeed if all constraints are met.
# See mod_install_pkg_version.
@@ -194,7 +194,7 @@ stderr '^go install: version is required when current directory is not in a modu
# 'go install' should fail if a source file imports a package that must be
# resolved to a module.
! go install ./needmod/needmod.go
-stderr 'needmod[/\\]needmod.go:10:2: no required module provides package example.com/version: working directory is not part of a module'
+stderr 'needmod[/\\]needmod.go:10:2: no required module provides package example.com/version: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go install' should succeed with a package in GOROOT.
go install cmd/addr2line
@@ -206,12 +206,12 @@ stderr 'can only use path@version syntax with'
# 'go run' should fail if a package argument must be resolved to a module.
! go run example.com/printversion
-stderr '^no required module provides package example.com/printversion: working directory is not part of a module$'
+stderr '^no required module provides package example.com/printversion: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go run' should fail if a source file imports a package that must be
# resolved to a module.
! go run ./needmod/needmod.go
-stderr '^needmod[/\\]needmod.go:10:2: no required module provides package example.com/version: working directory is not part of a module$'
+stderr '^needmod[/\\]needmod.go:10:2: no required module provides package example.com/version: go.mod file not found in current directory or any parent directory; see ''go help modules''$'
# 'go fmt' should be able to format files outside of a module.
diff --git a/libgo/go/cmd/go/testdata/script/mod_tidy_error.txt b/libgo/go/cmd/go/testdata/script/mod_tidy_error.txt
index b6c24ce..395537b 100644
--- a/libgo/go/cmd/go/testdata/script/mod_tidy_error.txt
+++ b/libgo/go/cmd/go/testdata/script/mod_tidy_error.txt
@@ -4,12 +4,12 @@ env GO111MODULE=on
# 'go mod tidy' and 'go mod vendor' should not hide loading errors.
! go mod tidy
-stderr '^issue27063 imports\n\tnonexist: package nonexist is not in GOROOT \(.*\)'
+! stderr 'package nonexist is not in GOROOT'
stderr '^issue27063 imports\n\tnonexist.example.com: cannot find module providing package nonexist.example.com'
stderr '^issue27063 imports\n\tissue27063/other imports\n\tother.example.com/nonexist: cannot find module providing package other.example.com/nonexist'
! go mod vendor
-stderr '^issue27063 imports\n\tnonexist: package nonexist is not in GOROOT \(.*\)'
+! stderr 'package nonexist is not in GOROOT'
stderr '^issue27063 imports\n\tnonexist.example.com: cannot find module providing package nonexist.example.com'
stderr '^issue27063 imports\n\tissue27063/other imports\n\tother.example.com/nonexist: cannot find module providing package other.example.com/nonexist'
diff --git a/libgo/go/cmd/vendor/modules.txt b/libgo/go/cmd/vendor/modules.txt
index e033984..1084276 100644
--- a/libgo/go/cmd/vendor/modules.txt
+++ b/libgo/go/cmd/vendor/modules.txt
@@ -28,7 +28,7 @@ golang.org/x/arch/x86/x86asm
golang.org/x/crypto/ed25519
golang.org/x/crypto/ed25519/internal/edwards25519
golang.org/x/crypto/ssh/terminal
-# golang.org/x/mod v0.4.1
+# golang.org/x/mod v0.4.2-0.20210302225053-d515b24adc21
## explicit
golang.org/x/mod/internal/lazyregexp
golang.org/x/mod/modfile
diff --git a/libgo/go/encoding/xml/xml.go b/libgo/go/encoding/xml/xml.go
index adaf4da..6f9594d 100644
--- a/libgo/go/encoding/xml/xml.go
+++ b/libgo/go/encoding/xml/xml.go
@@ -271,7 +271,7 @@ func NewTokenDecoder(t TokenReader) *Decoder {
// it will return an error.
//
// Token implements XML name spaces as described by
-// https://www.w3.org/TR/REC-xml-names/. Each of the
+// https://www.w3.org/TR/REC-xml-names/. Each of the
// Name structures contained in the Token has the Space
// set to the URL identifying its name space when known.
// If Token encounters an unrecognized name space prefix,
@@ -285,16 +285,17 @@ func (d *Decoder) Token() (Token, error) {
if d.nextToken != nil {
t = d.nextToken
d.nextToken = nil
- } else if t, err = d.rawToken(); err != nil {
- switch {
- case err == io.EOF && d.t != nil:
- err = nil
- case err == io.EOF && d.stk != nil && d.stk.kind != stkEOF:
- err = d.syntaxError("unexpected EOF")
+ } else {
+ if t, err = d.rawToken(); t == nil && err != nil {
+ if err == io.EOF && d.stk != nil && d.stk.kind != stkEOF {
+ err = d.syntaxError("unexpected EOF")
+ }
+ return nil, err
}
- return t, err
+ // We still have a token to process, so clear any
+ // errors (e.g. EOF) and proceed.
+ err = nil
}
-
if !d.Strict {
if t1, ok := d.autoClose(t); ok {
d.nextToken = t
diff --git a/libgo/go/encoding/xml/xml_test.go b/libgo/go/encoding/xml/xml_test.go
index efddca4..5672ebb 100644
--- a/libgo/go/encoding/xml/xml_test.go
+++ b/libgo/go/encoding/xml/xml_test.go
@@ -33,30 +33,90 @@ func (t *toks) Token() (Token, error) {
func TestDecodeEOF(t *testing.T) {
start := StartElement{Name: Name{Local: "test"}}
- t.Run("EarlyEOF", func(t *testing.T) {
- d := NewTokenDecoder(&toks{earlyEOF: true, t: []Token{
- start,
- start.End(),
- }})
- err := d.Decode(&struct {
- XMLName Name `xml:"test"`
- }{})
- if err != nil {
- t.Error(err)
+ tests := []struct {
+ name string
+ tokens []Token
+ ok bool
+ }{
+ {
+ name: "OK",
+ tokens: []Token{
+ start,
+ start.End(),
+ },
+ ok: true,
+ },
+ {
+ name: "Malformed",
+ tokens: []Token{
+ start,
+ StartElement{Name: Name{Local: "bad"}},
+ start.End(),
+ },
+ ok: false,
+ },
+ }
+ for _, tc := range tests {
+ for _, eof := range []bool{true, false} {
+ name := fmt.Sprintf("%s/earlyEOF=%v", tc.name, eof)
+ t.Run(name, func(t *testing.T) {
+ d := NewTokenDecoder(&toks{
+ earlyEOF: eof,
+ t: tc.tokens,
+ })
+ err := d.Decode(&struct {
+ XMLName Name `xml:"test"`
+ }{})
+ if tc.ok && err != nil {
+ t.Fatalf("d.Decode: expected nil error, got %v", err)
+ }
+ if _, ok := err.(*SyntaxError); !tc.ok && !ok {
+ t.Errorf("d.Decode: expected syntax error, got %v", err)
+ }
+ })
}
- })
- t.Run("LateEOF", func(t *testing.T) {
- d := NewTokenDecoder(&toks{t: []Token{
- start,
- start.End(),
- }})
- err := d.Decode(&struct {
- XMLName Name `xml:"test"`
- }{})
- if err != nil {
- t.Error(err)
+ }
+}
+
+type toksNil struct {
+ returnEOF bool
+ t []Token
+}
+
+func (t *toksNil) Token() (Token, error) {
+ if len(t.t) == 0 {
+ if !t.returnEOF {
+ // Return nil, nil before returning an EOF. It's legal, but
+ // discouraged.
+ t.returnEOF = true
+ return nil, nil
}
- })
+ return nil, io.EOF
+ }
+ var tok Token
+ tok, t.t = t.t[0], t.t[1:]
+ return tok, nil
+}
+
+func TestDecodeNilToken(t *testing.T) {
+ for _, strict := range []bool{true, false} {
+ name := fmt.Sprintf("Strict=%v", strict)
+ t.Run(name, func(t *testing.T) {
+ start := StartElement{Name: Name{Local: "test"}}
+ bad := StartElement{Name: Name{Local: "bad"}}
+ d := NewTokenDecoder(&toksNil{
+ // Malformed
+ t: []Token{start, bad, start.End()},
+ })
+ d.Strict = strict
+ err := d.Decode(&struct {
+ XMLName Name `xml:"test"`
+ }{})
+ if _, ok := err.(*SyntaxError); !ok {
+ t.Errorf("d.Decode: expected syntax error, got %v", err)
+ }
+ })
+ }
}
const testInput = `
diff --git a/libgo/go/go/build/build_test.go b/libgo/go/go/build/build_test.go
index 490c212..1c0dc46 100644
--- a/libgo/go/go/build/build_test.go
+++ b/libgo/go/go/build/build_test.go
@@ -614,7 +614,7 @@ func TestImportPackageOutsideModule(t *testing.T) {
ctxt.GOPATH = gopath
ctxt.Dir = filepath.Join(gopath, "src/example.com/p")
- want := "working directory is not part of a module"
+ want := "go.mod file not found in current directory or any parent directory"
if _, err := ctxt.Import("example.com/p", gopath, FindOnly); err == nil {
t.Fatal("importing package when no go.mod is present succeeded unexpectedly")
} else if errStr := err.Error(); !strings.Contains(errStr, want) {
diff --git a/libgo/go/golang.org/x/mod/modfile/rule.go b/libgo/go/golang.org/x/mod/modfile/rule.go
index c6a189d..f8c9384 100644
--- a/libgo/go/golang.org/x/mod/modfile/rule.go
+++ b/libgo/go/golang.org/x/mod/modfile/rule.go
@@ -125,6 +125,12 @@ func (f *File) AddComment(text string) {
type VersionFixer func(path, version string) (string, error)
+// errDontFix is returned by a VersionFixer to indicate the version should be
+// left alone, even if it's not canonical.
+var dontFixRetract VersionFixer = func(_, vers string) (string, error) {
+ return vers, nil
+}
+
// Parse parses the data, reported in errors as being from file,
// into a File struct. It applies fix, if non-nil, to canonicalize all module versions found.
func Parse(file string, data []byte, fix VersionFixer) (*File, error) {
@@ -142,7 +148,7 @@ func ParseLax(file string, data []byte, fix VersionFixer) (*File, error) {
return parseToFile(file, data, fix, false)
}
-func parseToFile(file string, data []byte, fix VersionFixer, strict bool) (*File, error) {
+func parseToFile(file string, data []byte, fix VersionFixer, strict bool) (parsed *File, err error) {
fs, err := parse(file, data)
if err != nil {
return nil, err
@@ -150,8 +156,18 @@ func parseToFile(file string, data []byte, fix VersionFixer, strict bool) (*File
f := &File{
Syntax: fs,
}
-
var errs ErrorList
+
+ // fix versions in retract directives after the file is parsed.
+ // We need the module path to fix versions, and it might be at the end.
+ defer func() {
+ oldLen := len(errs)
+ f.fixRetract(fix, &errs)
+ if len(errs) > oldLen {
+ parsed, err = nil, errs
+ }
+ }()
+
for _, x := range fs.Stmt {
switch x := x.(type) {
case *Line:
@@ -370,7 +386,7 @@ func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, a
case "retract":
rationale := parseRetractRationale(block, line)
- vi, err := parseVersionInterval(verb, &args, fix)
+ vi, err := parseVersionInterval(verb, "", &args, dontFixRetract)
if err != nil {
if strict {
wrapError(err)
@@ -397,6 +413,47 @@ func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, a
}
}
+// fixRetract applies fix to each retract directive in f, appending any errors
+// to errs.
+//
+// Most versions are fixed as we parse the file, but for retract directives,
+// the relevant module path is the one specified with the module directive,
+// and that might appear at the end of the file (or not at all).
+func (f *File) fixRetract(fix VersionFixer, errs *ErrorList) {
+ if fix == nil {
+ return
+ }
+ path := ""
+ if f.Module != nil {
+ path = f.Module.Mod.Path
+ }
+ var r *Retract
+ wrapError := func(err error) {
+ *errs = append(*errs, Error{
+ Filename: f.Syntax.Name,
+ Pos: r.Syntax.Start,
+ Err: err,
+ })
+ }
+
+ for _, r = range f.Retract {
+ if path == "" {
+ wrapError(errors.New("no module directive found, so retract cannot be used"))
+ return // only print the first one of these
+ }
+
+ args := r.Syntax.Token
+ if args[0] == "retract" {
+ args = args[1:]
+ }
+ vi, err := parseVersionInterval("retract", path, &args, fix)
+ if err != nil {
+ wrapError(err)
+ }
+ r.VersionInterval = vi
+ }
+}
+
// isIndirect reports whether line has a "// indirect" comment,
// meaning it is in go.mod only for its effect on indirect dependencies,
// so that it can be dropped entirely once the effective version of the
@@ -491,13 +548,13 @@ func AutoQuote(s string) string {
return s
}
-func parseVersionInterval(verb string, args *[]string, fix VersionFixer) (VersionInterval, error) {
+func parseVersionInterval(verb string, path string, args *[]string, fix VersionFixer) (VersionInterval, error) {
toks := *args
if len(toks) == 0 || toks[0] == "(" {
return VersionInterval{}, fmt.Errorf("expected '[' or version")
}
if toks[0] != "[" {
- v, err := parseVersion(verb, "", &toks[0], fix)
+ v, err := parseVersion(verb, path, &toks[0], fix)
if err != nil {
return VersionInterval{}, err
}
@@ -509,7 +566,7 @@ func parseVersionInterval(verb string, args *[]string, fix VersionFixer) (Versio
if len(toks) == 0 {
return VersionInterval{}, fmt.Errorf("expected version after '['")
}
- low, err := parseVersion(verb, "", &toks[0], fix)
+ low, err := parseVersion(verb, path, &toks[0], fix)
if err != nil {
return VersionInterval{}, err
}
@@ -523,7 +580,7 @@ func parseVersionInterval(verb string, args *[]string, fix VersionFixer) (Versio
if len(toks) == 0 {
return VersionInterval{}, fmt.Errorf("expected version after ','")
}
- high, err := parseVersion(verb, "", &toks[0], fix)
+ high, err := parseVersion(verb, path, &toks[0], fix)
if err != nil {
return VersionInterval{}, err
}
@@ -631,8 +688,7 @@ func parseVersion(verb string, path string, s *string, fix VersionFixer) (string
}
}
if fix != nil {
- var err error
- t, err = fix(path, t)
+ fixed, err := fix(path, t)
if err != nil {
if err, ok := err.(*module.ModuleError); ok {
return "", &Error{
@@ -643,19 +699,23 @@ func parseVersion(verb string, path string, s *string, fix VersionFixer) (string
}
return "", err
}
+ t = fixed
+ } else {
+ cv := module.CanonicalVersion(t)
+ if cv == "" {
+ return "", &Error{
+ Verb: verb,
+ ModPath: path,
+ Err: &module.InvalidVersionError{
+ Version: t,
+ Err: errors.New("must be of the form v1.2.3"),
+ },
+ }
+ }
+ t = cv
}
- if v := module.CanonicalVersion(t); v != "" {
- *s = v
- return *s, nil
- }
- return "", &Error{
- Verb: verb,
- ModPath: path,
- Err: &module.InvalidVersionError{
- Version: t,
- Err: errors.New("must be of the form v1.2.3"),
- },
- }
+ *s = t
+ return *s, nil
}
func modulePathMajor(path string) (string, error) {
@@ -835,11 +895,8 @@ func (f *File) DropRequire(path string) error {
// AddExclude adds a exclude statement to the mod file. Errors if the provided
// version is not a canonical version string
func (f *File) AddExclude(path, vers string) error {
- if !isCanonicalVersion(vers) {
- return &module.InvalidVersionError{
- Version: vers,
- Err: errors.New("must be of the form v1.2.3"),
- }
+ if err := checkCanonicalVersion(path, vers); err != nil {
+ return err
}
var hint *Line
@@ -916,17 +973,15 @@ func (f *File) DropReplace(oldPath, oldVers string) error {
// AddRetract adds a retract statement to the mod file. Errors if the provided
// version interval does not consist of canonical version strings
func (f *File) AddRetract(vi VersionInterval, rationale string) error {
- if !isCanonicalVersion(vi.High) {
- return &module.InvalidVersionError{
- Version: vi.High,
- Err: errors.New("must be of the form v1.2.3"),
- }
+ var path string
+ if f.Module != nil {
+ path = f.Module.Mod.Path
}
- if !isCanonicalVersion(vi.Low) {
- return &module.InvalidVersionError{
- Version: vi.Low,
- Err: errors.New("must be of the form v1.2.3"),
- }
+ if err := checkCanonicalVersion(path, vi.High); err != nil {
+ return err
+ }
+ if err := checkCanonicalVersion(path, vi.Low); err != nil {
+ return err
}
r := &Retract{
@@ -1086,8 +1141,40 @@ func lineRetractLess(li, lj *Line) bool {
return semver.Compare(vii.High, vij.High) > 0
}
-// isCanonicalVersion tests if the provided version string represents a valid
-// canonical version.
-func isCanonicalVersion(vers string) bool {
- return vers != "" && semver.Canonical(vers) == vers
+// checkCanonicalVersion returns a non-nil error if vers is not a canonical
+// version string or does not match the major version of path.
+//
+// If path is non-empty, the error text suggests a format with a major version
+// corresponding to the path.
+func checkCanonicalVersion(path, vers string) error {
+ _, pathMajor, pathMajorOk := module.SplitPathVersion(path)
+
+ if vers == "" || vers != module.CanonicalVersion(vers) {
+ if pathMajor == "" {
+ return &module.InvalidVersionError{
+ Version: vers,
+ Err: fmt.Errorf("must be of the form v1.2.3"),
+ }
+ }
+ return &module.InvalidVersionError{
+ Version: vers,
+ Err: fmt.Errorf("must be of the form %s.2.3", module.PathMajorPrefix(pathMajor)),
+ }
+ }
+
+ if pathMajorOk {
+ if err := module.CheckPathMajor(vers, pathMajor); err != nil {
+ if pathMajor == "" {
+ // In this context, the user probably wrote "v2.3.4" when they meant
+ // "v2.3.4+incompatible". Suggest that instead of "v0 or v1".
+ return &module.InvalidVersionError{
+ Version: vers,
+ Err: fmt.Errorf("should be %s+incompatible (or module %s/%v)", vers, path, semver.Major(vers)),
+ }
+ }
+ return err
+ }
+ }
+
+ return nil
}
diff --git a/libgo/go/golang.org/x/mod/module/module.go b/libgo/go/golang.org/x/mod/module/module.go
index c1c5263..272baee 100644
--- a/libgo/go/golang.org/x/mod/module/module.go
+++ b/libgo/go/golang.org/x/mod/module/module.go
@@ -270,7 +270,7 @@ func fileNameOK(r rune) bool {
// CheckPath checks that a module path is valid.
// A valid module path is a valid import path, as checked by CheckImportPath,
-// with two additional constraints.
+// with three additional constraints.
// First, the leading path element (up to the first slash, if any),
// by convention a domain name, must contain only lower-case ASCII letters,
// ASCII digits, dots (U+002E), and dashes (U+002D);
@@ -280,8 +280,9 @@ func fileNameOK(r rune) bool {
// and must not contain any dots. For paths beginning with "gopkg.in/",
// this second requirement is replaced by a requirement that the path
// follow the gopkg.in server's conventions.
+// Third, no path element may begin with a dot.
func CheckPath(path string) error {
- if err := checkPath(path, false); err != nil {
+ if err := checkPath(path, modulePath); err != nil {
return fmt.Errorf("malformed module path %q: %v", path, err)
}
i := strings.Index(path, "/")
@@ -315,7 +316,7 @@ func CheckPath(path string) error {
//
// A valid path element is a non-empty string made up of
// ASCII letters, ASCII digits, and limited ASCII punctuation: - . _ and ~.
-// It must not begin or end with a dot (U+002E), nor contain two dots in a row.
+// It must not end with a dot (U+002E), nor contain two dots in a row.
//
// The element prefix up to the first dot must not be a reserved file name
// on Windows, regardless of case (CON, com1, NuL, and so on). The element
@@ -326,19 +327,29 @@ func CheckPath(path string) error {
// top-level package documentation for additional information about
// subtleties of Unicode.
func CheckImportPath(path string) error {
- if err := checkPath(path, false); err != nil {
+ if err := checkPath(path, importPath); err != nil {
return fmt.Errorf("malformed import path %q: %v", path, err)
}
return nil
}
+// pathKind indicates what kind of path we're checking. Module paths,
+// import paths, and file paths have different restrictions.
+type pathKind int
+
+const (
+ modulePath pathKind = iota
+ importPath
+ filePath
+)
+
// checkPath checks that a general path is valid.
// It returns an error describing why but not mentioning path.
// Because these checks apply to both module paths and import paths,
// the caller is expected to add the "malformed ___ path %q: " prefix.
// fileName indicates whether the final element of the path is a file name
// (as opposed to a directory name).
-func checkPath(path string, fileName bool) error {
+func checkPath(path string, kind pathKind) error {
if !utf8.ValidString(path) {
return fmt.Errorf("invalid UTF-8")
}
@@ -357,35 +368,34 @@ func checkPath(path string, fileName bool) error {
elemStart := 0
for i, r := range path {
if r == '/' {
- if err := checkElem(path[elemStart:i], fileName); err != nil {
+ if err := checkElem(path[elemStart:i], kind); err != nil {
return err
}
elemStart = i + 1
}
}
- if err := checkElem(path[elemStart:], fileName); err != nil {
+ if err := checkElem(path[elemStart:], kind); err != nil {
return err
}
return nil
}
// checkElem checks whether an individual path element is valid.
-// fileName indicates whether the element is a file name (not a directory name).
-func checkElem(elem string, fileName bool) error {
+func checkElem(elem string, kind pathKind) error {
if elem == "" {
return fmt.Errorf("empty path element")
}
if strings.Count(elem, ".") == len(elem) {
return fmt.Errorf("invalid path element %q", elem)
}
- if elem[0] == '.' && !fileName {
+ if elem[0] == '.' && kind == modulePath {
return fmt.Errorf("leading dot in path element")
}
if elem[len(elem)-1] == '.' {
return fmt.Errorf("trailing dot in path element")
}
charOK := pathOK
- if fileName {
+ if kind == filePath {
charOK = fileNameOK
}
for _, r := range elem {
@@ -406,7 +416,7 @@ func checkElem(elem string, fileName bool) error {
}
}
- if fileName {
+ if kind == filePath {
// don't check for Windows short-names in file names. They're
// only an issue for import paths.
return nil
@@ -444,7 +454,7 @@ func checkElem(elem string, fileName bool) error {
// top-level package documentation for additional information about
// subtleties of Unicode.
func CheckFilePath(path string) error {
- if err := checkPath(path, true); err != nil {
+ if err := checkPath(path, filePath); err != nil {
return fmt.Errorf("malformed file path %q: %v", path, err)
}
return nil
@@ -647,7 +657,7 @@ func EscapePath(path string) (escaped string, err error) {
// Versions are allowed to be in non-semver form but must be valid file names
// and not contain exclamation marks.
func EscapeVersion(v string) (escaped string, err error) {
- if err := checkElem(v, true); err != nil || strings.Contains(v, "!") {
+ if err := checkElem(v, filePath); err != nil || strings.Contains(v, "!") {
return "", &InvalidVersionError{
Version: v,
Err: fmt.Errorf("disallowed version string"),
@@ -706,7 +716,7 @@ func UnescapeVersion(escaped string) (v string, err error) {
if !ok {
return "", fmt.Errorf("invalid escaped version %q", escaped)
}
- if err := checkElem(v, true); err != nil {
+ if err := checkElem(v, filePath); err != nil {
return "", fmt.Errorf("invalid escaped version %q: %v", v, err)
}
return v, nil
diff --git a/libgo/go/time/zoneinfo.go b/libgo/go/time/zoneinfo.go
index c366229..6db9443 100644
--- a/libgo/go/time/zoneinfo.go
+++ b/libgo/go/time/zoneinfo.go
@@ -377,8 +377,10 @@ func tzsetOffset(s string) (offset int, rest string, ok bool) {
neg = true
}
+ // The tzdata code permits values up to 24 * 7 here,
+ // although POSIX does not.
var hours int
- hours, s, ok = tzsetNum(s, 0, 24)
+ hours, s, ok = tzsetNum(s, 0, 24*7)
if !ok {
return 0, "", false
}
@@ -487,7 +489,7 @@ func tzsetRule(s string) (rule, string, bool) {
}
offset, s, ok := tzsetOffset(s[1:])
- if !ok || offset < 0 {
+ if !ok {
return rule{}, "", false
}
r.time = offset
diff --git a/libgo/go/time/zoneinfo_test.go b/libgo/go/time/zoneinfo_test.go
index d543f93e..3e32da0 100644
--- a/libgo/go/time/zoneinfo_test.go
+++ b/libgo/go/time/zoneinfo_test.go
@@ -189,22 +189,50 @@ func TestMalformedTZData(t *testing.T) {
}
}
-func TestLoadLocationFromTZDataSlim(t *testing.T) {
- // A 2020b slim tzdata for Europe/Berlin
- tzData := "TZif2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00TZif2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00<\x00\x00\x00\x04\x00\x00\x00\x12\xff\xff\xff\xffo\xa2a\xf8\xff\xff\xff\xff\x9b\f\x17`\xff\xff\xff\xff\x9b\xd5\xda\xf0\xff\xff\xff\xff\x9cٮ\x90\xff\xff\xff\xff\x9d\xa4\xb5\x90\xff\xff\xff\xff\x9e\xb9\x90\x90\xff\xff\xff\xff\x9f\x84\x97\x90\xff\xff\xff\xff\xc8\tq\x90\xff\xff\xff\xff\xcc\xe7K\x10\xff\xff\xff\xffͩ\x17\x90\xff\xff\xff\xff\u03a2C\x10\xff\xff\xff\xffϒ4\x10\xff\xff\xff\xffЂ%\x10\xff\xff\xff\xff\xd1r\x16\x10\xff\xff\xff\xffѶ\x96\x00\xff\xff\xff\xff\xd2X\xbe\x80\xff\xff\xff\xffҡO\x10\xff\xff\xff\xff\xd3c\x1b\x90\xff\xff\xff\xff\xd4K#\x90\xff\xff\xff\xff\xd59\xd1 \xff\xff\xff\xff\xd5g\xe7\x90\xff\xff\xff\xffըs\x00\xff\xff\xff\xff\xd6)\xb4\x10\xff\xff\xff\xff\xd7,\x1a\x10\xff\xff\xff\xff\xd8\t\x96\x10\xff\xff\xff\xff\xd9\x02\xc1\x90\xff\xff\xff\xff\xd9\xe9x\x10\x00\x00\x00\x00\x13MD\x10\x00\x00\x00\x00\x143\xfa\x90\x00\x00\x00\x00\x15#\xeb\x90\x00\x00\x00\x00\x16\x13ܐ\x00\x00\x00\x00\x17\x03͐\x00\x00\x00\x00\x17\xf3\xbe\x90\x00\x00\x00\x00\x18㯐\x00\x00\x00\x00\x19Ӡ\x90\x00\x00\x00\x00\x1aÑ\x90\x00\x00\x00\x00\x1b\xbc\xbd\x10\x00\x00\x00\x00\x1c\xac\xae\x10\x00\x00\x00\x00\x1d\x9c\x9f\x10\x00\x00\x00\x00\x1e\x8c\x90\x10\x00\x00\x00\x00\x1f|\x81\x10\x00\x00\x00\x00 lr\x10\x00\x00\x00\x00!\\c\x10\x00\x00\x00\x00\"LT\x10\x00\x00\x00\x00#<E\x10\x00\x00\x00\x00$,6\x10\x00\x00\x00\x00%\x1c'\x10\x00\x00\x00\x00&\f\x18\x10\x00\x00\x00\x00'\x05C\x90\x00\x00\x00\x00'\xf54\x90\x00\x00\x00\x00(\xe5%\x90\x00\x00\x00\x00)\xd5\x16\x90\x00\x00\x00\x00*\xc5\a\x90\x00\x00\x00\x00+\xb4\xf8\x90\x00\x00\x00\x00,\xa4\xe9\x90\x00\x00\x00\x00-\x94ڐ\x00\x00\x00\x00.\x84ː\x00\x00\x00\x00/t\xbc\x90\x00\x00\x00\x000d\xad\x90\x00\x00\x00\x001]\xd9\x10\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x03\x01\x02\x01\x02\x01\x03\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x00\x00\f\x88\x00\x00\x00\x00\x1c \x01\x04\x00\x00\x0e\x10\x00\t\x00\x00*0\x01\rLMT\x00CEST\x00CET\x00CEMT\x00\nCET-1CEST,M3.5.0,M10.5.0/3\n"
+var slimTests = []struct {
+ zoneName string
+ tzData string
+ wantName string
+ wantOffset int
+}{
+ {
+ // 2020b slim tzdata for Europe/Berlin.
+ zoneName: "Europe/Berlin",
+ tzData: "TZif2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00TZif2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00<\x00\x00\x00\x04\x00\x00\x00\x12\xff\xff\xff\xffo\xa2a\xf8\xff\xff\xff\xff\x9b\f\x17`\xff\xff\xff\xff\x9b\xd5\xda\xf0\xff\xff\xff\xff\x9cٮ\x90\xff\xff\xff\xff\x9d\xa4\xb5\x90\xff\xff\xff\xff\x9e\xb9\x90\x90\xff\xff\xff\xff\x9f\x84\x97\x90\xff\xff\xff\xff\xc8\tq\x90\xff\xff\xff\xff\xcc\xe7K\x10\xff\xff\xff\xffͩ\x17\x90\xff\xff\xff\xff\u03a2C\x10\xff\xff\xff\xffϒ4\x10\xff\xff\xff\xffЂ%\x10\xff\xff\xff\xff\xd1r\x16\x10\xff\xff\xff\xffѶ\x96\x00\xff\xff\xff\xff\xd2X\xbe\x80\xff\xff\xff\xffҡO\x10\xff\xff\xff\xff\xd3c\x1b\x90\xff\xff\xff\xff\xd4K#\x90\xff\xff\xff\xff\xd59\xd1 \xff\xff\xff\xff\xd5g\xe7\x90\xff\xff\xff\xffըs\x00\xff\xff\xff\xff\xd6)\xb4\x10\xff\xff\xff\xff\xd7,\x1a\x10\xff\xff\xff\xff\xd8\t\x96\x10\xff\xff\xff\xff\xd9\x02\xc1\x90\xff\xff\xff\xff\xd9\xe9x\x10\x00\x00\x00\x00\x13MD\x10\x00\x00\x00\x00\x143\xfa\x90\x00\x00\x00\x00\x15#\xeb\x90\x00\x00\x00\x00\x16\x13ܐ\x00\x00\x00\x00\x17\x03͐\x00\x00\x00\x00\x17\xf3\xbe\x90\x00\x00\x00\x00\x18㯐\x00\x00\x00\x00\x19Ӡ\x90\x00\x00\x00\x00\x1aÑ\x90\x00\x00\x00\x00\x1b\xbc\xbd\x10\x00\x00\x00\x00\x1c\xac\xae\x10\x00\x00\x00\x00\x1d\x9c\x9f\x10\x00\x00\x00\x00\x1e\x8c\x90\x10\x00\x00\x00\x00\x1f|\x81\x10\x00\x00\x00\x00 lr\x10\x00\x00\x00\x00!\\c\x10\x00\x00\x00\x00\"LT\x10\x00\x00\x00\x00#<E\x10\x00\x00\x00\x00$,6\x10\x00\x00\x00\x00%\x1c'\x10\x00\x00\x00\x00&\f\x18\x10\x00\x00\x00\x00'\x05C\x90\x00\x00\x00\x00'\xf54\x90\x00\x00\x00\x00(\xe5%\x90\x00\x00\x00\x00)\xd5\x16\x90\x00\x00\x00\x00*\xc5\a\x90\x00\x00\x00\x00+\xb4\xf8\x90\x00\x00\x00\x00,\xa4\xe9\x90\x00\x00\x00\x00-\x94ڐ\x00\x00\x00\x00.\x84ː\x00\x00\x00\x00/t\xbc\x90\x00\x00\x00\x000d\xad\x90\x00\x00\x00\x001]\xd9\x10\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x03\x01\x02\x01\x02\x01\x03\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x00\x00\f\x88\x00\x00\x00\x00\x1c \x01\x04\x00\x00\x0e\x10\x00\t\x00\x00*0\x01\rLMT\x00CEST\x00CET\x00CEMT\x00\nCET-1CEST,M3.5.0,M10.5.0/3\n",
+ wantName: "CET",
+ wantOffset: 3600,
+ },
+ {
+ // 2021a slim tzdata for America/Nuuk.
+ zoneName: "America/Nuuk",
+ tzData: "TZif3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00TZif3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\"\x00\x00\x00\x03\x00\x00\x00\f\xff\xff\xff\xff\x9b\x80h\x00\x00\x00\x00\x00\x13M|P\x00\x00\x00\x00\x143\xfa\x90\x00\x00\x00\x00\x15#\xeb\x90\x00\x00\x00\x00\x16\x13ܐ\x00\x00\x00\x00\x17\x03͐\x00\x00\x00\x00\x17\xf3\xbe\x90\x00\x00\x00\x00\x18㯐\x00\x00\x00\x00\x19Ӡ\x90\x00\x00\x00\x00\x1aÑ\x90\x00\x00\x00\x00\x1b\xbc\xbd\x10\x00\x00\x00\x00\x1c\xac\xae\x10\x00\x00\x00\x00\x1d\x9c\x9f\x10\x00\x00\x00\x00\x1e\x8c\x90\x10\x00\x00\x00\x00\x1f|\x81\x10\x00\x00\x00\x00 lr\x10\x00\x00\x00\x00!\\c\x10\x00\x00\x00\x00\"LT\x10\x00\x00\x00\x00#<E\x10\x00\x00\x00\x00$,6\x10\x00\x00\x00\x00%\x1c'\x10\x00\x00\x00\x00&\f\x18\x10\x00\x00\x00\x00'\x05C\x90\x00\x00\x00\x00'\xf54\x90\x00\x00\x00\x00(\xe5%\x90\x00\x00\x00\x00)\xd5\x16\x90\x00\x00\x00\x00*\xc5\a\x90\x00\x00\x00\x00+\xb4\xf8\x90\x00\x00\x00\x00,\xa4\xe9\x90\x00\x00\x00\x00-\x94ڐ\x00\x00\x00\x00.\x84ː\x00\x00\x00\x00/t\xbc\x90\x00\x00\x00\x000d\xad\x90\x00\x00\x00\x001]\xd9\x10\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\xff\xffπ\x00\x00\xff\xff\xd5\xd0\x00\x04\xff\xff\xe3\xe0\x01\bLMT\x00-03\x00-02\x00\n<-03>3<-02>,M3.5.0/-2,M10.5.0/-1\n",
+ wantName: "-03",
+ wantOffset: -10800,
+ },
+ {
+ // 2021a slim tzdata for Asia/Gaza.
+ zoneName: "Asia/Gaza",
+ tzData: "TZif3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00TZif3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00s\x00\x00\x00\x05\x00\x00\x00\x15\xff\xff\xff\xff}\xbdJ\xb0\xff\xff\xff\xff\xc8Y\xcf\x00\xff\xff\xff\xff\xc8\xfa\xa6\x00\xff\xff\xff\xff\xc98\x9c\x80\xff\xff\xff\xff\xcc\xe5\xeb\x80\xff\xff\xff\xffͬ\xfe\x00\xff\xff\xff\xff\xce\xc7\x1f\x00\xff\xff\xff\xffϏ\x83\x00\xff\xff\xff\xffЩ\xa4\x00\xff\xff\xff\xffф}\x00\xff\xff\xff\xffҊ׀\xff\xff\xff\xff\xd3e\xb0\x80\xff\xff\xff\xff\xd4l\v\x00\xff\xff\xff\xff\xe86c`\xff\xff\xff\xff\xe8\xf4-P\xff\xff\xff\xff\xea\v\xb9`\xff\xff\xff\xff\xea\xd5`\xd0\xff\xff\xff\xff\xeb\xec\xfa\xf0\xff\xff\xff\xff\xec\xb5m\x00\xff\xff\xff\xff\xed\xcf\u007f\xf0\xff\xff\xff\xff\xee\x97\xf2\x00\xff\xff\xff\xffﰳp\xff\xff\xff\xff\xf0y%\x80\xff\xff\xff\xff\xf1\x91\xe6\xf0\xff\xff\xff\xff\xf2ZY\x00\xff\xff\xff\xff\xf3s\x1ap\xff\xff\xff\xff\xf4;\x8c\x80\xff\xff\xff\xff\xf5U\x9fp\xff\xff\xff\xff\xf6\x1e\x11\x80\xff\xff\xff\xff\xf76\xd2\xf0\xff\xff\xff\xff\xf7\xffE\x00\xff\xff\xff\xff\xf9\x18\x06p\xff\xff\xff\xff\xf9\xe1\xca\x00\xff\xff\xff\xff\xfa\xf99\xf0\xff\xff\xff\xff\xfb'BP\x00\x00\x00\x00\b|\x8b\xe0\x00\x00\x00\x00\b\xfd\xb0\xd0\x00\x00\x00\x00\t\xf6\xea`\x00\x00\x00\x00\n\xa63\xd0\x00\x00\x00\x00\x13\xe9\xfc`\x00\x00\x00\x00\x14![`\x00\x00\x00\x00\x1a\xfa\xc6`\x00\x00\x00\x00\x1b\x8en`\x00\x00\x00\x00\x1c\xbe\xf8\xe0\x00\x00\x00\x00\x1dw|\xd0\x00\x00\x00\x00\x1e\xcc\xff`\x00\x00\x00\x00\x1f`\x99P\x00\x00\x00\x00 \x82\xb1`\x00\x00\x00\x00!I\xb5\xd0\x00\x00\x00\x00\"^\x9e\xe0\x00\x00\x00\x00# ]P\x00\x00\x00\x00$Z0`\x00\x00\x00\x00%\x00?P\x00\x00\x00\x00&\v\xed\xe0\x00\x00\x00\x00&\xd6\xe6\xd0\x00\x00\x00\x00'\xeb\xcf\xe0\x00\x00\x00\x00(\xc0\x03P\x00\x00\x00\x00)\xd4\xec`\x00\x00\x00\x00*\xa9\x1f\xd0\x00\x00\x00\x00+\xbbe\xe0\x00\x00\x00\x00,\x89\x01\xd0\x00\x00\x00\x00-\x9bG\xe0\x00\x00\x00\x00._\xa9P\x00\x00\x00\x00/{)\xe0\x00\x00\x00\x000H\xc5\xd0\x00\x00\x00\x000\xe7\a\xe0\x00\x00\x00\x001dF`\x00\x00\x00\x002A\xc2`\x00\x00\x00\x003D(`\x00\x00\x00\x004!\xa4`\x00\x00\x00\x005$\n`\x00\x00\x00\x006\x01\x86`\x00\x00\x00\x007\x16a`\x00\x00\x00\x008\x06DP\x00\x00\x00\x008\xff}\xe0\x00\x00\x00\x009\xef`\xd0\x00\x00\x00\x00:\xdf_\xe0\x00\x00\x00\x00;\xcfB\xd0\x00\x00\x00\x00<\xbfA\xe0\x00\x00\x00\x00=\xaf$\xd0\x00\x00\x00\x00>\x9f#\xe0\x00\x00\x00\x00?\x8f\x06\xd0\x00\x00\x00\x00@\u007f\x05\xe0\x00\x00\x00\x00A\\\x81\xe0\x00\x00\x00\x00B^\xe7\xe0\x00\x00\x00\x00CA\xb7\xf0\x00\x00\x00\x00D-\xa6`\x00\x00\x00\x00E\x12\xfdP\x00\x00\x00\x00F\x0e\xd9\xe0\x00\x00\x00\x00F\xe8op\x00\x00\x00\x00G\xec\x18\xe0\x00\x00\x00\x00H\xb7\x11\xd0\x00\x00\x00\x00I\xcb\xfa\xe0\x00\x00\x00\x00J\xa0<`\x00\x00\x00\x00K\xad.\x9c\x00\x00\x00\x00La\xbd\xd0\x00\x00\x00\x00M\x94\xf9\x9c\x00\x00\x00\x00N5\xc2P\x00\x00\x00\x00Ot\xdb`\x00\x00\x00\x00P[\x91\xe0\x00\x00\x00\x00QT\xbd`\x00\x00\x00\x00RD\xa0P\x00\x00\x00\x00S4\x9f`\x00\x00\x00\x00TIlP\x00\x00\x00\x00U\x15\xd2\xe0\x00\x00\x00\x00V)\\`\x00\x00\x00\x00V\xf5\xc2\xf0\x00\x00\x00\x00X\x13\xca`\x00\x00\x00\x00Xդ\xf0\x00\x00\x00\x00Y\xf3\xac`\x00\x00\x00\x00Z\xb5\x86\xf0\x00\x00\x00\x00[ӎ`\x00\x00\x00\x00\\\x9dC\xe0\x00\x00\x00\x00]\xb3bP\x00\x00\x00\x00^~w`\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x02\x01\x00\x00 P\x00\x00\x00\x00*0\x01\x04\x00\x00\x1c \x00\t\x00\x00*0\x01\r\x00\x00\x1c \x00\x11LMT\x00EEST\x00EET\x00IDT\x00IST\x00\nEET-2EEST,M3.4.4/48,M10.4.4/49\n",
+ wantName: "EET",
+ wantOffset: 7200,
+ },
+}
- reference, err := time.LoadLocationFromTZData("Europe/Berlin", []byte(tzData))
- if err != nil {
- t.Fatal(err)
- }
+func TestLoadLocationFromTZDataSlim(t *testing.T) {
+ for _, test := range slimTests {
+ reference, err := time.LoadLocationFromTZData(test.zoneName, []byte(test.tzData))
+ if err != nil {
+ t.Fatal(err)
+ }
- d := time.Date(2020, time.October, 29, 15, 30, 0, 0, reference)
- tzName, tzOffset := d.Zone()
- if want := "CET"; tzName != want {
- t.Errorf("Zone name == %s, want %s", tzName, want)
- }
- if want := 3600; tzOffset != want {
- t.Errorf("Zone offset == %d, want %d", tzOffset, want)
+ d := time.Date(2020, time.October, 29, 15, 30, 0, 0, reference)
+ tzName, tzOffset := d.Zone()
+ if tzName != test.wantName {
+ t.Errorf("Zone name == %s, want %s", tzName, test.wantName)
+ }
+ if tzOffset != test.wantOffset {
+ t.Errorf("Zone offset == %d, want %d", tzOffset, test.wantOffset)
+ }
}
}
@@ -269,7 +297,8 @@ func TestTzsetOffset(t *testing.T) {
{"+08", 8 * 60 * 60, "", true},
{"-01:02:03", -1*60*60 - 2*60 - 3, "", true},
{"01", 1 * 60 * 60, "", true},
- {"100", 0, "", false},
+ {"100", 100 * 60 * 60, "", true},
+ {"1000", 0, "", false},
{"8PDT", 8 * 60 * 60, "PDT", true},
} {
off, out, ok := time.TzsetOffset(test.in)
@@ -294,6 +323,7 @@ func TestTzsetRule(t *testing.T) {
{"30/03:00:00", time.Rule{Kind: time.RuleDOY, Day: 30, Time: 3 * 60 * 60}, "", true},
{"M4.5.6/03:00:00", time.Rule{Kind: time.RuleMonthWeekDay, Mon: 4, Week: 5, Day: 6, Time: 3 * 60 * 60}, "", true},
{"M4.5.7/03:00:00", time.Rule{}, "", false},
+ {"M4.5.6/-04", time.Rule{Kind: time.RuleMonthWeekDay, Mon: 4, Week: 5, Day: 6, Time: -4 * 60 * 60}, "", true},
} {
r, out, ok := time.TzsetRule(test.in)
if r != test.r || out != test.out || ok != test.ok {
diff --git a/libgo/misc/cgo/testcarchive/testdata/main_unix.c b/libgo/misc/cgo/testcarchive/testdata/main_unix.c
index b23ac1c..bd00f9d 100644
--- a/libgo/misc/cgo/testcarchive/testdata/main_unix.c
+++ b/libgo/misc/cgo/testcarchive/testdata/main_unix.c
@@ -36,7 +36,7 @@ int install_handler() {
return 2;
}
// gccgo does not set SA_ONSTACK for SIGSEGV.
- if (getenv("GCCGO") == "" && (osa.sa_flags&SA_ONSTACK) == 0) {
+ if (getenv("GCCGO") == NULL && (osa.sa_flags&SA_ONSTACK) == 0) {
fprintf(stderr, "Go runtime did not install signal handler\n");
return 2;
}
diff --git a/libgo/misc/cgo/testplugin/plugin_test.go b/libgo/misc/cgo/testplugin/plugin_test.go
index 9055dbd..2d99101 100644
--- a/libgo/misc/cgo/testplugin/plugin_test.go
+++ b/libgo/misc/cgo/testplugin/plugin_test.go
@@ -201,12 +201,11 @@ func TestMethod(t *testing.T) {
// Exported symbol's method must be live.
goCmd(t, "build", "-buildmode=plugin", "-o", "plugin.so", "./method/plugin.go")
goCmd(t, "build", "-o", "method.exe", "./method/main.go")
+ run(t, "./method.exe")
+}
- ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
- defer cancel()
- cmd := exec.CommandContext(ctx, "./method.exe")
- out, err := cmd.CombinedOutput()
- if err != nil {
- t.Fatalf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, out)
- }
+func TestMethod2(t *testing.T) {
+ goCmd(t, "build", "-buildmode=plugin", "-o", "method2.so", "./method2/plugin.go")
+ goCmd(t, "build", "-o", "method2.exe", "./method2/main.go")
+ run(t, "./method2.exe")
}
diff --git a/libgo/misc/cgo/testplugin/testdata/method2/main.go b/libgo/misc/cgo/testplugin/testdata/method2/main.go
new file mode 100644
index 0000000..6a87e7b
--- /dev/null
+++ b/libgo/misc/cgo/testplugin/testdata/method2/main.go
@@ -0,0 +1,32 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// A type can be passed to a plugin and converted to interface
+// there. So its methods need to be live.
+
+package main
+
+import (
+ "plugin"
+
+ "testplugin/method2/p"
+)
+
+var t p.T
+
+type I interface { M() }
+
+func main() {
+ pl, err := plugin.Open("method2.so")
+ if err != nil {
+ panic(err)
+ }
+
+ f, err := pl.Lookup("F")
+ if err != nil {
+ panic(err)
+ }
+
+ f.(func(p.T) interface{})(t).(I).M()
+}
diff --git a/libgo/misc/cgo/testplugin/testdata/method2/p/p.go b/libgo/misc/cgo/testplugin/testdata/method2/p/p.go
new file mode 100644
index 0000000..acb526a
--- /dev/null
+++ b/libgo/misc/cgo/testplugin/testdata/method2/p/p.go
@@ -0,0 +1,9 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+type T int
+
+func (T) M() { println("M") }
diff --git a/libgo/misc/cgo/testplugin/testdata/method2/plugin.go b/libgo/misc/cgo/testplugin/testdata/method2/plugin.go
new file mode 100644
index 0000000..6198e76
--- /dev/null
+++ b/libgo/misc/cgo/testplugin/testdata/method2/plugin.go
@@ -0,0 +1,11 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "testplugin/method2/p"
+
+func main() {}
+
+func F(t p.T) interface{} { return t }
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index e4a5197..c7502ca 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,13 @@
+2021-03-15 Tobias Burnus <tobias@codesourcery.com>
+
+ PR c++/99509
+ * testsuite/libgomp.c-c++-common/declare_target-1.c: New test.
+
+2021-03-12 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/98858
+ * testsuite/libgomp.fortran/use_device_ptr-3.f90: New test.
+
2021-03-04 Jakub Jelinek <jakub@redhat.com>
* configure.ac: Add AC_CHECK_SIZEOF([void *]).
diff --git a/libgomp/testsuite/libgomp.c-c++-common/declare_target-1.c b/libgomp/testsuite/libgomp.c-c++-common/declare_target-1.c
new file mode 100644
index 0000000..c5670df
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c-c++-common/declare_target-1.c
@@ -0,0 +1,22 @@
+/* PR c++/99509 */
+
+#pragma omp declare target
+int data[] = {5};
+#pragma omp end declare target
+
+static inline int
+foo (int idx)
+{
+ return data[idx];
+}
+
+int
+main ()
+{
+ int i = -1;
+ #pragma omp target map(from:i)
+ i = foo(0);
+ if (i != 5)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.fortran/use_device_ptr-3.f90 b/libgomp/testsuite/libgomp.fortran/use_device_ptr-3.f90
new file mode 100644
index 0000000..f2b33cd
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/use_device_ptr-3.f90
@@ -0,0 +1,91 @@
+! PR fortran/98858
+!
+! Assumed-size array with use_device_ptr()
+!
+program test_use_device_ptr
+ use iso_c_binding, only: c_ptr, c_loc, c_f_pointer
+ implicit none
+ double precision :: alpha
+ integer, parameter :: lda = 10
+ integer, allocatable :: mat(:, :)
+ integer :: i, j
+
+ allocate(mat(lda, lda))
+ do i = 1, lda
+ do j = 1, lda
+ mat(j,i) = i*100 + j
+ end do
+ end do
+
+ !$omp target enter data map(to:mat)
+ call dgemm(lda, mat)
+ !$omp target exit data map(from:mat)
+
+ do i = 1, lda
+ do j = 1, lda
+ if (mat(j,i) /= -(i*100 + j)) stop 1
+ end do
+ end do
+
+ !$omp target enter data map(to:mat)
+ call dgemm2(lda, mat)
+ !$omp target exit data map(from:mat)
+
+ do i = 1, lda
+ do j = 1, lda
+ if (mat(j,i) /= (i*100 + j)) stop 1
+ end do
+ end do
+
+ contains
+
+ subroutine dgemm(lda, a)
+ implicit none
+ integer :: lda
+ integer, target:: a(lda,*) ! need target attribute to use c_loc
+ !$omp target data use_device_ptr(a)
+ call negate_it(c_loc(a), lda)
+ !$omp end target data
+ end subroutine
+
+ subroutine dgemm2(lda, a)
+ implicit none
+ integer :: lda
+ integer, target:: a(lda,*) ! need target attribute to use c_loc
+ !$omp target data use_device_addr(a)
+ call negate_it(c_loc(a), lda)
+ !$omp end target data
+ end subroutine
+
+ subroutine negate_it(a, n)
+ type(c_ptr), value :: a
+ integer, value :: n
+ integer, pointer :: array(:,:)
+
+ ! detour due to OpenMP 5.0 oddness
+ call c_f_pointer(a, array, [n,n])
+ call do_offload(array, n)
+ end
+
+ subroutine do_offload(aptr, n)
+ integer, target :: aptr(:,:)
+ integer, value :: n
+ !$omp target is_device_ptr(aptr)
+ call negate_it_tgt(aptr, n)
+ !$omp end target
+ end subroutine do_offload
+
+ subroutine negate_it_tgt(array, n)
+ !$omp declare target
+ integer, value :: n
+ integer :: array(n,n)
+ integer :: i, j
+ !$omp parallel do collapse(2)
+ do i = 1, n
+ do j = 1, n
+ array(j,i) = - array(j,i)
+ end do
+ end do
+ !$omp end parallel do
+ end subroutine
+end program
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 3c0ee1a..99bb585 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2021-03-16 Nick Clifton <nickc@redhat.com>
+
+ * sha1.c (sha1_process_bytes): Use memmove in place of memcpy.
+
2021-02-20 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (ACLOCAL, ACLOCAL_AMFLAGS, $(srcdir)/aclocal.m4): Define.
diff --git a/libiberty/sha1.c b/libiberty/sha1.c
index e3d7f86..7d15d48 100644
--- a/libiberty/sha1.c
+++ b/libiberty/sha1.c
@@ -258,7 +258,7 @@ sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
{
sha1_process_block (ctx->buffer, 64, ctx);
left_over -= 64;
- memcpy (ctx->buffer, &ctx->buffer[16], left_over);
+ memmove (ctx->buffer, &ctx->buffer[16], left_over);
}
ctx->buflen = left_over;
}
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 109a206..2d2bd37 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,136 @@
+2021-03-16 Jonathan Wakely <jwakely@redhat.com>
+
+ 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.
+
+2021-03-16 Jonathan Wakely <jwakely@redhat.com>
+
+ 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.
+
+2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ * testsuite/17_intro/names.cc: Exclude j from the list
+ of test symbols for Darwin.
+
+2021-03-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/os/bsd/darwin/ppc-extra.ver: Add matching for
+ to_chars and from_chars for long double.
+
+2021-03-15 Patrick Palka <ppalka@redhat.com>
+
+ * 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.
+
+2021-03-15 Caroline Tice <cmtice@google.com>
+
+ PR libstdc++/99172
+ * src/Makefile.am (AM_CXXFLAGS_PRE, AM_CXXFLAGS): Add
+ AM_CXXFLAGS_PRE with the old definition of AM_CXXFLAGS; make
+ AM_CXXFLAGS to be AM_CXXFLAGS_PRE with '-fvtable-verify=std'
+ filtered out.
+ * src/Makefile.in: Regenerate.
+
+2021-03-11 Patrick Palka <ppalka@redhat.com>
+
+ * src/c++17/floating_to_chars.cc: Simplify the file as if
+ __SIZEOF_INT128__ is always defined.
+ [!defined __SIZEOF_INT128__]: Include "uint128_t.h". Define
+ a base-10 to_chars overload for the uint128_t class type.
+ * src/c++17/uint128_t.h: New file.
+ * testsuite/20_util/to_chars/long_double.cc: No longer expect an
+ execution FAIL on targets that have a large long double type
+ but lack __int128.
+
+2021-03-11 Patrick Palka <ppalka@redhat.com>
+
+ * src/c++17/ryu/LOCAL_PATCHES: Update.
+ * src/c++17/ryu/d2s_intrinsics.h: Don't define uint128_t.
+ * src/c++17/ryu/generic_128.h: Likewise.
+ * src/c++17/ryu/ryu_generic_128.h (struct floating_decimal_128):
+ Use uint128_t instead of __uint128_t.
+ (generic_binary_to_decimal): Likewise.
+
+2021-03-11 Patrick Palka <ppalka@redhat.com>
+
+ * src/c++17/ryu/LOCAL_PATCHES: New file.
+
+2021-03-11 Patrick Palka <ppalka@redhat.com>
+
+ * src/c++17/floating_to_chars.cc (uint128_t): New conditionally
+ defined alias of unsigned __int128.
+ (floating_type_traits_binary128::mantissa_t): Use uint128_t
+ instead of unsigned __int128.
+ (floating_type_traits<long double>::mantissa_t)
+ [LONG_DOUBLE_KIND == LDK_IBM128]: Likewise.
+ (get_ieee_repr): Likewise. Make casts from uint_t to mantissa_t
+ and uint32_t explicit. Simplify the extraction of mantissa,
+ exponent and sign bit.
+
+2021-03-11 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/std/barrier (barrier::arrival_token): New move-only
+ class that encapsulates the underlying token value.
+
+2021-03-11 Jonathan Wakely <jwakely@redhat.com>
+
+ * python/libstdcxx/v6/printers.py (find_type): Use tag attribute
+ instead of unqualified() method.
+
+2021-03-11 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/99537
+ * include/std/stop_token (_Stop_state_t::_M_release_ownership):
+ Use acq_rel memory ordering.
+
+2021-03-11 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/99537
+ * src/c++17/fs_dir.cc (recursive_directory_iterator): Use new
+ helper function to check for permission denied errors.
+ * src/filesystem/dir.cc (recursive_directory_iterator):
+ Likewise.
+ * src/filesystem/dir-common.h (is_permission_denied_error): New
+ helper function.
+
+2021-03-11 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/99536
+ * include/bits/random.h (normal_distribution): Use
+ default-initializer for _M_saved and _M_saved_available.
+
2021-03-10 John David Anglin <danglin@gcc.gnu.org>
* testsuite/29_atomics/atomic/wait_notify/bool.cc: Add options to
diff --git a/libstdc++-v3/config/abi/post/aarch64-linux-gnu/baseline_symbols.txt b/libstdc++-v3/config/abi/post/aarch64-linux-gnu/baseline_symbols.txt
index 45f1540..898c8e1 100644
--- a/libstdc++-v3/config/abi/post/aarch64-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/aarch64-linux-gnu/baseline_symbols.txt
@@ -4086,8 +4086,6 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Em@@GLIBCXX
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4
-FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29
-FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29
FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4
FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4
FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4
diff --git a/libstdc++-v3/config/abi/post/ia64-linux-gnu/baseline_symbols.txt b/libstdc++-v3/config/abi/post/ia64-linux-gnu/baseline_symbols.txt
index 62d28d2..92288cc 100644
--- a/libstdc++-v3/config/abi/post/ia64-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/ia64-linux-gnu/baseline_symbols.txt
@@ -4086,8 +4086,6 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Em@@GLIBCXX
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4
-FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29
-FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29
FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4
FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4
FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4
diff --git a/libstdc++-v3/config/abi/post/m68k-linux-gnu/baseline_symbols.txt b/libstdc++-v3/config/abi/post/m68k-linux-gnu/baseline_symbols.txt
index 45992ae..af5dc02 100644
--- a/libstdc++-v3/config/abi/post/m68k-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/m68k-linux-gnu/baseline_symbols.txt
@@ -4086,8 +4086,6 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Ej@@GLIBCXX
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4
-FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29
-FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29
FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4
FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4
FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4
diff --git a/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt b/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt
index 02a2e17..6e5da52 100644
--- a/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt
+++ b/libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt
@@ -4086,8 +4086,6 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Em@@GLIBCXX
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4
FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4
-FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29
-FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29
FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4
FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4
FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index a2c151d..5323c7f 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -2388,11 +2388,6 @@ GLIBCXX_3.4.29 {
_ZNKRSt7__cxx1118basic_stringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EE3strEv;
_ZNSt7__cxx1118basic_stringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EE3strEONS_12basic_stringI[cw]S2_S3_EE;
- # std::once_flag::_M_activate()
- _ZNSt9once_flag11_M_activateEv;
- # std::once_flag::_M_finish(bool)
- _ZNSt9once_flag9_M_finishEb;
-
# std::to_chars(char*, char*, [float|double|long double])
_ZSt8to_charsPcS_[def];
# std::to_chars(char*, char*, [float|double|long double], chars_format)
diff --git a/libstdc++-v3/config/os/bsd/darwin/ppc-extra.ver b/libstdc++-v3/config/os/bsd/darwin/ppc-extra.ver
index f0aee9e8..970f3bb 100644
--- a/libstdc++-v3/config/os/bsd/darwin/ppc-extra.ver
+++ b/libstdc++-v3/config/os/bsd/darwin/ppc-extra.ver
@@ -16,6 +16,9 @@
# 3.4.10
_ZNKSt3tr14hashIgEclEg;
_ZNKSt4hashIgEclEg;
+# LDBL_3.4.29
+ _ZSt10from_charsPKcS0_RgSt12chars_format;
+ _ZSt8to_charsPcS_g*;
# ldbl 1.3
_ZT[IS]g;
_ZT[IS]Pg;
diff --git a/libstdc++-v3/include/bits/max_size_type.h b/libstdc++-v3/include/bits/max_size_type.h
index 05984a3..27d6379 100644
--- a/libstdc++-v3/include/bits/max_size_type.h
+++ b/libstdc++-v3/include/bits/max_size_type.h
@@ -71,7 +71,8 @@ namespace ranges
__max_size_type(const __max_diff_type& __d) noexcept;
template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp>
- constexpr explicit operator _Tp() const noexcept
+ constexpr explicit
+ operator _Tp() const noexcept
{ return _M_val; }
constexpr explicit
@@ -91,6 +92,30 @@ namespace ranges
{ return operator~() + 1; }
constexpr __max_size_type&
+ operator++() noexcept
+ { return *this += 1; }
+
+ constexpr __max_size_type
+ operator++(int) noexcept
+ {
+ auto __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ constexpr __max_size_type&
+ operator--() noexcept
+ { return *this -= 1; }
+
+ constexpr __max_size_type
+ operator--(int) noexcept
+ {
+ auto __tmp = *this;
+ --*this;
+ return __tmp;
+ }
+
+ constexpr __max_size_type&
operator+=(const __max_size_type& __r) noexcept
{
const auto __sum = _M_val + __r._M_val;
@@ -355,6 +380,16 @@ namespace ranges
operator==(const __max_size_type& __l, const __max_size_type& __r) noexcept
{ return __l._M_val == __r._M_val && __l._M_msb == __r._M_msb; }
+#if __cpp_lib_three_way_comparison
+ friend constexpr strong_ordering
+ operator<=>(const __max_size_type& __l, const __max_size_type& __r) noexcept
+ {
+ if (__l._M_msb ^ __r._M_msb)
+ return __l._M_msb ? strong_ordering::greater : strong_ordering::less;
+ else
+ return __l._M_val <=> __r._M_val;
+ }
+#else
friend constexpr bool
operator!=(const __max_size_type& __l, const __max_size_type& __r) noexcept
{ return !(__l == __r); }
@@ -379,6 +414,7 @@ namespace ranges
friend constexpr bool
operator>=(const __max_size_type& __l, const __max_size_type& __r) noexcept
{ return __r <= __l; }
+#endif
#if __SIZEOF_INT128__
using __rep = unsigned __int128;
@@ -417,7 +453,8 @@ namespace ranges
{ }
template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp>
- constexpr explicit operator _Tp() const noexcept
+ constexpr explicit
+ operator _Tp() const noexcept
{ return static_cast<_Tp>(_M_rep); }
constexpr explicit
@@ -437,6 +474,30 @@ namespace ranges
{ return __max_diff_type(~_M_rep); }
constexpr __max_diff_type&
+ operator++() noexcept
+ { return *this += 1; }
+
+ constexpr __max_diff_type
+ operator++(int) noexcept
+ {
+ auto __tmp = *this;
+ ++*this;
+ return __tmp;
+ }
+
+ constexpr __max_diff_type&
+ operator--() noexcept
+ { return *this -= 1; }
+
+ constexpr __max_diff_type
+ operator--(int) noexcept
+ {
+ auto __tmp = *this;
+ --*this;
+ return __tmp;
+ }
+
+ constexpr __max_diff_type&
operator+=(const __max_diff_type& __r) noexcept
{
_M_rep += __r._M_rep;
@@ -647,6 +708,18 @@ namespace ranges
operator==(const __max_diff_type& __l, const __max_diff_type& __r) noexcept
{ return __l._M_rep == __r._M_rep; }
+#if __cpp_lib_three_way_comparison
+ constexpr strong_ordering
+ operator<=>(const __max_diff_type& __r) const noexcept
+ {
+ const auto __lsign = _M_rep._M_msb;
+ const auto __rsign = __r._M_rep._M_msb;
+ if (__lsign ^ __rsign)
+ return __lsign ? strong_ordering::less : strong_ordering::greater;
+ else
+ return _M_rep <=> __r._M_rep;
+ }
+#else
friend constexpr bool
operator!=(const __max_diff_type& __l, const __max_diff_type& __r) noexcept
{ return !(__l == __r); }
@@ -673,6 +746,7 @@ namespace ranges
friend constexpr bool
operator>=(const __max_diff_type& __l, const __max_diff_type& __r) noexcept
{ return !(__l < __r); }
+#endif
private:
__max_size_type _M_rep = 0;
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index f96c48e..b6a5952 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -669,6 +669,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
#endif // C++17
+#ifdef _GLIBCXX_HAS_GTHREADS
/// Flag type used by std::call_once
struct once_flag
{
@@ -680,125 +681,27 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
once_flag& operator=(const once_flag&) = delete;
private:
- // There are two different std::once_flag interfaces, abstracting four
- // different implementations.
- // The preferred interface uses the _M_activate() and _M_finish(bool)
- // member functions (introduced in GCC 11), which start and finish an
- // active execution respectively. See [thread.once.callonce] in C++11
- // for the definition of active/passive/returning/exceptional executions.
- // This interface is supported for Linux (using atomics and futexes) and
- // for single-threaded targets with no gthreads support.
- // For other targets a pthread_once_t is used with pthread_once, but that
- // doesn't work correctly for exceptional executions. That interface
- // uses an object of type _Prepare_execution and a lambda expression.
-#if defined _GLIBCXX_HAVE_LINUX_FUTEX || ! defined _GLIBCXX_HAS_GTHREADS
- enum _Bits : int { _Init = 0, _Active = 1, _Done = 2 };
-
- int _M_once = _Bits::_Init;
-
- // Non-blocking check to see if all executions will be passive now.
- bool
- _M_passive() const noexcept;
-
- // Attempts to begin an active execution. Blocks until it either:
- // - returns true if an active execution has started on this thread, or
- // - returns false if a returning execution happens on another thread.
- bool _M_activate();
-
- // Must be called to complete an active execution.
- // The argument is true if the active execution was a returning execution,
- // false if it was an exceptional execution.
- void _M_finish(bool __returning) noexcept;
-
- // RAII helper to call _M_finish.
- struct _Active_execution
- {
- explicit _Active_execution(once_flag& __flag) : _M_flag(__flag) { }
-
- ~_Active_execution() { _M_flag._M_finish(_M_returning); }
-
- _Active_execution(const _Active_execution&) = delete;
- _Active_execution& operator=(const _Active_execution&) = delete;
-
- once_flag& _M_flag;
- bool _M_returning = false;
- };
-#else
+ // For gthreads targets a pthread_once_t is used with pthread_once, but
+ // for most targets this doesn't work correctly for exceptional executions.
__gthread_once_t _M_once = __GTHREAD_ONCE_INIT;
struct _Prepare_execution;
-#endif // ! GTHREADS
template<typename _Callable, typename... _Args>
friend void
call_once(once_flag& __once, _Callable&& __f, _Args&&... __args);
};
-#if ! defined _GLIBCXX_HAS_GTHREADS
- // Inline definitions of std::once_flag members for single-threaded targets.
-
- inline bool
- once_flag::_M_passive() const noexcept
- { return _M_once == _Bits::_Done; }
-
- inline bool
- once_flag::_M_activate()
- {
- if (_M_once == _Bits::_Init) [[__likely__]]
- {
- _M_once = _Bits::_Active;
- return true;
- }
- else if (_M_passive()) // Caller should have checked this already.
- return false;
- else
- __throw_system_error(EDEADLK);
- }
-
- inline void
- once_flag::_M_finish(bool __returning) noexcept
- { _M_once = __returning ? _Bits::_Done : _Bits::_Init; }
-
-#elif defined _GLIBCXX_HAVE_LINUX_FUTEX
-
- // Define this inline to make passive executions fast.
- inline bool
- once_flag::_M_passive() const noexcept
- {
- if (__gnu_cxx::__is_single_threaded())
- return _M_once == _Bits::_Done;
- else
- return __atomic_load_n(&_M_once, __ATOMIC_ACQUIRE) == _Bits::_Done;
- }
-
-#else // GTHREADS && ! FUTEX
-
/// @cond undocumented
# ifdef _GLIBCXX_HAVE_TLS
// If TLS is available use thread-local state for the type-erased callable
// that is being run by std::call_once in the current thread.
extern __thread void* __once_callable;
extern __thread void (*__once_call)();
-# else
- // Without TLS use a global std::mutex and store the callable in a
- // global std::function.
- extern function<void()> __once_functor;
-
- extern void
- __set_once_functor_lock_ptr(unique_lock<mutex>*);
-
- extern mutex&
- __get_once_mutex();
-# endif
-
- // This function is passed to pthread_once by std::call_once.
- // It runs __once_call() or __once_functor().
- extern "C" void __once_proxy(void);
// RAII type to set up state for pthread_once call.
struct once_flag::_Prepare_execution
{
-#ifdef _GLIBCXX_HAVE_TLS
template<typename _Callable>
explicit
_Prepare_execution(_Callable& __c)
@@ -815,7 +718,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__once_callable = nullptr;
__once_call = nullptr;
}
-#else // ! TLS
+
+ _Prepare_execution(const _Prepare_execution&) = delete;
+ _Prepare_execution& operator=(const _Prepare_execution&) = delete;
+ };
+
+# else
+ // Without TLS use a global std::mutex and store the callable in a
+ // global std::function.
+ extern function<void()> __once_functor;
+
+ extern void
+ __set_once_functor_lock_ptr(unique_lock<mutex>*);
+
+ extern mutex&
+ __get_once_mutex();
+
+ // RAII type to set up state for pthread_once call.
+ struct once_flag::_Prepare_execution
+ {
template<typename _Callable>
explicit
_Prepare_execution(_Callable& __c)
@@ -832,21 +753,120 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
private:
+ // XXX This deadlocks if used recursively (PR 97949)
unique_lock<mutex> _M_functor_lock{__get_once_mutex()};
-#endif // ! TLS
_Prepare_execution(const _Prepare_execution&) = delete;
_Prepare_execution& operator=(const _Prepare_execution&) = delete;
};
+# endif
/// @endcond
-#endif
+
+ // This function is passed to pthread_once by std::call_once.
+ // It runs __once_call() or __once_functor().
+ extern "C" void __once_proxy(void);
/// Invoke a callable and synchronize with other calls using the same flag
template<typename _Callable, typename... _Args>
void
call_once(once_flag& __once, _Callable&& __f, _Args&&... __args)
{
-#if defined _GLIBCXX_HAVE_LINUX_FUTEX || ! defined _GLIBCXX_HAS_GTHREADS
+ // Closure type that runs the function
+ auto __callable = [&] {
+ std::__invoke(std::forward<_Callable>(__f),
+ std::forward<_Args>(__args)...);
+ };
+
+ once_flag::_Prepare_execution __exec(__callable);
+
+ // XXX pthread_once does not reset the flag if an exception is thrown.
+ if (int __e = __gthread_once(&__once._M_once, &__once_proxy))
+ __throw_system_error(__e);
+ }
+
+#else // _GLIBCXX_HAS_GTHREADS
+
+ /// Flag type used by std::call_once
+ struct once_flag
+ {
+ constexpr once_flag() noexcept = default;
+
+ /// Deleted copy constructor
+ once_flag(const once_flag&) = delete;
+ /// Deleted assignment operator
+ once_flag& operator=(const once_flag&) = delete;
+
+ private:
+ // There are two different std::once_flag interfaces, abstracting four
+ // different implementations.
+ // The single-threaded interface uses the _M_activate() and _M_finish(bool)
+ // functions, which start and finish an active execution respectively.
+ // See [thread.once.callonce] in C++11 for the definition of
+ // active/passive/returning/exceptional executions.
+ enum _Bits : int { _Init = 0, _Active = 1, _Done = 2 };
+
+ int _M_once = _Bits::_Init;
+
+ // Check to see if all executions will be passive now.
+ bool
+ _M_passive() const noexcept;
+
+ // Attempts to begin an active execution.
+ bool _M_activate();
+
+ // Must be called to complete an active execution.
+ // The argument is true if the active execution was a returning execution,
+ // false if it was an exceptional execution.
+ void _M_finish(bool __returning) noexcept;
+
+ // RAII helper to call _M_finish.
+ struct _Active_execution
+ {
+ explicit _Active_execution(once_flag& __flag) : _M_flag(__flag) { }
+
+ ~_Active_execution() { _M_flag._M_finish(_M_returning); }
+
+ _Active_execution(const _Active_execution&) = delete;
+ _Active_execution& operator=(const _Active_execution&) = delete;
+
+ once_flag& _M_flag;
+ bool _M_returning = false;
+ };
+
+ template<typename _Callable, typename... _Args>
+ friend void
+ call_once(once_flag& __once, _Callable&& __f, _Args&&... __args);
+ };
+
+ // Inline definitions of std::once_flag members for single-threaded targets.
+
+ inline bool
+ once_flag::_M_passive() const noexcept
+ { return _M_once == _Bits::_Done; }
+
+ inline bool
+ once_flag::_M_activate()
+ {
+ if (_M_once == _Bits::_Init) [[__likely__]]
+ {
+ _M_once = _Bits::_Active;
+ return true;
+ }
+ else if (_M_passive()) // Caller should have checked this already.
+ return false;
+ else
+ __throw_system_error(EDEADLK);
+ }
+
+ inline void
+ once_flag::_M_finish(bool __returning) noexcept
+ { _M_once = __returning ? _Bits::_Done : _Bits::_Init; }
+
+ /// Invoke a callable and synchronize with other calls using the same flag
+ template<typename _Callable, typename... _Args>
+ inline void
+ call_once(once_flag& __once, _Callable&& __f, _Args&&... __args)
+ {
if (__once._M_passive())
return;
else if (__once._M_activate())
@@ -861,20 +881,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// __f(__args...) did not throw
__exec._M_returning = true;
}
-#else
- // Closure type that runs the function
- auto __callable = [&] {
- std::__invoke(std::forward<_Callable>(__f),
- std::forward<_Args>(__args)...);
- };
-
- once_flag::_Prepare_execution __exec(__callable);
-
- // XXX pthread_once does not reset the flag if an exception is thrown.
- if (int __e = __gthread_once(&__once._M_once, &__once_proxy))
- __throw_system_error(__e);
-#endif
}
+#endif // _GLIBCXX_HAS_GTHREADS
// @} group mutexes
_GLIBCXX_END_NAMESPACE_VERSION
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index 78e788c..16f4cc6 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -214,12 +214,14 @@ compatibility-condvar.o: compatibility-condvar.cc
# set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion calls for it.
-AM_CXXFLAGS = \
+AM_CXXFLAGS_PRE = \
-std=gnu++98 \
$(glibcxx_compiler_pic_flag) \
$(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
+AM_CXXFLAGS = $(filter-out -fvtable-verify=std,$(AM_CXXFLAGS_PRE))
+
# Libtool notes
# 1) In general, libtool expects an argument such as `--tag=CXX' when
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index 684b7ae..4df5c82 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -578,12 +578,13 @@ libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) $(lt_host_flags)
# set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion calls for it.
-AM_CXXFLAGS = \
+AM_CXXFLAGS_PRE = \
-std=gnu++98 \
$(glibcxx_compiler_pic_flag) \
$(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
+AM_CXXFLAGS = $(filter-out -fvtable-verify=std,$(AM_CXXFLAGS_PRE))
# Libtool notes
diff --git a/libstdc++-v3/src/c++11/mutex.cc b/libstdc++-v3/src/c++11/mutex.cc
index 79db318..646fd17 100644
--- a/libstdc++-v3/src/c++11/mutex.cc
+++ b/libstdc++-v3/src/c++11/mutex.cc
@@ -26,65 +26,6 @@
#ifdef _GLIBCXX_HAS_GTHREADS
-#ifdef _GLIBCXX_HAVE_LINUX_FUTEX
-#include <syscall.h>
-#include <unistd.h>
-#include <limits.h>
-
-bool
-std::once_flag::_M_activate()
-{
- if (__gnu_cxx::__is_single_threaded())
- {
- if (_M_once == _Bits::_Done)
- return false;
- _M_once = _Bits::_Active;
- return true;
- }
-
- while (true)
- {
- int expected = _Bits::_Init;
- constexpr int active = _Bits::_Active;
- if (__atomic_compare_exchange_n(&_M_once, &expected, active, false,
- __ATOMIC_ACQ_REL,
- __ATOMIC_ACQUIRE))
- {
- // This thread is now doing an active execution.
- return true;
- }
-
- if (expected == _Bits::_Done)
- return false; // A returning execution happened, this is passive.
-
- // Otherwise, an active execution is happening. Wait for it to finish.
- constexpr int futex_wait = 128; // FUTEX_WAIT_PRIVATE
- syscall (SYS_futex, &_M_once, futex_wait, expected, 0);
- }
-}
-
-void
-std::once_flag::_M_finish(bool returning) noexcept
-{
- const int newval = returning ? _Bits::_Done : _Bits::_Init;
- if (__gnu_cxx::__is_single_threaded())
- {
- __glibcxx_assert(_M_once == _Bits::_Active);
- _M_once = newval;
- }
- else
- {
- int prev [[maybe_unused]]
- = __atomic_exchange_n(&_M_once, newval, __ATOMIC_RELEASE);
- __glibcxx_assert(prev & _Bits::_Active);
- // Wake any other threads waiting for this execution to finish.
- constexpr int futex_wake = 129; // FUTEX_WAKE_PRIVATE
- syscall (SYS_futex, &_M_once, futex_wake, INT_MAX);
- }
-}
-
-#endif // ! FUTEX
-
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc
index 4534d79..624e3ed 100644
--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -197,6 +197,11 @@
#undef v
#endif
+#ifdef __APPLE__
+// inttypes.h: extern intmax_t imaxabs(intmax_t j);
+#undef j
+#endif
+
#ifdef __hpux__
#undef d
#undef r
diff --git a/libstdc++-v3/testsuite/30_threads/call_once/66146.cc b/libstdc++-v3/testsuite/30_threads/call_once/66146.cc
deleted file mode 100644
index f552937..0000000
--- a/libstdc++-v3/testsuite/30_threads/call_once/66146.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (C) 2020-2021 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING3. If not see
-// <http://www.gnu.org/licenses/>.
-
-// { dg-do run { target c++11 } }
-// { dg-additional-options "-pthread" { target pthread } }
-
-// Currently std::call_once is broken for gthreads targets without futexes:
-// { dg-skip-if "see PR 66146" { gthreads && { ! futex } } }
-
-#include <mutex>
-#include <cstdlib>
-#include <testsuite_hooks.h>
-
-void
-test01()
-{
- std::once_flag once;
- int counter = 0;
- for (int i = 0; i < 10; ++i)
- {
- try
- {
- std::call_once(once, [&]{ if (i < 3) throw i; ++counter; });
- VERIFY(i >= 3);
- }
- catch (int ex)
- {
- VERIFY(i < 3);
- }
- }
- VERIFY(counter == 1);
- std::call_once(once, []{ std::abort(); });
-}
-
-int
-main()
-{
- test01();
-}
diff --git a/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc b/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc
index 9284d71..983bdfb 100644
--- a/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc
+++ b/libstdc++-v3/testsuite/std/ranges/iota/max_size_type.cc
@@ -145,6 +145,42 @@ test01()
auto h = [] (auto a) { a <<= a; return a; };
static_assert(h(max_size_t(3)) == 24);
static_assert(h(max_diff_t(3)) == 24);
+
+ auto w = [] (auto a) {
+ const auto b = a;
+ VERIFY( a++ == b && a == b+1 );
+ VERIFY( a-- == b+1 && a == b );
+
+ VERIFY( ++(++a) == b+2 );
+ VERIFY( --(--a) == b );
+ return true;
+ };
+ static_assert(w(max_size_t(10)));
+ static_assert(w(-max_diff_t(10)));
+
+#if __cpp_lib_three_way_comparison
+ static_assert(max_size_t{1} <=> max_size_t{9} == std::strong_ordering::less);
+ static_assert(max_size_t{3} <=> max_size_t{2} == std::strong_ordering::greater);
+ static_assert(max_size_t{5} <=> max_size_t{5} == std::strong_ordering::equal);
+ static_assert(~max_size_t{1} <=> ~max_size_t{9} == std::strong_ordering::greater);
+ static_assert(~max_size_t{3} <=> ~max_size_t{2} == std::strong_ordering::less);
+ static_assert(~max_size_t{5} <=> ~max_size_t{5} == std::strong_ordering::equal);
+ static_assert(~max_size_t{5} <=> max_size_t{9} == std::strong_ordering::greater);
+ static_assert(~max_size_t{9} <=> max_size_t{5} == std::strong_ordering::greater);
+ static_assert(max_size_t{5} <=> ~max_size_t{9} == std::strong_ordering::less);
+ static_assert(max_size_t{9} <=> ~max_size_t{5} == std::strong_ordering::less);
+
+ static_assert(max_diff_t{1} <=> max_diff_t{9} == std::strong_ordering::less);
+ static_assert(max_diff_t{3} <=> max_diff_t{2} == std::strong_ordering::greater);
+ static_assert(max_diff_t{5} <=> max_diff_t{5} == std::strong_ordering::equal);
+ static_assert(max_diff_t{-1} <=> max_diff_t{-9} == std::strong_ordering::greater);
+ static_assert(max_diff_t{-3} <=> max_diff_t{-2} == std::strong_ordering::less);
+ static_assert(max_diff_t{-5} <=> max_diff_t{-5} == std::strong_ordering::equal);
+ static_assert(max_diff_t{-5} <=> max_diff_t{9} == std::strong_ordering::less);
+ static_assert(max_diff_t{-9} <=> max_diff_t{5} == std::strong_ordering::less);
+ static_assert(max_diff_t{5} <=> max_diff_t{-9} == std::strong_ordering::greater);
+ static_assert(max_diff_t{9} <=> max_diff_t{-5} == std::strong_ordering::greater);
+#endif
}
template<bool signed_p, bool shorten_p>