aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--MAINTAINERS1
-rw-r--r--config/ChangeLog4
-rw-r--r--config/bootstrap-lto-locality.mk20
-rw-r--r--contrib/ChangeLog14
-rwxr-xr-xcontrib/gcc-changelog/git_update_version.py4
-rw-r--r--contrib/unicode/DerivedGeneralCategory.txt4323
-rw-r--r--contrib/unicode/README3
-rwxr-xr-xcontrib/unicode/gen_libstdcxx_unicode_data.py47
-rw-r--r--gcc/BASE-VER2
-rw-r--r--gcc/ChangeLog710
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/ada/ChangeLog10
-rw-r--r--gcc/ada/gnatvsn.ads2
-rw-r--r--gcc/ada/sem_ch8.adb3
-rw-r--r--gcc/avoid-store-forwarding.cc11
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.cc8
-rw-r--r--gcc/calls.cc62
-rw-r--r--gcc/cgraph.h1
-rw-r--r--gcc/cgraphclones.cc2
-rw-r--r--gcc/cobol/ChangeLog79
-rw-r--r--gcc/cobol/LICENSE29
-rw-r--r--gcc/cobol/Make-lang.in7
-rw-r--r--gcc/cobol/cbldiag.h8
-rw-r--r--gcc/cobol/cdf.y2
-rw-r--r--gcc/cobol/cobol1.cc10
-rw-r--r--gcc/cobol/except.cc4
-rw-r--r--gcc/cobol/gcobol.12
-rw-r--r--gcc/cobol/genapi.cc73
-rw-r--r--gcc/cobol/lang.opt10
-rw-r--r--gcc/cobol/lang.opt.urls6
-rw-r--r--gcc/cobol/lexio.cc6
-rw-r--r--gcc/cobol/parse.y148
-rw-r--r--gcc/cobol/scan.l6
-rw-r--r--gcc/cobol/scan_ante.h3
-rw-r--r--gcc/cobol/show_parse.h3
-rw-r--r--gcc/cobol/symbols.cc177
-rw-r--r--gcc/cobol/symfind.cc27
-rw-r--r--gcc/cobol/token_names.h2
-rw-r--r--gcc/cobol/util.cc47
-rw-r--r--gcc/combine.cc12
-rw-r--r--gcc/common.opt9
-rw-r--r--gcc/common.opt.urls11
-rw-r--r--gcc/common/config/s390/s390-common.cc4
-rw-r--r--gcc/config.gcc16
-rw-r--r--gcc/config.in7
-rw-r--r--gcc/config/aarch64/aarch64-sve.md6
-rw-r--r--gcc/config/aarch64/aarch64.cc4
-rw-r--r--gcc/config/alpha/alpha.cc23
-rw-r--r--gcc/config/c6x/c6x.h6
-rw-r--r--gcc/config/darwin.h1
-rw-r--r--gcc/config/gcn/gcn.md4
-rw-r--r--gcc/config/gcn/gcn.opt8
-rw-r--r--gcc/config/gcn/mkoffload.cc3
-rw-r--r--gcc/config/i386/i386-expand.cc44
-rw-r--r--gcc/config/i386/i386-options.cc4
-rw-r--r--gcc/config/i386/i386.cc82
-rw-r--r--gcc/config/i386/i386.h6
-rw-r--r--gcc/config/i386/x86-tune-costs.h123
-rw-r--r--gcc/config/i386/x86-tune-sched.cc15
-rw-r--r--gcc/config/nvptx/mkoffload.cc3
-rw-r--r--gcc/config/nvptx/nvptx.cc34
-rw-r--r--gcc/config/nvptx/nvptx.md4
-rw-r--r--gcc/config/nvptx/nvptx.opt8
-rw-r--r--gcc/config/riscv/bitmanip.md56
-rw-r--r--gcc/config/riscv/gnu.h59
-rwxr-xr-xgcc/config/riscv/multilib-generator4
-rw-r--r--gcc/config/riscv/riscv-target-attr.cc6
-rw-r--r--gcc/config/riscv/riscv-vsetvl.cc19
-rw-r--r--gcc/config/riscv/riscv.cc5
-rw-r--r--gcc/config/riscv/riscv.h2
-rw-r--r--gcc/config/riscv/riscv.md28
-rw-r--r--gcc/config/rx/rx.md20
-rw-r--r--gcc/config/s390/9175.md316
-rw-r--r--gcc/config/s390/driver-native.cc4
-rw-r--r--gcc/config/s390/s390-builtins.def8
-rw-r--r--gcc/config/s390/s390-c.cc4
-rw-r--r--gcc/config/s390/s390-opts.h2
-rw-r--r--gcc/config/s390/s390.cc37
-rw-r--r--gcc/config/s390/s390.h18
-rw-r--r--gcc/config/s390/s390.md61
-rw-r--r--gcc/config/s390/s390.opt5
-rw-r--r--gcc/config/sh/sh-modes.def6
-rwxr-xr-xgcc/configure47
-rw-r--r--gcc/configure.ac22
-rw-r--r--gcc/cp/ChangeLog180
-rw-r--r--gcc/cp/constexpr.cc130
-rw-r--r--gcc/cp/constraint.cc4
-rw-r--r--gcc/cp/contracts.cc6
-rw-r--r--gcc/cp/coroutines.cc21
-rw-r--r--gcc/cp/cp-gimplify.cc11
-rw-r--r--gcc/cp/cp-tree.h3
-rw-r--r--gcc/cp/decl.cc2
-rw-r--r--gcc/cp/error.cc59
-rw-r--r--gcc/cp/lambda.cc24
-rw-r--r--gcc/cp/lex.cc3
-rw-r--r--gcc/cp/mangle.cc6
-rw-r--r--gcc/cp/module.cc60
-rw-r--r--gcc/cp/name-lookup.cc2
-rw-r--r--gcc/cp/parser.cc5
-rw-r--r--gcc/cp/pt.cc16
-rw-r--r--gcc/cp/rtti.cc15
-rw-r--r--gcc/cp/semantics.cc26
-rw-r--r--gcc/d/ChangeLog75
-rw-r--r--gcc/d/d-compiler.cc37
-rw-r--r--gcc/d/d-lang.cc25
-rw-r--r--gcc/d/d-spec.cc50
-rw-r--r--gcc/d/decl.cc15
-rw-r--r--gcc/d/dmd/MERGE2
-rw-r--r--gcc/d/dmd/expressionsem.d6
-rw-r--r--gcc/d/dmd/globals.h1
-rw-r--r--gcc/d/dmd/lexer.d4
-rw-r--r--gcc/d/dmd/location.d23
-rw-r--r--gcc/d/dmd/typesem.d16
-rw-r--r--gcc/d/gdc.texi6
-rw-r--r--gcc/d/imports.cc6
-rw-r--r--gcc/d/lang.opt4
-rw-r--r--gcc/d/lang.opt.urls3
-rw-r--r--gcc/d/types.cc20
-rw-r--r--gcc/doc/cfg.texi10
-rw-r--r--gcc/doc/extend.texi121
-rw-r--r--gcc/doc/gm2.texi8
-rw-r--r--gcc/doc/install.texi6
-rw-r--r--gcc/doc/invoke.texi146
-rw-r--r--gcc/except.cc24
-rw-r--r--gcc/expmed.cc2
-rw-r--r--gcc/flag-types.h10
-rw-r--r--gcc/fold-const.cc6
-rw-r--r--gcc/fortran/ChangeLog91
-rw-r--r--gcc/fortran/f95-lang.cc6
-rw-r--r--gcc/fortran/interface.cc31
-rw-r--r--gcc/fortran/openmp.cc42
-rw-r--r--gcc/fortran/resolve.cc56
-rw-r--r--gcc/fortran/trans-decl.cc1
-rw-r--r--gcc/fortran/trans-openmp.cc1007
-rw-r--r--gcc/fortran/trans-stmt.cc2
-rw-r--r--gcc/fortran/trans.h4
-rw-r--r--gcc/gcc.cc80
-rw-r--r--gcc/gimple-expr.cc2
-rw-r--r--gcc/gimple-fold.cc56
-rw-r--r--gcc/gimple-lower-bitint.cc57
-rw-r--r--gcc/gimple-lower-bitint.h1
-rw-r--r--gcc/ginclude/stddef.h15
-rw-r--r--gcc/ipa-cp.cc172
-rw-r--r--gcc/ipa-locality-cloning.cc1137
-rw-r--r--gcc/ipa-locality-cloning.h35
-rw-r--r--gcc/ipa-prop.cc191
-rw-r--r--gcc/ipa-prop.h15
-rw-r--r--gcc/lto-cgraph.cc2
-rw-r--r--gcc/lto-streamer-out.cc2
-rw-r--r--gcc/lto-streamer.h1
-rw-r--r--gcc/lto/ChangeLog10
-rw-r--r--gcc/lto/lto-partition.cc126
-rw-r--r--gcc/lto/lto-partition.h1
-rw-r--r--gcc/lto/lto.cc4
-rw-r--r--gcc/m2/ChangeLog19
-rw-r--r--gcc/m2/gm2-compiler/M2MetaError.def3
-rw-r--r--gcc/m2/gm2-compiler/SymbolTable.def2
-rw-r--r--gcc/m2/gm2-gcc/m2expr.def2
-rw-r--r--gcc/m2/gm2-libiberty/pexecute.def16
-rw-r--r--gcc/m2/gm2-libs-coroutines/Executive.def6
-rw-r--r--gcc/m2/gm2-libs-iso/ClientSocket.def2
-rw-r--r--gcc/m2/gm2-libs-log/BlockOps.def2
-rw-r--r--gcc/m2/gm2-libs-log/InOut.def4
-rw-r--r--gcc/m2/mc/mcFileName.def2
-rw-r--r--gcc/opts.cc23
-rw-r--r--gcc/params.opt27
-rw-r--r--gcc/passes.def1
-rw-r--r--gcc/po/ChangeLog10
-rw-r--r--gcc/rust/ChangeLog159
-rw-r--r--gcc/rust/Make-lang.in1
-rw-r--r--gcc/rust/ast/rust-ast.h1
-rw-r--r--gcc/rust/ast/rust-expr.h12
-rw-r--r--gcc/rust/checks/errors/rust-const-checker.cc3
-rw-r--r--gcc/rust/expand/rust-macro-builtins-format-args.cc7
-rw-r--r--gcc/rust/expand/rust-macro-builtins.cc2
-rw-r--r--gcc/rust/expand/rust-macro-expand.cc21
-rw-r--r--gcc/rust/expand/rust-token-tree-desugar.cc72
-rw-r--r--gcc/rust/expand/rust-token-tree-desugar.h55
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-item.cc2
-rw-r--r--gcc/rust/resolve/rust-early-name-resolver-2.0.cc7
-rw-r--r--gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc12
-rw-r--r--gcc/rust/rust-gcc.cc254
-rw-r--r--gcc/rust/rust-session-manager.cc2
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-expr.cc129
-rw-r--r--gcc/rust/util/rust-attribute-values.h27
-rw-r--r--gcc/rust/util/rust-attributes.cc22
-rw-r--r--gcc/rust/util/rust-attributes.h7
-rw-r--r--gcc/rust/util/rust-lang-item.cc1
-rw-r--r--gcc/rust/util/rust-lang-item.h2
-rw-r--r--gcc/sanitizer.def2
-rw-r--r--gcc/testsuite/ChangeLog823
-rw-r--r--gcc/testsuite/c-c++-common/analyzer/realloc-1.c2
-rw-r--r--gcc/testsuite/c-c++-common/tsan/pr119801.c24
-rw-r--r--gcc/testsuite/cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob2
-rw-r--r--gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob2
-rw-r--r--gcc/testsuite/cobol.dg/group2/Dynamic_reference_modification.cob24
-rw-r--r--gcc/testsuite/cobol.dg/group2/Dynamic_reference_modification.out5
-rw-r--r--gcc/testsuite/cobol.dg/group2/FUNCTION_DATE___TIME_OMNIBUS.cob3
-rw-r--r--gcc/testsuite/cobol.dg/group2/Length_overflow__1_.cob16
-rw-r--r--gcc/testsuite/cobol.dg/group2/Length_overflow__1_.out1
-rw-r--r--gcc/testsuite/cobol.dg/group2/Length_overflow__2_.cob16
-rw-r--r--gcc/testsuite/cobol.dg/group2/Length_overflow__2_.out1
-rw-r--r--gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__1_.cob15
-rw-r--r--gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__1_.out1
-rw-r--r--gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__2_.cob16
-rw-r--r--gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__2_.out1
-rw-r--r--gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__3_.cob22
-rw-r--r--gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__3_.out1
-rw-r--r--gcc/testsuite/cobol.dg/group2/Offset_overflow.cob16
-rw-r--r--gcc/testsuite/cobol.dg/group2/Offset_overflow.out1
-rw-r--r--gcc/testsuite/cobol.dg/group2/Offset_underflow.cob16
-rw-r--r--gcc/testsuite/cobol.dg/group2/Offset_underflow.out1
-rw-r--r--gcc/testsuite/cobol.dg/group2/Refmod__comparisons_inside_numeric-display.cob20
-rw-r--r--gcc/testsuite/cobol.dg/group2/Refmod__comparisons_inside_numeric-display.out9
-rw-r--r--gcc/testsuite/cobol.dg/group2/Refmod_sources_are_figurative_constants.cob29
-rw-r--r--gcc/testsuite/cobol.dg/group2/Refmod_sources_are_figurative_constants.out9
-rw-r--r--gcc/testsuite/cobol.dg/group2/Static_reference_modification.cob19
-rw-r--r--gcc/testsuite/cobol.dg/group2/Static_reference_modification.out5
-rw-r--r--gcc/testsuite/g++.dg/abi/ref-temp1.C13
-rw-r--r--gcc/testsuite/g++.dg/concepts/diagnostic20.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ice21.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-diag2.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-new.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-prvalue1.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-prvalue1a.C33
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr63996.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp23/class-deduction-inherited8.C21
-rw-r--r--gcc/testsuite/g++.dg/cpp23/constexpr-nonlit18.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp26/pack-indexing2.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp26/static_assert1.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/concepts-lambda23.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dtor16.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dtor7.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic10.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new26.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C12
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constexpr-vector1.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/constinit14.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/lambda-targ14.C12
-rw-r--r--gcc/testsuite/g++.dg/ext/pragma-target2.C18
-rw-r--r--gcc/testsuite/g++.dg/ext/type_pack_element2.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/type_pack_element4.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/pr119614_0.C34
-rw-r--r--gcc/testsuite/g++.dg/modules/lambda-10_a.H17
-rw-r--r--gcc/testsuite/g++.dg/modules/lambda-10_b.C7
-rw-r--r--gcc/testsuite/g++.dg/modules/lambda-8_b.C2
-rw-r--r--gcc/testsuite/g++.dg/modules/leg-merge-4_c.C6
-rw-r--r--gcc/testsuite/g++.dg/modules/noexcept-4_a.H6
-rw-r--r--gcc/testsuite/g++.dg/modules/noexcept-4_b.C18
-rw-r--r--gcc/testsuite/g++.dg/opt/is_constant_evaluated4.C20
-rw-r--r--gcc/testsuite/g++.dg/opt/shrink-wrapping-vector-1.C17
-rw-r--r--gcc/testsuite/g++.dg/pr112822.C2
-rw-r--r--gcc/testsuite/g++.dg/template/explicit-args6.C8
-rw-r--r--gcc/testsuite/g++.dg/template/friend86.C25
-rw-r--r--gcc/testsuite/g++.dg/template/friend87.C42
-rw-r--r--gcc/testsuite/g++.dg/torture/pr119778.C20
-rw-r--r--gcc/testsuite/g++.dg/warn/Wformat-3.C19
-rw-r--r--gcc/testsuite/g++.target/aarch64/sve/pr119706.C178
-rw-r--r--gcc/testsuite/g++.target/gcn/exceptions-bad_cast-1.C15
-rw-r--r--gcc/testsuite/g++.target/gcn/exceptions-bad_cast-2.C13
-rw-r--r--gcc/testsuite/g++.target/gcn/exceptions-bad_cast-2_-mfake-exceptions.C18
-rw-r--r--gcc/testsuite/g++.target/gcn/exceptions-bad_cast-3.C10
-rw-r--r--gcc/testsuite/g++.target/gcn/exceptions-pr118794-1.C17
-rw-r--r--gcc/testsuite/g++.target/gcn/exceptions-pr118794-1_-mfake-exceptions.C16
-rw-r--r--gcc/testsuite/g++.target/gcn/exceptions-throw-1.C16
-rw-r--r--gcc/testsuite/g++.target/gcn/exceptions-throw-2.C14
-rw-r--r--gcc/testsuite/g++.target/gcn/exceptions-throw-2_-mfake-exceptions.C19
-rw-r--r--gcc/testsuite/g++.target/gcn/exceptions-throw-3.C11
-rw-r--r--gcc/testsuite/g++.target/gcn/gcn.exp56
-rw-r--r--gcc/testsuite/g++.target/gcn/pr119692-1-1.C6
-rw-r--r--gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-1.C15
-rw-r--r--gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-2.C13
-rw-r--r--gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-2_-mfake-exceptions.C19
-rw-r--r--gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-3.C10
-rw-r--r--gcc/testsuite/g++.target/nvptx/exceptions-pr118794-1.C17
-rw-r--r--gcc/testsuite/g++.target/nvptx/exceptions-pr118794-1_-mfake-exceptions.C16
-rw-r--r--gcc/testsuite/g++.target/nvptx/exceptions-throw-1.C16
-rw-r--r--gcc/testsuite/g++.target/nvptx/exceptions-throw-2.C14
-rw-r--r--gcc/testsuite/g++.target/nvptx/exceptions-throw-2_-mfake-exceptions.C19
-rw-r--r--gcc/testsuite/g++.target/nvptx/exceptions-throw-3.C11
-rw-r--r--gcc/testsuite/g++.target/nvptx/pr119692-1-1.C6
-rw-r--r--gcc/testsuite/g++.target/riscv/rvv/autovec/pr119547-2.C212
-rw-r--r--gcc/testsuite/g++.target/riscv/rvv/autovec/pr119547.C82
-rw-r--r--gcc/testsuite/g++.target/s390/pr119834.C76
-rw-r--r--gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/bf-ms-attrib.c2
-rw-r--r--gcc/testsuite/gcc.dg/bitint-121.c24
-rw-r--r--gcc/testsuite/gcc.dg/bitint-122.c20
-rw-r--r--gcc/testsuite/gcc.dg/completion-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-sra-19.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr119318.c37
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr119530.c21
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr119803.c16
-rw-r--r--gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr116357.c6
-rw-r--r--gcc/testsuite/gcc.dg/pr118947-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr119160.c26
-rw-r--r--gcc/testsuite/gcc.dg/pr119717.c24
-rw-r--r--gcc/testsuite/gcc.dg/pr78408-3.c14
-rw-r--r--gcc/testsuite/gcc.dg/rtl/i386/vector_eq-2.c71
-rw-r--r--gcc/testsuite/gcc.dg/rtl/i386/vector_eq-3.c74
-rw-r--r--gcc/testsuite/gcc.dg/torture/bitint-76.c19
-rw-r--r--gcc/testsuite/gcc.dg/torture/bitint-77.c26
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr118476-1.c14
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr118902-1.c21
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-52.c30
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-53.c26
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-54.c25
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr119399.c10
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr119757.c17
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-early-break_18.c2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/acle/rwsr-ungated.c13
-rw-r--r--gcc/testsuite/gcc.target/aarch64/bic-1.c40
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10.c24
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10_run.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5.c24
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5_run.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6.c24
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6_run.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7.c24
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7_run.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_8.c24
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_8_run.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9.c25
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9_run.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/pr119351.c39
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/pr119351_run.c20
-rw-r--r--gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-long.c76
-rw-r--r--gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-quad.c64
-rw-r--r--gcc/testsuite/gcc.target/arm/ivopts.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/lob1.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/lob6.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/unsigned-extend-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/apx-interrupt-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr119386-1.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/pr119386-2.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr119386-3.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/pr119784a.c96
-rw-r--r--gcc/testsuite/gcc.target/i386/pr119784b.c87
-rw-r--r--gcc/testsuite/gcc.target/i386/recip-vec-divf-fma.c12
-rw-r--r--gcc/testsuite/gcc.target/loongarch/vector/loongarch-vector.exp6
-rw-r--r--gcc/testsuite/gcc.target/riscv/bext-ext-2.c74
-rw-r--r--gcc/testsuite/gcc.target/riscv/gnu-property-align-rv32.c7
-rw-r--r--gcc/testsuite/gcc.target/riscv/gnu-property-align-rv64.c7
-rw-r--r--gcc/testsuite/gcc.target/riscv/jump-table-large-code-model.c24
-rw-r--r--gcc/testsuite/gcc.target/riscv/pr108016.c33
-rw-r--r--gcc/testsuite/gcc.target/riscv/pr118410-1.c9
-rw-r--r--gcc/testsuite/gcc.target/riscv/pr118410-2.c9
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-1.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-2.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-save-restore.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-zcmp.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-zcmp.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/bug-10-2.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/bug-10.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/bug-7.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/bug-8.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/bug-9.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr110943.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-21.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr114639-1.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr115068-run.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr115068.c4
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr117286.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr117544.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr117955.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/pr118872.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-1.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/vssubu-1.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/vssubu-2.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/base/vwaddsub-1.c4
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/vsetvl/avl_single-68.c8
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111234.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr115214.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-10.c4
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl-24.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-3.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-4.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr116591.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr116592.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr118357.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/vsext.c2
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/vzext.c2
-rw-r--r--gcc/testsuite/gcc.target/sh/pr111814.c7
-rw-r--r--gcc/testsuite/gdc.dg/debug/imports/m119817/a.d2
-rw-r--r--gcc/testsuite/gdc.dg/debug/imports/m119817/b.d2
-rw-r--r--gcc/testsuite/gdc.dg/debug/imports/m119817/package.d4
-rw-r--r--gcc/testsuite/gdc.dg/debug/imports/pr119826b.d14
-rw-r--r--gcc/testsuite/gdc.dg/debug/pr119817.d6
-rw-r--r--gcc/testsuite/gdc.dg/debug/pr119826.d8
-rw-r--r--gcc/testsuite/gdc.dg/driver_fonly1.d2
-rw-r--r--gcc/testsuite/gdc.dg/driver_fonly2.d8
-rw-r--r--gcc/testsuite/gdc.dg/driver_fonly3.d8
-rw-r--r--gcc/testsuite/gdc.dg/import-c/import-c.exp29
-rw-r--r--gcc/testsuite/gdc.dg/import-c/pr119761.d2
-rw-r--r--gcc/testsuite/gdc.dg/import-c/pr119761c.c4
-rw-r--r--gcc/testsuite/gdc.dg/import-c/pr119799.d2
-rw-r--r--gcc/testsuite/gdc.dg/import-c/pr119799c.c1
-rw-r--r--gcc/testsuite/gdc.dg/imports/fonly.d3
-rw-r--r--gcc/testsuite/gdc.dg/torture/imports/pr109023.d3
-rw-r--r--gcc/testsuite/gdc.dg/torture/pr109023.d6
-rw-r--r--gcc/testsuite/gdc.test/compilable/test21179.d11
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/fail_pretty_errors.d18
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/test21247.d20
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/test21247b.d14
-rw-r--r--gcc/testsuite/gfortran.dg/do_concurrent_all_clauses.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/map-alloc-comp-1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-1.f9030
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-3.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-4.f909
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-5.f909
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping.f9024
-rw-r--r--gcc/testsuite/gfortran.dg/interface_59.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/pr119502.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/pr119836_1.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/pr119836_2.f9021
-rw-r--r--gcc/testsuite/gfortran.dg/pr119836_3.f9030
-rw-r--r--gcc/testsuite/gfortran.dg/pr119836_4.f9030
-rw-r--r--gcc/testsuite/gfortran.dg/pure_formal_proc_4.f9049
-rw-r--r--gcc/testsuite/gm2.dg/doc/examples/pass/doc-examples-pass.exp18
-rw-r--r--gcc/testsuite/gm2.dg/doc/examples/pass/exampleadd.mod32
-rw-r--r--gcc/testsuite/gm2.dg/doc/examples/pass/exampleadd2.mod32
-rw-r--r--gcc/testsuite/gm2.dg/doc/examples/pass/hello.mod10
-rw-r--r--gcc/testsuite/gm2.dg/doc/examples/pass/hellopim.mod10
-rw-r--r--gcc/testsuite/gnat.dg/lto29.adb9
-rw-r--r--gcc/testsuite/gnat.dg/lto29_pkg.ads15
-rw-r--r--gcc/testsuite/gnat.dg/opt105.adb30
-rw-r--r--gcc/testsuite/gnat.dg/opt105_pkg.adb6
-rw-r--r--gcc/testsuite/gnat.dg/opt105_pkg.ads11
-rw-r--r--gcc/testsuite/gnat.dg/renaming17.adb17
-rw-r--r--gcc/testsuite/go.dg/pr119533-riscv-2.go42
-rw-r--r--gcc/testsuite/go.dg/pr119533-riscv.go120
-rw-r--r--gcc/testsuite/lib/cobol.exp9
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp3
-rw-r--r--gcc/testsuite/lib/target-supports.exp22
-rw-r--r--gcc/testsuite/rust/compile/enum_discriminant2.rs9
-rw-r--r--gcc/testsuite/rust/compile/format_args_extra_comma.rs47
-rw-r--r--gcc/testsuite/rust/compile/macros/mbe/macro-issue3693.rs10
-rw-r--r--gcc/testsuite/rust/compile/macros/mbe/macro-issue3708.rs80
-rw-r--r--gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-1.rs10
-rw-r--r--gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-2.rs81
-rw-r--r--gcc/testsuite/rust/compile/nr2/compile.exp11
-rw-r--r--gcc/testsuite/rust/compile/track_caller.rs6
-rw-r--r--gcc/testsuite/rust/execute/torture/min_specialization2.rs31
-rw-r--r--gcc/testsuite/rust/execute/torture/min_specialization3.rs36
-rw-r--r--gcc/timevar.def1
-rw-r--r--gcc/tree-data-ref.cc7
-rw-r--r--gcc/tree-inline.cc7
-rw-r--r--gcc/tree-pass.h1
-rw-r--r--gcc/tree-pretty-print.cc2
-rw-r--r--gcc/tree-ssa-coalesce.cc22
-rw-r--r--gcc/tree-ssa-dse.cc16
-rw-r--r--gcc/tree-ssa-phiopt.cc9
-rw-r--r--gcc/tree-tailcall.cc157
-rw-r--r--gcc/tree-vect-loop.cc99
-rw-r--r--gcc/tree-vect-slp.cc24
-rw-r--r--gcc/tree-vect-stmts.cc64
-rw-r--r--gcc/tree-vectorizer.h18
-rw-r--r--gcc/tree.def6
-rw-r--r--libatomic/ChangeLog20
-rw-r--r--libatomic/config/mingw/lock.c50
-rw-r--r--libatomic/config/posix/lock.c39
-rw-r--r--libbacktrace/ChangeLog12
-rw-r--r--libbacktrace/fileline.c36
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libgcc/ChangeLog80
-rw-r--r--libgcc/config/gcn/unwind-gcn.c6
-rw-r--r--libgcc/config/i386/gthr-win32.h81
-rw-r--r--libgcc/config/nvptx/unwind-nvptx.c6
-rw-r--r--libgcc/config/sh/sfp-machine.h80
-rw-r--r--libgcobol/ChangeLog78
-rw-r--r--libgcobol/Makefile.am9
-rw-r--r--libgcobol/Makefile.in14
-rw-r--r--libgcobol/acinclude.m4162
-rw-r--r--libgcobol/config.h.in30
-rwxr-xr-xlibgcobol/configure535
-rw-r--r--libgcobol/configure.ac41
-rw-r--r--libgcobol/configure.tgt7
-rw-r--r--libgcobol/gfileio.cc32
-rw-r--r--libgcobol/gmath.cc108
-rw-r--r--libgcobol/intrinsic.cc182
-rw-r--r--libgcobol/libgcobol-fp.h59
-rw-r--r--libgcobol/libgcobol.cc225
-rw-r--r--libgcobol/libgcobol.h10
-rw-r--r--libgcobol/libgcobol.spec.in2
-rw-r--r--libgcobol/valconv.cc6
-rw-r--r--libgfortran/ChangeLog24
-rw-r--r--libgfortran/io/close.c13
-rw-r--r--libgfortran/io/open.c10
-rw-r--r--libgomp/ChangeLog166
-rw-r--r--libgomp/libgomp.texi12
-rw-r--r--libgomp/omp.h.in132
-rw-r--r--libgomp/testsuite/libgomp.c++/allocator-1.C171
-rw-r--r--libgomp/testsuite/libgomp.c++/allocator-2.C141
-rw-r--r--libgomp/testsuite/libgomp.c++/pr106445-1-O0.C3
-rw-r--r--libgomp/testsuite/libgomp.c++/pr106445-1.C18
-rw-r--r--libgomp/testsuite/libgomp.c++/pr119692-1-1.C10
-rw-r--r--libgomp/testsuite/libgomp.c++/pr119692-1-2.C11
-rw-r--r--libgomp/testsuite/libgomp.c++/pr119692-1-3.C10
-rw-r--r--libgomp/testsuite/libgomp.c++/pr119692-1-4.C10
-rw-r--r--libgomp/testsuite/libgomp.c++/pr119692-1-5.C10
-rw-r--r--libgomp/testsuite/libgomp.c++/pr96390.C2
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-1.C25
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-GCN.C19
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-nvptx.C19
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2.C24
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-3.C17
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-GCN.C24
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-nvptx.C24
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1.C57
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-throw-1-O0.C23
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-throw-1.C25
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-O0.C25
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-GCN.C21
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-nvptx.C21
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-throw-2.C23
-rw-r--r--libgomp/testsuite/libgomp.c++/target-exceptions-throw-3.C19
-rw-r--r--libgomp/testsuite/libgomp.c-c++-common/pr96390.c2
-rw-r--r--libgomp/testsuite/libgomp.c-target/aarch64/firstprivate.c2
-rw-r--r--libgomp/testsuite/libgomp.c-target/aarch64/lastprivate.c2
-rw-r--r--libgomp/testsuite/libgomp.c-target/aarch64/private.c2
-rw-r--r--libgomp/testsuite/libgomp.c-target/aarch64/shared.c2
-rw-r--r--libgomp/testsuite/libgomp.c-target/aarch64/simd-aligned.c2
-rw-r--r--libgomp/testsuite/libgomp.c-target/aarch64/simd-nontemporal.c2
-rw-r--r--libgomp/testsuite/libgomp.c-target/aarch64/threadprivate.c2
-rw-r--r--libgomp/testsuite/libgomp.c-target/aarch64/udr-sve.c4
-rw-r--r--libgomp/testsuite/libgomp.fortran/allocatable-comp.f9053
-rw-r--r--libgomp/testsuite/libgomp.fortran/map-alloc-comp-3.f90121
-rw-r--r--libgomp/testsuite/libgomp.fortran/map-alloc-comp-4.f90124
-rw-r--r--libgomp/testsuite/libgomp.fortran/map-alloc-comp-5.f9053
-rw-r--r--libgomp/testsuite/libgomp.fortran/map-alloc-comp-6.f90308
-rw-r--r--libgomp/testsuite/libgomp.fortran/map-alloc-comp-7.f90672
-rw-r--r--libgomp/testsuite/libgomp.fortran/map-alloc-comp-8.f90268
-rw-r--r--libgomp/testsuite/libgomp.fortran/map-alloc-comp-9.f90559
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-1.C54
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-GCN.C18
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-nvptx.C20
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2.C60
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-3.C49
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-1.C46
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-GCN.C20
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-nvptx.C22
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2.C55
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-3.C43
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/pr119692-1-1.C42
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/pr119692-1-2.C12
-rw-r--r--libgomp/testsuite/libgomp.oacc-c++/pr119692-1-3.C12
-rw-r--r--libphobos/ChangeLog24
-rw-r--r--libphobos/Makefile.in1
-rwxr-xr-xlibphobos/configure53
-rw-r--r--libphobos/configure.ac1
-rw-r--r--libphobos/libdruntime/MERGE2
-rw-r--r--libphobos/libdruntime/Makefile.am5
-rw-r--r--libphobos/libdruntime/Makefile.in6
-rw-r--r--libphobos/libdruntime/__importc_builtins.di (renamed from libphobos/libdruntime/__builtins.di)10
-rw-r--r--libphobos/m4/druntime/os.m427
-rw-r--r--libphobos/src/MERGE2
-rw-r--r--libphobos/src/Makefile.am3
-rw-r--r--libphobos/src/Makefile.in4
-rw-r--r--libphobos/src/std/format/write.d11
-rw-r--r--libphobos/src/std/random.d66
-rw-r--r--libphobos/testsuite/Makefile.in1
-rwxr-xr-xlibphobos/testsuite/testsuite_flags.in2
-rw-r--r--libquadmath/ChangeLog4
-rw-r--r--libstdc++-v3/ChangeLog371
-rw-r--r--libstdc++-v3/config/os/hpux/os_defines.h7
-rw-r--r--libstdc++-v3/doc/html/manual/using_concurrency.html10
-rw-r--r--libstdc++-v3/doc/xml/manual/appendix_contributing.xml2
-rw-r--r--libstdc++-v3/doc/xml/manual/using.xml12
-rw-r--r--libstdc++-v3/include/bits/basic_string.h225
-rw-r--r--libstdc++-v3/include/bits/basic_string.tcc3
-rw-r--r--libstdc++-v3/include/bits/chrono_io.h16
-rw-r--r--libstdc++-v3/include/bits/cow_string.h124
-rw-r--r--libstdc++-v3/include/bits/deque.tcc4
-rw-r--r--libstdc++-v3/include/bits/forward_list.h20
-rw-r--r--libstdc++-v3/include/bits/ranges_base.h4
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h8
-rw-r--r--libstdc++-v3/include/bits/stl_deque.h12
-rw-r--r--libstdc++-v3/include/bits/stl_list.h12
-rw-r--r--libstdc++-v3/include/bits/stl_map.h8
-rw-r--r--libstdc++-v3/include/bits/stl_multimap.h8
-rw-r--r--libstdc++-v3/include/bits/stl_multiset.h8
-rw-r--r--libstdc++-v3/include/bits/stl_queue.h14
-rw-r--r--libstdc++-v3/include/bits/stl_set.h8
-rw-r--r--libstdc++-v3/include/bits/stl_stack.h8
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h16
-rw-r--r--libstdc++-v3/include/bits/unicode-data.h260
-rw-r--r--libstdc++-v3/include/bits/unicode.h17
-rw-r--r--libstdc++-v3/include/bits/unordered_map.h14
-rw-r--r--libstdc++-v3/include/bits/unordered_set.h14
-rw-r--r--libstdc++-v3/include/bits/vector.tcc4
-rw-r--r--libstdc++-v3/include/bits/version.def23
-rw-r--r--libstdc++-v3/include/bits/version.h17
-rw-r--r--libstdc++-v3/include/debug/deque8
-rw-r--r--libstdc++-v3/include/debug/forward_list10
-rw-r--r--libstdc++-v3/include/debug/list10
-rw-r--r--libstdc++-v3/include/debug/map.h4
-rw-r--r--libstdc++-v3/include/debug/multimap.h4
-rw-r--r--libstdc++-v3/include/debug/multiset.h4
-rw-r--r--libstdc++-v3/include/debug/set.h4
-rw-r--r--libstdc++-v3/include/debug/unordered_map8
-rw-r--r--libstdc++-v3/include/debug/unordered_set8
-rw-r--r--libstdc++-v3/include/debug/vector6
-rw-r--r--libstdc++-v3/include/std/deque1
-rw-r--r--libstdc++-v3/include/std/format1255
-rw-r--r--libstdc++-v3/include/std/forward_list1
-rw-r--r--libstdc++-v3/include/std/list1
-rw-r--r--libstdc++-v3/include/std/map1
-rw-r--r--libstdc++-v3/include/std/numeric8
-rw-r--r--libstdc++-v3/include/std/queue1
-rw-r--r--libstdc++-v3/include/std/ranges1
-rw-r--r--libstdc++-v3/include/std/set1
-rw-r--r--libstdc++-v3/include/std/stack1
-rw-r--r--libstdc++-v3/include/std/string1
-rw-r--r--libstdc++-v3/include/std/unordered_map1
-rw-r--r--libstdc++-v3/include/std/unordered_set1
-rw-r--r--libstdc++-v3/include/std/vector1
-rw-r--r--libstdc++-v3/src/c++11/string-inst.cc3
-rw-r--r--libstdc++-v3/src/c++17/fast_float/LOCAL_PATCHES1
-rw-r--r--libstdc++-v3/src/c++17/fast_float/fast_float.h3
-rw-r--r--libstdc++-v3/src/c++23/std.cc.in6
-rw-r--r--libstdc++-v3/testsuite/17_intro/names.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/expected/equality_constrained.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/tuple/element_access/get_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/cons/char/119748.cc35
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/cons/from_range.cc129
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/119748.cc7
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/append_range.cc125
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/assign_range.cc116
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/insert_range.cc130
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/replace_with_range.cc133
-rw-r--r--libstdc++-v3/testsuite/23_containers/deque/cons/from_range.cc5
-rw-r--r--libstdc++-v3/testsuite/23_containers/forward_list/cons/from_range.cc6
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/cons/from_range.cc5
-rw-r--r--libstdc++-v3/testsuite/23_containers/map/cons/from_range.cc7
-rw-r--r--libstdc++-v3/testsuite/23_containers/multimap/cons/from_range.cc7
-rw-r--r--libstdc++-v3/testsuite/23_containers/multiset/cons/from_range.cc7
-rw-r--r--libstdc++-v3/testsuite/23_containers/priority_queue/cons_from_range.cc7
-rw-r--r--libstdc++-v3/testsuite/23_containers/queue/cons_from_range.cc7
-rw-r--r--libstdc++-v3/testsuite/23_containers/set/cons/from_range.cc7
-rw-r--r--libstdc++-v3/testsuite/23_containers/stack/cons_from_range.cc7
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/cons/from_range.cc7
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_arrow_operator_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_const_conversion_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_copy_assignment_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_copy_construction_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_move_assignment_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_move_construction_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/debug/max_load_factor_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/from_range.cc7
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cend_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/end1_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/end2_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_arrow_operator_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_const_conversion_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_copy_assignment_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_copy_construction_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_move_assignment_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_move_construction_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/max_load_factor_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/from_range.cc7
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_arrow_operator_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_const_conversion_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_copy_assignment_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_copy_construction_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_move_assignment_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_move_construction_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/cons/from_range.cc7
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_arrow_operator_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_const_conversion_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_copy_assignment_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_copy_construction_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_move_assignment_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_move_construction_neg.cc17
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/bool/cons/from_range.cc6
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/bool/format.cc9
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/cons/from_range.cc5
-rw-r--r--libstdc++-v3/testsuite/std/format/debug.cc455
-rw-r--r--libstdc++-v3/testsuite/std/format/debug_nonunicode.cc5
-rw-r--r--libstdc++-v3/testsuite/std/format/formatter/lwg3944.cc4
-rw-r--r--libstdc++-v3/testsuite/std/format/formatter/requirements.cc14
-rw-r--r--libstdc++-v3/testsuite/std/format/parse_ctx.cc2
-rw-r--r--libstdc++-v3/testsuite/std/format/ranges/format_kind.cc94
-rw-r--r--libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc13
-rw-r--r--libstdc++-v3/testsuite/std/format/ranges/formatter.cc171
-rw-r--r--libstdc++-v3/testsuite/std/format/ranges/map.cc209
-rw-r--r--libstdc++-v3/testsuite/std/format/ranges/sequence.cc206
-rw-r--r--libstdc++-v3/testsuite/std/format/ranges/string.cc226
-rw-r--r--libstdc++-v3/testsuite/std/format/string.cc2
-rw-r--r--libstdc++-v3/testsuite/std/format/tuple.cc259
-rw-r--r--libstdc++-v3/testsuite/util/debug/unordered_checks.h152
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_iterators.h7
-rw-r--r--maintainer-scripts/ChangeLog5
-rw-r--r--maintainer-scripts/crontab9
706 files changed, 26834 insertions, 2631 deletions
diff --git a/ChangeLog b/ChangeLog
index 16b716c..f7efaad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2025-04-16 Waffl3x <waffl3x@baylibre.com>
+
+ * MAINTAINERS: Add myself.
+
2025-04-02 Iain Sandoe <iain@sandoe.co.uk>
* configure: Regenerate.
diff --git a/MAINTAINERS b/MAINTAINERS
index 756227e..6ff4770 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -862,6 +862,7 @@ Ville Voutilainen ville <ville.voutilainen@gmail.com>
Tom de Vries vries <tdevries@suse.de>
Nenad Vukicevic nenadv <nenad@intrepid.com>
Dmitry Vyukov dvyukov <dvyukov@google.com>
+Waffl3x waffl3x <waffl3x@baylibre.com>
Jonathan Wakely redi <jwakely@redhat.com>
Krister Walfridsson kristerw <krister.walfridsson@gmail.com>
Feng Wang - <wangfeng@eswincomputing.com>
diff --git a/config/ChangeLog b/config/ChangeLog
index 9268a8e..2551f82 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2025-04-15 Kyrylo Tkachov <ktkachov@nvidia.com>
+
+ * bootstrap-lto-locality.mk: New file.
+
2024-11-25 Sandra Loosemore <sloosemore@baylibre.com>
* mt-nios2-elf: Deleted.
diff --git a/config/bootstrap-lto-locality.mk b/config/bootstrap-lto-locality.mk
new file mode 100644
index 0000000..b31565c
--- /dev/null
+++ b/config/bootstrap-lto-locality.mk
@@ -0,0 +1,20 @@
+# This option enables LTO and locality partitioning for stage2 and stage3 in slim mode
+
+STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 -fipa-reorder-for-locality
+STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1 -fipa-reorder-for-locality
+STAGEprofile_CFLAGS += -flto=jobserver -frandom-seed=1 -fipa-reorder-for-locality
+STAGEtrain_CFLAGS += -flto=jobserver -frandom-seed=1 -fipa-reorder-for-locality
+STAGEfeedback_CFLAGS += -flto=jobserver -frandom-seed=1 -fipa-reorder-for-locality
+
+# assumes the host supports the linker plugin
+LTO_AR = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ar$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
+LTO_RANLIB = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ranlib$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
+LTO_NM = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-nm$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
+
+LTO_EXPORTS = AR="$(LTO_AR)"; export AR; \
+ RANLIB="$(LTO_RANLIB)"; export RANLIB; \
+ NM="$(LTO_NM)"; export NM;
+LTO_FLAGS_TO_PASS = AR="$(LTO_AR)" RANLIB="$(LTO_RANLIB)" NM="$(LTO_NM)"
+
+do-compare = $(SHELL) $(srcdir)/contrib/compare-lto $$f1 $$f2
+extra-compare = gcc/lto1$(exeext)
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index c78c0b7..e7a4cab 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,17 @@
+2025-04-17 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc-changelog/git_update_version.py (active_refs): Add
+ releases/gcc-15.
+
+2025-04-11 Tomasz Kamiński <tkaminsk@redhat.com>
+
+ PR libstdc++/109162
+ * unicode/README: Mentioned DerivedGeneralCategory.txt.
+ * unicode/gen_libstdcxx_unicode_data.py: Generation __escape_edges
+ table from DerivedGeneralCategory.txt. Update file name in comments.
+ * unicode/DerivedGeneralCategory.txt: Copy of file distributed by
+ Unicode Consortium.
+
2025-03-27 David Malcolm <dmalcolm@redhat.com>
PR testsuite/116163
diff --git a/contrib/gcc-changelog/git_update_version.py b/contrib/gcc-changelog/git_update_version.py
index 8e36c74..aa9adee 100755
--- a/contrib/gcc-changelog/git_update_version.py
+++ b/contrib/gcc-changelog/git_update_version.py
@@ -85,8 +85,8 @@ def prepend_to_changelog_files(repo, folder, git_commit, add_to_git):
repo.git.add(full_path)
-active_refs = ['master',
- 'releases/gcc-12', 'releases/gcc-13', 'releases/gcc-14']
+active_refs = ['master', 'releases/gcc-12',
+ 'releases/gcc-13', 'releases/gcc-14', 'releases/gcc-15']
parser = argparse.ArgumentParser(description='Update DATESTAMP and generate '
'ChangeLog entries')
diff --git a/contrib/unicode/DerivedGeneralCategory.txt b/contrib/unicode/DerivedGeneralCategory.txt
new file mode 100644
index 0000000..07bf7bc
--- /dev/null
+++ b/contrib/unicode/DerivedGeneralCategory.txt
@@ -0,0 +1,4323 @@
+# DerivedGeneralCategory-16.0.0.txt
+# Date: 2024-04-30, 21:48:17 GMT
+# © 2024 Unicode®, Inc.
+# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries.
+# For terms of use and license, see https://www.unicode.org/terms_of_use.html
+#
+# Unicode Character Database
+# For documentation, see https://www.unicode.org/reports/tr44/
+
+# ================================================
+
+# Property: General_Category
+
+# ================================================
+
+# General_Category=Unassigned
+
+0378..0379 ; Cn # [2] <reserved-0378>..<reserved-0379>
+0380..0383 ; Cn # [4] <reserved-0380>..<reserved-0383>
+038B ; Cn # <reserved-038B>
+038D ; Cn # <reserved-038D>
+03A2 ; Cn # <reserved-03A2>
+0530 ; Cn # <reserved-0530>
+0557..0558 ; Cn # [2] <reserved-0557>..<reserved-0558>
+058B..058C ; Cn # [2] <reserved-058B>..<reserved-058C>
+0590 ; Cn # <reserved-0590>
+05C8..05CF ; Cn # [8] <reserved-05C8>..<reserved-05CF>
+05EB..05EE ; Cn # [4] <reserved-05EB>..<reserved-05EE>
+05F5..05FF ; Cn # [11] <reserved-05F5>..<reserved-05FF>
+070E ; Cn # <reserved-070E>
+074B..074C ; Cn # [2] <reserved-074B>..<reserved-074C>
+07B2..07BF ; Cn # [14] <reserved-07B2>..<reserved-07BF>
+07FB..07FC ; Cn # [2] <reserved-07FB>..<reserved-07FC>
+082E..082F ; Cn # [2] <reserved-082E>..<reserved-082F>
+083F ; Cn # <reserved-083F>
+085C..085D ; Cn # [2] <reserved-085C>..<reserved-085D>
+085F ; Cn # <reserved-085F>
+086B..086F ; Cn # [5] <reserved-086B>..<reserved-086F>
+088F ; Cn # <reserved-088F>
+0892..0896 ; Cn # [5] <reserved-0892>..<reserved-0896>
+0984 ; Cn # <reserved-0984>
+098D..098E ; Cn # [2] <reserved-098D>..<reserved-098E>
+0991..0992 ; Cn # [2] <reserved-0991>..<reserved-0992>
+09A9 ; Cn # <reserved-09A9>
+09B1 ; Cn # <reserved-09B1>
+09B3..09B5 ; Cn # [3] <reserved-09B3>..<reserved-09B5>
+09BA..09BB ; Cn # [2] <reserved-09BA>..<reserved-09BB>
+09C5..09C6 ; Cn # [2] <reserved-09C5>..<reserved-09C6>
+09C9..09CA ; Cn # [2] <reserved-09C9>..<reserved-09CA>
+09CF..09D6 ; Cn # [8] <reserved-09CF>..<reserved-09D6>
+09D8..09DB ; Cn # [4] <reserved-09D8>..<reserved-09DB>
+09DE ; Cn # <reserved-09DE>
+09E4..09E5 ; Cn # [2] <reserved-09E4>..<reserved-09E5>
+09FF..0A00 ; Cn # [2] <reserved-09FF>..<reserved-0A00>
+0A04 ; Cn # <reserved-0A04>
+0A0B..0A0E ; Cn # [4] <reserved-0A0B>..<reserved-0A0E>
+0A11..0A12 ; Cn # [2] <reserved-0A11>..<reserved-0A12>
+0A29 ; Cn # <reserved-0A29>
+0A31 ; Cn # <reserved-0A31>
+0A34 ; Cn # <reserved-0A34>
+0A37 ; Cn # <reserved-0A37>
+0A3A..0A3B ; Cn # [2] <reserved-0A3A>..<reserved-0A3B>
+0A3D ; Cn # <reserved-0A3D>
+0A43..0A46 ; Cn # [4] <reserved-0A43>..<reserved-0A46>
+0A49..0A4A ; Cn # [2] <reserved-0A49>..<reserved-0A4A>
+0A4E..0A50 ; Cn # [3] <reserved-0A4E>..<reserved-0A50>
+0A52..0A58 ; Cn # [7] <reserved-0A52>..<reserved-0A58>
+0A5D ; Cn # <reserved-0A5D>
+0A5F..0A65 ; Cn # [7] <reserved-0A5F>..<reserved-0A65>
+0A77..0A80 ; Cn # [10] <reserved-0A77>..<reserved-0A80>
+0A84 ; Cn # <reserved-0A84>
+0A8E ; Cn # <reserved-0A8E>
+0A92 ; Cn # <reserved-0A92>
+0AA9 ; Cn # <reserved-0AA9>
+0AB1 ; Cn # <reserved-0AB1>
+0AB4 ; Cn # <reserved-0AB4>
+0ABA..0ABB ; Cn # [2] <reserved-0ABA>..<reserved-0ABB>
+0AC6 ; Cn # <reserved-0AC6>
+0ACA ; Cn # <reserved-0ACA>
+0ACE..0ACF ; Cn # [2] <reserved-0ACE>..<reserved-0ACF>
+0AD1..0ADF ; Cn # [15] <reserved-0AD1>..<reserved-0ADF>
+0AE4..0AE5 ; Cn # [2] <reserved-0AE4>..<reserved-0AE5>
+0AF2..0AF8 ; Cn # [7] <reserved-0AF2>..<reserved-0AF8>
+0B00 ; Cn # <reserved-0B00>
+0B04 ; Cn # <reserved-0B04>
+0B0D..0B0E ; Cn # [2] <reserved-0B0D>..<reserved-0B0E>
+0B11..0B12 ; Cn # [2] <reserved-0B11>..<reserved-0B12>
+0B29 ; Cn # <reserved-0B29>
+0B31 ; Cn # <reserved-0B31>
+0B34 ; Cn # <reserved-0B34>
+0B3A..0B3B ; Cn # [2] <reserved-0B3A>..<reserved-0B3B>
+0B45..0B46 ; Cn # [2] <reserved-0B45>..<reserved-0B46>
+0B49..0B4A ; Cn # [2] <reserved-0B49>..<reserved-0B4A>
+0B4E..0B54 ; Cn # [7] <reserved-0B4E>..<reserved-0B54>
+0B58..0B5B ; Cn # [4] <reserved-0B58>..<reserved-0B5B>
+0B5E ; Cn # <reserved-0B5E>
+0B64..0B65 ; Cn # [2] <reserved-0B64>..<reserved-0B65>
+0B78..0B81 ; Cn # [10] <reserved-0B78>..<reserved-0B81>
+0B84 ; Cn # <reserved-0B84>
+0B8B..0B8D ; Cn # [3] <reserved-0B8B>..<reserved-0B8D>
+0B91 ; Cn # <reserved-0B91>
+0B96..0B98 ; Cn # [3] <reserved-0B96>..<reserved-0B98>
+0B9B ; Cn # <reserved-0B9B>
+0B9D ; Cn # <reserved-0B9D>
+0BA0..0BA2 ; Cn # [3] <reserved-0BA0>..<reserved-0BA2>
+0BA5..0BA7 ; Cn # [3] <reserved-0BA5>..<reserved-0BA7>
+0BAB..0BAD ; Cn # [3] <reserved-0BAB>..<reserved-0BAD>
+0BBA..0BBD ; Cn # [4] <reserved-0BBA>..<reserved-0BBD>
+0BC3..0BC5 ; Cn # [3] <reserved-0BC3>..<reserved-0BC5>
+0BC9 ; Cn # <reserved-0BC9>
+0BCE..0BCF ; Cn # [2] <reserved-0BCE>..<reserved-0BCF>
+0BD1..0BD6 ; Cn # [6] <reserved-0BD1>..<reserved-0BD6>
+0BD8..0BE5 ; Cn # [14] <reserved-0BD8>..<reserved-0BE5>
+0BFB..0BFF ; Cn # [5] <reserved-0BFB>..<reserved-0BFF>
+0C0D ; Cn # <reserved-0C0D>
+0C11 ; Cn # <reserved-0C11>
+0C29 ; Cn # <reserved-0C29>
+0C3A..0C3B ; Cn # [2] <reserved-0C3A>..<reserved-0C3B>
+0C45 ; Cn # <reserved-0C45>
+0C49 ; Cn # <reserved-0C49>
+0C4E..0C54 ; Cn # [7] <reserved-0C4E>..<reserved-0C54>
+0C57 ; Cn # <reserved-0C57>
+0C5B..0C5C ; Cn # [2] <reserved-0C5B>..<reserved-0C5C>
+0C5E..0C5F ; Cn # [2] <reserved-0C5E>..<reserved-0C5F>
+0C64..0C65 ; Cn # [2] <reserved-0C64>..<reserved-0C65>
+0C70..0C76 ; Cn # [7] <reserved-0C70>..<reserved-0C76>
+0C8D ; Cn # <reserved-0C8D>
+0C91 ; Cn # <reserved-0C91>
+0CA9 ; Cn # <reserved-0CA9>
+0CB4 ; Cn # <reserved-0CB4>
+0CBA..0CBB ; Cn # [2] <reserved-0CBA>..<reserved-0CBB>
+0CC5 ; Cn # <reserved-0CC5>
+0CC9 ; Cn # <reserved-0CC9>
+0CCE..0CD4 ; Cn # [7] <reserved-0CCE>..<reserved-0CD4>
+0CD7..0CDC ; Cn # [6] <reserved-0CD7>..<reserved-0CDC>
+0CDF ; Cn # <reserved-0CDF>
+0CE4..0CE5 ; Cn # [2] <reserved-0CE4>..<reserved-0CE5>
+0CF0 ; Cn # <reserved-0CF0>
+0CF4..0CFF ; Cn # [12] <reserved-0CF4>..<reserved-0CFF>
+0D0D ; Cn # <reserved-0D0D>
+0D11 ; Cn # <reserved-0D11>
+0D45 ; Cn # <reserved-0D45>
+0D49 ; Cn # <reserved-0D49>
+0D50..0D53 ; Cn # [4] <reserved-0D50>..<reserved-0D53>
+0D64..0D65 ; Cn # [2] <reserved-0D64>..<reserved-0D65>
+0D80 ; Cn # <reserved-0D80>
+0D84 ; Cn # <reserved-0D84>
+0D97..0D99 ; Cn # [3] <reserved-0D97>..<reserved-0D99>
+0DB2 ; Cn # <reserved-0DB2>
+0DBC ; Cn # <reserved-0DBC>
+0DBE..0DBF ; Cn # [2] <reserved-0DBE>..<reserved-0DBF>
+0DC7..0DC9 ; Cn # [3] <reserved-0DC7>..<reserved-0DC9>
+0DCB..0DCE ; Cn # [4] <reserved-0DCB>..<reserved-0DCE>
+0DD5 ; Cn # <reserved-0DD5>
+0DD7 ; Cn # <reserved-0DD7>
+0DE0..0DE5 ; Cn # [6] <reserved-0DE0>..<reserved-0DE5>
+0DF0..0DF1 ; Cn # [2] <reserved-0DF0>..<reserved-0DF1>
+0DF5..0E00 ; Cn # [12] <reserved-0DF5>..<reserved-0E00>
+0E3B..0E3E ; Cn # [4] <reserved-0E3B>..<reserved-0E3E>
+0E5C..0E80 ; Cn # [37] <reserved-0E5C>..<reserved-0E80>
+0E83 ; Cn # <reserved-0E83>
+0E85 ; Cn # <reserved-0E85>
+0E8B ; Cn # <reserved-0E8B>
+0EA4 ; Cn # <reserved-0EA4>
+0EA6 ; Cn # <reserved-0EA6>
+0EBE..0EBF ; Cn # [2] <reserved-0EBE>..<reserved-0EBF>
+0EC5 ; Cn # <reserved-0EC5>
+0EC7 ; Cn # <reserved-0EC7>
+0ECF ; Cn # <reserved-0ECF>
+0EDA..0EDB ; Cn # [2] <reserved-0EDA>..<reserved-0EDB>
+0EE0..0EFF ; Cn # [32] <reserved-0EE0>..<reserved-0EFF>
+0F48 ; Cn # <reserved-0F48>
+0F6D..0F70 ; Cn # [4] <reserved-0F6D>..<reserved-0F70>
+0F98 ; Cn # <reserved-0F98>
+0FBD ; Cn # <reserved-0FBD>
+0FCD ; Cn # <reserved-0FCD>
+0FDB..0FFF ; Cn # [37] <reserved-0FDB>..<reserved-0FFF>
+10C6 ; Cn # <reserved-10C6>
+10C8..10CC ; Cn # [5] <reserved-10C8>..<reserved-10CC>
+10CE..10CF ; Cn # [2] <reserved-10CE>..<reserved-10CF>
+1249 ; Cn # <reserved-1249>
+124E..124F ; Cn # [2] <reserved-124E>..<reserved-124F>
+1257 ; Cn # <reserved-1257>
+1259 ; Cn # <reserved-1259>
+125E..125F ; Cn # [2] <reserved-125E>..<reserved-125F>
+1289 ; Cn # <reserved-1289>
+128E..128F ; Cn # [2] <reserved-128E>..<reserved-128F>
+12B1 ; Cn # <reserved-12B1>
+12B6..12B7 ; Cn # [2] <reserved-12B6>..<reserved-12B7>
+12BF ; Cn # <reserved-12BF>
+12C1 ; Cn # <reserved-12C1>
+12C6..12C7 ; Cn # [2] <reserved-12C6>..<reserved-12C7>
+12D7 ; Cn # <reserved-12D7>
+1311 ; Cn # <reserved-1311>
+1316..1317 ; Cn # [2] <reserved-1316>..<reserved-1317>
+135B..135C ; Cn # [2] <reserved-135B>..<reserved-135C>
+137D..137F ; Cn # [3] <reserved-137D>..<reserved-137F>
+139A..139F ; Cn # [6] <reserved-139A>..<reserved-139F>
+13F6..13F7 ; Cn # [2] <reserved-13F6>..<reserved-13F7>
+13FE..13FF ; Cn # [2] <reserved-13FE>..<reserved-13FF>
+169D..169F ; Cn # [3] <reserved-169D>..<reserved-169F>
+16F9..16FF ; Cn # [7] <reserved-16F9>..<reserved-16FF>
+1716..171E ; Cn # [9] <reserved-1716>..<reserved-171E>
+1737..173F ; Cn # [9] <reserved-1737>..<reserved-173F>
+1754..175F ; Cn # [12] <reserved-1754>..<reserved-175F>
+176D ; Cn # <reserved-176D>
+1771 ; Cn # <reserved-1771>
+1774..177F ; Cn # [12] <reserved-1774>..<reserved-177F>
+17DE..17DF ; Cn # [2] <reserved-17DE>..<reserved-17DF>
+17EA..17EF ; Cn # [6] <reserved-17EA>..<reserved-17EF>
+17FA..17FF ; Cn # [6] <reserved-17FA>..<reserved-17FF>
+181A..181F ; Cn # [6] <reserved-181A>..<reserved-181F>
+1879..187F ; Cn # [7] <reserved-1879>..<reserved-187F>
+18AB..18AF ; Cn # [5] <reserved-18AB>..<reserved-18AF>
+18F6..18FF ; Cn # [10] <reserved-18F6>..<reserved-18FF>
+191F ; Cn # <reserved-191F>
+192C..192F ; Cn # [4] <reserved-192C>..<reserved-192F>
+193C..193F ; Cn # [4] <reserved-193C>..<reserved-193F>
+1941..1943 ; Cn # [3] <reserved-1941>..<reserved-1943>
+196E..196F ; Cn # [2] <reserved-196E>..<reserved-196F>
+1975..197F ; Cn # [11] <reserved-1975>..<reserved-197F>
+19AC..19AF ; Cn # [4] <reserved-19AC>..<reserved-19AF>
+19CA..19CF ; Cn # [6] <reserved-19CA>..<reserved-19CF>
+19DB..19DD ; Cn # [3] <reserved-19DB>..<reserved-19DD>
+1A1C..1A1D ; Cn # [2] <reserved-1A1C>..<reserved-1A1D>
+1A5F ; Cn # <reserved-1A5F>
+1A7D..1A7E ; Cn # [2] <reserved-1A7D>..<reserved-1A7E>
+1A8A..1A8F ; Cn # [6] <reserved-1A8A>..<reserved-1A8F>
+1A9A..1A9F ; Cn # [6] <reserved-1A9A>..<reserved-1A9F>
+1AAE..1AAF ; Cn # [2] <reserved-1AAE>..<reserved-1AAF>
+1ACF..1AFF ; Cn # [49] <reserved-1ACF>..<reserved-1AFF>
+1B4D ; Cn # <reserved-1B4D>
+1BF4..1BFB ; Cn # [8] <reserved-1BF4>..<reserved-1BFB>
+1C38..1C3A ; Cn # [3] <reserved-1C38>..<reserved-1C3A>
+1C4A..1C4C ; Cn # [3] <reserved-1C4A>..<reserved-1C4C>
+1C8B..1C8F ; Cn # [5] <reserved-1C8B>..<reserved-1C8F>
+1CBB..1CBC ; Cn # [2] <reserved-1CBB>..<reserved-1CBC>
+1CC8..1CCF ; Cn # [8] <reserved-1CC8>..<reserved-1CCF>
+1CFB..1CFF ; Cn # [5] <reserved-1CFB>..<reserved-1CFF>
+1F16..1F17 ; Cn # [2] <reserved-1F16>..<reserved-1F17>
+1F1E..1F1F ; Cn # [2] <reserved-1F1E>..<reserved-1F1F>
+1F46..1F47 ; Cn # [2] <reserved-1F46>..<reserved-1F47>
+1F4E..1F4F ; Cn # [2] <reserved-1F4E>..<reserved-1F4F>
+1F58 ; Cn # <reserved-1F58>
+1F5A ; Cn # <reserved-1F5A>
+1F5C ; Cn # <reserved-1F5C>
+1F5E ; Cn # <reserved-1F5E>
+1F7E..1F7F ; Cn # [2] <reserved-1F7E>..<reserved-1F7F>
+1FB5 ; Cn # <reserved-1FB5>
+1FC5 ; Cn # <reserved-1FC5>
+1FD4..1FD5 ; Cn # [2] <reserved-1FD4>..<reserved-1FD5>
+1FDC ; Cn # <reserved-1FDC>
+1FF0..1FF1 ; Cn # [2] <reserved-1FF0>..<reserved-1FF1>
+1FF5 ; Cn # <reserved-1FF5>
+1FFF ; Cn # <reserved-1FFF>
+2065 ; Cn # <reserved-2065>
+2072..2073 ; Cn # [2] <reserved-2072>..<reserved-2073>
+208F ; Cn # <reserved-208F>
+209D..209F ; Cn # [3] <reserved-209D>..<reserved-209F>
+20C1..20CF ; Cn # [15] <reserved-20C1>..<reserved-20CF>
+20F1..20FF ; Cn # [15] <reserved-20F1>..<reserved-20FF>
+218C..218F ; Cn # [4] <reserved-218C>..<reserved-218F>
+242A..243F ; Cn # [22] <reserved-242A>..<reserved-243F>
+244B..245F ; Cn # [21] <reserved-244B>..<reserved-245F>
+2B74..2B75 ; Cn # [2] <reserved-2B74>..<reserved-2B75>
+2B96 ; Cn # <reserved-2B96>
+2CF4..2CF8 ; Cn # [5] <reserved-2CF4>..<reserved-2CF8>
+2D26 ; Cn # <reserved-2D26>
+2D28..2D2C ; Cn # [5] <reserved-2D28>..<reserved-2D2C>
+2D2E..2D2F ; Cn # [2] <reserved-2D2E>..<reserved-2D2F>
+2D68..2D6E ; Cn # [7] <reserved-2D68>..<reserved-2D6E>
+2D71..2D7E ; Cn # [14] <reserved-2D71>..<reserved-2D7E>
+2D97..2D9F ; Cn # [9] <reserved-2D97>..<reserved-2D9F>
+2DA7 ; Cn # <reserved-2DA7>
+2DAF ; Cn # <reserved-2DAF>
+2DB7 ; Cn # <reserved-2DB7>
+2DBF ; Cn # <reserved-2DBF>
+2DC7 ; Cn # <reserved-2DC7>
+2DCF ; Cn # <reserved-2DCF>
+2DD7 ; Cn # <reserved-2DD7>
+2DDF ; Cn # <reserved-2DDF>
+2E5E..2E7F ; Cn # [34] <reserved-2E5E>..<reserved-2E7F>
+2E9A ; Cn # <reserved-2E9A>
+2EF4..2EFF ; Cn # [12] <reserved-2EF4>..<reserved-2EFF>
+2FD6..2FEF ; Cn # [26] <reserved-2FD6>..<reserved-2FEF>
+3040 ; Cn # <reserved-3040>
+3097..3098 ; Cn # [2] <reserved-3097>..<reserved-3098>
+3100..3104 ; Cn # [5] <reserved-3100>..<reserved-3104>
+3130 ; Cn # <reserved-3130>
+318F ; Cn # <reserved-318F>
+31E6..31EE ; Cn # [9] <reserved-31E6>..<reserved-31EE>
+321F ; Cn # <reserved-321F>
+A48D..A48F ; Cn # [3] <reserved-A48D>..<reserved-A48F>
+A4C7..A4CF ; Cn # [9] <reserved-A4C7>..<reserved-A4CF>
+A62C..A63F ; Cn # [20] <reserved-A62C>..<reserved-A63F>
+A6F8..A6FF ; Cn # [8] <reserved-A6F8>..<reserved-A6FF>
+A7CE..A7CF ; Cn # [2] <reserved-A7CE>..<reserved-A7CF>
+A7D2 ; Cn # <reserved-A7D2>
+A7D4 ; Cn # <reserved-A7D4>
+A7DD..A7F1 ; Cn # [21] <reserved-A7DD>..<reserved-A7F1>
+A82D..A82F ; Cn # [3] <reserved-A82D>..<reserved-A82F>
+A83A..A83F ; Cn # [6] <reserved-A83A>..<reserved-A83F>
+A878..A87F ; Cn # [8] <reserved-A878>..<reserved-A87F>
+A8C6..A8CD ; Cn # [8] <reserved-A8C6>..<reserved-A8CD>
+A8DA..A8DF ; Cn # [6] <reserved-A8DA>..<reserved-A8DF>
+A954..A95E ; Cn # [11] <reserved-A954>..<reserved-A95E>
+A97D..A97F ; Cn # [3] <reserved-A97D>..<reserved-A97F>
+A9CE ; Cn # <reserved-A9CE>
+A9DA..A9DD ; Cn # [4] <reserved-A9DA>..<reserved-A9DD>
+A9FF ; Cn # <reserved-A9FF>
+AA37..AA3F ; Cn # [9] <reserved-AA37>..<reserved-AA3F>
+AA4E..AA4F ; Cn # [2] <reserved-AA4E>..<reserved-AA4F>
+AA5A..AA5B ; Cn # [2] <reserved-AA5A>..<reserved-AA5B>
+AAC3..AADA ; Cn # [24] <reserved-AAC3>..<reserved-AADA>
+AAF7..AB00 ; Cn # [10] <reserved-AAF7>..<reserved-AB00>
+AB07..AB08 ; Cn # [2] <reserved-AB07>..<reserved-AB08>
+AB0F..AB10 ; Cn # [2] <reserved-AB0F>..<reserved-AB10>
+AB17..AB1F ; Cn # [9] <reserved-AB17>..<reserved-AB1F>
+AB27 ; Cn # <reserved-AB27>
+AB2F ; Cn # <reserved-AB2F>
+AB6C..AB6F ; Cn # [4] <reserved-AB6C>..<reserved-AB6F>
+ABEE..ABEF ; Cn # [2] <reserved-ABEE>..<reserved-ABEF>
+ABFA..ABFF ; Cn # [6] <reserved-ABFA>..<reserved-ABFF>
+D7A4..D7AF ; Cn # [12] <reserved-D7A4>..<reserved-D7AF>
+D7C7..D7CA ; Cn # [4] <reserved-D7C7>..<reserved-D7CA>
+D7FC..D7FF ; Cn # [4] <reserved-D7FC>..<reserved-D7FF>
+FA6E..FA6F ; Cn # [2] <reserved-FA6E>..<reserved-FA6F>
+FADA..FAFF ; Cn # [38] <reserved-FADA>..<reserved-FAFF>
+FB07..FB12 ; Cn # [12] <reserved-FB07>..<reserved-FB12>
+FB18..FB1C ; Cn # [5] <reserved-FB18>..<reserved-FB1C>
+FB37 ; Cn # <reserved-FB37>
+FB3D ; Cn # <reserved-FB3D>
+FB3F ; Cn # <reserved-FB3F>
+FB42 ; Cn # <reserved-FB42>
+FB45 ; Cn # <reserved-FB45>
+FBC3..FBD2 ; Cn # [16] <reserved-FBC3>..<reserved-FBD2>
+FD90..FD91 ; Cn # [2] <reserved-FD90>..<reserved-FD91>
+FDC8..FDCE ; Cn # [7] <reserved-FDC8>..<reserved-FDCE>
+FDD0..FDEF ; Cn # [32] <noncharacter-FDD0>..<noncharacter-FDEF>
+FE1A..FE1F ; Cn # [6] <reserved-FE1A>..<reserved-FE1F>
+FE53 ; Cn # <reserved-FE53>
+FE67 ; Cn # <reserved-FE67>
+FE6C..FE6F ; Cn # [4] <reserved-FE6C>..<reserved-FE6F>
+FE75 ; Cn # <reserved-FE75>
+FEFD..FEFE ; Cn # [2] <reserved-FEFD>..<reserved-FEFE>
+FF00 ; Cn # <reserved-FF00>
+FFBF..FFC1 ; Cn # [3] <reserved-FFBF>..<reserved-FFC1>
+FFC8..FFC9 ; Cn # [2] <reserved-FFC8>..<reserved-FFC9>
+FFD0..FFD1 ; Cn # [2] <reserved-FFD0>..<reserved-FFD1>
+FFD8..FFD9 ; Cn # [2] <reserved-FFD8>..<reserved-FFD9>
+FFDD..FFDF ; Cn # [3] <reserved-FFDD>..<reserved-FFDF>
+FFE7 ; Cn # <reserved-FFE7>
+FFEF..FFF8 ; Cn # [10] <reserved-FFEF>..<reserved-FFF8>
+FFFE..FFFF ; Cn # [2] <noncharacter-FFFE>..<noncharacter-FFFF>
+1000C ; Cn # <reserved-1000C>
+10027 ; Cn # <reserved-10027>
+1003B ; Cn # <reserved-1003B>
+1003E ; Cn # <reserved-1003E>
+1004E..1004F ; Cn # [2] <reserved-1004E>..<reserved-1004F>
+1005E..1007F ; Cn # [34] <reserved-1005E>..<reserved-1007F>
+100FB..100FF ; Cn # [5] <reserved-100FB>..<reserved-100FF>
+10103..10106 ; Cn # [4] <reserved-10103>..<reserved-10106>
+10134..10136 ; Cn # [3] <reserved-10134>..<reserved-10136>
+1018F ; Cn # <reserved-1018F>
+1019D..1019F ; Cn # [3] <reserved-1019D>..<reserved-1019F>
+101A1..101CF ; Cn # [47] <reserved-101A1>..<reserved-101CF>
+101FE..1027F ; Cn # [130] <reserved-101FE>..<reserved-1027F>
+1029D..1029F ; Cn # [3] <reserved-1029D>..<reserved-1029F>
+102D1..102DF ; Cn # [15] <reserved-102D1>..<reserved-102DF>
+102FC..102FF ; Cn # [4] <reserved-102FC>..<reserved-102FF>
+10324..1032C ; Cn # [9] <reserved-10324>..<reserved-1032C>
+1034B..1034F ; Cn # [5] <reserved-1034B>..<reserved-1034F>
+1037B..1037F ; Cn # [5] <reserved-1037B>..<reserved-1037F>
+1039E ; Cn # <reserved-1039E>
+103C4..103C7 ; Cn # [4] <reserved-103C4>..<reserved-103C7>
+103D6..103FF ; Cn # [42] <reserved-103D6>..<reserved-103FF>
+1049E..1049F ; Cn # [2] <reserved-1049E>..<reserved-1049F>
+104AA..104AF ; Cn # [6] <reserved-104AA>..<reserved-104AF>
+104D4..104D7 ; Cn # [4] <reserved-104D4>..<reserved-104D7>
+104FC..104FF ; Cn # [4] <reserved-104FC>..<reserved-104FF>
+10528..1052F ; Cn # [8] <reserved-10528>..<reserved-1052F>
+10564..1056E ; Cn # [11] <reserved-10564>..<reserved-1056E>
+1057B ; Cn # <reserved-1057B>
+1058B ; Cn # <reserved-1058B>
+10593 ; Cn # <reserved-10593>
+10596 ; Cn # <reserved-10596>
+105A2 ; Cn # <reserved-105A2>
+105B2 ; Cn # <reserved-105B2>
+105BA ; Cn # <reserved-105BA>
+105BD..105BF ; Cn # [3] <reserved-105BD>..<reserved-105BF>
+105F4..105FF ; Cn # [12] <reserved-105F4>..<reserved-105FF>
+10737..1073F ; Cn # [9] <reserved-10737>..<reserved-1073F>
+10756..1075F ; Cn # [10] <reserved-10756>..<reserved-1075F>
+10768..1077F ; Cn # [24] <reserved-10768>..<reserved-1077F>
+10786 ; Cn # <reserved-10786>
+107B1 ; Cn # <reserved-107B1>
+107BB..107FF ; Cn # [69] <reserved-107BB>..<reserved-107FF>
+10806..10807 ; Cn # [2] <reserved-10806>..<reserved-10807>
+10809 ; Cn # <reserved-10809>
+10836 ; Cn # <reserved-10836>
+10839..1083B ; Cn # [3] <reserved-10839>..<reserved-1083B>
+1083D..1083E ; Cn # [2] <reserved-1083D>..<reserved-1083E>
+10856 ; Cn # <reserved-10856>
+1089F..108A6 ; Cn # [8] <reserved-1089F>..<reserved-108A6>
+108B0..108DF ; Cn # [48] <reserved-108B0>..<reserved-108DF>
+108F3 ; Cn # <reserved-108F3>
+108F6..108FA ; Cn # [5] <reserved-108F6>..<reserved-108FA>
+1091C..1091E ; Cn # [3] <reserved-1091C>..<reserved-1091E>
+1093A..1093E ; Cn # [5] <reserved-1093A>..<reserved-1093E>
+10940..1097F ; Cn # [64] <reserved-10940>..<reserved-1097F>
+109B8..109BB ; Cn # [4] <reserved-109B8>..<reserved-109BB>
+109D0..109D1 ; Cn # [2] <reserved-109D0>..<reserved-109D1>
+10A04 ; Cn # <reserved-10A04>
+10A07..10A0B ; Cn # [5] <reserved-10A07>..<reserved-10A0B>
+10A14 ; Cn # <reserved-10A14>
+10A18 ; Cn # <reserved-10A18>
+10A36..10A37 ; Cn # [2] <reserved-10A36>..<reserved-10A37>
+10A3B..10A3E ; Cn # [4] <reserved-10A3B>..<reserved-10A3E>
+10A49..10A4F ; Cn # [7] <reserved-10A49>..<reserved-10A4F>
+10A59..10A5F ; Cn # [7] <reserved-10A59>..<reserved-10A5F>
+10AA0..10ABF ; Cn # [32] <reserved-10AA0>..<reserved-10ABF>
+10AE7..10AEA ; Cn # [4] <reserved-10AE7>..<reserved-10AEA>
+10AF7..10AFF ; Cn # [9] <reserved-10AF7>..<reserved-10AFF>
+10B36..10B38 ; Cn # [3] <reserved-10B36>..<reserved-10B38>
+10B56..10B57 ; Cn # [2] <reserved-10B56>..<reserved-10B57>
+10B73..10B77 ; Cn # [5] <reserved-10B73>..<reserved-10B77>
+10B92..10B98 ; Cn # [7] <reserved-10B92>..<reserved-10B98>
+10B9D..10BA8 ; Cn # [12] <reserved-10B9D>..<reserved-10BA8>
+10BB0..10BFF ; Cn # [80] <reserved-10BB0>..<reserved-10BFF>
+10C49..10C7F ; Cn # [55] <reserved-10C49>..<reserved-10C7F>
+10CB3..10CBF ; Cn # [13] <reserved-10CB3>..<reserved-10CBF>
+10CF3..10CF9 ; Cn # [7] <reserved-10CF3>..<reserved-10CF9>
+10D28..10D2F ; Cn # [8] <reserved-10D28>..<reserved-10D2F>
+10D3A..10D3F ; Cn # [6] <reserved-10D3A>..<reserved-10D3F>
+10D66..10D68 ; Cn # [3] <reserved-10D66>..<reserved-10D68>
+10D86..10D8D ; Cn # [8] <reserved-10D86>..<reserved-10D8D>
+10D90..10E5F ; Cn # [208] <reserved-10D90>..<reserved-10E5F>
+10E7F ; Cn # <reserved-10E7F>
+10EAA ; Cn # <reserved-10EAA>
+10EAE..10EAF ; Cn # [2] <reserved-10EAE>..<reserved-10EAF>
+10EB2..10EC1 ; Cn # [16] <reserved-10EB2>..<reserved-10EC1>
+10EC5..10EFB ; Cn # [55] <reserved-10EC5>..<reserved-10EFB>
+10F28..10F2F ; Cn # [8] <reserved-10F28>..<reserved-10F2F>
+10F5A..10F6F ; Cn # [22] <reserved-10F5A>..<reserved-10F6F>
+10F8A..10FAF ; Cn # [38] <reserved-10F8A>..<reserved-10FAF>
+10FCC..10FDF ; Cn # [20] <reserved-10FCC>..<reserved-10FDF>
+10FF7..10FFF ; Cn # [9] <reserved-10FF7>..<reserved-10FFF>
+1104E..11051 ; Cn # [4] <reserved-1104E>..<reserved-11051>
+11076..1107E ; Cn # [9] <reserved-11076>..<reserved-1107E>
+110C3..110CC ; Cn # [10] <reserved-110C3>..<reserved-110CC>
+110CE..110CF ; Cn # [2] <reserved-110CE>..<reserved-110CF>
+110E9..110EF ; Cn # [7] <reserved-110E9>..<reserved-110EF>
+110FA..110FF ; Cn # [6] <reserved-110FA>..<reserved-110FF>
+11135 ; Cn # <reserved-11135>
+11148..1114F ; Cn # [8] <reserved-11148>..<reserved-1114F>
+11177..1117F ; Cn # [9] <reserved-11177>..<reserved-1117F>
+111E0 ; Cn # <reserved-111E0>
+111F5..111FF ; Cn # [11] <reserved-111F5>..<reserved-111FF>
+11212 ; Cn # <reserved-11212>
+11242..1127F ; Cn # [62] <reserved-11242>..<reserved-1127F>
+11287 ; Cn # <reserved-11287>
+11289 ; Cn # <reserved-11289>
+1128E ; Cn # <reserved-1128E>
+1129E ; Cn # <reserved-1129E>
+112AA..112AF ; Cn # [6] <reserved-112AA>..<reserved-112AF>
+112EB..112EF ; Cn # [5] <reserved-112EB>..<reserved-112EF>
+112FA..112FF ; Cn # [6] <reserved-112FA>..<reserved-112FF>
+11304 ; Cn # <reserved-11304>
+1130D..1130E ; Cn # [2] <reserved-1130D>..<reserved-1130E>
+11311..11312 ; Cn # [2] <reserved-11311>..<reserved-11312>
+11329 ; Cn # <reserved-11329>
+11331 ; Cn # <reserved-11331>
+11334 ; Cn # <reserved-11334>
+1133A ; Cn # <reserved-1133A>
+11345..11346 ; Cn # [2] <reserved-11345>..<reserved-11346>
+11349..1134A ; Cn # [2] <reserved-11349>..<reserved-1134A>
+1134E..1134F ; Cn # [2] <reserved-1134E>..<reserved-1134F>
+11351..11356 ; Cn # [6] <reserved-11351>..<reserved-11356>
+11358..1135C ; Cn # [5] <reserved-11358>..<reserved-1135C>
+11364..11365 ; Cn # [2] <reserved-11364>..<reserved-11365>
+1136D..1136F ; Cn # [3] <reserved-1136D>..<reserved-1136F>
+11375..1137F ; Cn # [11] <reserved-11375>..<reserved-1137F>
+1138A ; Cn # <reserved-1138A>
+1138C..1138D ; Cn # [2] <reserved-1138C>..<reserved-1138D>
+1138F ; Cn # <reserved-1138F>
+113B6 ; Cn # <reserved-113B6>
+113C1 ; Cn # <reserved-113C1>
+113C3..113C4 ; Cn # [2] <reserved-113C3>..<reserved-113C4>
+113C6 ; Cn # <reserved-113C6>
+113CB ; Cn # <reserved-113CB>
+113D6 ; Cn # <reserved-113D6>
+113D9..113E0 ; Cn # [8] <reserved-113D9>..<reserved-113E0>
+113E3..113FF ; Cn # [29] <reserved-113E3>..<reserved-113FF>
+1145C ; Cn # <reserved-1145C>
+11462..1147F ; Cn # [30] <reserved-11462>..<reserved-1147F>
+114C8..114CF ; Cn # [8] <reserved-114C8>..<reserved-114CF>
+114DA..1157F ; Cn # [166] <reserved-114DA>..<reserved-1157F>
+115B6..115B7 ; Cn # [2] <reserved-115B6>..<reserved-115B7>
+115DE..115FF ; Cn # [34] <reserved-115DE>..<reserved-115FF>
+11645..1164F ; Cn # [11] <reserved-11645>..<reserved-1164F>
+1165A..1165F ; Cn # [6] <reserved-1165A>..<reserved-1165F>
+1166D..1167F ; Cn # [19] <reserved-1166D>..<reserved-1167F>
+116BA..116BF ; Cn # [6] <reserved-116BA>..<reserved-116BF>
+116CA..116CF ; Cn # [6] <reserved-116CA>..<reserved-116CF>
+116E4..116FF ; Cn # [28] <reserved-116E4>..<reserved-116FF>
+1171B..1171C ; Cn # [2] <reserved-1171B>..<reserved-1171C>
+1172C..1172F ; Cn # [4] <reserved-1172C>..<reserved-1172F>
+11747..117FF ; Cn # [185] <reserved-11747>..<reserved-117FF>
+1183C..1189F ; Cn # [100] <reserved-1183C>..<reserved-1189F>
+118F3..118FE ; Cn # [12] <reserved-118F3>..<reserved-118FE>
+11907..11908 ; Cn # [2] <reserved-11907>..<reserved-11908>
+1190A..1190B ; Cn # [2] <reserved-1190A>..<reserved-1190B>
+11914 ; Cn # <reserved-11914>
+11917 ; Cn # <reserved-11917>
+11936 ; Cn # <reserved-11936>
+11939..1193A ; Cn # [2] <reserved-11939>..<reserved-1193A>
+11947..1194F ; Cn # [9] <reserved-11947>..<reserved-1194F>
+1195A..1199F ; Cn # [70] <reserved-1195A>..<reserved-1199F>
+119A8..119A9 ; Cn # [2] <reserved-119A8>..<reserved-119A9>
+119D8..119D9 ; Cn # [2] <reserved-119D8>..<reserved-119D9>
+119E5..119FF ; Cn # [27] <reserved-119E5>..<reserved-119FF>
+11A48..11A4F ; Cn # [8] <reserved-11A48>..<reserved-11A4F>
+11AA3..11AAF ; Cn # [13] <reserved-11AA3>..<reserved-11AAF>
+11AF9..11AFF ; Cn # [7] <reserved-11AF9>..<reserved-11AFF>
+11B0A..11BBF ; Cn # [182] <reserved-11B0A>..<reserved-11BBF>
+11BE2..11BEF ; Cn # [14] <reserved-11BE2>..<reserved-11BEF>
+11BFA..11BFF ; Cn # [6] <reserved-11BFA>..<reserved-11BFF>
+11C09 ; Cn # <reserved-11C09>
+11C37 ; Cn # <reserved-11C37>
+11C46..11C4F ; Cn # [10] <reserved-11C46>..<reserved-11C4F>
+11C6D..11C6F ; Cn # [3] <reserved-11C6D>..<reserved-11C6F>
+11C90..11C91 ; Cn # [2] <reserved-11C90>..<reserved-11C91>
+11CA8 ; Cn # <reserved-11CA8>
+11CB7..11CFF ; Cn # [73] <reserved-11CB7>..<reserved-11CFF>
+11D07 ; Cn # <reserved-11D07>
+11D0A ; Cn # <reserved-11D0A>
+11D37..11D39 ; Cn # [3] <reserved-11D37>..<reserved-11D39>
+11D3B ; Cn # <reserved-11D3B>
+11D3E ; Cn # <reserved-11D3E>
+11D48..11D4F ; Cn # [8] <reserved-11D48>..<reserved-11D4F>
+11D5A..11D5F ; Cn # [6] <reserved-11D5A>..<reserved-11D5F>
+11D66 ; Cn # <reserved-11D66>
+11D69 ; Cn # <reserved-11D69>
+11D8F ; Cn # <reserved-11D8F>
+11D92 ; Cn # <reserved-11D92>
+11D99..11D9F ; Cn # [7] <reserved-11D99>..<reserved-11D9F>
+11DAA..11EDF ; Cn # [310] <reserved-11DAA>..<reserved-11EDF>
+11EF9..11EFF ; Cn # [7] <reserved-11EF9>..<reserved-11EFF>
+11F11 ; Cn # <reserved-11F11>
+11F3B..11F3D ; Cn # [3] <reserved-11F3B>..<reserved-11F3D>
+11F5B..11FAF ; Cn # [85] <reserved-11F5B>..<reserved-11FAF>
+11FB1..11FBF ; Cn # [15] <reserved-11FB1>..<reserved-11FBF>
+11FF2..11FFE ; Cn # [13] <reserved-11FF2>..<reserved-11FFE>
+1239A..123FF ; Cn # [102] <reserved-1239A>..<reserved-123FF>
+1246F ; Cn # <reserved-1246F>
+12475..1247F ; Cn # [11] <reserved-12475>..<reserved-1247F>
+12544..12F8F ; Cn # [2636] <reserved-12544>..<reserved-12F8F>
+12FF3..12FFF ; Cn # [13] <reserved-12FF3>..<reserved-12FFF>
+13456..1345F ; Cn # [10] <reserved-13456>..<reserved-1345F>
+143FB..143FF ; Cn # [5] <reserved-143FB>..<reserved-143FF>
+14647..160FF ; Cn # [6841] <reserved-14647>..<reserved-160FF>
+1613A..167FF ; Cn # [1734] <reserved-1613A>..<reserved-167FF>
+16A39..16A3F ; Cn # [7] <reserved-16A39>..<reserved-16A3F>
+16A5F ; Cn # <reserved-16A5F>
+16A6A..16A6D ; Cn # [4] <reserved-16A6A>..<reserved-16A6D>
+16ABF ; Cn # <reserved-16ABF>
+16ACA..16ACF ; Cn # [6] <reserved-16ACA>..<reserved-16ACF>
+16AEE..16AEF ; Cn # [2] <reserved-16AEE>..<reserved-16AEF>
+16AF6..16AFF ; Cn # [10] <reserved-16AF6>..<reserved-16AFF>
+16B46..16B4F ; Cn # [10] <reserved-16B46>..<reserved-16B4F>
+16B5A ; Cn # <reserved-16B5A>
+16B62 ; Cn # <reserved-16B62>
+16B78..16B7C ; Cn # [5] <reserved-16B78>..<reserved-16B7C>
+16B90..16D3F ; Cn # [432] <reserved-16B90>..<reserved-16D3F>
+16D7A..16E3F ; Cn # [198] <reserved-16D7A>..<reserved-16E3F>
+16E9B..16EFF ; Cn # [101] <reserved-16E9B>..<reserved-16EFF>
+16F4B..16F4E ; Cn # [4] <reserved-16F4B>..<reserved-16F4E>
+16F88..16F8E ; Cn # [7] <reserved-16F88>..<reserved-16F8E>
+16FA0..16FDF ; Cn # [64] <reserved-16FA0>..<reserved-16FDF>
+16FE5..16FEF ; Cn # [11] <reserved-16FE5>..<reserved-16FEF>
+16FF2..16FFF ; Cn # [14] <reserved-16FF2>..<reserved-16FFF>
+187F8..187FF ; Cn # [8] <reserved-187F8>..<reserved-187FF>
+18CD6..18CFE ; Cn # [41] <reserved-18CD6>..<reserved-18CFE>
+18D09..1AFEF ; Cn # [8935] <reserved-18D09>..<reserved-1AFEF>
+1AFF4 ; Cn # <reserved-1AFF4>
+1AFFC ; Cn # <reserved-1AFFC>
+1AFFF ; Cn # <reserved-1AFFF>
+1B123..1B131 ; Cn # [15] <reserved-1B123>..<reserved-1B131>
+1B133..1B14F ; Cn # [29] <reserved-1B133>..<reserved-1B14F>
+1B153..1B154 ; Cn # [2] <reserved-1B153>..<reserved-1B154>
+1B156..1B163 ; Cn # [14] <reserved-1B156>..<reserved-1B163>
+1B168..1B16F ; Cn # [8] <reserved-1B168>..<reserved-1B16F>
+1B2FC..1BBFF ; Cn # [2308] <reserved-1B2FC>..<reserved-1BBFF>
+1BC6B..1BC6F ; Cn # [5] <reserved-1BC6B>..<reserved-1BC6F>
+1BC7D..1BC7F ; Cn # [3] <reserved-1BC7D>..<reserved-1BC7F>
+1BC89..1BC8F ; Cn # [7] <reserved-1BC89>..<reserved-1BC8F>
+1BC9A..1BC9B ; Cn # [2] <reserved-1BC9A>..<reserved-1BC9B>
+1BCA4..1CBFF ; Cn # [3932] <reserved-1BCA4>..<reserved-1CBFF>
+1CCFA..1CCFF ; Cn # [6] <reserved-1CCFA>..<reserved-1CCFF>
+1CEB4..1CEFF ; Cn # [76] <reserved-1CEB4>..<reserved-1CEFF>
+1CF2E..1CF2F ; Cn # [2] <reserved-1CF2E>..<reserved-1CF2F>
+1CF47..1CF4F ; Cn # [9] <reserved-1CF47>..<reserved-1CF4F>
+1CFC4..1CFFF ; Cn # [60] <reserved-1CFC4>..<reserved-1CFFF>
+1D0F6..1D0FF ; Cn # [10] <reserved-1D0F6>..<reserved-1D0FF>
+1D127..1D128 ; Cn # [2] <reserved-1D127>..<reserved-1D128>
+1D1EB..1D1FF ; Cn # [21] <reserved-1D1EB>..<reserved-1D1FF>
+1D246..1D2BF ; Cn # [122] <reserved-1D246>..<reserved-1D2BF>
+1D2D4..1D2DF ; Cn # [12] <reserved-1D2D4>..<reserved-1D2DF>
+1D2F4..1D2FF ; Cn # [12] <reserved-1D2F4>..<reserved-1D2FF>
+1D357..1D35F ; Cn # [9] <reserved-1D357>..<reserved-1D35F>
+1D379..1D3FF ; Cn # [135] <reserved-1D379>..<reserved-1D3FF>
+1D455 ; Cn # <reserved-1D455>
+1D49D ; Cn # <reserved-1D49D>
+1D4A0..1D4A1 ; Cn # [2] <reserved-1D4A0>..<reserved-1D4A1>
+1D4A3..1D4A4 ; Cn # [2] <reserved-1D4A3>..<reserved-1D4A4>
+1D4A7..1D4A8 ; Cn # [2] <reserved-1D4A7>..<reserved-1D4A8>
+1D4AD ; Cn # <reserved-1D4AD>
+1D4BA ; Cn # <reserved-1D4BA>
+1D4BC ; Cn # <reserved-1D4BC>
+1D4C4 ; Cn # <reserved-1D4C4>
+1D506 ; Cn # <reserved-1D506>
+1D50B..1D50C ; Cn # [2] <reserved-1D50B>..<reserved-1D50C>
+1D515 ; Cn # <reserved-1D515>
+1D51D ; Cn # <reserved-1D51D>
+1D53A ; Cn # <reserved-1D53A>
+1D53F ; Cn # <reserved-1D53F>
+1D545 ; Cn # <reserved-1D545>
+1D547..1D549 ; Cn # [3] <reserved-1D547>..<reserved-1D549>
+1D551 ; Cn # <reserved-1D551>
+1D6A6..1D6A7 ; Cn # [2] <reserved-1D6A6>..<reserved-1D6A7>
+1D7CC..1D7CD ; Cn # [2] <reserved-1D7CC>..<reserved-1D7CD>
+1DA8C..1DA9A ; Cn # [15] <reserved-1DA8C>..<reserved-1DA9A>
+1DAA0 ; Cn # <reserved-1DAA0>
+1DAB0..1DEFF ; Cn # [1104] <reserved-1DAB0>..<reserved-1DEFF>
+1DF1F..1DF24 ; Cn # [6] <reserved-1DF1F>..<reserved-1DF24>
+1DF2B..1DFFF ; Cn # [213] <reserved-1DF2B>..<reserved-1DFFF>
+1E007 ; Cn # <reserved-1E007>
+1E019..1E01A ; Cn # [2] <reserved-1E019>..<reserved-1E01A>
+1E022 ; Cn # <reserved-1E022>
+1E025 ; Cn # <reserved-1E025>
+1E02B..1E02F ; Cn # [5] <reserved-1E02B>..<reserved-1E02F>
+1E06E..1E08E ; Cn # [33] <reserved-1E06E>..<reserved-1E08E>
+1E090..1E0FF ; Cn # [112] <reserved-1E090>..<reserved-1E0FF>
+1E12D..1E12F ; Cn # [3] <reserved-1E12D>..<reserved-1E12F>
+1E13E..1E13F ; Cn # [2] <reserved-1E13E>..<reserved-1E13F>
+1E14A..1E14D ; Cn # [4] <reserved-1E14A>..<reserved-1E14D>
+1E150..1E28F ; Cn # [320] <reserved-1E150>..<reserved-1E28F>
+1E2AF..1E2BF ; Cn # [17] <reserved-1E2AF>..<reserved-1E2BF>
+1E2FA..1E2FE ; Cn # [5] <reserved-1E2FA>..<reserved-1E2FE>
+1E300..1E4CF ; Cn # [464] <reserved-1E300>..<reserved-1E4CF>
+1E4FA..1E5CF ; Cn # [214] <reserved-1E4FA>..<reserved-1E5CF>
+1E5FB..1E5FE ; Cn # [4] <reserved-1E5FB>..<reserved-1E5FE>
+1E600..1E7DF ; Cn # [480] <reserved-1E600>..<reserved-1E7DF>
+1E7E7 ; Cn # <reserved-1E7E7>
+1E7EC ; Cn # <reserved-1E7EC>
+1E7EF ; Cn # <reserved-1E7EF>
+1E7FF ; Cn # <reserved-1E7FF>
+1E8C5..1E8C6 ; Cn # [2] <reserved-1E8C5>..<reserved-1E8C6>
+1E8D7..1E8FF ; Cn # [41] <reserved-1E8D7>..<reserved-1E8FF>
+1E94C..1E94F ; Cn # [4] <reserved-1E94C>..<reserved-1E94F>
+1E95A..1E95D ; Cn # [4] <reserved-1E95A>..<reserved-1E95D>
+1E960..1EC70 ; Cn # [785] <reserved-1E960>..<reserved-1EC70>
+1ECB5..1ED00 ; Cn # [76] <reserved-1ECB5>..<reserved-1ED00>
+1ED3E..1EDFF ; Cn # [194] <reserved-1ED3E>..<reserved-1EDFF>
+1EE04 ; Cn # <reserved-1EE04>
+1EE20 ; Cn # <reserved-1EE20>
+1EE23 ; Cn # <reserved-1EE23>
+1EE25..1EE26 ; Cn # [2] <reserved-1EE25>..<reserved-1EE26>
+1EE28 ; Cn # <reserved-1EE28>
+1EE33 ; Cn # <reserved-1EE33>
+1EE38 ; Cn # <reserved-1EE38>
+1EE3A ; Cn # <reserved-1EE3A>
+1EE3C..1EE41 ; Cn # [6] <reserved-1EE3C>..<reserved-1EE41>
+1EE43..1EE46 ; Cn # [4] <reserved-1EE43>..<reserved-1EE46>
+1EE48 ; Cn # <reserved-1EE48>
+1EE4A ; Cn # <reserved-1EE4A>
+1EE4C ; Cn # <reserved-1EE4C>
+1EE50 ; Cn # <reserved-1EE50>
+1EE53 ; Cn # <reserved-1EE53>
+1EE55..1EE56 ; Cn # [2] <reserved-1EE55>..<reserved-1EE56>
+1EE58 ; Cn # <reserved-1EE58>
+1EE5A ; Cn # <reserved-1EE5A>
+1EE5C ; Cn # <reserved-1EE5C>
+1EE5E ; Cn # <reserved-1EE5E>
+1EE60 ; Cn # <reserved-1EE60>
+1EE63 ; Cn # <reserved-1EE63>
+1EE65..1EE66 ; Cn # [2] <reserved-1EE65>..<reserved-1EE66>
+1EE6B ; Cn # <reserved-1EE6B>
+1EE73 ; Cn # <reserved-1EE73>
+1EE78 ; Cn # <reserved-1EE78>
+1EE7D ; Cn # <reserved-1EE7D>
+1EE7F ; Cn # <reserved-1EE7F>
+1EE8A ; Cn # <reserved-1EE8A>
+1EE9C..1EEA0 ; Cn # [5] <reserved-1EE9C>..<reserved-1EEA0>
+1EEA4 ; Cn # <reserved-1EEA4>
+1EEAA ; Cn # <reserved-1EEAA>
+1EEBC..1EEEF ; Cn # [52] <reserved-1EEBC>..<reserved-1EEEF>
+1EEF2..1EFFF ; Cn # [270] <reserved-1EEF2>..<reserved-1EFFF>
+1F02C..1F02F ; Cn # [4] <reserved-1F02C>..<reserved-1F02F>
+1F094..1F09F ; Cn # [12] <reserved-1F094>..<reserved-1F09F>
+1F0AF..1F0B0 ; Cn # [2] <reserved-1F0AF>..<reserved-1F0B0>
+1F0C0 ; Cn # <reserved-1F0C0>
+1F0D0 ; Cn # <reserved-1F0D0>
+1F0F6..1F0FF ; Cn # [10] <reserved-1F0F6>..<reserved-1F0FF>
+1F1AE..1F1E5 ; Cn # [56] <reserved-1F1AE>..<reserved-1F1E5>
+1F203..1F20F ; Cn # [13] <reserved-1F203>..<reserved-1F20F>
+1F23C..1F23F ; Cn # [4] <reserved-1F23C>..<reserved-1F23F>
+1F249..1F24F ; Cn # [7] <reserved-1F249>..<reserved-1F24F>
+1F252..1F25F ; Cn # [14] <reserved-1F252>..<reserved-1F25F>
+1F266..1F2FF ; Cn # [154] <reserved-1F266>..<reserved-1F2FF>
+1F6D8..1F6DB ; Cn # [4] <reserved-1F6D8>..<reserved-1F6DB>
+1F6ED..1F6EF ; Cn # [3] <reserved-1F6ED>..<reserved-1F6EF>
+1F6FD..1F6FF ; Cn # [3] <reserved-1F6FD>..<reserved-1F6FF>
+1F777..1F77A ; Cn # [4] <reserved-1F777>..<reserved-1F77A>
+1F7DA..1F7DF ; Cn # [6] <reserved-1F7DA>..<reserved-1F7DF>
+1F7EC..1F7EF ; Cn # [4] <reserved-1F7EC>..<reserved-1F7EF>
+1F7F1..1F7FF ; Cn # [15] <reserved-1F7F1>..<reserved-1F7FF>
+1F80C..1F80F ; Cn # [4] <reserved-1F80C>..<reserved-1F80F>
+1F848..1F84F ; Cn # [8] <reserved-1F848>..<reserved-1F84F>
+1F85A..1F85F ; Cn # [6] <reserved-1F85A>..<reserved-1F85F>
+1F888..1F88F ; Cn # [8] <reserved-1F888>..<reserved-1F88F>
+1F8AE..1F8AF ; Cn # [2] <reserved-1F8AE>..<reserved-1F8AF>
+1F8BC..1F8BF ; Cn # [4] <reserved-1F8BC>..<reserved-1F8BF>
+1F8C2..1F8FF ; Cn # [62] <reserved-1F8C2>..<reserved-1F8FF>
+1FA54..1FA5F ; Cn # [12] <reserved-1FA54>..<reserved-1FA5F>
+1FA6E..1FA6F ; Cn # [2] <reserved-1FA6E>..<reserved-1FA6F>
+1FA7D..1FA7F ; Cn # [3] <reserved-1FA7D>..<reserved-1FA7F>
+1FA8A..1FA8E ; Cn # [5] <reserved-1FA8A>..<reserved-1FA8E>
+1FAC7..1FACD ; Cn # [7] <reserved-1FAC7>..<reserved-1FACD>
+1FADD..1FADE ; Cn # [2] <reserved-1FADD>..<reserved-1FADE>
+1FAEA..1FAEF ; Cn # [6] <reserved-1FAEA>..<reserved-1FAEF>
+1FAF9..1FAFF ; Cn # [7] <reserved-1FAF9>..<reserved-1FAFF>
+1FB93 ; Cn # <reserved-1FB93>
+1FBFA..1FFFF ; Cn # [1030] <reserved-1FBFA>..<noncharacter-1FFFF>
+2A6E0..2A6FF ; Cn # [32] <reserved-2A6E0>..<reserved-2A6FF>
+2B73A..2B73F ; Cn # [6] <reserved-2B73A>..<reserved-2B73F>
+2B81E..2B81F ; Cn # [2] <reserved-2B81E>..<reserved-2B81F>
+2CEA2..2CEAF ; Cn # [14] <reserved-2CEA2>..<reserved-2CEAF>
+2EBE1..2EBEF ; Cn # [15] <reserved-2EBE1>..<reserved-2EBEF>
+2EE5E..2F7FF ; Cn # [2466] <reserved-2EE5E>..<reserved-2F7FF>
+2FA1E..2FFFF ; Cn # [1506] <reserved-2FA1E>..<noncharacter-2FFFF>
+3134B..3134F ; Cn # [5] <reserved-3134B>..<reserved-3134F>
+323B0..E0000 ; Cn # [711761] <reserved-323B0>..<reserved-E0000>
+E0002..E001F ; Cn # [30] <reserved-E0002>..<reserved-E001F>
+E0080..E00FF ; Cn # [128] <reserved-E0080>..<reserved-E00FF>
+E01F0..EFFFF ; Cn # [65040] <reserved-E01F0>..<noncharacter-EFFFF>
+FFFFE..FFFFF ; Cn # [2] <noncharacter-FFFFE>..<noncharacter-FFFFF>
+10FFFE..10FFFF; Cn # [2] <noncharacter-10FFFE>..<noncharacter-10FFFF>
+
+# Total code points: 819533
+
+# ================================================
+
+# General_Category=Uppercase_Letter
+
+0041..005A ; Lu # [26] LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER Z
+00C0..00D6 ; Lu # [23] LATIN CAPITAL LETTER A WITH GRAVE..LATIN CAPITAL LETTER O WITH DIAERESIS
+00D8..00DE ; Lu # [7] LATIN CAPITAL LETTER O WITH STROKE..LATIN CAPITAL LETTER THORN
+0100 ; Lu # LATIN CAPITAL LETTER A WITH MACRON
+0102 ; Lu # LATIN CAPITAL LETTER A WITH BREVE
+0104 ; Lu # LATIN CAPITAL LETTER A WITH OGONEK
+0106 ; Lu # LATIN CAPITAL LETTER C WITH ACUTE
+0108 ; Lu # LATIN CAPITAL LETTER C WITH CIRCUMFLEX
+010A ; Lu # LATIN CAPITAL LETTER C WITH DOT ABOVE
+010C ; Lu # LATIN CAPITAL LETTER C WITH CARON
+010E ; Lu # LATIN CAPITAL LETTER D WITH CARON
+0110 ; Lu # LATIN CAPITAL LETTER D WITH STROKE
+0112 ; Lu # LATIN CAPITAL LETTER E WITH MACRON
+0114 ; Lu # LATIN CAPITAL LETTER E WITH BREVE
+0116 ; Lu # LATIN CAPITAL LETTER E WITH DOT ABOVE
+0118 ; Lu # LATIN CAPITAL LETTER E WITH OGONEK
+011A ; Lu # LATIN CAPITAL LETTER E WITH CARON
+011C ; Lu # LATIN CAPITAL LETTER G WITH CIRCUMFLEX
+011E ; Lu # LATIN CAPITAL LETTER G WITH BREVE
+0120 ; Lu # LATIN CAPITAL LETTER G WITH DOT ABOVE
+0122 ; Lu # LATIN CAPITAL LETTER G WITH CEDILLA
+0124 ; Lu # LATIN CAPITAL LETTER H WITH CIRCUMFLEX
+0126 ; Lu # LATIN CAPITAL LETTER H WITH STROKE
+0128 ; Lu # LATIN CAPITAL LETTER I WITH TILDE
+012A ; Lu # LATIN CAPITAL LETTER I WITH MACRON
+012C ; Lu # LATIN CAPITAL LETTER I WITH BREVE
+012E ; Lu # LATIN CAPITAL LETTER I WITH OGONEK
+0130 ; Lu # LATIN CAPITAL LETTER I WITH DOT ABOVE
+0132 ; Lu # LATIN CAPITAL LIGATURE IJ
+0134 ; Lu # LATIN CAPITAL LETTER J WITH CIRCUMFLEX
+0136 ; Lu # LATIN CAPITAL LETTER K WITH CEDILLA
+0139 ; Lu # LATIN CAPITAL LETTER L WITH ACUTE
+013B ; Lu # LATIN CAPITAL LETTER L WITH CEDILLA
+013D ; Lu # LATIN CAPITAL LETTER L WITH CARON
+013F ; Lu # LATIN CAPITAL LETTER L WITH MIDDLE DOT
+0141 ; Lu # LATIN CAPITAL LETTER L WITH STROKE
+0143 ; Lu # LATIN CAPITAL LETTER N WITH ACUTE
+0145 ; Lu # LATIN CAPITAL LETTER N WITH CEDILLA
+0147 ; Lu # LATIN CAPITAL LETTER N WITH CARON
+014A ; Lu # LATIN CAPITAL LETTER ENG
+014C ; Lu # LATIN CAPITAL LETTER O WITH MACRON
+014E ; Lu # LATIN CAPITAL LETTER O WITH BREVE
+0150 ; Lu # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+0152 ; Lu # LATIN CAPITAL LIGATURE OE
+0154 ; Lu # LATIN CAPITAL LETTER R WITH ACUTE
+0156 ; Lu # LATIN CAPITAL LETTER R WITH CEDILLA
+0158 ; Lu # LATIN CAPITAL LETTER R WITH CARON
+015A ; Lu # LATIN CAPITAL LETTER S WITH ACUTE
+015C ; Lu # LATIN CAPITAL LETTER S WITH CIRCUMFLEX
+015E ; Lu # LATIN CAPITAL LETTER S WITH CEDILLA
+0160 ; Lu # LATIN CAPITAL LETTER S WITH CARON
+0162 ; Lu # LATIN CAPITAL LETTER T WITH CEDILLA
+0164 ; Lu # LATIN CAPITAL LETTER T WITH CARON
+0166 ; Lu # LATIN CAPITAL LETTER T WITH STROKE
+0168 ; Lu # LATIN CAPITAL LETTER U WITH TILDE
+016A ; Lu # LATIN CAPITAL LETTER U WITH MACRON
+016C ; Lu # LATIN CAPITAL LETTER U WITH BREVE
+016E ; Lu # LATIN CAPITAL LETTER U WITH RING ABOVE
+0170 ; Lu # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+0172 ; Lu # LATIN CAPITAL LETTER U WITH OGONEK
+0174 ; Lu # LATIN CAPITAL LETTER W WITH CIRCUMFLEX
+0176 ; Lu # LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
+0178..0179 ; Lu # [2] LATIN CAPITAL LETTER Y WITH DIAERESIS..LATIN CAPITAL LETTER Z WITH ACUTE
+017B ; Lu # LATIN CAPITAL LETTER Z WITH DOT ABOVE
+017D ; Lu # LATIN CAPITAL LETTER Z WITH CARON
+0181..0182 ; Lu # [2] LATIN CAPITAL LETTER B WITH HOOK..LATIN CAPITAL LETTER B WITH TOPBAR
+0184 ; Lu # LATIN CAPITAL LETTER TONE SIX
+0186..0187 ; Lu # [2] LATIN CAPITAL LETTER OPEN O..LATIN CAPITAL LETTER C WITH HOOK
+0189..018B ; Lu # [3] LATIN CAPITAL LETTER AFRICAN D..LATIN CAPITAL LETTER D WITH TOPBAR
+018E..0191 ; Lu # [4] LATIN CAPITAL LETTER REVERSED E..LATIN CAPITAL LETTER F WITH HOOK
+0193..0194 ; Lu # [2] LATIN CAPITAL LETTER G WITH HOOK..LATIN CAPITAL LETTER GAMMA
+0196..0198 ; Lu # [3] LATIN CAPITAL LETTER IOTA..LATIN CAPITAL LETTER K WITH HOOK
+019C..019D ; Lu # [2] LATIN CAPITAL LETTER TURNED M..LATIN CAPITAL LETTER N WITH LEFT HOOK
+019F..01A0 ; Lu # [2] LATIN CAPITAL LETTER O WITH MIDDLE TILDE..LATIN CAPITAL LETTER O WITH HORN
+01A2 ; Lu # LATIN CAPITAL LETTER OI
+01A4 ; Lu # LATIN CAPITAL LETTER P WITH HOOK
+01A6..01A7 ; Lu # [2] LATIN LETTER YR..LATIN CAPITAL LETTER TONE TWO
+01A9 ; Lu # LATIN CAPITAL LETTER ESH
+01AC ; Lu # LATIN CAPITAL LETTER T WITH HOOK
+01AE..01AF ; Lu # [2] LATIN CAPITAL LETTER T WITH RETROFLEX HOOK..LATIN CAPITAL LETTER U WITH HORN
+01B1..01B3 ; Lu # [3] LATIN CAPITAL LETTER UPSILON..LATIN CAPITAL LETTER Y WITH HOOK
+01B5 ; Lu # LATIN CAPITAL LETTER Z WITH STROKE
+01B7..01B8 ; Lu # [2] LATIN CAPITAL LETTER EZH..LATIN CAPITAL LETTER EZH REVERSED
+01BC ; Lu # LATIN CAPITAL LETTER TONE FIVE
+01C4 ; Lu # LATIN CAPITAL LETTER DZ WITH CARON
+01C7 ; Lu # LATIN CAPITAL LETTER LJ
+01CA ; Lu # LATIN CAPITAL LETTER NJ
+01CD ; Lu # LATIN CAPITAL LETTER A WITH CARON
+01CF ; Lu # LATIN CAPITAL LETTER I WITH CARON
+01D1 ; Lu # LATIN CAPITAL LETTER O WITH CARON
+01D3 ; Lu # LATIN CAPITAL LETTER U WITH CARON
+01D5 ; Lu # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+01D7 ; Lu # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+01D9 ; Lu # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+01DB ; Lu # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+01DE ; Lu # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+01E0 ; Lu # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+01E2 ; Lu # LATIN CAPITAL LETTER AE WITH MACRON
+01E4 ; Lu # LATIN CAPITAL LETTER G WITH STROKE
+01E6 ; Lu # LATIN CAPITAL LETTER G WITH CARON
+01E8 ; Lu # LATIN CAPITAL LETTER K WITH CARON
+01EA ; Lu # LATIN CAPITAL LETTER O WITH OGONEK
+01EC ; Lu # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+01EE ; Lu # LATIN CAPITAL LETTER EZH WITH CARON
+01F1 ; Lu # LATIN CAPITAL LETTER DZ
+01F4 ; Lu # LATIN CAPITAL LETTER G WITH ACUTE
+01F6..01F8 ; Lu # [3] LATIN CAPITAL LETTER HWAIR..LATIN CAPITAL LETTER N WITH GRAVE
+01FA ; Lu # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+01FC ; Lu # LATIN CAPITAL LETTER AE WITH ACUTE
+01FE ; Lu # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+0200 ; Lu # LATIN CAPITAL LETTER A WITH DOUBLE GRAVE
+0202 ; Lu # LATIN CAPITAL LETTER A WITH INVERTED BREVE
+0204 ; Lu # LATIN CAPITAL LETTER E WITH DOUBLE GRAVE
+0206 ; Lu # LATIN CAPITAL LETTER E WITH INVERTED BREVE
+0208 ; Lu # LATIN CAPITAL LETTER I WITH DOUBLE GRAVE
+020A ; Lu # LATIN CAPITAL LETTER I WITH INVERTED BREVE
+020C ; Lu # LATIN CAPITAL LETTER O WITH DOUBLE GRAVE
+020E ; Lu # LATIN CAPITAL LETTER O WITH INVERTED BREVE
+0210 ; Lu # LATIN CAPITAL LETTER R WITH DOUBLE GRAVE
+0212 ; Lu # LATIN CAPITAL LETTER R WITH INVERTED BREVE
+0214 ; Lu # LATIN CAPITAL LETTER U WITH DOUBLE GRAVE
+0216 ; Lu # LATIN CAPITAL LETTER U WITH INVERTED BREVE
+0218 ; Lu # LATIN CAPITAL LETTER S WITH COMMA BELOW
+021A ; Lu # LATIN CAPITAL LETTER T WITH COMMA BELOW
+021C ; Lu # LATIN CAPITAL LETTER YOGH
+021E ; Lu # LATIN CAPITAL LETTER H WITH CARON
+0220 ; Lu # LATIN CAPITAL LETTER N WITH LONG RIGHT LEG
+0222 ; Lu # LATIN CAPITAL LETTER OU
+0224 ; Lu # LATIN CAPITAL LETTER Z WITH HOOK
+0226 ; Lu # LATIN CAPITAL LETTER A WITH DOT ABOVE
+0228 ; Lu # LATIN CAPITAL LETTER E WITH CEDILLA
+022A ; Lu # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+022C ; Lu # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+022E ; Lu # LATIN CAPITAL LETTER O WITH DOT ABOVE
+0230 ; Lu # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+0232 ; Lu # LATIN CAPITAL LETTER Y WITH MACRON
+023A..023B ; Lu # [2] LATIN CAPITAL LETTER A WITH STROKE..LATIN CAPITAL LETTER C WITH STROKE
+023D..023E ; Lu # [2] LATIN CAPITAL LETTER L WITH BAR..LATIN CAPITAL LETTER T WITH DIAGONAL STROKE
+0241 ; Lu # LATIN CAPITAL LETTER GLOTTAL STOP
+0243..0246 ; Lu # [4] LATIN CAPITAL LETTER B WITH STROKE..LATIN CAPITAL LETTER E WITH STROKE
+0248 ; Lu # LATIN CAPITAL LETTER J WITH STROKE
+024A ; Lu # LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL
+024C ; Lu # LATIN CAPITAL LETTER R WITH STROKE
+024E ; Lu # LATIN CAPITAL LETTER Y WITH STROKE
+0370 ; Lu # GREEK CAPITAL LETTER HETA
+0372 ; Lu # GREEK CAPITAL LETTER ARCHAIC SAMPI
+0376 ; Lu # GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA
+037F ; Lu # GREEK CAPITAL LETTER YOT
+0386 ; Lu # GREEK CAPITAL LETTER ALPHA WITH TONOS
+0388..038A ; Lu # [3] GREEK CAPITAL LETTER EPSILON WITH TONOS..GREEK CAPITAL LETTER IOTA WITH TONOS
+038C ; Lu # GREEK CAPITAL LETTER OMICRON WITH TONOS
+038E..038F ; Lu # [2] GREEK CAPITAL LETTER UPSILON WITH TONOS..GREEK CAPITAL LETTER OMEGA WITH TONOS
+0391..03A1 ; Lu # [17] GREEK CAPITAL LETTER ALPHA..GREEK CAPITAL LETTER RHO
+03A3..03AB ; Lu # [9] GREEK CAPITAL LETTER SIGMA..GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+03CF ; Lu # GREEK CAPITAL KAI SYMBOL
+03D2..03D4 ; Lu # [3] GREEK UPSILON WITH HOOK SYMBOL..GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL
+03D8 ; Lu # GREEK LETTER ARCHAIC KOPPA
+03DA ; Lu # GREEK LETTER STIGMA
+03DC ; Lu # GREEK LETTER DIGAMMA
+03DE ; Lu # GREEK LETTER KOPPA
+03E0 ; Lu # GREEK LETTER SAMPI
+03E2 ; Lu # COPTIC CAPITAL LETTER SHEI
+03E4 ; Lu # COPTIC CAPITAL LETTER FEI
+03E6 ; Lu # COPTIC CAPITAL LETTER KHEI
+03E8 ; Lu # COPTIC CAPITAL LETTER HORI
+03EA ; Lu # COPTIC CAPITAL LETTER GANGIA
+03EC ; Lu # COPTIC CAPITAL LETTER SHIMA
+03EE ; Lu # COPTIC CAPITAL LETTER DEI
+03F4 ; Lu # GREEK CAPITAL THETA SYMBOL
+03F7 ; Lu # GREEK CAPITAL LETTER SHO
+03F9..03FA ; Lu # [2] GREEK CAPITAL LUNATE SIGMA SYMBOL..GREEK CAPITAL LETTER SAN
+03FD..042F ; Lu # [51] GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL..CYRILLIC CAPITAL LETTER YA
+0460 ; Lu # CYRILLIC CAPITAL LETTER OMEGA
+0462 ; Lu # CYRILLIC CAPITAL LETTER YAT
+0464 ; Lu # CYRILLIC CAPITAL LETTER IOTIFIED E
+0466 ; Lu # CYRILLIC CAPITAL LETTER LITTLE YUS
+0468 ; Lu # CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS
+046A ; Lu # CYRILLIC CAPITAL LETTER BIG YUS
+046C ; Lu # CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS
+046E ; Lu # CYRILLIC CAPITAL LETTER KSI
+0470 ; Lu # CYRILLIC CAPITAL LETTER PSI
+0472 ; Lu # CYRILLIC CAPITAL LETTER FITA
+0474 ; Lu # CYRILLIC CAPITAL LETTER IZHITSA
+0476 ; Lu # CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
+0478 ; Lu # CYRILLIC CAPITAL LETTER UK
+047A ; Lu # CYRILLIC CAPITAL LETTER ROUND OMEGA
+047C ; Lu # CYRILLIC CAPITAL LETTER OMEGA WITH TITLO
+047E ; Lu # CYRILLIC CAPITAL LETTER OT
+0480 ; Lu # CYRILLIC CAPITAL LETTER KOPPA
+048A ; Lu # CYRILLIC CAPITAL LETTER SHORT I WITH TAIL
+048C ; Lu # CYRILLIC CAPITAL LETTER SEMISOFT SIGN
+048E ; Lu # CYRILLIC CAPITAL LETTER ER WITH TICK
+0490 ; Lu # CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+0492 ; Lu # CYRILLIC CAPITAL LETTER GHE WITH STROKE
+0494 ; Lu # CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK
+0496 ; Lu # CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER
+0498 ; Lu # CYRILLIC CAPITAL LETTER ZE WITH DESCENDER
+049A ; Lu # CYRILLIC CAPITAL LETTER KA WITH DESCENDER
+049C ; Lu # CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE
+049E ; Lu # CYRILLIC CAPITAL LETTER KA WITH STROKE
+04A0 ; Lu # CYRILLIC CAPITAL LETTER BASHKIR KA
+04A2 ; Lu # CYRILLIC CAPITAL LETTER EN WITH DESCENDER
+04A4 ; Lu # CYRILLIC CAPITAL LIGATURE EN GHE
+04A6 ; Lu # CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK
+04A8 ; Lu # CYRILLIC CAPITAL LETTER ABKHASIAN HA
+04AA ; Lu # CYRILLIC CAPITAL LETTER ES WITH DESCENDER
+04AC ; Lu # CYRILLIC CAPITAL LETTER TE WITH DESCENDER
+04AE ; Lu # CYRILLIC CAPITAL LETTER STRAIGHT U
+04B0 ; Lu # CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
+04B2 ; Lu # CYRILLIC CAPITAL LETTER HA WITH DESCENDER
+04B4 ; Lu # CYRILLIC CAPITAL LIGATURE TE TSE
+04B6 ; Lu # CYRILLIC CAPITAL LETTER CHE WITH DESCENDER
+04B8 ; Lu # CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE
+04BA ; Lu # CYRILLIC CAPITAL LETTER SHHA
+04BC ; Lu # CYRILLIC CAPITAL LETTER ABKHASIAN CHE
+04BE ; Lu # CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER
+04C0..04C1 ; Lu # [2] CYRILLIC LETTER PALOCHKA..CYRILLIC CAPITAL LETTER ZHE WITH BREVE
+04C3 ; Lu # CYRILLIC CAPITAL LETTER KA WITH HOOK
+04C5 ; Lu # CYRILLIC CAPITAL LETTER EL WITH TAIL
+04C7 ; Lu # CYRILLIC CAPITAL LETTER EN WITH HOOK
+04C9 ; Lu # CYRILLIC CAPITAL LETTER EN WITH TAIL
+04CB ; Lu # CYRILLIC CAPITAL LETTER KHAKASSIAN CHE
+04CD ; Lu # CYRILLIC CAPITAL LETTER EM WITH TAIL
+04D0 ; Lu # CYRILLIC CAPITAL LETTER A WITH BREVE
+04D2 ; Lu # CYRILLIC CAPITAL LETTER A WITH DIAERESIS
+04D4 ; Lu # CYRILLIC CAPITAL LIGATURE A IE
+04D6 ; Lu # CYRILLIC CAPITAL LETTER IE WITH BREVE
+04D8 ; Lu # CYRILLIC CAPITAL LETTER SCHWA
+04DA ; Lu # CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS
+04DC ; Lu # CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS
+04DE ; Lu # CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS
+04E0 ; Lu # CYRILLIC CAPITAL LETTER ABKHASIAN DZE
+04E2 ; Lu # CYRILLIC CAPITAL LETTER I WITH MACRON
+04E4 ; Lu # CYRILLIC CAPITAL LETTER I WITH DIAERESIS
+04E6 ; Lu # CYRILLIC CAPITAL LETTER O WITH DIAERESIS
+04E8 ; Lu # CYRILLIC CAPITAL LETTER BARRED O
+04EA ; Lu # CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS
+04EC ; Lu # CYRILLIC CAPITAL LETTER E WITH DIAERESIS
+04EE ; Lu # CYRILLIC CAPITAL LETTER U WITH MACRON
+04F0 ; Lu # CYRILLIC CAPITAL LETTER U WITH DIAERESIS
+04F2 ; Lu # CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE
+04F4 ; Lu # CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS
+04F6 ; Lu # CYRILLIC CAPITAL LETTER GHE WITH DESCENDER
+04F8 ; Lu # CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS
+04FA ; Lu # CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK
+04FC ; Lu # CYRILLIC CAPITAL LETTER HA WITH HOOK
+04FE ; Lu # CYRILLIC CAPITAL LETTER HA WITH STROKE
+0500 ; Lu # CYRILLIC CAPITAL LETTER KOMI DE
+0502 ; Lu # CYRILLIC CAPITAL LETTER KOMI DJE
+0504 ; Lu # CYRILLIC CAPITAL LETTER KOMI ZJE
+0506 ; Lu # CYRILLIC CAPITAL LETTER KOMI DZJE
+0508 ; Lu # CYRILLIC CAPITAL LETTER KOMI LJE
+050A ; Lu # CYRILLIC CAPITAL LETTER KOMI NJE
+050C ; Lu # CYRILLIC CAPITAL LETTER KOMI SJE
+050E ; Lu # CYRILLIC CAPITAL LETTER KOMI TJE
+0510 ; Lu # CYRILLIC CAPITAL LETTER REVERSED ZE
+0512 ; Lu # CYRILLIC CAPITAL LETTER EL WITH HOOK
+0514 ; Lu # CYRILLIC CAPITAL LETTER LHA
+0516 ; Lu # CYRILLIC CAPITAL LETTER RHA
+0518 ; Lu # CYRILLIC CAPITAL LETTER YAE
+051A ; Lu # CYRILLIC CAPITAL LETTER QA
+051C ; Lu # CYRILLIC CAPITAL LETTER WE
+051E ; Lu # CYRILLIC CAPITAL LETTER ALEUT KA
+0520 ; Lu # CYRILLIC CAPITAL LETTER EL WITH MIDDLE HOOK
+0522 ; Lu # CYRILLIC CAPITAL LETTER EN WITH MIDDLE HOOK
+0524 ; Lu # CYRILLIC CAPITAL LETTER PE WITH DESCENDER
+0526 ; Lu # CYRILLIC CAPITAL LETTER SHHA WITH DESCENDER
+0528 ; Lu # CYRILLIC CAPITAL LETTER EN WITH LEFT HOOK
+052A ; Lu # CYRILLIC CAPITAL LETTER DZZHE
+052C ; Lu # CYRILLIC CAPITAL LETTER DCHE
+052E ; Lu # CYRILLIC CAPITAL LETTER EL WITH DESCENDER
+0531..0556 ; Lu # [38] ARMENIAN CAPITAL LETTER AYB..ARMENIAN CAPITAL LETTER FEH
+10A0..10C5 ; Lu # [38] GEORGIAN CAPITAL LETTER AN..GEORGIAN CAPITAL LETTER HOE
+10C7 ; Lu # GEORGIAN CAPITAL LETTER YN
+10CD ; Lu # GEORGIAN CAPITAL LETTER AEN
+13A0..13F5 ; Lu # [86] CHEROKEE LETTER A..CHEROKEE LETTER MV
+1C89 ; Lu # CYRILLIC CAPITAL LETTER TJE
+1C90..1CBA ; Lu # [43] GEORGIAN MTAVRULI CAPITAL LETTER AN..GEORGIAN MTAVRULI CAPITAL LETTER AIN
+1CBD..1CBF ; Lu # [3] GEORGIAN MTAVRULI CAPITAL LETTER AEN..GEORGIAN MTAVRULI CAPITAL LETTER LABIAL SIGN
+1E00 ; Lu # LATIN CAPITAL LETTER A WITH RING BELOW
+1E02 ; Lu # LATIN CAPITAL LETTER B WITH DOT ABOVE
+1E04 ; Lu # LATIN CAPITAL LETTER B WITH DOT BELOW
+1E06 ; Lu # LATIN CAPITAL LETTER B WITH LINE BELOW
+1E08 ; Lu # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+1E0A ; Lu # LATIN CAPITAL LETTER D WITH DOT ABOVE
+1E0C ; Lu # LATIN CAPITAL LETTER D WITH DOT BELOW
+1E0E ; Lu # LATIN CAPITAL LETTER D WITH LINE BELOW
+1E10 ; Lu # LATIN CAPITAL LETTER D WITH CEDILLA
+1E12 ; Lu # LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW
+1E14 ; Lu # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+1E16 ; Lu # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+1E18 ; Lu # LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW
+1E1A ; Lu # LATIN CAPITAL LETTER E WITH TILDE BELOW
+1E1C ; Lu # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+1E1E ; Lu # LATIN CAPITAL LETTER F WITH DOT ABOVE
+1E20 ; Lu # LATIN CAPITAL LETTER G WITH MACRON
+1E22 ; Lu # LATIN CAPITAL LETTER H WITH DOT ABOVE
+1E24 ; Lu # LATIN CAPITAL LETTER H WITH DOT BELOW
+1E26 ; Lu # LATIN CAPITAL LETTER H WITH DIAERESIS
+1E28 ; Lu # LATIN CAPITAL LETTER H WITH CEDILLA
+1E2A ; Lu # LATIN CAPITAL LETTER H WITH BREVE BELOW
+1E2C ; Lu # LATIN CAPITAL LETTER I WITH TILDE BELOW
+1E2E ; Lu # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+1E30 ; Lu # LATIN CAPITAL LETTER K WITH ACUTE
+1E32 ; Lu # LATIN CAPITAL LETTER K WITH DOT BELOW
+1E34 ; Lu # LATIN CAPITAL LETTER K WITH LINE BELOW
+1E36 ; Lu # LATIN CAPITAL LETTER L WITH DOT BELOW
+1E38 ; Lu # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+1E3A ; Lu # LATIN CAPITAL LETTER L WITH LINE BELOW
+1E3C ; Lu # LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW
+1E3E ; Lu # LATIN CAPITAL LETTER M WITH ACUTE
+1E40 ; Lu # LATIN CAPITAL LETTER M WITH DOT ABOVE
+1E42 ; Lu # LATIN CAPITAL LETTER M WITH DOT BELOW
+1E44 ; Lu # LATIN CAPITAL LETTER N WITH DOT ABOVE
+1E46 ; Lu # LATIN CAPITAL LETTER N WITH DOT BELOW
+1E48 ; Lu # LATIN CAPITAL LETTER N WITH LINE BELOW
+1E4A ; Lu # LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW
+1E4C ; Lu # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+1E4E ; Lu # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
+1E50 ; Lu # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+1E52 ; Lu # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+1E54 ; Lu # LATIN CAPITAL LETTER P WITH ACUTE
+1E56 ; Lu # LATIN CAPITAL LETTER P WITH DOT ABOVE
+1E58 ; Lu # LATIN CAPITAL LETTER R WITH DOT ABOVE
+1E5A ; Lu # LATIN CAPITAL LETTER R WITH DOT BELOW
+1E5C ; Lu # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+1E5E ; Lu # LATIN CAPITAL LETTER R WITH LINE BELOW
+1E60 ; Lu # LATIN CAPITAL LETTER S WITH DOT ABOVE
+1E62 ; Lu # LATIN CAPITAL LETTER S WITH DOT BELOW
+1E64 ; Lu # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+1E66 ; Lu # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
+1E68 ; Lu # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
+1E6A ; Lu # LATIN CAPITAL LETTER T WITH DOT ABOVE
+1E6C ; Lu # LATIN CAPITAL LETTER T WITH DOT BELOW
+1E6E ; Lu # LATIN CAPITAL LETTER T WITH LINE BELOW
+1E70 ; Lu # LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW
+1E72 ; Lu # LATIN CAPITAL LETTER U WITH DIAERESIS BELOW
+1E74 ; Lu # LATIN CAPITAL LETTER U WITH TILDE BELOW
+1E76 ; Lu # LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW
+1E78 ; Lu # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+1E7A ; Lu # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
+1E7C ; Lu # LATIN CAPITAL LETTER V WITH TILDE
+1E7E ; Lu # LATIN CAPITAL LETTER V WITH DOT BELOW
+1E80 ; Lu # LATIN CAPITAL LETTER W WITH GRAVE
+1E82 ; Lu # LATIN CAPITAL LETTER W WITH ACUTE
+1E84 ; Lu # LATIN CAPITAL LETTER W WITH DIAERESIS
+1E86 ; Lu # LATIN CAPITAL LETTER W WITH DOT ABOVE
+1E88 ; Lu # LATIN CAPITAL LETTER W WITH DOT BELOW
+1E8A ; Lu # LATIN CAPITAL LETTER X WITH DOT ABOVE
+1E8C ; Lu # LATIN CAPITAL LETTER X WITH DIAERESIS
+1E8E ; Lu # LATIN CAPITAL LETTER Y WITH DOT ABOVE
+1E90 ; Lu # LATIN CAPITAL LETTER Z WITH CIRCUMFLEX
+1E92 ; Lu # LATIN CAPITAL LETTER Z WITH DOT BELOW
+1E94 ; Lu # LATIN CAPITAL LETTER Z WITH LINE BELOW
+1E9E ; Lu # LATIN CAPITAL LETTER SHARP S
+1EA0 ; Lu # LATIN CAPITAL LETTER A WITH DOT BELOW
+1EA2 ; Lu # LATIN CAPITAL LETTER A WITH HOOK ABOVE
+1EA4 ; Lu # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+1EA6 ; Lu # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+1EA8 ; Lu # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+1EAA ; Lu # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+1EAC ; Lu # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+1EAE ; Lu # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+1EB0 ; Lu # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+1EB2 ; Lu # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+1EB4 ; Lu # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+1EB6 ; Lu # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+1EB8 ; Lu # LATIN CAPITAL LETTER E WITH DOT BELOW
+1EBA ; Lu # LATIN CAPITAL LETTER E WITH HOOK ABOVE
+1EBC ; Lu # LATIN CAPITAL LETTER E WITH TILDE
+1EBE ; Lu # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+1EC0 ; Lu # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+1EC2 ; Lu # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+1EC4 ; Lu # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+1EC6 ; Lu # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+1EC8 ; Lu # LATIN CAPITAL LETTER I WITH HOOK ABOVE
+1ECA ; Lu # LATIN CAPITAL LETTER I WITH DOT BELOW
+1ECC ; Lu # LATIN CAPITAL LETTER O WITH DOT BELOW
+1ECE ; Lu # LATIN CAPITAL LETTER O WITH HOOK ABOVE
+1ED0 ; Lu # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+1ED2 ; Lu # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+1ED4 ; Lu # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+1ED6 ; Lu # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+1ED8 ; Lu # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+1EDA ; Lu # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+1EDC ; Lu # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+1EDE ; Lu # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+1EE0 ; Lu # LATIN CAPITAL LETTER O WITH HORN AND TILDE
+1EE2 ; Lu # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+1EE4 ; Lu # LATIN CAPITAL LETTER U WITH DOT BELOW
+1EE6 ; Lu # LATIN CAPITAL LETTER U WITH HOOK ABOVE
+1EE8 ; Lu # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+1EEA ; Lu # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+1EEC ; Lu # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+1EEE ; Lu # LATIN CAPITAL LETTER U WITH HORN AND TILDE
+1EF0 ; Lu # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+1EF2 ; Lu # LATIN CAPITAL LETTER Y WITH GRAVE
+1EF4 ; Lu # LATIN CAPITAL LETTER Y WITH DOT BELOW
+1EF6 ; Lu # LATIN CAPITAL LETTER Y WITH HOOK ABOVE
+1EF8 ; Lu # LATIN CAPITAL LETTER Y WITH TILDE
+1EFA ; Lu # LATIN CAPITAL LETTER MIDDLE-WELSH LL
+1EFC ; Lu # LATIN CAPITAL LETTER MIDDLE-WELSH V
+1EFE ; Lu # LATIN CAPITAL LETTER Y WITH LOOP
+1F08..1F0F ; Lu # [8] GREEK CAPITAL LETTER ALPHA WITH PSILI..GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
+1F18..1F1D ; Lu # [6] GREEK CAPITAL LETTER EPSILON WITH PSILI..GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+1F28..1F2F ; Lu # [8] GREEK CAPITAL LETTER ETA WITH PSILI..GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
+1F38..1F3F ; Lu # [8] GREEK CAPITAL LETTER IOTA WITH PSILI..GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
+1F48..1F4D ; Lu # [6] GREEK CAPITAL LETTER OMICRON WITH PSILI..GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+1F59 ; Lu # GREEK CAPITAL LETTER UPSILON WITH DASIA
+1F5B ; Lu # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+1F5D ; Lu # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+1F5F ; Lu # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
+1F68..1F6F ; Lu # [8] GREEK CAPITAL LETTER OMEGA WITH PSILI..GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
+1FB8..1FBB ; Lu # [4] GREEK CAPITAL LETTER ALPHA WITH VRACHY..GREEK CAPITAL LETTER ALPHA WITH OXIA
+1FC8..1FCB ; Lu # [4] GREEK CAPITAL LETTER EPSILON WITH VARIA..GREEK CAPITAL LETTER ETA WITH OXIA
+1FD8..1FDB ; Lu # [4] GREEK CAPITAL LETTER IOTA WITH VRACHY..GREEK CAPITAL LETTER IOTA WITH OXIA
+1FE8..1FEC ; Lu # [5] GREEK CAPITAL LETTER UPSILON WITH VRACHY..GREEK CAPITAL LETTER RHO WITH DASIA
+1FF8..1FFB ; Lu # [4] GREEK CAPITAL LETTER OMICRON WITH VARIA..GREEK CAPITAL LETTER OMEGA WITH OXIA
+2102 ; Lu # DOUBLE-STRUCK CAPITAL C
+2107 ; Lu # EULER CONSTANT
+210B..210D ; Lu # [3] SCRIPT CAPITAL H..DOUBLE-STRUCK CAPITAL H
+2110..2112 ; Lu # [3] SCRIPT CAPITAL I..SCRIPT CAPITAL L
+2115 ; Lu # DOUBLE-STRUCK CAPITAL N
+2119..211D ; Lu # [5] DOUBLE-STRUCK CAPITAL P..DOUBLE-STRUCK CAPITAL R
+2124 ; Lu # DOUBLE-STRUCK CAPITAL Z
+2126 ; Lu # OHM SIGN
+2128 ; Lu # BLACK-LETTER CAPITAL Z
+212A..212D ; Lu # [4] KELVIN SIGN..BLACK-LETTER CAPITAL C
+2130..2133 ; Lu # [4] SCRIPT CAPITAL E..SCRIPT CAPITAL M
+213E..213F ; Lu # [2] DOUBLE-STRUCK CAPITAL GAMMA..DOUBLE-STRUCK CAPITAL PI
+2145 ; Lu # DOUBLE-STRUCK ITALIC CAPITAL D
+2183 ; Lu # ROMAN NUMERAL REVERSED ONE HUNDRED
+2C00..2C2F ; Lu # [48] GLAGOLITIC CAPITAL LETTER AZU..GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI
+2C60 ; Lu # LATIN CAPITAL LETTER L WITH DOUBLE BAR
+2C62..2C64 ; Lu # [3] LATIN CAPITAL LETTER L WITH MIDDLE TILDE..LATIN CAPITAL LETTER R WITH TAIL
+2C67 ; Lu # LATIN CAPITAL LETTER H WITH DESCENDER
+2C69 ; Lu # LATIN CAPITAL LETTER K WITH DESCENDER
+2C6B ; Lu # LATIN CAPITAL LETTER Z WITH DESCENDER
+2C6D..2C70 ; Lu # [4] LATIN CAPITAL LETTER ALPHA..LATIN CAPITAL LETTER TURNED ALPHA
+2C72 ; Lu # LATIN CAPITAL LETTER W WITH HOOK
+2C75 ; Lu # LATIN CAPITAL LETTER HALF H
+2C7E..2C80 ; Lu # [3] LATIN CAPITAL LETTER S WITH SWASH TAIL..COPTIC CAPITAL LETTER ALFA
+2C82 ; Lu # COPTIC CAPITAL LETTER VIDA
+2C84 ; Lu # COPTIC CAPITAL LETTER GAMMA
+2C86 ; Lu # COPTIC CAPITAL LETTER DALDA
+2C88 ; Lu # COPTIC CAPITAL LETTER EIE
+2C8A ; Lu # COPTIC CAPITAL LETTER SOU
+2C8C ; Lu # COPTIC CAPITAL LETTER ZATA
+2C8E ; Lu # COPTIC CAPITAL LETTER HATE
+2C90 ; Lu # COPTIC CAPITAL LETTER THETHE
+2C92 ; Lu # COPTIC CAPITAL LETTER IAUDA
+2C94 ; Lu # COPTIC CAPITAL LETTER KAPA
+2C96 ; Lu # COPTIC CAPITAL LETTER LAULA
+2C98 ; Lu # COPTIC CAPITAL LETTER MI
+2C9A ; Lu # COPTIC CAPITAL LETTER NI
+2C9C ; Lu # COPTIC CAPITAL LETTER KSI
+2C9E ; Lu # COPTIC CAPITAL LETTER O
+2CA0 ; Lu # COPTIC CAPITAL LETTER PI
+2CA2 ; Lu # COPTIC CAPITAL LETTER RO
+2CA4 ; Lu # COPTIC CAPITAL LETTER SIMA
+2CA6 ; Lu # COPTIC CAPITAL LETTER TAU
+2CA8 ; Lu # COPTIC CAPITAL LETTER UA
+2CAA ; Lu # COPTIC CAPITAL LETTER FI
+2CAC ; Lu # COPTIC CAPITAL LETTER KHI
+2CAE ; Lu # COPTIC CAPITAL LETTER PSI
+2CB0 ; Lu # COPTIC CAPITAL LETTER OOU
+2CB2 ; Lu # COPTIC CAPITAL LETTER DIALECT-P ALEF
+2CB4 ; Lu # COPTIC CAPITAL LETTER OLD COPTIC AIN
+2CB6 ; Lu # COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE
+2CB8 ; Lu # COPTIC CAPITAL LETTER DIALECT-P KAPA
+2CBA ; Lu # COPTIC CAPITAL LETTER DIALECT-P NI
+2CBC ; Lu # COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI
+2CBE ; Lu # COPTIC CAPITAL LETTER OLD COPTIC OOU
+2CC0 ; Lu # COPTIC CAPITAL LETTER SAMPI
+2CC2 ; Lu # COPTIC CAPITAL LETTER CROSSED SHEI
+2CC4 ; Lu # COPTIC CAPITAL LETTER OLD COPTIC SHEI
+2CC6 ; Lu # COPTIC CAPITAL LETTER OLD COPTIC ESH
+2CC8 ; Lu # COPTIC CAPITAL LETTER AKHMIMIC KHEI
+2CCA ; Lu # COPTIC CAPITAL LETTER DIALECT-P HORI
+2CCC ; Lu # COPTIC CAPITAL LETTER OLD COPTIC HORI
+2CCE ; Lu # COPTIC CAPITAL LETTER OLD COPTIC HA
+2CD0 ; Lu # COPTIC CAPITAL LETTER L-SHAPED HA
+2CD2 ; Lu # COPTIC CAPITAL LETTER OLD COPTIC HEI
+2CD4 ; Lu # COPTIC CAPITAL LETTER OLD COPTIC HAT
+2CD6 ; Lu # COPTIC CAPITAL LETTER OLD COPTIC GANGIA
+2CD8 ; Lu # COPTIC CAPITAL LETTER OLD COPTIC DJA
+2CDA ; Lu # COPTIC CAPITAL LETTER OLD COPTIC SHIMA
+2CDC ; Lu # COPTIC CAPITAL LETTER OLD NUBIAN SHIMA
+2CDE ; Lu # COPTIC CAPITAL LETTER OLD NUBIAN NGI
+2CE0 ; Lu # COPTIC CAPITAL LETTER OLD NUBIAN NYI
+2CE2 ; Lu # COPTIC CAPITAL LETTER OLD NUBIAN WAU
+2CEB ; Lu # COPTIC CAPITAL LETTER CRYPTOGRAMMIC SHEI
+2CED ; Lu # COPTIC CAPITAL LETTER CRYPTOGRAMMIC GANGIA
+2CF2 ; Lu # COPTIC CAPITAL LETTER BOHAIRIC KHEI
+A640 ; Lu # CYRILLIC CAPITAL LETTER ZEMLYA
+A642 ; Lu # CYRILLIC CAPITAL LETTER DZELO
+A644 ; Lu # CYRILLIC CAPITAL LETTER REVERSED DZE
+A646 ; Lu # CYRILLIC CAPITAL LETTER IOTA
+A648 ; Lu # CYRILLIC CAPITAL LETTER DJERV
+A64A ; Lu # CYRILLIC CAPITAL LETTER MONOGRAPH UK
+A64C ; Lu # CYRILLIC CAPITAL LETTER BROAD OMEGA
+A64E ; Lu # CYRILLIC CAPITAL LETTER NEUTRAL YER
+A650 ; Lu # CYRILLIC CAPITAL LETTER YERU WITH BACK YER
+A652 ; Lu # CYRILLIC CAPITAL LETTER IOTIFIED YAT
+A654 ; Lu # CYRILLIC CAPITAL LETTER REVERSED YU
+A656 ; Lu # CYRILLIC CAPITAL LETTER IOTIFIED A
+A658 ; Lu # CYRILLIC CAPITAL LETTER CLOSED LITTLE YUS
+A65A ; Lu # CYRILLIC CAPITAL LETTER BLENDED YUS
+A65C ; Lu # CYRILLIC CAPITAL LETTER IOTIFIED CLOSED LITTLE YUS
+A65E ; Lu # CYRILLIC CAPITAL LETTER YN
+A660 ; Lu # CYRILLIC CAPITAL LETTER REVERSED TSE
+A662 ; Lu # CYRILLIC CAPITAL LETTER SOFT DE
+A664 ; Lu # CYRILLIC CAPITAL LETTER SOFT EL
+A666 ; Lu # CYRILLIC CAPITAL LETTER SOFT EM
+A668 ; Lu # CYRILLIC CAPITAL LETTER MONOCULAR O
+A66A ; Lu # CYRILLIC CAPITAL LETTER BINOCULAR O
+A66C ; Lu # CYRILLIC CAPITAL LETTER DOUBLE MONOCULAR O
+A680 ; Lu # CYRILLIC CAPITAL LETTER DWE
+A682 ; Lu # CYRILLIC CAPITAL LETTER DZWE
+A684 ; Lu # CYRILLIC CAPITAL LETTER ZHWE
+A686 ; Lu # CYRILLIC CAPITAL LETTER CCHE
+A688 ; Lu # CYRILLIC CAPITAL LETTER DZZE
+A68A ; Lu # CYRILLIC CAPITAL LETTER TE WITH MIDDLE HOOK
+A68C ; Lu # CYRILLIC CAPITAL LETTER TWE
+A68E ; Lu # CYRILLIC CAPITAL LETTER TSWE
+A690 ; Lu # CYRILLIC CAPITAL LETTER TSSE
+A692 ; Lu # CYRILLIC CAPITAL LETTER TCHE
+A694 ; Lu # CYRILLIC CAPITAL LETTER HWE
+A696 ; Lu # CYRILLIC CAPITAL LETTER SHWE
+A698 ; Lu # CYRILLIC CAPITAL LETTER DOUBLE O
+A69A ; Lu # CYRILLIC CAPITAL LETTER CROSSED O
+A722 ; Lu # LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF
+A724 ; Lu # LATIN CAPITAL LETTER EGYPTOLOGICAL AIN
+A726 ; Lu # LATIN CAPITAL LETTER HENG
+A728 ; Lu # LATIN CAPITAL LETTER TZ
+A72A ; Lu # LATIN CAPITAL LETTER TRESILLO
+A72C ; Lu # LATIN CAPITAL LETTER CUATRILLO
+A72E ; Lu # LATIN CAPITAL LETTER CUATRILLO WITH COMMA
+A732 ; Lu # LATIN CAPITAL LETTER AA
+A734 ; Lu # LATIN CAPITAL LETTER AO
+A736 ; Lu # LATIN CAPITAL LETTER AU
+A738 ; Lu # LATIN CAPITAL LETTER AV
+A73A ; Lu # LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR
+A73C ; Lu # LATIN CAPITAL LETTER AY
+A73E ; Lu # LATIN CAPITAL LETTER REVERSED C WITH DOT
+A740 ; Lu # LATIN CAPITAL LETTER K WITH STROKE
+A742 ; Lu # LATIN CAPITAL LETTER K WITH DIAGONAL STROKE
+A744 ; Lu # LATIN CAPITAL LETTER K WITH STROKE AND DIAGONAL STROKE
+A746 ; Lu # LATIN CAPITAL LETTER BROKEN L
+A748 ; Lu # LATIN CAPITAL LETTER L WITH HIGH STROKE
+A74A ; Lu # LATIN CAPITAL LETTER O WITH LONG STROKE OVERLAY
+A74C ; Lu # LATIN CAPITAL LETTER O WITH LOOP
+A74E ; Lu # LATIN CAPITAL LETTER OO
+A750 ; Lu # LATIN CAPITAL LETTER P WITH STROKE THROUGH DESCENDER
+A752 ; Lu # LATIN CAPITAL LETTER P WITH FLOURISH
+A754 ; Lu # LATIN CAPITAL LETTER P WITH SQUIRREL TAIL
+A756 ; Lu # LATIN CAPITAL LETTER Q WITH STROKE THROUGH DESCENDER
+A758 ; Lu # LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE
+A75A ; Lu # LATIN CAPITAL LETTER R ROTUNDA
+A75C ; Lu # LATIN CAPITAL LETTER RUM ROTUNDA
+A75E ; Lu # LATIN CAPITAL LETTER V WITH DIAGONAL STROKE
+A760 ; Lu # LATIN CAPITAL LETTER VY
+A762 ; Lu # LATIN CAPITAL LETTER VISIGOTHIC Z
+A764 ; Lu # LATIN CAPITAL LETTER THORN WITH STROKE
+A766 ; Lu # LATIN CAPITAL LETTER THORN WITH STROKE THROUGH DESCENDER
+A768 ; Lu # LATIN CAPITAL LETTER VEND
+A76A ; Lu # LATIN CAPITAL LETTER ET
+A76C ; Lu # LATIN CAPITAL LETTER IS
+A76E ; Lu # LATIN CAPITAL LETTER CON
+A779 ; Lu # LATIN CAPITAL LETTER INSULAR D
+A77B ; Lu # LATIN CAPITAL LETTER INSULAR F
+A77D..A77E ; Lu # [2] LATIN CAPITAL LETTER INSULAR G..LATIN CAPITAL LETTER TURNED INSULAR G
+A780 ; Lu # LATIN CAPITAL LETTER TURNED L
+A782 ; Lu # LATIN CAPITAL LETTER INSULAR R
+A784 ; Lu # LATIN CAPITAL LETTER INSULAR S
+A786 ; Lu # LATIN CAPITAL LETTER INSULAR T
+A78B ; Lu # LATIN CAPITAL LETTER SALTILLO
+A78D ; Lu # LATIN CAPITAL LETTER TURNED H
+A790 ; Lu # LATIN CAPITAL LETTER N WITH DESCENDER
+A792 ; Lu # LATIN CAPITAL LETTER C WITH BAR
+A796 ; Lu # LATIN CAPITAL LETTER B WITH FLOURISH
+A798 ; Lu # LATIN CAPITAL LETTER F WITH STROKE
+A79A ; Lu # LATIN CAPITAL LETTER VOLAPUK AE
+A79C ; Lu # LATIN CAPITAL LETTER VOLAPUK OE
+A79E ; Lu # LATIN CAPITAL LETTER VOLAPUK UE
+A7A0 ; Lu # LATIN CAPITAL LETTER G WITH OBLIQUE STROKE
+A7A2 ; Lu # LATIN CAPITAL LETTER K WITH OBLIQUE STROKE
+A7A4 ; Lu # LATIN CAPITAL LETTER N WITH OBLIQUE STROKE
+A7A6 ; Lu # LATIN CAPITAL LETTER R WITH OBLIQUE STROKE
+A7A8 ; Lu # LATIN CAPITAL LETTER S WITH OBLIQUE STROKE
+A7AA..A7AE ; Lu # [5] LATIN CAPITAL LETTER H WITH HOOK..LATIN CAPITAL LETTER SMALL CAPITAL I
+A7B0..A7B4 ; Lu # [5] LATIN CAPITAL LETTER TURNED K..LATIN CAPITAL LETTER BETA
+A7B6 ; Lu # LATIN CAPITAL LETTER OMEGA
+A7B8 ; Lu # LATIN CAPITAL LETTER U WITH STROKE
+A7BA ; Lu # LATIN CAPITAL LETTER GLOTTAL A
+A7BC ; Lu # LATIN CAPITAL LETTER GLOTTAL I
+A7BE ; Lu # LATIN CAPITAL LETTER GLOTTAL U
+A7C0 ; Lu # LATIN CAPITAL LETTER OLD POLISH O
+A7C2 ; Lu # LATIN CAPITAL LETTER ANGLICANA W
+A7C4..A7C7 ; Lu # [4] LATIN CAPITAL LETTER C WITH PALATAL HOOK..LATIN CAPITAL LETTER D WITH SHORT STROKE OVERLAY
+A7C9 ; Lu # LATIN CAPITAL LETTER S WITH SHORT STROKE OVERLAY
+A7CB..A7CC ; Lu # [2] LATIN CAPITAL LETTER RAMS HORN..LATIN CAPITAL LETTER S WITH DIAGONAL STROKE
+A7D0 ; Lu # LATIN CAPITAL LETTER CLOSED INSULAR G
+A7D6 ; Lu # LATIN CAPITAL LETTER MIDDLE SCOTS S
+A7D8 ; Lu # LATIN CAPITAL LETTER SIGMOID S
+A7DA ; Lu # LATIN CAPITAL LETTER LAMBDA
+A7DC ; Lu # LATIN CAPITAL LETTER LAMBDA WITH STROKE
+A7F5 ; Lu # LATIN CAPITAL LETTER REVERSED HALF H
+FF21..FF3A ; Lu # [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAPITAL LETTER Z
+10400..10427 ; Lu # [40] DESERET CAPITAL LETTER LONG I..DESERET CAPITAL LETTER EW
+104B0..104D3 ; Lu # [36] OSAGE CAPITAL LETTER A..OSAGE CAPITAL LETTER ZHA
+10570..1057A ; Lu # [11] VITHKUQI CAPITAL LETTER A..VITHKUQI CAPITAL LETTER GA
+1057C..1058A ; Lu # [15] VITHKUQI CAPITAL LETTER HA..VITHKUQI CAPITAL LETTER RE
+1058C..10592 ; Lu # [7] VITHKUQI CAPITAL LETTER SE..VITHKUQI CAPITAL LETTER XE
+10594..10595 ; Lu # [2] VITHKUQI CAPITAL LETTER Y..VITHKUQI CAPITAL LETTER ZE
+10C80..10CB2 ; Lu # [51] OLD HUNGARIAN CAPITAL LETTER A..OLD HUNGARIAN CAPITAL LETTER US
+10D50..10D65 ; Lu # [22] GARAY CAPITAL LETTER A..GARAY CAPITAL LETTER OLD NA
+118A0..118BF ; Lu # [32] WARANG CITI CAPITAL LETTER NGAA..WARANG CITI CAPITAL LETTER VIYO
+16E40..16E5F ; Lu # [32] MEDEFAIDRIN CAPITAL LETTER M..MEDEFAIDRIN CAPITAL LETTER Y
+1D400..1D419 ; Lu # [26] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL BOLD CAPITAL Z
+1D434..1D44D ; Lu # [26] MATHEMATICAL ITALIC CAPITAL A..MATHEMATICAL ITALIC CAPITAL Z
+1D468..1D481 ; Lu # [26] MATHEMATICAL BOLD ITALIC CAPITAL A..MATHEMATICAL BOLD ITALIC CAPITAL Z
+1D49C ; Lu # MATHEMATICAL SCRIPT CAPITAL A
+1D49E..1D49F ; Lu # [2] MATHEMATICAL SCRIPT CAPITAL C..MATHEMATICAL SCRIPT CAPITAL D
+1D4A2 ; Lu # MATHEMATICAL SCRIPT CAPITAL G
+1D4A5..1D4A6 ; Lu # [2] MATHEMATICAL SCRIPT CAPITAL J..MATHEMATICAL SCRIPT CAPITAL K
+1D4A9..1D4AC ; Lu # [4] MATHEMATICAL SCRIPT CAPITAL N..MATHEMATICAL SCRIPT CAPITAL Q
+1D4AE..1D4B5 ; Lu # [8] MATHEMATICAL SCRIPT CAPITAL S..MATHEMATICAL SCRIPT CAPITAL Z
+1D4D0..1D4E9 ; Lu # [26] MATHEMATICAL BOLD SCRIPT CAPITAL A..MATHEMATICAL BOLD SCRIPT CAPITAL Z
+1D504..1D505 ; Lu # [2] MATHEMATICAL FRAKTUR CAPITAL A..MATHEMATICAL FRAKTUR CAPITAL B
+1D507..1D50A ; Lu # [4] MATHEMATICAL FRAKTUR CAPITAL D..MATHEMATICAL FRAKTUR CAPITAL G
+1D50D..1D514 ; Lu # [8] MATHEMATICAL FRAKTUR CAPITAL J..MATHEMATICAL FRAKTUR CAPITAL Q
+1D516..1D51C ; Lu # [7] MATHEMATICAL FRAKTUR CAPITAL S..MATHEMATICAL FRAKTUR CAPITAL Y
+1D538..1D539 ; Lu # [2] MATHEMATICAL DOUBLE-STRUCK CAPITAL A..MATHEMATICAL DOUBLE-STRUCK CAPITAL B
+1D53B..1D53E ; Lu # [4] MATHEMATICAL DOUBLE-STRUCK CAPITAL D..MATHEMATICAL DOUBLE-STRUCK CAPITAL G
+1D540..1D544 ; Lu # [5] MATHEMATICAL DOUBLE-STRUCK CAPITAL I..MATHEMATICAL DOUBLE-STRUCK CAPITAL M
+1D546 ; Lu # MATHEMATICAL DOUBLE-STRUCK CAPITAL O
+1D54A..1D550 ; Lu # [7] MATHEMATICAL DOUBLE-STRUCK CAPITAL S..MATHEMATICAL DOUBLE-STRUCK CAPITAL Y
+1D56C..1D585 ; Lu # [26] MATHEMATICAL BOLD FRAKTUR CAPITAL A..MATHEMATICAL BOLD FRAKTUR CAPITAL Z
+1D5A0..1D5B9 ; Lu # [26] MATHEMATICAL SANS-SERIF CAPITAL A..MATHEMATICAL SANS-SERIF CAPITAL Z
+1D5D4..1D5ED ; Lu # [26] MATHEMATICAL SANS-SERIF BOLD CAPITAL A..MATHEMATICAL SANS-SERIF BOLD CAPITAL Z
+1D608..1D621 ; Lu # [26] MATHEMATICAL SANS-SERIF ITALIC CAPITAL A..MATHEMATICAL SANS-SERIF ITALIC CAPITAL Z
+1D63C..1D655 ; Lu # [26] MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL A..MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL Z
+1D670..1D689 ; Lu # [26] MATHEMATICAL MONOSPACE CAPITAL A..MATHEMATICAL MONOSPACE CAPITAL Z
+1D6A8..1D6C0 ; Lu # [25] MATHEMATICAL BOLD CAPITAL ALPHA..MATHEMATICAL BOLD CAPITAL OMEGA
+1D6E2..1D6FA ; Lu # [25] MATHEMATICAL ITALIC CAPITAL ALPHA..MATHEMATICAL ITALIC CAPITAL OMEGA
+1D71C..1D734 ; Lu # [25] MATHEMATICAL BOLD ITALIC CAPITAL ALPHA..MATHEMATICAL BOLD ITALIC CAPITAL OMEGA
+1D756..1D76E ; Lu # [25] MATHEMATICAL SANS-SERIF BOLD CAPITAL ALPHA..MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA
+1D790..1D7A8 ; Lu # [25] MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL ALPHA..MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA
+1D7CA ; Lu # MATHEMATICAL BOLD CAPITAL DIGAMMA
+1E900..1E921 ; Lu # [34] ADLAM CAPITAL LETTER ALIF..ADLAM CAPITAL LETTER SHA
+
+# Total code points: 1858
+
+# ================================================
+
+# General_Category=Lowercase_Letter
+
+0061..007A ; Ll # [26] LATIN SMALL LETTER A..LATIN SMALL LETTER Z
+00B5 ; Ll # MICRO SIGN
+00DF..00F6 ; Ll # [24] LATIN SMALL LETTER SHARP S..LATIN SMALL LETTER O WITH DIAERESIS
+00F8..00FF ; Ll # [8] LATIN SMALL LETTER O WITH STROKE..LATIN SMALL LETTER Y WITH DIAERESIS
+0101 ; Ll # LATIN SMALL LETTER A WITH MACRON
+0103 ; Ll # LATIN SMALL LETTER A WITH BREVE
+0105 ; Ll # LATIN SMALL LETTER A WITH OGONEK
+0107 ; Ll # LATIN SMALL LETTER C WITH ACUTE
+0109 ; Ll # LATIN SMALL LETTER C WITH CIRCUMFLEX
+010B ; Ll # LATIN SMALL LETTER C WITH DOT ABOVE
+010D ; Ll # LATIN SMALL LETTER C WITH CARON
+010F ; Ll # LATIN SMALL LETTER D WITH CARON
+0111 ; Ll # LATIN SMALL LETTER D WITH STROKE
+0113 ; Ll # LATIN SMALL LETTER E WITH MACRON
+0115 ; Ll # LATIN SMALL LETTER E WITH BREVE
+0117 ; Ll # LATIN SMALL LETTER E WITH DOT ABOVE
+0119 ; Ll # LATIN SMALL LETTER E WITH OGONEK
+011B ; Ll # LATIN SMALL LETTER E WITH CARON
+011D ; Ll # LATIN SMALL LETTER G WITH CIRCUMFLEX
+011F ; Ll # LATIN SMALL LETTER G WITH BREVE
+0121 ; Ll # LATIN SMALL LETTER G WITH DOT ABOVE
+0123 ; Ll # LATIN SMALL LETTER G WITH CEDILLA
+0125 ; Ll # LATIN SMALL LETTER H WITH CIRCUMFLEX
+0127 ; Ll # LATIN SMALL LETTER H WITH STROKE
+0129 ; Ll # LATIN SMALL LETTER I WITH TILDE
+012B ; Ll # LATIN SMALL LETTER I WITH MACRON
+012D ; Ll # LATIN SMALL LETTER I WITH BREVE
+012F ; Ll # LATIN SMALL LETTER I WITH OGONEK
+0131 ; Ll # LATIN SMALL LETTER DOTLESS I
+0133 ; Ll # LATIN SMALL LIGATURE IJ
+0135 ; Ll # LATIN SMALL LETTER J WITH CIRCUMFLEX
+0137..0138 ; Ll # [2] LATIN SMALL LETTER K WITH CEDILLA..LATIN SMALL LETTER KRA
+013A ; Ll # LATIN SMALL LETTER L WITH ACUTE
+013C ; Ll # LATIN SMALL LETTER L WITH CEDILLA
+013E ; Ll # LATIN SMALL LETTER L WITH CARON
+0140 ; Ll # LATIN SMALL LETTER L WITH MIDDLE DOT
+0142 ; Ll # LATIN SMALL LETTER L WITH STROKE
+0144 ; Ll # LATIN SMALL LETTER N WITH ACUTE
+0146 ; Ll # LATIN SMALL LETTER N WITH CEDILLA
+0148..0149 ; Ll # [2] LATIN SMALL LETTER N WITH CARON..LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
+014B ; Ll # LATIN SMALL LETTER ENG
+014D ; Ll # LATIN SMALL LETTER O WITH MACRON
+014F ; Ll # LATIN SMALL LETTER O WITH BREVE
+0151 ; Ll # LATIN SMALL LETTER O WITH DOUBLE ACUTE
+0153 ; Ll # LATIN SMALL LIGATURE OE
+0155 ; Ll # LATIN SMALL LETTER R WITH ACUTE
+0157 ; Ll # LATIN SMALL LETTER R WITH CEDILLA
+0159 ; Ll # LATIN SMALL LETTER R WITH CARON
+015B ; Ll # LATIN SMALL LETTER S WITH ACUTE
+015D ; Ll # LATIN SMALL LETTER S WITH CIRCUMFLEX
+015F ; Ll # LATIN SMALL LETTER S WITH CEDILLA
+0161 ; Ll # LATIN SMALL LETTER S WITH CARON
+0163 ; Ll # LATIN SMALL LETTER T WITH CEDILLA
+0165 ; Ll # LATIN SMALL LETTER T WITH CARON
+0167 ; Ll # LATIN SMALL LETTER T WITH STROKE
+0169 ; Ll # LATIN SMALL LETTER U WITH TILDE
+016B ; Ll # LATIN SMALL LETTER U WITH MACRON
+016D ; Ll # LATIN SMALL LETTER U WITH BREVE
+016F ; Ll # LATIN SMALL LETTER U WITH RING ABOVE
+0171 ; Ll # LATIN SMALL LETTER U WITH DOUBLE ACUTE
+0173 ; Ll # LATIN SMALL LETTER U WITH OGONEK
+0175 ; Ll # LATIN SMALL LETTER W WITH CIRCUMFLEX
+0177 ; Ll # LATIN SMALL LETTER Y WITH CIRCUMFLEX
+017A ; Ll # LATIN SMALL LETTER Z WITH ACUTE
+017C ; Ll # LATIN SMALL LETTER Z WITH DOT ABOVE
+017E..0180 ; Ll # [3] LATIN SMALL LETTER Z WITH CARON..LATIN SMALL LETTER B WITH STROKE
+0183 ; Ll # LATIN SMALL LETTER B WITH TOPBAR
+0185 ; Ll # LATIN SMALL LETTER TONE SIX
+0188 ; Ll # LATIN SMALL LETTER C WITH HOOK
+018C..018D ; Ll # [2] LATIN SMALL LETTER D WITH TOPBAR..LATIN SMALL LETTER TURNED DELTA
+0192 ; Ll # LATIN SMALL LETTER F WITH HOOK
+0195 ; Ll # LATIN SMALL LETTER HV
+0199..019B ; Ll # [3] LATIN SMALL LETTER K WITH HOOK..LATIN SMALL LETTER LAMBDA WITH STROKE
+019E ; Ll # LATIN SMALL LETTER N WITH LONG RIGHT LEG
+01A1 ; Ll # LATIN SMALL LETTER O WITH HORN
+01A3 ; Ll # LATIN SMALL LETTER OI
+01A5 ; Ll # LATIN SMALL LETTER P WITH HOOK
+01A8 ; Ll # LATIN SMALL LETTER TONE TWO
+01AA..01AB ; Ll # [2] LATIN LETTER REVERSED ESH LOOP..LATIN SMALL LETTER T WITH PALATAL HOOK
+01AD ; Ll # LATIN SMALL LETTER T WITH HOOK
+01B0 ; Ll # LATIN SMALL LETTER U WITH HORN
+01B4 ; Ll # LATIN SMALL LETTER Y WITH HOOK
+01B6 ; Ll # LATIN SMALL LETTER Z WITH STROKE
+01B9..01BA ; Ll # [2] LATIN SMALL LETTER EZH REVERSED..LATIN SMALL LETTER EZH WITH TAIL
+01BD..01BF ; Ll # [3] LATIN SMALL LETTER TONE FIVE..LATIN LETTER WYNN
+01C6 ; Ll # LATIN SMALL LETTER DZ WITH CARON
+01C9 ; Ll # LATIN SMALL LETTER LJ
+01CC ; Ll # LATIN SMALL LETTER NJ
+01CE ; Ll # LATIN SMALL LETTER A WITH CARON
+01D0 ; Ll # LATIN SMALL LETTER I WITH CARON
+01D2 ; Ll # LATIN SMALL LETTER O WITH CARON
+01D4 ; Ll # LATIN SMALL LETTER U WITH CARON
+01D6 ; Ll # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+01D8 ; Ll # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+01DA ; Ll # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+01DC..01DD ; Ll # [2] LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE..LATIN SMALL LETTER TURNED E
+01DF ; Ll # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+01E1 ; Ll # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+01E3 ; Ll # LATIN SMALL LETTER AE WITH MACRON
+01E5 ; Ll # LATIN SMALL LETTER G WITH STROKE
+01E7 ; Ll # LATIN SMALL LETTER G WITH CARON
+01E9 ; Ll # LATIN SMALL LETTER K WITH CARON
+01EB ; Ll # LATIN SMALL LETTER O WITH OGONEK
+01ED ; Ll # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+01EF..01F0 ; Ll # [2] LATIN SMALL LETTER EZH WITH CARON..LATIN SMALL LETTER J WITH CARON
+01F3 ; Ll # LATIN SMALL LETTER DZ
+01F5 ; Ll # LATIN SMALL LETTER G WITH ACUTE
+01F9 ; Ll # LATIN SMALL LETTER N WITH GRAVE
+01FB ; Ll # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+01FD ; Ll # LATIN SMALL LETTER AE WITH ACUTE
+01FF ; Ll # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+0201 ; Ll # LATIN SMALL LETTER A WITH DOUBLE GRAVE
+0203 ; Ll # LATIN SMALL LETTER A WITH INVERTED BREVE
+0205 ; Ll # LATIN SMALL LETTER E WITH DOUBLE GRAVE
+0207 ; Ll # LATIN SMALL LETTER E WITH INVERTED BREVE
+0209 ; Ll # LATIN SMALL LETTER I WITH DOUBLE GRAVE
+020B ; Ll # LATIN SMALL LETTER I WITH INVERTED BREVE
+020D ; Ll # LATIN SMALL LETTER O WITH DOUBLE GRAVE
+020F ; Ll # LATIN SMALL LETTER O WITH INVERTED BREVE
+0211 ; Ll # LATIN SMALL LETTER R WITH DOUBLE GRAVE
+0213 ; Ll # LATIN SMALL LETTER R WITH INVERTED BREVE
+0215 ; Ll # LATIN SMALL LETTER U WITH DOUBLE GRAVE
+0217 ; Ll # LATIN SMALL LETTER U WITH INVERTED BREVE
+0219 ; Ll # LATIN SMALL LETTER S WITH COMMA BELOW
+021B ; Ll # LATIN SMALL LETTER T WITH COMMA BELOW
+021D ; Ll # LATIN SMALL LETTER YOGH
+021F ; Ll # LATIN SMALL LETTER H WITH CARON
+0221 ; Ll # LATIN SMALL LETTER D WITH CURL
+0223 ; Ll # LATIN SMALL LETTER OU
+0225 ; Ll # LATIN SMALL LETTER Z WITH HOOK
+0227 ; Ll # LATIN SMALL LETTER A WITH DOT ABOVE
+0229 ; Ll # LATIN SMALL LETTER E WITH CEDILLA
+022B ; Ll # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+022D ; Ll # LATIN SMALL LETTER O WITH TILDE AND MACRON
+022F ; Ll # LATIN SMALL LETTER O WITH DOT ABOVE
+0231 ; Ll # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+0233..0239 ; Ll # [7] LATIN SMALL LETTER Y WITH MACRON..LATIN SMALL LETTER QP DIGRAPH
+023C ; Ll # LATIN SMALL LETTER C WITH STROKE
+023F..0240 ; Ll # [2] LATIN SMALL LETTER S WITH SWASH TAIL..LATIN SMALL LETTER Z WITH SWASH TAIL
+0242 ; Ll # LATIN SMALL LETTER GLOTTAL STOP
+0247 ; Ll # LATIN SMALL LETTER E WITH STROKE
+0249 ; Ll # LATIN SMALL LETTER J WITH STROKE
+024B ; Ll # LATIN SMALL LETTER Q WITH HOOK TAIL
+024D ; Ll # LATIN SMALL LETTER R WITH STROKE
+024F..0293 ; Ll # [69] LATIN SMALL LETTER Y WITH STROKE..LATIN SMALL LETTER EZH WITH CURL
+0295..02AF ; Ll # [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL
+0371 ; Ll # GREEK SMALL LETTER HETA
+0373 ; Ll # GREEK SMALL LETTER ARCHAIC SAMPI
+0377 ; Ll # GREEK SMALL LETTER PAMPHYLIAN DIGAMMA
+037B..037D ; Ll # [3] GREEK SMALL REVERSED LUNATE SIGMA SYMBOL..GREEK SMALL REVERSED DOTTED LUNATE SIGMA SYMBOL
+0390 ; Ll # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+03AC..03CE ; Ll # [35] GREEK SMALL LETTER ALPHA WITH TONOS..GREEK SMALL LETTER OMEGA WITH TONOS
+03D0..03D1 ; Ll # [2] GREEK BETA SYMBOL..GREEK THETA SYMBOL
+03D5..03D7 ; Ll # [3] GREEK PHI SYMBOL..GREEK KAI SYMBOL
+03D9 ; Ll # GREEK SMALL LETTER ARCHAIC KOPPA
+03DB ; Ll # GREEK SMALL LETTER STIGMA
+03DD ; Ll # GREEK SMALL LETTER DIGAMMA
+03DF ; Ll # GREEK SMALL LETTER KOPPA
+03E1 ; Ll # GREEK SMALL LETTER SAMPI
+03E3 ; Ll # COPTIC SMALL LETTER SHEI
+03E5 ; Ll # COPTIC SMALL LETTER FEI
+03E7 ; Ll # COPTIC SMALL LETTER KHEI
+03E9 ; Ll # COPTIC SMALL LETTER HORI
+03EB ; Ll # COPTIC SMALL LETTER GANGIA
+03ED ; Ll # COPTIC SMALL LETTER SHIMA
+03EF..03F3 ; Ll # [5] COPTIC SMALL LETTER DEI..GREEK LETTER YOT
+03F5 ; Ll # GREEK LUNATE EPSILON SYMBOL
+03F8 ; Ll # GREEK SMALL LETTER SHO
+03FB..03FC ; Ll # [2] GREEK SMALL LETTER SAN..GREEK RHO WITH STROKE SYMBOL
+0430..045F ; Ll # [48] CYRILLIC SMALL LETTER A..CYRILLIC SMALL LETTER DZHE
+0461 ; Ll # CYRILLIC SMALL LETTER OMEGA
+0463 ; Ll # CYRILLIC SMALL LETTER YAT
+0465 ; Ll # CYRILLIC SMALL LETTER IOTIFIED E
+0467 ; Ll # CYRILLIC SMALL LETTER LITTLE YUS
+0469 ; Ll # CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS
+046B ; Ll # CYRILLIC SMALL LETTER BIG YUS
+046D ; Ll # CYRILLIC SMALL LETTER IOTIFIED BIG YUS
+046F ; Ll # CYRILLIC SMALL LETTER KSI
+0471 ; Ll # CYRILLIC SMALL LETTER PSI
+0473 ; Ll # CYRILLIC SMALL LETTER FITA
+0475 ; Ll # CYRILLIC SMALL LETTER IZHITSA
+0477 ; Ll # CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
+0479 ; Ll # CYRILLIC SMALL LETTER UK
+047B ; Ll # CYRILLIC SMALL LETTER ROUND OMEGA
+047D ; Ll # CYRILLIC SMALL LETTER OMEGA WITH TITLO
+047F ; Ll # CYRILLIC SMALL LETTER OT
+0481 ; Ll # CYRILLIC SMALL LETTER KOPPA
+048B ; Ll # CYRILLIC SMALL LETTER SHORT I WITH TAIL
+048D ; Ll # CYRILLIC SMALL LETTER SEMISOFT SIGN
+048F ; Ll # CYRILLIC SMALL LETTER ER WITH TICK
+0491 ; Ll # CYRILLIC SMALL LETTER GHE WITH UPTURN
+0493 ; Ll # CYRILLIC SMALL LETTER GHE WITH STROKE
+0495 ; Ll # CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK
+0497 ; Ll # CYRILLIC SMALL LETTER ZHE WITH DESCENDER
+0499 ; Ll # CYRILLIC SMALL LETTER ZE WITH DESCENDER
+049B ; Ll # CYRILLIC SMALL LETTER KA WITH DESCENDER
+049D ; Ll # CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE
+049F ; Ll # CYRILLIC SMALL LETTER KA WITH STROKE
+04A1 ; Ll # CYRILLIC SMALL LETTER BASHKIR KA
+04A3 ; Ll # CYRILLIC SMALL LETTER EN WITH DESCENDER
+04A5 ; Ll # CYRILLIC SMALL LIGATURE EN GHE
+04A7 ; Ll # CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK
+04A9 ; Ll # CYRILLIC SMALL LETTER ABKHASIAN HA
+04AB ; Ll # CYRILLIC SMALL LETTER ES WITH DESCENDER
+04AD ; Ll # CYRILLIC SMALL LETTER TE WITH DESCENDER
+04AF ; Ll # CYRILLIC SMALL LETTER STRAIGHT U
+04B1 ; Ll # CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
+04B3 ; Ll # CYRILLIC SMALL LETTER HA WITH DESCENDER
+04B5 ; Ll # CYRILLIC SMALL LIGATURE TE TSE
+04B7 ; Ll # CYRILLIC SMALL LETTER CHE WITH DESCENDER
+04B9 ; Ll # CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE
+04BB ; Ll # CYRILLIC SMALL LETTER SHHA
+04BD ; Ll # CYRILLIC SMALL LETTER ABKHASIAN CHE
+04BF ; Ll # CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER
+04C2 ; Ll # CYRILLIC SMALL LETTER ZHE WITH BREVE
+04C4 ; Ll # CYRILLIC SMALL LETTER KA WITH HOOK
+04C6 ; Ll # CYRILLIC SMALL LETTER EL WITH TAIL
+04C8 ; Ll # CYRILLIC SMALL LETTER EN WITH HOOK
+04CA ; Ll # CYRILLIC SMALL LETTER EN WITH TAIL
+04CC ; Ll # CYRILLIC SMALL LETTER KHAKASSIAN CHE
+04CE..04CF ; Ll # [2] CYRILLIC SMALL LETTER EM WITH TAIL..CYRILLIC SMALL LETTER PALOCHKA
+04D1 ; Ll # CYRILLIC SMALL LETTER A WITH BREVE
+04D3 ; Ll # CYRILLIC SMALL LETTER A WITH DIAERESIS
+04D5 ; Ll # CYRILLIC SMALL LIGATURE A IE
+04D7 ; Ll # CYRILLIC SMALL LETTER IE WITH BREVE
+04D9 ; Ll # CYRILLIC SMALL LETTER SCHWA
+04DB ; Ll # CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS
+04DD ; Ll # CYRILLIC SMALL LETTER ZHE WITH DIAERESIS
+04DF ; Ll # CYRILLIC SMALL LETTER ZE WITH DIAERESIS
+04E1 ; Ll # CYRILLIC SMALL LETTER ABKHASIAN DZE
+04E3 ; Ll # CYRILLIC SMALL LETTER I WITH MACRON
+04E5 ; Ll # CYRILLIC SMALL LETTER I WITH DIAERESIS
+04E7 ; Ll # CYRILLIC SMALL LETTER O WITH DIAERESIS
+04E9 ; Ll # CYRILLIC SMALL LETTER BARRED O
+04EB ; Ll # CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS
+04ED ; Ll # CYRILLIC SMALL LETTER E WITH DIAERESIS
+04EF ; Ll # CYRILLIC SMALL LETTER U WITH MACRON
+04F1 ; Ll # CYRILLIC SMALL LETTER U WITH DIAERESIS
+04F3 ; Ll # CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE
+04F5 ; Ll # CYRILLIC SMALL LETTER CHE WITH DIAERESIS
+04F7 ; Ll # CYRILLIC SMALL LETTER GHE WITH DESCENDER
+04F9 ; Ll # CYRILLIC SMALL LETTER YERU WITH DIAERESIS
+04FB ; Ll # CYRILLIC SMALL LETTER GHE WITH STROKE AND HOOK
+04FD ; Ll # CYRILLIC SMALL LETTER HA WITH HOOK
+04FF ; Ll # CYRILLIC SMALL LETTER HA WITH STROKE
+0501 ; Ll # CYRILLIC SMALL LETTER KOMI DE
+0503 ; Ll # CYRILLIC SMALL LETTER KOMI DJE
+0505 ; Ll # CYRILLIC SMALL LETTER KOMI ZJE
+0507 ; Ll # CYRILLIC SMALL LETTER KOMI DZJE
+0509 ; Ll # CYRILLIC SMALL LETTER KOMI LJE
+050B ; Ll # CYRILLIC SMALL LETTER KOMI NJE
+050D ; Ll # CYRILLIC SMALL LETTER KOMI SJE
+050F ; Ll # CYRILLIC SMALL LETTER KOMI TJE
+0511 ; Ll # CYRILLIC SMALL LETTER REVERSED ZE
+0513 ; Ll # CYRILLIC SMALL LETTER EL WITH HOOK
+0515 ; Ll # CYRILLIC SMALL LETTER LHA
+0517 ; Ll # CYRILLIC SMALL LETTER RHA
+0519 ; Ll # CYRILLIC SMALL LETTER YAE
+051B ; Ll # CYRILLIC SMALL LETTER QA
+051D ; Ll # CYRILLIC SMALL LETTER WE
+051F ; Ll # CYRILLIC SMALL LETTER ALEUT KA
+0521 ; Ll # CYRILLIC SMALL LETTER EL WITH MIDDLE HOOK
+0523 ; Ll # CYRILLIC SMALL LETTER EN WITH MIDDLE HOOK
+0525 ; Ll # CYRILLIC SMALL LETTER PE WITH DESCENDER
+0527 ; Ll # CYRILLIC SMALL LETTER SHHA WITH DESCENDER
+0529 ; Ll # CYRILLIC SMALL LETTER EN WITH LEFT HOOK
+052B ; Ll # CYRILLIC SMALL LETTER DZZHE
+052D ; Ll # CYRILLIC SMALL LETTER DCHE
+052F ; Ll # CYRILLIC SMALL LETTER EL WITH DESCENDER
+0560..0588 ; Ll # [41] ARMENIAN SMALL LETTER TURNED AYB..ARMENIAN SMALL LETTER YI WITH STROKE
+10D0..10FA ; Ll # [43] GEORGIAN LETTER AN..GEORGIAN LETTER AIN
+10FD..10FF ; Ll # [3] GEORGIAN LETTER AEN..GEORGIAN LETTER LABIAL SIGN
+13F8..13FD ; Ll # [6] CHEROKEE SMALL LETTER YE..CHEROKEE SMALL LETTER MV
+1C80..1C88 ; Ll # [9] CYRILLIC SMALL LETTER ROUNDED VE..CYRILLIC SMALL LETTER UNBLENDED UK
+1C8A ; Ll # CYRILLIC SMALL LETTER TJE
+1D00..1D2B ; Ll # [44] LATIN LETTER SMALL CAPITAL A..CYRILLIC LETTER SMALL CAPITAL EL
+1D6B..1D77 ; Ll # [13] LATIN SMALL LETTER UE..LATIN SMALL LETTER TURNED G
+1D79..1D9A ; Ll # [34] LATIN SMALL LETTER INSULAR G..LATIN SMALL LETTER EZH WITH RETROFLEX HOOK
+1E01 ; Ll # LATIN SMALL LETTER A WITH RING BELOW
+1E03 ; Ll # LATIN SMALL LETTER B WITH DOT ABOVE
+1E05 ; Ll # LATIN SMALL LETTER B WITH DOT BELOW
+1E07 ; Ll # LATIN SMALL LETTER B WITH LINE BELOW
+1E09 ; Ll # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+1E0B ; Ll # LATIN SMALL LETTER D WITH DOT ABOVE
+1E0D ; Ll # LATIN SMALL LETTER D WITH DOT BELOW
+1E0F ; Ll # LATIN SMALL LETTER D WITH LINE BELOW
+1E11 ; Ll # LATIN SMALL LETTER D WITH CEDILLA
+1E13 ; Ll # LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW
+1E15 ; Ll # LATIN SMALL LETTER E WITH MACRON AND GRAVE
+1E17 ; Ll # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+1E19 ; Ll # LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW
+1E1B ; Ll # LATIN SMALL LETTER E WITH TILDE BELOW
+1E1D ; Ll # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+1E1F ; Ll # LATIN SMALL LETTER F WITH DOT ABOVE
+1E21 ; Ll # LATIN SMALL LETTER G WITH MACRON
+1E23 ; Ll # LATIN SMALL LETTER H WITH DOT ABOVE
+1E25 ; Ll # LATIN SMALL LETTER H WITH DOT BELOW
+1E27 ; Ll # LATIN SMALL LETTER H WITH DIAERESIS
+1E29 ; Ll # LATIN SMALL LETTER H WITH CEDILLA
+1E2B ; Ll # LATIN SMALL LETTER H WITH BREVE BELOW
+1E2D ; Ll # LATIN SMALL LETTER I WITH TILDE BELOW
+1E2F ; Ll # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+1E31 ; Ll # LATIN SMALL LETTER K WITH ACUTE
+1E33 ; Ll # LATIN SMALL LETTER K WITH DOT BELOW
+1E35 ; Ll # LATIN SMALL LETTER K WITH LINE BELOW
+1E37 ; Ll # LATIN SMALL LETTER L WITH DOT BELOW
+1E39 ; Ll # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+1E3B ; Ll # LATIN SMALL LETTER L WITH LINE BELOW
+1E3D ; Ll # LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW
+1E3F ; Ll # LATIN SMALL LETTER M WITH ACUTE
+1E41 ; Ll # LATIN SMALL LETTER M WITH DOT ABOVE
+1E43 ; Ll # LATIN SMALL LETTER M WITH DOT BELOW
+1E45 ; Ll # LATIN SMALL LETTER N WITH DOT ABOVE
+1E47 ; Ll # LATIN SMALL LETTER N WITH DOT BELOW
+1E49 ; Ll # LATIN SMALL LETTER N WITH LINE BELOW
+1E4B ; Ll # LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW
+1E4D ; Ll # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+1E4F ; Ll # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+1E51 ; Ll # LATIN SMALL LETTER O WITH MACRON AND GRAVE
+1E53 ; Ll # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+1E55 ; Ll # LATIN SMALL LETTER P WITH ACUTE
+1E57 ; Ll # LATIN SMALL LETTER P WITH DOT ABOVE
+1E59 ; Ll # LATIN SMALL LETTER R WITH DOT ABOVE
+1E5B ; Ll # LATIN SMALL LETTER R WITH DOT BELOW
+1E5D ; Ll # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+1E5F ; Ll # LATIN SMALL LETTER R WITH LINE BELOW
+1E61 ; Ll # LATIN SMALL LETTER S WITH DOT ABOVE
+1E63 ; Ll # LATIN SMALL LETTER S WITH DOT BELOW
+1E65 ; Ll # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+1E67 ; Ll # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
+1E69 ; Ll # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+1E6B ; Ll # LATIN SMALL LETTER T WITH DOT ABOVE
+1E6D ; Ll # LATIN SMALL LETTER T WITH DOT BELOW
+1E6F ; Ll # LATIN SMALL LETTER T WITH LINE BELOW
+1E71 ; Ll # LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW
+1E73 ; Ll # LATIN SMALL LETTER U WITH DIAERESIS BELOW
+1E75 ; Ll # LATIN SMALL LETTER U WITH TILDE BELOW
+1E77 ; Ll # LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW
+1E79 ; Ll # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+1E7B ; Ll # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+1E7D ; Ll # LATIN SMALL LETTER V WITH TILDE
+1E7F ; Ll # LATIN SMALL LETTER V WITH DOT BELOW
+1E81 ; Ll # LATIN SMALL LETTER W WITH GRAVE
+1E83 ; Ll # LATIN SMALL LETTER W WITH ACUTE
+1E85 ; Ll # LATIN SMALL LETTER W WITH DIAERESIS
+1E87 ; Ll # LATIN SMALL LETTER W WITH DOT ABOVE
+1E89 ; Ll # LATIN SMALL LETTER W WITH DOT BELOW
+1E8B ; Ll # LATIN SMALL LETTER X WITH DOT ABOVE
+1E8D ; Ll # LATIN SMALL LETTER X WITH DIAERESIS
+1E8F ; Ll # LATIN SMALL LETTER Y WITH DOT ABOVE
+1E91 ; Ll # LATIN SMALL LETTER Z WITH CIRCUMFLEX
+1E93 ; Ll # LATIN SMALL LETTER Z WITH DOT BELOW
+1E95..1E9D ; Ll # [9] LATIN SMALL LETTER Z WITH LINE BELOW..LATIN SMALL LETTER LONG S WITH HIGH STROKE
+1E9F ; Ll # LATIN SMALL LETTER DELTA
+1EA1 ; Ll # LATIN SMALL LETTER A WITH DOT BELOW
+1EA3 ; Ll # LATIN SMALL LETTER A WITH HOOK ABOVE
+1EA5 ; Ll # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+1EA7 ; Ll # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+1EA9 ; Ll # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+1EAB ; Ll # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+1EAD ; Ll # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+1EAF ; Ll # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+1EB1 ; Ll # LATIN SMALL LETTER A WITH BREVE AND GRAVE
+1EB3 ; Ll # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+1EB5 ; Ll # LATIN SMALL LETTER A WITH BREVE AND TILDE
+1EB7 ; Ll # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+1EB9 ; Ll # LATIN SMALL LETTER E WITH DOT BELOW
+1EBB ; Ll # LATIN SMALL LETTER E WITH HOOK ABOVE
+1EBD ; Ll # LATIN SMALL LETTER E WITH TILDE
+1EBF ; Ll # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+1EC1 ; Ll # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+1EC3 ; Ll # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+1EC5 ; Ll # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+1EC7 ; Ll # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+1EC9 ; Ll # LATIN SMALL LETTER I WITH HOOK ABOVE
+1ECB ; Ll # LATIN SMALL LETTER I WITH DOT BELOW
+1ECD ; Ll # LATIN SMALL LETTER O WITH DOT BELOW
+1ECF ; Ll # LATIN SMALL LETTER O WITH HOOK ABOVE
+1ED1 ; Ll # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+1ED3 ; Ll # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+1ED5 ; Ll # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+1ED7 ; Ll # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+1ED9 ; Ll # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+1EDB ; Ll # LATIN SMALL LETTER O WITH HORN AND ACUTE
+1EDD ; Ll # LATIN SMALL LETTER O WITH HORN AND GRAVE
+1EDF ; Ll # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+1EE1 ; Ll # LATIN SMALL LETTER O WITH HORN AND TILDE
+1EE3 ; Ll # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+1EE5 ; Ll # LATIN SMALL LETTER U WITH DOT BELOW
+1EE7 ; Ll # LATIN SMALL LETTER U WITH HOOK ABOVE
+1EE9 ; Ll # LATIN SMALL LETTER U WITH HORN AND ACUTE
+1EEB ; Ll # LATIN SMALL LETTER U WITH HORN AND GRAVE
+1EED ; Ll # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+1EEF ; Ll # LATIN SMALL LETTER U WITH HORN AND TILDE
+1EF1 ; Ll # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+1EF3 ; Ll # LATIN SMALL LETTER Y WITH GRAVE
+1EF5 ; Ll # LATIN SMALL LETTER Y WITH DOT BELOW
+1EF7 ; Ll # LATIN SMALL LETTER Y WITH HOOK ABOVE
+1EF9 ; Ll # LATIN SMALL LETTER Y WITH TILDE
+1EFB ; Ll # LATIN SMALL LETTER MIDDLE-WELSH LL
+1EFD ; Ll # LATIN SMALL LETTER MIDDLE-WELSH V
+1EFF..1F07 ; Ll # [9] LATIN SMALL LETTER Y WITH LOOP..GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+1F10..1F15 ; Ll # [6] GREEK SMALL LETTER EPSILON WITH PSILI..GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+1F20..1F27 ; Ll # [8] GREEK SMALL LETTER ETA WITH PSILI..GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
+1F30..1F37 ; Ll # [8] GREEK SMALL LETTER IOTA WITH PSILI..GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
+1F40..1F45 ; Ll # [6] GREEK SMALL LETTER OMICRON WITH PSILI..GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+1F50..1F57 ; Ll # [8] GREEK SMALL LETTER UPSILON WITH PSILI..GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+1F60..1F67 ; Ll # [8] GREEK SMALL LETTER OMEGA WITH PSILI..GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+1F70..1F7D ; Ll # [14] GREEK SMALL LETTER ALPHA WITH VARIA..GREEK SMALL LETTER OMEGA WITH OXIA
+1F80..1F87 ; Ll # [8] GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI..GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+1F90..1F97 ; Ll # [8] GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI..GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+1FA0..1FA7 ; Ll # [8] GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI..GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+1FB0..1FB4 ; Ll # [5] GREEK SMALL LETTER ALPHA WITH VRACHY..GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+1FB6..1FB7 ; Ll # [2] GREEK SMALL LETTER ALPHA WITH PERISPOMENI..GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
+1FBE ; Ll # GREEK PROSGEGRAMMENI
+1FC2..1FC4 ; Ll # [3] GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI..GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+1FC6..1FC7 ; Ll # [2] GREEK SMALL LETTER ETA WITH PERISPOMENI..GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
+1FD0..1FD3 ; Ll # [4] GREEK SMALL LETTER IOTA WITH VRACHY..GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
+1FD6..1FD7 ; Ll # [2] GREEK SMALL LETTER IOTA WITH PERISPOMENI..GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
+1FE0..1FE7 ; Ll # [8] GREEK SMALL LETTER UPSILON WITH VRACHY..GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
+1FF2..1FF4 ; Ll # [3] GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI..GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+1FF6..1FF7 ; Ll # [2] GREEK SMALL LETTER OMEGA WITH PERISPOMENI..GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
+210A ; Ll # SCRIPT SMALL G
+210E..210F ; Ll # [2] PLANCK CONSTANT..PLANCK CONSTANT OVER TWO PI
+2113 ; Ll # SCRIPT SMALL L
+212F ; Ll # SCRIPT SMALL E
+2134 ; Ll # SCRIPT SMALL O
+2139 ; Ll # INFORMATION SOURCE
+213C..213D ; Ll # [2] DOUBLE-STRUCK SMALL PI..DOUBLE-STRUCK SMALL GAMMA
+2146..2149 ; Ll # [4] DOUBLE-STRUCK ITALIC SMALL D..DOUBLE-STRUCK ITALIC SMALL J
+214E ; Ll # TURNED SMALL F
+2184 ; Ll # LATIN SMALL LETTER REVERSED C
+2C30..2C5F ; Ll # [48] GLAGOLITIC SMALL LETTER AZU..GLAGOLITIC SMALL LETTER CAUDATE CHRIVI
+2C61 ; Ll # LATIN SMALL LETTER L WITH DOUBLE BAR
+2C65..2C66 ; Ll # [2] LATIN SMALL LETTER A WITH STROKE..LATIN SMALL LETTER T WITH DIAGONAL STROKE
+2C68 ; Ll # LATIN SMALL LETTER H WITH DESCENDER
+2C6A ; Ll # LATIN SMALL LETTER K WITH DESCENDER
+2C6C ; Ll # LATIN SMALL LETTER Z WITH DESCENDER
+2C71 ; Ll # LATIN SMALL LETTER V WITH RIGHT HOOK
+2C73..2C74 ; Ll # [2] LATIN SMALL LETTER W WITH HOOK..LATIN SMALL LETTER V WITH CURL
+2C76..2C7B ; Ll # [6] LATIN SMALL LETTER HALF H..LATIN LETTER SMALL CAPITAL TURNED E
+2C81 ; Ll # COPTIC SMALL LETTER ALFA
+2C83 ; Ll # COPTIC SMALL LETTER VIDA
+2C85 ; Ll # COPTIC SMALL LETTER GAMMA
+2C87 ; Ll # COPTIC SMALL LETTER DALDA
+2C89 ; Ll # COPTIC SMALL LETTER EIE
+2C8B ; Ll # COPTIC SMALL LETTER SOU
+2C8D ; Ll # COPTIC SMALL LETTER ZATA
+2C8F ; Ll # COPTIC SMALL LETTER HATE
+2C91 ; Ll # COPTIC SMALL LETTER THETHE
+2C93 ; Ll # COPTIC SMALL LETTER IAUDA
+2C95 ; Ll # COPTIC SMALL LETTER KAPA
+2C97 ; Ll # COPTIC SMALL LETTER LAULA
+2C99 ; Ll # COPTIC SMALL LETTER MI
+2C9B ; Ll # COPTIC SMALL LETTER NI
+2C9D ; Ll # COPTIC SMALL LETTER KSI
+2C9F ; Ll # COPTIC SMALL LETTER O
+2CA1 ; Ll # COPTIC SMALL LETTER PI
+2CA3 ; Ll # COPTIC SMALL LETTER RO
+2CA5 ; Ll # COPTIC SMALL LETTER SIMA
+2CA7 ; Ll # COPTIC SMALL LETTER TAU
+2CA9 ; Ll # COPTIC SMALL LETTER UA
+2CAB ; Ll # COPTIC SMALL LETTER FI
+2CAD ; Ll # COPTIC SMALL LETTER KHI
+2CAF ; Ll # COPTIC SMALL LETTER PSI
+2CB1 ; Ll # COPTIC SMALL LETTER OOU
+2CB3 ; Ll # COPTIC SMALL LETTER DIALECT-P ALEF
+2CB5 ; Ll # COPTIC SMALL LETTER OLD COPTIC AIN
+2CB7 ; Ll # COPTIC SMALL LETTER CRYPTOGRAMMIC EIE
+2CB9 ; Ll # COPTIC SMALL LETTER DIALECT-P KAPA
+2CBB ; Ll # COPTIC SMALL LETTER DIALECT-P NI
+2CBD ; Ll # COPTIC SMALL LETTER CRYPTOGRAMMIC NI
+2CBF ; Ll # COPTIC SMALL LETTER OLD COPTIC OOU
+2CC1 ; Ll # COPTIC SMALL LETTER SAMPI
+2CC3 ; Ll # COPTIC SMALL LETTER CROSSED SHEI
+2CC5 ; Ll # COPTIC SMALL LETTER OLD COPTIC SHEI
+2CC7 ; Ll # COPTIC SMALL LETTER OLD COPTIC ESH
+2CC9 ; Ll # COPTIC SMALL LETTER AKHMIMIC KHEI
+2CCB ; Ll # COPTIC SMALL LETTER DIALECT-P HORI
+2CCD ; Ll # COPTIC SMALL LETTER OLD COPTIC HORI
+2CCF ; Ll # COPTIC SMALL LETTER OLD COPTIC HA
+2CD1 ; Ll # COPTIC SMALL LETTER L-SHAPED HA
+2CD3 ; Ll # COPTIC SMALL LETTER OLD COPTIC HEI
+2CD5 ; Ll # COPTIC SMALL LETTER OLD COPTIC HAT
+2CD7 ; Ll # COPTIC SMALL LETTER OLD COPTIC GANGIA
+2CD9 ; Ll # COPTIC SMALL LETTER OLD COPTIC DJA
+2CDB ; Ll # COPTIC SMALL LETTER OLD COPTIC SHIMA
+2CDD ; Ll # COPTIC SMALL LETTER OLD NUBIAN SHIMA
+2CDF ; Ll # COPTIC SMALL LETTER OLD NUBIAN NGI
+2CE1 ; Ll # COPTIC SMALL LETTER OLD NUBIAN NYI
+2CE3..2CE4 ; Ll # [2] COPTIC SMALL LETTER OLD NUBIAN WAU..COPTIC SYMBOL KAI
+2CEC ; Ll # COPTIC SMALL LETTER CRYPTOGRAMMIC SHEI
+2CEE ; Ll # COPTIC SMALL LETTER CRYPTOGRAMMIC GANGIA
+2CF3 ; Ll # COPTIC SMALL LETTER BOHAIRIC KHEI
+2D00..2D25 ; Ll # [38] GEORGIAN SMALL LETTER AN..GEORGIAN SMALL LETTER HOE
+2D27 ; Ll # GEORGIAN SMALL LETTER YN
+2D2D ; Ll # GEORGIAN SMALL LETTER AEN
+A641 ; Ll # CYRILLIC SMALL LETTER ZEMLYA
+A643 ; Ll # CYRILLIC SMALL LETTER DZELO
+A645 ; Ll # CYRILLIC SMALL LETTER REVERSED DZE
+A647 ; Ll # CYRILLIC SMALL LETTER IOTA
+A649 ; Ll # CYRILLIC SMALL LETTER DJERV
+A64B ; Ll # CYRILLIC SMALL LETTER MONOGRAPH UK
+A64D ; Ll # CYRILLIC SMALL LETTER BROAD OMEGA
+A64F ; Ll # CYRILLIC SMALL LETTER NEUTRAL YER
+A651 ; Ll # CYRILLIC SMALL LETTER YERU WITH BACK YER
+A653 ; Ll # CYRILLIC SMALL LETTER IOTIFIED YAT
+A655 ; Ll # CYRILLIC SMALL LETTER REVERSED YU
+A657 ; Ll # CYRILLIC SMALL LETTER IOTIFIED A
+A659 ; Ll # CYRILLIC SMALL LETTER CLOSED LITTLE YUS
+A65B ; Ll # CYRILLIC SMALL LETTER BLENDED YUS
+A65D ; Ll # CYRILLIC SMALL LETTER IOTIFIED CLOSED LITTLE YUS
+A65F ; Ll # CYRILLIC SMALL LETTER YN
+A661 ; Ll # CYRILLIC SMALL LETTER REVERSED TSE
+A663 ; Ll # CYRILLIC SMALL LETTER SOFT DE
+A665 ; Ll # CYRILLIC SMALL LETTER SOFT EL
+A667 ; Ll # CYRILLIC SMALL LETTER SOFT EM
+A669 ; Ll # CYRILLIC SMALL LETTER MONOCULAR O
+A66B ; Ll # CYRILLIC SMALL LETTER BINOCULAR O
+A66D ; Ll # CYRILLIC SMALL LETTER DOUBLE MONOCULAR O
+A681 ; Ll # CYRILLIC SMALL LETTER DWE
+A683 ; Ll # CYRILLIC SMALL LETTER DZWE
+A685 ; Ll # CYRILLIC SMALL LETTER ZHWE
+A687 ; Ll # CYRILLIC SMALL LETTER CCHE
+A689 ; Ll # CYRILLIC SMALL LETTER DZZE
+A68B ; Ll # CYRILLIC SMALL LETTER TE WITH MIDDLE HOOK
+A68D ; Ll # CYRILLIC SMALL LETTER TWE
+A68F ; Ll # CYRILLIC SMALL LETTER TSWE
+A691 ; Ll # CYRILLIC SMALL LETTER TSSE
+A693 ; Ll # CYRILLIC SMALL LETTER TCHE
+A695 ; Ll # CYRILLIC SMALL LETTER HWE
+A697 ; Ll # CYRILLIC SMALL LETTER SHWE
+A699 ; Ll # CYRILLIC SMALL LETTER DOUBLE O
+A69B ; Ll # CYRILLIC SMALL LETTER CROSSED O
+A723 ; Ll # LATIN SMALL LETTER EGYPTOLOGICAL ALEF
+A725 ; Ll # LATIN SMALL LETTER EGYPTOLOGICAL AIN
+A727 ; Ll # LATIN SMALL LETTER HENG
+A729 ; Ll # LATIN SMALL LETTER TZ
+A72B ; Ll # LATIN SMALL LETTER TRESILLO
+A72D ; Ll # LATIN SMALL LETTER CUATRILLO
+A72F..A731 ; Ll # [3] LATIN SMALL LETTER CUATRILLO WITH COMMA..LATIN LETTER SMALL CAPITAL S
+A733 ; Ll # LATIN SMALL LETTER AA
+A735 ; Ll # LATIN SMALL LETTER AO
+A737 ; Ll # LATIN SMALL LETTER AU
+A739 ; Ll # LATIN SMALL LETTER AV
+A73B ; Ll # LATIN SMALL LETTER AV WITH HORIZONTAL BAR
+A73D ; Ll # LATIN SMALL LETTER AY
+A73F ; Ll # LATIN SMALL LETTER REVERSED C WITH DOT
+A741 ; Ll # LATIN SMALL LETTER K WITH STROKE
+A743 ; Ll # LATIN SMALL LETTER K WITH DIAGONAL STROKE
+A745 ; Ll # LATIN SMALL LETTER K WITH STROKE AND DIAGONAL STROKE
+A747 ; Ll # LATIN SMALL LETTER BROKEN L
+A749 ; Ll # LATIN SMALL LETTER L WITH HIGH STROKE
+A74B ; Ll # LATIN SMALL LETTER O WITH LONG STROKE OVERLAY
+A74D ; Ll # LATIN SMALL LETTER O WITH LOOP
+A74F ; Ll # LATIN SMALL LETTER OO
+A751 ; Ll # LATIN SMALL LETTER P WITH STROKE THROUGH DESCENDER
+A753 ; Ll # LATIN SMALL LETTER P WITH FLOURISH
+A755 ; Ll # LATIN SMALL LETTER P WITH SQUIRREL TAIL
+A757 ; Ll # LATIN SMALL LETTER Q WITH STROKE THROUGH DESCENDER
+A759 ; Ll # LATIN SMALL LETTER Q WITH DIAGONAL STROKE
+A75B ; Ll # LATIN SMALL LETTER R ROTUNDA
+A75D ; Ll # LATIN SMALL LETTER RUM ROTUNDA
+A75F ; Ll # LATIN SMALL LETTER V WITH DIAGONAL STROKE
+A761 ; Ll # LATIN SMALL LETTER VY
+A763 ; Ll # LATIN SMALL LETTER VISIGOTHIC Z
+A765 ; Ll # LATIN SMALL LETTER THORN WITH STROKE
+A767 ; Ll # LATIN SMALL LETTER THORN WITH STROKE THROUGH DESCENDER
+A769 ; Ll # LATIN SMALL LETTER VEND
+A76B ; Ll # LATIN SMALL LETTER ET
+A76D ; Ll # LATIN SMALL LETTER IS
+A76F ; Ll # LATIN SMALL LETTER CON
+A771..A778 ; Ll # [8] LATIN SMALL LETTER DUM..LATIN SMALL LETTER UM
+A77A ; Ll # LATIN SMALL LETTER INSULAR D
+A77C ; Ll # LATIN SMALL LETTER INSULAR F
+A77F ; Ll # LATIN SMALL LETTER TURNED INSULAR G
+A781 ; Ll # LATIN SMALL LETTER TURNED L
+A783 ; Ll # LATIN SMALL LETTER INSULAR R
+A785 ; Ll # LATIN SMALL LETTER INSULAR S
+A787 ; Ll # LATIN SMALL LETTER INSULAR T
+A78C ; Ll # LATIN SMALL LETTER SALTILLO
+A78E ; Ll # LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT
+A791 ; Ll # LATIN SMALL LETTER N WITH DESCENDER
+A793..A795 ; Ll # [3] LATIN SMALL LETTER C WITH BAR..LATIN SMALL LETTER H WITH PALATAL HOOK
+A797 ; Ll # LATIN SMALL LETTER B WITH FLOURISH
+A799 ; Ll # LATIN SMALL LETTER F WITH STROKE
+A79B ; Ll # LATIN SMALL LETTER VOLAPUK AE
+A79D ; Ll # LATIN SMALL LETTER VOLAPUK OE
+A79F ; Ll # LATIN SMALL LETTER VOLAPUK UE
+A7A1 ; Ll # LATIN SMALL LETTER G WITH OBLIQUE STROKE
+A7A3 ; Ll # LATIN SMALL LETTER K WITH OBLIQUE STROKE
+A7A5 ; Ll # LATIN SMALL LETTER N WITH OBLIQUE STROKE
+A7A7 ; Ll # LATIN SMALL LETTER R WITH OBLIQUE STROKE
+A7A9 ; Ll # LATIN SMALL LETTER S WITH OBLIQUE STROKE
+A7AF ; Ll # LATIN LETTER SMALL CAPITAL Q
+A7B5 ; Ll # LATIN SMALL LETTER BETA
+A7B7 ; Ll # LATIN SMALL LETTER OMEGA
+A7B9 ; Ll # LATIN SMALL LETTER U WITH STROKE
+A7BB ; Ll # LATIN SMALL LETTER GLOTTAL A
+A7BD ; Ll # LATIN SMALL LETTER GLOTTAL I
+A7BF ; Ll # LATIN SMALL LETTER GLOTTAL U
+A7C1 ; Ll # LATIN SMALL LETTER OLD POLISH O
+A7C3 ; Ll # LATIN SMALL LETTER ANGLICANA W
+A7C8 ; Ll # LATIN SMALL LETTER D WITH SHORT STROKE OVERLAY
+A7CA ; Ll # LATIN SMALL LETTER S WITH SHORT STROKE OVERLAY
+A7CD ; Ll # LATIN SMALL LETTER S WITH DIAGONAL STROKE
+A7D1 ; Ll # LATIN SMALL LETTER CLOSED INSULAR G
+A7D3 ; Ll # LATIN SMALL LETTER DOUBLE THORN
+A7D5 ; Ll # LATIN SMALL LETTER DOUBLE WYNN
+A7D7 ; Ll # LATIN SMALL LETTER MIDDLE SCOTS S
+A7D9 ; Ll # LATIN SMALL LETTER SIGMOID S
+A7DB ; Ll # LATIN SMALL LETTER LAMBDA
+A7F6 ; Ll # LATIN SMALL LETTER REVERSED HALF H
+A7FA ; Ll # LATIN LETTER SMALL CAPITAL TURNED M
+AB30..AB5A ; Ll # [43] LATIN SMALL LETTER BARRED ALPHA..LATIN SMALL LETTER Y WITH SHORT RIGHT LEG
+AB60..AB68 ; Ll # [9] LATIN SMALL LETTER SAKHA YAT..LATIN SMALL LETTER TURNED R WITH MIDDLE TILDE
+AB70..ABBF ; Ll # [80] CHEROKEE SMALL LETTER A..CHEROKEE SMALL LETTER YA
+FB00..FB06 ; Ll # [7] LATIN SMALL LIGATURE FF..LATIN SMALL LIGATURE ST
+FB13..FB17 ; Ll # [5] ARMENIAN SMALL LIGATURE MEN NOW..ARMENIAN SMALL LIGATURE MEN XEH
+FF41..FF5A ; Ll # [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN SMALL LETTER Z
+10428..1044F ; Ll # [40] DESERET SMALL LETTER LONG I..DESERET SMALL LETTER EW
+104D8..104FB ; Ll # [36] OSAGE SMALL LETTER A..OSAGE SMALL LETTER ZHA
+10597..105A1 ; Ll # [11] VITHKUQI SMALL LETTER A..VITHKUQI SMALL LETTER GA
+105A3..105B1 ; Ll # [15] VITHKUQI SMALL LETTER HA..VITHKUQI SMALL LETTER RE
+105B3..105B9 ; Ll # [7] VITHKUQI SMALL LETTER SE..VITHKUQI SMALL LETTER XE
+105BB..105BC ; Ll # [2] VITHKUQI SMALL LETTER Y..VITHKUQI SMALL LETTER ZE
+10CC0..10CF2 ; Ll # [51] OLD HUNGARIAN SMALL LETTER A..OLD HUNGARIAN SMALL LETTER US
+10D70..10D85 ; Ll # [22] GARAY SMALL LETTER A..GARAY SMALL LETTER OLD NA
+118C0..118DF ; Ll # [32] WARANG CITI SMALL LETTER NGAA..WARANG CITI SMALL LETTER VIYO
+16E60..16E7F ; Ll # [32] MEDEFAIDRIN SMALL LETTER M..MEDEFAIDRIN SMALL LETTER Y
+1D41A..1D433 ; Ll # [26] MATHEMATICAL BOLD SMALL A..MATHEMATICAL BOLD SMALL Z
+1D44E..1D454 ; Ll # [7] MATHEMATICAL ITALIC SMALL A..MATHEMATICAL ITALIC SMALL G
+1D456..1D467 ; Ll # [18] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL ITALIC SMALL Z
+1D482..1D49B ; Ll # [26] MATHEMATICAL BOLD ITALIC SMALL A..MATHEMATICAL BOLD ITALIC SMALL Z
+1D4B6..1D4B9 ; Ll # [4] MATHEMATICAL SCRIPT SMALL A..MATHEMATICAL SCRIPT SMALL D
+1D4BB ; Ll # MATHEMATICAL SCRIPT SMALL F
+1D4BD..1D4C3 ; Ll # [7] MATHEMATICAL SCRIPT SMALL H..MATHEMATICAL SCRIPT SMALL N
+1D4C5..1D4CF ; Ll # [11] MATHEMATICAL SCRIPT SMALL P..MATHEMATICAL SCRIPT SMALL Z
+1D4EA..1D503 ; Ll # [26] MATHEMATICAL BOLD SCRIPT SMALL A..MATHEMATICAL BOLD SCRIPT SMALL Z
+1D51E..1D537 ; Ll # [26] MATHEMATICAL FRAKTUR SMALL A..MATHEMATICAL FRAKTUR SMALL Z
+1D552..1D56B ; Ll # [26] MATHEMATICAL DOUBLE-STRUCK SMALL A..MATHEMATICAL DOUBLE-STRUCK SMALL Z
+1D586..1D59F ; Ll # [26] MATHEMATICAL BOLD FRAKTUR SMALL A..MATHEMATICAL BOLD FRAKTUR SMALL Z
+1D5BA..1D5D3 ; Ll # [26] MATHEMATICAL SANS-SERIF SMALL A..MATHEMATICAL SANS-SERIF SMALL Z
+1D5EE..1D607 ; Ll # [26] MATHEMATICAL SANS-SERIF BOLD SMALL A..MATHEMATICAL SANS-SERIF BOLD SMALL Z
+1D622..1D63B ; Ll # [26] MATHEMATICAL SANS-SERIF ITALIC SMALL A..MATHEMATICAL SANS-SERIF ITALIC SMALL Z
+1D656..1D66F ; Ll # [26] MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL A..MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL Z
+1D68A..1D6A5 ; Ll # [28] MATHEMATICAL MONOSPACE SMALL A..MATHEMATICAL ITALIC SMALL DOTLESS J
+1D6C2..1D6DA ; Ll # [25] MATHEMATICAL BOLD SMALL ALPHA..MATHEMATICAL BOLD SMALL OMEGA
+1D6DC..1D6E1 ; Ll # [6] MATHEMATICAL BOLD EPSILON SYMBOL..MATHEMATICAL BOLD PI SYMBOL
+1D6FC..1D714 ; Ll # [25] MATHEMATICAL ITALIC SMALL ALPHA..MATHEMATICAL ITALIC SMALL OMEGA
+1D716..1D71B ; Ll # [6] MATHEMATICAL ITALIC EPSILON SYMBOL..MATHEMATICAL ITALIC PI SYMBOL
+1D736..1D74E ; Ll # [25] MATHEMATICAL BOLD ITALIC SMALL ALPHA..MATHEMATICAL BOLD ITALIC SMALL OMEGA
+1D750..1D755 ; Ll # [6] MATHEMATICAL BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD ITALIC PI SYMBOL
+1D770..1D788 ; Ll # [25] MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA
+1D78A..1D78F ; Ll # [6] MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD PI SYMBOL
+1D7AA..1D7C2 ; Ll # [25] MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA
+1D7C4..1D7C9 ; Ll # [6] MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL
+1D7CB ; Ll # MATHEMATICAL BOLD SMALL DIGAMMA
+1DF00..1DF09 ; Ll # [10] LATIN SMALL LETTER FENG DIGRAPH WITH TRILL..LATIN SMALL LETTER T WITH HOOK AND RETROFLEX HOOK
+1DF0B..1DF1E ; Ll # [20] LATIN SMALL LETTER ESH WITH DOUBLE BAR..LATIN SMALL LETTER S WITH CURL
+1DF25..1DF2A ; Ll # [6] LATIN SMALL LETTER D WITH MID-HEIGHT LEFT HOOK..LATIN SMALL LETTER T WITH MID-HEIGHT LEFT HOOK
+1E922..1E943 ; Ll # [34] ADLAM SMALL LETTER ALIF..ADLAM SMALL LETTER SHA
+
+# Total code points: 2258
+
+# ================================================
+
+# General_Category=Titlecase_Letter
+
+01C5 ; Lt # LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
+01C8 ; Lt # LATIN CAPITAL LETTER L WITH SMALL LETTER J
+01CB ; Lt # LATIN CAPITAL LETTER N WITH SMALL LETTER J
+01F2 ; Lt # LATIN CAPITAL LETTER D WITH SMALL LETTER Z
+1F88..1F8F ; Lt # [8] GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI..GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+1F98..1F9F ; Lt # [8] GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI..GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+1FA8..1FAF ; Lt # [8] GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI..GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+1FBC ; Lt # GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
+1FCC ; Lt # GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
+1FFC ; Lt # GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
+
+# Total code points: 31
+
+# ================================================
+
+# General_Category=Modifier_Letter
+
+02B0..02C1 ; Lm # [18] MODIFIER LETTER SMALL H..MODIFIER LETTER REVERSED GLOTTAL STOP
+02C6..02D1 ; Lm # [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON
+02E0..02E4 ; Lm # [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
+02EC ; Lm # MODIFIER LETTER VOICING
+02EE ; Lm # MODIFIER LETTER DOUBLE APOSTROPHE
+0374 ; Lm # GREEK NUMERAL SIGN
+037A ; Lm # GREEK YPOGEGRAMMENI
+0559 ; Lm # ARMENIAN MODIFIER LETTER LEFT HALF RING
+0640 ; Lm # ARABIC TATWEEL
+06E5..06E6 ; Lm # [2] ARABIC SMALL WAW..ARABIC SMALL YEH
+07F4..07F5 ; Lm # [2] NKO HIGH TONE APOSTROPHE..NKO LOW TONE APOSTROPHE
+07FA ; Lm # NKO LAJANYALAN
+081A ; Lm # SAMARITAN MODIFIER LETTER EPENTHETIC YUT
+0824 ; Lm # SAMARITAN MODIFIER LETTER SHORT A
+0828 ; Lm # SAMARITAN MODIFIER LETTER I
+08C9 ; Lm # ARABIC SMALL FARSI YEH
+0971 ; Lm # DEVANAGARI SIGN HIGH SPACING DOT
+0E46 ; Lm # THAI CHARACTER MAIYAMOK
+0EC6 ; Lm # LAO KO LA
+10FC ; Lm # MODIFIER LETTER GEORGIAN NAR
+17D7 ; Lm # KHMER SIGN LEK TOO
+1843 ; Lm # MONGOLIAN LETTER TODO LONG VOWEL SIGN
+1AA7 ; Lm # TAI THAM SIGN MAI YAMOK
+1C78..1C7D ; Lm # [6] OL CHIKI MU TTUDDAG..OL CHIKI AHAD
+1D2C..1D6A ; Lm # [63] MODIFIER LETTER CAPITAL A..GREEK SUBSCRIPT SMALL LETTER CHI
+1D78 ; Lm # MODIFIER LETTER CYRILLIC EN
+1D9B..1DBF ; Lm # [37] MODIFIER LETTER SMALL TURNED ALPHA..MODIFIER LETTER SMALL THETA
+2071 ; Lm # SUPERSCRIPT LATIN SMALL LETTER I
+207F ; Lm # SUPERSCRIPT LATIN SMALL LETTER N
+2090..209C ; Lm # [13] LATIN SUBSCRIPT SMALL LETTER A..LATIN SUBSCRIPT SMALL LETTER T
+2C7C..2C7D ; Lm # [2] LATIN SUBSCRIPT SMALL LETTER J..MODIFIER LETTER CAPITAL V
+2D6F ; Lm # TIFINAGH MODIFIER LETTER LABIALIZATION MARK
+2E2F ; Lm # VERTICAL TILDE
+3005 ; Lm # IDEOGRAPHIC ITERATION MARK
+3031..3035 ; Lm # [5] VERTICAL KANA REPEAT MARK..VERTICAL KANA REPEAT MARK LOWER HALF
+303B ; Lm # VERTICAL IDEOGRAPHIC ITERATION MARK
+309D..309E ; Lm # [2] HIRAGANA ITERATION MARK..HIRAGANA VOICED ITERATION MARK
+30FC..30FE ; Lm # [3] KATAKANA-HIRAGANA PROLONGED SOUND MARK..KATAKANA VOICED ITERATION MARK
+A015 ; Lm # YI SYLLABLE WU
+A4F8..A4FD ; Lm # [6] LISU LETTER TONE MYA TI..LISU LETTER TONE MYA JEU
+A60C ; Lm # VAI SYLLABLE LENGTHENER
+A67F ; Lm # CYRILLIC PAYEROK
+A69C..A69D ; Lm # [2] MODIFIER LETTER CYRILLIC HARD SIGN..MODIFIER LETTER CYRILLIC SOFT SIGN
+A717..A71F ; Lm # [9] MODIFIER LETTER DOT VERTICAL BAR..MODIFIER LETTER LOW INVERTED EXCLAMATION MARK
+A770 ; Lm # MODIFIER LETTER US
+A788 ; Lm # MODIFIER LETTER LOW CIRCUMFLEX ACCENT
+A7F2..A7F4 ; Lm # [3] MODIFIER LETTER CAPITAL C..MODIFIER LETTER CAPITAL Q
+A7F8..A7F9 ; Lm # [2] MODIFIER LETTER CAPITAL H WITH STROKE..MODIFIER LETTER SMALL LIGATURE OE
+A9CF ; Lm # JAVANESE PANGRANGKEP
+A9E6 ; Lm # MYANMAR MODIFIER LETTER SHAN REDUPLICATION
+AA70 ; Lm # MYANMAR MODIFIER LETTER KHAMTI REDUPLICATION
+AADD ; Lm # TAI VIET SYMBOL SAM
+AAF3..AAF4 ; Lm # [2] MEETEI MAYEK SYLLABLE REPETITION MARK..MEETEI MAYEK WORD REPETITION MARK
+AB5C..AB5F ; Lm # [4] MODIFIER LETTER SMALL HENG..MODIFIER LETTER SMALL U WITH LEFT HOOK
+AB69 ; Lm # MODIFIER LETTER SMALL TURNED W
+FF70 ; Lm # HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK
+FF9E..FF9F ; Lm # [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+10780..10785 ; Lm # [6] MODIFIER LETTER SMALL CAPITAL AA..MODIFIER LETTER SMALL B WITH HOOK
+10787..107B0 ; Lm # [42] MODIFIER LETTER SMALL DZ DIGRAPH..MODIFIER LETTER SMALL V WITH RIGHT HOOK
+107B2..107BA ; Lm # [9] MODIFIER LETTER SMALL CAPITAL Y..MODIFIER LETTER SMALL S WITH CURL
+10D4E ; Lm # GARAY VOWEL LENGTH MARK
+10D6F ; Lm # GARAY REDUPLICATION MARK
+16B40..16B43 ; Lm # [4] PAHAWH HMONG SIGN VOS SEEV..PAHAWH HMONG SIGN IB YAM
+16D40..16D42 ; Lm # [3] KIRAT RAI SIGN ANUSVARA..KIRAT RAI SIGN VISARGA
+16D6B..16D6C ; Lm # [2] KIRAT RAI SIGN VIRAMA..KIRAT RAI SIGN SAAT
+16F93..16F9F ; Lm # [13] MIAO LETTER TONE-2..MIAO LETTER REFORMED TONE-8
+16FE0..16FE1 ; Lm # [2] TANGUT ITERATION MARK..NUSHU ITERATION MARK
+16FE3 ; Lm # OLD CHINESE ITERATION MARK
+1AFF0..1AFF3 ; Lm # [4] KATAKANA LETTER MINNAN TONE-2..KATAKANA LETTER MINNAN TONE-5
+1AFF5..1AFFB ; Lm # [7] KATAKANA LETTER MINNAN TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-5
+1AFFD..1AFFE ; Lm # [2] KATAKANA LETTER MINNAN NASALIZED TONE-7..KATAKANA LETTER MINNAN NASALIZED TONE-8
+1E030..1E06D ; Lm # [62] MODIFIER LETTER CYRILLIC SMALL A..MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE
+1E137..1E13D ; Lm # [7] NYIAKENG PUACHUE HMONG SIGN FOR PERSON..NYIAKENG PUACHUE HMONG SYLLABLE LENGTHENER
+1E4EB ; Lm # NAG MUNDARI SIGN OJOD
+1E94B ; Lm # ADLAM NASALIZATION MARK
+
+# Total code points: 404
+
+# ================================================
+
+# General_Category=Other_Letter
+
+00AA ; Lo # FEMININE ORDINAL INDICATOR
+00BA ; Lo # MASCULINE ORDINAL INDICATOR
+01BB ; Lo # LATIN LETTER TWO WITH STROKE
+01C0..01C3 ; Lo # [4] LATIN LETTER DENTAL CLICK..LATIN LETTER RETROFLEX CLICK
+0294 ; Lo # LATIN LETTER GLOTTAL STOP
+05D0..05EA ; Lo # [27] HEBREW LETTER ALEF..HEBREW LETTER TAV
+05EF..05F2 ; Lo # [4] HEBREW YOD TRIANGLE..HEBREW LIGATURE YIDDISH DOUBLE YOD
+0620..063F ; Lo # [32] ARABIC LETTER KASHMIRI YEH..ARABIC LETTER FARSI YEH WITH THREE DOTS ABOVE
+0641..064A ; Lo # [10] ARABIC LETTER FEH..ARABIC LETTER YEH
+066E..066F ; Lo # [2] ARABIC LETTER DOTLESS BEH..ARABIC LETTER DOTLESS QAF
+0671..06D3 ; Lo # [99] ARABIC LETTER ALEF WASLA..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE
+06D5 ; Lo # ARABIC LETTER AE
+06EE..06EF ; Lo # [2] ARABIC LETTER DAL WITH INVERTED V..ARABIC LETTER REH WITH INVERTED V
+06FA..06FC ; Lo # [3] ARABIC LETTER SHEEN WITH DOT BELOW..ARABIC LETTER GHAIN WITH DOT BELOW
+06FF ; Lo # ARABIC LETTER HEH WITH INVERTED V
+0710 ; Lo # SYRIAC LETTER ALAPH
+0712..072F ; Lo # [30] SYRIAC LETTER BETH..SYRIAC LETTER PERSIAN DHALATH
+074D..07A5 ; Lo # [89] SYRIAC LETTER SOGDIAN ZHAIN..THAANA LETTER WAAVU
+07B1 ; Lo # THAANA LETTER NAA
+07CA..07EA ; Lo # [33] NKO LETTER A..NKO LETTER JONA RA
+0800..0815 ; Lo # [22] SAMARITAN LETTER ALAF..SAMARITAN LETTER TAAF
+0840..0858 ; Lo # [25] MANDAIC LETTER HALQA..MANDAIC LETTER AIN
+0860..086A ; Lo # [11] SYRIAC LETTER MALAYALAM NGA..SYRIAC LETTER MALAYALAM SSA
+0870..0887 ; Lo # [24] ARABIC LETTER ALEF WITH ATTACHED FATHA..ARABIC BASELINE ROUND DOT
+0889..088E ; Lo # [6] ARABIC LETTER NOON WITH INVERTED SMALL V..ARABIC VERTICAL TAIL
+08A0..08C8 ; Lo # [41] ARABIC LETTER BEH WITH SMALL V BELOW..ARABIC LETTER GRAF
+0904..0939 ; Lo # [54] DEVANAGARI LETTER SHORT A..DEVANAGARI LETTER HA
+093D ; Lo # DEVANAGARI SIGN AVAGRAHA
+0950 ; Lo # DEVANAGARI OM
+0958..0961 ; Lo # [10] DEVANAGARI LETTER QA..DEVANAGARI LETTER VOCALIC LL
+0972..0980 ; Lo # [15] DEVANAGARI LETTER CANDRA A..BENGALI ANJI
+0985..098C ; Lo # [8] BENGALI LETTER A..BENGALI LETTER VOCALIC L
+098F..0990 ; Lo # [2] BENGALI LETTER E..BENGALI LETTER AI
+0993..09A8 ; Lo # [22] BENGALI LETTER O..BENGALI LETTER NA
+09AA..09B0 ; Lo # [7] BENGALI LETTER PA..BENGALI LETTER RA
+09B2 ; Lo # BENGALI LETTER LA
+09B6..09B9 ; Lo # [4] BENGALI LETTER SHA..BENGALI LETTER HA
+09BD ; Lo # BENGALI SIGN AVAGRAHA
+09CE ; Lo # BENGALI LETTER KHANDA TA
+09DC..09DD ; Lo # [2] BENGALI LETTER RRA..BENGALI LETTER RHA
+09DF..09E1 ; Lo # [3] BENGALI LETTER YYA..BENGALI LETTER VOCALIC LL
+09F0..09F1 ; Lo # [2] BENGALI LETTER RA WITH MIDDLE DIAGONAL..BENGALI LETTER RA WITH LOWER DIAGONAL
+09FC ; Lo # BENGALI LETTER VEDIC ANUSVARA
+0A05..0A0A ; Lo # [6] GURMUKHI LETTER A..GURMUKHI LETTER UU
+0A0F..0A10 ; Lo # [2] GURMUKHI LETTER EE..GURMUKHI LETTER AI
+0A13..0A28 ; Lo # [22] GURMUKHI LETTER OO..GURMUKHI LETTER NA
+0A2A..0A30 ; Lo # [7] GURMUKHI LETTER PA..GURMUKHI LETTER RA
+0A32..0A33 ; Lo # [2] GURMUKHI LETTER LA..GURMUKHI LETTER LLA
+0A35..0A36 ; Lo # [2] GURMUKHI LETTER VA..GURMUKHI LETTER SHA
+0A38..0A39 ; Lo # [2] GURMUKHI LETTER SA..GURMUKHI LETTER HA
+0A59..0A5C ; Lo # [4] GURMUKHI LETTER KHHA..GURMUKHI LETTER RRA
+0A5E ; Lo # GURMUKHI LETTER FA
+0A72..0A74 ; Lo # [3] GURMUKHI IRI..GURMUKHI EK ONKAR
+0A85..0A8D ; Lo # [9] GUJARATI LETTER A..GUJARATI VOWEL CANDRA E
+0A8F..0A91 ; Lo # [3] GUJARATI LETTER E..GUJARATI VOWEL CANDRA O
+0A93..0AA8 ; Lo # [22] GUJARATI LETTER O..GUJARATI LETTER NA
+0AAA..0AB0 ; Lo # [7] GUJARATI LETTER PA..GUJARATI LETTER RA
+0AB2..0AB3 ; Lo # [2] GUJARATI LETTER LA..GUJARATI LETTER LLA
+0AB5..0AB9 ; Lo # [5] GUJARATI LETTER VA..GUJARATI LETTER HA
+0ABD ; Lo # GUJARATI SIGN AVAGRAHA
+0AD0 ; Lo # GUJARATI OM
+0AE0..0AE1 ; Lo # [2] GUJARATI LETTER VOCALIC RR..GUJARATI LETTER VOCALIC LL
+0AF9 ; Lo # GUJARATI LETTER ZHA
+0B05..0B0C ; Lo # [8] ORIYA LETTER A..ORIYA LETTER VOCALIC L
+0B0F..0B10 ; Lo # [2] ORIYA LETTER E..ORIYA LETTER AI
+0B13..0B28 ; Lo # [22] ORIYA LETTER O..ORIYA LETTER NA
+0B2A..0B30 ; Lo # [7] ORIYA LETTER PA..ORIYA LETTER RA
+0B32..0B33 ; Lo # [2] ORIYA LETTER LA..ORIYA LETTER LLA
+0B35..0B39 ; Lo # [5] ORIYA LETTER VA..ORIYA LETTER HA
+0B3D ; Lo # ORIYA SIGN AVAGRAHA
+0B5C..0B5D ; Lo # [2] ORIYA LETTER RRA..ORIYA LETTER RHA
+0B5F..0B61 ; Lo # [3] ORIYA LETTER YYA..ORIYA LETTER VOCALIC LL
+0B71 ; Lo # ORIYA LETTER WA
+0B83 ; Lo # TAMIL SIGN VISARGA
+0B85..0B8A ; Lo # [6] TAMIL LETTER A..TAMIL LETTER UU
+0B8E..0B90 ; Lo # [3] TAMIL LETTER E..TAMIL LETTER AI
+0B92..0B95 ; Lo # [4] TAMIL LETTER O..TAMIL LETTER KA
+0B99..0B9A ; Lo # [2] TAMIL LETTER NGA..TAMIL LETTER CA
+0B9C ; Lo # TAMIL LETTER JA
+0B9E..0B9F ; Lo # [2] TAMIL LETTER NYA..TAMIL LETTER TTA
+0BA3..0BA4 ; Lo # [2] TAMIL LETTER NNA..TAMIL LETTER TA
+0BA8..0BAA ; Lo # [3] TAMIL LETTER NA..TAMIL LETTER PA
+0BAE..0BB9 ; Lo # [12] TAMIL LETTER MA..TAMIL LETTER HA
+0BD0 ; Lo # TAMIL OM
+0C05..0C0C ; Lo # [8] TELUGU LETTER A..TELUGU LETTER VOCALIC L
+0C0E..0C10 ; Lo # [3] TELUGU LETTER E..TELUGU LETTER AI
+0C12..0C28 ; Lo # [23] TELUGU LETTER O..TELUGU LETTER NA
+0C2A..0C39 ; Lo # [16] TELUGU LETTER PA..TELUGU LETTER HA
+0C3D ; Lo # TELUGU SIGN AVAGRAHA
+0C58..0C5A ; Lo # [3] TELUGU LETTER TSA..TELUGU LETTER RRRA
+0C5D ; Lo # TELUGU LETTER NAKAARA POLLU
+0C60..0C61 ; Lo # [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL
+0C80 ; Lo # KANNADA SIGN SPACING CANDRABINDU
+0C85..0C8C ; Lo # [8] KANNADA LETTER A..KANNADA LETTER VOCALIC L
+0C8E..0C90 ; Lo # [3] KANNADA LETTER E..KANNADA LETTER AI
+0C92..0CA8 ; Lo # [23] KANNADA LETTER O..KANNADA LETTER NA
+0CAA..0CB3 ; Lo # [10] KANNADA LETTER PA..KANNADA LETTER LLA
+0CB5..0CB9 ; Lo # [5] KANNADA LETTER VA..KANNADA LETTER HA
+0CBD ; Lo # KANNADA SIGN AVAGRAHA
+0CDD..0CDE ; Lo # [2] KANNADA LETTER NAKAARA POLLU..KANNADA LETTER FA
+0CE0..0CE1 ; Lo # [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL
+0CF1..0CF2 ; Lo # [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA
+0D04..0D0C ; Lo # [9] MALAYALAM LETTER VEDIC ANUSVARA..MALAYALAM LETTER VOCALIC L
+0D0E..0D10 ; Lo # [3] MALAYALAM LETTER E..MALAYALAM LETTER AI
+0D12..0D3A ; Lo # [41] MALAYALAM LETTER O..MALAYALAM LETTER TTTA
+0D3D ; Lo # MALAYALAM SIGN AVAGRAHA
+0D4E ; Lo # MALAYALAM LETTER DOT REPH
+0D54..0D56 ; Lo # [3] MALAYALAM LETTER CHILLU M..MALAYALAM LETTER CHILLU LLL
+0D5F..0D61 ; Lo # [3] MALAYALAM LETTER ARCHAIC II..MALAYALAM LETTER VOCALIC LL
+0D7A..0D7F ; Lo # [6] MALAYALAM LETTER CHILLU NN..MALAYALAM LETTER CHILLU K
+0D85..0D96 ; Lo # [18] SINHALA LETTER AYANNA..SINHALA LETTER AUYANNA
+0D9A..0DB1 ; Lo # [24] SINHALA LETTER ALPAPRAANA KAYANNA..SINHALA LETTER DANTAJA NAYANNA
+0DB3..0DBB ; Lo # [9] SINHALA LETTER SANYAKA DAYANNA..SINHALA LETTER RAYANNA
+0DBD ; Lo # SINHALA LETTER DANTAJA LAYANNA
+0DC0..0DC6 ; Lo # [7] SINHALA LETTER VAYANNA..SINHALA LETTER FAYANNA
+0E01..0E30 ; Lo # [48] THAI CHARACTER KO KAI..THAI CHARACTER SARA A
+0E32..0E33 ; Lo # [2] THAI CHARACTER SARA AA..THAI CHARACTER SARA AM
+0E40..0E45 ; Lo # [6] THAI CHARACTER SARA E..THAI CHARACTER LAKKHANGYAO
+0E81..0E82 ; Lo # [2] LAO LETTER KO..LAO LETTER KHO SUNG
+0E84 ; Lo # LAO LETTER KHO TAM
+0E86..0E8A ; Lo # [5] LAO LETTER PALI GHA..LAO LETTER SO TAM
+0E8C..0EA3 ; Lo # [24] LAO LETTER PALI JHA..LAO LETTER LO LING
+0EA5 ; Lo # LAO LETTER LO LOOT
+0EA7..0EB0 ; Lo # [10] LAO LETTER WO..LAO VOWEL SIGN A
+0EB2..0EB3 ; Lo # [2] LAO VOWEL SIGN AA..LAO VOWEL SIGN AM
+0EBD ; Lo # LAO SEMIVOWEL SIGN NYO
+0EC0..0EC4 ; Lo # [5] LAO VOWEL SIGN E..LAO VOWEL SIGN AI
+0EDC..0EDF ; Lo # [4] LAO HO NO..LAO LETTER KHMU NYO
+0F00 ; Lo # TIBETAN SYLLABLE OM
+0F40..0F47 ; Lo # [8] TIBETAN LETTER KA..TIBETAN LETTER JA
+0F49..0F6C ; Lo # [36] TIBETAN LETTER NYA..TIBETAN LETTER RRA
+0F88..0F8C ; Lo # [5] TIBETAN SIGN LCE TSA CAN..TIBETAN SIGN INVERTED MCHU CAN
+1000..102A ; Lo # [43] MYANMAR LETTER KA..MYANMAR LETTER AU
+103F ; Lo # MYANMAR LETTER GREAT SA
+1050..1055 ; Lo # [6] MYANMAR LETTER SHA..MYANMAR LETTER VOCALIC LL
+105A..105D ; Lo # [4] MYANMAR LETTER MON NGA..MYANMAR LETTER MON BBE
+1061 ; Lo # MYANMAR LETTER SGAW KAREN SHA
+1065..1066 ; Lo # [2] MYANMAR LETTER WESTERN PWO KAREN THA..MYANMAR LETTER WESTERN PWO KAREN PWA
+106E..1070 ; Lo # [3] MYANMAR LETTER EASTERN PWO KAREN NNA..MYANMAR LETTER EASTERN PWO KAREN GHWA
+1075..1081 ; Lo # [13] MYANMAR LETTER SHAN KA..MYANMAR LETTER SHAN HA
+108E ; Lo # MYANMAR LETTER RUMAI PALAUNG FA
+1100..1248 ; Lo # [329] HANGUL CHOSEONG KIYEOK..ETHIOPIC SYLLABLE QWA
+124A..124D ; Lo # [4] ETHIOPIC SYLLABLE QWI..ETHIOPIC SYLLABLE QWE
+1250..1256 ; Lo # [7] ETHIOPIC SYLLABLE QHA..ETHIOPIC SYLLABLE QHO
+1258 ; Lo # ETHIOPIC SYLLABLE QHWA
+125A..125D ; Lo # [4] ETHIOPIC SYLLABLE QHWI..ETHIOPIC SYLLABLE QHWE
+1260..1288 ; Lo # [41] ETHIOPIC SYLLABLE BA..ETHIOPIC SYLLABLE XWA
+128A..128D ; Lo # [4] ETHIOPIC SYLLABLE XWI..ETHIOPIC SYLLABLE XWE
+1290..12B0 ; Lo # [33] ETHIOPIC SYLLABLE NA..ETHIOPIC SYLLABLE KWA
+12B2..12B5 ; Lo # [4] ETHIOPIC SYLLABLE KWI..ETHIOPIC SYLLABLE KWE
+12B8..12BE ; Lo # [7] ETHIOPIC SYLLABLE KXA..ETHIOPIC SYLLABLE KXO
+12C0 ; Lo # ETHIOPIC SYLLABLE KXWA
+12C2..12C5 ; Lo # [4] ETHIOPIC SYLLABLE KXWI..ETHIOPIC SYLLABLE KXWE
+12C8..12D6 ; Lo # [15] ETHIOPIC SYLLABLE WA..ETHIOPIC SYLLABLE PHARYNGEAL O
+12D8..1310 ; Lo # [57] ETHIOPIC SYLLABLE ZA..ETHIOPIC SYLLABLE GWA
+1312..1315 ; Lo # [4] ETHIOPIC SYLLABLE GWI..ETHIOPIC SYLLABLE GWE
+1318..135A ; Lo # [67] ETHIOPIC SYLLABLE GGA..ETHIOPIC SYLLABLE FYA
+1380..138F ; Lo # [16] ETHIOPIC SYLLABLE SEBATBEIT MWA..ETHIOPIC SYLLABLE PWE
+1401..166C ; Lo # [620] CANADIAN SYLLABICS E..CANADIAN SYLLABICS CARRIER TTSA
+166F..167F ; Lo # [17] CANADIAN SYLLABICS QAI..CANADIAN SYLLABICS BLACKFOOT W
+1681..169A ; Lo # [26] OGHAM LETTER BEITH..OGHAM LETTER PEITH
+16A0..16EA ; Lo # [75] RUNIC LETTER FEHU FEOH FE F..RUNIC LETTER X
+16F1..16F8 ; Lo # [8] RUNIC LETTER K..RUNIC LETTER FRANKS CASKET AESC
+1700..1711 ; Lo # [18] TAGALOG LETTER A..TAGALOG LETTER HA
+171F..1731 ; Lo # [19] TAGALOG LETTER ARCHAIC RA..HANUNOO LETTER HA
+1740..1751 ; Lo # [18] BUHID LETTER A..BUHID LETTER HA
+1760..176C ; Lo # [13] TAGBANWA LETTER A..TAGBANWA LETTER YA
+176E..1770 ; Lo # [3] TAGBANWA LETTER LA..TAGBANWA LETTER SA
+1780..17B3 ; Lo # [52] KHMER LETTER KA..KHMER INDEPENDENT VOWEL QAU
+17DC ; Lo # KHMER SIGN AVAKRAHASANYA
+1820..1842 ; Lo # [35] MONGOLIAN LETTER A..MONGOLIAN LETTER CHI
+1844..1878 ; Lo # [53] MONGOLIAN LETTER TODO E..MONGOLIAN LETTER CHA WITH TWO DOTS
+1880..1884 ; Lo # [5] MONGOLIAN LETTER ALI GALI ANUSVARA ONE..MONGOLIAN LETTER ALI GALI INVERTED UBADAMA
+1887..18A8 ; Lo # [34] MONGOLIAN LETTER ALI GALI A..MONGOLIAN LETTER MANCHU ALI GALI BHA
+18AA ; Lo # MONGOLIAN LETTER MANCHU ALI GALI LHA
+18B0..18F5 ; Lo # [70] CANADIAN SYLLABICS OY..CANADIAN SYLLABICS CARRIER DENTAL S
+1900..191E ; Lo # [31] LIMBU VOWEL-CARRIER LETTER..LIMBU LETTER TRA
+1950..196D ; Lo # [30] TAI LE LETTER KA..TAI LE LETTER AI
+1970..1974 ; Lo # [5] TAI LE LETTER TONE-2..TAI LE LETTER TONE-6
+1980..19AB ; Lo # [44] NEW TAI LUE LETTER HIGH QA..NEW TAI LUE LETTER LOW SUA
+19B0..19C9 ; Lo # [26] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE TONE MARK-2
+1A00..1A16 ; Lo # [23] BUGINESE LETTER KA..BUGINESE LETTER HA
+1A20..1A54 ; Lo # [53] TAI THAM LETTER HIGH KA..TAI THAM LETTER GREAT SA
+1B05..1B33 ; Lo # [47] BALINESE LETTER AKARA..BALINESE LETTER HA
+1B45..1B4C ; Lo # [8] BALINESE LETTER KAF SASAK..BALINESE LETTER ARCHAIC JNYA
+1B83..1BA0 ; Lo # [30] SUNDANESE LETTER A..SUNDANESE LETTER HA
+1BAE..1BAF ; Lo # [2] SUNDANESE LETTER KHA..SUNDANESE LETTER SYA
+1BBA..1BE5 ; Lo # [44] SUNDANESE AVAGRAHA..BATAK LETTER U
+1C00..1C23 ; Lo # [36] LEPCHA LETTER KA..LEPCHA LETTER A
+1C4D..1C4F ; Lo # [3] LEPCHA LETTER TTA..LEPCHA LETTER DDA
+1C5A..1C77 ; Lo # [30] OL CHIKI LETTER LA..OL CHIKI LETTER OH
+1CE9..1CEC ; Lo # [4] VEDIC SIGN ANUSVARA ANTARGOMUKHA..VEDIC SIGN ANUSVARA VAMAGOMUKHA WITH TAIL
+1CEE..1CF3 ; Lo # [6] VEDIC SIGN HEXIFORM LONG ANUSVARA..VEDIC SIGN ROTATED ARDHAVISARGA
+1CF5..1CF6 ; Lo # [2] VEDIC SIGN JIHVAMULIYA..VEDIC SIGN UPADHMANIYA
+1CFA ; Lo # VEDIC SIGN DOUBLE ANUSVARA ANTARGOMUKHA
+2135..2138 ; Lo # [4] ALEF SYMBOL..DALET SYMBOL
+2D30..2D67 ; Lo # [56] TIFINAGH LETTER YA..TIFINAGH LETTER YO
+2D80..2D96 ; Lo # [23] ETHIOPIC SYLLABLE LOA..ETHIOPIC SYLLABLE GGWE
+2DA0..2DA6 ; Lo # [7] ETHIOPIC SYLLABLE SSA..ETHIOPIC SYLLABLE SSO
+2DA8..2DAE ; Lo # [7] ETHIOPIC SYLLABLE CCA..ETHIOPIC SYLLABLE CCO
+2DB0..2DB6 ; Lo # [7] ETHIOPIC SYLLABLE ZZA..ETHIOPIC SYLLABLE ZZO
+2DB8..2DBE ; Lo # [7] ETHIOPIC SYLLABLE CCHA..ETHIOPIC SYLLABLE CCHO
+2DC0..2DC6 ; Lo # [7] ETHIOPIC SYLLABLE QYA..ETHIOPIC SYLLABLE QYO
+2DC8..2DCE ; Lo # [7] ETHIOPIC SYLLABLE KYA..ETHIOPIC SYLLABLE KYO
+2DD0..2DD6 ; Lo # [7] ETHIOPIC SYLLABLE XYA..ETHIOPIC SYLLABLE XYO
+2DD8..2DDE ; Lo # [7] ETHIOPIC SYLLABLE GYA..ETHIOPIC SYLLABLE GYO
+3006 ; Lo # IDEOGRAPHIC CLOSING MARK
+303C ; Lo # MASU MARK
+3041..3096 ; Lo # [86] HIRAGANA LETTER SMALL A..HIRAGANA LETTER SMALL KE
+309F ; Lo # HIRAGANA DIGRAPH YORI
+30A1..30FA ; Lo # [90] KATAKANA LETTER SMALL A..KATAKANA LETTER VO
+30FF ; Lo # KATAKANA DIGRAPH KOTO
+3105..312F ; Lo # [43] BOPOMOFO LETTER B..BOPOMOFO LETTER NN
+3131..318E ; Lo # [94] HANGUL LETTER KIYEOK..HANGUL LETTER ARAEAE
+31A0..31BF ; Lo # [32] BOPOMOFO LETTER BU..BOPOMOFO LETTER AH
+31F0..31FF ; Lo # [16] KATAKANA LETTER SMALL KU..KATAKANA LETTER SMALL RO
+3400..4DBF ; Lo # [6592] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DBF
+4E00..A014 ; Lo # [21013] CJK UNIFIED IDEOGRAPH-4E00..YI SYLLABLE E
+A016..A48C ; Lo # [1143] YI SYLLABLE BIT..YI SYLLABLE YYR
+A4D0..A4F7 ; Lo # [40] LISU LETTER BA..LISU LETTER OE
+A500..A60B ; Lo # [268] VAI SYLLABLE EE..VAI SYLLABLE NG
+A610..A61F ; Lo # [16] VAI SYLLABLE NDOLE FA..VAI SYMBOL JONG
+A62A..A62B ; Lo # [2] VAI SYLLABLE NDOLE MA..VAI SYLLABLE NDOLE DO
+A66E ; Lo # CYRILLIC LETTER MULTIOCULAR O
+A6A0..A6E5 ; Lo # [70] BAMUM LETTER A..BAMUM LETTER KI
+A78F ; Lo # LATIN LETTER SINOLOGICAL DOT
+A7F7 ; Lo # LATIN EPIGRAPHIC LETTER SIDEWAYS I
+A7FB..A801 ; Lo # [7] LATIN EPIGRAPHIC LETTER REVERSED F..SYLOTI NAGRI LETTER I
+A803..A805 ; Lo # [3] SYLOTI NAGRI LETTER U..SYLOTI NAGRI LETTER O
+A807..A80A ; Lo # [4] SYLOTI NAGRI LETTER KO..SYLOTI NAGRI LETTER GHO
+A80C..A822 ; Lo # [23] SYLOTI NAGRI LETTER CO..SYLOTI NAGRI LETTER HO
+A840..A873 ; Lo # [52] PHAGS-PA LETTER KA..PHAGS-PA LETTER CANDRABINDU
+A882..A8B3 ; Lo # [50] SAURASHTRA LETTER A..SAURASHTRA LETTER LLA
+A8F2..A8F7 ; Lo # [6] DEVANAGARI SIGN SPACING CANDRABINDU..DEVANAGARI SIGN CANDRABINDU AVAGRAHA
+A8FB ; Lo # DEVANAGARI HEADSTROKE
+A8FD..A8FE ; Lo # [2] DEVANAGARI JAIN OM..DEVANAGARI LETTER AY
+A90A..A925 ; Lo # [28] KAYAH LI LETTER KA..KAYAH LI LETTER OO
+A930..A946 ; Lo # [23] REJANG LETTER KA..REJANG LETTER A
+A960..A97C ; Lo # [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH
+A984..A9B2 ; Lo # [47] JAVANESE LETTER A..JAVANESE LETTER HA
+A9E0..A9E4 ; Lo # [5] MYANMAR LETTER SHAN GHA..MYANMAR LETTER SHAN BHA
+A9E7..A9EF ; Lo # [9] MYANMAR LETTER TAI LAING NYA..MYANMAR LETTER TAI LAING NNA
+A9FA..A9FE ; Lo # [5] MYANMAR LETTER TAI LAING LLA..MYANMAR LETTER TAI LAING BHA
+AA00..AA28 ; Lo # [41] CHAM LETTER A..CHAM LETTER HA
+AA40..AA42 ; Lo # [3] CHAM LETTER FINAL K..CHAM LETTER FINAL NG
+AA44..AA4B ; Lo # [8] CHAM LETTER FINAL CH..CHAM LETTER FINAL SS
+AA60..AA6F ; Lo # [16] MYANMAR LETTER KHAMTI GA..MYANMAR LETTER KHAMTI FA
+AA71..AA76 ; Lo # [6] MYANMAR LETTER KHAMTI XA..MYANMAR LOGOGRAM KHAMTI HM
+AA7A ; Lo # MYANMAR LETTER AITON RA
+AA7E..AAAF ; Lo # [50] MYANMAR LETTER SHWE PALAUNG CHA..TAI VIET LETTER HIGH O
+AAB1 ; Lo # TAI VIET VOWEL AA
+AAB5..AAB6 ; Lo # [2] TAI VIET VOWEL E..TAI VIET VOWEL O
+AAB9..AABD ; Lo # [5] TAI VIET VOWEL UEA..TAI VIET VOWEL AN
+AAC0 ; Lo # TAI VIET TONE MAI NUENG
+AAC2 ; Lo # TAI VIET TONE MAI SONG
+AADB..AADC ; Lo # [2] TAI VIET SYMBOL KON..TAI VIET SYMBOL NUENG
+AAE0..AAEA ; Lo # [11] MEETEI MAYEK LETTER E..MEETEI MAYEK LETTER SSA
+AAF2 ; Lo # MEETEI MAYEK ANJI
+AB01..AB06 ; Lo # [6] ETHIOPIC SYLLABLE TTHU..ETHIOPIC SYLLABLE TTHO
+AB09..AB0E ; Lo # [6] ETHIOPIC SYLLABLE DDHU..ETHIOPIC SYLLABLE DDHO
+AB11..AB16 ; Lo # [6] ETHIOPIC SYLLABLE DZU..ETHIOPIC SYLLABLE DZO
+AB20..AB26 ; Lo # [7] ETHIOPIC SYLLABLE CCHHA..ETHIOPIC SYLLABLE CCHHO
+AB28..AB2E ; Lo # [7] ETHIOPIC SYLLABLE BBA..ETHIOPIC SYLLABLE BBO
+ABC0..ABE2 ; Lo # [35] MEETEI MAYEK LETTER KOK..MEETEI MAYEK LETTER I LONSUM
+AC00..D7A3 ; Lo # [11172] HANGUL SYLLABLE GA..HANGUL SYLLABLE HIH
+D7B0..D7C6 ; Lo # [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E
+D7CB..D7FB ; Lo # [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH
+F900..FA6D ; Lo # [366] CJK COMPATIBILITY IDEOGRAPH-F900..CJK COMPATIBILITY IDEOGRAPH-FA6D
+FA70..FAD9 ; Lo # [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPATIBILITY IDEOGRAPH-FAD9
+FB1D ; Lo # HEBREW LETTER YOD WITH HIRIQ
+FB1F..FB28 ; Lo # [10] HEBREW LIGATURE YIDDISH YOD YOD PATAH..HEBREW LETTER WIDE TAV
+FB2A..FB36 ; Lo # [13] HEBREW LETTER SHIN WITH SHIN DOT..HEBREW LETTER ZAYIN WITH DAGESH
+FB38..FB3C ; Lo # [5] HEBREW LETTER TET WITH DAGESH..HEBREW LETTER LAMED WITH DAGESH
+FB3E ; Lo # HEBREW LETTER MEM WITH DAGESH
+FB40..FB41 ; Lo # [2] HEBREW LETTER NUN WITH DAGESH..HEBREW LETTER SAMEKH WITH DAGESH
+FB43..FB44 ; Lo # [2] HEBREW LETTER FINAL PE WITH DAGESH..HEBREW LETTER PE WITH DAGESH
+FB46..FBB1 ; Lo # [108] HEBREW LETTER TSADI WITH DAGESH..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE FINAL FORM
+FBD3..FD3D ; Lo # [363] ARABIC LETTER NG ISOLATED FORM..ARABIC LIGATURE ALEF WITH FATHATAN ISOLATED FORM
+FD50..FD8F ; Lo # [64] ARABIC LIGATURE TEH WITH JEEM WITH MEEM INITIAL FORM..ARABIC LIGATURE MEEM WITH KHAH WITH MEEM INITIAL FORM
+FD92..FDC7 ; Lo # [54] ARABIC LIGATURE MEEM WITH JEEM WITH KHAH INITIAL FORM..ARABIC LIGATURE NOON WITH JEEM WITH YEH FINAL FORM
+FDF0..FDFB ; Lo # [12] ARABIC LIGATURE SALLA USED AS KORANIC STOP SIGN ISOLATED FORM..ARABIC LIGATURE JALLAJALALOUHOU
+FE70..FE74 ; Lo # [5] ARABIC FATHATAN ISOLATED FORM..ARABIC KASRATAN ISOLATED FORM
+FE76..FEFC ; Lo # [135] ARABIC FATHA ISOLATED FORM..ARABIC LIGATURE LAM WITH ALEF FINAL FORM
+FF66..FF6F ; Lo # [10] HALFWIDTH KATAKANA LETTER WO..HALFWIDTH KATAKANA LETTER SMALL TU
+FF71..FF9D ; Lo # [45] HALFWIDTH KATAKANA LETTER A..HALFWIDTH KATAKANA LETTER N
+FFA0..FFBE ; Lo # [31] HALFWIDTH HANGUL FILLER..HALFWIDTH HANGUL LETTER HIEUH
+FFC2..FFC7 ; Lo # [6] HALFWIDTH HANGUL LETTER A..HALFWIDTH HANGUL LETTER E
+FFCA..FFCF ; Lo # [6] HALFWIDTH HANGUL LETTER YEO..HALFWIDTH HANGUL LETTER OE
+FFD2..FFD7 ; Lo # [6] HALFWIDTH HANGUL LETTER YO..HALFWIDTH HANGUL LETTER YU
+FFDA..FFDC ; Lo # [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I
+10000..1000B ; Lo # [12] LINEAR B SYLLABLE B008 A..LINEAR B SYLLABLE B046 JE
+1000D..10026 ; Lo # [26] LINEAR B SYLLABLE B036 JO..LINEAR B SYLLABLE B032 QO
+10028..1003A ; Lo # [19] LINEAR B SYLLABLE B060 RA..LINEAR B SYLLABLE B042 WO
+1003C..1003D ; Lo # [2] LINEAR B SYLLABLE B017 ZA..LINEAR B SYLLABLE B074 ZE
+1003F..1004D ; Lo # [15] LINEAR B SYLLABLE B020 ZO..LINEAR B SYLLABLE B091 TWO
+10050..1005D ; Lo # [14] LINEAR B SYMBOL B018..LINEAR B SYMBOL B089
+10080..100FA ; Lo # [123] LINEAR B IDEOGRAM B100 MAN..LINEAR B IDEOGRAM VESSEL B305
+10280..1029C ; Lo # [29] LYCIAN LETTER A..LYCIAN LETTER X
+102A0..102D0 ; Lo # [49] CARIAN LETTER A..CARIAN LETTER UUU3
+10300..1031F ; Lo # [32] OLD ITALIC LETTER A..OLD ITALIC LETTER ESS
+1032D..10340 ; Lo # [20] OLD ITALIC LETTER YE..GOTHIC LETTER PAIRTHRA
+10342..10349 ; Lo # [8] GOTHIC LETTER RAIDA..GOTHIC LETTER OTHAL
+10350..10375 ; Lo # [38] OLD PERMIC LETTER AN..OLD PERMIC LETTER IA
+10380..1039D ; Lo # [30] UGARITIC LETTER ALPA..UGARITIC LETTER SSU
+103A0..103C3 ; Lo # [36] OLD PERSIAN SIGN A..OLD PERSIAN SIGN HA
+103C8..103CF ; Lo # [8] OLD PERSIAN SIGN AURAMAZDAA..OLD PERSIAN SIGN BUUMISH
+10450..1049D ; Lo # [78] SHAVIAN LETTER PEEP..OSMANYA LETTER OO
+10500..10527 ; Lo # [40] ELBASAN LETTER A..ELBASAN LETTER KHE
+10530..10563 ; Lo # [52] CAUCASIAN ALBANIAN LETTER ALT..CAUCASIAN ALBANIAN LETTER KIW
+105C0..105F3 ; Lo # [52] TODHRI LETTER A..TODHRI LETTER OO
+10600..10736 ; Lo # [311] LINEAR A SIGN AB001..LINEAR A SIGN A664
+10740..10755 ; Lo # [22] LINEAR A SIGN A701 A..LINEAR A SIGN A732 JE
+10760..10767 ; Lo # [8] LINEAR A SIGN A800..LINEAR A SIGN A807
+10800..10805 ; Lo # [6] CYPRIOT SYLLABLE A..CYPRIOT SYLLABLE JA
+10808 ; Lo # CYPRIOT SYLLABLE JO
+1080A..10835 ; Lo # [44] CYPRIOT SYLLABLE KA..CYPRIOT SYLLABLE WO
+10837..10838 ; Lo # [2] CYPRIOT SYLLABLE XA..CYPRIOT SYLLABLE XE
+1083C ; Lo # CYPRIOT SYLLABLE ZA
+1083F..10855 ; Lo # [23] CYPRIOT SYLLABLE ZO..IMPERIAL ARAMAIC LETTER TAW
+10860..10876 ; Lo # [23] PALMYRENE LETTER ALEPH..PALMYRENE LETTER TAW
+10880..1089E ; Lo # [31] NABATAEAN LETTER FINAL ALEPH..NABATAEAN LETTER TAW
+108E0..108F2 ; Lo # [19] HATRAN LETTER ALEPH..HATRAN LETTER QOPH
+108F4..108F5 ; Lo # [2] HATRAN LETTER SHIN..HATRAN LETTER TAW
+10900..10915 ; Lo # [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU
+10920..10939 ; Lo # [26] LYDIAN LETTER A..LYDIAN LETTER C
+10980..109B7 ; Lo # [56] MEROITIC HIEROGLYPHIC LETTER A..MEROITIC CURSIVE LETTER DA
+109BE..109BF ; Lo # [2] MEROITIC CURSIVE LOGOGRAM RMT..MEROITIC CURSIVE LOGOGRAM IMN
+10A00 ; Lo # KHAROSHTHI LETTER A
+10A10..10A13 ; Lo # [4] KHAROSHTHI LETTER KA..KHAROSHTHI LETTER GHA
+10A15..10A17 ; Lo # [3] KHAROSHTHI LETTER CA..KHAROSHTHI LETTER JA
+10A19..10A35 ; Lo # [29] KHAROSHTHI LETTER NYA..KHAROSHTHI LETTER VHA
+10A60..10A7C ; Lo # [29] OLD SOUTH ARABIAN LETTER HE..OLD SOUTH ARABIAN LETTER THETH
+10A80..10A9C ; Lo # [29] OLD NORTH ARABIAN LETTER HEH..OLD NORTH ARABIAN LETTER ZAH
+10AC0..10AC7 ; Lo # [8] MANICHAEAN LETTER ALEPH..MANICHAEAN LETTER WAW
+10AC9..10AE4 ; Lo # [28] MANICHAEAN LETTER ZAYIN..MANICHAEAN LETTER TAW
+10B00..10B35 ; Lo # [54] AVESTAN LETTER A..AVESTAN LETTER HE
+10B40..10B55 ; Lo # [22] INSCRIPTIONAL PARTHIAN LETTER ALEPH..INSCRIPTIONAL PARTHIAN LETTER TAW
+10B60..10B72 ; Lo # [19] INSCRIPTIONAL PAHLAVI LETTER ALEPH..INSCRIPTIONAL PAHLAVI LETTER TAW
+10B80..10B91 ; Lo # [18] PSALTER PAHLAVI LETTER ALEPH..PSALTER PAHLAVI LETTER TAW
+10C00..10C48 ; Lo # [73] OLD TURKIC LETTER ORKHON A..OLD TURKIC LETTER ORKHON BASH
+10D00..10D23 ; Lo # [36] HANIFI ROHINGYA LETTER A..HANIFI ROHINGYA MARK NA KHONNA
+10D4A..10D4D ; Lo # [4] GARAY VOWEL SIGN A..GARAY VOWEL SIGN EE
+10D4F ; Lo # GARAY SUKUN
+10E80..10EA9 ; Lo # [42] YEZIDI LETTER ELIF..YEZIDI LETTER ET
+10EB0..10EB1 ; Lo # [2] YEZIDI LETTER LAM WITH DOT ABOVE..YEZIDI LETTER YOT WITH CIRCUMFLEX ABOVE
+10EC2..10EC4 ; Lo # [3] ARABIC LETTER DAL WITH TWO DOTS VERTICALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS VERTICALLY BELOW
+10F00..10F1C ; Lo # [29] OLD SOGDIAN LETTER ALEPH..OLD SOGDIAN LETTER FINAL TAW WITH VERTICAL TAIL
+10F27 ; Lo # OLD SOGDIAN LIGATURE AYIN-DALETH
+10F30..10F45 ; Lo # [22] SOGDIAN LETTER ALEPH..SOGDIAN INDEPENDENT SHIN
+10F70..10F81 ; Lo # [18] OLD UYGHUR LETTER ALEPH..OLD UYGHUR LETTER LESH
+10FB0..10FC4 ; Lo # [21] CHORASMIAN LETTER ALEPH..CHORASMIAN LETTER TAW
+10FE0..10FF6 ; Lo # [23] ELYMAIC LETTER ALEPH..ELYMAIC LIGATURE ZAYIN-YODH
+11003..11037 ; Lo # [53] BRAHMI SIGN JIHVAMULIYA..BRAHMI LETTER OLD TAMIL NNNA
+11071..11072 ; Lo # [2] BRAHMI LETTER OLD TAMIL SHORT E..BRAHMI LETTER OLD TAMIL SHORT O
+11075 ; Lo # BRAHMI LETTER OLD TAMIL LLA
+11083..110AF ; Lo # [45] KAITHI LETTER A..KAITHI LETTER HA
+110D0..110E8 ; Lo # [25] SORA SOMPENG LETTER SAH..SORA SOMPENG LETTER MAE
+11103..11126 ; Lo # [36] CHAKMA LETTER AA..CHAKMA LETTER HAA
+11144 ; Lo # CHAKMA LETTER LHAA
+11147 ; Lo # CHAKMA LETTER VAA
+11150..11172 ; Lo # [35] MAHAJANI LETTER A..MAHAJANI LETTER RRA
+11176 ; Lo # MAHAJANI LIGATURE SHRI
+11183..111B2 ; Lo # [48] SHARADA LETTER A..SHARADA LETTER HA
+111C1..111C4 ; Lo # [4] SHARADA SIGN AVAGRAHA..SHARADA OM
+111DA ; Lo # SHARADA EKAM
+111DC ; Lo # SHARADA HEADSTROKE
+11200..11211 ; Lo # [18] KHOJKI LETTER A..KHOJKI LETTER JJA
+11213..1122B ; Lo # [25] KHOJKI LETTER NYA..KHOJKI LETTER LLA
+1123F..11240 ; Lo # [2] KHOJKI LETTER QA..KHOJKI LETTER SHORT I
+11280..11286 ; Lo # [7] MULTANI LETTER A..MULTANI LETTER GA
+11288 ; Lo # MULTANI LETTER GHA
+1128A..1128D ; Lo # [4] MULTANI LETTER CA..MULTANI LETTER JJA
+1128F..1129D ; Lo # [15] MULTANI LETTER NYA..MULTANI LETTER BA
+1129F..112A8 ; Lo # [10] MULTANI LETTER BHA..MULTANI LETTER RHA
+112B0..112DE ; Lo # [47] KHUDAWADI LETTER A..KHUDAWADI LETTER HA
+11305..1130C ; Lo # [8] GRANTHA LETTER A..GRANTHA LETTER VOCALIC L
+1130F..11310 ; Lo # [2] GRANTHA LETTER EE..GRANTHA LETTER AI
+11313..11328 ; Lo # [22] GRANTHA LETTER OO..GRANTHA LETTER NA
+1132A..11330 ; Lo # [7] GRANTHA LETTER PA..GRANTHA LETTER RA
+11332..11333 ; Lo # [2] GRANTHA LETTER LA..GRANTHA LETTER LLA
+11335..11339 ; Lo # [5] GRANTHA LETTER VA..GRANTHA LETTER HA
+1133D ; Lo # GRANTHA SIGN AVAGRAHA
+11350 ; Lo # GRANTHA OM
+1135D..11361 ; Lo # [5] GRANTHA SIGN PLUTA..GRANTHA LETTER VOCALIC LL
+11380..11389 ; Lo # [10] TULU-TIGALARI LETTER A..TULU-TIGALARI LETTER VOCALIC LL
+1138B ; Lo # TULU-TIGALARI LETTER EE
+1138E ; Lo # TULU-TIGALARI LETTER AI
+11390..113B5 ; Lo # [38] TULU-TIGALARI LETTER OO..TULU-TIGALARI LETTER LLLA
+113B7 ; Lo # TULU-TIGALARI SIGN AVAGRAHA
+113D1 ; Lo # TULU-TIGALARI REPHA
+113D3 ; Lo # TULU-TIGALARI SIGN PLUTA
+11400..11434 ; Lo # [53] NEWA LETTER A..NEWA LETTER HA
+11447..1144A ; Lo # [4] NEWA SIGN AVAGRAHA..NEWA SIDDHI
+1145F..11461 ; Lo # [3] NEWA LETTER VEDIC ANUSVARA..NEWA SIGN UPADHMANIYA
+11480..114AF ; Lo # [48] TIRHUTA ANJI..TIRHUTA LETTER HA
+114C4..114C5 ; Lo # [2] TIRHUTA SIGN AVAGRAHA..TIRHUTA GVANG
+114C7 ; Lo # TIRHUTA OM
+11580..115AE ; Lo # [47] SIDDHAM LETTER A..SIDDHAM LETTER HA
+115D8..115DB ; Lo # [4] SIDDHAM LETTER THREE-CIRCLE ALTERNATE I..SIDDHAM LETTER ALTERNATE U
+11600..1162F ; Lo # [48] MODI LETTER A..MODI LETTER LLA
+11644 ; Lo # MODI SIGN HUVA
+11680..116AA ; Lo # [43] TAKRI LETTER A..TAKRI LETTER RRA
+116B8 ; Lo # TAKRI LETTER ARCHAIC KHA
+11700..1171A ; Lo # [27] AHOM LETTER KA..AHOM LETTER ALTERNATE BA
+11740..11746 ; Lo # [7] AHOM LETTER CA..AHOM LETTER LLA
+11800..1182B ; Lo # [44] DOGRA LETTER A..DOGRA LETTER RRA
+118FF..11906 ; Lo # [8] WARANG CITI OM..DIVES AKURU LETTER E
+11909 ; Lo # DIVES AKURU LETTER O
+1190C..11913 ; Lo # [8] DIVES AKURU LETTER KA..DIVES AKURU LETTER JA
+11915..11916 ; Lo # [2] DIVES AKURU LETTER NYA..DIVES AKURU LETTER TTA
+11918..1192F ; Lo # [24] DIVES AKURU LETTER DDA..DIVES AKURU LETTER ZA
+1193F ; Lo # DIVES AKURU PREFIXED NASAL SIGN
+11941 ; Lo # DIVES AKURU INITIAL RA
+119A0..119A7 ; Lo # [8] NANDINAGARI LETTER A..NANDINAGARI LETTER VOCALIC RR
+119AA..119D0 ; Lo # [39] NANDINAGARI LETTER E..NANDINAGARI LETTER RRA
+119E1 ; Lo # NANDINAGARI SIGN AVAGRAHA
+119E3 ; Lo # NANDINAGARI HEADSTROKE
+11A00 ; Lo # ZANABAZAR SQUARE LETTER A
+11A0B..11A32 ; Lo # [40] ZANABAZAR SQUARE LETTER KA..ZANABAZAR SQUARE LETTER KSSA
+11A3A ; Lo # ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA
+11A50 ; Lo # SOYOMBO LETTER A
+11A5C..11A89 ; Lo # [46] SOYOMBO LETTER KA..SOYOMBO CLUSTER-INITIAL LETTER SA
+11A9D ; Lo # SOYOMBO MARK PLUTA
+11AB0..11AF8 ; Lo # [73] CANADIAN SYLLABICS NATTILIK HI..PAU CIN HAU GLOTTAL STOP FINAL
+11BC0..11BE0 ; Lo # [33] SUNUWAR LETTER DEVI..SUNUWAR LETTER KLOKO
+11C00..11C08 ; Lo # [9] BHAIKSUKI LETTER A..BHAIKSUKI LETTER VOCALIC L
+11C0A..11C2E ; Lo # [37] BHAIKSUKI LETTER E..BHAIKSUKI LETTER HA
+11C40 ; Lo # BHAIKSUKI SIGN AVAGRAHA
+11C72..11C8F ; Lo # [30] MARCHEN LETTER KA..MARCHEN LETTER A
+11D00..11D06 ; Lo # [7] MASARAM GONDI LETTER A..MASARAM GONDI LETTER E
+11D08..11D09 ; Lo # [2] MASARAM GONDI LETTER AI..MASARAM GONDI LETTER O
+11D0B..11D30 ; Lo # [38] MASARAM GONDI LETTER AU..MASARAM GONDI LETTER TRA
+11D46 ; Lo # MASARAM GONDI REPHA
+11D60..11D65 ; Lo # [6] GUNJALA GONDI LETTER A..GUNJALA GONDI LETTER UU
+11D67..11D68 ; Lo # [2] GUNJALA GONDI LETTER EE..GUNJALA GONDI LETTER AI
+11D6A..11D89 ; Lo # [32] GUNJALA GONDI LETTER OO..GUNJALA GONDI LETTER SA
+11D98 ; Lo # GUNJALA GONDI OM
+11EE0..11EF2 ; Lo # [19] MAKASAR LETTER KA..MAKASAR ANGKA
+11F02 ; Lo # KAWI SIGN REPHA
+11F04..11F10 ; Lo # [13] KAWI LETTER A..KAWI LETTER O
+11F12..11F33 ; Lo # [34] KAWI LETTER KA..KAWI LETTER JNYA
+11FB0 ; Lo # LISU LETTER YHA
+12000..12399 ; Lo # [922] CUNEIFORM SIGN A..CUNEIFORM SIGN U U
+12480..12543 ; Lo # [196] CUNEIFORM SIGN AB TIMES NUN TENU..CUNEIFORM SIGN ZU5 TIMES THREE DISH TENU
+12F90..12FF0 ; Lo # [97] CYPRO-MINOAN SIGN CM001..CYPRO-MINOAN SIGN CM114
+13000..1342F ; Lo # [1072] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH V011D
+13441..13446 ; Lo # [6] EGYPTIAN HIEROGLYPH FULL BLANK..EGYPTIAN HIEROGLYPH WIDE LOST SIGN
+13460..143FA ; Lo # [3995] EGYPTIAN HIEROGLYPH-13460..EGYPTIAN HIEROGLYPH-143FA
+14400..14646 ; Lo # [583] ANATOLIAN HIEROGLYPH A001..ANATOLIAN HIEROGLYPH A530
+16100..1611D ; Lo # [30] GURUNG KHEMA LETTER A..GURUNG KHEMA LETTER SA
+16800..16A38 ; Lo # [569] BAMUM LETTER PHASE-A NGKUE MFON..BAMUM LETTER PHASE-F VUEQ
+16A40..16A5E ; Lo # [31] MRO LETTER TA..MRO LETTER TEK
+16A70..16ABE ; Lo # [79] TANGSA LETTER OZ..TANGSA LETTER ZA
+16AD0..16AED ; Lo # [30] BASSA VAH LETTER ENNI..BASSA VAH LETTER I
+16B00..16B2F ; Lo # [48] PAHAWH HMONG VOWEL KEEB..PAHAWH HMONG CONSONANT CAU
+16B63..16B77 ; Lo # [21] PAHAWH HMONG SIGN VOS LUB..PAHAWH HMONG SIGN CIM NRES TOS
+16B7D..16B8F ; Lo # [19] PAHAWH HMONG CLAN SIGN TSHEEJ..PAHAWH HMONG CLAN SIGN VWJ
+16D43..16D6A ; Lo # [40] KIRAT RAI LETTER A..KIRAT RAI VOWEL SIGN AU
+16F00..16F4A ; Lo # [75] MIAO LETTER PA..MIAO LETTER RTE
+16F50 ; Lo # MIAO LETTER NASALIZATION
+17000..187F7 ; Lo # [6136] TANGUT IDEOGRAPH-17000..TANGUT IDEOGRAPH-187F7
+18800..18CD5 ; Lo # [1238] TANGUT COMPONENT-001..KHITAN SMALL SCRIPT CHARACTER-18CD5
+18CFF..18D08 ; Lo # [10] KHITAN SMALL SCRIPT CHARACTER-18CFF..TANGUT IDEOGRAPH-18D08
+1B000..1B122 ; Lo # [291] KATAKANA LETTER ARCHAIC E..KATAKANA LETTER ARCHAIC WU
+1B132 ; Lo # HIRAGANA LETTER SMALL KO
+1B150..1B152 ; Lo # [3] HIRAGANA LETTER SMALL WI..HIRAGANA LETTER SMALL WO
+1B155 ; Lo # KATAKANA LETTER SMALL KO
+1B164..1B167 ; Lo # [4] KATAKANA LETTER SMALL WI..KATAKANA LETTER SMALL N
+1B170..1B2FB ; Lo # [396] NUSHU CHARACTER-1B170..NUSHU CHARACTER-1B2FB
+1BC00..1BC6A ; Lo # [107] DUPLOYAN LETTER H..DUPLOYAN LETTER VOCALIC M
+1BC70..1BC7C ; Lo # [13] DUPLOYAN AFFIX LEFT HORIZONTAL SECANT..DUPLOYAN AFFIX ATTACHED TANGENT HOOK
+1BC80..1BC88 ; Lo # [9] DUPLOYAN AFFIX HIGH ACUTE..DUPLOYAN AFFIX HIGH VERTICAL
+1BC90..1BC99 ; Lo # [10] DUPLOYAN AFFIX LOW ACUTE..DUPLOYAN AFFIX LOW ARROW
+1DF0A ; Lo # LATIN LETTER RETROFLEX CLICK WITH RETROFLEX HOOK
+1E100..1E12C ; Lo # [45] NYIAKENG PUACHUE HMONG LETTER MA..NYIAKENG PUACHUE HMONG LETTER W
+1E14E ; Lo # NYIAKENG PUACHUE HMONG LOGOGRAM NYAJ
+1E290..1E2AD ; Lo # [30] TOTO LETTER PA..TOTO LETTER A
+1E2C0..1E2EB ; Lo # [44] WANCHO LETTER AA..WANCHO LETTER YIH
+1E4D0..1E4EA ; Lo # [27] NAG MUNDARI LETTER O..NAG MUNDARI LETTER ELL
+1E5D0..1E5ED ; Lo # [30] OL ONAL LETTER O..OL ONAL LETTER EG
+1E5F0 ; Lo # OL ONAL SIGN HODDOND
+1E7E0..1E7E6 ; Lo # [7] ETHIOPIC SYLLABLE HHYA..ETHIOPIC SYLLABLE HHYO
+1E7E8..1E7EB ; Lo # [4] ETHIOPIC SYLLABLE GURAGE HHWA..ETHIOPIC SYLLABLE HHWE
+1E7ED..1E7EE ; Lo # [2] ETHIOPIC SYLLABLE GURAGE MWI..ETHIOPIC SYLLABLE GURAGE MWEE
+1E7F0..1E7FE ; Lo # [15] ETHIOPIC SYLLABLE GURAGE QWI..ETHIOPIC SYLLABLE GURAGE PWEE
+1E800..1E8C4 ; Lo # [197] MENDE KIKAKUI SYLLABLE M001 KI..MENDE KIKAKUI SYLLABLE M060 NYON
+1EE00..1EE03 ; Lo # [4] ARABIC MATHEMATICAL ALEF..ARABIC MATHEMATICAL DAL
+1EE05..1EE1F ; Lo # [27] ARABIC MATHEMATICAL WAW..ARABIC MATHEMATICAL DOTLESS QAF
+1EE21..1EE22 ; Lo # [2] ARABIC MATHEMATICAL INITIAL BEH..ARABIC MATHEMATICAL INITIAL JEEM
+1EE24 ; Lo # ARABIC MATHEMATICAL INITIAL HEH
+1EE27 ; Lo # ARABIC MATHEMATICAL INITIAL HAH
+1EE29..1EE32 ; Lo # [10] ARABIC MATHEMATICAL INITIAL YEH..ARABIC MATHEMATICAL INITIAL QAF
+1EE34..1EE37 ; Lo # [4] ARABIC MATHEMATICAL INITIAL SHEEN..ARABIC MATHEMATICAL INITIAL KHAH
+1EE39 ; Lo # ARABIC MATHEMATICAL INITIAL DAD
+1EE3B ; Lo # ARABIC MATHEMATICAL INITIAL GHAIN
+1EE42 ; Lo # ARABIC MATHEMATICAL TAILED JEEM
+1EE47 ; Lo # ARABIC MATHEMATICAL TAILED HAH
+1EE49 ; Lo # ARABIC MATHEMATICAL TAILED YEH
+1EE4B ; Lo # ARABIC MATHEMATICAL TAILED LAM
+1EE4D..1EE4F ; Lo # [3] ARABIC MATHEMATICAL TAILED NOON..ARABIC MATHEMATICAL TAILED AIN
+1EE51..1EE52 ; Lo # [2] ARABIC MATHEMATICAL TAILED SAD..ARABIC MATHEMATICAL TAILED QAF
+1EE54 ; Lo # ARABIC MATHEMATICAL TAILED SHEEN
+1EE57 ; Lo # ARABIC MATHEMATICAL TAILED KHAH
+1EE59 ; Lo # ARABIC MATHEMATICAL TAILED DAD
+1EE5B ; Lo # ARABIC MATHEMATICAL TAILED GHAIN
+1EE5D ; Lo # ARABIC MATHEMATICAL TAILED DOTLESS NOON
+1EE5F ; Lo # ARABIC MATHEMATICAL TAILED DOTLESS QAF
+1EE61..1EE62 ; Lo # [2] ARABIC MATHEMATICAL STRETCHED BEH..ARABIC MATHEMATICAL STRETCHED JEEM
+1EE64 ; Lo # ARABIC MATHEMATICAL STRETCHED HEH
+1EE67..1EE6A ; Lo # [4] ARABIC MATHEMATICAL STRETCHED HAH..ARABIC MATHEMATICAL STRETCHED KAF
+1EE6C..1EE72 ; Lo # [7] ARABIC MATHEMATICAL STRETCHED MEEM..ARABIC MATHEMATICAL STRETCHED QAF
+1EE74..1EE77 ; Lo # [4] ARABIC MATHEMATICAL STRETCHED SHEEN..ARABIC MATHEMATICAL STRETCHED KHAH
+1EE79..1EE7C ; Lo # [4] ARABIC MATHEMATICAL STRETCHED DAD..ARABIC MATHEMATICAL STRETCHED DOTLESS BEH
+1EE7E ; Lo # ARABIC MATHEMATICAL STRETCHED DOTLESS FEH
+1EE80..1EE89 ; Lo # [10] ARABIC MATHEMATICAL LOOPED ALEF..ARABIC MATHEMATICAL LOOPED YEH
+1EE8B..1EE9B ; Lo # [17] ARABIC MATHEMATICAL LOOPED LAM..ARABIC MATHEMATICAL LOOPED GHAIN
+1EEA1..1EEA3 ; Lo # [3] ARABIC MATHEMATICAL DOUBLE-STRUCK BEH..ARABIC MATHEMATICAL DOUBLE-STRUCK DAL
+1EEA5..1EEA9 ; Lo # [5] ARABIC MATHEMATICAL DOUBLE-STRUCK WAW..ARABIC MATHEMATICAL DOUBLE-STRUCK YEH
+1EEAB..1EEBB ; Lo # [17] ARABIC MATHEMATICAL DOUBLE-STRUCK LAM..ARABIC MATHEMATICAL DOUBLE-STRUCK GHAIN
+20000..2A6DF ; Lo # [42720] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF
+2A700..2B739 ; Lo # [4154] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B739
+2B740..2B81D ; Lo # [222] CJK UNIFIED IDEOGRAPH-2B740..CJK UNIFIED IDEOGRAPH-2B81D
+2B820..2CEA1 ; Lo # [5762] CJK UNIFIED IDEOGRAPH-2B820..CJK UNIFIED IDEOGRAPH-2CEA1
+2CEB0..2EBE0 ; Lo # [7473] CJK UNIFIED IDEOGRAPH-2CEB0..CJK UNIFIED IDEOGRAPH-2EBE0
+2EBF0..2EE5D ; Lo # [622] CJK UNIFIED IDEOGRAPH-2EBF0..CJK UNIFIED IDEOGRAPH-2EE5D
+2F800..2FA1D ; Lo # [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D
+30000..3134A ; Lo # [4939] CJK UNIFIED IDEOGRAPH-30000..CJK UNIFIED IDEOGRAPH-3134A
+31350..323AF ; Lo # [4192] CJK UNIFIED IDEOGRAPH-31350..CJK UNIFIED IDEOGRAPH-323AF
+
+# Total code points: 136477
+
+# ================================================
+
+# General_Category=Nonspacing_Mark
+
+0300..036F ; Mn # [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X
+0483..0487 ; Mn # [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE
+0591..05BD ; Mn # [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG
+05BF ; Mn # HEBREW POINT RAFE
+05C1..05C2 ; Mn # [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT
+05C4..05C5 ; Mn # [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT
+05C7 ; Mn # HEBREW POINT QAMATS QATAN
+0610..061A ; Mn # [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA
+064B..065F ; Mn # [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW
+0670 ; Mn # ARABIC LETTER SUPERSCRIPT ALEF
+06D6..06DC ; Mn # [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN
+06DF..06E4 ; Mn # [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA
+06E7..06E8 ; Mn # [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON
+06EA..06ED ; Mn # [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM
+0711 ; Mn # SYRIAC LETTER SUPERSCRIPT ALAPH
+0730..074A ; Mn # [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH
+07A6..07B0 ; Mn # [11] THAANA ABAFILI..THAANA SUKUN
+07EB..07F3 ; Mn # [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE
+07FD ; Mn # NKO DANTAYALAN
+0816..0819 ; Mn # [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH
+081B..0823 ; Mn # [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A
+0825..0827 ; Mn # [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U
+0829..082D ; Mn # [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA
+0859..085B ; Mn # [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK
+0897..089F ; Mn # [9] ARABIC PEPET..ARABIC HALF MADDA OVER MADDA
+08CA..08E1 ; Mn # [24] ARABIC SMALL HIGH FARSI YEH..ARABIC SMALL HIGH SIGN SAFHA
+08E3..0902 ; Mn # [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA
+093A ; Mn # DEVANAGARI VOWEL SIGN OE
+093C ; Mn # DEVANAGARI SIGN NUKTA
+0941..0948 ; Mn # [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI
+094D ; Mn # DEVANAGARI SIGN VIRAMA
+0951..0957 ; Mn # [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE
+0962..0963 ; Mn # [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL
+0981 ; Mn # BENGALI SIGN CANDRABINDU
+09BC ; Mn # BENGALI SIGN NUKTA
+09C1..09C4 ; Mn # [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR
+09CD ; Mn # BENGALI SIGN VIRAMA
+09E2..09E3 ; Mn # [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL
+09FE ; Mn # BENGALI SANDHI MARK
+0A01..0A02 ; Mn # [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI
+0A3C ; Mn # GURMUKHI SIGN NUKTA
+0A41..0A42 ; Mn # [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU
+0A47..0A48 ; Mn # [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI
+0A4B..0A4D ; Mn # [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA
+0A51 ; Mn # GURMUKHI SIGN UDAAT
+0A70..0A71 ; Mn # [2] GURMUKHI TIPPI..GURMUKHI ADDAK
+0A75 ; Mn # GURMUKHI SIGN YAKASH
+0A81..0A82 ; Mn # [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA
+0ABC ; Mn # GUJARATI SIGN NUKTA
+0AC1..0AC5 ; Mn # [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E
+0AC7..0AC8 ; Mn # [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI
+0ACD ; Mn # GUJARATI SIGN VIRAMA
+0AE2..0AE3 ; Mn # [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL
+0AFA..0AFF ; Mn # [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE
+0B01 ; Mn # ORIYA SIGN CANDRABINDU
+0B3C ; Mn # ORIYA SIGN NUKTA
+0B3F ; Mn # ORIYA VOWEL SIGN I
+0B41..0B44 ; Mn # [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR
+0B4D ; Mn # ORIYA SIGN VIRAMA
+0B55..0B56 ; Mn # [2] ORIYA SIGN OVERLINE..ORIYA AI LENGTH MARK
+0B62..0B63 ; Mn # [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL
+0B82 ; Mn # TAMIL SIGN ANUSVARA
+0BC0 ; Mn # TAMIL VOWEL SIGN II
+0BCD ; Mn # TAMIL SIGN VIRAMA
+0C00 ; Mn # TELUGU SIGN COMBINING CANDRABINDU ABOVE
+0C04 ; Mn # TELUGU SIGN COMBINING ANUSVARA ABOVE
+0C3C ; Mn # TELUGU SIGN NUKTA
+0C3E..0C40 ; Mn # [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II
+0C46..0C48 ; Mn # [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI
+0C4A..0C4D ; Mn # [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA
+0C55..0C56 ; Mn # [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK
+0C62..0C63 ; Mn # [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL
+0C81 ; Mn # KANNADA SIGN CANDRABINDU
+0CBC ; Mn # KANNADA SIGN NUKTA
+0CBF ; Mn # KANNADA VOWEL SIGN I
+0CC6 ; Mn # KANNADA VOWEL SIGN E
+0CCC..0CCD ; Mn # [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA
+0CE2..0CE3 ; Mn # [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL
+0D00..0D01 ; Mn # [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU
+0D3B..0D3C ; Mn # [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA
+0D41..0D44 ; Mn # [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR
+0D4D ; Mn # MALAYALAM SIGN VIRAMA
+0D62..0D63 ; Mn # [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL
+0D81 ; Mn # SINHALA SIGN CANDRABINDU
+0DCA ; Mn # SINHALA SIGN AL-LAKUNA
+0DD2..0DD4 ; Mn # [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA
+0DD6 ; Mn # SINHALA VOWEL SIGN DIGA PAA-PILLA
+0E31 ; Mn # THAI CHARACTER MAI HAN-AKAT
+0E34..0E3A ; Mn # [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU
+0E47..0E4E ; Mn # [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN
+0EB1 ; Mn # LAO VOWEL SIGN MAI KAN
+0EB4..0EBC ; Mn # [9] LAO VOWEL SIGN I..LAO SEMIVOWEL SIGN LO
+0EC8..0ECE ; Mn # [7] LAO TONE MAI EK..LAO YAMAKKAN
+0F18..0F19 ; Mn # [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS
+0F35 ; Mn # TIBETAN MARK NGAS BZUNG NYI ZLA
+0F37 ; Mn # TIBETAN MARK NGAS BZUNG SGOR RTAGS
+0F39 ; Mn # TIBETAN MARK TSA -PHRU
+0F71..0F7E ; Mn # [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO
+0F80..0F84 ; Mn # [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA
+0F86..0F87 ; Mn # [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS
+0F8D..0F97 ; Mn # [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA
+0F99..0FBC ; Mn # [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA
+0FC6 ; Mn # TIBETAN SYMBOL PADMA GDAN
+102D..1030 ; Mn # [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU
+1032..1037 ; Mn # [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW
+1039..103A ; Mn # [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT
+103D..103E ; Mn # [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA
+1058..1059 ; Mn # [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL
+105E..1060 ; Mn # [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA
+1071..1074 ; Mn # [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE
+1082 ; Mn # MYANMAR CONSONANT SIGN SHAN MEDIAL WA
+1085..1086 ; Mn # [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y
+108D ; Mn # MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE
+109D ; Mn # MYANMAR VOWEL SIGN AITON AI
+135D..135F ; Mn # [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK
+1712..1714 ; Mn # [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA
+1732..1733 ; Mn # [2] HANUNOO VOWEL SIGN I..HANUNOO VOWEL SIGN U
+1752..1753 ; Mn # [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U
+1772..1773 ; Mn # [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U
+17B4..17B5 ; Mn # [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA
+17B7..17BD ; Mn # [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA
+17C6 ; Mn # KHMER SIGN NIKAHIT
+17C9..17D3 ; Mn # [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT
+17DD ; Mn # KHMER SIGN ATTHACAN
+180B..180D ; Mn # [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE
+180F ; Mn # MONGOLIAN FREE VARIATION SELECTOR FOUR
+1885..1886 ; Mn # [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA
+18A9 ; Mn # MONGOLIAN LETTER ALI GALI DAGALGA
+1920..1922 ; Mn # [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U
+1927..1928 ; Mn # [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O
+1932 ; Mn # LIMBU SMALL LETTER ANUSVARA
+1939..193B ; Mn # [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I
+1A17..1A18 ; Mn # [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U
+1A1B ; Mn # BUGINESE VOWEL SIGN AE
+1A56 ; Mn # TAI THAM CONSONANT SIGN MEDIAL LA
+1A58..1A5E ; Mn # [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA
+1A60 ; Mn # TAI THAM SIGN SAKOT
+1A62 ; Mn # TAI THAM VOWEL SIGN MAI SAT
+1A65..1A6C ; Mn # [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW
+1A73..1A7C ; Mn # [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN
+1A7F ; Mn # TAI THAM COMBINING CRYPTOGRAMMIC DOT
+1AB0..1ABD ; Mn # [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW
+1ABF..1ACE ; Mn # [16] COMBINING LATIN SMALL LETTER W BELOW..COMBINING LATIN SMALL LETTER INSULAR T
+1B00..1B03 ; Mn # [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG
+1B34 ; Mn # BALINESE SIGN REREKAN
+1B36..1B3A ; Mn # [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA
+1B3C ; Mn # BALINESE VOWEL SIGN LA LENGA
+1B42 ; Mn # BALINESE VOWEL SIGN PEPET
+1B6B..1B73 ; Mn # [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG
+1B80..1B81 ; Mn # [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR
+1BA2..1BA5 ; Mn # [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU
+1BA8..1BA9 ; Mn # [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG
+1BAB..1BAD ; Mn # [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA
+1BE6 ; Mn # BATAK SIGN TOMPI
+1BE8..1BE9 ; Mn # [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE
+1BED ; Mn # BATAK VOWEL SIGN KARO O
+1BEF..1BF1 ; Mn # [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H
+1C2C..1C33 ; Mn # [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T
+1C36..1C37 ; Mn # [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA
+1CD0..1CD2 ; Mn # [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA
+1CD4..1CE0 ; Mn # [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA
+1CE2..1CE8 ; Mn # [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL
+1CED ; Mn # VEDIC SIGN TIRYAK
+1CF4 ; Mn # VEDIC TONE CANDRA ABOVE
+1CF8..1CF9 ; Mn # [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE
+1DC0..1DFF ; Mn # [64] COMBINING DOTTED GRAVE ACCENT..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW
+20D0..20DC ; Mn # [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE
+20E1 ; Mn # COMBINING LEFT RIGHT ARROW ABOVE
+20E5..20F0 ; Mn # [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE
+2CEF..2CF1 ; Mn # [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS
+2D7F ; Mn # TIFINAGH CONSONANT JOINER
+2DE0..2DFF ; Mn # [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS
+302A..302D ; Mn # [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK
+3099..309A ; Mn # [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+A66F ; Mn # COMBINING CYRILLIC VZMET
+A674..A67D ; Mn # [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK
+A69E..A69F ; Mn # [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E
+A6F0..A6F1 ; Mn # [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS
+A802 ; Mn # SYLOTI NAGRI SIGN DVISVARA
+A806 ; Mn # SYLOTI NAGRI SIGN HASANTA
+A80B ; Mn # SYLOTI NAGRI SIGN ANUSVARA
+A825..A826 ; Mn # [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E
+A82C ; Mn # SYLOTI NAGRI SIGN ALTERNATE HASANTA
+A8C4..A8C5 ; Mn # [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU
+A8E0..A8F1 ; Mn # [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA
+A8FF ; Mn # DEVANAGARI VOWEL SIGN AY
+A926..A92D ; Mn # [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU
+A947..A951 ; Mn # [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R
+A980..A982 ; Mn # [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR
+A9B3 ; Mn # JAVANESE SIGN CECAK TELU
+A9B6..A9B9 ; Mn # [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT
+A9BC..A9BD ; Mn # [2] JAVANESE VOWEL SIGN PEPET..JAVANESE CONSONANT SIGN KERET
+A9E5 ; Mn # MYANMAR SIGN SHAN SAW
+AA29..AA2E ; Mn # [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE
+AA31..AA32 ; Mn # [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE
+AA35..AA36 ; Mn # [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA
+AA43 ; Mn # CHAM CONSONANT SIGN FINAL NG
+AA4C ; Mn # CHAM CONSONANT SIGN FINAL M
+AA7C ; Mn # MYANMAR SIGN TAI LAING TONE-2
+AAB0 ; Mn # TAI VIET MAI KANG
+AAB2..AAB4 ; Mn # [3] TAI VIET VOWEL I..TAI VIET VOWEL U
+AAB7..AAB8 ; Mn # [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA
+AABE..AABF ; Mn # [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK
+AAC1 ; Mn # TAI VIET TONE MAI THO
+AAEC..AAED ; Mn # [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI
+AAF6 ; Mn # MEETEI MAYEK VIRAMA
+ABE5 ; Mn # MEETEI MAYEK VOWEL SIGN ANAP
+ABE8 ; Mn # MEETEI MAYEK VOWEL SIGN UNAP
+ABED ; Mn # MEETEI MAYEK APUN IYEK
+FB1E ; Mn # HEBREW POINT JUDEO-SPANISH VARIKA
+FE00..FE0F ; Mn # [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16
+FE20..FE2F ; Mn # [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF
+101FD ; Mn # PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE
+102E0 ; Mn # COPTIC EPACT THOUSANDS MARK
+10376..1037A ; Mn # [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII
+10A01..10A03 ; Mn # [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R
+10A05..10A06 ; Mn # [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O
+10A0C..10A0F ; Mn # [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA
+10A38..10A3A ; Mn # [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW
+10A3F ; Mn # KHAROSHTHI VIRAMA
+10AE5..10AE6 ; Mn # [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW
+10D24..10D27 ; Mn # [4] HANIFI ROHINGYA SIGN HARBAHAY..HANIFI ROHINGYA SIGN TASSI
+10D69..10D6D ; Mn # [5] GARAY VOWEL SIGN E..GARAY CONSONANT NASALIZATION MARK
+10EAB..10EAC ; Mn # [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK
+10EFC..10EFF ; Mn # [4] ARABIC COMBINING ALEF OVERLAY..ARABIC SMALL LOW WORD MADDA
+10F46..10F50 ; Mn # [11] SOGDIAN COMBINING DOT BELOW..SOGDIAN COMBINING STROKE BELOW
+10F82..10F85 ; Mn # [4] OLD UYGHUR COMBINING DOT ABOVE..OLD UYGHUR COMBINING TWO DOTS BELOW
+11001 ; Mn # BRAHMI SIGN ANUSVARA
+11038..11046 ; Mn # [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA
+11070 ; Mn # BRAHMI SIGN OLD TAMIL VIRAMA
+11073..11074 ; Mn # [2] BRAHMI VOWEL SIGN OLD TAMIL SHORT E..BRAHMI VOWEL SIGN OLD TAMIL SHORT O
+1107F..11081 ; Mn # [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA
+110B3..110B6 ; Mn # [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI
+110B9..110BA ; Mn # [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA
+110C2 ; Mn # KAITHI VOWEL SIGN VOCALIC R
+11100..11102 ; Mn # [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA
+11127..1112B ; Mn # [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU
+1112D..11134 ; Mn # [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA
+11173 ; Mn # MAHAJANI SIGN NUKTA
+11180..11181 ; Mn # [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA
+111B6..111BE ; Mn # [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O
+111C9..111CC ; Mn # [4] SHARADA SANDHI MARK..SHARADA EXTRA SHORT VOWEL MARK
+111CF ; Mn # SHARADA SIGN INVERTED CANDRABINDU
+1122F..11231 ; Mn # [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI
+11234 ; Mn # KHOJKI SIGN ANUSVARA
+11236..11237 ; Mn # [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA
+1123E ; Mn # KHOJKI SIGN SUKUN
+11241 ; Mn # KHOJKI VOWEL SIGN VOCALIC R
+112DF ; Mn # KHUDAWADI SIGN ANUSVARA
+112E3..112EA ; Mn # [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA
+11300..11301 ; Mn # [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU
+1133B..1133C ; Mn # [2] COMBINING BINDU BELOW..GRANTHA SIGN NUKTA
+11340 ; Mn # GRANTHA VOWEL SIGN II
+11366..1136C ; Mn # [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX
+11370..11374 ; Mn # [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA
+113BB..113C0 ; Mn # [6] TULU-TIGALARI VOWEL SIGN U..TULU-TIGALARI VOWEL SIGN VOCALIC LL
+113CE ; Mn # TULU-TIGALARI SIGN VIRAMA
+113D0 ; Mn # TULU-TIGALARI CONJOINER
+113D2 ; Mn # TULU-TIGALARI GEMINATION MARK
+113E1..113E2 ; Mn # [2] TULU-TIGALARI VEDIC TONE SVARITA..TULU-TIGALARI VEDIC TONE ANUDATTA
+11438..1143F ; Mn # [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI
+11442..11444 ; Mn # [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA
+11446 ; Mn # NEWA SIGN NUKTA
+1145E ; Mn # NEWA SANDHI MARK
+114B3..114B8 ; Mn # [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL
+114BA ; Mn # TIRHUTA VOWEL SIGN SHORT E
+114BF..114C0 ; Mn # [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA
+114C2..114C3 ; Mn # [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA
+115B2..115B5 ; Mn # [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR
+115BC..115BD ; Mn # [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA
+115BF..115C0 ; Mn # [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA
+115DC..115DD ; Mn # [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU
+11633..1163A ; Mn # [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI
+1163D ; Mn # MODI SIGN ANUSVARA
+1163F..11640 ; Mn # [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA
+116AB ; Mn # TAKRI SIGN ANUSVARA
+116AD ; Mn # TAKRI VOWEL SIGN AA
+116B0..116B5 ; Mn # [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU
+116B7 ; Mn # TAKRI SIGN NUKTA
+1171D ; Mn # AHOM CONSONANT SIGN MEDIAL LA
+1171F ; Mn # AHOM CONSONANT SIGN MEDIAL LIGATING RA
+11722..11725 ; Mn # [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU
+11727..1172B ; Mn # [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER
+1182F..11837 ; Mn # [9] DOGRA VOWEL SIGN U..DOGRA SIGN ANUSVARA
+11839..1183A ; Mn # [2] DOGRA SIGN VIRAMA..DOGRA SIGN NUKTA
+1193B..1193C ; Mn # [2] DIVES AKURU SIGN ANUSVARA..DIVES AKURU SIGN CANDRABINDU
+1193E ; Mn # DIVES AKURU VIRAMA
+11943 ; Mn # DIVES AKURU SIGN NUKTA
+119D4..119D7 ; Mn # [4] NANDINAGARI VOWEL SIGN U..NANDINAGARI VOWEL SIGN VOCALIC RR
+119DA..119DB ; Mn # [2] NANDINAGARI VOWEL SIGN E..NANDINAGARI VOWEL SIGN AI
+119E0 ; Mn # NANDINAGARI SIGN VIRAMA
+11A01..11A0A ; Mn # [10] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL LENGTH MARK
+11A33..11A38 ; Mn # [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA
+11A3B..11A3E ; Mn # [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA
+11A47 ; Mn # ZANABAZAR SQUARE SUBJOINER
+11A51..11A56 ; Mn # [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE
+11A59..11A5B ; Mn # [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK
+11A8A..11A96 ; Mn # [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA
+11A98..11A99 ; Mn # [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER
+11C30..11C36 ; Mn # [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L
+11C38..11C3D ; Mn # [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA
+11C3F ; Mn # BHAIKSUKI SIGN VIRAMA
+11C92..11CA7 ; Mn # [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA
+11CAA..11CB0 ; Mn # [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA
+11CB2..11CB3 ; Mn # [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E
+11CB5..11CB6 ; Mn # [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU
+11D31..11D36 ; Mn # [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R
+11D3A ; Mn # MASARAM GONDI VOWEL SIGN E
+11D3C..11D3D ; Mn # [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O
+11D3F..11D45 ; Mn # [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA
+11D47 ; Mn # MASARAM GONDI RA-KARA
+11D90..11D91 ; Mn # [2] GUNJALA GONDI VOWEL SIGN EE..GUNJALA GONDI VOWEL SIGN AI
+11D95 ; Mn # GUNJALA GONDI SIGN ANUSVARA
+11D97 ; Mn # GUNJALA GONDI VIRAMA
+11EF3..11EF4 ; Mn # [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U
+11F00..11F01 ; Mn # [2] KAWI SIGN CANDRABINDU..KAWI SIGN ANUSVARA
+11F36..11F3A ; Mn # [5] KAWI VOWEL SIGN I..KAWI VOWEL SIGN VOCALIC R
+11F40 ; Mn # KAWI VOWEL SIGN EU
+11F42 ; Mn # KAWI CONJOINER
+11F5A ; Mn # KAWI SIGN NUKTA
+13440 ; Mn # EGYPTIAN HIEROGLYPH MIRROR HORIZONTALLY
+13447..13455 ; Mn # [15] EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START..EGYPTIAN HIEROGLYPH MODIFIER DAMAGED
+1611E..16129 ; Mn # [12] GURUNG KHEMA VOWEL SIGN AA..GURUNG KHEMA VOWEL LENGTH MARK
+1612D..1612F ; Mn # [3] GURUNG KHEMA SIGN ANUSVARA..GURUNG KHEMA SIGN THOLHOMA
+16AF0..16AF4 ; Mn # [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE
+16B30..16B36 ; Mn # [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM
+16F4F ; Mn # MIAO SIGN CONSONANT MODIFIER BAR
+16F8F..16F92 ; Mn # [4] MIAO TONE RIGHT..MIAO TONE BELOW
+16FE4 ; Mn # KHITAN SMALL SCRIPT FILLER
+1BC9D..1BC9E ; Mn # [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK
+1CF00..1CF2D ; Mn # [46] ZNAMENNY COMBINING MARK GORAZDO NIZKO S KRYZHEM ON LEFT..ZNAMENNY COMBINING MARK KRYZH ON LEFT
+1CF30..1CF46 ; Mn # [23] ZNAMENNY COMBINING TONAL RANGE MARK MRACHNO..ZNAMENNY PRIZNAK MODIFIER ROG
+1D167..1D169 ; Mn # [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3
+1D17B..1D182 ; Mn # [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE
+1D185..1D18B ; Mn # [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE
+1D1AA..1D1AD ; Mn # [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO
+1D242..1D244 ; Mn # [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME
+1DA00..1DA36 ; Mn # [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN
+1DA3B..1DA6C ; Mn # [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT
+1DA75 ; Mn # SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS
+1DA84 ; Mn # SIGNWRITING LOCATION HEAD NECK
+1DA9B..1DA9F ; Mn # [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6
+1DAA1..1DAAF ; Mn # [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16
+1E000..1E006 ; Mn # [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE
+1E008..1E018 ; Mn # [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU
+1E01B..1E021 ; Mn # [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI
+1E023..1E024 ; Mn # [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS
+1E026..1E02A ; Mn # [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA
+1E08F ; Mn # COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+1E130..1E136 ; Mn # [7] NYIAKENG PUACHUE HMONG TONE-B..NYIAKENG PUACHUE HMONG TONE-D
+1E2AE ; Mn # TOTO SIGN RISING TONE
+1E2EC..1E2EF ; Mn # [4] WANCHO TONE TUP..WANCHO TONE KOINI
+1E4EC..1E4EF ; Mn # [4] NAG MUNDARI SIGN MUHOR..NAG MUNDARI SIGN SUTUH
+1E5EE..1E5EF ; Mn # [2] OL ONAL SIGN MU..OL ONAL SIGN IKIR
+1E8D0..1E8D6 ; Mn # [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS
+1E944..1E94A ; Mn # [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA
+E0100..E01EF ; Mn # [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
+
+# Total code points: 2020
+
+# ================================================
+
+# General_Category=Enclosing_Mark
+
+0488..0489 ; Me # [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN
+1ABE ; Me # COMBINING PARENTHESES OVERLAY
+20DD..20E0 ; Me # [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH
+20E2..20E4 ; Me # [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE
+A670..A672 ; Me # [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN
+
+# Total code points: 13
+
+# ================================================
+
+# General_Category=Spacing_Mark
+
+0903 ; Mc # DEVANAGARI SIGN VISARGA
+093B ; Mc # DEVANAGARI VOWEL SIGN OOE
+093E..0940 ; Mc # [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II
+0949..094C ; Mc # [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU
+094E..094F ; Mc # [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW
+0982..0983 ; Mc # [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA
+09BE..09C0 ; Mc # [3] BENGALI VOWEL SIGN AA..BENGALI VOWEL SIGN II
+09C7..09C8 ; Mc # [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI
+09CB..09CC ; Mc # [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU
+09D7 ; Mc # BENGALI AU LENGTH MARK
+0A03 ; Mc # GURMUKHI SIGN VISARGA
+0A3E..0A40 ; Mc # [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II
+0A83 ; Mc # GUJARATI SIGN VISARGA
+0ABE..0AC0 ; Mc # [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II
+0AC9 ; Mc # GUJARATI VOWEL SIGN CANDRA O
+0ACB..0ACC ; Mc # [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU
+0B02..0B03 ; Mc # [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA
+0B3E ; Mc # ORIYA VOWEL SIGN AA
+0B40 ; Mc # ORIYA VOWEL SIGN II
+0B47..0B48 ; Mc # [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI
+0B4B..0B4C ; Mc # [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU
+0B57 ; Mc # ORIYA AU LENGTH MARK
+0BBE..0BBF ; Mc # [2] TAMIL VOWEL SIGN AA..TAMIL VOWEL SIGN I
+0BC1..0BC2 ; Mc # [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU
+0BC6..0BC8 ; Mc # [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI
+0BCA..0BCC ; Mc # [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU
+0BD7 ; Mc # TAMIL AU LENGTH MARK
+0C01..0C03 ; Mc # [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA
+0C41..0C44 ; Mc # [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR
+0C82..0C83 ; Mc # [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA
+0CBE ; Mc # KANNADA VOWEL SIGN AA
+0CC0..0CC4 ; Mc # [5] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN VOCALIC RR
+0CC7..0CC8 ; Mc # [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI
+0CCA..0CCB ; Mc # [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO
+0CD5..0CD6 ; Mc # [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK
+0CF3 ; Mc # KANNADA SIGN COMBINING ANUSVARA ABOVE RIGHT
+0D02..0D03 ; Mc # [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA
+0D3E..0D40 ; Mc # [3] MALAYALAM VOWEL SIGN AA..MALAYALAM VOWEL SIGN II
+0D46..0D48 ; Mc # [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI
+0D4A..0D4C ; Mc # [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU
+0D57 ; Mc # MALAYALAM AU LENGTH MARK
+0D82..0D83 ; Mc # [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA
+0DCF..0DD1 ; Mc # [3] SINHALA VOWEL SIGN AELA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA
+0DD8..0DDF ; Mc # [8] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN GAYANUKITTA
+0DF2..0DF3 ; Mc # [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA
+0F3E..0F3F ; Mc # [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES
+0F7F ; Mc # TIBETAN SIGN RNAM BCAD
+102B..102C ; Mc # [2] MYANMAR VOWEL SIGN TALL AA..MYANMAR VOWEL SIGN AA
+1031 ; Mc # MYANMAR VOWEL SIGN E
+1038 ; Mc # MYANMAR SIGN VISARGA
+103B..103C ; Mc # [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA
+1056..1057 ; Mc # [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR
+1062..1064 ; Mc # [3] MYANMAR VOWEL SIGN SGAW KAREN EU..MYANMAR TONE MARK SGAW KAREN KE PHO
+1067..106D ; Mc # [7] MYANMAR VOWEL SIGN WESTERN PWO KAREN EU..MYANMAR SIGN WESTERN PWO KAREN TONE-5
+1083..1084 ; Mc # [2] MYANMAR VOWEL SIGN SHAN AA..MYANMAR VOWEL SIGN SHAN E
+1087..108C ; Mc # [6] MYANMAR SIGN SHAN TONE-2..MYANMAR SIGN SHAN COUNCIL TONE-3
+108F ; Mc # MYANMAR SIGN RUMAI PALAUNG TONE-5
+109A..109C ; Mc # [3] MYANMAR SIGN KHAMTI TONE-1..MYANMAR VOWEL SIGN AITON A
+1715 ; Mc # TAGALOG SIGN PAMUDPOD
+1734 ; Mc # HANUNOO SIGN PAMUDPOD
+17B6 ; Mc # KHMER VOWEL SIGN AA
+17BE..17C5 ; Mc # [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU
+17C7..17C8 ; Mc # [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU
+1923..1926 ; Mc # [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU
+1929..192B ; Mc # [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA
+1930..1931 ; Mc # [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA
+1933..1938 ; Mc # [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA
+1A19..1A1A ; Mc # [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O
+1A55 ; Mc # TAI THAM CONSONANT SIGN MEDIAL RA
+1A57 ; Mc # TAI THAM CONSONANT SIGN LA TANG LAI
+1A61 ; Mc # TAI THAM VOWEL SIGN A
+1A63..1A64 ; Mc # [2] TAI THAM VOWEL SIGN AA..TAI THAM VOWEL SIGN TALL AA
+1A6D..1A72 ; Mc # [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI
+1B04 ; Mc # BALINESE SIGN BISAH
+1B35 ; Mc # BALINESE VOWEL SIGN TEDUNG
+1B3B ; Mc # BALINESE VOWEL SIGN RA REPA TEDUNG
+1B3D..1B41 ; Mc # [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG
+1B43..1B44 ; Mc # [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG
+1B82 ; Mc # SUNDANESE SIGN PANGWISAD
+1BA1 ; Mc # SUNDANESE CONSONANT SIGN PAMINGKAL
+1BA6..1BA7 ; Mc # [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG
+1BAA ; Mc # SUNDANESE SIGN PAMAAEH
+1BE7 ; Mc # BATAK VOWEL SIGN E
+1BEA..1BEC ; Mc # [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O
+1BEE ; Mc # BATAK VOWEL SIGN U
+1BF2..1BF3 ; Mc # [2] BATAK PANGOLAT..BATAK PANONGONAN
+1C24..1C2B ; Mc # [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU
+1C34..1C35 ; Mc # [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG
+1CE1 ; Mc # VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA
+1CF7 ; Mc # VEDIC SIGN ATIKRAMA
+302E..302F ; Mc # [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK
+A823..A824 ; Mc # [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I
+A827 ; Mc # SYLOTI NAGRI VOWEL SIGN OO
+A880..A881 ; Mc # [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA
+A8B4..A8C3 ; Mc # [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU
+A952..A953 ; Mc # [2] REJANG CONSONANT SIGN H..REJANG VIRAMA
+A983 ; Mc # JAVANESE SIGN WIGNYAN
+A9B4..A9B5 ; Mc # [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG
+A9BA..A9BB ; Mc # [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE
+A9BE..A9C0 ; Mc # [3] JAVANESE CONSONANT SIGN PENGKAL..JAVANESE PANGKON
+AA2F..AA30 ; Mc # [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI
+AA33..AA34 ; Mc # [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA
+AA4D ; Mc # CHAM CONSONANT SIGN FINAL H
+AA7B ; Mc # MYANMAR SIGN PAO KAREN TONE
+AA7D ; Mc # MYANMAR SIGN TAI LAING TONE-5
+AAEB ; Mc # MEETEI MAYEK VOWEL SIGN II
+AAEE..AAEF ; Mc # [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU
+AAF5 ; Mc # MEETEI MAYEK VOWEL SIGN VISARGA
+ABE3..ABE4 ; Mc # [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP
+ABE6..ABE7 ; Mc # [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP
+ABE9..ABEA ; Mc # [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG
+ABEC ; Mc # MEETEI MAYEK LUM IYEK
+11000 ; Mc # BRAHMI SIGN CANDRABINDU
+11002 ; Mc # BRAHMI SIGN VISARGA
+11082 ; Mc # KAITHI SIGN VISARGA
+110B0..110B2 ; Mc # [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II
+110B7..110B8 ; Mc # [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU
+1112C ; Mc # CHAKMA VOWEL SIGN E
+11145..11146 ; Mc # [2] CHAKMA VOWEL SIGN AA..CHAKMA VOWEL SIGN EI
+11182 ; Mc # SHARADA SIGN VISARGA
+111B3..111B5 ; Mc # [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II
+111BF..111C0 ; Mc # [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA
+111CE ; Mc # SHARADA VOWEL SIGN PRISHTHAMATRA E
+1122C..1122E ; Mc # [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II
+11232..11233 ; Mc # [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU
+11235 ; Mc # KHOJKI SIGN VIRAMA
+112E0..112E2 ; Mc # [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II
+11302..11303 ; Mc # [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA
+1133E..1133F ; Mc # [2] GRANTHA VOWEL SIGN AA..GRANTHA VOWEL SIGN I
+11341..11344 ; Mc # [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR
+11347..11348 ; Mc # [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI
+1134B..1134D ; Mc # [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA
+11357 ; Mc # GRANTHA AU LENGTH MARK
+11362..11363 ; Mc # [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL
+113B8..113BA ; Mc # [3] TULU-TIGALARI VOWEL SIGN AA..TULU-TIGALARI VOWEL SIGN II
+113C2 ; Mc # TULU-TIGALARI VOWEL SIGN EE
+113C5 ; Mc # TULU-TIGALARI VOWEL SIGN AI
+113C7..113CA ; Mc # [4] TULU-TIGALARI VOWEL SIGN OO..TULU-TIGALARI SIGN CANDRA ANUNASIKA
+113CC..113CD ; Mc # [2] TULU-TIGALARI SIGN ANUSVARA..TULU-TIGALARI SIGN VISARGA
+113CF ; Mc # TULU-TIGALARI SIGN LOOPED VIRAMA
+11435..11437 ; Mc # [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II
+11440..11441 ; Mc # [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU
+11445 ; Mc # NEWA SIGN VISARGA
+114B0..114B2 ; Mc # [3] TIRHUTA VOWEL SIGN AA..TIRHUTA VOWEL SIGN II
+114B9 ; Mc # TIRHUTA VOWEL SIGN E
+114BB..114BE ; Mc # [4] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN AU
+114C1 ; Mc # TIRHUTA SIGN VISARGA
+115AF..115B1 ; Mc # [3] SIDDHAM VOWEL SIGN AA..SIDDHAM VOWEL SIGN II
+115B8..115BB ; Mc # [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU
+115BE ; Mc # SIDDHAM SIGN VISARGA
+11630..11632 ; Mc # [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II
+1163B..1163C ; Mc # [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU
+1163E ; Mc # MODI SIGN VISARGA
+116AC ; Mc # TAKRI SIGN VISARGA
+116AE..116AF ; Mc # [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II
+116B6 ; Mc # TAKRI SIGN VIRAMA
+1171E ; Mc # AHOM CONSONANT SIGN MEDIAL RA
+11720..11721 ; Mc # [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA
+11726 ; Mc # AHOM VOWEL SIGN E
+1182C..1182E ; Mc # [3] DOGRA VOWEL SIGN AA..DOGRA VOWEL SIGN II
+11838 ; Mc # DOGRA SIGN VISARGA
+11930..11935 ; Mc # [6] DIVES AKURU VOWEL SIGN AA..DIVES AKURU VOWEL SIGN E
+11937..11938 ; Mc # [2] DIVES AKURU VOWEL SIGN AI..DIVES AKURU VOWEL SIGN O
+1193D ; Mc # DIVES AKURU SIGN HALANTA
+11940 ; Mc # DIVES AKURU MEDIAL YA
+11942 ; Mc # DIVES AKURU MEDIAL RA
+119D1..119D3 ; Mc # [3] NANDINAGARI VOWEL SIGN AA..NANDINAGARI VOWEL SIGN II
+119DC..119DF ; Mc # [4] NANDINAGARI VOWEL SIGN O..NANDINAGARI SIGN VISARGA
+119E4 ; Mc # NANDINAGARI VOWEL SIGN PRISHTHAMATRA E
+11A39 ; Mc # ZANABAZAR SQUARE SIGN VISARGA
+11A57..11A58 ; Mc # [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU
+11A97 ; Mc # SOYOMBO SIGN VISARGA
+11C2F ; Mc # BHAIKSUKI VOWEL SIGN AA
+11C3E ; Mc # BHAIKSUKI SIGN VISARGA
+11CA9 ; Mc # MARCHEN SUBJOINED LETTER YA
+11CB1 ; Mc # MARCHEN VOWEL SIGN I
+11CB4 ; Mc # MARCHEN VOWEL SIGN O
+11D8A..11D8E ; Mc # [5] GUNJALA GONDI VOWEL SIGN AA..GUNJALA GONDI VOWEL SIGN UU
+11D93..11D94 ; Mc # [2] GUNJALA GONDI VOWEL SIGN OO..GUNJALA GONDI VOWEL SIGN AU
+11D96 ; Mc # GUNJALA GONDI SIGN VISARGA
+11EF5..11EF6 ; Mc # [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O
+11F03 ; Mc # KAWI SIGN VISARGA
+11F34..11F35 ; Mc # [2] KAWI VOWEL SIGN AA..KAWI VOWEL SIGN ALTERNATE AA
+11F3E..11F3F ; Mc # [2] KAWI VOWEL SIGN E..KAWI VOWEL SIGN AI
+11F41 ; Mc # KAWI SIGN KILLER
+1612A..1612C ; Mc # [3] GURUNG KHEMA CONSONANT SIGN MEDIAL YA..GURUNG KHEMA CONSONANT SIGN MEDIAL HA
+16F51..16F87 ; Mc # [55] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN UI
+16FF0..16FF1 ; Mc # [2] VIETNAMESE ALTERNATE READING MARK CA..VIETNAMESE ALTERNATE READING MARK NHAY
+1D165..1D166 ; Mc # [2] MUSICAL SYMBOL COMBINING STEM..MUSICAL SYMBOL COMBINING SPRECHGESANG STEM
+1D16D..1D172 ; Mc # [6] MUSICAL SYMBOL COMBINING AUGMENTATION DOT..MUSICAL SYMBOL COMBINING FLAG-5
+
+# Total code points: 468
+
+# ================================================
+
+# General_Category=Decimal_Number
+
+0030..0039 ; Nd # [10] DIGIT ZERO..DIGIT NINE
+0660..0669 ; Nd # [10] ARABIC-INDIC DIGIT ZERO..ARABIC-INDIC DIGIT NINE
+06F0..06F9 ; Nd # [10] EXTENDED ARABIC-INDIC DIGIT ZERO..EXTENDED ARABIC-INDIC DIGIT NINE
+07C0..07C9 ; Nd # [10] NKO DIGIT ZERO..NKO DIGIT NINE
+0966..096F ; Nd # [10] DEVANAGARI DIGIT ZERO..DEVANAGARI DIGIT NINE
+09E6..09EF ; Nd # [10] BENGALI DIGIT ZERO..BENGALI DIGIT NINE
+0A66..0A6F ; Nd # [10] GURMUKHI DIGIT ZERO..GURMUKHI DIGIT NINE
+0AE6..0AEF ; Nd # [10] GUJARATI DIGIT ZERO..GUJARATI DIGIT NINE
+0B66..0B6F ; Nd # [10] ORIYA DIGIT ZERO..ORIYA DIGIT NINE
+0BE6..0BEF ; Nd # [10] TAMIL DIGIT ZERO..TAMIL DIGIT NINE
+0C66..0C6F ; Nd # [10] TELUGU DIGIT ZERO..TELUGU DIGIT NINE
+0CE6..0CEF ; Nd # [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE
+0D66..0D6F ; Nd # [10] MALAYALAM DIGIT ZERO..MALAYALAM DIGIT NINE
+0DE6..0DEF ; Nd # [10] SINHALA LITH DIGIT ZERO..SINHALA LITH DIGIT NINE
+0E50..0E59 ; Nd # [10] THAI DIGIT ZERO..THAI DIGIT NINE
+0ED0..0ED9 ; Nd # [10] LAO DIGIT ZERO..LAO DIGIT NINE
+0F20..0F29 ; Nd # [10] TIBETAN DIGIT ZERO..TIBETAN DIGIT NINE
+1040..1049 ; Nd # [10] MYANMAR DIGIT ZERO..MYANMAR DIGIT NINE
+1090..1099 ; Nd # [10] MYANMAR SHAN DIGIT ZERO..MYANMAR SHAN DIGIT NINE
+17E0..17E9 ; Nd # [10] KHMER DIGIT ZERO..KHMER DIGIT NINE
+1810..1819 ; Nd # [10] MONGOLIAN DIGIT ZERO..MONGOLIAN DIGIT NINE
+1946..194F ; Nd # [10] LIMBU DIGIT ZERO..LIMBU DIGIT NINE
+19D0..19D9 ; Nd # [10] NEW TAI LUE DIGIT ZERO..NEW TAI LUE DIGIT NINE
+1A80..1A89 ; Nd # [10] TAI THAM HORA DIGIT ZERO..TAI THAM HORA DIGIT NINE
+1A90..1A99 ; Nd # [10] TAI THAM THAM DIGIT ZERO..TAI THAM THAM DIGIT NINE
+1B50..1B59 ; Nd # [10] BALINESE DIGIT ZERO..BALINESE DIGIT NINE
+1BB0..1BB9 ; Nd # [10] SUNDANESE DIGIT ZERO..SUNDANESE DIGIT NINE
+1C40..1C49 ; Nd # [10] LEPCHA DIGIT ZERO..LEPCHA DIGIT NINE
+1C50..1C59 ; Nd # [10] OL CHIKI DIGIT ZERO..OL CHIKI DIGIT NINE
+A620..A629 ; Nd # [10] VAI DIGIT ZERO..VAI DIGIT NINE
+A8D0..A8D9 ; Nd # [10] SAURASHTRA DIGIT ZERO..SAURASHTRA DIGIT NINE
+A900..A909 ; Nd # [10] KAYAH LI DIGIT ZERO..KAYAH LI DIGIT NINE
+A9D0..A9D9 ; Nd # [10] JAVANESE DIGIT ZERO..JAVANESE DIGIT NINE
+A9F0..A9F9 ; Nd # [10] MYANMAR TAI LAING DIGIT ZERO..MYANMAR TAI LAING DIGIT NINE
+AA50..AA59 ; Nd # [10] CHAM DIGIT ZERO..CHAM DIGIT NINE
+ABF0..ABF9 ; Nd # [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DIGIT NINE
+FF10..FF19 ; Nd # [10] FULLWIDTH DIGIT ZERO..FULLWIDTH DIGIT NINE
+104A0..104A9 ; Nd # [10] OSMANYA DIGIT ZERO..OSMANYA DIGIT NINE
+10D30..10D39 ; Nd # [10] HANIFI ROHINGYA DIGIT ZERO..HANIFI ROHINGYA DIGIT NINE
+10D40..10D49 ; Nd # [10] GARAY DIGIT ZERO..GARAY DIGIT NINE
+11066..1106F ; Nd # [10] BRAHMI DIGIT ZERO..BRAHMI DIGIT NINE
+110F0..110F9 ; Nd # [10] SORA SOMPENG DIGIT ZERO..SORA SOMPENG DIGIT NINE
+11136..1113F ; Nd # [10] CHAKMA DIGIT ZERO..CHAKMA DIGIT NINE
+111D0..111D9 ; Nd # [10] SHARADA DIGIT ZERO..SHARADA DIGIT NINE
+112F0..112F9 ; Nd # [10] KHUDAWADI DIGIT ZERO..KHUDAWADI DIGIT NINE
+11450..11459 ; Nd # [10] NEWA DIGIT ZERO..NEWA DIGIT NINE
+114D0..114D9 ; Nd # [10] TIRHUTA DIGIT ZERO..TIRHUTA DIGIT NINE
+11650..11659 ; Nd # [10] MODI DIGIT ZERO..MODI DIGIT NINE
+116C0..116C9 ; Nd # [10] TAKRI DIGIT ZERO..TAKRI DIGIT NINE
+116D0..116E3 ; Nd # [20] MYANMAR PAO DIGIT ZERO..MYANMAR EASTERN PWO KAREN DIGIT NINE
+11730..11739 ; Nd # [10] AHOM DIGIT ZERO..AHOM DIGIT NINE
+118E0..118E9 ; Nd # [10] WARANG CITI DIGIT ZERO..WARANG CITI DIGIT NINE
+11950..11959 ; Nd # [10] DIVES AKURU DIGIT ZERO..DIVES AKURU DIGIT NINE
+11BF0..11BF9 ; Nd # [10] SUNUWAR DIGIT ZERO..SUNUWAR DIGIT NINE
+11C50..11C59 ; Nd # [10] BHAIKSUKI DIGIT ZERO..BHAIKSUKI DIGIT NINE
+11D50..11D59 ; Nd # [10] MASARAM GONDI DIGIT ZERO..MASARAM GONDI DIGIT NINE
+11DA0..11DA9 ; Nd # [10] GUNJALA GONDI DIGIT ZERO..GUNJALA GONDI DIGIT NINE
+11F50..11F59 ; Nd # [10] KAWI DIGIT ZERO..KAWI DIGIT NINE
+16130..16139 ; Nd # [10] GURUNG KHEMA DIGIT ZERO..GURUNG KHEMA DIGIT NINE
+16A60..16A69 ; Nd # [10] MRO DIGIT ZERO..MRO DIGIT NINE
+16AC0..16AC9 ; Nd # [10] TANGSA DIGIT ZERO..TANGSA DIGIT NINE
+16B50..16B59 ; Nd # [10] PAHAWH HMONG DIGIT ZERO..PAHAWH HMONG DIGIT NINE
+16D70..16D79 ; Nd # [10] KIRAT RAI DIGIT ZERO..KIRAT RAI DIGIT NINE
+1CCF0..1CCF9 ; Nd # [10] OUTLINED DIGIT ZERO..OUTLINED DIGIT NINE
+1D7CE..1D7FF ; Nd # [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE
+1E140..1E149 ; Nd # [10] NYIAKENG PUACHUE HMONG DIGIT ZERO..NYIAKENG PUACHUE HMONG DIGIT NINE
+1E2F0..1E2F9 ; Nd # [10] WANCHO DIGIT ZERO..WANCHO DIGIT NINE
+1E4F0..1E4F9 ; Nd # [10] NAG MUNDARI DIGIT ZERO..NAG MUNDARI DIGIT NINE
+1E5F1..1E5FA ; Nd # [10] OL ONAL DIGIT ZERO..OL ONAL DIGIT NINE
+1E950..1E959 ; Nd # [10] ADLAM DIGIT ZERO..ADLAM DIGIT NINE
+1FBF0..1FBF9 ; Nd # [10] SEGMENTED DIGIT ZERO..SEGMENTED DIGIT NINE
+
+# Total code points: 760
+
+# ================================================
+
+# General_Category=Letter_Number
+
+16EE..16F0 ; Nl # [3] RUNIC ARLAUG SYMBOL..RUNIC BELGTHOR SYMBOL
+2160..2182 ; Nl # [35] ROMAN NUMERAL ONE..ROMAN NUMERAL TEN THOUSAND
+2185..2188 ; Nl # [4] ROMAN NUMERAL SIX LATE FORM..ROMAN NUMERAL ONE HUNDRED THOUSAND
+3007 ; Nl # IDEOGRAPHIC NUMBER ZERO
+3021..3029 ; Nl # [9] HANGZHOU NUMERAL ONE..HANGZHOU NUMERAL NINE
+3038..303A ; Nl # [3] HANGZHOU NUMERAL TEN..HANGZHOU NUMERAL THIRTY
+A6E6..A6EF ; Nl # [10] BAMUM LETTER MO..BAMUM LETTER KOGHOM
+10140..10174 ; Nl # [53] GREEK ACROPHONIC ATTIC ONE QUARTER..GREEK ACROPHONIC STRATIAN FIFTY MNAS
+10341 ; Nl # GOTHIC LETTER NINETY
+1034A ; Nl # GOTHIC LETTER NINE HUNDRED
+103D1..103D5 ; Nl # [5] OLD PERSIAN NUMBER ONE..OLD PERSIAN NUMBER HUNDRED
+12400..1246E ; Nl # [111] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN NINE U VARIANT FORM
+
+# Total code points: 236
+
+# ================================================
+
+# General_Category=Other_Number
+
+00B2..00B3 ; No # [2] SUPERSCRIPT TWO..SUPERSCRIPT THREE
+00B9 ; No # SUPERSCRIPT ONE
+00BC..00BE ; No # [3] VULGAR FRACTION ONE QUARTER..VULGAR FRACTION THREE QUARTERS
+09F4..09F9 ; No # [6] BENGALI CURRENCY NUMERATOR ONE..BENGALI CURRENCY DENOMINATOR SIXTEEN
+0B72..0B77 ; No # [6] ORIYA FRACTION ONE QUARTER..ORIYA FRACTION THREE SIXTEENTHS
+0BF0..0BF2 ; No # [3] TAMIL NUMBER TEN..TAMIL NUMBER ONE THOUSAND
+0C78..0C7E ; No # [7] TELUGU FRACTION DIGIT ZERO FOR ODD POWERS OF FOUR..TELUGU FRACTION DIGIT THREE FOR EVEN POWERS OF FOUR
+0D58..0D5E ; No # [7] MALAYALAM FRACTION ONE ONE-HUNDRED-AND-SIXTIETH..MALAYALAM FRACTION ONE FIFTH
+0D70..0D78 ; No # [9] MALAYALAM NUMBER TEN..MALAYALAM FRACTION THREE SIXTEENTHS
+0F2A..0F33 ; No # [10] TIBETAN DIGIT HALF ONE..TIBETAN DIGIT HALF ZERO
+1369..137C ; No # [20] ETHIOPIC DIGIT ONE..ETHIOPIC NUMBER TEN THOUSAND
+17F0..17F9 ; No # [10] KHMER SYMBOL LEK ATTAK SON..KHMER SYMBOL LEK ATTAK PRAM-BUON
+19DA ; No # NEW TAI LUE THAM DIGIT ONE
+2070 ; No # SUPERSCRIPT ZERO
+2074..2079 ; No # [6] SUPERSCRIPT FOUR..SUPERSCRIPT NINE
+2080..2089 ; No # [10] SUBSCRIPT ZERO..SUBSCRIPT NINE
+2150..215F ; No # [16] VULGAR FRACTION ONE SEVENTH..FRACTION NUMERATOR ONE
+2189 ; No # VULGAR FRACTION ZERO THIRDS
+2460..249B ; No # [60] CIRCLED DIGIT ONE..NUMBER TWENTY FULL STOP
+24EA..24FF ; No # [22] CIRCLED DIGIT ZERO..NEGATIVE CIRCLED DIGIT ZERO
+2776..2793 ; No # [30] DINGBAT NEGATIVE CIRCLED DIGIT ONE..DINGBAT NEGATIVE CIRCLED SANS-SERIF NUMBER TEN
+2CFD ; No # COPTIC FRACTION ONE HALF
+3192..3195 ; No # [4] IDEOGRAPHIC ANNOTATION ONE MARK..IDEOGRAPHIC ANNOTATION FOUR MARK
+3220..3229 ; No # [10] PARENTHESIZED IDEOGRAPH ONE..PARENTHESIZED IDEOGRAPH TEN
+3248..324F ; No # [8] CIRCLED NUMBER TEN ON BLACK SQUARE..CIRCLED NUMBER EIGHTY ON BLACK SQUARE
+3251..325F ; No # [15] CIRCLED NUMBER TWENTY ONE..CIRCLED NUMBER THIRTY FIVE
+3280..3289 ; No # [10] CIRCLED IDEOGRAPH ONE..CIRCLED IDEOGRAPH TEN
+32B1..32BF ; No # [15] CIRCLED NUMBER THIRTY SIX..CIRCLED NUMBER FIFTY
+A830..A835 ; No # [6] NORTH INDIC FRACTION ONE QUARTER..NORTH INDIC FRACTION THREE SIXTEENTHS
+10107..10133 ; No # [45] AEGEAN NUMBER ONE..AEGEAN NUMBER NINETY THOUSAND
+10175..10178 ; No # [4] GREEK ONE HALF SIGN..GREEK THREE QUARTERS SIGN
+1018A..1018B ; No # [2] GREEK ZERO SIGN..GREEK ONE QUARTER SIGN
+102E1..102FB ; No # [27] COPTIC EPACT DIGIT ONE..COPTIC EPACT NUMBER NINE HUNDRED
+10320..10323 ; No # [4] OLD ITALIC NUMERAL ONE..OLD ITALIC NUMERAL FIFTY
+10858..1085F ; No # [8] IMPERIAL ARAMAIC NUMBER ONE..IMPERIAL ARAMAIC NUMBER TEN THOUSAND
+10879..1087F ; No # [7] PALMYRENE NUMBER ONE..PALMYRENE NUMBER TWENTY
+108A7..108AF ; No # [9] NABATAEAN NUMBER ONE..NABATAEAN NUMBER ONE HUNDRED
+108FB..108FF ; No # [5] HATRAN NUMBER ONE..HATRAN NUMBER ONE HUNDRED
+10916..1091B ; No # [6] PHOENICIAN NUMBER ONE..PHOENICIAN NUMBER THREE
+109BC..109BD ; No # [2] MEROITIC CURSIVE FRACTION ELEVEN TWELFTHS..MEROITIC CURSIVE FRACTION ONE HALF
+109C0..109CF ; No # [16] MEROITIC CURSIVE NUMBER ONE..MEROITIC CURSIVE NUMBER SEVENTY
+109D2..109FF ; No # [46] MEROITIC CURSIVE NUMBER ONE HUNDRED..MEROITIC CURSIVE FRACTION TEN TWELFTHS
+10A40..10A48 ; No # [9] KHAROSHTHI DIGIT ONE..KHAROSHTHI FRACTION ONE HALF
+10A7D..10A7E ; No # [2] OLD SOUTH ARABIAN NUMBER ONE..OLD SOUTH ARABIAN NUMBER FIFTY
+10A9D..10A9F ; No # [3] OLD NORTH ARABIAN NUMBER ONE..OLD NORTH ARABIAN NUMBER TWENTY
+10AEB..10AEF ; No # [5] MANICHAEAN NUMBER ONE..MANICHAEAN NUMBER ONE HUNDRED
+10B58..10B5F ; No # [8] INSCRIPTIONAL PARTHIAN NUMBER ONE..INSCRIPTIONAL PARTHIAN NUMBER ONE THOUSAND
+10B78..10B7F ; No # [8] INSCRIPTIONAL PAHLAVI NUMBER ONE..INSCRIPTIONAL PAHLAVI NUMBER ONE THOUSAND
+10BA9..10BAF ; No # [7] PSALTER PAHLAVI NUMBER ONE..PSALTER PAHLAVI NUMBER ONE HUNDRED
+10CFA..10CFF ; No # [6] OLD HUNGARIAN NUMBER ONE..OLD HUNGARIAN NUMBER ONE THOUSAND
+10E60..10E7E ; No # [31] RUMI DIGIT ONE..RUMI FRACTION TWO THIRDS
+10F1D..10F26 ; No # [10] OLD SOGDIAN NUMBER ONE..OLD SOGDIAN FRACTION ONE HALF
+10F51..10F54 ; No # [4] SOGDIAN NUMBER ONE..SOGDIAN NUMBER ONE HUNDRED
+10FC5..10FCB ; No # [7] CHORASMIAN NUMBER ONE..CHORASMIAN NUMBER ONE HUNDRED
+11052..11065 ; No # [20] BRAHMI NUMBER ONE..BRAHMI NUMBER ONE THOUSAND
+111E1..111F4 ; No # [20] SINHALA ARCHAIC DIGIT ONE..SINHALA ARCHAIC NUMBER ONE THOUSAND
+1173A..1173B ; No # [2] AHOM NUMBER TEN..AHOM NUMBER TWENTY
+118EA..118F2 ; No # [9] WARANG CITI NUMBER TEN..WARANG CITI NUMBER NINETY
+11C5A..11C6C ; No # [19] BHAIKSUKI NUMBER ONE..BHAIKSUKI HUNDREDS UNIT MARK
+11FC0..11FD4 ; No # [21] TAMIL FRACTION ONE THREE-HUNDRED-AND-TWENTIETH..TAMIL FRACTION DOWNSCALING FACTOR KIIZH
+16B5B..16B61 ; No # [7] PAHAWH HMONG NUMBER TENS..PAHAWH HMONG NUMBER TRILLIONS
+16E80..16E96 ; No # [23] MEDEFAIDRIN DIGIT ZERO..MEDEFAIDRIN DIGIT THREE ALTERNATE FORM
+1D2C0..1D2D3 ; No # [20] KAKTOVIK NUMERAL ZERO..KAKTOVIK NUMERAL NINETEEN
+1D2E0..1D2F3 ; No # [20] MAYAN NUMERAL ZERO..MAYAN NUMERAL NINETEEN
+1D360..1D378 ; No # [25] COUNTING ROD UNIT DIGIT ONE..TALLY MARK FIVE
+1E8C7..1E8CF ; No # [9] MENDE KIKAKUI DIGIT ONE..MENDE KIKAKUI DIGIT NINE
+1EC71..1ECAB ; No # [59] INDIC SIYAQ NUMBER ONE..INDIC SIYAQ NUMBER PREFIXED NINE
+1ECAD..1ECAF ; No # [3] INDIC SIYAQ FRACTION ONE QUARTER..INDIC SIYAQ FRACTION THREE QUARTERS
+1ECB1..1ECB4 ; No # [4] INDIC SIYAQ NUMBER ALTERNATE ONE..INDIC SIYAQ ALTERNATE LAKH MARK
+1ED01..1ED2D ; No # [45] OTTOMAN SIYAQ NUMBER ONE..OTTOMAN SIYAQ NUMBER NINETY THOUSAND
+1ED2F..1ED3D ; No # [15] OTTOMAN SIYAQ ALTERNATE NUMBER TWO..OTTOMAN SIYAQ FRACTION ONE SIXTH
+1F100..1F10C ; No # [13] DIGIT ZERO FULL STOP..DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ZERO
+
+# Total code points: 915
+
+# ================================================
+
+# General_Category=Space_Separator
+
+0020 ; Zs # SPACE
+00A0 ; Zs # NO-BREAK SPACE
+1680 ; Zs # OGHAM SPACE MARK
+2000..200A ; Zs # [11] EN QUAD..HAIR SPACE
+202F ; Zs # NARROW NO-BREAK SPACE
+205F ; Zs # MEDIUM MATHEMATICAL SPACE
+3000 ; Zs # IDEOGRAPHIC SPACE
+
+# Total code points: 17
+
+# ================================================
+
+# General_Category=Line_Separator
+
+2028 ; Zl # LINE SEPARATOR
+
+# Total code points: 1
+
+# ================================================
+
+# General_Category=Paragraph_Separator
+
+2029 ; Zp # PARAGRAPH SEPARATOR
+
+# Total code points: 1
+
+# ================================================
+
+# General_Category=Control
+
+0000..001F ; Cc # [32] <control-0000>..<control-001F>
+007F..009F ; Cc # [33] <control-007F>..<control-009F>
+
+# Total code points: 65
+
+# ================================================
+
+# General_Category=Format
+
+00AD ; Cf # SOFT HYPHEN
+0600..0605 ; Cf # [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE
+061C ; Cf # ARABIC LETTER MARK
+06DD ; Cf # ARABIC END OF AYAH
+070F ; Cf # SYRIAC ABBREVIATION MARK
+0890..0891 ; Cf # [2] ARABIC POUND MARK ABOVE..ARABIC PIASTRE MARK ABOVE
+08E2 ; Cf # ARABIC DISPUTED END OF AYAH
+180E ; Cf # MONGOLIAN VOWEL SEPARATOR
+200B..200F ; Cf # [5] ZERO WIDTH SPACE..RIGHT-TO-LEFT MARK
+202A..202E ; Cf # [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE
+2060..2064 ; Cf # [5] WORD JOINER..INVISIBLE PLUS
+2066..206F ; Cf # [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES
+FEFF ; Cf # ZERO WIDTH NO-BREAK SPACE
+FFF9..FFFB ; Cf # [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR
+110BD ; Cf # KAITHI NUMBER SIGN
+110CD ; Cf # KAITHI NUMBER SIGN ABOVE
+13430..1343F ; Cf # [16] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE
+1BCA0..1BCA3 ; Cf # [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP
+1D173..1D17A ; Cf # [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE
+E0001 ; Cf # LANGUAGE TAG
+E0020..E007F ; Cf # [96] TAG SPACE..CANCEL TAG
+
+# Total code points: 170
+
+# ================================================
+
+# General_Category=Private_Use
+
+E000..F8FF ; Co # [6400] <private-use-E000>..<private-use-F8FF>
+F0000..FFFFD ; Co # [65534] <private-use-F0000>..<private-use-FFFFD>
+100000..10FFFD; Co # [65534] <private-use-100000>..<private-use-10FFFD>
+
+# Total code points: 137468
+
+# ================================================
+
+# General_Category=Surrogate
+
+D800..DFFF ; Cs # [2048] <surrogate-D800>..<surrogate-DFFF>
+
+# Total code points: 2048
+
+# ================================================
+
+# General_Category=Dash_Punctuation
+
+002D ; Pd # HYPHEN-MINUS
+058A ; Pd # ARMENIAN HYPHEN
+05BE ; Pd # HEBREW PUNCTUATION MAQAF
+1400 ; Pd # CANADIAN SYLLABICS HYPHEN
+1806 ; Pd # MONGOLIAN TODO SOFT HYPHEN
+2010..2015 ; Pd # [6] HYPHEN..HORIZONTAL BAR
+2E17 ; Pd # DOUBLE OBLIQUE HYPHEN
+2E1A ; Pd # HYPHEN WITH DIAERESIS
+2E3A..2E3B ; Pd # [2] TWO-EM DASH..THREE-EM DASH
+2E40 ; Pd # DOUBLE HYPHEN
+2E5D ; Pd # OBLIQUE HYPHEN
+301C ; Pd # WAVE DASH
+3030 ; Pd # WAVY DASH
+30A0 ; Pd # KATAKANA-HIRAGANA DOUBLE HYPHEN
+FE31..FE32 ; Pd # [2] PRESENTATION FORM FOR VERTICAL EM DASH..PRESENTATION FORM FOR VERTICAL EN DASH
+FE58 ; Pd # SMALL EM DASH
+FE63 ; Pd # SMALL HYPHEN-MINUS
+FF0D ; Pd # FULLWIDTH HYPHEN-MINUS
+10D6E ; Pd # GARAY HYPHEN
+10EAD ; Pd # YEZIDI HYPHENATION MARK
+
+# Total code points: 27
+
+# ================================================
+
+# General_Category=Open_Punctuation
+
+0028 ; Ps # LEFT PARENTHESIS
+005B ; Ps # LEFT SQUARE BRACKET
+007B ; Ps # LEFT CURLY BRACKET
+0F3A ; Ps # TIBETAN MARK GUG RTAGS GYON
+0F3C ; Ps # TIBETAN MARK ANG KHANG GYON
+169B ; Ps # OGHAM FEATHER MARK
+201A ; Ps # SINGLE LOW-9 QUOTATION MARK
+201E ; Ps # DOUBLE LOW-9 QUOTATION MARK
+2045 ; Ps # LEFT SQUARE BRACKET WITH QUILL
+207D ; Ps # SUPERSCRIPT LEFT PARENTHESIS
+208D ; Ps # SUBSCRIPT LEFT PARENTHESIS
+2308 ; Ps # LEFT CEILING
+230A ; Ps # LEFT FLOOR
+2329 ; Ps # LEFT-POINTING ANGLE BRACKET
+2768 ; Ps # MEDIUM LEFT PARENTHESIS ORNAMENT
+276A ; Ps # MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT
+276C ; Ps # MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT
+276E ; Ps # HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT
+2770 ; Ps # HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT
+2772 ; Ps # LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT
+2774 ; Ps # MEDIUM LEFT CURLY BRACKET ORNAMENT
+27C5 ; Ps # LEFT S-SHAPED BAG DELIMITER
+27E6 ; Ps # MATHEMATICAL LEFT WHITE SQUARE BRACKET
+27E8 ; Ps # MATHEMATICAL LEFT ANGLE BRACKET
+27EA ; Ps # MATHEMATICAL LEFT DOUBLE ANGLE BRACKET
+27EC ; Ps # MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET
+27EE ; Ps # MATHEMATICAL LEFT FLATTENED PARENTHESIS
+2983 ; Ps # LEFT WHITE CURLY BRACKET
+2985 ; Ps # LEFT WHITE PARENTHESIS
+2987 ; Ps # Z NOTATION LEFT IMAGE BRACKET
+2989 ; Ps # Z NOTATION LEFT BINDING BRACKET
+298B ; Ps # LEFT SQUARE BRACKET WITH UNDERBAR
+298D ; Ps # LEFT SQUARE BRACKET WITH TICK IN TOP CORNER
+298F ; Ps # LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
+2991 ; Ps # LEFT ANGLE BRACKET WITH DOT
+2993 ; Ps # LEFT ARC LESS-THAN BRACKET
+2995 ; Ps # DOUBLE LEFT ARC GREATER-THAN BRACKET
+2997 ; Ps # LEFT BLACK TORTOISE SHELL BRACKET
+29D8 ; Ps # LEFT WIGGLY FENCE
+29DA ; Ps # LEFT DOUBLE WIGGLY FENCE
+29FC ; Ps # LEFT-POINTING CURVED ANGLE BRACKET
+2E22 ; Ps # TOP LEFT HALF BRACKET
+2E24 ; Ps # BOTTOM LEFT HALF BRACKET
+2E26 ; Ps # LEFT SIDEWAYS U BRACKET
+2E28 ; Ps # LEFT DOUBLE PARENTHESIS
+2E42 ; Ps # DOUBLE LOW-REVERSED-9 QUOTATION MARK
+2E55 ; Ps # LEFT SQUARE BRACKET WITH STROKE
+2E57 ; Ps # LEFT SQUARE BRACKET WITH DOUBLE STROKE
+2E59 ; Ps # TOP HALF LEFT PARENTHESIS
+2E5B ; Ps # BOTTOM HALF LEFT PARENTHESIS
+3008 ; Ps # LEFT ANGLE BRACKET
+300A ; Ps # LEFT DOUBLE ANGLE BRACKET
+300C ; Ps # LEFT CORNER BRACKET
+300E ; Ps # LEFT WHITE CORNER BRACKET
+3010 ; Ps # LEFT BLACK LENTICULAR BRACKET
+3014 ; Ps # LEFT TORTOISE SHELL BRACKET
+3016 ; Ps # LEFT WHITE LENTICULAR BRACKET
+3018 ; Ps # LEFT WHITE TORTOISE SHELL BRACKET
+301A ; Ps # LEFT WHITE SQUARE BRACKET
+301D ; Ps # REVERSED DOUBLE PRIME QUOTATION MARK
+FD3F ; Ps # ORNATE RIGHT PARENTHESIS
+FE17 ; Ps # PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET
+FE35 ; Ps # PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS
+FE37 ; Ps # PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET
+FE39 ; Ps # PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET
+FE3B ; Ps # PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET
+FE3D ; Ps # PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET
+FE3F ; Ps # PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET
+FE41 ; Ps # PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET
+FE43 ; Ps # PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET
+FE47 ; Ps # PRESENTATION FORM FOR VERTICAL LEFT SQUARE BRACKET
+FE59 ; Ps # SMALL LEFT PARENTHESIS
+FE5B ; Ps # SMALL LEFT CURLY BRACKET
+FE5D ; Ps # SMALL LEFT TORTOISE SHELL BRACKET
+FF08 ; Ps # FULLWIDTH LEFT PARENTHESIS
+FF3B ; Ps # FULLWIDTH LEFT SQUARE BRACKET
+FF5B ; Ps # FULLWIDTH LEFT CURLY BRACKET
+FF5F ; Ps # FULLWIDTH LEFT WHITE PARENTHESIS
+FF62 ; Ps # HALFWIDTH LEFT CORNER BRACKET
+
+# Total code points: 79
+
+# ================================================
+
+# General_Category=Close_Punctuation
+
+0029 ; Pe # RIGHT PARENTHESIS
+005D ; Pe # RIGHT SQUARE BRACKET
+007D ; Pe # RIGHT CURLY BRACKET
+0F3B ; Pe # TIBETAN MARK GUG RTAGS GYAS
+0F3D ; Pe # TIBETAN MARK ANG KHANG GYAS
+169C ; Pe # OGHAM REVERSED FEATHER MARK
+2046 ; Pe # RIGHT SQUARE BRACKET WITH QUILL
+207E ; Pe # SUPERSCRIPT RIGHT PARENTHESIS
+208E ; Pe # SUBSCRIPT RIGHT PARENTHESIS
+2309 ; Pe # RIGHT CEILING
+230B ; Pe # RIGHT FLOOR
+232A ; Pe # RIGHT-POINTING ANGLE BRACKET
+2769 ; Pe # MEDIUM RIGHT PARENTHESIS ORNAMENT
+276B ; Pe # MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT
+276D ; Pe # MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT
+276F ; Pe # HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT
+2771 ; Pe # HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT
+2773 ; Pe # LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT
+2775 ; Pe # MEDIUM RIGHT CURLY BRACKET ORNAMENT
+27C6 ; Pe # RIGHT S-SHAPED BAG DELIMITER
+27E7 ; Pe # MATHEMATICAL RIGHT WHITE SQUARE BRACKET
+27E9 ; Pe # MATHEMATICAL RIGHT ANGLE BRACKET
+27EB ; Pe # MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET
+27ED ; Pe # MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET
+27EF ; Pe # MATHEMATICAL RIGHT FLATTENED PARENTHESIS
+2984 ; Pe # RIGHT WHITE CURLY BRACKET
+2986 ; Pe # RIGHT WHITE PARENTHESIS
+2988 ; Pe # Z NOTATION RIGHT IMAGE BRACKET
+298A ; Pe # Z NOTATION RIGHT BINDING BRACKET
+298C ; Pe # RIGHT SQUARE BRACKET WITH UNDERBAR
+298E ; Pe # RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
+2990 ; Pe # RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER
+2992 ; Pe # RIGHT ANGLE BRACKET WITH DOT
+2994 ; Pe # RIGHT ARC GREATER-THAN BRACKET
+2996 ; Pe # DOUBLE RIGHT ARC LESS-THAN BRACKET
+2998 ; Pe # RIGHT BLACK TORTOISE SHELL BRACKET
+29D9 ; Pe # RIGHT WIGGLY FENCE
+29DB ; Pe # RIGHT DOUBLE WIGGLY FENCE
+29FD ; Pe # RIGHT-POINTING CURVED ANGLE BRACKET
+2E23 ; Pe # TOP RIGHT HALF BRACKET
+2E25 ; Pe # BOTTOM RIGHT HALF BRACKET
+2E27 ; Pe # RIGHT SIDEWAYS U BRACKET
+2E29 ; Pe # RIGHT DOUBLE PARENTHESIS
+2E56 ; Pe # RIGHT SQUARE BRACKET WITH STROKE
+2E58 ; Pe # RIGHT SQUARE BRACKET WITH DOUBLE STROKE
+2E5A ; Pe # TOP HALF RIGHT PARENTHESIS
+2E5C ; Pe # BOTTOM HALF RIGHT PARENTHESIS
+3009 ; Pe # RIGHT ANGLE BRACKET
+300B ; Pe # RIGHT DOUBLE ANGLE BRACKET
+300D ; Pe # RIGHT CORNER BRACKET
+300F ; Pe # RIGHT WHITE CORNER BRACKET
+3011 ; Pe # RIGHT BLACK LENTICULAR BRACKET
+3015 ; Pe # RIGHT TORTOISE SHELL BRACKET
+3017 ; Pe # RIGHT WHITE LENTICULAR BRACKET
+3019 ; Pe # RIGHT WHITE TORTOISE SHELL BRACKET
+301B ; Pe # RIGHT WHITE SQUARE BRACKET
+301E..301F ; Pe # [2] DOUBLE PRIME QUOTATION MARK..LOW DOUBLE PRIME QUOTATION MARK
+FD3E ; Pe # ORNATE LEFT PARENTHESIS
+FE18 ; Pe # PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET
+FE36 ; Pe # PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
+FE38 ; Pe # PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
+FE3A ; Pe # PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
+FE3C ; Pe # PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET
+FE3E ; Pe # PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET
+FE40 ; Pe # PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET
+FE42 ; Pe # PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET
+FE44 ; Pe # PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET
+FE48 ; Pe # PRESENTATION FORM FOR VERTICAL RIGHT SQUARE BRACKET
+FE5A ; Pe # SMALL RIGHT PARENTHESIS
+FE5C ; Pe # SMALL RIGHT CURLY BRACKET
+FE5E ; Pe # SMALL RIGHT TORTOISE SHELL BRACKET
+FF09 ; Pe # FULLWIDTH RIGHT PARENTHESIS
+FF3D ; Pe # FULLWIDTH RIGHT SQUARE BRACKET
+FF5D ; Pe # FULLWIDTH RIGHT CURLY BRACKET
+FF60 ; Pe # FULLWIDTH RIGHT WHITE PARENTHESIS
+FF63 ; Pe # HALFWIDTH RIGHT CORNER BRACKET
+
+# Total code points: 77
+
+# ================================================
+
+# General_Category=Connector_Punctuation
+
+005F ; Pc # LOW LINE
+203F..2040 ; Pc # [2] UNDERTIE..CHARACTER TIE
+2054 ; Pc # INVERTED UNDERTIE
+FE33..FE34 ; Pc # [2] PRESENTATION FORM FOR VERTICAL LOW LINE..PRESENTATION FORM FOR VERTICAL WAVY LOW LINE
+FE4D..FE4F ; Pc # [3] DASHED LOW LINE..WAVY LOW LINE
+FF3F ; Pc # FULLWIDTH LOW LINE
+
+# Total code points: 10
+
+# ================================================
+
+# General_Category=Other_Punctuation
+
+0021..0023 ; Po # [3] EXCLAMATION MARK..NUMBER SIGN
+0025..0027 ; Po # [3] PERCENT SIGN..APOSTROPHE
+002A ; Po # ASTERISK
+002C ; Po # COMMA
+002E..002F ; Po # [2] FULL STOP..SOLIDUS
+003A..003B ; Po # [2] COLON..SEMICOLON
+003F..0040 ; Po # [2] QUESTION MARK..COMMERCIAL AT
+005C ; Po # REVERSE SOLIDUS
+00A1 ; Po # INVERTED EXCLAMATION MARK
+00A7 ; Po # SECTION SIGN
+00B6..00B7 ; Po # [2] PILCROW SIGN..MIDDLE DOT
+00BF ; Po # INVERTED QUESTION MARK
+037E ; Po # GREEK QUESTION MARK
+0387 ; Po # GREEK ANO TELEIA
+055A..055F ; Po # [6] ARMENIAN APOSTROPHE..ARMENIAN ABBREVIATION MARK
+0589 ; Po # ARMENIAN FULL STOP
+05C0 ; Po # HEBREW PUNCTUATION PASEQ
+05C3 ; Po # HEBREW PUNCTUATION SOF PASUQ
+05C6 ; Po # HEBREW PUNCTUATION NUN HAFUKHA
+05F3..05F4 ; Po # [2] HEBREW PUNCTUATION GERESH..HEBREW PUNCTUATION GERSHAYIM
+0609..060A ; Po # [2] ARABIC-INDIC PER MILLE SIGN..ARABIC-INDIC PER TEN THOUSAND SIGN
+060C..060D ; Po # [2] ARABIC COMMA..ARABIC DATE SEPARATOR
+061B ; Po # ARABIC SEMICOLON
+061D..061F ; Po # [3] ARABIC END OF TEXT MARK..ARABIC QUESTION MARK
+066A..066D ; Po # [4] ARABIC PERCENT SIGN..ARABIC FIVE POINTED STAR
+06D4 ; Po # ARABIC FULL STOP
+0700..070D ; Po # [14] SYRIAC END OF PARAGRAPH..SYRIAC HARKLEAN ASTERISCUS
+07F7..07F9 ; Po # [3] NKO SYMBOL GBAKURUNEN..NKO EXCLAMATION MARK
+0830..083E ; Po # [15] SAMARITAN PUNCTUATION NEQUDAA..SAMARITAN PUNCTUATION ANNAAU
+085E ; Po # MANDAIC PUNCTUATION
+0964..0965 ; Po # [2] DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA
+0970 ; Po # DEVANAGARI ABBREVIATION SIGN
+09FD ; Po # BENGALI ABBREVIATION SIGN
+0A76 ; Po # GURMUKHI ABBREVIATION SIGN
+0AF0 ; Po # GUJARATI ABBREVIATION SIGN
+0C77 ; Po # TELUGU SIGN SIDDHAM
+0C84 ; Po # KANNADA SIGN SIDDHAM
+0DF4 ; Po # SINHALA PUNCTUATION KUNDDALIYA
+0E4F ; Po # THAI CHARACTER FONGMAN
+0E5A..0E5B ; Po # [2] THAI CHARACTER ANGKHANKHU..THAI CHARACTER KHOMUT
+0F04..0F12 ; Po # [15] TIBETAN MARK INITIAL YIG MGO MDUN MA..TIBETAN MARK RGYA GRAM SHAD
+0F14 ; Po # TIBETAN MARK GTER TSHEG
+0F85 ; Po # TIBETAN MARK PALUTA
+0FD0..0FD4 ; Po # [5] TIBETAN MARK BSKA- SHOG GI MGO RGYAN..TIBETAN MARK CLOSING BRDA RNYING YIG MGO SGAB MA
+0FD9..0FDA ; Po # [2] TIBETAN MARK LEADING MCHAN RTAGS..TIBETAN MARK TRAILING MCHAN RTAGS
+104A..104F ; Po # [6] MYANMAR SIGN LITTLE SECTION..MYANMAR SYMBOL GENITIVE
+10FB ; Po # GEORGIAN PARAGRAPH SEPARATOR
+1360..1368 ; Po # [9] ETHIOPIC SECTION MARK..ETHIOPIC PARAGRAPH SEPARATOR
+166E ; Po # CANADIAN SYLLABICS FULL STOP
+16EB..16ED ; Po # [3] RUNIC SINGLE PUNCTUATION..RUNIC CROSS PUNCTUATION
+1735..1736 ; Po # [2] PHILIPPINE SINGLE PUNCTUATION..PHILIPPINE DOUBLE PUNCTUATION
+17D4..17D6 ; Po # [3] KHMER SIGN KHAN..KHMER SIGN CAMNUC PII KUUH
+17D8..17DA ; Po # [3] KHMER SIGN BEYYAL..KHMER SIGN KOOMUUT
+1800..1805 ; Po # [6] MONGOLIAN BIRGA..MONGOLIAN FOUR DOTS
+1807..180A ; Po # [4] MONGOLIAN SIBE SYLLABLE BOUNDARY MARKER..MONGOLIAN NIRUGU
+1944..1945 ; Po # [2] LIMBU EXCLAMATION MARK..LIMBU QUESTION MARK
+1A1E..1A1F ; Po # [2] BUGINESE PALLAWA..BUGINESE END OF SECTION
+1AA0..1AA6 ; Po # [7] TAI THAM SIGN WIANG..TAI THAM SIGN REVERSED ROTATED RANA
+1AA8..1AAD ; Po # [6] TAI THAM SIGN KAAN..TAI THAM SIGN CAANG
+1B4E..1B4F ; Po # [2] BALINESE INVERTED CARIK SIKI..BALINESE INVERTED CARIK PAREREN
+1B5A..1B60 ; Po # [7] BALINESE PANTI..BALINESE PAMENENG
+1B7D..1B7F ; Po # [3] BALINESE PANTI LANTANG..BALINESE PANTI BAWAK
+1BFC..1BFF ; Po # [4] BATAK SYMBOL BINDU NA METEK..BATAK SYMBOL BINDU PANGOLAT
+1C3B..1C3F ; Po # [5] LEPCHA PUNCTUATION TA-ROL..LEPCHA PUNCTUATION TSHOOK
+1C7E..1C7F ; Po # [2] OL CHIKI PUNCTUATION MUCAAD..OL CHIKI PUNCTUATION DOUBLE MUCAAD
+1CC0..1CC7 ; Po # [8] SUNDANESE PUNCTUATION BINDU SURYA..SUNDANESE PUNCTUATION BINDU BA SATANGA
+1CD3 ; Po # VEDIC SIGN NIHSHVASA
+2016..2017 ; Po # [2] DOUBLE VERTICAL LINE..DOUBLE LOW LINE
+2020..2027 ; Po # [8] DAGGER..HYPHENATION POINT
+2030..2038 ; Po # [9] PER MILLE SIGN..CARET
+203B..203E ; Po # [4] REFERENCE MARK..OVERLINE
+2041..2043 ; Po # [3] CARET INSERTION POINT..HYPHEN BULLET
+2047..2051 ; Po # [11] DOUBLE QUESTION MARK..TWO ASTERISKS ALIGNED VERTICALLY
+2053 ; Po # SWUNG DASH
+2055..205E ; Po # [10] FLOWER PUNCTUATION MARK..VERTICAL FOUR DOTS
+2CF9..2CFC ; Po # [4] COPTIC OLD NUBIAN FULL STOP..COPTIC OLD NUBIAN VERSE DIVIDER
+2CFE..2CFF ; Po # [2] COPTIC FULL STOP..COPTIC MORPHOLOGICAL DIVIDER
+2D70 ; Po # TIFINAGH SEPARATOR MARK
+2E00..2E01 ; Po # [2] RIGHT ANGLE SUBSTITUTION MARKER..RIGHT ANGLE DOTTED SUBSTITUTION MARKER
+2E06..2E08 ; Po # [3] RAISED INTERPOLATION MARKER..DOTTED TRANSPOSITION MARKER
+2E0B ; Po # RAISED SQUARE
+2E0E..2E16 ; Po # [9] EDITORIAL CORONIS..DOTTED RIGHT-POINTING ANGLE
+2E18..2E19 ; Po # [2] INVERTED INTERROBANG..PALM BRANCH
+2E1B ; Po # TILDE WITH RING ABOVE
+2E1E..2E1F ; Po # [2] TILDE WITH DOT ABOVE..TILDE WITH DOT BELOW
+2E2A..2E2E ; Po # [5] TWO DOTS OVER ONE DOT PUNCTUATION..REVERSED QUESTION MARK
+2E30..2E39 ; Po # [10] RING POINT..TOP HALF SECTION SIGN
+2E3C..2E3F ; Po # [4] STENOGRAPHIC FULL STOP..CAPITULUM
+2E41 ; Po # REVERSED COMMA
+2E43..2E4F ; Po # [13] DASH WITH LEFT UPTURN..CORNISH VERSE DIVIDER
+2E52..2E54 ; Po # [3] TIRONIAN SIGN CAPITAL ET..MEDIEVAL QUESTION MARK
+3001..3003 ; Po # [3] IDEOGRAPHIC COMMA..DITTO MARK
+303D ; Po # PART ALTERNATION MARK
+30FB ; Po # KATAKANA MIDDLE DOT
+A4FE..A4FF ; Po # [2] LISU PUNCTUATION COMMA..LISU PUNCTUATION FULL STOP
+A60D..A60F ; Po # [3] VAI COMMA..VAI QUESTION MARK
+A673 ; Po # SLAVONIC ASTERISK
+A67E ; Po # CYRILLIC KAVYKA
+A6F2..A6F7 ; Po # [6] BAMUM NJAEMLI..BAMUM QUESTION MARK
+A874..A877 ; Po # [4] PHAGS-PA SINGLE HEAD MARK..PHAGS-PA MARK DOUBLE SHAD
+A8CE..A8CF ; Po # [2] SAURASHTRA DANDA..SAURASHTRA DOUBLE DANDA
+A8F8..A8FA ; Po # [3] DEVANAGARI SIGN PUSHPIKA..DEVANAGARI CARET
+A8FC ; Po # DEVANAGARI SIGN SIDDHAM
+A92E..A92F ; Po # [2] KAYAH LI SIGN CWI..KAYAH LI SIGN SHYA
+A95F ; Po # REJANG SECTION MARK
+A9C1..A9CD ; Po # [13] JAVANESE LEFT RERENGGAN..JAVANESE TURNED PADA PISELEH
+A9DE..A9DF ; Po # [2] JAVANESE PADA TIRTA TUMETES..JAVANESE PADA ISEN-ISEN
+AA5C..AA5F ; Po # [4] CHAM PUNCTUATION SPIRAL..CHAM PUNCTUATION TRIPLE DANDA
+AADE..AADF ; Po # [2] TAI VIET SYMBOL HO HOI..TAI VIET SYMBOL KOI KOI
+AAF0..AAF1 ; Po # [2] MEETEI MAYEK CHEIKHAN..MEETEI MAYEK AHANG KHUDAM
+ABEB ; Po # MEETEI MAYEK CHEIKHEI
+FE10..FE16 ; Po # [7] PRESENTATION FORM FOR VERTICAL COMMA..PRESENTATION FORM FOR VERTICAL QUESTION MARK
+FE19 ; Po # PRESENTATION FORM FOR VERTICAL HORIZONTAL ELLIPSIS
+FE30 ; Po # PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
+FE45..FE46 ; Po # [2] SESAME DOT..WHITE SESAME DOT
+FE49..FE4C ; Po # [4] DASHED OVERLINE..DOUBLE WAVY OVERLINE
+FE50..FE52 ; Po # [3] SMALL COMMA..SMALL FULL STOP
+FE54..FE57 ; Po # [4] SMALL SEMICOLON..SMALL EXCLAMATION MARK
+FE5F..FE61 ; Po # [3] SMALL NUMBER SIGN..SMALL ASTERISK
+FE68 ; Po # SMALL REVERSE SOLIDUS
+FE6A..FE6B ; Po # [2] SMALL PERCENT SIGN..SMALL COMMERCIAL AT
+FF01..FF03 ; Po # [3] FULLWIDTH EXCLAMATION MARK..FULLWIDTH NUMBER SIGN
+FF05..FF07 ; Po # [3] FULLWIDTH PERCENT SIGN..FULLWIDTH APOSTROPHE
+FF0A ; Po # FULLWIDTH ASTERISK
+FF0C ; Po # FULLWIDTH COMMA
+FF0E..FF0F ; Po # [2] FULLWIDTH FULL STOP..FULLWIDTH SOLIDUS
+FF1A..FF1B ; Po # [2] FULLWIDTH COLON..FULLWIDTH SEMICOLON
+FF1F..FF20 ; Po # [2] FULLWIDTH QUESTION MARK..FULLWIDTH COMMERCIAL AT
+FF3C ; Po # FULLWIDTH REVERSE SOLIDUS
+FF61 ; Po # HALFWIDTH IDEOGRAPHIC FULL STOP
+FF64..FF65 ; Po # [2] HALFWIDTH IDEOGRAPHIC COMMA..HALFWIDTH KATAKANA MIDDLE DOT
+10100..10102 ; Po # [3] AEGEAN WORD SEPARATOR LINE..AEGEAN CHECK MARK
+1039F ; Po # UGARITIC WORD DIVIDER
+103D0 ; Po # OLD PERSIAN WORD DIVIDER
+1056F ; Po # CAUCASIAN ALBANIAN CITATION MARK
+10857 ; Po # IMPERIAL ARAMAIC SECTION SIGN
+1091F ; Po # PHOENICIAN WORD SEPARATOR
+1093F ; Po # LYDIAN TRIANGULAR MARK
+10A50..10A58 ; Po # [9] KHAROSHTHI PUNCTUATION DOT..KHAROSHTHI PUNCTUATION LINES
+10A7F ; Po # OLD SOUTH ARABIAN NUMERIC INDICATOR
+10AF0..10AF6 ; Po # [7] MANICHAEAN PUNCTUATION STAR..MANICHAEAN PUNCTUATION LINE FILLER
+10B39..10B3F ; Po # [7] AVESTAN ABBREVIATION MARK..LARGE ONE RING OVER TWO RINGS PUNCTUATION
+10B99..10B9C ; Po # [4] PSALTER PAHLAVI SECTION MARK..PSALTER PAHLAVI FOUR DOTS WITH DOT
+10F55..10F59 ; Po # [5] SOGDIAN PUNCTUATION TWO VERTICAL BARS..SOGDIAN PUNCTUATION HALF CIRCLE WITH DOT
+10F86..10F89 ; Po # [4] OLD UYGHUR PUNCTUATION BAR..OLD UYGHUR PUNCTUATION FOUR DOTS
+11047..1104D ; Po # [7] BRAHMI DANDA..BRAHMI PUNCTUATION LOTUS
+110BB..110BC ; Po # [2] KAITHI ABBREVIATION SIGN..KAITHI ENUMERATION SIGN
+110BE..110C1 ; Po # [4] KAITHI SECTION MARK..KAITHI DOUBLE DANDA
+11140..11143 ; Po # [4] CHAKMA SECTION MARK..CHAKMA QUESTION MARK
+11174..11175 ; Po # [2] MAHAJANI ABBREVIATION SIGN..MAHAJANI SECTION MARK
+111C5..111C8 ; Po # [4] SHARADA DANDA..SHARADA SEPARATOR
+111CD ; Po # SHARADA SUTRA MARK
+111DB ; Po # SHARADA SIGN SIDDHAM
+111DD..111DF ; Po # [3] SHARADA CONTINUATION SIGN..SHARADA SECTION MARK-2
+11238..1123D ; Po # [6] KHOJKI DANDA..KHOJKI ABBREVIATION SIGN
+112A9 ; Po # MULTANI SECTION MARK
+113D4..113D5 ; Po # [2] TULU-TIGALARI DANDA..TULU-TIGALARI DOUBLE DANDA
+113D7..113D8 ; Po # [2] TULU-TIGALARI SIGN OM PUSHPIKA..TULU-TIGALARI SIGN SHRII PUSHPIKA
+1144B..1144F ; Po # [5] NEWA DANDA..NEWA ABBREVIATION SIGN
+1145A..1145B ; Po # [2] NEWA DOUBLE COMMA..NEWA PLACEHOLDER MARK
+1145D ; Po # NEWA INSERTION SIGN
+114C6 ; Po # TIRHUTA ABBREVIATION SIGN
+115C1..115D7 ; Po # [23] SIDDHAM SIGN SIDDHAM..SIDDHAM SECTION MARK WITH CIRCLES AND FOUR ENCLOSURES
+11641..11643 ; Po # [3] MODI DANDA..MODI ABBREVIATION SIGN
+11660..1166C ; Po # [13] MONGOLIAN BIRGA WITH ORNAMENT..MONGOLIAN TURNED SWIRL BIRGA WITH DOUBLE ORNAMENT
+116B9 ; Po # TAKRI ABBREVIATION SIGN
+1173C..1173E ; Po # [3] AHOM SIGN SMALL SECTION..AHOM SIGN RULAI
+1183B ; Po # DOGRA ABBREVIATION SIGN
+11944..11946 ; Po # [3] DIVES AKURU DOUBLE DANDA..DIVES AKURU END OF TEXT MARK
+119E2 ; Po # NANDINAGARI SIGN SIDDHAM
+11A3F..11A46 ; Po # [8] ZANABAZAR SQUARE INITIAL HEAD MARK..ZANABAZAR SQUARE CLOSING DOUBLE-LINED HEAD MARK
+11A9A..11A9C ; Po # [3] SOYOMBO MARK TSHEG..SOYOMBO MARK DOUBLE SHAD
+11A9E..11AA2 ; Po # [5] SOYOMBO HEAD MARK WITH MOON AND SUN AND TRIPLE FLAME..SOYOMBO TERMINAL MARK-2
+11B00..11B09 ; Po # [10] DEVANAGARI HEAD MARK..DEVANAGARI SIGN MINDU
+11BE1 ; Po # SUNUWAR SIGN PVO
+11C41..11C45 ; Po # [5] BHAIKSUKI DANDA..BHAIKSUKI GAP FILLER-2
+11C70..11C71 ; Po # [2] MARCHEN HEAD MARK..MARCHEN MARK SHAD
+11EF7..11EF8 ; Po # [2] MAKASAR PASSIMBANG..MAKASAR END OF SECTION
+11F43..11F4F ; Po # [13] KAWI DANDA..KAWI PUNCTUATION CLOSING SPIRAL
+11FFF ; Po # TAMIL PUNCTUATION END OF TEXT
+12470..12474 ; Po # [5] CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD DIVIDER..CUNEIFORM PUNCTUATION SIGN DIAGONAL QUADCOLON
+12FF1..12FF2 ; Po # [2] CYPRO-MINOAN SIGN CM301..CYPRO-MINOAN SIGN CM302
+16A6E..16A6F ; Po # [2] MRO DANDA..MRO DOUBLE DANDA
+16AF5 ; Po # BASSA VAH FULL STOP
+16B37..16B3B ; Po # [5] PAHAWH HMONG SIGN VOS THOM..PAHAWH HMONG SIGN VOS FEEM
+16B44 ; Po # PAHAWH HMONG SIGN XAUS
+16D6D..16D6F ; Po # [3] KIRAT RAI SIGN YUPI..KIRAT RAI DOUBLE DANDA
+16E97..16E9A ; Po # [4] MEDEFAIDRIN COMMA..MEDEFAIDRIN EXCLAMATION OH
+16FE2 ; Po # OLD CHINESE HOOK MARK
+1BC9F ; Po # DUPLOYAN PUNCTUATION CHINOOK FULL STOP
+1DA87..1DA8B ; Po # [5] SIGNWRITING COMMA..SIGNWRITING PARENTHESIS
+1E5FF ; Po # OL ONAL ABBREVIATION SIGN
+1E95E..1E95F ; Po # [2] ADLAM INITIAL EXCLAMATION MARK..ADLAM INITIAL QUESTION MARK
+
+# Total code points: 640
+
+# ================================================
+
+# General_Category=Math_Symbol
+
+002B ; Sm # PLUS SIGN
+003C..003E ; Sm # [3] LESS-THAN SIGN..GREATER-THAN SIGN
+007C ; Sm # VERTICAL LINE
+007E ; Sm # TILDE
+00AC ; Sm # NOT SIGN
+00B1 ; Sm # PLUS-MINUS SIGN
+00D7 ; Sm # MULTIPLICATION SIGN
+00F7 ; Sm # DIVISION SIGN
+03F6 ; Sm # GREEK REVERSED LUNATE EPSILON SYMBOL
+0606..0608 ; Sm # [3] ARABIC-INDIC CUBE ROOT..ARABIC RAY
+2044 ; Sm # FRACTION SLASH
+2052 ; Sm # COMMERCIAL MINUS SIGN
+207A..207C ; Sm # [3] SUPERSCRIPT PLUS SIGN..SUPERSCRIPT EQUALS SIGN
+208A..208C ; Sm # [3] SUBSCRIPT PLUS SIGN..SUBSCRIPT EQUALS SIGN
+2118 ; Sm # SCRIPT CAPITAL P
+2140..2144 ; Sm # [5] DOUBLE-STRUCK N-ARY SUMMATION..TURNED SANS-SERIF CAPITAL Y
+214B ; Sm # TURNED AMPERSAND
+2190..2194 ; Sm # [5] LEFTWARDS ARROW..LEFT RIGHT ARROW
+219A..219B ; Sm # [2] LEFTWARDS ARROW WITH STROKE..RIGHTWARDS ARROW WITH STROKE
+21A0 ; Sm # RIGHTWARDS TWO HEADED ARROW
+21A3 ; Sm # RIGHTWARDS ARROW WITH TAIL
+21A6 ; Sm # RIGHTWARDS ARROW FROM BAR
+21AE ; Sm # LEFT RIGHT ARROW WITH STROKE
+21CE..21CF ; Sm # [2] LEFT RIGHT DOUBLE ARROW WITH STROKE..RIGHTWARDS DOUBLE ARROW WITH STROKE
+21D2 ; Sm # RIGHTWARDS DOUBLE ARROW
+21D4 ; Sm # LEFT RIGHT DOUBLE ARROW
+21F4..22FF ; Sm # [268] RIGHT ARROW WITH SMALL CIRCLE..Z NOTATION BAG MEMBERSHIP
+2320..2321 ; Sm # [2] TOP HALF INTEGRAL..BOTTOM HALF INTEGRAL
+237C ; Sm # RIGHT ANGLE WITH DOWNWARDS ZIGZAG ARROW
+239B..23B3 ; Sm # [25] LEFT PARENTHESIS UPPER HOOK..SUMMATION BOTTOM
+23DC..23E1 ; Sm # [6] TOP PARENTHESIS..BOTTOM TORTOISE SHELL BRACKET
+25B7 ; Sm # WHITE RIGHT-POINTING TRIANGLE
+25C1 ; Sm # WHITE LEFT-POINTING TRIANGLE
+25F8..25FF ; Sm # [8] UPPER LEFT TRIANGLE..LOWER RIGHT TRIANGLE
+266F ; Sm # MUSIC SHARP SIGN
+27C0..27C4 ; Sm # [5] THREE DIMENSIONAL ANGLE..OPEN SUPERSET
+27C7..27E5 ; Sm # [31] OR WITH DOT INSIDE..WHITE SQUARE WITH RIGHTWARDS TICK
+27F0..27FF ; Sm # [16] UPWARDS QUADRUPLE ARROW..LONG RIGHTWARDS SQUIGGLE ARROW
+2900..2982 ; Sm # [131] RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE..Z NOTATION TYPE COLON
+2999..29D7 ; Sm # [63] DOTTED FENCE..BLACK HOURGLASS
+29DC..29FB ; Sm # [32] INCOMPLETE INFINITY..TRIPLE PLUS
+29FE..2AFF ; Sm # [258] TINY..N-ARY WHITE VERTICAL BAR
+2B30..2B44 ; Sm # [21] LEFT ARROW WITH SMALL CIRCLE..RIGHTWARDS ARROW THROUGH SUPERSET
+2B47..2B4C ; Sm # [6] REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW..RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
+FB29 ; Sm # HEBREW LETTER ALTERNATIVE PLUS SIGN
+FE62 ; Sm # SMALL PLUS SIGN
+FE64..FE66 ; Sm # [3] SMALL LESS-THAN SIGN..SMALL EQUALS SIGN
+FF0B ; Sm # FULLWIDTH PLUS SIGN
+FF1C..FF1E ; Sm # [3] FULLWIDTH LESS-THAN SIGN..FULLWIDTH GREATER-THAN SIGN
+FF5C ; Sm # FULLWIDTH VERTICAL LINE
+FF5E ; Sm # FULLWIDTH TILDE
+FFE2 ; Sm # FULLWIDTH NOT SIGN
+FFE9..FFEC ; Sm # [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS ARROW
+10D8E..10D8F ; Sm # [2] GARAY PLUS SIGN..GARAY MINUS SIGN
+1D6C1 ; Sm # MATHEMATICAL BOLD NABLA
+1D6DB ; Sm # MATHEMATICAL BOLD PARTIAL DIFFERENTIAL
+1D6FB ; Sm # MATHEMATICAL ITALIC NABLA
+1D715 ; Sm # MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL
+1D735 ; Sm # MATHEMATICAL BOLD ITALIC NABLA
+1D74F ; Sm # MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL
+1D76F ; Sm # MATHEMATICAL SANS-SERIF BOLD NABLA
+1D789 ; Sm # MATHEMATICAL SANS-SERIF BOLD PARTIAL DIFFERENTIAL
+1D7A9 ; Sm # MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA
+1D7C3 ; Sm # MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL
+1EEF0..1EEF1 ; Sm # [2] ARABIC MATHEMATICAL OPERATOR MEEM WITH HAH WITH TATWEEL..ARABIC MATHEMATICAL OPERATOR HAH WITH DAL
+
+# Total code points: 950
+
+# ================================================
+
+# General_Category=Currency_Symbol
+
+0024 ; Sc # DOLLAR SIGN
+00A2..00A5 ; Sc # [4] CENT SIGN..YEN SIGN
+058F ; Sc # ARMENIAN DRAM SIGN
+060B ; Sc # AFGHANI SIGN
+07FE..07FF ; Sc # [2] NKO DOROME SIGN..NKO TAMAN SIGN
+09F2..09F3 ; Sc # [2] BENGALI RUPEE MARK..BENGALI RUPEE SIGN
+09FB ; Sc # BENGALI GANDA MARK
+0AF1 ; Sc # GUJARATI RUPEE SIGN
+0BF9 ; Sc # TAMIL RUPEE SIGN
+0E3F ; Sc # THAI CURRENCY SYMBOL BAHT
+17DB ; Sc # KHMER CURRENCY SYMBOL RIEL
+20A0..20C0 ; Sc # [33] EURO-CURRENCY SIGN..SOM SIGN
+A838 ; Sc # NORTH INDIC RUPEE MARK
+FDFC ; Sc # RIAL SIGN
+FE69 ; Sc # SMALL DOLLAR SIGN
+FF04 ; Sc # FULLWIDTH DOLLAR SIGN
+FFE0..FFE1 ; Sc # [2] FULLWIDTH CENT SIGN..FULLWIDTH POUND SIGN
+FFE5..FFE6 ; Sc # [2] FULLWIDTH YEN SIGN..FULLWIDTH WON SIGN
+11FDD..11FE0 ; Sc # [4] TAMIL SIGN KAACU..TAMIL SIGN VARAAKAN
+1E2FF ; Sc # WANCHO NGUN SIGN
+1ECB0 ; Sc # INDIC SIYAQ RUPEE MARK
+
+# Total code points: 63
+
+# ================================================
+
+# General_Category=Modifier_Symbol
+
+005E ; Sk # CIRCUMFLEX ACCENT
+0060 ; Sk # GRAVE ACCENT
+00A8 ; Sk # DIAERESIS
+00AF ; Sk # MACRON
+00B4 ; Sk # ACUTE ACCENT
+00B8 ; Sk # CEDILLA
+02C2..02C5 ; Sk # [4] MODIFIER LETTER LEFT ARROWHEAD..MODIFIER LETTER DOWN ARROWHEAD
+02D2..02DF ; Sk # [14] MODIFIER LETTER CENTRED RIGHT HALF RING..MODIFIER LETTER CROSS ACCENT
+02E5..02EB ; Sk # [7] MODIFIER LETTER EXTRA-HIGH TONE BAR..MODIFIER LETTER YANG DEPARTING TONE MARK
+02ED ; Sk # MODIFIER LETTER UNASPIRATED
+02EF..02FF ; Sk # [17] MODIFIER LETTER LOW DOWN ARROWHEAD..MODIFIER LETTER LOW LEFT ARROW
+0375 ; Sk # GREEK LOWER NUMERAL SIGN
+0384..0385 ; Sk # [2] GREEK TONOS..GREEK DIALYTIKA TONOS
+0888 ; Sk # ARABIC RAISED ROUND DOT
+1FBD ; Sk # GREEK KORONIS
+1FBF..1FC1 ; Sk # [3] GREEK PSILI..GREEK DIALYTIKA AND PERISPOMENI
+1FCD..1FCF ; Sk # [3] GREEK PSILI AND VARIA..GREEK PSILI AND PERISPOMENI
+1FDD..1FDF ; Sk # [3] GREEK DASIA AND VARIA..GREEK DASIA AND PERISPOMENI
+1FED..1FEF ; Sk # [3] GREEK DIALYTIKA AND VARIA..GREEK VARIA
+1FFD..1FFE ; Sk # [2] GREEK OXIA..GREEK DASIA
+309B..309C ; Sk # [2] KATAKANA-HIRAGANA VOICED SOUND MARK..KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+A700..A716 ; Sk # [23] MODIFIER LETTER CHINESE TONE YIN PING..MODIFIER LETTER EXTRA-LOW LEFT-STEM TONE BAR
+A720..A721 ; Sk # [2] MODIFIER LETTER STRESS AND HIGH TONE..MODIFIER LETTER STRESS AND LOW TONE
+A789..A78A ; Sk # [2] MODIFIER LETTER COLON..MODIFIER LETTER SHORT EQUALS SIGN
+AB5B ; Sk # MODIFIER BREVE WITH INVERTED BREVE
+AB6A..AB6B ; Sk # [2] MODIFIER LETTER LEFT TACK..MODIFIER LETTER RIGHT TACK
+FBB2..FBC2 ; Sk # [17] ARABIC SYMBOL DOT ABOVE..ARABIC SYMBOL WASLA ABOVE
+FF3E ; Sk # FULLWIDTH CIRCUMFLEX ACCENT
+FF40 ; Sk # FULLWIDTH GRAVE ACCENT
+FFE3 ; Sk # FULLWIDTH MACRON
+1F3FB..1F3FF ; Sk # [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6
+
+# Total code points: 125
+
+# ================================================
+
+# General_Category=Other_Symbol
+
+00A6 ; So # BROKEN BAR
+00A9 ; So # COPYRIGHT SIGN
+00AE ; So # REGISTERED SIGN
+00B0 ; So # DEGREE SIGN
+0482 ; So # CYRILLIC THOUSANDS SIGN
+058D..058E ; So # [2] RIGHT-FACING ARMENIAN ETERNITY SIGN..LEFT-FACING ARMENIAN ETERNITY SIGN
+060E..060F ; So # [2] ARABIC POETIC VERSE SIGN..ARABIC SIGN MISRA
+06DE ; So # ARABIC START OF RUB EL HIZB
+06E9 ; So # ARABIC PLACE OF SAJDAH
+06FD..06FE ; So # [2] ARABIC SIGN SINDHI AMPERSAND..ARABIC SIGN SINDHI POSTPOSITION MEN
+07F6 ; So # NKO SYMBOL OO DENNEN
+09FA ; So # BENGALI ISSHAR
+0B70 ; So # ORIYA ISSHAR
+0BF3..0BF8 ; So # [6] TAMIL DAY SIGN..TAMIL AS ABOVE SIGN
+0BFA ; So # TAMIL NUMBER SIGN
+0C7F ; So # TELUGU SIGN TUUMU
+0D4F ; So # MALAYALAM SIGN PARA
+0D79 ; So # MALAYALAM DATE MARK
+0F01..0F03 ; So # [3] TIBETAN MARK GTER YIG MGO TRUNCATED A..TIBETAN MARK GTER YIG MGO -UM GTER TSHEG MA
+0F13 ; So # TIBETAN MARK CARET -DZUD RTAGS ME LONG CAN
+0F15..0F17 ; So # [3] TIBETAN LOGOTYPE SIGN CHAD RTAGS..TIBETAN ASTROLOGICAL SIGN SGRA GCAN -CHAR RTAGS
+0F1A..0F1F ; So # [6] TIBETAN SIGN RDEL DKAR GCIG..TIBETAN SIGN RDEL DKAR RDEL NAG
+0F34 ; So # TIBETAN MARK BSDUS RTAGS
+0F36 ; So # TIBETAN MARK CARET -DZUD RTAGS BZHI MIG CAN
+0F38 ; So # TIBETAN MARK CHE MGO
+0FBE..0FC5 ; So # [8] TIBETAN KU RU KHA..TIBETAN SYMBOL RDO RJE
+0FC7..0FCC ; So # [6] TIBETAN SYMBOL RDO RJE RGYA GRAM..TIBETAN SYMBOL NOR BU BZHI -KHYIL
+0FCE..0FCF ; So # [2] TIBETAN SIGN RDEL NAG RDEL DKAR..TIBETAN SIGN RDEL NAG GSUM
+0FD5..0FD8 ; So # [4] RIGHT-FACING SVASTI SIGN..LEFT-FACING SVASTI SIGN WITH DOTS
+109E..109F ; So # [2] MYANMAR SYMBOL SHAN ONE..MYANMAR SYMBOL SHAN EXCLAMATION
+1390..1399 ; So # [10] ETHIOPIC TONAL MARK YIZET..ETHIOPIC TONAL MARK KURT
+166D ; So # CANADIAN SYLLABICS CHI SIGN
+1940 ; So # LIMBU SIGN LOO
+19DE..19FF ; So # [34] NEW TAI LUE SIGN LAE..KHMER SYMBOL DAP-PRAM ROC
+1B61..1B6A ; So # [10] BALINESE MUSICAL SYMBOL DONG..BALINESE MUSICAL SYMBOL DANG GEDE
+1B74..1B7C ; So # [9] BALINESE MUSICAL SYMBOL RIGHT-HAND OPEN DUG..BALINESE MUSICAL SYMBOL LEFT-HAND OPEN PING
+2100..2101 ; So # [2] ACCOUNT OF..ADDRESSED TO THE SUBJECT
+2103..2106 ; So # [4] DEGREE CELSIUS..CADA UNA
+2108..2109 ; So # [2] SCRUPLE..DEGREE FAHRENHEIT
+2114 ; So # L B BAR SYMBOL
+2116..2117 ; So # [2] NUMERO SIGN..SOUND RECORDING COPYRIGHT
+211E..2123 ; So # [6] PRESCRIPTION TAKE..VERSICLE
+2125 ; So # OUNCE SIGN
+2127 ; So # INVERTED OHM SIGN
+2129 ; So # TURNED GREEK SMALL LETTER IOTA
+212E ; So # ESTIMATED SYMBOL
+213A..213B ; So # [2] ROTATED CAPITAL Q..FACSIMILE SIGN
+214A ; So # PROPERTY LINE
+214C..214D ; So # [2] PER SIGN..AKTIESELSKAB
+214F ; So # SYMBOL FOR SAMARITAN SOURCE
+218A..218B ; So # [2] TURNED DIGIT TWO..TURNED DIGIT THREE
+2195..2199 ; So # [5] UP DOWN ARROW..SOUTH WEST ARROW
+219C..219F ; So # [4] LEFTWARDS WAVE ARROW..UPWARDS TWO HEADED ARROW
+21A1..21A2 ; So # [2] DOWNWARDS TWO HEADED ARROW..LEFTWARDS ARROW WITH TAIL
+21A4..21A5 ; So # [2] LEFTWARDS ARROW FROM BAR..UPWARDS ARROW FROM BAR
+21A7..21AD ; So # [7] DOWNWARDS ARROW FROM BAR..LEFT RIGHT WAVE ARROW
+21AF..21CD ; So # [31] DOWNWARDS ZIGZAG ARROW..LEFTWARDS DOUBLE ARROW WITH STROKE
+21D0..21D1 ; So # [2] LEFTWARDS DOUBLE ARROW..UPWARDS DOUBLE ARROW
+21D3 ; So # DOWNWARDS DOUBLE ARROW
+21D5..21F3 ; So # [31] UP DOWN DOUBLE ARROW..UP DOWN WHITE ARROW
+2300..2307 ; So # [8] DIAMETER SIGN..WAVY LINE
+230C..231F ; So # [20] BOTTOM RIGHT CROP..BOTTOM RIGHT CORNER
+2322..2328 ; So # [7] FROWN..KEYBOARD
+232B..237B ; So # [81] ERASE TO THE LEFT..NOT CHECK MARK
+237D..239A ; So # [30] SHOULDERED OPEN BOX..CLEAR SCREEN SYMBOL
+23B4..23DB ; So # [40] TOP SQUARE BRACKET..FUSE
+23E2..2429 ; So # [72] WHITE TRAPEZIUM..SYMBOL FOR DELETE MEDIUM SHADE FORM
+2440..244A ; So # [11] OCR HOOK..OCR DOUBLE BACKSLASH
+249C..24E9 ; So # [78] PARENTHESIZED LATIN SMALL LETTER A..CIRCLED LATIN SMALL LETTER Z
+2500..25B6 ; So # [183] BOX DRAWINGS LIGHT HORIZONTAL..BLACK RIGHT-POINTING TRIANGLE
+25B8..25C0 ; So # [9] BLACK RIGHT-POINTING SMALL TRIANGLE..BLACK LEFT-POINTING TRIANGLE
+25C2..25F7 ; So # [54] BLACK LEFT-POINTING SMALL TRIANGLE..WHITE CIRCLE WITH UPPER RIGHT QUADRANT
+2600..266E ; So # [111] BLACK SUN WITH RAYS..MUSIC NATURAL SIGN
+2670..2767 ; So # [248] WEST SYRIAC CROSS..ROTATED FLORAL HEART BULLET
+2794..27BF ; So # [44] HEAVY WIDE-HEADED RIGHTWARDS ARROW..DOUBLE CURLY LOOP
+2800..28FF ; So # [256] BRAILLE PATTERN BLANK..BRAILLE PATTERN DOTS-12345678
+2B00..2B2F ; So # [48] NORTH EAST WHITE ARROW..WHITE VERTICAL ELLIPSE
+2B45..2B46 ; So # [2] LEFTWARDS QUADRUPLE ARROW..RIGHTWARDS QUADRUPLE ARROW
+2B4D..2B73 ; So # [39] DOWNWARDS TRIANGLE-HEADED ZIGZAG ARROW..DOWNWARDS TRIANGLE-HEADED ARROW TO BAR
+2B76..2B95 ; So # [32] NORTH WEST TRIANGLE-HEADED ARROW TO BAR..RIGHTWARDS BLACK ARROW
+2B97..2BFF ; So # [105] SYMBOL FOR TYPE A ELECTRONICS..HELLSCHREIBER PAUSE SYMBOL
+2CE5..2CEA ; So # [6] COPTIC SYMBOL MI RO..COPTIC SYMBOL SHIMA SIMA
+2E50..2E51 ; So # [2] CROSS PATTY WITH RIGHT CROSSBAR..CROSS PATTY WITH LEFT CROSSBAR
+2E80..2E99 ; So # [26] CJK RADICAL REPEAT..CJK RADICAL RAP
+2E9B..2EF3 ; So # [89] CJK RADICAL CHOKE..CJK RADICAL C-SIMPLIFIED TURTLE
+2F00..2FD5 ; So # [214] KANGXI RADICAL ONE..KANGXI RADICAL FLUTE
+2FF0..2FFF ; So # [16] IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT..IDEOGRAPHIC DESCRIPTION CHARACTER ROTATION
+3004 ; So # JAPANESE INDUSTRIAL STANDARD SYMBOL
+3012..3013 ; So # [2] POSTAL MARK..GETA MARK
+3020 ; So # POSTAL MARK FACE
+3036..3037 ; So # [2] CIRCLED POSTAL MARK..IDEOGRAPHIC TELEGRAPH LINE FEED SEPARATOR SYMBOL
+303E..303F ; So # [2] IDEOGRAPHIC VARIATION INDICATOR..IDEOGRAPHIC HALF FILL SPACE
+3190..3191 ; So # [2] IDEOGRAPHIC ANNOTATION LINKING MARK..IDEOGRAPHIC ANNOTATION REVERSE MARK
+3196..319F ; So # [10] IDEOGRAPHIC ANNOTATION TOP MARK..IDEOGRAPHIC ANNOTATION MAN MARK
+31C0..31E5 ; So # [38] CJK STROKE T..CJK STROKE SZP
+31EF ; So # IDEOGRAPHIC DESCRIPTION CHARACTER SUBTRACTION
+3200..321E ; So # [31] PARENTHESIZED HANGUL KIYEOK..PARENTHESIZED KOREAN CHARACTER O HU
+322A..3247 ; So # [30] PARENTHESIZED IDEOGRAPH MOON..CIRCLED IDEOGRAPH KOTO
+3250 ; So # PARTNERSHIP SIGN
+3260..327F ; So # [32] CIRCLED HANGUL KIYEOK..KOREAN STANDARD SYMBOL
+328A..32B0 ; So # [39] CIRCLED IDEOGRAPH MOON..CIRCLED IDEOGRAPH NIGHT
+32C0..33FF ; So # [320] IDEOGRAPHIC TELEGRAPH SYMBOL FOR JANUARY..SQUARE GAL
+4DC0..4DFF ; So # [64] HEXAGRAM FOR THE CREATIVE HEAVEN..HEXAGRAM FOR BEFORE COMPLETION
+A490..A4C6 ; So # [55] YI RADICAL QOT..YI RADICAL KE
+A828..A82B ; So # [4] SYLOTI NAGRI POETRY MARK-1..SYLOTI NAGRI POETRY MARK-4
+A836..A837 ; So # [2] NORTH INDIC QUARTER MARK..NORTH INDIC PLACEHOLDER MARK
+A839 ; So # NORTH INDIC QUANTITY MARK
+AA77..AA79 ; So # [3] MYANMAR SYMBOL AITON EXCLAMATION..MYANMAR SYMBOL AITON TWO
+FD40..FD4F ; So # [16] ARABIC LIGATURE RAHIMAHU ALLAAH..ARABIC LIGATURE RAHIMAHUM ALLAAH
+FDCF ; So # ARABIC LIGATURE SALAAMUHU ALAYNAA
+FDFD..FDFF ; So # [3] ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM..ARABIC LIGATURE AZZA WA JALL
+FFE4 ; So # FULLWIDTH BROKEN BAR
+FFE8 ; So # HALFWIDTH FORMS LIGHT VERTICAL
+FFED..FFEE ; So # [2] HALFWIDTH BLACK SQUARE..HALFWIDTH WHITE CIRCLE
+FFFC..FFFD ; So # [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHARACTER
+10137..1013F ; So # [9] AEGEAN WEIGHT BASE UNIT..AEGEAN MEASURE THIRD SUBUNIT
+10179..10189 ; So # [17] GREEK YEAR SIGN..GREEK TRYBLION BASE SIGN
+1018C..1018E ; So # [3] GREEK SINUSOID SIGN..NOMISMA SIGN
+10190..1019C ; So # [13] ROMAN SEXTANS SIGN..ASCIA SYMBOL
+101A0 ; So # GREEK SYMBOL TAU RHO
+101D0..101FC ; So # [45] PHAISTOS DISC SIGN PEDESTRIAN..PHAISTOS DISC SIGN WAVY BAND
+10877..10878 ; So # [2] PALMYRENE LEFT-POINTING FLEURON..PALMYRENE RIGHT-POINTING FLEURON
+10AC8 ; So # MANICHAEAN SIGN UD
+1173F ; So # AHOM SYMBOL VI
+11FD5..11FDC ; So # [8] TAMIL SIGN NEL..TAMIL SIGN MUKKURUNI
+11FE1..11FF1 ; So # [17] TAMIL SIGN PAARAM..TAMIL SIGN VAKAIYARAA
+16B3C..16B3F ; So # [4] PAHAWH HMONG SIGN XYEEM NTXIV..PAHAWH HMONG SIGN XYEEM FAIB
+16B45 ; So # PAHAWH HMONG SIGN CIM TSOV ROG
+1BC9C ; So # DUPLOYAN SIGN O WITH CROSS
+1CC00..1CCEF ; So # [240] UP-POINTING GO-KART..OUTLINED LATIN CAPITAL LETTER Z
+1CD00..1CEB3 ; So # [436] BLOCK OCTANT-3..BLACK RIGHT TRIANGLE CARET
+1CF50..1CFC3 ; So # [116] ZNAMENNY NEUME KRYUK..ZNAMENNY NEUME PAUK
+1D000..1D0F5 ; So # [246] BYZANTINE MUSICAL SYMBOL PSILI..BYZANTINE MUSICAL SYMBOL GORGON NEO KATO
+1D100..1D126 ; So # [39] MUSICAL SYMBOL SINGLE BARLINE..MUSICAL SYMBOL DRUM CLEF-2
+1D129..1D164 ; So # [60] MUSICAL SYMBOL MULTIPLE MEASURE REST..MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE
+1D16A..1D16C ; So # [3] MUSICAL SYMBOL FINGERED TREMOLO-1..MUSICAL SYMBOL FINGERED TREMOLO-3
+1D183..1D184 ; So # [2] MUSICAL SYMBOL ARPEGGIATO UP..MUSICAL SYMBOL ARPEGGIATO DOWN
+1D18C..1D1A9 ; So # [30] MUSICAL SYMBOL RINFORZANDO..MUSICAL SYMBOL DEGREE SLASH
+1D1AE..1D1EA ; So # [61] MUSICAL SYMBOL PEDAL MARK..MUSICAL SYMBOL KORON
+1D200..1D241 ; So # [66] GREEK VOCAL NOTATION SYMBOL-1..GREEK INSTRUMENTAL NOTATION SYMBOL-54
+1D245 ; So # GREEK MUSICAL LEIMMA
+1D300..1D356 ; So # [87] MONOGRAM FOR EARTH..TETRAGRAM FOR FOSTERING
+1D800..1D9FF ; So # [512] SIGNWRITING HAND-FIST INDEX..SIGNWRITING HEAD
+1DA37..1DA3A ; So # [4] SIGNWRITING AIR BLOW SMALL ROTATIONS..SIGNWRITING BREATH EXHALE
+1DA6D..1DA74 ; So # [8] SIGNWRITING SHOULDER HIP SPINE..SIGNWRITING TORSO-FLOORPLANE TWISTING
+1DA76..1DA83 ; So # [14] SIGNWRITING LIMB COMBINATION..SIGNWRITING LOCATION DEPTH
+1DA85..1DA86 ; So # [2] SIGNWRITING LOCATION TORSO..SIGNWRITING LOCATION LIMBS DIGITS
+1E14F ; So # NYIAKENG PUACHUE HMONG CIRCLED CA
+1ECAC ; So # INDIC SIYAQ PLACEHOLDER
+1ED2E ; So # OTTOMAN SIYAQ MARRATAN
+1F000..1F02B ; So # [44] MAHJONG TILE EAST WIND..MAHJONG TILE BACK
+1F030..1F093 ; So # [100] DOMINO TILE HORIZONTAL BACK..DOMINO TILE VERTICAL-06-06
+1F0A0..1F0AE ; So # [15] PLAYING CARD BACK..PLAYING CARD KING OF SPADES
+1F0B1..1F0BF ; So # [15] PLAYING CARD ACE OF HEARTS..PLAYING CARD RED JOKER
+1F0C1..1F0CF ; So # [15] PLAYING CARD ACE OF DIAMONDS..PLAYING CARD BLACK JOKER
+1F0D1..1F0F5 ; So # [37] PLAYING CARD ACE OF CLUBS..PLAYING CARD TRUMP-21
+1F10D..1F1AD ; So # [161] CIRCLED ZERO WITH SLASH..MASK WORK SYMBOL
+1F1E6..1F202 ; So # [29] REGIONAL INDICATOR SYMBOL LETTER A..SQUARED KATAKANA SA
+1F210..1F23B ; So # [44] SQUARED CJK UNIFIED IDEOGRAPH-624B..SQUARED CJK UNIFIED IDEOGRAPH-914D
+1F240..1F248 ; So # [9] TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-672C..TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6557
+1F250..1F251 ; So # [2] CIRCLED IDEOGRAPH ADVANTAGE..CIRCLED IDEOGRAPH ACCEPT
+1F260..1F265 ; So # [6] ROUNDED SYMBOL FOR FU..ROUNDED SYMBOL FOR CAI
+1F300..1F3FA ; So # [251] CYCLONE..AMPHORA
+1F400..1F6D7 ; So # [728] RAT..ELEVATOR
+1F6DC..1F6EC ; So # [17] WIRELESS..AIRPLANE ARRIVING
+1F6F0..1F6FC ; So # [13] SATELLITE..ROLLER SKATE
+1F700..1F776 ; So # [119] ALCHEMICAL SYMBOL FOR QUINTESSENCE..LUNAR ECLIPSE
+1F77B..1F7D9 ; So # [95] HAUMEA..NINE POINTED WHITE STAR
+1F7E0..1F7EB ; So # [12] LARGE ORANGE CIRCLE..LARGE BROWN SQUARE
+1F7F0 ; So # HEAVY EQUALS SIGN
+1F800..1F80B ; So # [12] LEFTWARDS ARROW WITH SMALL TRIANGLE ARROWHEAD..DOWNWARDS ARROW WITH LARGE TRIANGLE ARROWHEAD
+1F810..1F847 ; So # [56] LEFTWARDS ARROW WITH SMALL EQUILATERAL ARROWHEAD..DOWNWARDS HEAVY ARROW
+1F850..1F859 ; So # [10] LEFTWARDS SANS-SERIF ARROW..UP DOWN SANS-SERIF ARROW
+1F860..1F887 ; So # [40] WIDE-HEADED LEFTWARDS LIGHT BARB ARROW..WIDE-HEADED SOUTH WEST VERY HEAVY BARB ARROW
+1F890..1F8AD ; So # [30] LEFTWARDS TRIANGLE ARROWHEAD..WHITE ARROW SHAFT WIDTH TWO THIRDS
+1F8B0..1F8BB ; So # [12] ARROW POINTING UPWARDS THEN NORTH WEST..SOUTH WEST ARROW FROM BAR
+1F8C0..1F8C1 ; So # [2] LEFTWARDS ARROW FROM DOWNWARDS ARROW..RIGHTWARDS ARROW FROM DOWNWARDS ARROW
+1F900..1FA53 ; So # [340] CIRCLED CROSS FORMEE WITH FOUR DOTS..BLACK CHESS KNIGHT-BISHOP
+1FA60..1FA6D ; So # [14] XIANGQI RED GENERAL..XIANGQI BLACK SOLDIER
+1FA70..1FA7C ; So # [13] BALLET SHOES..CRUTCH
+1FA80..1FA89 ; So # [10] YO-YO..HARP
+1FA8F..1FAC6 ; So # [56] SHOVEL..FINGERPRINT
+1FACE..1FADC ; So # [15] MOOSE..ROOT VEGETABLE
+1FADF..1FAE9 ; So # [11] SPLATTER..FACE WITH BAGS UNDER EYES
+1FAF0..1FAF8 ; So # [9] HAND WITH INDEX FINGER AND THUMB CROSSED..RIGHTWARDS PUSHING HAND
+1FB00..1FB92 ; So # [147] BLOCK SEXTANT-1..UPPER HALF INVERSE MEDIUM SHADE AND LOWER HALF BLOCK
+1FB94..1FBEF ; So # [92] LEFT HALF INVERSE MEDIUM SHADE AND RIGHT HALF BLOCK..TOP LEFT JUSTIFIED LOWER RIGHT QUARTER BLACK CIRCLE
+
+# Total code points: 7376
+
+# ================================================
+
+# General_Category=Initial_Punctuation
+
+00AB ; Pi # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+2018 ; Pi # LEFT SINGLE QUOTATION MARK
+201B..201C ; Pi # [2] SINGLE HIGH-REVERSED-9 QUOTATION MARK..LEFT DOUBLE QUOTATION MARK
+201F ; Pi # DOUBLE HIGH-REVERSED-9 QUOTATION MARK
+2039 ; Pi # SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+2E02 ; Pi # LEFT SUBSTITUTION BRACKET
+2E04 ; Pi # LEFT DOTTED SUBSTITUTION BRACKET
+2E09 ; Pi # LEFT TRANSPOSITION BRACKET
+2E0C ; Pi # LEFT RAISED OMISSION BRACKET
+2E1C ; Pi # LEFT LOW PARAPHRASE BRACKET
+2E20 ; Pi # LEFT VERTICAL BAR WITH QUILL
+
+# Total code points: 12
+
+# ================================================
+
+# General_Category=Final_Punctuation
+
+00BB ; Pf # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+2019 ; Pf # RIGHT SINGLE QUOTATION MARK
+201D ; Pf # RIGHT DOUBLE QUOTATION MARK
+203A ; Pf # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+2E03 ; Pf # RIGHT SUBSTITUTION BRACKET
+2E05 ; Pf # RIGHT DOTTED SUBSTITUTION BRACKET
+2E0A ; Pf # RIGHT TRANSPOSITION BRACKET
+2E0D ; Pf # RIGHT RAISED OMISSION BRACKET
+2E1D ; Pf # RIGHT LOW PARAPHRASE BRACKET
+2E21 ; Pf # RIGHT VERTICAL BAR WITH QUILL
+
+# Total code points: 10
+
+# EOF
diff --git a/contrib/unicode/README b/contrib/unicode/README
index 9ef80fb..a459f34 100644
--- a/contrib/unicode/README
+++ b/contrib/unicode/README
@@ -16,10 +16,11 @@ ftp://ftp.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt
ftp://ftp.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt
ftp://ftp.unicode.org/Public/UNIDATA/NameAliases.txt
-Two additional files are needed for lookup tables in libstdc++:
+Three additional files are needed for lookup tables in libstdc++:
ftp://ftp.unicode.org/Public/UNIDATA/auxiliary/GraphemeBreakProperty.txt
ftp://ftp.unicode.org/Public/UNIDATA/emoji/emoji-data.txt
+ftp://ftp.unicode.org/Public/UNIDATA/extracted/DerivedGeneralCategory.txt
All these files have been added to source control in this directory;
please see unicode-license.txt for the relevant copyright information.
diff --git a/contrib/unicode/gen_libstdcxx_unicode_data.py b/contrib/unicode/gen_libstdcxx_unicode_data.py
index ff4bee4..c50884d 100755
--- a/contrib/unicode/gen_libstdcxx_unicode_data.py
+++ b/contrib/unicode/gen_libstdcxx_unicode_data.py
@@ -126,7 +126,7 @@ edges = find_edges(all_code_points, 1)
# Table for std::__unicode::__format_width(char32_t)
-print(" // Table generated by contrib/unicode/gen_std_format_width.py,")
+print(" // Table generated by contrib/unicode/gen_libstdcxx_unicode_data.py,")
print(" // from EastAsianWidth.txt from the Unicode standard.");
print(" inline constexpr char32_t __width_edges[] = {", end="")
for i, e in enumerate(edges):
@@ -138,6 +138,45 @@ for i, e in enumerate(edges):
print("{:#x},".format(c), end="")
print("\n };\n")
+# By default escape each code point
+all_code_points = [True] * (1 + 0x10FFFF)
+
+escaped_general_categories = {
+ # Separator (Z)
+ "Zs", "Zl", "Zp",
+ # Other (C)
+ "Cc", "Cf", "Cs", "Co", "Cn",
+}
+
+# Extract General_Category and detrmine if it should be escaped
+# for all code points.
+for line in open("DerivedGeneralCategory.txt", "r"):
+ # Example lines:
+ # 0530 ; Cn # <reserved-0530>
+ # 0557..0558 ; Cn # [2] <reserved-0557>..<reserved-0558>
+ line = line.split("#")[0]
+ if re.match(r'^[\dA-Fa-f][^;]+;', line):
+ code_points, general_category = line.split(";")
+ gc_escaped = general_category.strip() in escaped_general_categories
+ process_code_points(code_points, gc_escaped)
+
+edges = find_edges(all_code_points)
+
+shift_bits = 1
+print(" // Values generated by contrib/unicode/gen_libstdcxx_unicode_data.py,")
+print(" // from DerivedGeneralCategory.txt from the Unicode standard.");
+print(" // Entries are (code_point << 1) + escape.")
+print(" inline constexpr uint32_t __escape_edges[] = {", end="")
+for i, e in enumerate(edges):
+ if i % 6:
+ print(" ", end="")
+ else:
+ print("\n ", end="")
+ c, p = e
+ x = (c << shift_bits) + (1 if p else 0)
+ print("{0:#x},".format(x), end="")
+print("\n };\n")
+
# By default every code point has Grapheme_Cluster_Break=Other.
all_code_points = ["Other"] * (1 + 0x10FFFF)
@@ -167,7 +206,7 @@ print(" };\n")
# Tables for std::__unicode::_Grapheme_cluster_state
-print(" // Values generated by contrib/unicode/gen_std_format_width.py,")
+print(" // Values generated by contrib/unicode/gen_libstdcxx_unicode_data.py,")
print(" // from GraphemeBreakProperty.txt from the Unicode standard.");
print(" // Entries are (code_point << shift_bits) + property.")
print(" inline constexpr int __gcb_shift_bits = {:#x};".format(shift_bits))
@@ -209,7 +248,7 @@ edges = find_edges(all_code_points)
incb_props = {None:0, "Consonant":1, "Extend":2}
print(" enum class _InCB { _Consonant = 1, _Extend = 2 };\n")
# Table for std::__unicode::__incb_property
-print(" // Values generated by contrib/unicode/gen_std_format_width.py,")
+print(" // Values generated by contrib/unicode/gen_libstdcxx_unicode_data.py,")
print(" // from DerivedCoreProperties.txt from the Unicode standard.");
print(" // Entries are (code_point << 2) + property.")
print(" inline constexpr uint32_t __incb_edges[] = {", end="")
@@ -238,7 +277,7 @@ for line in open("emoji-data.txt", "r"):
edges = find_edges(all_code_points, False)
# Table for std::__unicode::__is_extended_pictographic
-print(" // Table generated by contrib/unicode/gen_std_format_width.py,")
+print(" // Table generated by contrib/unicode/gen_libstdcxx_unicode_data.py,")
print(" // from emoji-data.txt from the Unicode standard.");
print(" inline constexpr char32_t __xpicto_edges[] = {", end="")
for i, e in enumerate(edges):
diff --git a/gcc/BASE-VER b/gcc/BASE-VER
index 2bbd2b4..946789e 100644
--- a/gcc/BASE-VER
+++ b/gcc/BASE-VER
@@ -1 +1 @@
-15.0.1
+16.0.0
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a3e0333..4a2a79f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,713 @@
+2025-04-19 Jeff Law <jlaw@ventanamicro.com>
+
+ PR target/119865
+ * config/riscv/riscv.cc (parse_features_for_version): Do not
+ explicitly free the architecture string.
+
+2025-04-19 Jeff Law <jlaw@ventanamicro.com>
+
+ PR target/118410
+ * config/riscv/bitmanip.md (logical with constant argument): New
+ splitter for cases where synthesizing ~C is cheaper than synthesizing
+ the original constant C.
+
+2025-04-19 Jan Hubicka <hubicka@ucw.cz>
+
+ * config/i386/i386.cc (vec_fp_conversion_cost): New function.
+ (ix86_rtx_costs): Use it for SSE/AVX FP conversoins.
+ (ix86_builtin_vectorization_cost): Fix indentation;
+ and use vec_fp_conversion_cost in vec_promote_demote.
+ (fp_conversion_stmt_cost): New function.
+ (ix86_vector_costs::add_stmt_cost): Use it to cost NOP_EXPR
+ and vec_promote_demote.
+ * config/i386/i386.h (struct processor_costs):
+ * config/i386/x86-tune-costs.h (struct processor_costs):
+
+2025-04-19 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR rtl-optimization/111949
+ * combine.cc (find_split_point): Add a split point
+ for `(and (not X) Y)` if not in the outer set already.
+
+2025-04-19 Jiaxun Yang <jiaxun.yang@flygoat.com>
+
+ PR target/111814
+ * config/sh/sh-modes.def (RESET_FLOAT_FORMAT): Use mips format.
+ (FLOAT_MODE): Use mips mode.
+
+2025-04-19 Maciej W. Rozycki <macro@orcam.me.uk>
+
+ * config/alpha/alpha.cc
+ (alpha_get_mem_rtx_alignment_and_offset): Recurse into
+ COMPONENT_REF nodes.
+
+2025-04-18 Jeff Law <jlaw@ventanamicro.com>
+
+ * config/riscv/bitmanip.md (*bext<mode>_mask_pos): New pattern
+ for extracting a single bit at masked bit position.
+
+2025-04-18 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR tree-optimization/87901
+ * tree-ssa-dse.cc (maybe_trim_constructor_store): Add was_integer_cst argument.
+ Check for was_integer_cst instead of `{}` when was_integer_cst is true.
+ (maybe_trim_partially_dead_store): Handle INTEGER_CST stores of 0 as stores of `{}`.
+ Udpate call to maybe_trim_constructor_store for CONSTRUCTOR.
+
+2025-04-18 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR tree-optimization/87901
+ * tree-ssa-dse.cc (maybe_trim_constructor_store): Strip over useless type
+ conversions after taking the address of the MEM_REF.
+
+2025-04-18 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR tree-optimization/118902
+ * fold-const.cc (tree_swap_operands_p): Place invariants in the first operand
+ if not used with constants.
+
+2025-04-18 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR tree-optimization/118947
+ * gimple-fold.cc (optimize_memcpy_to_memset): Walk back until we get a
+ statement that may clobber the read.
+
+2025-04-18 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR tree-optimization/78408
+ PR tree-optimization/118947
+ * gimple-fold.cc (optimize_memcpy_to_memset): Handle STRING_CST case too.
+
+2025-04-18 Richard Braun <rbraun@sceen.net>
+
+ * config/c6x/c6x.h (ASM_PREFERRED_EH_DATA_FORMAT): Remove the
+ DW_EH_PE_indirect flag.
+
+2025-04-18 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/119858
+ * tree-vect-loop.cc (vectorizable_live_operation): Convert
+ pointer offset to sizetype.
+
+2025-04-18 Hakan Candar <hakancandar@protonmail.com>
+
+ * config.gcc: Recognize riscv*-*-gnu* targets.
+ * config/riscv/gnu.h: New file.
+
+2025-04-18 Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
+
+ PR middle-end/108016
+ PR middle-end/108016
+ * config/riscv/riscv.md (addv<mode>4, uaddv<mode>4, subv<mode>4,
+ usubv<mode>4): Tunes for unnecessary sext.w elimination.
+
+2025-04-18 kelefth <konstantinos.eleftheriou@vrull.eu>
+
+ PR rtl-optimization/119160
+ * avoid-store-forwarding.cc (process_store_forwarding):
+ Zero-extend the value stored in the base register, in case
+ of load-elimination, only when the mode of the destination
+ is wider.
+
+2025-04-18 kelefth <konstantinos.eleftheriou@vrull.eu>
+
+ * doc/cfg.texi: Update the exception handling section for the
+ REG_EH_REGION notes to make it clear that the note is attached
+ to the instruction throwing the exception.
+
+2025-04-17 翁愷邑 <kaiweng9487@gmail.com>
+
+ * config/riscv/riscv-target-attr.cc
+ (riscv_target_attr_parser::update_settings):
+ Do not manually free any arch string.
+
+2025-04-17 Eric Botcazou <ebotcazou@gcc.gnu.org>
+
+ * tree.def (BOOLEAN_TYPE): Add more details.
+
+2025-04-17 Sam James <sam@gentoo.org>
+
+ * doc/invoke.texi: Use "compatible types" term. Rephrase to be
+ more precise (and correct).
+
+2025-04-17 Tamar Christina <tamar.christina@arm.com>
+
+ PR tree-optimization/119351
+ * tree-vect-stmts.cc (vectorizable_early_exit): Mask both operands of
+ the gcond for partial masking support.
+
+2025-04-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/119834
+ * config/s390/s390.md (define_split after *cpymem_short): Use
+ (clobber (match_scratch N)) instead of (clobber (scratch)). Use
+ (match_dup 4) and operands[4] instead of (match_dup 3) and operands[3]
+ in the last of those.
+ (define_split after *clrmem_short): Use (clobber (match_scratch N))
+ instead of (clobber (scratch)).
+ (define_split after *cmpmem_short): Likewise.
+
+2025-04-17 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * config/nvptx/nvptx.cc (TARGET_ASM_NEED_VAR_DECL_BEFORE_USE):
+ Don't '#define'.
+
+2025-04-17 Hans-Peter Nilsson <hp@axis.com>
+
+ * combine.cc: Correct comments about combine_validate_cost.
+
+2025-04-16 Sandra Loosemore <sloosemore@baylibre.com>
+
+ PR c/88382
+ * doc/extend.texi (Syntax Extensions): Adjust menu.
+ (Raw String Literals): New section.
+
+2025-04-16 Keith Packard <keithp@keithp.com>
+
+ * config/rx/rx.md (cmpstrnsi): Allow constant length. For
+ static length 0, just store 0 into the output register.
+ For dynamic zero, set C/Z appropriately.
+ (rxcmpstrn): No longer set C/Z.
+
+2025-04-16 Eric Botcazou <ebotcazou@gcc.gnu.org>
+
+ * tree-ssa-phiopt.cc (factor_out_conditional_operation): Do not
+ bypass the int_fits_type_p test for boolean types whose precision
+ is not 1.
+
+2025-04-16 Sandra Loosemore <sloosemore@baylibre.com>
+
+ * common.opt.urls: Regenerated.
+
+2025-04-16 Ard Biesheuvel <ardb@kernel.org>
+
+ PR target/119386
+ * config/i386/i386-options.cc: Permit -mnop-mcount when
+ using -fpic with PLTs.
+
+2025-04-16 Ard Biesheuvel <ardb@kernel.org>
+
+ PR target/119386
+ * config/i386/i386.cc (x86_print_call_or_nop): Add @PLT suffix
+ where appropriate.
+ (x86_function_profiler): Fall through to x86_print_call_or_nop()
+ for PIC codegen when flag_plt is set.
+
+2025-04-16 Sandra Loosemore <sloosemore@baylibre.com>
+
+ PR driver/90465
+ * doc/invoke.texi (Overall Options): Add a @cindex for -Q in
+ connection with --help=.
+ (Developer Options): Point at --help= documentation for the
+ other use of -Q.
+
+2025-04-16 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR target/97106
+ * config/nvptx/nvptx.cc (nvptx_asm_output_def_from_decls)
+ [ACCEL_COMPILER]: Make sure to emit C++ constructor, destructor
+ aliases.
+
+2025-04-16 Jan Hubicka <hubicka@ucw.cz>
+
+ PR tree-optimization/119614
+ * ipa-prop.cc (ipa_write_return_summaries): New function.
+ (ipa_record_return_value_range_1): Break out from ....
+ (ipa_record_return_value_range): ... here.
+ (ipa_read_return_summaries): New function.
+ (ipa_prop_read_section): Read return summaries.
+ (read_ipcp_transformation_info): Read return summaries.
+ (ipcp_write_transformation_summaries): Write return summaries;
+ do not stream stray 0.
+
+2025-04-16 Tamar Christina <tamar.christina@arm.com>
+
+ PR tree-optimization/119351
+ * tree-vectorizer.h (LOOP_VINFO_MASK_NITERS_PFA_OFFSET,
+ LOOP_VINFO_NON_LINEAR_IV): New.
+ (class _loop_vec_info): Add mask_skip_niters_pfa_offset and
+ nonlinear_iv.
+ * tree-vect-loop.cc (_loop_vec_info::_loop_vec_info): Initialize them.
+ (vect_analyze_scalar_cycles_1): Record non-linear inductions.
+ (vectorizable_induction): If early break and PFA using masking create a
+ new phi which tracks where the scalar code needs to start...
+ (vectorizable_live_operation): ...and generate the adjustments here.
+ (vect_use_loop_mask_for_alignment_p): Reject non-linear inductions and
+ early break needing peeling.
+
+2025-04-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/119808
+ * gimple-lower-bitint.cc (gimple_lower_bitint): Don't set
+ m_single_use_names bits for SSA_NAMEs which have single use but
+ their SSA_NAME_DEF_STMT is a copy from another SSA_NAME which doesn't
+ have a single use, or single use which is such a copy etc.
+
+2025-04-16 Jesse Huang <jesse.huang@sifive.com>
+
+ * config/riscv/riscv.cc (riscv_file_end): Fix .p2align value.
+
+2025-04-16 Kito Cheng <kito.cheng@sifive.com>
+
+ * config/riscv/riscv.h (JUMP_TABLES_IN_TEXT_SECTION): Check if
+ large code model.
+
+2025-04-16 Tejas Belagod <tejas.belagod@arm.com>
+
+ * config/aarch64/aarch64-sve.md (vec_extract<vpred><Vel>): Fix operand
+ order to gen_vcond_mask_*.
+
+2025-04-16 Alice Carlotti <alice.carlotti@arm.com>
+
+ * config/aarch64/aarch64.cc
+ (aarch64_valid_sysreg_name_p): Remove feature check.
+ (aarch64_retrieve_sysreg): Ditto.
+
+2025-04-15 Sandra Loosemore <sloosemore@baylibre.com>
+
+ PR tree-optimization/71094
+ * doc/invoke.texi (Optimize Options): Document that -fivopts is
+ enabled at -O1 and higher. Add blurb about -O0 causing GCC to
+ completely ignore most optimization options.
+
+2025-04-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ * configure: Regenerate.
+ * configure.ac: Recognise PROJECT:ld-mmmm.nn.aa as an identifier
+ for Darwin's static linker.
+
+2025-04-15 Iain Sandoe <iainsandoe@mini-05-seq.local>
+
+ PR target/116827
+ * ginclude/stddef.h: Undefine __PTRDIFF_T and __SIZE_T for module-
+ enabled c++ on Darwin/macOS platforms.
+
+2025-04-15 Kyrylo Tkachov <ktkachov@nvidia.com>
+
+ * common.opt.urls: Regenerate.
+
+2025-04-15 Jan Hubicka <hubicka@ucw.cz>
+
+ * config/i386/x86-tune-sched.cc (ix86_issue_rate): Set
+ to 4 for znver5.
+
+2025-04-15 Jan Hubicka <hubicka@ucw.cz>
+
+ PR target/119298
+ * config/i386/x86-tune-costs.h (znver5_cost): Set ADDSS cost to 3.
+
+2025-04-15 Vineet Gupta <vineetg@rivosinc.com>
+
+ PR target/119533
+ * config/riscv/riscv-vsetvl.cc (invalid_opt_bb_p): Check for
+ EDGE_ABNOMAL.
+ (pre_vsetvl::compute_lcm_local_properties): Initialize kill
+ bitmap.
+ Debug dump skipped edge.
+
+2025-04-15 Robin Dapp <rdapp@ventanamicro.com>
+
+ PR target/119547
+ * config/riscv/riscv-vsetvl.cc (pre_vsetvl::earliest_fuse_vsetvl_info):
+ Do not perform lift if block is not transparent.
+
+2025-04-15 Kyrylo Tkachov <ktkachov@nvidia.com>
+
+ * Makefile.in (OBJS): Add ipa-locality-cloning.o.
+ * cgraph.h (set_new_clone_decl_and_node_flags): Declare prototype.
+ * cgraphclones.cc (set_new_clone_decl_and_node_flags): Remove static
+ qualifier.
+ * common.opt (fipa-reorder-for-locality): New flag.
+ (LTO_PARTITION_DEFAULT): Declare.
+ (flto-partition): Change default to LTO_PARTITION_DFEAULT.
+ * doc/invoke.texi: Document -fipa-reorder-for-locality.
+ * flag-types.h (enum lto_locality_cloning_model): Declare.
+ (lto_partitioning_model): Add LTO_PARTITION_DEFAULT.
+ * lto-cgraph.cc (lto_set_symtab_encoder_in_partition): Add dumping of
+ node and index.
+ * opts.cc (validate_ipa_reorder_locality_lto_partition): Define.
+ (finish_options): Handle LTO_PARTITION_DEFAULT.
+ * params.opt (lto_locality_cloning_model): New enum.
+ (lto-partition-locality-cloning): New param.
+ (lto-partition-locality-frequency-cutoff): Likewise.
+ (lto-partition-locality-size-cutoff): Likewise.
+ (lto-max-locality-partition): Likewise.
+ * passes.def: Register pass_ipa_locality_cloning.
+ * timevar.def (TV_IPA_LC): New timevar.
+ * tree-pass.h (make_pass_ipa_locality_cloning): Declare.
+ * ipa-locality-cloning.cc: New file.
+ * ipa-locality-cloning.h: New file.
+
+2025-04-15 Martin Jambor <mjambor@suse.cz>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR ipa/119803
+ * ipa-cp.cc (ipcp_bits_lattice::meet_with_1): Move m_value adjustmed
+ according to m_mask below the adjustment of the latter according to
+ cap_mask. Optimize the calculation of cap_mask a bit.
+ (ipcp_bits_lattice::meet_with): Optimize the calculation of cap_mask a
+ bit.
+
+2025-04-15 Jakub Jelinek <jakub@redhat.com>
+
+ * ipa-cp.cc (ipcp_print_widest_int): Print values with all ones in
+ bits 128+ with "0xf..f" prefix instead of "all ones folled by ".
+ Simplify wide_int check for -1 or all ones above least significant
+ 128 bits.
+
+2025-04-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/119801
+ * sanitizer.def (BUILT_IN_TSAN_FUNC_EXIT): Use BT_FN_VOID rather
+ than BT_FN_VOID_PTR.
+ * tree-tailcall.cc: Include attribs.h and asan.h.
+ (struct tailcall): Add has_tsan_func_exit member.
+ (empty_eh_cleanup): Add eh_has_tsan_func_exit argument, set what
+ it points to to 1 if there is exactly one __tsan_func_exit call
+ and ignore that call otherwise. Adjust recursive call.
+ (find_tail_calls): Add RETRY_TSAN_FUNC_EXIT argument, pass it
+ to recursive calls. When seeing __tsan_func_exit call with
+ RETRY_TSAN_FUNC_EXIT 0, set it to -1. If RETRY_TSAN_FUNC_EXIT
+ is 1, initially ignore __tsan_func_exit calls. Adjust
+ empty_eh_cleanup caller. When looking through stmts after the call,
+ ignore exactly one __tsan_func_exit call but remember it in
+ t->has_tsan_func_exit. Diagnose if EH cleanups didn't have
+ __tsan_func_exit and normal path did or vice versa.
+ (optimize_tail_call): Emit __tsan_func_exit before the tail call
+ or tail recursion.
+ (tree_optimize_tail_calls_1): Adjust find_tail_calls callers. If
+ find_tail_calls changes retry_tsan_func_exit to -1, set it to 1
+ and call it again with otherwise the same arguments.
+
+2025-04-15 Sandra Loosemore <sloosemore@baylibre.com>
+
+ PR ipa/113203
+ * doc/extend.texi (Common Function Attributes): Explain how to
+ use always_inline in programs that have multiple translation
+ units, and that LTO inlining additionally needs optimization
+ enabled.
+
+2025-04-15 liuhongt <hongtao.liu@intel.com>
+
+ PR target/108134
+ * doc/extend.texi: Remove documents from r11-344-g0fec3f62b9bfc0.
+
+2025-04-15 Sandra Loosemore <sloosemore@baylibre.com>
+
+ PR target/42683
+ * doc/invoke.texi (x86 Options): Clarify that -march=pentiumpro
+ doesn't include MMX.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR target/118794
+ * config/gcn/gcn.opt (-mfake-exceptions): Support.
+ * config/nvptx/nvptx.opt (-mfake-exceptions): Likewise.
+ * config/gcn/gcn.md (define_expand "exception_receiver"): Use it.
+ * config/nvptx/nvptx.md (define_expand "exception_receiver"):
+ Likewise.
+ * config/gcn/mkoffload.cc (main): Set it.
+ * config/nvptx/mkoffload.cc (main): Likewise.
+ * config/nvptx/nvptx.cc (nvptx_assemble_integer)
+ <in_section == exception_section>: Special handling for
+ 'SYMBOL_REF's.
+ * except.cc (expand_dw2_landing_pad_for_region): Don't generate
+ bogus code for (default)
+ '#define EH_RETURN_DATA_REGNO(N) INVALID_REGNUM'.
+
+2025-04-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/119785
+ * expmed.cc (init_expmed): Always pass QImode rather than mode to
+ set_src_cost passed to set_zero_cost.
+
+2025-04-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/119718
+ * tree-pretty-print.cc (dump_generic_node) <case CALL_EXPR>: Dump
+ also CALL_EXPR_MUST_TAIL_CALL flag.
+ * calls.cc (maybe_complain_about_tail_call): Emit error about
+ CALL_EXPR_MUST_TAIL_CALL only after emitting dump message, not before
+ it.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * doc/install.texi: Add requirements for building gccrs.
+
+2025-04-14 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/119784
+ * config/i386/i386.cc (ix86_using_red_zone): Don't use red-zone
+ with 32 GPRs and no caller-saved registers.
+
+2025-04-14 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/118097
+ * ipa-cp.cc (ipa_get_jf_arith_result): Require res_operand for
+ anything except NOP_EXPR or ADDR_EXPR, document it and remove the code
+ trying to deduce it.
+ (ipa_value_from_jfunc): Use the stored and streamed type of arithmetic
+ pass-through functions.
+ (ipa_agg_value_from_jfunc): Use the stored and streamed type of
+ arithmetic pass-through functions, convert to the type used to store
+ the value if necessary.
+ (get_val_across_arith_op): New parameter op_type, pass it to
+ ipa_get_jf_arith_result.
+ (propagate_vals_across_arith_jfunc): New parameter op_type, pass it to
+ get_val_across_arith_op.
+ (propagate_vals_across_pass_through): Use the stored and streamed type
+ of arithmetic pass-through functions.
+ (propagate_aggregate_lattice): Likewise.
+ (push_agg_values_for_index_from_edge): Use the stored and streamed
+ type of arithmetic pass-through functions, convert to the type used to
+ store the value if necessary.
+
+2025-04-14 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/118785
+ * ipa-cp.cc (ipa_vr_intersect_with_arith_jfunc): Use the stored
+ and streamed type of arithmetic pass-through functions.
+
+2025-04-14 Martin Jambor <mjambor@suse.cz>
+
+ * ipa-cp.cc (ipcp_print_widest_int): Also add a truncated form of
+ dumping of widest ints which only have zeros in the lowest 128 bits.
+ Update the comment.
+ (ipcp_bits_lattice::print): Also dump the mask using
+ ipcp_print_widest_int.
+ (ipcp_store_vr_results): Likewise.
+
+2025-04-14 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/119318
+ * ipa-cp.cc (ipcp_bits_lattice::meet_with_1): Set all mask bits
+ not covered by precision to one.
+ (ipcp_bits_lattice::meet_with): Likewise.
+ (propagate_bits_across_jump_function): Use the stored operation
+ type to perform meet with other lattices.
+
+2025-04-14 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/118097
+ PR ipa/118785
+ PR ipa/119318
+ * lto-streamer.h (lto_variably_modified_type_p): Declare.
+ * ipa-prop.h (ipa_pass_through_data): New field op_type.
+ (ipa_get_jf_pass_through_op_type): New function.
+ * ipa-prop.cc: Include lto-streamer.h.
+ (ipa_dump_jump_function): Dump also pass-through
+ operation types, if any. Dump pass-through operands only if not NULL.
+ (ipa_set_jf_simple_pass_through): Set op_type accordingly.
+ (compute_complex_assign_jump_func): Set op_type of arithmetic
+ pass-through jump_functions.
+ (analyze_agg_content_value): Update lhs when walking assighment
+ copies. Set op_type of aggregate arithmetic pass-through
+ jump_functions.
+ (update_jump_functions_after_inlining): Also transfer the operation
+ type from the source arithmentic pass-through jump function to the
+ destination jump function.
+ (ipa_write_jump_function): Stream also the op_type when necessary.
+ (ipa_read_jump_function): Likewise.
+ (ipa_agg_pass_through_jf_equivalent_p): Also compare operation types.
+ * lto-streamer-out.cc (lto_variably_modified_type_p): Make public.
+
+2025-04-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/119757
+ * tree-vect-slp.cc (vect_build_slp_tree_1): Record and compare
+ whether a stmt uses a maks.
+
+2025-04-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/119778
+ * tree-inline.cc (copy_edges_for_bb): Mark calls that are
+ source of abnormal edges as altering control-flow.
+
+2025-04-14 Gaius Mulley <gaiusmod2@gmail.com>
+
+ PR modula2/119779
+ * doc/gm2.texi (Interface to assembly language): Use eax
+ rather than rax in both examples.
+
+2025-04-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR driver/119727
+ * configure.ac (HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE): New check.
+ * gcc.cc: Include sys/personality.h if
+ HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE is defined.
+ (try_generate_repro): Call
+ personality (personality (0xffffffffU) | ADDR_NO_RANDOMIZE)
+ if HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE is defined.
+ * config.in: Regenerate.
+ * configure: Regenerate.
+
+2025-04-13 Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org>
+
+ * config/s390/s390.cc: Add z17 scheduler description.
+ * config/s390/s390.h: Ditto.
+ * config/s390/s390.md: Ditto.
+ * config/s390/9175.md: New file.
+
+2025-04-13 Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org>
+
+ * common/config/s390/s390-common.cc: Rename arch15 to z17.
+ * config.gcc: Add z17.
+ * config/s390/driver-native.cc: Detect z17 machine.
+ * config/s390/s390-builtins.def (B_VXE3): Rename arch15 to z17.
+ * config/s390/s390-c.cc (s390_resolve_overloaded_builtin): Ditto.
+ * config/s390/s390-opts.h (enum processor_type): Ditto.
+ * config/s390/s390.cc: Ditto.
+ * config/s390/s390.h: Ditto.
+ * config/s390/s390.md: Ditto.
+ * config/s390/s390.opt: Add z17.
+ * doc/invoke.texi: Ditto.
+
+2025-04-12 Sandra Loosemore <sloosemore@baylibre.com>
+
+ PR target/97585
+ * doc/invoke.texi (x86 Options): Document list of extensions
+ supported by -march=x86_64, according to the declaration of
+ PTA_X86_64_BASELINE in config/i386/i386.h.
+
+2025-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR driver/119727
+ * gcc.cc (files_equal_p): Rewritten using fopen/fgets/fclose instead
+ of open/fstat/read/close. At the start of lines, ignore lowercase
+ hexadecimal addresses followed by space.
+
+2025-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/119722
+ * gimple-lower-bitint.h (build_bitint_stmt_ssa_conflicts): Add
+ CLEAR argument.
+ * gimple-lower-bitint.cc (build_bitint_stmt_ssa_conflicts): Add
+ CLEAR argument. Call clear on gimple_assign_copy_p rhs1 if lhs
+ is large/huge bitint unless lhs is not in names.
+ * tree-ssa-coalesce.cc (build_ssa_conflict_graph): Adjust
+ build_bitint_stmt_ssa_conflicts caller. Move gimple_assign_copy_p
+ handling to after the build_bitint_stmt_ssa_conflicts call.
+
+2025-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/119718
+ * tree-tailcall.cc (maybe_error_musttail): Dump the GIMPLE at the
+ end of the Cannot tail-call line rather than on the line before it.
+ * calls.cc (maybe_complain_about_tail_call): Dump the GENERIC
+ at the end of the ;; Cannot tail-call line rather than on the
+ line before it.
+
+2025-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/119718
+ * tree-tailcall.cc (maybe_error_musttail): Only dump into dump_file
+ if dump_flags & TDF_DETAILS. Use "Cannot tail-call: " prefix instead
+ of "Cannot convert: ".
+ (find_tail_calls, tree_optimize_tail_calls_1): Formatting fixes
+ for maybe_error_musttail calls.
+ * calls.cc (maybe_complain_about_tail_call): Emit also a message
+ into dump_file when dump_flags & TDF_DETAILS for CALL_EXPR_TAILCALL
+ calls.
+ (initialize_argument_information): Formatting fix for
+ maybe_complain_about_tail_call calls.
+ (can_implement_as_sibling_call_p, expand_call): Likewise.
+
+2025-04-11 Sandra Loosemore <sloosemore@baylibre.com>
+
+ PR c++/106618
+ * doc/invoke.texi (Option Summary): Remove -fargs-in-order, add
+ -fstrong-eval-order.
+ (C++ Dialect Options): Explicitly document that -fstrong-eval-order
+ takes an optional argument and what the choices are. Generalize
+ references to C++17.
+
+2025-04-11 Sandra Loosemore <sloosemore@baylibre.com>
+
+ PR middle-end/105548
+ * doc/invoke.texi (Optimize Options): Delete misleading sentence
+ about conversions.
+
+2025-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/119707
+ * gimple-lower-bitint.cc (bitint_large_huge::handle_cast): Only use
+ m_data[save_data_cnt] instead of m_data[save_data_cnt + 1] if
+ idx is odd and equal to low + 1. Remember tree_to_uhwi (idx) in
+ a temporary instead of calling the function multiple times.
+
+2025-04-11 Sandra Loosemore <sloosemore@baylibre.com>
+
+ PR tree-optimization/87909
+ * common.opt.urls: Regenerate.
+ * doc/invoke.texi (Option Summary): Add -ftree-cselim.
+ (Optimize Options): Likewise.
+
+2025-04-11 Sandra Loosemore <sloosemore@baylibre.com>
+
+ PR middle-end/14708
+ * doc/invoke.texi (Optimize Options): List -fexcess-precision
+ before -ffloat-store, moving some background discussion to the
+ former from the latter. Recommend using -fexcess-precision=standard
+ instead of -ffloat-store.
+
+2025-04-10 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.h (LINK_SPEC): Add support for
+ -static-libgcobol.
+
+2025-04-10 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/119706
+ * gimple-expr.cc (is_gimple_mem_ref_addr): Also allow
+ POLY_INT_CST.
+
+2025-04-10 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR tree-optimization/119399
+ * tree-data-ref.cc (create_waw_or_war_checks): Use a MINUS_EXPR
+ on two converted pointers, rather than converting a POINTER_DIFF_EXPR
+ on the pointers.
+
+2025-04-10 Kito Cheng <kito.cheng@sifive.com>
+
+ * config/riscv/multilib-generator: Remove the compact code model
+ and check large code model for RV32.
+
+2025-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ * pretty-print.cc (pretty_printer::format): Use %.Ns instead of
+ %Ns in function comment.
+
+2025-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/119664
+ * config/h8300/jumpcall.md (bit test and jump define_insn_and_split):
+ Use HSI iterator rather than QHSI.
+
+2025-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ * config/riscv/riscv-vector-builtins.cc (verify_type_context):
+ Diagnose RVV types for a given OpenMP context.
+
+2025-04-09 Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/119689
+ PR rtl-optimization/115568
+ * lra-remat.cc (create_cands): Use prev_nonnote_nondebug_insn
+ to check whether insn2 is directly before insn.
+
+2025-04-09 Robin Dapp <rdapp@ventanamicro.com>
+
+ PR middle-end/116595
+ * expr.cc (categorize_ctor_elements_1): Use
+ constant_lower_bound.
+
+2025-04-09 Yang Yujie <yangyujie@loongson.cn>
+
+ * config/loongarch/genopts/gen-evolution.awk: remove
+ usage of "asort".
+ * config/loongarch/genopts/genstr.sh: replace sed with awk.
+
2025-04-08 Sandra Loosemore <sloosemore@baylibre.com>
PR c++/90468
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index cb38c2c..2aaf995 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20250409
+20250421
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index ebfcd8a..55b4cd7 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1555,6 +1555,7 @@ OBJS = \
incpath.o \
init-regs.o \
internal-fn.o \
+ ipa-locality-cloning.o \
ipa-cp.o \
ipa-sra.o \
ipa-devirt.o \
@@ -3026,6 +3027,7 @@ GTFILES = $(CPPLIB_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/ipa-param-manipulation.h $(srcdir)/ipa-sra.cc \
$(srcdir)/ipa-modref.h $(srcdir)/ipa-modref.cc \
$(srcdir)/ipa-modref-tree.h \
+ $(srcdir)/ipa-locality-cloning.cc \
$(srcdir)/signop.h \
$(srcdir)/diagnostic-spec.h $(srcdir)/diagnostic-spec.cc \
$(srcdir)/dwarf2out.h \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index f7a9025..650de8b 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,13 @@
+2025-04-17 Jakub Jelinek <jakub@redhat.com>
+
+ * gnatvsn.ads: Bump Library_Version to 16.
+
+2025-04-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/119643
+ * sem_ch8.adb (Inherit_Renamed_Profile): Add guard against the
+ peculiarities of Natural and Positive.
+
2025-04-07 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.cc (convert) <POINTER_TYPE>: Use fold_convert
diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads
index 176f88a..ad11c30 100644
--- a/gcc/ada/gnatvsn.ads
+++ b/gcc/ada/gnatvsn.ads
@@ -32,7 +32,7 @@ package Gnatvsn is
-- Static string identifying this version, that can be used as an argument
-- to e.g. pragma Ident.
- Library_Version : constant String := "15";
+ Library_Version : constant String := "16";
-- Library version. It needs to be updated whenever the major version
-- number is changed.
--
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index d4ab44f..0a9ef41 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -9314,11 +9314,12 @@ package body Sem_Ch8 is
-- If the new type is a renaming of the old one, as is the case
-- for actuals in instances, retain its name, to simplify later
- -- disambiguation.
+ -- disambiguation. Beware of Natural and Positive, see Cstand.
if Nkind (Parent (New_T)) = N_Subtype_Declaration
and then Is_Entity_Name (Subtype_Indication (Parent (New_T)))
and then Entity (Subtype_Indication (Parent (New_T))) = Old_T
+ and then Scope (New_T) /= Standard_Standard
then
null;
else
diff --git a/gcc/avoid-store-forwarding.cc b/gcc/avoid-store-forwarding.cc
index 34a7bba..ded8d7e 100644
--- a/gcc/avoid-store-forwarding.cc
+++ b/gcc/avoid-store-forwarding.cc
@@ -238,10 +238,15 @@ process_store_forwarding (vec<store_fwd_info> &stores, rtx_insn *load_insn,
{
start_sequence ();
- rtx ext0 = gen_rtx_ZERO_EXTEND (GET_MODE (dest), it->mov_reg);
- if (ext0)
+ machine_mode dest_mode = GET_MODE (dest);
+ rtx base_reg = it->mov_reg;
+ if (known_gt (GET_MODE_BITSIZE (dest_mode),
+ GET_MODE_BITSIZE (GET_MODE (it->mov_reg))))
+ base_reg = gen_rtx_ZERO_EXTEND (dest_mode, it->mov_reg);
+
+ if (base_reg)
{
- rtx_insn *move0 = emit_move_insn (dest, ext0);
+ rtx_insn *move0 = emit_move_insn (dest, base_reg);
if (recog_memoized (move0) >= 0)
{
insns = get_insns ();
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index dec9f16..f75a0f6 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-15 Qing Zhao <qing.zhao@oracle.com>
+
+ PR c/119717
+ * c-typeck.cc (build_access_with_size_for_counted_by): Fully fold the
+ parameters for call to .ACCESS_WITH_SIZE.
+
2025-04-08 Martin Uecker <uecker@tugraz.at>
PR c/119612
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index 3870e8a..55d896e 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -3013,12 +3013,16 @@ build_access_with_size_for_counted_by (location_t loc, tree ref,
gcc_assert (c_flexible_array_member_type_p (TREE_TYPE (ref)));
/* The result type of the call is a pointer to the flexible array type. */
tree result_type = c_build_pointer_type (TREE_TYPE (ref));
+ tree first_param
+ = c_fully_fold (array_to_pointer_conversion (loc, ref), false, NULL);
+ tree second_param
+ = c_fully_fold (counted_by_ref, false, NULL);
tree call
= build_call_expr_internal_loc (loc, IFN_ACCESS_WITH_SIZE,
result_type, 6,
- array_to_pointer_conversion (loc, ref),
- counted_by_ref,
+ first_param,
+ second_param,
build_int_cst (integer_type_node, 1),
build_int_cst (counted_by_type, 0),
build_int_cst (integer_type_node, -1),
diff --git a/gcc/calls.cc b/gcc/calls.cc
index b3dccd8..076e046 100644
--- a/gcc/calls.cc
+++ b/gcc/calls.cc
@@ -1273,11 +1273,19 @@ void
maybe_complain_about_tail_call (tree call_expr, const char *reason)
{
gcc_assert (TREE_CODE (call_expr) == CALL_EXPR);
- if (!CALL_EXPR_MUST_TAIL_CALL (call_expr))
- return;
-
- error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", reason);
- CALL_EXPR_MUST_TAIL_CALL (call_expr) = 0;
+ if (CALL_EXPR_TAILCALL (call_expr)
+ && dump_file
+ && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, ";; Cannot tail-call: %s: ", reason);
+ print_generic_expr (dump_file, call_expr, TDF_SLIM);
+ fprintf (dump_file, "\n");
+ }
+ if (CALL_EXPR_MUST_TAIL_CALL (call_expr))
+ {
+ error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", reason);
+ CALL_EXPR_MUST_TAIL_CALL (call_expr) = 0;
+ }
}
/* Fill in ARGS_SIZE and ARGS array based on the parameters found in
@@ -1447,10 +1455,10 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
if (!call_from_thunk_p && DECL_P (base) && !TREE_STATIC (base))
{
*may_tailcall = false;
- maybe_complain_about_tail_call (exp,
- _("a callee-copied argument is"
- " stored in the current"
- " function's frame"));
+ maybe_complain_about_tail_call (exp, _("a callee-copied "
+ "argument is stored "
+ "in the current "
+ "function's frame"));
}
args[i].tree_value = build_fold_addr_expr_loc (loc,
@@ -2534,10 +2542,9 @@ can_implement_as_sibling_call_p (tree exp,
if (!targetm.have_sibcall_epilogue ()
&& !targetm.emit_epilogue_for_sibcall)
{
- maybe_complain_about_tail_call
- (exp,
- _("machine description does not have"
- " a sibcall_epilogue instruction pattern"));
+ maybe_complain_about_tail_call (exp, _("machine description does not "
+ "have a sibcall_epilogue "
+ "instruction pattern"));
return false;
}
@@ -2555,9 +2562,8 @@ can_implement_as_sibling_call_p (tree exp,
into a sibcall. */
if (!targetm.function_ok_for_sibcall (fndecl, exp))
{
- maybe_complain_about_tail_call (exp,
- _("target is not able to optimize the"
- " call into a sibling call"));
+ maybe_complain_about_tail_call (exp, _("target is not able to optimize "
+ "the call into a sibling call"));
return false;
}
@@ -2606,9 +2612,8 @@ can_implement_as_sibling_call_p (tree exp,
if (maybe_gt (args_size.constant,
crtl->args.size - crtl->args.pretend_args_size))
{
- maybe_complain_about_tail_call (exp,
- _("callee required more stack slots"
- " than the caller"));
+ maybe_complain_about_tail_call (exp, _("callee required more stack "
+ "slots than the caller"));
return false;
}
@@ -2621,9 +2626,8 @@ can_implement_as_sibling_call_p (tree exp,
(current_function_decl),
crtl->args.size)))
{
- maybe_complain_about_tail_call (exp,
- _("inconsistent number of"
- " popped arguments"));
+ maybe_complain_about_tail_call (exp, _("inconsistent number of"
+ " popped arguments"));
return false;
}
@@ -2685,7 +2689,7 @@ expand_call (tree exp, rtx target, int ignore)
so this shouldn't really happen unless the
the musttail pass gave up walking before finding the call. */
if (!try_tail_call)
- maybe_complain_about_tail_call (exp, _("other reasons"));
+ maybe_complain_about_tail_call (exp, _("other reasons"));
int pass;
/* Register in which non-BLKmode value will be returned,
@@ -3092,8 +3096,9 @@ expand_call (tree exp, rtx target, int ignore)
if (MEM_P (*iter))
{
try_tail_call = 0;
- maybe_complain_about_tail_call (exp,
- _("hidden string length argument passed on stack"));
+ maybe_complain_about_tail_call (exp, _("hidden string length "
+ "argument passed on "
+ "stack"));
break;
}
}
@@ -3140,10 +3145,9 @@ expand_call (tree exp, rtx target, int ignore)
|| partial_subreg_p (caller_mode, callee_mode)))))
{
try_tail_call = 0;
- maybe_complain_about_tail_call (exp,
- _("caller and callee disagree in"
- " promotion of function"
- " return value"));
+ maybe_complain_about_tail_call (exp, _("caller and callee disagree "
+ "in promotion of function "
+ "return value"));
}
}
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 065fcc7..abde770 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -2627,6 +2627,7 @@ void tree_function_versioning (tree, tree, vec<ipa_replace_map *, va_gc> *,
void dump_callgraph_transformation (const cgraph_node *original,
const cgraph_node *clone,
const char *suffix);
+void set_new_clone_decl_and_node_flags (cgraph_node *new_node);
/* In cgraphbuild.cc */
int compute_call_stmt_bb_frequency (tree, basic_block bb);
void record_references_in_initializer (tree, bool);
diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc
index 5332a43..e6223fa 100644
--- a/gcc/cgraphclones.cc
+++ b/gcc/cgraphclones.cc
@@ -158,7 +158,7 @@ cgraph_edge::clone (cgraph_node *n, gcall *call_stmt, unsigned stmt_uid,
/* Set flags of NEW_NODE and its decl. NEW_NODE is a newly created private
clone or its thunk. */
-static void
+void
set_new_clone_decl_and_node_flags (cgraph_node *new_node)
{
DECL_EXTERNAL (new_node->decl) = 0;
diff --git a/gcc/cobol/ChangeLog b/gcc/cobol/ChangeLog
index e386591..27c31c1 100644
--- a/gcc/cobol/ChangeLog
+++ b/gcc/cobol/ChangeLog
@@ -1,3 +1,82 @@
+2025-04-16 Bob Dubner <rdubner@symas.com>
+
+ PR cobol/119759
+ * LICENSE: Deleted.
+
+2025-04-15 Richard Biener <rguenther@suse.de>
+
+ PR cobol/119302
+ * Make-lang.in (GCOBOLIO_INSTALL_NAME): Define.
+ Use $(GCOBOLIO_INSTALL_NAME) for gcobol.3 manpage source
+ upon install.
+
+2025-04-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR cobol/119776
+ * lang.opt (fmax-errors): Remove.
+ * lang.opt.urls: Regenerate.
+ * cobol1.cc (cobol_langhook_handle_option) <case OPT_fmax_errors>:
+ Remove.
+ * gcobol.1: Document -fmax-errors=nerror rather than
+ -fmax-errors nerror.
+
+2025-04-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR cobol/119777
+ * lang.opt (include): Remove Var(cobol_include).
+ * cobol1.cc (cobol_langhook_handle_option) <case OPT_include>: Use
+ arg instead of cobol_include.
+
+2025-04-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR cobol/119777
+ * lang.opt (fsyntax-only): Remove.
+ * lang.opt.urls: Regenerate.
+
+2025-04-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+ Simon Sobisch <simonsobisch@gnu.org>
+
+ PR cobol/119217
+ * parse.y: Rename OVERFLOW to OVERFLOW_kw.
+ Specify type name in %token directive.
+ * scan.l: Likewise.
+ * token_names.h: Regenerate.
+
+2025-04-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR cobol/119217
+ * util.cc (class timespec_t): Rename to cbl_timespec.
+
+2025-04-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * genapi.cc: Include target.h.
+ (section_label): Use ASM_COMMENT_START.
+ (paragraph_label): Likewise.
+ (parser_perform): Likewise.
+ (internal_perform_through): Likewise.
+ (hijack_for_development): Likewise.
+
+2025-04-12 Bob Dubner <rdubner@symas.com>
+
+ PR cobol/119694
+ * cbldiag.h: Eliminate getenv() calls.
+ * cdf.y: Likewise.
+ * cobol1.cc: Likewise.
+ * except.cc: Likewise.
+ * genapi.cc: Likewise.
+ * lexio.cc: Likewise.
+ * parse.y: Likewise.
+ * scan_ante.h: Likewise.
+ * show_parse.h: Likewise.
+ * symbols.cc: Likewise.
+ * symfind.cc: Likewise.
+ * util.cc: Likewise.
+
+2025-04-09 Bob Dubner <rdubner@symas.com>
+
+ PR cobol/119682
+ * genapi.cc: (cobol_compare): Change the call to __gg__compare().
+
2025-04-08 Jakub Jelinek <jakub@redhat.com>
PR cobol/119364
diff --git a/gcc/cobol/LICENSE b/gcc/cobol/LICENSE
deleted file mode 100644
index aa5ba60..0000000
--- a/gcc/cobol/LICENSE
+++ /dev/null
@@ -1,29 +0,0 @@
-#########################################################################
-#
-# Copyright (c) 2021-2025 Symas Corporation
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of the Symas Corporation nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/gcc/cobol/Make-lang.in b/gcc/cobol/Make-lang.in
index 422ebe2..9b74dd3 100644
--- a/gcc/cobol/Make-lang.in
+++ b/gcc/cobol/Make-lang.in
@@ -35,6 +35,7 @@
# - define the names for selecting the language in LANGUAGES.
GCOBOL_INSTALL_NAME := $(shell echo gcobol|sed '$(program_transform_name)')
+GCOBOLIO_INSTALL_NAME := $(shell echo gcobol-io|sed '$(program_transform_name)')
GCOBOL_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcobol|sed '$(program_transform_name)')
GCOBC_INSTALL_NAME := $(shell echo gcobc|sed '$(program_transform_name)')
@@ -293,7 +294,7 @@ cobol.install-common: installdirs
cobol.install-man: installdirs
$(INSTALL_DATA) $(srcdir)/cobol/gcobol.1 $(DESTDIR)$(man1dir)/$(GCOBOL_INSTALL_NAME)$(man1ext)
- $(INSTALL_DATA) $(srcdir)/cobol/gcobol.3 $(DESTDIR)$(man3dir)/
+ $(INSTALL_DATA) $(srcdir)/cobol/gcobol.3 $(DESTDIR)$(man3dir)/$(GCOBOLIO_INSTALL_NAME)$(man3ext)
cobol.install-info:
@@ -342,8 +343,8 @@ cobol.uninstall:
rm -rf $(DESTDIR)$(bindir)/$(GCOBOL_INSTALL_NAME)$(exeext) \
$(DESTDIR)$(bindir)/$(GCOBC_INSTALL_NAME) \
$(DESTDIR)$(datadir)/gcobol/ \
- $(DESTDIR)$(man1dir)/$(GCOBOL_INSTALL_NAME).1 \
- $(DESTDIR)$(man3dir)/gcobol.3
+ $(DESTDIR)$(man1dir)/$(GCOBOL_INSTALL_NAME)$(man1ext) \
+ $(DESTDIR)$(man3dir)/$(GCOBOLIO_INSTALL_NAME)$(man3ext)
cobol.man:
cobol.srcman:
diff --git a/gcc/cobol/cbldiag.h b/gcc/cobol/cbldiag.h
index ed754f1..d7ee98f 100644
--- a/gcc/cobol/cbldiag.h
+++ b/gcc/cobol/cbldiag.h
@@ -33,6 +33,12 @@
#else
#define _CBLDIAG_H
+#if 0
+#define gcobol_getenv(x) getenv(x)
+#else
+#define gcobol_getenv(x) ((char *)nullptr)
+#endif
+
const char * cobol_filename();
/*
@@ -101,7 +107,7 @@ template <typename LOC>
static void
location_dump( const char func[], int line, const char tag[], const LOC& loc) {
extern int yy_flex_debug;
- if( yy_flex_debug && getenv("update_location") )
+ if( yy_flex_debug && gcobol_getenv("update_location") )
fprintf(stderr, "%s:%d: %s location (%d,%d) to (%d,%d)\n",
func, line, tag,
loc.first_line, loc.first_column, loc.last_line, loc.last_column);
diff --git a/gcc/cobol/cdf.y b/gcc/cobol/cdf.y
index 6392f89..e06ccf3 100644
--- a/gcc/cobol/cdf.y
+++ b/gcc/cobol/cdf.y
@@ -226,7 +226,7 @@ apply_cdf_turn( exception_turns_t& turns ) {
turns.location,
elem.first, files);
}
- if( getenv("SHOW_PARSE") ) enabled_exceptions.dump();
+ if( getenv("GCOBOL_SHOW") ) enabled_exceptions.dump();
return true;
}
%}
diff --git a/gcc/cobol/cobol1.cc b/gcc/cobol/cobol1.cc
index 1e690ff..3bd21c7 100644
--- a/gcc/cobol/cobol1.cc
+++ b/gcc/cobol/cobol1.cc
@@ -294,7 +294,7 @@ cobol_langhook_init_options_struct (struct gcc_options *opts) {
cobol_set_debugging( false, false, false );
- copybook_directory_add( getenv("GCOB_COPYBOOK") );
+ copybook_directory_add( getenv("GCOBOL_COPYBOOK") );
}
static unsigned int
@@ -385,10 +385,6 @@ cobol_langhook_handle_option (size_t scode,
return true;
}
- case OPT_fmax_errors:
- flag_max_errors = atoi(arg);
- return true;
-
case OPT_ffixed_form:
cobol_set_indicator_column(-7);
return true;
@@ -413,8 +409,8 @@ cobol_langhook_handle_option (size_t scode,
}
return true;
case OPT_include:
- if( ! include_file_add(cobol_include) ) {
- cbl_errx( "could not include %s", cobol_include);
+ if( ! include_file_add(arg) ) {
+ cbl_errx( "could not include %s", arg);
}
return true;
diff --git a/gcc/cobol/except.cc b/gcc/cobol/except.cc
index 1485a33..7a6a922 100644
--- a/gcc/cobol/except.cc
+++ b/gcc/cobol/except.cc
@@ -312,11 +312,11 @@ file_status_t current_file_handled_status();
void
declarative_runtime_match( cbl_field_t *declaratives, cbl_label_t *lave ) {
- if( getenv("SHOW_PARSE") )
+ if( getenv("GCOBOL_SHOW") )
{
fprintf(stderr, "( %d ) %s: \n", cobol_location().first_line, __func__);
}
- if( getenv("TRACE1") )
+ if( getenv("GCOBOL_TRACE") )
{
gg_printf(">>>>>>( %d )(%s) declaratives:%s lave:%s\n",
build_int_cst_type(INT, cobol_location().first_line),
diff --git a/gcc/cobol/gcobol.1 b/gcc/cobol/gcobol.1
index 64c017c..4377c14 100644
--- a/gcc/cobol/gcobol.1
+++ b/gcc/cobol/gcobol.1
@@ -224,7 +224,7 @@ had appeared.
Not all exception conditions are implemented. Any that are not
produce a warning message.
.
-.It Fl fmax-errors Ar nerror
+.It Fl fmax-errors Ns Li = Ns Ar nerror
.Ar nerror
represents the number of error messages produced. Without this option,
.Nm
diff --git a/gcc/cobol/genapi.cc b/gcc/cobol/genapi.cc
index fdf76aa..c8911f9 100644
--- a/gcc/cobol/genapi.cc
+++ b/gcc/cobol/genapi.cc
@@ -34,6 +34,7 @@
#include "tree-iterator.h"
#include "stringpool.h"
#include "diagnostic-core.h"
+#include "target.h"
#include "../../libgcobol/ec.h"
#include "../../libgcobol/common-defs.h"
@@ -75,7 +76,7 @@ static int pseudo_label = 1;
static bool suppress_cobol_entry_point = false;
static char ach_cobol_entry_point[256] = "";
-bool bSHOW_PARSE = getenv("SHOW_PARSE");
+bool bSHOW_PARSE = getenv("GCOBOL_SHOW");
bool show_parse_sol = true;
int show_parse_indent = 0;
@@ -198,7 +199,7 @@ trace1_init()
trace_handle = gg_define_variable(INT, "trace_handle", vs_static);
trace_indent = gg_define_variable(INT, "trace_indent", vs_static);
- bTRACE1 = getenv("TRACE1") ? getenv("TRACE1") : gv_trace_switch;
+ bTRACE1 = getenv("GCOBOL_TRACE") ? getenv("GCOBOL_TRACE") : gv_trace_switch;
if( bTRACE1 && strcmp(bTRACE1, "0") != 0 )
{
@@ -2357,7 +2358,8 @@ section_label(struct cbl_proc_t *procedure)
cbl_label_t *label = procedure->label;
// The _initialize_program section isn't relevant.
- char *psz = xasprintf("# SECTION %s in %s (%ld)",
+ char *psz = xasprintf("%s SECTION %s in %s (%ld)",
+ ASM_COMMENT_START,
label->name,
current_function->our_unmangled_name,
deconflictor);
@@ -2408,7 +2410,8 @@ paragraph_label(struct cbl_proc_t *procedure)
char *psz1 =
xasprintf(
- "# PARAGRAPH %s of %s in %s (%ld)",
+ "%s PARAGRAPH %s of %s in %s (%ld)",
+ ASM_COMMENT_START,
para_name ? para_name: "" ,
section_name ? section_name: "(null)" ,
current_function->our_unmangled_name ? current_function->our_unmangled_name: "" ,
@@ -3006,7 +3009,8 @@ parser_perform(cbl_label_t *label, bool suppress_nexting)
para_name = label->name;
sect_name = section_label->name;
sprintf(ach,
- "# PERFORM %s of %s of %s (%ld)",
+ "%s PERFORM %s of %s of %s (%ld)",
+ ASM_COMMENT_START,
para_name,
sect_name,
program_name,
@@ -3018,7 +3022,8 @@ parser_perform(cbl_label_t *label, bool suppress_nexting)
{
sect_name = label->name;
sprintf(ach,
- "# PERFORM %s of %s (%ld)",
+ "%s PERFORM %s of %s (%ld)",
+ ASM_COMMENT_START,
sect_name,
program_name,
deconflictor);
@@ -3170,8 +3175,8 @@ internal_perform_through( cbl_label_t *proc_1,
pseudo_return_push(proc2, return_addr);
// Create the code that will launch the first procedure
- gg_insert_into_assembler("# PERFORM %s THROUGH %s",
- proc_1->name, proc_2->name);
+ gg_insert_into_assembler("%s PERFORM %s THROUGH %s",
+ ASM_COMMENT_START, proc_1->name, proc_2->name);
if( !suppress_nexting )
{
@@ -6632,22 +6637,6 @@ parser_division(cbl_division_t division,
}
gg_assign(base, gg_cast(UCHAR_P, parameter));
- IF( gg_call_expr( CHAR_P,
- "getenv",
- gg_string_literal("PARAMETERS_ON_ENTRY"),
- NULL_TREE),
- ne_op,
- gg_cast(CHAR_P, null_pointer_node));
- {
- gg_printf("parameter_on_entry: %s(): %d %p\n",
- gg_string_literal(current_function->our_unmangled_name),
- build_int_cst_type(INT, i+1),
- base,
- NULL_TREE);
- }
- ELSE
- ENDIF
-
if( args[i].refer.field->attr & any_length_e )
{
// gg_printf("side channel: Length of \"%s\" is %ld\n",
@@ -13622,7 +13611,7 @@ hijack_for_development(const char *funcname)
// Assume that funcname is lowercase with no hyphens
enter_program_common(funcname, funcname);
parser_display_literal("You have been hijacked by a program named \"dubner\"");
- gg_insert_into_assembler("# HIJACKED DUBNER CODE START");
+ gg_insert_into_assembler("%s HIJACKED DUBNER CODE START", ASM_COMMENT_START);
for(int i=0; i<10; i++)
{
@@ -13635,7 +13624,7 @@ hijack_for_development(const char *funcname)
NULL_TREE);
}
- gg_insert_into_assembler("# HIJACKED DUBNER CODE END");
+ gg_insert_into_assembler("%s HIJACKED DUBNER CODE END", ASM_COMMENT_START);
gg_return(0);
}
@@ -15871,38 +15860,6 @@ psa_global(cbl_field_t *new_var)
sprintf(ach, "__gg__%s", mname);
free(mname);
- if( getenv("SHOW_GLOBAL_VARIABLES") )
- {
- char ach_type[32];
- strcpy(ach_type, cbl_field_type_str(new_var->type));
-
- fprintf(stderr, "struct cblc_field_t %s = {\n", ach);
- fprintf(stderr, " .data = NULL ,\n" );
- fprintf(stderr, " .capacity = %d ,\n", new_var->data.capacity );
- fprintf(stderr, " .offset = %ld ,\n" , new_var->offset );
- fprintf(stderr, " .name = \"%s\" ,\n" , new_var->name );
- fprintf(stderr, " .picture = \"%s\" ,\n" , new_var->data.picture ? new_var->data.picture : "" );
- if( new_var->data.initial || new_var->type == FldPointer )
- {
- fprintf(stderr, " .initial = \"%s\" ,\n" , new_var->data.picture ? new_var->data.picture : "" );
- }
- else
- {
- fprintf(stderr, " .initial = NULL ,\n" );
- }
- fprintf(stderr, " .parent = NULL,\n" );
- fprintf(stderr, " .depending_on = NULL ,\n" );
- fprintf(stderr, " .depends_on = NULL ,\n" );
- fprintf(stderr, " .occurs_lower = 0 ,\n" );
- fprintf(stderr, " .occurs_upper = 0 ,\n" );
- fprintf(stderr, " .attr = 0x%lx ,\n" , new_var->attr );
- fprintf(stderr, " .type = %s ,\n" , ach_type);
- fprintf(stderr, " .level = %d ,\n" , new_var->level );
- fprintf(stderr, " .digits = %d ,\n" , new_var->data.digits );
- fprintf(stderr, " .rdigits = %d ,\n" , new_var->data.rdigits );
- fprintf(stderr, " };\n");
- }
-
if( strcmp(new_var->name, "_VERY_TRUE") == 0 )
{
new_var->var_decl_node = boolean_true_node;
diff --git a/gcc/cobol/lang.opt b/gcc/cobol/lang.opt
index 42c4020..59278a1 100644
--- a/gcc/cobol/lang.opt
+++ b/gcc/cobol/lang.opt
@@ -77,10 +77,6 @@ ffixed-form
Cobol RejectNegative
Assume that the source file is fixed form.
-fsyntax-only
-Cobol RejectNegative
-; Documented in c.opt
-
ffree-form
Cobol RejectNegative
Assume that the source file is free form.
@@ -93,10 +89,6 @@ finternal-ebcdic
Cobol Var(cobol_ebcdic, 1) Init(0)
-finternal-ebcdic Internal processing is in EBCDIC Code Page 1140
-fmax-errors
-Cobol Joined Separate
-; Documented in C
-
fstatic-call
Cobol Var(cobol_static_call, 1) Init(1)
Enable/disable static linkage for CALL literals
@@ -118,7 +110,7 @@ Cobol Joined Separate
; Documented in C
include
-Cobol Joined Separate Var(cobol_include)
+Cobol Joined Separate
; Documented in C
isysroot
diff --git a/gcc/cobol/lang.opt.urls b/gcc/cobol/lang.opt.urls
index 6a5dc1c..69f5297 100644
--- a/gcc/cobol/lang.opt.urls
+++ b/gcc/cobol/lang.opt.urls
@@ -13,15 +13,9 @@ UrlSuffix(gcc/Directory-Options.html#index-I) LangUrlSuffix_D(gdc/Directory-Opti
ffixed-form
LangUrlSuffix_Fortran(gfortran/Fortran-Dialect-Options.html#index-ffixed-form)
-fsyntax-only
-UrlSuffix(gcc/Warning-Options.html#index-fsyntax-only) LangUrlSuffix_D(gdc/Warnings.html#index-fno-syntax-only) LangUrlSuffix_Fortran(gfortran/Error-and-Warning-Options.html#index-fsyntax-only)
-
ffree-form
LangUrlSuffix_Fortran(gfortran/Fortran-Dialect-Options.html#index-ffree-form)
-fmax-errors
-UrlSuffix(gcc/Warning-Options.html#index-fmax-errors) LangUrlSuffix_D(gdc/Warnings.html#index-fmax-errors)
-
iprefix
UrlSuffix(gcc/Directory-Options.html#index-iprefix) LangUrlSuffix_D(gdc/Directory-Options.html#index-iprefix) LangUrlSuffix_Fortran(gfortran/Preprocessing-Options.html#index-iprefix)
diff --git a/gcc/cobol/lexio.cc b/gcc/cobol/lexio.cc
index 82bacf2..afe3725 100644
--- a/gcc/cobol/lexio.cc
+++ b/gcc/cobol/lexio.cc
@@ -380,7 +380,9 @@ struct buffer_t : public bytespan_t {
dbgmsg("flex input buffer: '%.*s'\n[xelf]", int(pos - data), data);
}
void dump() const {
+#ifdef GETENV_OK
if( getenv("lexer_input") ) show();
+#endif
}
};
@@ -457,11 +459,11 @@ update_yylloc( const csub_match& stmt, const csub_match& term ) {
class dump_loc_on_exit {
public:
dump_loc_on_exit() {
- if( getenv( "update_yylloc" ) )
+ if( gcobol_getenv( "update_yylloc" ) )
location_dump( "update_yylloc", __LINE__, "begin", yylloc);
}
~dump_loc_on_exit() {
- if( getenv( "update_yylloc" ) )
+ if( gcobol_getenv( "update_yylloc" ) )
location_dump( "update_yylloc", __LINE__, "end ", yylloc);
}
} dloe;
diff --git a/gcc/cobol/parse.y b/gcc/cobol/parse.y
index 61ffa7c..55c26fe 100644
--- a/gcc/cobol/parse.y
+++ b/gcc/cobol/parse.y
@@ -338,7 +338,7 @@
%token <number> INVALID
%token <number> NUMBER NEGATIVE
%token <numstr> NUMSTR "numeric literal"
-%token <number> OVERFLOW
+%token <number> OVERFLOW_kw "OVERFLOW"
%token <computational> COMPUTATIONAL
%token <boolean> PERFORM BACKWARD
@@ -997,7 +997,7 @@
DELETE DISPLAY DIVIDE EVALUATE END EOP EXIT FILLER_kw
GOBACK GOTO
INITIALIZE INSPECT
- MERGE MOVE MULTIPLY OPEN OVERFLOW PARAGRAPH PERFORM
+ MERGE MOVE MULTIPLY OPEN OVERFLOW_kw PARAGRAPH PERFORM
READ RELEASE RETURN REWRITE
SEARCH SET SELECT SORT SORT_MERGE
STRING_kw STOP SUBTRACT START
@@ -3306,13 +3306,6 @@ level_name: LEVEL ctx_name
data_descr: data_descr1
{
$$ = current_field($1); // make available for occurs, etc.
- char *env = getenv("symbols_update");
- if( env && env[0] == 'P' ) {
- dbgmsg("parse.y:%d: %-15s %s (%s)", __LINE__,
- cbl_field_type_str($$->type) + 3,
- field_str($$),
- cbl_field_type_str($$->usage) + 3);
- }
}
| error { static cbl_field_t none = {}; $$ = &none; }
;
@@ -9495,7 +9488,7 @@ call_except: EXCEPTION
std::swap($$.on_error, $$.not_error);
}
}
- | OVERFLOW
+ | OVERFLOW_kw
{
$$.not_error = NULL;
$$.on_error = label_add(LblArith,
@@ -9503,7 +9496,7 @@ call_except: EXCEPTION
if( !$$.on_error ) YYERROR;
parser_call_exception( $$.on_error );
- assert( $1 == OVERFLOW || $1 == NOT );
+ assert( $1 == OVERFLOW_kw || $1 == NOT );
if( $1 == NOT ) {
std::swap($$.on_error, $$.not_error);
}
@@ -9758,7 +9751,7 @@ on_overflows: on_overflow[over] statements %prec ADD
}
;
-on_overflow: OVERFLOW
+on_overflow: OVERFLOW_kw
{
$$.not_error = NULL;
$$.on_error = label_add(LblString,
@@ -9766,7 +9759,7 @@ on_overflow: OVERFLOW
if( !$$.on_error ) YYERROR;
parser_string_overflow( $$.on_error );
- assert( $1 == OVERFLOW || $1 == NOT );
+ assert( $1 == OVERFLOW_kw || $1 == NOT );
if( $1 == NOT ) {
std::swap($$.on_error, $$.not_error);
}
@@ -11078,23 +11071,6 @@ void ast_call( const YYLTYPE& loc, cbl_refer_t name, cbl_refer_t returning,
parser_symbol_add(name.field);
}
- if( getenv("ast_call") ) {
- dbgmsg("%s: calling %s returning %s with %zu args:", __func__,
- name_of(name.field),
- (returning.field)? returning.field->name : "[none]",
- narg);
- for( size_t i=0; i < narg; i++ ) {
- const char *crv = "?";
- switch(args[i].crv) {
- case by_default_e: crv = "def"; break;
- case by_reference_e: crv = "ref"; break;
- case by_content_e: crv = "con"; break;
- case by_value_e: crv = "val"; break;
- }
- dbgmsg("%s: %4zu: %s @%p %s", __func__,
- i, crv, args[i].refer.field, args[i].refer.field->name);
- }
- }
parser_call( name, returning, narg, args, except, not_except, is_function );
}
@@ -11403,11 +11379,6 @@ label_add( const YYLTYPE& loc,
assert( !(p->type == LblSection && p->parent > 0) );
- if( getenv(__func__) ) {
- yywarn("%s: added label %3zu %10s for '%s' of %zu", __func__,
- symbol_elem_of(p) - symbols_begin(), p->type_str()+3, p->name, p->parent);
- }
-
return p;
}
@@ -11468,20 +11439,12 @@ paragraph_reference( const char name[], size_t section )
strcpy(label.name, name);
if( label.type == LblNone ) assert(label.parent == 0);
- const symbol_elem_t *last = symbols_end();
-
p = symbol_label_add(PROGRAM, &label);
assert(p);
const char *sect_name = section? cbl_label_of(symbol_at(section))->name : NULL;
procedure_reference_add(sect_name, p->name, yylineno, current.program_section());
- if( getenv(__func__) ) {
- yywarn("%s: %s label %3zu %10s for '%s' of %zu", __func__,
- symbols_end() == last? "added" : "found",
- symbol_index(symbol_elem_of(p)), p->type_str()+3, p->name, p->parent);
- }
-
return p;
}
@@ -11675,10 +11638,6 @@ ast_add( arith_t *arith ) {
pC = use_any(arith->tgts, C);
pA = use_any(arith->A, A);
- if( getenv(__func__) ) {
- dbgmsg("%s:%d: %-12s C{%zu %p} A{%zu %p}", __func__, __LINE__,
- arith->format_str(), nC, pC, nA, pA );
- }
parser_add( nC, pC, nA, pA, arith->format, arith->on_error, arith->not_error );
ec_type_t handled = arith->on_error || arith->not_error ? ec_size_e : ec_none_e;
@@ -11780,9 +11739,6 @@ stringify( refer_collection_t *inputs,
}
assert( inputs->lists.back().marker );
std::copy( inputs->lists.begin(), inputs->lists.end(), sources.begin() );
- if( yydebug && getenv(__func__) ) {
- std::for_each(sources.begin(), sources.end(), stringify_src_t::dump);
- }
parser_string( into, pointer, sources.size(), sources.data(), on_error, not_error );
}
@@ -12227,9 +12183,6 @@ initialize_one( cbl_num_result_t target, bool with_filler,
} else {
parser_move(tgt, src, current_rounded_mode());
}
- if( getenv(__func__) ) {
- yywarn("%s:%-5s: %s", __func__, keyword_str(token), field_str(tgt.field));
- }
return true;
}
@@ -12246,10 +12199,6 @@ initialize_one( cbl_num_result_t target, bool with_filler,
parser_initialize(tgt);
}
}
-
- if( getenv(__func__) ) {
- yywarn("%s: value: %s", __func__, field_str(tgt.field));
- }
}
// apply REPLACING, possibly overwriting VALUE
@@ -12262,75 +12211,15 @@ initialize_one( cbl_num_result_t target, bool with_filler,
if( r != replacements.end() ) {
parser_move( tgt, *r->second );
- if( getenv(__func__) ) {
- cbl_field_t *from = r->second->field;
- char from_str[128]; // copy static buffer from field_str
- strcpy( from_str, field_str(from) );
- yywarn("%s: move: %-18s %s \n\t from %-18s %s", __func__,
- cbl_field_type_str(tgt.field->type) + 3, field_str(tgt.field),
- cbl_field_type_str(from->type) + 3, from_str);
- }
return true;
}
return true;
-
}
typedef std::pair<cbl_field_t*,cbl_field_t*> field_span_t;
typedef std::pair<size_t, size_t> cbl_bytespan_t;
-static void
-dump_spans( size_t isym,
- const cbl_field_t *table,
- const std::list<field_span_t>& spans,
- size_t nrange,
- const cbl_bytespan_t ranges[],
- size_t depth,
- const std::list<cbl_subtable_t>& subtables )
-{
- int i=0;
- assert( nrange == 0 || nrange == spans.size() );
-
- if( isym != field_index(table) ) {
- dbgmsg("%s:%d: isym %zu is not #%zu %02u %s", __func__, __LINE__,
- isym, field_index(table), table->level, table->name);
- }
- dbgmsg( "%s: [%zu] #%zu %s has %zu spans and %zu subtables",
- __func__, depth, isym, table->name, nrange, subtables.size() );
- for( auto span : spans ) {
- unsigned int last_level = 0;
- const char *last_name = "<none>";
- if( span.second ) {
- last_level = span.second->level;
- last_name = span.second->name;
- }
-
- char at_subtable[64] = {};
- size_t offset = nrange? ranges[i].first : 0;
- auto p = std::find_if(subtables.begin(), subtables.end(),
- [offset]( const cbl_subtable_t& tbl ) {
- return tbl.offset == offset;
- });
- if( p != subtables.end() ) {
- sprintf(at_subtable, "(subtable #%zu)", p->isym);
- }
- dbgmsg("\t %02u %-20s to %02u %-20s: %3zu-%zu %s",
- span.first->level, span.first->name,
- last_level, last_name,
- nrange? ranges[i].first : 1,
- nrange? ranges[i].second : 0,
- at_subtable);
- i++;
- }
- if( ! subtables.empty() ) {
- dbgmsg("\ttable #%zu has %zu subtables", isym, subtables.size());
- for( auto tbl : subtables ) {
- dbgmsg("\t #%zu @ %4zu", tbl.isym, tbl.offset);
- }
- }
-}
-
/*
* After the 1st record is initialized, copy it to the others.
*/
@@ -12339,9 +12228,6 @@ initialize_table( cbl_num_result_t target,
size_t nspan, const cbl_bytespan_t spans[],
const std::list<cbl_subtable_t>& subtables )
{
- if( getenv("initialize_statement") ) {
- dbgmsg("%s:%d: %s ", __func__, __LINE__, target.refer.str());
- }
assert( target.refer.nsubscript == dimensions(target.refer.field) );
const cbl_refer_t& src( target.refer );
size_t n( src.field->occurs.ntimes());
@@ -12391,12 +12277,6 @@ initialize_statement( const cbl_num_result_t& target, bool with_filler,
const category_map_t& replacements,
size_t depth = 0 )
{
- if( getenv(__func__) ) {
- dbgmsg("%s:%d: %2zu: %s (%s%zuR)",
- __func__, __LINE__, depth, target.refer.str(),
- with_filler? "F" : "",
- replacements.size());
- }
const cbl_refer_t& tgt( target.refer );
assert(dimensions(tgt.field) == tgt.nsubscript || 0 < depth);
assert(!is_literal(tgt.field));
@@ -12480,10 +12360,6 @@ initialize_statement( const cbl_num_result_t& target, bool with_filler,
return std::make_pair(first, second);
} );
}
- if( getenv("initialize_statement") ) {
- dump_spans( field_index(output.refer.field), output.refer.field,
- field_spans, ranges.size(), ranges.data(), depth, subtables );
- }
return initialize_table( output, nrange, ranges.data(), subtables );
}
}
@@ -12550,18 +12426,6 @@ static void
initialize_statement( std::list<cbl_num_result_t>& tgts, bool with_filler,
data_category_t value_category,
const category_map_t& replacements) {
- if( yydebug && getenv(__func__) ) {
- yywarn( "%s: %zu targets, %s filler",
- __func__, tgts.size(), with_filler? "with" : "no");
- for( auto tgt : tgts ) {
- fprintf( stderr, "%28s: %s\n", __func__, name_of(tgt.refer.field) );
- }
- for( const auto& elem : replacements ) {
- fprintf( stderr, "%28s: %s <-%s\n", __func__,
- data_category_str(elem.first),
- name_of(elem.second->field) );
- }
- }
bool is_refmod = std::any_of( tgts.begin(), tgts.end(),
[]( const auto& tgt ) {
diff --git a/gcc/cobol/scan.l b/gcc/cobol/scan.l
index 2cb7d30..e30634d 100644
--- a/gcc/cobol/scan.l
+++ b/gcc/cobol/scan.l
@@ -1543,9 +1543,9 @@ USE({SPC}FOR)? { return USE; }
NOT{SPC}(ON{SPC})?EXCEPTION {
yylval.number = NOT; return EXCEPTION; }
- (ON{SPC})?OVERFLOW { yylval.number = OVERFLOW; return OVERFLOW; }
+ (ON{SPC})?OVERFLOW { yylval.number = OVERFLOW_kw; return OVERFLOW_kw; }
NOT{SPC}(ON{SPC})?OVERFLOW {
- yylval.number = NOT; return OVERFLOW; }
+ yylval.number = NOT; return OVERFLOW_kw; }
(AT{SPC})?END/[[:space:]] { yylval.number = END;
return END; }
@@ -2312,7 +2312,7 @@ BASIS { yy_push_state(basis); return BASIS; }
ORGANIZATION { return ORGANIZATION; }
OTHER { return OTHER; }
OUTPUT { return OUTPUT; }
- OVERFLOW { return OVERFLOW; }
+ OVERFLOW { return OVERFLOW_kw; }
OVERRIDE { return OVERRIDE; }
PACKED-DECIMAL { return PACKED_DECIMAL; }
PAGE { return PAGE; }
diff --git a/gcc/cobol/scan_ante.h b/gcc/cobol/scan_ante.h
index b9bbd30..cfeacfc 100644
--- a/gcc/cobol/scan_ante.h
+++ b/gcc/cobol/scan_ante.h
@@ -694,9 +694,6 @@ tmpstring_append( int len ) {
const char *extant = tmpstring == NULL ? "" : tmpstring;
char *s = xasprintf("%s%.*s", extant, len, yytext);
free(tmpstring);
- if( yy_flex_debug && getenv(__func__) ) {
- yywarn("%s: value is now '%s'", __func__, s);
- }
return tmpstring = s;
}
diff --git a/gcc/cobol/show_parse.h b/gcc/cobol/show_parse.h
index ad26584..9b1abb4 100644
--- a/gcc/cobol/show_parse.h
+++ b/gcc/cobol/show_parse.h
@@ -42,9 +42,6 @@
// SHOW_PARSE must be followed by a bracketed set of instructions, no semicolon
-// This construction isn't really necessary; getenv() apparently runs pretty
-// fast. But using makes compiling a large number of programs just perceptably
-// quicker. So, I am using it; it's cheap.
extern bool bSHOW_PARSE;
extern bool show_parse_sol;
extern int show_parse_indent;
diff --git a/gcc/cobol/symbols.cc b/gcc/cobol/symbols.cc
index 4067459..ddb8e68 100644
--- a/gcc/cobol/symbols.cc
+++ b/gcc/cobol/symbols.cc
@@ -369,12 +369,6 @@ special_pair_cmp( const cbl_special_name_t& key,
const cbl_special_name_t& elem ) {
const bool matched = key.id == elem.id || 0 == strcasecmp(key.name, elem.name);
- if( getenv(__func__) ) {
- dbgmsg("%s:%d: key: id=%2d, %s", __func__, __LINE__, key.id, key.name);
- dbgmsg("%s:%d: elem: id=%2d, %s => %s", __func__, __LINE__,
- elem.id, elem.name, matched? "match" : "no match");
- }
-
return matched;
}
@@ -893,13 +887,6 @@ update_block_offsets( struct symbol_elem_t *block)
uint32_t offset = cbl_field_of(block)->offset;
const uint32_t block_level = cbl_field_of(block)->level;
- if( getenv(__func__) ) {
- cbl_field_t *field = cbl_field_of(block);
- dbgmsg( "%s: offset is %3zu for %2u %-30s #%3zu P%zu",
- __func__, field->offset, field->level, field->name,
- symbol_index(block), field->parent );
- }
-
struct symbol_elem_t *e = block;
for( ++e; e < symbols_end(); e++ ) {
if( e->type != SymField ) {
@@ -929,12 +916,6 @@ update_block_offsets( struct symbol_elem_t *block)
offset += field_memsize(field);
}
- if( getenv(__func__) ) {
- dbgmsg( "%s: offset is %3zu for %2u %-30s #%3zu P%zu",
- __func__, field->offset, field->level, field->name,
- symbol_index(e), field->parent );
- }
-
if( field->type == FldGroup ) {
e = update_block_offsets(e) - 1;
}
@@ -1051,7 +1032,6 @@ symbol_find_odo_debug( cbl_field_t * field ) {
// Return OCCURS DEPENDING ON table subordinate to field, if any.
struct cbl_field_t *
symbol_find_odo( cbl_field_t * field ) {
- if( getenv(__func__) ) return symbol_find_odo_debug(field);
size_t bog = field_index(field), eog = end_of_group(bog);
auto e = std::find_if( symbol_at(bog), symbol_at_impl(eog, true), has_odo );
return e == symbol_at_impl(eog, true)? NULL : cbl_field_of(e);
@@ -1288,10 +1268,6 @@ static struct symbol_elem_t *
// Print accumulating details for one group to debug log.
bool details = false;
- if( yydebug ) {
- const auto details_for = getenv("symbols_update");
- details = details_for && 0 == strcasecmp(details_for, group->name);
- }
// At end of group, members is a list of all immediate children, any
// of which might have been redefined and so acquired a memsize.
@@ -1363,23 +1339,6 @@ verify_block( const struct symbol_elem_t *block,
if( e->type != SymField ) {
continue;
}
- const struct cbl_field_t *field = cbl_field_of(e);
-
- if( getenv(__func__) ) {
- if( e == block ) {
- static const char ds[] = "--------------------------------";
- dbgmsg( "%17s %-3s %-3s %-18s %-3s %3s %-16s C/D/R = init\n"
- "%.25s %-.3s %-.3s %-.18s %-.3s %.3s %-.16s %-.7s %-.16s",
- "", "ndx", "off", "type", "par", "lvl", "name",
- ds, ds, ds, ds, ds, ds, ds, ds, ds );
- }
- dbgmsg( "%s:%d: %3zu %3zu %-18s %3zu %02d %-16s %2u/%u/%d = '%s'",
- __func__, __LINE__, e - symbols.elems, field->offset,
- cbl_field_type_str(field->type),
- field->parent, field->level, field->name,
- field->data.capacity, field->data.digits, field->data.rdigits,
- field->data.initial? field->data.initial : "(none)" );
- }
}
}
@@ -1694,6 +1653,9 @@ operator<<( std::ostream& os, const cbl_occurs_bounds_t& bound ) {
return os << bound.lower << ',' << bound.upper;
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+// Keep this debugging function around for when it is needed
static std::ostream&
operator<<( std::ostream& os, const cbl_field_data_t& field ) {
return os << field.memsize << ','
@@ -1717,16 +1679,7 @@ operator<<( std::ostream& os, const cbl_field_t& field ) {
<< ',' << field.line
<< ',' << field.data;
}
-
-static void
-write_field_csv( size_t isym, const cbl_field_t *field ) {
- static std::ofstream os( getenv("GCOBOL_DATA") );
- assert(os.is_open());
-
- if( symbols.first_program < isym) {
- os << isym << "," << *field << std::endl;
- }
-}
+#pragma GCC diagnostic pop
static std::map<size_t, std::set<size_t>> same_record_areas;
size_t parse_error_count();
@@ -1747,11 +1700,6 @@ symbols_update( size_t first, bool parsed_ok ) {
struct symbol_elem_t *p, *pend;
std::list<cbl_field_t*> shared_record_areas;
- if( getenv(__func__) ) {
- fprintf(stderr, "Initial");
- symbols_dump(std::max(first, symbols.first_program), true);
- }
-
for( p = symbols_begin(first); p < symbols_end(); p++ ) {
if( p->type == SymAlphabet ) continue; // Alphabets already processed.
@@ -1796,10 +1744,6 @@ symbols_update( size_t first, bool parsed_ok ) {
// no special processing for other levels
}
- if( getenv("GCOBOL_DATA") ) {
- write_field_csv( p - symbols_begin(), field );
- }
-
// Update ODO field in situ.
if( is_table(field) ) {
size_t& odo = field->occurs.depending_on;
@@ -1869,11 +1813,6 @@ symbols_update( size_t first, bool parsed_ok ) {
assert( !(field->data.memsize > 0 && symbol_explicitly_redefines(field)) );
}
- if( getenv(__func__) ) {
- fprintf(stderr, "Pre");
- symbols_dump(std::max(first, symbols.first_program), true);
- }
-
// A shared record area has no 01 child because that child redefines its parent.
for( auto sharer : shared_record_areas ) {
auto redefined = cbl_field_of(symbol_at(sharer->parent));
@@ -2391,8 +2330,6 @@ symbol_table_init(void) {
symbols.registers.return_code = symbol_index(symbol_field(0,0, "RETURN-CODE"));
symbols.registers.very_true = symbol_index(symbol_field(0,0, "_VERY_TRUE"));
symbols.registers.very_false = symbol_index(symbol_field(0,0, "_VERY_FALSE"));
-
- if( getenv(__func__) ) symbols_dump(0, true);
}
/*
@@ -2589,26 +2526,6 @@ symbol_field_add( size_t program, struct cbl_field_t *field )
}
}
- char *s;
- if( (s = getenv(__func__)) != NULL ) {
- if( s[0] == 'D' ) {
- for( struct symbol_elem_t *e = symbols_begin(); e < symbols_end(); e++ ) {
- fprintf(stderr, "%zu: %s ", e - symbols.elems, symbol_type_str(e->type));
- if( e->type == SymField ) {
- fprintf(stderr, "%s = %s",
- cbl_field_of(e)->name, cbl_field_of(e)->data.initial);
- }
- fprintf(stderr, "\n");
- }
- }
-
- dbgmsg( "%s:%d: %3zu %-18s %02d %-16s %u/%u/%d = '%s'", __func__, __LINE__,
- field->offset,
- cbl_field_type_str(field->type), field->level, field->name,
- field->data.capacity, field->data.digits, field->data.rdigits,
- field->data.initial? field->data.initial : "(none)" );
- }
-
if( is_forward(field) ) {
auto *e = symbol_field( program, field->parent, field->name );
if( e ) {
@@ -3120,12 +3037,6 @@ symbol_file_record_sizes( struct cbl_file_t *file ) {
output.min = cbl_field_of(&*p.first)->data.capacity;
output.max = cbl_field_of(&*p.second)->data.capacity;
- if( yydebug && getenv(__func__) ) {
- dbgmsg("%s: %s: min '%s' %zu, max '%s' %zu", __func__, file->name,
- cbl_field_of(&*p.first)->name, output.min,
- cbl_field_of(&*p.second)->name, output.max);
- }
-
assert(output.min > 0 && "min record size is 0");
assert(output.min <= output.max);
@@ -3304,10 +3215,6 @@ new_temporary_impl( enum cbl_field_type_t type )
snprintf(f->name, sizeof(f->name), "_literal%d",++nliteral);
} else {
snprintf(f->name, sizeof(f->name), "_stack%d",++nstack);
-
- if( getenv("symbol_temporaries_free") ) {
- dbgmsg("%s: %s, %s", __func__, f->name, 3 + cbl_field_type_str(f->type));
- }
}
return f;
@@ -3400,14 +3307,6 @@ temporaries_t::dump() const {
}
temporaries_t::~temporaries_t() {
- if( getenv( "symbol_temporaries_free" ) ) {
- dbgmsg("%s: %zu literals", __func__, literals.size());
- for( const auto& elem : literals ) {
- const literal_an& key(elem.first);
- fprintf(stderr, "%c '%s'\n", key.is_quoted? 'Q' : ' ', key.value.c_str());
- }
- dump();
- }
}
cbl_field_t *
@@ -3451,7 +3350,6 @@ temporaries_t::acquire( cbl_field_type_t type ) {
void
symbol_temporaries_free() {
- if( getenv(__func__) ) temporaries.dump();
for( auto& elem : temporaries.used ) {
const cbl_field_type_t& type(elem.first);
temporaries_t::fieldset_t& used(elem.second);
@@ -3599,9 +3497,6 @@ cbl_field_t::internalize() {
yywarn("failed iconv_open tocode = '%s' fromcode = %s", tocode, fromcode);
}
- // Sat Mar 16 11:45:08 2024: require temporary environment for testing
- if( getenv( "INTERNALIZE_NO") ) return data.initial;
-
bool using_assumed = fromcode == os_locale.assumed;
if( fromcode == tocode || has_attr(hex_encoded_e) ) {
@@ -3649,16 +3544,6 @@ cbl_field_t::internalize() {
if( 0 != memcmp(data.initial, output.data(), out - output.data()) ) {
assert(out <= output.data() + data.capacity);
- if( getenv(__func__) ) {
- const char *eoi = data.initial + data.capacity, *p;
- char nullitude[64] = "no null";
- if( (p = std::find(data.initial, eoi, '\0')) != eoi ) {
- sprintf(nullitude, "NUL @ %zu", p - data.initial);
- }
- dbgmsg("%s:%d: before: %-15s %-20s: '%.*s'{%u}, %s", __func__, __LINE__,
- 3 + cbl_field_type_str(type), name,
- data.capacity, data.initial, data.capacity, nullitude);
- }
dbgmsg("%s: converted '%.*s' to %s",
__func__, data.capacity, data.initial, tocode);
@@ -3677,18 +3562,6 @@ cbl_field_t::internalize() {
free(const_cast<char*>(data.initial));
data.initial = mem;
-
- if( getenv(__func__) ) {
- const char *eoi = data.initial + data.capacity, *p;
- char nullitude[64] = "no null";
- if( (p = std::find(data.initial, eoi, '\0')) != eoi ) {
- sprintf(nullitude, "NUL @ %zu", p - data.initial);
- }
- dbgmsg("%s:%d: after: %-15s %-20s: '%.*s'{%u}, %s", __func__, __LINE__,
- "", name,
- data.capacity, data.initial, data.capacity, nullitude);
- }
-
}
return data.initial;
@@ -3808,37 +3681,14 @@ common_callables_update( const size_t iprog ) {
cbl_label_t *
symbol_label_add( size_t program, cbl_label_t *input )
{
- if( getenv(__func__) ) {
- const cbl_label_t *L = input;
- dbgmsg( "%s:%d: %-5s #%3zu %-9s '%s' of '%s' at line %d", __func__, __LINE__,
- "input",
- size_t(0),
- L->type_str()+3,
- L->name,
- L->parent? cbl_label_of(symbol_at(L->parent))->name : "",
- L->line );
- }
-
cbl_label_t *label = symbol_label(program, input->type,
input->parent, input->name);
if( label && label->type == LblNone ) {
- const char *verb = "set";
label->type = input->type;
label->parent = input->parent;
label->line = input->line;
- if( getenv(__func__) ) {
- const cbl_label_t *L = label;
- dbgmsg( "%s:%d: %-5s #%3zu %-9s '%s' of '%s' at line %d",
- __func__, __LINE__,
- verb,
- symbol_elem_of(L) - symbols_begin(),
- L->type_str()+3,
- L->name,
- L->parent? cbl_label_of(symbol_at(L->parent))->name : "",
- L->line );
- }
return label;
}
@@ -3864,15 +3714,6 @@ symbol_label_add( size_t program, cbl_label_t *input )
// restore munged line number unless symbol_add returned an existing label
if( e->elem.label.line < 0 ) e->elem.label.line = -e->elem.label.line;
- if( getenv(__func__) ) {
- const cbl_label_t *L = cbl_label_of(e);
- dbgmsg( "%s:%d: added #%3zu %-9s '%s' of '%s' at line %d", __func__, __LINE__,
- e - symbols_begin(),
- L->type_str()+3,
- L->name,
- L->parent? cbl_label_of(symbol_at(L->parent))->name : "",
- L->line );
- }
symbols.labelmap_add(e);
return cbl_label_of(e);
}
@@ -3965,11 +3806,6 @@ symbol_special_add( size_t program, struct cbl_special_name_t *special )
struct symbol_elem_t *e = symbol_special(program, special->name);
if( e ) {
- cbl_special_name_t *s = cbl_special_name_of(e);
- if( getenv(__func__) ) {
- dbgmsg("%s:%d matches %s %d (%s)", __func__, __LINE__,
- special->name, int(s->id), s->name);
- }
return e;
}
assert(e == NULL);
@@ -3980,11 +3816,6 @@ symbol_special_add( size_t program, struct cbl_special_name_t *special )
cbl_errx( "%s:%d: could not add '%s'", __func__, __LINE__, special->name);
}
- if( getenv(__func__) ) {
- dbgmsg( "%s:%d: added special '%s'", __func__, __LINE__,
- e->elem.special.name);
- }
-
elem_key_t key(program, cbl_special_name_of(e)->name);
symbols.specials[key] = symbol_index(e);
diff --git a/gcc/cobol/symfind.cc b/gcc/cobol/symfind.cc
index 8995715..8c5f4af 100644
--- a/gcc/cobol/symfind.cc
+++ b/gcc/cobol/symfind.cc
@@ -200,12 +200,6 @@ field_structure( symbol_elem_t& sym ) {
static const symbol_map_t::value_type
none( symbol_map_t::key_type( 0, "", 0 ), std::vector<size_t>() );
- if( getenv(__func__) && sym.type == SymField ) {
- const auto& field = *cbl_field_of(&sym);
- dbgmsg("%s: #%zu %s: '%s' is_data_field: %s", __func__,
- symbol_index(&sym), cbl_field_type_str(field.type), field.name,
- is_data_field(sym)? "yes" : "no" );
- }
if( !is_data_field(sym) ) return none;
cbl_field_t *field = cbl_field_of(&sym);
@@ -233,12 +227,6 @@ field_structure( symbol_elem_t& sym ) {
}
}
- if( getenv(__func__) && yydebug ) {
- dbgmsg( "%s:%d: '%s' has %zu ancestors", __func__, __LINE__,
- elem.first.c_str(), elem.second.size() );
- dump_symbol_map_value(__func__, elem);
- }
-
return elem;
}
@@ -270,12 +258,6 @@ build_symbol_map() {
if( yydebug ) {
dbgmsg( "%s:%d: %zu of %zu symbols inserted into %zu in symbol_map",
__func__, __LINE__, nsym, end, symbol_map.size() );
-
- if( getenv(__func__) ) {
- for( const auto& elem : symbol_map ) {
- dump_symbol_map_value1(elem);
- }
- }
}
}
@@ -291,9 +273,6 @@ public:
is_name( const char *name ) : name(name) {}
bool operator()( symbol_map_t::value_type& elem ) {
const bool tf = elem.first == name;
- if( tf && getenv("is_name") ) {
- dump_key( "matched", elem.first );
- }
return tf;
}
protected:
@@ -587,12 +566,6 @@ symbol_elem_t *
symbol_find_of( size_t program, std::list<const char *> names, size_t group ) {
symbol_map_t input = symbol_match(program, names);
- if( getenv(__func__) && input.size() != 1 ) {
- dbgmsg( "%s:%d: '%s' has %zu candidates for group %zu",
- __func__, __LINE__, names.back(), input.size(), group );
- std::for_each( input.begin(), input.end(), dump_symbol_map_value1 );
- }
-
symbol_map_t items;
std::copy_if( input.begin(), input.end(),
std::inserter(items, items.begin()), in_group(group) );
diff --git a/gcc/cobol/token_names.h b/gcc/cobol/token_names.h
index a082078..d1e3b5d 100644
--- a/gcc/cobol/token_names.h
+++ b/gcc/cobol/token_names.h
@@ -49,7 +49,7 @@ tokens = {
{ "number", NUMBER }, // 302
{ "negative", NEGATIVE }, // 303
{ "numstr", NUMSTR }, // 304
- { "overflow", OVERFLOW }, // 305
+ { "overflow", OVERFLOW_kw }, // 305
{ "computational", COMPUTATIONAL }, // 306
{ "perform", PERFORM }, // 307
{ "backward", BACKWARD }, // 308
diff --git a/gcc/cobol/util.cc b/gcc/cobol/util.cc
index 1c0810b..f28fddf 100644
--- a/gcc/cobol/util.cc
+++ b/gcc/cobol/util.cc
@@ -1172,12 +1172,6 @@ valid_move( const struct cbl_field_t *tgt, const struct cbl_field_t *src )
}
}
- if( yydebug && getenv(__func__) ) {
- dbgmsg("%s:%d: ok to move %s to %s (0x%02x)", __func__, __LINE__,
- cbl_field_type_str(src->type), cbl_field_type_str(tgt->type),
- retval);
- }
-
return retval;
}
@@ -1443,15 +1437,6 @@ locally_unique( size_t program, const procdef_t& key, const procref_t& ref ) {
const char *section_name = ref.has_section()? ref.section() : key.section();
procref_base_t full_ref(section_name, ref.paragraph());
- if( getenv(__func__) ) {
- dbgmsg("%s: %zu for ref %s of '%s' (line %d) "
- "in %s of '%s' (as %s of '%s')", __func__,
- procedures.count(full_ref),
- ref.paragraph(), ref.section(), ref.line_number(),
- key.paragraph(), key.section(),
- full_ref.paragraph(), full_ref.section() );
- }
-
return 1 == procedures.count(full_ref);
}
@@ -1473,9 +1458,6 @@ procedure_definition_add( size_t program, const cbl_label_t *procedure ) {
}
procdef_t key( section_name, paragraph_name, isym );
- if( getenv(__func__) ) {
- dbgmsg("%s: #%3zu %s of %s", __func__, isym, paragraph_name, section_name);
- }
current_procedure =
programs[program].insert( make_pair(key, procedures_t::mapped_type()) );
}
@@ -1485,9 +1467,6 @@ void
procedure_reference_add( const char *section, const char *paragraph,
int line, size_t context )
{
- if( getenv(__func__) ) {
- dbgmsg("%s: line %3d %s of %s", __func__, line, paragraph, section);
- }
current_procedure->second.push_back( procref_t(section, paragraph,
line, context) );
}
@@ -1518,7 +1497,7 @@ ambiguous_reference( size_t program ) {
ambiguous = find_if_not( proc.second.begin(), proc.second.end(),
is_unique(program, proc.first) );
if( proc.second.end() != ambiguous ) {
- if( yydebug || getenv("symbol_label_add")) {
+ if( yydebug ) {
dbgmsg("%s: %s of '%s' has %zu potential matches", __func__,
ambiguous->paragraph(), ambiguous->section(),
procedures.count(*ambiguous));
@@ -1842,10 +1821,6 @@ bool cobol_filename( const char *name, ino_t inode ) {
input_filename_vestige = name;
bool pushed = input_filenames.push( input_file_t(name, inode, 1, lines) );
input_filenames.top().lineno = yylineno = 1;
- if( getenv(__func__) ) {
- dbgmsg(" saving %s with lineno as %d",
- input_filenames.top().name, input_filenames.top().lineno);
- }
return pushed;
}
@@ -1854,9 +1829,6 @@ cobol_lineno_save() {
if( input_filenames.empty() ) return NULL;
auto& input( input_filenames.top() );
input.lineno = yylineno;
- if( getenv(__func__) ) {
- dbgmsg(" setting %s with lineno as %d", input.name, input.lineno);
- }
return input.name;
}
@@ -1880,9 +1852,6 @@ cobol_filename_restore() {
input.lines = linemap_add(line_table, LC_LEAVE, sysp, NULL, 0);
yylineno = input.lineno;
- if( getenv("cobol_filename") ) {
- dbgmsg("restoring %s with lineno to %d", input.name, input.lineno);
- }
return input.name;
}
@@ -2118,8 +2087,6 @@ cobol_fileline_set( const char line[] ) {
input_file_t input_file( filename, ino_t(0), fileline ); // constructor sets inode
- if( getenv(__func__) ) return filename; // ignore #line directive
-
if( input_filenames.empty() ) {
input_file.lines = linemap_add(line_table, LC_ENTER, sysp, filename, 1);
input_filenames.push(input_file);
@@ -2132,20 +2099,20 @@ cobol_fileline_set( const char line[] ) {
return file.name;
}
-class timespec_t {
+class cbl_timespec {
struct timespec now;
public:
- timespec_t() {
+ cbl_timespec() {
clock_gettime(CLOCK_MONOTONIC, &now);
}
double ns() const {
return now.tv_sec * 1000000000 + now.tv_nsec;
}
- friend double operator-( const timespec_t& now, const timespec_t& then );
+ friend double operator-( const cbl_timespec& now, const cbl_timespec& then );
};
double
-operator-( const timespec_t& then, const timespec_t& now ) {
+operator-( const cbl_timespec& then, const cbl_timespec& now ) {
return (now.ns() - then.ns()) / 1000000000;
}
@@ -2158,11 +2125,11 @@ parse_file( const char filename[] )
parser_enter_file(filename);
- timespec_t start;
+ cbl_timespec start;
int erc = yyparse();
- timespec_t finish;
+ cbl_timespec finish;
double dt = finish - start;
parser_leave_file();
diff --git a/gcc/combine.cc b/gcc/combine.cc
index 5f08518..873c2bd 100644
--- a/gcc/combine.cc
+++ b/gcc/combine.cc
@@ -815,7 +815,7 @@ do_SUBST_LINK (struct insn_link **into, struct insn_link *newval)
#define SUBST_LINK(oldval, newval) do_SUBST_LINK (&oldval, newval)
/* Subroutine of try_combine. Determine whether the replacement patterns
- NEWPAT, NEWI2PAT and NEWOTHERPAT are cheaper according to insn_cost
+ NEWPAT, NEWI2PAT and NEWOTHERPAT are more expensive according to insn_cost
than the original sequence I0, I1, I2, I3 and undobuf.other_insn. Note
that I0, I1 and/or NEWI2PAT may be NULL_RTX. Similarly, NEWOTHERPAT and
undobuf.other_insn may also both be NULL_RTX. Return false if the cost
@@ -4129,8 +4129,8 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
}
}
- /* Only allow this combination if insn_cost reports that the
- replacement instructions are cheaper than the originals. */
+ /* Reject this combination if insn_cost reports that the replacement
+ instructions are more expensive than the originals. */
if (!combine_validate_cost (i0, i1, i2, i3, newpat, newi2pat, other_pat))
{
undo_all ();
@@ -5280,6 +5280,12 @@ find_split_point (rtx *loc, rtx_insn *insn, bool set_src)
SUBST (XEXP (x, 0), XEXP (x, 1));
SUBST (XEXP (x, 1), tem);
}
+ /* Many targets have a `(and (not X) Y)` and/or `(ior (not X) Y)` instructions.
+ Split at that insns. However if this is
+ the SET_SRC, we likely do not have such an instruction and it's
+ worthless to try this split. */
+ if (!set_src && GET_CODE (XEXP (x, 0)) == NOT)
+ return loc;
break;
case PLUS:
diff --git a/gcc/common.opt b/gcc/common.opt
index 2c8fdde..88d987e 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2116,6 +2116,10 @@ fipa-modref
Common Var(flag_ipa_modref) Optimization
Perform interprocedural modref analysis.
+fipa-reorder-for-locality
+Common Var(flag_ipa_reorder_for_locality) Init(0) Optimization
+Perform reordering and cloning of functions to maximize locality.
+
fipa-profile
Common Var(flag_ipa_profile) Init(0) Optimization
Perform interprocedural profile propagation.
@@ -2275,6 +2279,9 @@ Enum
Name(lto_partition_model) Type(enum lto_partition_model) UnknownError(unknown LTO partitioning model %qs)
EnumValue
+Enum(lto_partition_model) String(default) Value(LTO_PARTITION_DEFAULT)
+
+EnumValue
Enum(lto_partition_model) String(none) Value(LTO_PARTITION_NONE)
EnumValue
@@ -2293,7 +2300,7 @@ EnumValue
Enum(lto_partition_model) String(cache) Value(LTO_PARTITION_CACHE)
flto-partition=
-Common Joined RejectNegative Enum(lto_partition_model) Var(flag_lto_partition) Init(LTO_PARTITION_BALANCED)
+Common Joined RejectNegative Enum(lto_partition_model) Var(flag_lto_partition) Init(LTO_PARTITION_DEFAULT)
Specify the algorithm to partition symbols and vars at linktime.
; The initial value of -1 comes from Z_DEFAULT_COMPRESSION in zlib.h.
diff --git a/gcc/common.opt.urls b/gcc/common.opt.urls
index 860ebd0..0077511 100644
--- a/gcc/common.opt.urls
+++ b/gcc/common.opt.urls
@@ -31,8 +31,9 @@ UrlSuffix(gcc/Optimize-Options.html#index-Og)
Oz
UrlSuffix(gcc/Optimize-Options.html#index-Oz)
-Q
-UrlSuffix(gcc/Developer-Options.html#index-Q)
+; skipping UrlSuffix for 'Q' due to multiple URLs:
+; duplicate: 'gcc/Developer-Options.html#index-Q-1'
+; duplicate: 'gcc/Overall-Options.html#index-Q'
Qn
UrlSuffix(gcc/System-V-Options.html#index-Qn)
@@ -868,6 +869,9 @@ UrlSuffix(gcc/Optimize-Options.html#index-fipa-bit-cp)
fipa-modref
UrlSuffix(gcc/Optimize-Options.html#index-fipa-modref)
+fipa-reorder-for-locality
+UrlSuffix(gcc/Optimize-Options.html#index-fipa-reorder-for-locality)
+
fipa-profile
UrlSuffix(gcc/Optimize-Options.html#index-fipa-profile)
@@ -1459,6 +1463,9 @@ UrlSuffix(gcc/Optimize-Options.html#index-ftree-coalesce-vars)
ftree-copy-prop
UrlSuffix(gcc/Optimize-Options.html#index-ftree-copy-prop)
+ftree-cselim
+UrlSuffix(gcc/Optimize-Options.html#index-ftree-cselim)
+
ftree-switch-conversion
UrlSuffix(gcc/Optimize-Options.html#index-ftree-switch-conversion)
diff --git a/gcc/common/config/s390/s390-common.cc b/gcc/common/config/s390/s390-common.cc
index 4b0691d..8a147d7 100644
--- a/gcc/common/config/s390/s390-common.cc
+++ b/gcc/common/config/s390/s390-common.cc
@@ -54,10 +54,10 @@ EXPORTED_CONST int processor_flags_table[] =
| PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
| PF_Z13 | PF_VX | PF_VXE | PF_Z14 | PF_VXE2 | PF_Z15
| PF_NNPA | PF_Z16,
- /* arch15 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
+ /* z17 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
| PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
| PF_Z13 | PF_VX | PF_VXE | PF_Z14 | PF_VXE2 | PF_Z15
- | PF_NNPA | PF_Z16 | PF_VXE3 | PF_ARCH15
+ | PF_NNPA | PF_Z16 | PF_VXE3 | PF_Z17
};
/* Change optimizations to be performed, depending on the
diff --git a/gcc/config.gcc b/gcc/config.gcc
index f7f2002..d98df88 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2540,6 +2540,20 @@ riscv*-*-linux*)
gcc_cv_initfini_array=yes
with_tls=${with_tls:-trad}
;;
+riscv*-*-gnu*)
+ tm_file="elfos.h gnu-user.h gnu.h glibc-stdint.h ${tm_file} riscv/gnu.h"
+ tmake_file="${tmake_file} riscv/t-riscv"
+ gnu_ld=yes
+ gas=yes
+ case $target in
+ riscv32be-*|riscv64be-*)
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+ ;;
+ esac
+ # Force .init_array support. The configure script cannot always
+ # automatically detect that GAS supports it, yet we require it.
+ gcc_cv_initfini_array=yes
+ ;;
riscv*-*-elf* | riscv*-*-rtems*)
tm_file="elfos.h newlib-stdint.h ${tm_file} riscv/elf.h"
case ${target} in
@@ -5756,7 +5770,7 @@ case "${target}" in
for which in arch tune; do
eval "val=\$with_$which"
case ${val} in
- "" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | z15 | z16 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 | arch14 | arch15 )
+ "" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | z15 | z16 | z17 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 | arch14 | arch15 )
# OK
;;
*)
diff --git a/gcc/config.in b/gcc/config.in
index 7c89cab..a79c51a 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -2320,6 +2320,13 @@
#endif
+/* Define if personality and ADDR_NO_RANDOMIZE are declared in
+ sys/personality.h. */
+#ifndef USED_FOR_TARGET
+#undef HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE
+#endif
+
+
/* Define which stat syscall is able to handle 64bit indodes. */
#ifndef USED_FOR_TARGET
#undef HOST_STAT_FOR_64BIT_INODES
diff --git a/gcc/config/aarch64/aarch64-sve.md b/gcc/config/aarch64/aarch64-sve.md
index 3dbd659..d4af370 100644
--- a/gcc/config/aarch64/aarch64-sve.md
+++ b/gcc/config/aarch64/aarch64-sve.md
@@ -3133,9 +3133,9 @@
"TARGET_SVE"
{
rtx tmp = gen_reg_rtx (<MODE>mode);
- emit_insn (gen_vcond_mask_<mode><vpred> (tmp, operands[1],
- CONST1_RTX (<MODE>mode),
- CONST0_RTX (<MODE>mode)));
+ emit_insn (gen_vcond_mask_<mode><vpred> (tmp, CONST1_RTX (<MODE>mode),
+ CONST0_RTX (<MODE>mode),
+ operands[1]));
emit_insn (gen_vec_extract<mode><Vel> (operands[0], tmp, operands[2]));
DONE;
}
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 4e80114..433ec97 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -31073,8 +31073,6 @@ aarch64_valid_sysreg_name_p (const char *regname)
const sysreg_t *sysreg = aarch64_lookup_sysreg_map (regname);
if (sysreg == NULL)
return aarch64_is_implem_def_reg (regname);
- if (sysreg->arch_reqs)
- return bool (aarch64_isa_flags & sysreg->arch_reqs);
return true;
}
@@ -31098,8 +31096,6 @@ aarch64_retrieve_sysreg (const char *regname, bool write_p, bool is128op)
if ((write_p && (sysreg->properties & F_REG_READ))
|| (!write_p && (sysreg->properties & F_REG_WRITE)))
return NULL;
- if ((~aarch64_isa_flags & sysreg->arch_reqs) != 0)
- return NULL;
return sysreg->encoding;
}
diff --git a/gcc/config/alpha/alpha.cc b/gcc/config/alpha/alpha.cc
index ba470d9..14e7da5 100644
--- a/gcc/config/alpha/alpha.cc
+++ b/gcc/config/alpha/alpha.cc
@@ -4291,14 +4291,10 @@ alpha_get_mem_rtx_alignment_and_offset (rtx expr, int &a, HOST_WIDE_INT &o)
tree mem = MEM_EXPR (expr);
if (mem != NULL_TREE)
- switch (TREE_CODE (mem))
- {
- case MEM_REF:
- tree_offset = mem_ref_offset (mem).force_shwi ();
- tree_align = get_object_alignment (get_base_address (mem));
- break;
+ {
+ HOST_WIDE_INT comp_offset = 0;
- case COMPONENT_REF:
+ for (; TREE_CODE (mem) == COMPONENT_REF; mem = TREE_OPERAND (mem, 0))
{
tree byte_offset = component_ref_field_offset (mem);
tree bit_offset = DECL_FIELD_BIT_OFFSET (TREE_OPERAND (mem, 1));
@@ -4307,14 +4303,15 @@ alpha_get_mem_rtx_alignment_and_offset (rtx expr, int &a, HOST_WIDE_INT &o)
|| !poly_int_tree_p (byte_offset, &offset)
|| !tree_fits_shwi_p (bit_offset))
break;
- tree_offset = offset + tree_to_shwi (bit_offset) / BITS_PER_UNIT;
+ comp_offset += offset + tree_to_shwi (bit_offset) / BITS_PER_UNIT;
}
- tree_align = get_object_alignment (get_base_address (mem));
- break;
- default:
- break;
- }
+ if (TREE_CODE (mem) == MEM_REF)
+ {
+ tree_offset = comp_offset + mem_ref_offset (mem).force_shwi ();
+ tree_align = get_object_alignment (get_base_address (mem));
+ }
+ }
if (reg_align > mem_align)
{
diff --git a/gcc/config/c6x/c6x.h b/gcc/config/c6x/c6x.h
index e7da250..50bad27 100644
--- a/gcc/config/c6x/c6x.h
+++ b/gcc/config/c6x/c6x.h
@@ -444,11 +444,9 @@ struct GTY(()) machine_function
#define TARG_VEC_PERMUTE_COST 1
#endif
-/* ttype entries (the only interesting data references used) are
- sb-relative got-indirect (aka .ehtype). */
+/* .ehtype ttype entries are sb-relative. */
#define ASM_PREFERRED_EH_DATA_FORMAT(code, data) \
- (((code) == 0 && (data) == 1) ? (DW_EH_PE_datarel | DW_EH_PE_indirect) \
- : DW_EH_PE_absptr)
+ (((code) == 0 && (data) == 1) ? DW_EH_PE_datarel : DW_EH_PE_absptr)
/* This should be the same as the definition in elfos.h, plus the call
to output special unwinding directives. */
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 8c164fd..9b9a3fe 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -504,6 +504,7 @@ extern GTY(()) int darwin_ms_struct;
%{static|static-libgcc|static-libgfortran:%:replace-outfile(-lgfortran libgfortran.a%s)}\
%{static|static-libgcc|static-libquadmath:%:replace-outfile(-lquadmath libquadmath.a%s)}\
%{static|static-libgcc|static-libphobos:%:replace-outfile(-lgphobos libgphobos.a%s)}\
+ %{static|static-libgcc|static-libgcobol:%:replace-outfile(-lgcobol libgcobol.a%s)}\
%{static|static-libgcc|static-libstdc++|static-libgfortran:%:replace-outfile(-lgomp libgomp.a%s)}\
%{static|static-libgcc|static-libstdc++:%:replace-outfile(-lstdc++ libstdc++.a%s)}\
%{static|static-libgm2:%:replace-outfile(-lm2pim libm2pim.a%s)}\
diff --git a/gcc/config/gcn/gcn.md b/gcc/config/gcn/gcn.md
index 695656f..e0fb735 100644
--- a/gcc/config/gcn/gcn.md
+++ b/gcc/config/gcn/gcn.md
@@ -1018,7 +1018,9 @@
[(const_int 0)]
""
{
- sorry ("exception handling not supported");
+ if (!fake_exceptions)
+ sorry ("exception handling not supported");
+ DONE;
})
;; }}}
diff --git a/gcc/config/gcn/gcn.opt b/gcc/config/gcn/gcn.opt
index 142b439..99d6aeb 100644
--- a/gcc/config/gcn/gcn.opt
+++ b/gcc/config/gcn/gcn.opt
@@ -101,3 +101,11 @@ Enum(gcn_preferred_vectorization_factor) String(32) Value(32)
EnumValue
Enum(gcn_preferred_vectorization_factor) String(64) Value(64)
+
+mfake-exceptions
+Target Var(fake_exceptions) Init(0) Undocumented
+; With '-mfake-exceptions' enabled, the user-visible behavior in presence of
+; exception handling constructs changes such that the compile-time
+; 'sorry, unimplemented: exception handling not supported' is skipped, code
+; generation proceeds, and instead, exception handling constructs 'abort' at
+; run time. (..., or don't, if they're in dead code.)
diff --git a/gcc/config/gcn/mkoffload.cc b/gcc/config/gcn/mkoffload.cc
index f5b89c9..b284ff4 100644
--- a/gcc/config/gcn/mkoffload.cc
+++ b/gcc/config/gcn/mkoffload.cc
@@ -1160,6 +1160,9 @@ main (int argc, char **argv)
obstack_ptr_grow (&cc_argv_obstack, "-xlto");
if (fopenmp)
obstack_ptr_grow (&cc_argv_obstack, "-mgomp");
+ /* The host code may contain exception handling constructs.
+ Handle these as good as we can. */
+ obstack_ptr_grow (&cc_argv_obstack, "-mfake-exceptions");
for (int ix = 1; ix != argc; ix++)
{
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index cdfd94d..36f71eb 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -19256,8 +19256,6 @@ ix86_emit_swdivsf (rtx res, rtx a, rtx b, machine_mode mode)
e1 = gen_reg_rtx (mode);
x1 = gen_reg_rtx (mode);
- /* a / b = a * ((rcp(b) + rcp(b)) - (b * rcp(b) * rcp (b))) */
-
b = force_reg (mode, b);
/* x0 = rcp(b) estimate */
@@ -19270,20 +19268,42 @@ ix86_emit_swdivsf (rtx res, rtx a, rtx b, machine_mode mode)
emit_insn (gen_rtx_SET (x0, gen_rtx_UNSPEC (mode, gen_rtvec (1, b),
UNSPEC_RCP)));
- /* e0 = x0 * b */
- emit_insn (gen_rtx_SET (e0, gen_rtx_MULT (mode, x0, b)));
+ unsigned vector_size = GET_MODE_SIZE (mode);
+
+ /* (a - (rcp(b) * a * b)) * rcp(b) + rcp(b) * a
+ N-R step with 2 fma implementation. */
+ if (TARGET_FMA
+ || (TARGET_AVX512F && vector_size == 64)
+ || (TARGET_AVX512VL && (vector_size == 32 || vector_size == 16)))
+ {
+ /* e0 = x0 * a */
+ emit_insn (gen_rtx_SET (e0, gen_rtx_MULT (mode, x0, a)));
+ /* e1 = e0 * b - a */
+ emit_insn (gen_rtx_SET (e1, gen_rtx_FMA (mode, e0, b,
+ gen_rtx_NEG (mode, a))));
+ /* res = - e1 * x0 + e0 */
+ emit_insn (gen_rtx_SET (res, gen_rtx_FMA (mode,
+ gen_rtx_NEG (mode, e1),
+ x0, e0)));
+ }
+ else
+ /* a / b = a * ((rcp(b) + rcp(b)) - (b * rcp(b) * rcp (b))) */
+ {
+ /* e0 = x0 * b */
+ emit_insn (gen_rtx_SET (e0, gen_rtx_MULT (mode, x0, b)));
- /* e0 = x0 * e0 */
- emit_insn (gen_rtx_SET (e0, gen_rtx_MULT (mode, x0, e0)));
+ /* e1 = x0 + x0 */
+ emit_insn (gen_rtx_SET (e1, gen_rtx_PLUS (mode, x0, x0)));
- /* e1 = x0 + x0 */
- emit_insn (gen_rtx_SET (e1, gen_rtx_PLUS (mode, x0, x0)));
+ /* e0 = x0 * e0 */
+ emit_insn (gen_rtx_SET (e0, gen_rtx_MULT (mode, x0, e0)));
- /* x1 = e1 - e0 */
- emit_insn (gen_rtx_SET (x1, gen_rtx_MINUS (mode, e1, e0)));
+ /* x1 = e1 - e0 */
+ emit_insn (gen_rtx_SET (x1, gen_rtx_MINUS (mode, e1, e0)));
- /* res = a * x1 */
- emit_insn (gen_rtx_SET (res, gen_rtx_MULT (mode, a, x1)));
+ /* res = a * x1 */
+ emit_insn (gen_rtx_SET (res, gen_rtx_MULT (mode, a, x1)));
+ }
}
/* Output code to perform a Newton-Rhapson approximation of a
diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index a9fac01..964449f 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -2828,8 +2828,8 @@ ix86_option_override_internal (bool main_args_p,
if (flag_nop_mcount)
error ("%<-mnop-mcount%> is not compatible with this target");
#endif
- if (flag_nop_mcount && flag_pic)
- error ("%<-mnop-mcount%> is not implemented for %<-fPIC%>");
+ if (flag_nop_mcount && flag_pic && !flag_plt)
+ error ("%<-mnop-mcount%> is not implemented for %<-fno-plt%>");
/* Accept -msseregparm only if at least SSE support is enabled. */
if (TARGET_SSEREGPARM_P (opts->x_target_flags)
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 4f8380c4..28603c2 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -100,6 +100,7 @@ along with GCC; see the file COPYING3. If not see
#include "i386-features.h"
#include "function-abi.h"
#include "rtl-error.h"
+#include "gimple-pretty-print.h"
/* This file should be included last. */
#include "target-def.h"
@@ -458,6 +459,9 @@ int ix86_arch_specified;
indirect thunk pushes the return address onto stack, destroying
red-zone.
+ NB: Don't use red-zone for functions with no_caller_saved_registers
+ and 32 GPRs since 128-byte red-zone is too small for 31 GPRs.
+
TODO: If we can reserve the first 2 WORDs, for PUSH and, another
for CALL, in red-zone, we can allow local indirect jumps with
indirect thunk. */
@@ -467,6 +471,9 @@ ix86_using_red_zone (void)
{
return (TARGET_RED_ZONE
&& !TARGET_64BIT_MS_ABI
+ && (!TARGET_APX_EGPR
+ || (cfun->machine->call_saved_registers
+ != TYPE_NO_CALLER_SAVED_REGISTERS))
&& (!cfun->machine->has_local_indirect_jump
|| cfun->machine->indirect_branch_type == indirect_branch_keep));
}
@@ -21810,6 +21817,25 @@ ix86_insn_cost (rtx_insn *insn, bool speed)
return insn_cost + pattern_cost (PATTERN (insn), speed);
}
+/* Return cost of SSE/AVX FP->FP conversion (extensions and truncates). */
+
+static int
+vec_fp_conversion_cost (const struct processor_costs *cost, int size)
+{
+ if (size < 128)
+ return cost->cvtss2sd;
+ else if (size < 256)
+ {
+ if (TARGET_SSE_SPLIT_REGS)
+ return cost->cvtss2sd * size / 64;
+ return cost->cvtss2sd;
+ }
+ if (size < 512)
+ return cost->vcvtps2pd256;
+ else
+ return cost->vcvtps2pd512;
+}
+
/* Compute a (partial) cost for rtx X. Return true if the complete
cost has been computed, and false if subexpressions should be
scanned. In either case, *TOTAL contains the cost result. */
@@ -22473,17 +22499,18 @@ ix86_rtx_costs (rtx x, machine_mode mode, int outer_code_i, int opno,
return false;
case FLOAT_EXTEND:
+ /* x87 represents all values extended to 80bit. */
if (!SSE_FLOAT_MODE_SSEMATH_OR_HFBF_P (mode))
*total = 0;
else
- *total = ix86_vec_cost (mode, cost->addss);
+ *total = vec_fp_conversion_cost (cost, GET_MODE_BITSIZE (mode));
return false;
case FLOAT_TRUNCATE:
if (!SSE_FLOAT_MODE_SSEMATH_OR_HFBF_P (mode))
*total = cost->fadd;
else
- *total = ix86_vec_cost (mode, cost->addss);
+ *total = vec_fp_conversion_cost (cost, GET_MODE_BITSIZE (mode));
return false;
case ABS:
@@ -23158,6 +23185,12 @@ x86_print_call_or_nop (FILE *file, const char *target)
if (flag_nop_mcount || !strcmp (target, "nop"))
/* 5 byte nop: nopl 0(%[re]ax,%[re]ax,1) */
fprintf (file, "1:" ASM_BYTE "0x0f, 0x1f, 0x44, 0x00, 0x00\n");
+ else if (!TARGET_PECOFF && flag_pic)
+ {
+ gcc_assert (flag_plt);
+
+ fprintf (file, "1:\tcall\t%s@PLT\n", target);
+ }
else
fprintf (file, "1:\tcall\t%s\n", target);
}
@@ -23321,7 +23354,7 @@ x86_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED)
break;
case CM_SMALL_PIC:
case CM_MEDIUM_PIC:
- if (!ix86_direct_extern_access)
+ if (!flag_plt)
{
if (ASSEMBLER_DIALECT == ASM_INTEL)
fprintf (file, "1:\tcall\t[QWORD PTR %s@GOTPCREL[rip]]\n",
@@ -23352,7 +23385,9 @@ x86_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED)
"\tleal\t%sP%d@GOTOFF(%%ebx), %%" PROFILE_COUNT_REGISTER "\n",
LPREFIX, labelno);
#endif
- if (ASSEMBLER_DIALECT == ASM_INTEL)
+ if (flag_plt)
+ x86_print_call_or_nop (file, mcount_name);
+ else if (ASSEMBLER_DIALECT == ASM_INTEL)
fprintf (file, "1:\tcall\t[DWORD PTR %s@GOT[ebx]]\n", mcount_name);
else
fprintf (file, "1:\tcall\t*%s@GOT(%%ebx)\n", mcount_name);
@@ -24669,7 +24704,7 @@ ix86_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
switch (type_of_cost)
{
case scalar_stmt:
- return fp ? ix86_cost->addss : COSTS_N_INSNS (1);
+ return fp ? ix86_cost->addss : COSTS_N_INSNS (1);
case scalar_load:
/* load/store costs are relative to register move which is 2. Recompute
@@ -24740,7 +24775,11 @@ ix86_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
return ix86_cost->cond_not_taken_branch_cost;
case vec_perm:
+ return ix86_vec_cost (mode, ix86_cost->sse_op);
+
case vec_promote_demote:
+ if (fp)
+ return vec_fp_conversion_cost (ix86_tune_cost, mode);
return ix86_vec_cost (mode, ix86_cost->sse_op);
case vec_construct:
@@ -25218,6 +25257,32 @@ ix86_vectorize_create_costs (vec_info *vinfo, bool costing_for_scalar)
return new ix86_vector_costs (vinfo, costing_for_scalar);
}
+/* Return cost of statement doing FP conversion. */
+
+static unsigned
+fp_conversion_stmt_cost (machine_mode mode, gimple *stmt, bool scalar_p)
+{
+ int outer_size
+ = tree_to_uhwi
+ (TYPE_SIZE
+ (TREE_TYPE (gimple_assign_lhs (stmt))));
+ int inner_size
+ = tree_to_uhwi
+ (TYPE_SIZE
+ (TREE_TYPE (gimple_assign_rhs1 (stmt))));
+ int stmt_cost = vec_fp_conversion_cost
+ (ix86_tune_cost, GET_MODE_BITSIZE (mode));
+ /* VEC_PACK_TRUNC_EXPR: If inner size is greater than outer size we will end
+ up doing two conversions and packing them. */
+ if (!scalar_p && inner_size > outer_size)
+ {
+ int n = inner_size / outer_size;
+ stmt_cost = stmt_cost * n
+ + (n - 1) * ix86_vec_cost (mode, ix86_cost->sse_op);
+ }
+ return stmt_cost;
+}
+
unsigned
ix86_vector_costs::add_stmt_cost (int count, vect_cost_for_stmt kind,
stmt_vec_info stmt_info, slp_tree node,
@@ -25328,6 +25393,9 @@ ix86_vector_costs::add_stmt_cost (int count, vect_cost_for_stmt kind,
(TREE_TYPE (gimple_assign_lhs (stmt_info->stmt)),
TREE_TYPE (gimple_assign_rhs1 (stmt_info->stmt))))
stmt_cost = 0;
+ else if (fp)
+ stmt_cost = fp_conversion_stmt_cost (mode, stmt_info->stmt,
+ scalar_p);
break;
case BIT_IOR_EXPR:
@@ -25369,6 +25437,10 @@ ix86_vector_costs::add_stmt_cost (int count, vect_cost_for_stmt kind,
break;
}
+ if (kind == vec_promote_demote
+ && fp && FLOAT_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt_info->stmt))))
+ stmt_cost = fp_conversion_stmt_cost (mode, stmt_info->stmt, scalar_p);
+
/* If we do elementwise loads into a vector then we are bound by
latency and execution resources for the many scalar loads
(AGU and load ports). Try to account for this by scaling the
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 8507243..18aa42d 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -207,6 +207,12 @@ struct processor_costs {
const int divsd; /* cost of DIVSD instructions. */
const int sqrtss; /* cost of SQRTSS instructions. */
const int sqrtsd; /* cost of SQRTSD instructions. */
+ const int cvtss2sd; /* cost SSE FP conversions,
+ such as CVTSS2SD. */
+ const int vcvtps2pd256; /* cost 256bit packed FP conversions,
+ such as VCVTPD2PS with larger reg in ymm. */
+ const int vcvtps2pd512; /* cost 512bit packed FP conversions,
+ such as VCVTPD2PS with larger reg in zmm. */
const int reassoc_int, reassoc_fp, reassoc_vec_int, reassoc_vec_fp;
/* Specify reassociation width for integer,
fp, vector integer and vector fp
diff --git a/gcc/config/i386/x86-tune-costs.h b/gcc/config/i386/x86-tune-costs.h
index 7c8cb73..cddcf61 100644
--- a/gcc/config/i386/x86-tune-costs.h
+++ b/gcc/config/i386/x86-tune-costs.h
@@ -121,16 +121,19 @@ struct processor_costs ix86_size_cost = {/* costs for tuning for size */
COSTS_N_BYTES (2), /* cost of FCHS instruction. */
COSTS_N_BYTES (2), /* cost of FSQRT instruction. */
- COSTS_N_BYTES (2), /* cost of cheap SSE instruction. */
- COSTS_N_BYTES (2), /* cost of ADDSS/SD SUBSS/SD insns. */
- COSTS_N_BYTES (2), /* cost of MULSS instruction. */
- COSTS_N_BYTES (2), /* cost of MULSD instruction. */
- COSTS_N_BYTES (2), /* cost of FMA SS instruction. */
- COSTS_N_BYTES (2), /* cost of FMA SD instruction. */
- COSTS_N_BYTES (2), /* cost of DIVSS instruction. */
- COSTS_N_BYTES (2), /* cost of DIVSD instruction. */
- COSTS_N_BYTES (2), /* cost of SQRTSS instruction. */
- COSTS_N_BYTES (2), /* cost of SQRTSD instruction. */
+ COSTS_N_BYTES (4), /* cost of cheap SSE instruction. */
+ COSTS_N_BYTES (4), /* cost of ADDSS/SD SUBSS/SD insns. */
+ COSTS_N_BYTES (4), /* cost of MULSS instruction. */
+ COSTS_N_BYTES (4), /* cost of MULSD instruction. */
+ COSTS_N_BYTES (4), /* cost of FMA SS instruction. */
+ COSTS_N_BYTES (4), /* cost of FMA SD instruction. */
+ COSTS_N_BYTES (4), /* cost of DIVSS instruction. */
+ COSTS_N_BYTES (4), /* cost of DIVSD instruction. */
+ COSTS_N_BYTES (4), /* cost of SQRTSS instruction. */
+ COSTS_N_BYTES (4), /* cost of SQRTSD instruction. */
+ COSTS_N_BYTES (4), /* cost of CVTSS2SD etc. */
+ COSTS_N_BYTES (4), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_BYTES (6), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
ix86_size_memcpy,
ix86_size_memset,
@@ -243,6 +246,9 @@ struct processor_costs i386_cost = { /* 386 specific costs */
COSTS_N_INSNS (88), /* cost of DIVSD instruction. */
COSTS_N_INSNS (122), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (122), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (27), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (54), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (108), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
i386_memcpy,
i386_memset,
@@ -356,6 +362,9 @@ struct processor_costs i486_cost = { /* 486 specific costs */
COSTS_N_INSNS (74), /* cost of DIVSD instruction. */
COSTS_N_INSNS (83), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (83), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (8), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (16), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (32), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
i486_memcpy,
i486_memset,
@@ -467,6 +476,9 @@ struct processor_costs pentium_cost = {
COSTS_N_INSNS (39), /* cost of DIVSD instruction. */
COSTS_N_INSNS (70), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (70), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (6), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (12), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
pentium_memcpy,
pentium_memset,
@@ -571,6 +583,9 @@ struct processor_costs lakemont_cost = {
COSTS_N_INSNS (60), /* cost of DIVSD instruction. */
COSTS_N_INSNS (31), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (63), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (5), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (10), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (20), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
pentium_memcpy,
pentium_memset,
@@ -690,6 +705,9 @@ struct processor_costs pentiumpro_cost = {
COSTS_N_INSNS (18), /* cost of DIVSD instruction. */
COSTS_N_INSNS (31), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (31), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (6), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (12), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
pentiumpro_memcpy,
pentiumpro_memset,
@@ -800,6 +818,9 @@ struct processor_costs geode_cost = {
COSTS_N_INSNS (47), /* cost of DIVSD instruction. */
COSTS_N_INSNS (54), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (54), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (6), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (12), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (24), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
geode_memcpy,
geode_memset,
@@ -913,6 +934,9 @@ struct processor_costs k6_cost = {
COSTS_N_INSNS (56), /* cost of DIVSD instruction. */
COSTS_N_INSNS (56), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (56), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (2), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (4), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (8), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
k6_memcpy,
k6_memset,
@@ -1027,6 +1051,9 @@ struct processor_costs athlon_cost = {
COSTS_N_INSNS (24), /* cost of DIVSD instruction. */
COSTS_N_INSNS (19), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (19), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (4), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (8), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (16), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
athlon_memcpy,
athlon_memset,
@@ -1150,6 +1177,9 @@ struct processor_costs k8_cost = {
COSTS_N_INSNS (20), /* cost of DIVSD instruction. */
COSTS_N_INSNS (19), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (27), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (4), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (8), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (16), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
k8_memcpy,
k8_memset,
@@ -1281,6 +1311,9 @@ struct processor_costs amdfam10_cost = {
COSTS_N_INSNS (20), /* cost of DIVSD instruction. */
COSTS_N_INSNS (19), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (27), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (4), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (8), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (16), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
amdfam10_memcpy,
amdfam10_memset,
@@ -1405,6 +1438,9 @@ const struct processor_costs bdver_cost = {
COSTS_N_INSNS (27), /* cost of DIVSD instruction. */
COSTS_N_INSNS (15), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (26), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (4), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (7), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (14), /* cost of 512bit VCVTPS2PD etc. */
1, 2, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
bdver_memcpy,
bdver_memset,
@@ -1553,6 +1589,10 @@ struct processor_costs znver1_cost = {
COSTS_N_INSNS (13), /* cost of DIVSD instruction. */
COSTS_N_INSNS (10), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (15), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ /* Real latency is 4, but for split regs multiply cost of half op by 2. */
+ COSTS_N_INSNS (6), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (12), /* cost of 512bit VCVTPS2PD etc. */
/* 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
@@ -1712,6 +1752,9 @@ struct processor_costs znver2_cost = {
COSTS_N_INSNS (13), /* cost of DIVSD instruction. */
COSTS_N_INSNS (10), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (15), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (5), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (10), /* cost of 512bit VCVTPS2PD etc. */
/* 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.
@@ -1847,6 +1890,9 @@ struct processor_costs znver3_cost = {
COSTS_N_INSNS (13), /* cost of DIVSD instruction. */
COSTS_N_INSNS (10), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (15), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (5), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (10), /* cost of 512bit VCVTPS2PD etc. */
/* 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.
@@ -1984,6 +2030,10 @@ struct processor_costs znver4_cost = {
COSTS_N_INSNS (13), /* cost of DIVSD instruction. */
COSTS_N_INSNS (15), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (21), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (5), /* cost of 256bit VCVTPS2PD etc. */
+ /* Real latency is 6, but for split regs multiply cost of half op by 2. */
+ COSTS_N_INSNS (10), /* cost of 512bit VCVTPS2PD etc. */
/* 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.
@@ -2120,7 +2170,7 @@ struct processor_costs znver5_cost = {
COSTS_N_INSNS (1), /* cost of cheap SSE instruction. */
/* ADDSS has throughput 2 and latency 2
(in some cases when source is another addition). */
- COSTS_N_INSNS (2), /* cost of ADDSS/SD SUBSS/SD insns. */
+ COSTS_N_INSNS (3), /* cost of ADDSS/SD SUBSS/SD insns. */
/* MULSS has throughput 2 and latency 3. */
COSTS_N_INSNS (3), /* cost of MULSS instruction. */
COSTS_N_INSNS (3), /* cost of MULSD instruction. */
@@ -2135,6 +2185,9 @@ struct processor_costs znver5_cost = {
COSTS_N_INSNS (14), /* cost of SQRTSS instruction. */
/* DIVSD has throughtput 0.13 and latency 20. */
COSTS_N_INSNS (20), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (5), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (5), /* cost of 512bit VCVTPS2PD etc. */
/* Zen5 can execute:
- integer ops: 6 per cycle, at most 3 multiplications.
latency 1 for additions, 3 for multiplications (pipelined)
@@ -2274,6 +2327,9 @@ struct processor_costs skylake_cost = {
COSTS_N_INSNS (14), /* cost of DIVSD instruction. */
COSTS_N_INSNS (12), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (18), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (2), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (2), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (4), /* cost of 512bit VCVTPS2PD etc. */
1, 4, 2, 2, /* reassoc int, fp, vec_int, vec_fp. */
skylake_memcpy,
skylake_memset,
@@ -2403,6 +2459,9 @@ struct processor_costs icelake_cost = {
COSTS_N_INSNS (14), /* cost of DIVSD instruction. */
COSTS_N_INSNS (12), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (18), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (2), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (2), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (2), /* cost of 512bit VCVTPS2PD etc. */
1, 4, 2, 2, /* reassoc int, fp, vec_int, vec_fp. */
icelake_memcpy,
icelake_memset,
@@ -2526,6 +2585,9 @@ struct processor_costs alderlake_cost = {
COSTS_N_INSNS (17), /* cost of DIVSD instruction. */
COSTS_N_INSNS (14), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (18), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (2), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (2), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (2), /* cost of 512bit VCVTPS2PD etc. */
1, 4, 3, 3, /* reassoc int, fp, vec_int, vec_fp. */
alderlake_memcpy,
alderlake_memset,
@@ -2642,6 +2704,9 @@ const struct processor_costs btver1_cost = {
COSTS_N_INSNS (17), /* cost of DIVSD instruction. */
COSTS_N_INSNS (14), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (48), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (4), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (7), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (14), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
btver1_memcpy,
btver1_memset,
@@ -2755,6 +2820,9 @@ const struct processor_costs btver2_cost = {
COSTS_N_INSNS (19), /* cost of DIVSD instruction. */
COSTS_N_INSNS (16), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (21), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (4), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (7), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (14), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
btver2_memcpy,
btver2_memset,
@@ -2867,6 +2935,9 @@ struct processor_costs pentium4_cost = {
COSTS_N_INSNS (38), /* cost of DIVSD instruction. */
COSTS_N_INSNS (23), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (38), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (10), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (20), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (40), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
pentium4_memcpy,
pentium4_memset,
@@ -2982,6 +3053,9 @@ struct processor_costs nocona_cost = {
COSTS_N_INSNS (40), /* cost of DIVSD instruction. */
COSTS_N_INSNS (32), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (41), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (10), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (20), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (40), /* cost of 512bit VCVTPS2PD etc. */
1, 1, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
nocona_memcpy,
nocona_memset,
@@ -3095,6 +3169,9 @@ struct processor_costs atom_cost = {
COSTS_N_INSNS (60), /* cost of DIVSD instruction. */
COSTS_N_INSNS (31), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (63), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (6), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (12), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (24), /* cost of 512bit VCVTPS2PD etc. */
2, 2, 2, 2, /* reassoc int, fp, vec_int, vec_fp. */
atom_memcpy,
atom_memset,
@@ -3208,6 +3285,9 @@ struct processor_costs slm_cost = {
COSTS_N_INSNS (69), /* cost of DIVSD instruction. */
COSTS_N_INSNS (20), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (35), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (6), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (12), /* cost of 512bit VCVTPS2PD etc. */
1, 2, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
slm_memcpy,
slm_memset,
@@ -3335,6 +3415,9 @@ struct processor_costs tremont_cost = {
COSTS_N_INSNS (17), /* cost of DIVSD instruction. */
COSTS_N_INSNS (14), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (18), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (6), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (12), /* cost of 512bit VCVTPS2PD etc. */
1, 4, 3, 3, /* reassoc int, fp, vec_int, vec_fp. */
tremont_memcpy,
tremont_memset,
@@ -3448,6 +3531,9 @@ struct processor_costs intel_cost = {
COSTS_N_INSNS (20), /* cost of DIVSD instruction. */
COSTS_N_INSNS (40), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (40), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (8), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (16), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (32), /* cost of 512bit VCVTPS2PD etc. */
1, 4, 1, 1, /* reassoc int, fp, vec_int, vec_fp. */
intel_memcpy,
intel_memset,
@@ -3566,6 +3652,9 @@ struct processor_costs lujiazui_cost = {
COSTS_N_INSNS (17), /* cost of DIVSD instruction. */
COSTS_N_INSNS (32), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (60), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (6), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (12), /* cost of 512bit VCVTPS2PD etc. */
1, 4, 3, 3, /* reassoc int, fp, vec_int, vec_fp. */
lujiazui_memcpy,
lujiazui_memset,
@@ -3682,6 +3771,9 @@ struct processor_costs yongfeng_cost = {
COSTS_N_INSNS (14), /* cost of DIVSD instruction. */
COSTS_N_INSNS (20), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (35), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (6), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (12), /* cost of 512bit VCVTPS2PD etc. */
4, 4, 4, 4, /* reassoc int, fp, vec_int, vec_fp. */
yongfeng_memcpy,
yongfeng_memset,
@@ -3798,6 +3890,9 @@ struct processor_costs shijidadao_cost = {
COSTS_N_INSNS (14), /* cost of DIVSD instruction. */
COSTS_N_INSNS (11), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (18), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (6), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (12), /* cost of 512bit VCVTPS2PD etc. */
4, 4, 4, 4, /* reassoc int, fp, vec_int, vec_fp. */
shijidadao_memcpy,
shijidadao_memset,
@@ -3922,6 +4017,9 @@ struct processor_costs generic_cost = {
COSTS_N_INSNS (17), /* cost of DIVSD instruction. */
COSTS_N_INSNS (14), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (18), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (3), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (4), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (5), /* cost of 512bit VCVTPS2PD etc. */
1, 4, 3, 3, /* reassoc int, fp, vec_int, vec_fp. */
generic_memcpy,
generic_memset,
@@ -4051,6 +4149,9 @@ struct processor_costs core_cost = {
COSTS_N_INSNS (32), /* cost of DIVSD instruction. */
COSTS_N_INSNS (30), /* cost of SQRTSS instruction. */
COSTS_N_INSNS (58), /* cost of SQRTSD instruction. */
+ COSTS_N_INSNS (2), /* cost of CVTSS2SD etc. */
+ COSTS_N_INSNS (2), /* cost of 256bit VCVTPS2PD etc. */
+ COSTS_N_INSNS (2), /* cost of 512bit VCVTPS2PD etc. */
1, 4, 2, 2, /* reassoc int, fp, vec_int, vec_fp. */
core_memcpy,
core_memset,
diff --git a/gcc/config/i386/x86-tune-sched.cc b/gcc/config/i386/x86-tune-sched.cc
index 685a83c..15d3d91 100644
--- a/gcc/config/i386/x86-tune-sched.cc
+++ b/gcc/config/i386/x86-tune-sched.cc
@@ -81,6 +81,14 @@ ix86_issue_rate (void)
case PROCESSOR_YONGFENG:
case PROCESSOR_SHIJIDADAO:
case PROCESSOR_GENERIC:
+ /* For znver5 decoder can handle 4 or 8 instructions per cycle,
+ op cache 12 instruction/cycle, dispatch 8 instructions
+ integer rename 8 instructions and Fp 6 instructions.
+
+ The scheduler, without understanding out of order nature of the CPU
+ is not going to be able to use more than 4 instructions since that
+ is limits of the decoders. */
+ case PROCESSOR_ZNVER5:
return 4;
case PROCESSOR_ICELAKE_CLIENT:
@@ -91,13 +99,6 @@ ix86_issue_rate (void)
return 5;
case PROCESSOR_SAPPHIRERAPIDS:
- /* For znver5 decoder can handle 4 or 8 instructions per cycle,
- op cache 12 instruction/cycle, dispatch 8 instructions
- integer rename 8 instructions and Fp 6 instructions.
-
- The scheduler, without understanding out of order nature of the CPU
- is unlikely going to be able to fill all of these. */
- case PROCESSOR_ZNVER5:
return 6;
default:
diff --git a/gcc/config/nvptx/mkoffload.cc b/gcc/config/nvptx/mkoffload.cc
index bdfe7f5..e7ec0ef 100644
--- a/gcc/config/nvptx/mkoffload.cc
+++ b/gcc/config/nvptx/mkoffload.cc
@@ -778,6 +778,9 @@ main (int argc, char **argv)
}
if (fopenmp)
obstack_ptr_grow (&argv_obstack, "-mgomp");
+ /* The host code may contain exception handling constructs.
+ Handle these as good as we can. */
+ obstack_ptr_grow (&argv_obstack, "-mfake-exceptions");
for (int ix = 1; ix != argc; ix++)
{
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index 87364bf..f893971 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -2359,7 +2359,25 @@ nvptx_assemble_integer (rtx x, unsigned int size, int ARG_UNUSED (aligned_p))
{
gcc_checking_assert (!init_frag.active);
/* Just use the default machinery; it's not getting used, anyway. */
- return default_assemble_integer (x, size, aligned_p);
+ bool ok = default_assemble_integer (x, size, aligned_p);
+ /* ..., but a few cases need special handling. */
+ switch (GET_CODE (x))
+ {
+ case SYMBOL_REF:
+ /* The default machinery won't work: we don't define the necessary
+ operations; don't use them outside of this. */
+ gcc_checking_assert (!ok);
+ {
+ /* Just emit something; it's not getting used, anyway. */
+ const char *op = "\t.symbol_ref\t";
+ ok = (assemble_integer_with_op (op, x), true);
+ }
+ break;
+
+ default:
+ break;
+ }
+ return ok;
}
gcc_checking_assert (init_frag.active);
@@ -7771,6 +7789,18 @@ nvptx_asm_output_def_from_decls (FILE *stream, tree name,
#endif
cgraph_node *cnode = cgraph_node::get (name);
+#ifdef ACCEL_COMPILER
+ /* For nvptx offloading, make sure to emit C++ constructor, destructor aliases [PR97106]
+
+ For some reason (yet to be analyzed), they're not 'cnode->referred_to_p ()'.
+ (..., or that's not the right approach at all;
+ <https://inbox.sourceware.org/87v7rx8lbx.fsf@euler.schwinge.ddns.net>
+ "Re: [committed][nvptx] Use .alias directive for mptx >= 6.3"). */
+ if (DECL_CXX_CONSTRUCTOR_P (name)
+ || DECL_CXX_DESTRUCTOR_P (name))
+ ;
+ else
+#endif
if (!cnode->referred_to_p ())
/* Prevent "Internal error: reference to deleted section". */
return;
@@ -7875,8 +7905,6 @@ nvptx_asm_output_def_from_decls (FILE *stream, tree name,
#define TARGET_ASM_DECLARE_CONSTANT_NAME nvptx_asm_declare_constant_name
#undef TARGET_USE_BLOCKS_FOR_CONSTANT_P
#define TARGET_USE_BLOCKS_FOR_CONSTANT_P hook_bool_mode_const_rtx_true
-#undef TARGET_ASM_NEED_VAR_DECL_BEFORE_USE
-#define TARGET_ASM_NEED_VAR_DECL_BEFORE_USE true
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG nvptx_reorg
diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md
index 3201247..7c3bd69 100644
--- a/gcc/config/nvptx/nvptx.md
+++ b/gcc/config/nvptx/nvptx.md
@@ -1644,7 +1644,9 @@
[(const_int 0)]
""
{
- sorry ("exception handling not supported");
+ if (!fake_exceptions)
+ sorry ("exception handling not supported");
+ DONE;
})
(define_expand "nonlocal_goto"
diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt
index 9be81ae..ce9fbc7 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -168,6 +168,14 @@ Target Var(nvptx_alias) Init(0) Undocumented
mexperimental
Target Var(nvptx_experimental) Init(0) Undocumented
+mfake-exceptions
+Target Var(fake_exceptions) Init(0) Undocumented
+; With '-mfake-exceptions' enabled, the user-visible behavior in presence of
+; exception handling constructs changes such that the compile-time
+; 'sorry, unimplemented: exception handling not supported' is skipped, code
+; generation proceeds, and instead, exception handling constructs 'abort' at
+; run time. (..., or don't, if they're in dead code.)
+
mfake-ptx-alloca
Target Var(nvptx_fake_ptx_alloca) Init(0) Undocumented
; With '-mfake-ptx-alloca' enabled, the user-visible behavior changes only
diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md
index 5ed5e18..d0919ec 100644
--- a/gcc/config/riscv/bitmanip.md
+++ b/gcc/config/riscv/bitmanip.md
@@ -908,6 +908,24 @@
"bext\t%0,%1,%2"
[(set_attr "type" "bitmanip")])
+;; We do not define SHIFT_COUNT_TRUNCATED, so we have to have variants
+;; that mask/extend the count if we want to eliminate those ops
+;;
+;; We could (in theory) use GPR for the various modes, but I haven't
+;; seen those cases appear in practice. Without a testcase I've
+;; elected to keep the modes X which is easy to reason about.
+(define_insn "*bext<mode>_mask_pos"
+ [(set (match_operand:X 0 "register_operand" "=r")
+ (zero_extract:X (match_operand:X 1 "register_operand" "r")
+ (const_int 1)
+ (and:X
+ (match_operand:X 2 "register_operand" "r")
+ (match_operand 3 "const_int_operand"))))]
+ "(TARGET_ZBS
+ && INTVAL (operands[3]) + 1 == GET_MODE_BITSIZE (<MODE>mode))"
+ "bext\t%0,%1,%2"
+ [(set_attr "type" "bitmanip")])
+
;; This is a bext followed by a seqz. Normally this would be a 3->2 split
;; But the and-not pattern with a constant operand is a define_insn_and_split,
;; so this looks like a 2->2 split, which combine rejects. So implement it
@@ -1245,3 +1263,41 @@
expand_crc_using_clmul (<SUBX:MODE>mode, <SUBX1:MODE>mode, operands);
DONE;
})
+
+;; If we have an XOR/IOR with a constant operand (C) and the we can
+;; synthesize ~C more efficiently than C, then synthesize ~C and use
+;; xnor/orn instead.
+;;
+;; The same can be done for AND, but mvconst_internal's issues get in
+;; the way. That's future work.
+(define_split
+ [(set (match_operand:X 0 "register_operand")
+ (any_or:X (match_operand:X 1 "register_operand")
+ (match_operand:X 2 "const_int_operand")))
+ (clobber (match_operand:X 3 "register_operand"))]
+ "TARGET_ZBB
+ && (riscv_const_insns (operands[2], true)
+ > riscv_const_insns (GEN_INT (~INTVAL (operands[2])), true))"
+ [(const_int 0)]
+{
+ /* Get the inverted constant into the temporary register. */
+ riscv_emit_move (operands[3], GEN_INT (~INTVAL (operands[2])));
+
+ /* For xnor, the NOT operation is in a different position. So
+ we have to customize the split code we generate a bit.
+
+ It is expected that AND will be handled like IOR in the future. */
+ if (<CODE> == XOR)
+ {
+ rtx x = gen_rtx_XOR (<X:MODE>mode, operands[1], operands[3]);
+ x = gen_rtx_NOT (<X:MODE>mode, x);
+ emit_insn (gen_rtx_SET (operands[0], x));
+ }
+ else
+ {
+ rtx x = gen_rtx_NOT (<X:MODE>mode, operands[3]);
+ x = gen_rtx_IOR (<X:MODE>mode, x, operands[1]);
+ emit_insn (gen_rtx_SET (operands[0], x));
+ }
+ DONE;
+})
diff --git a/gcc/config/riscv/gnu.h b/gcc/config/riscv/gnu.h
new file mode 100644
index 0000000..047399b
--- /dev/null
+++ b/gcc/config/riscv/gnu.h
@@ -0,0 +1,59 @@
+/* Definitions for RISC-V GNU/Hurd systems with ELF format.
+ Copyright (C) 1998-2025 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ GNU_USER_TARGET_OS_CPP_BUILTINS(); \
+ } while (0)
+
+#define GNU_USER_DYNAMIC_LINKER "/lib/ld-riscv" XLEN_SPEC "-" ABI_SPEC ".so.1"
+
+#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
+
+#define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
+#define LD_EMUL_SUFFIX \
+ "%{mabi=lp64d:}" \
+ "%{mabi=lp64f:_lp64f}" \
+ "%{mabi=lp64:_lp64}" \
+ "%{mabi=ilp32d:}" \
+ "%{mabi=ilp32f:_ilp32f}" \
+ "%{mabi=ilp32:_ilp32}"
+
+#define LINK_SPEC "\
+-melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " \
+%{mno-relax:--no-relax} \
+-X \
+%{mbig-endian:-EB} \
+%{mlittle-endian:-EL} \
+%{shared} \
+ %{!shared: \
+ %{!static: \
+ %{!static-pie: \
+ %{rdynamic:-export-dynamic} \
+ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
+ %{static:-static} %{static-pie:-static -pie --no-dynamic-linker -z text}}"
+
+#define STARTFILE_PREFIX_SPEC \
+ "/lib" XLEN_SPEC "/" ABI_SPEC "/ " \
+ "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \
+ "/lib/ " \
+ "/usr/lib/ "
+
+#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_abi
diff --git a/gcc/config/riscv/multilib-generator b/gcc/config/riscv/multilib-generator
index 4828016..6ad1cf0 100755
--- a/gcc/config/riscv/multilib-generator
+++ b/gcc/config/riscv/multilib-generator
@@ -159,8 +159,8 @@ for cmodel in cmodels:
"e.g. rv32imafd-ilp32--" % cfg)
sys.exit(1)
- # Compact code model only support rv64.
- if cmodel == "compact" and arch.startswith("rv32"):
+ # Large code model only support rv64.
+ if cmodel == "large" and arch.startswith("rv32"):
continue
arch = arch_canonicalize (arch, args.misa_spec)
diff --git a/gcc/config/riscv/riscv-target-attr.cc b/gcc/config/riscv/riscv-target-attr.cc
index 1d96865..8ad3025 100644
--- a/gcc/config/riscv/riscv-target-attr.cc
+++ b/gcc/config/riscv/riscv-target-attr.cc
@@ -257,11 +257,7 @@ riscv_target_attr_parser::update_settings (struct gcc_options *opts) const
{
std::string local_arch = m_subset_list->to_string (true);
const char* local_arch_str = local_arch.c_str ();
- struct cl_target_option *default_opts
- = TREE_TARGET_OPTION (target_option_default_node);
- if (opts->x_riscv_arch_string != default_opts->x_riscv_arch_string)
- free (CONST_CAST (void *, (const void *) opts->x_riscv_arch_string));
- opts->x_riscv_arch_string = xstrdup (local_arch_str);
+ opts->x_riscv_arch_string = ggc_strdup (local_arch_str);
riscv_set_arch_by_subset_list (m_subset_list, opts);
}
diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index 0ac2538..a8c9256 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -685,7 +685,7 @@ invalid_opt_bb_p (basic_block cfg_bb)
/* We only do LCM optimizations on blocks that are post dominated by
EXIT block, that is, we don't do LCM optimizations on infinite loop. */
FOR_EACH_EDGE (e, ei, cfg_bb->succs)
- if (e->flags & EDGE_FAKE)
+ if ((e->flags & EDGE_FAKE) || (e->flags & EDGE_ABNORMAL))
return true;
return false;
@@ -2698,6 +2698,7 @@ pre_vsetvl::compute_lcm_local_properties ()
m_avout = sbitmap_vector_alloc (last_basic_block_for_fn (cfun), num_exprs);
bitmap_vector_clear (m_avloc, last_basic_block_for_fn (cfun));
+ bitmap_vector_clear (m_kill, last_basic_block_for_fn (cfun));
bitmap_vector_clear (m_antloc, last_basic_block_for_fn (cfun));
bitmap_vector_ones (m_transp, last_basic_block_for_fn (cfun));
@@ -2749,6 +2750,10 @@ pre_vsetvl::compute_lcm_local_properties ()
if (invalid_opt_bb_p (bb->cfg_bb ()))
{
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "\n --- skipping bb %u due to weird edge",
+ bb->index ());
+
bitmap_clear (m_antloc[bb_index]);
bitmap_clear (m_transp[bb_index]);
}
@@ -3022,6 +3027,18 @@ pre_vsetvl::earliest_fuse_vsetvl_info (int iter)
continue;
}
+ /* We cannot lift a vsetvl into the source block if the block is
+ not transparent WRT to it.
+ This is too restrictive for blocks where a register's use only
+ feeds into vsetvls and no regular insns. One example is the
+ test rvv/vsetvl/avl_single-68.c which is currently XFAILed for
+ that reason.
+ In order to support this case we'd need to check the vsetvl's
+ AVL operand's uses in the source block and make sure they are
+ only used in other vsetvls. */
+ if (!bitmap_bit_p (m_transp[eg->src->index], expr_index))
+ continue;
+
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file,
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 38f3ae7..bad59e2 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -10382,7 +10382,7 @@ riscv_file_end ()
fprintf (asm_out_file, "1:\n");
/* pr_type. */
- fprintf (asm_out_file, "\t.p2align\t3\n");
+ fprintf (asm_out_file, "\t.p2align\t%u\n", p2align);
fprintf (asm_out_file, "2:\n");
fprintf (asm_out_file, "\t.long\t0xc0000000\n");
/* pr_datasz. */
@@ -13136,9 +13136,6 @@ parse_features_for_version (tree decl,
DECL_SOURCE_LOCATION (decl));
gcc_assert (parse_res);
- if (arch_string != default_opts->x_riscv_arch_string)
- free (CONST_CAST (void *, (const void *) arch_string));
-
cl_target_option_restore (&global_options, &global_options_set,
&cur_target);
}
diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h
index 2bcabd0..2759a4c 100644
--- a/gcc/config/riscv/riscv.h
+++ b/gcc/config/riscv/riscv.h
@@ -888,7 +888,7 @@ extern enum riscv_cc get_riscv_cc (const rtx use);
#define ASM_OUTPUT_OPCODE(STREAM, PTR) \
(PTR) = riscv_asm_output_opcode(STREAM, PTR)
-#define JUMP_TABLES_IN_TEXT_SECTION 0
+#define JUMP_TABLES_IN_TEXT_SECTION (riscv_cmodel == CM_LARGE)
#define CASE_VECTOR_MODE SImode
#define CASE_VECTOR_PC_RELATIVE (riscv_cmodel != CM_MEDLOW)
diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md
index 26a247c..eec9687 100644
--- a/gcc/config/riscv/riscv.md
+++ b/gcc/config/riscv/riscv.md
@@ -789,7 +789,7 @@
rtx t5 = gen_reg_rtx (DImode);
rtx t6 = gen_reg_rtx (DImode);
- riscv_emit_binary (PLUS, operands[0], operands[1], operands[2]);
+ emit_insn (gen_addsi3_extended (t6, operands[1], operands[2]));
if (GET_CODE (operands[1]) != CONST_INT)
emit_insn (gen_extend_insn (t4, operands[1], DImode, SImode, 0));
else
@@ -799,7 +799,10 @@
else
t5 = operands[2];
emit_insn (gen_adddi3 (t3, t4, t5));
- emit_insn (gen_extend_insn (t6, operands[0], DImode, SImode, 0));
+ rtx t7 = gen_lowpart (SImode, t6);
+ SUBREG_PROMOTED_VAR_P (t7) = 1;
+ SUBREG_PROMOTED_SET (t7, SRP_SIGNED);
+ emit_move_insn (operands[0], t7);
riscv_expand_conditional_branch (operands[3], NE, t6, t3);
}
@@ -835,8 +838,11 @@
emit_insn (gen_extend_insn (t3, operands[1], DImode, SImode, 0));
else
t3 = operands[1];
- riscv_emit_binary (PLUS, operands[0], operands[1], operands[2]);
- emit_insn (gen_extend_insn (t4, operands[0], DImode, SImode, 0));
+ emit_insn (gen_addsi3_extended (t4, operands[1], operands[2]));
+ rtx t5 = gen_lowpart (SImode, t4);
+ SUBREG_PROMOTED_VAR_P (t5) = 1;
+ SUBREG_PROMOTED_SET (t5, SRP_SIGNED);
+ emit_move_insn (operands[0], t5);
riscv_expand_conditional_branch (operands[3], LTU, t4, t3);
}
@@ -966,7 +972,7 @@
rtx t5 = gen_reg_rtx (DImode);
rtx t6 = gen_reg_rtx (DImode);
- riscv_emit_binary (MINUS, operands[0], operands[1], operands[2]);
+ emit_insn (gen_subsi3_extended (t6, operands[1], operands[2]));
if (GET_CODE (operands[1]) != CONST_INT)
emit_insn (gen_extend_insn (t4, operands[1], DImode, SImode, 0));
else
@@ -976,7 +982,10 @@
else
t5 = operands[2];
emit_insn (gen_subdi3 (t3, t4, t5));
- emit_insn (gen_extend_insn (t6, operands[0], DImode, SImode, 0));
+ rtx t7 = gen_lowpart (SImode, t6);
+ SUBREG_PROMOTED_VAR_P (t7) = 1;
+ SUBREG_PROMOTED_SET (t7, SRP_SIGNED);
+ emit_move_insn (operands[0], t7);
riscv_expand_conditional_branch (operands[3], NE, t6, t3);
}
@@ -1015,8 +1024,11 @@
emit_insn (gen_extend_insn (t3, operands[1], DImode, SImode, 0));
else
t3 = operands[1];
- riscv_emit_binary (MINUS, operands[0], operands[1], operands[2]);
- emit_insn (gen_extend_insn (t4, operands[0], DImode, SImode, 0));
+ emit_insn (gen_subsi3_extended (t4, operands[1], operands[2]));
+ rtx t5 = gen_lowpart (SImode, t4);
+ SUBREG_PROMOTED_VAR_P (t5) = 1;
+ SUBREG_PROMOTED_SET (t5, SRP_SIGNED);
+ emit_move_insn (operands[0], t5);
riscv_expand_conditional_branch (operands[3], LTU, t3, t4);
}
diff --git a/gcc/config/rx/rx.md b/gcc/config/rx/rx.md
index edb2c96..a3d966e 100644
--- a/gcc/config/rx/rx.md
+++ b/gcc/config/rx/rx.md
@@ -2541,10 +2541,17 @@
(unspec_volatile:SI [(match_operand:BLK 1 "memory_operand") ;; String1
(match_operand:BLK 2 "memory_operand")] ;; String2
UNSPEC_CMPSTRN))
- (use (match_operand:SI 3 "register_operand")) ;; Max Length
+ (use (match_operand:SI 3 "nonmemory_operand")) ;; Max Length
(match_operand:SI 4 "immediate_operand")] ;; Known Align
"rx_allow_string_insns"
{
+ bool const_len = CONST_INT_P (operands[3]);
+ if (const_len && operands[3] == CONST0_RTX (SImode))
+ {
+ emit_move_insn (operands[0], CONST0_RTX (SImode));
+ DONE;
+ }
+
rtx str1 = gen_rtx_REG (SImode, 1);
rtx str2 = gen_rtx_REG (SImode, 2);
rtx len = gen_rtx_REG (SImode, 3);
@@ -2553,6 +2560,13 @@
emit_move_insn (str2, force_operand (XEXP (operands[2], 0), NULL_RTX));
emit_move_insn (len, operands[3]);
+ /* Set flags in case len is zero */
+ if (!const_len)
+ {
+ emit_insn (gen_setpsw (GEN_INT ('C')));
+ emit_insn (gen_setpsw (GEN_INT ('Z')));
+ }
+
emit_insn (gen_rx_cmpstrn (operands[0], operands[1], operands[2]));
DONE;
}
@@ -2590,9 +2604,7 @@
(clobber (reg:SI 3))
(clobber (reg:CC CC_REG))]
"rx_allow_string_insns"
- "setpsw z ; Set flags in case len is zero
- setpsw c
- scmpu ; Perform the string comparison
+ "scmpu ; Perform the string comparison
mov #-1, %0 ; Set up -1 result (which cannot be created
; by the SC insn)
bnc ?+ ; If Carry is not set skip over
diff --git a/gcc/config/s390/9175.md b/gcc/config/s390/9175.md
new file mode 100644
index 0000000..d0ac0e1
--- /dev/null
+++ b/gcc/config/s390/9175.md
@@ -0,0 +1,316 @@
+;; Scheduling description for z17.
+;; Copyright (C) 2025 Free Software Foundation, Inc.
+
+;; This file is part of GCC.
+
+;; GCC 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.
+
+;; GCC 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 GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+(define_attr "z17_unit_fpd" ""
+ (cond [(eq_attr "mnemonic" "ddb,ddbr,deb,debr,dxbr,sqdb,sqdbr,sqeb,sqebr,\
+sqxbr,vdf,vdg,vdlf,vdlg,vdlq,vdq,vfddb,vfdsb,vfsqdb,vfsqsb,vrf,vrg,vrlf,vrlg,\
+vrlq,vrq,wfddb,wfdsb,wfdxb,wfsqdb,wfsqxb")
+ (const_int 1)] (const_int 0)))
+
+(define_attr "z17_unit_fxa" ""
+ (cond [(eq_attr "mnemonic" "a,afi,ag,agf,agfi,agfr,agh,aghi,aghik,agr,agrk,ah,\
+ahi,ahik,ahy,al,alc,alcg,alcgr,alcr,alfi,alg,algf,algfi,algfr,alghsik,algr,\
+algrk,alhsik,alr,alrk,aly,ar,ark,ay,bdepg,bextg,clzg,ctzg,etnd,flogr,ic,icm,\
+icmh,icmy,icy,iihf,iilf,ipm,la,larl,lay,lb,lbr,lcgfr,lcgr,lcr,lgb,lgbr,lgf,\
+lgfi,lgfr,lgfrl,lgh,lghi,lghr,lghrl,lgr,lh,lhi,lhr,lhrl,lhy,llcr,llgcr,llgfr,\
+llghr,llgtr,llhr,llihf,llihh,llihl,llilf,llilh,llill,llxab,llxaf,llxag,llxah,\
+llxaq,lngfr,lngr,lnr,loc,locg,locghi,locgr,lochi,locr,lpgfr,lpgr,lpr,lr,lrv,\
+lrvg,lrvgr,lrvh,lrvr,lt,ltg,ltgf,ltgfr,ltgr,ltr,lxab,lxaf,lxag,lxah,lxaq,m,mfy,\
+mg,mgh,mghi,mgrk,mh,mhi,mhy,ml,mlg,mlgr,mlr,mr,ms,msc,msfi,msg,msgc,msgf,msgfi,\
+msgfr,msgr,msgrkc,msr,msrkc,msy,n,ncgrk,ncrk,ng,ngr,ngrk,nihf,nihh,nihl,nilf,\
+nilh,nill,nngrk,nnrk,nogrk,nork,nr,nrk,nxgrk,nxrk,ny,o,ocgrk,ocrk,og,ogr,ogrk,\
+oihf,oihh,oihl,oilf,oilh,oill,or,ork,oy,pfpo,popcnt,risbg,risbgn,rll,rllg,\
+rnsbg,rosbg,rxsbg,s,selgr,selr,sg,sgf,sgfr,sgh,sgr,sgrk,sh,shy,sl,slb,slbg,\
+slbgr,slbr,sldl,slfi,slg,slgf,slgfi,slgfr,slgr,slgrk,sll,sllg,sllk,slr,slrk,\
+sly,sr,sra,srag,srak,srda,srdl,srk,srl,srlg,srlk,sy,x,xg,xgr,xgrk,xihf,xilf,xr,\
+xrk,xy")
+ (const_int 1)] (const_int 0)))
+
+(define_attr "z17_unit_fxb" ""
+ (cond [(eq_attr "mnemonic" "agsi,algsi,alsi,asi,b,bc,bcr,bi,br,c,cfi,cg,cgf,\
+cgfi,cgfr,cgfrl,cgh,cghi,cghrl,cghsi,cgit,cgr,cgrl,cgrt,ch,chi,chrl,chsi,chy,\
+cit,cl,clfhsi,clfi,clfit,clg,clgf,clgfi,clgfr,clgfrl,clghrl,clghsi,clgit,clgr,\
+clgrl,clgrt,clgt,clhhsi,clhrl,cli,cliy,clm,clmy,clr,clrl,clrt,clt,cly,cr,crl,\
+crt,cy,laa,laag,lan,lang,lao,laog,lat,lax,laxg,lcdfr,ldgr,ldr,lgat,lgdr,lndfr,\
+lpdfr,lxr,lzdr,lzer,lzxr,mvghi,mvhhi,mvhi,mvi,mviy,ni,niy,nop,nopr,ntstg,oi,\
+oiy,ppa,st,stc,stcy,std,stdy,ste,stey,stg,stgrl,sth,sthrl,sthy,stoc,stocg,strl,\
+strv,strvg,strvh,sty,tend,tm,tmh,tmhh,tmhl,tml,tmlh,tmll,tmy,vlgvb,vlgvf,vlgvg,\
+vlgvh,vlr,vlvgb,vlvgf,vlvgg,vlvgh,vlvgp,vscef,vsceg,vst,vstbrf,vstbrg,vstbrh,\
+vstbrq,vstebrf,vstebrg,vstef,vsteg,vsterf,vsterg,vsterh,vstl,vstrl,vstrlr,xi,\
+xiy")
+ (const_int 1)] (const_int 0)))
+
+(define_attr "z17_unit_fxd" ""
+ (cond [(eq_attr "mnemonic" "dlgr,dlr,dr,dsgfr,dsgr")
+ (const_int 1)] (const_int 0)))
+
+(define_attr "z17_unit_lsu" ""
+ (cond [(eq_attr "mnemonic" "clc,ear,l,lam,lcbb,ld,lde,ldy,lg,lgrl,llc,llgc,\
+llgf,llgfrl,llgh,llghrl,llgt,llh,llhrl,lm,lmg,lmy,lpq,lrl,ly,mvcrl,sar,sfpc,\
+tabort,vl,vlbb,vlbrf,vlbrg,vlbrh,vlbrq,vlbrrepf,vlbrrepg,vlbrreph,vlerf,vlerg,\
+vlerh,vll,vllebrzf,vllebrzg,vllebrzh,vllezb,vllezf,vllezg,vllezh,vllezlf,\
+vlrepb,vlrepf,vlrepg,vlreph,vlrl,vlrlr")
+ (const_int 1)] (const_int 0)))
+
+(define_attr "z17_unit_vfu" ""
+ (cond [(eq_attr "mnemonic" "adb,adbr,adtr,aeb,aebr,axbr,axtr,brcl,cdb,cdbr,\
+cdtr,ceb,cebr,cpsdr,cxbr,cxtr,ddtr,dxtr,fidbr,fidbra,fidtr,fiebr,fiebra,fixbr,\
+fixbra,fixtr,j,jg,kdb,kdbr,kdtr,keb,kebr,kxbr,kxtr,lcdbr,lcebr,lcxbr,ldeb,\
+ldebr,ldetr,le,ledbr,ledtr,ler,ley,lndbr,lnebr,lnxbr,lpdbr,lpebr,lpxbr,ltdbr,\
+ltdtr,ltebr,ltxbr,ltxtr,lxdb,lxdbr,lxdtr,lxeb,lxebr,madb,madbr,maeb,maebr,mdb,\
+mdbr,mdtr,meeb,meebr,msdb,msdbr,mseb,msebr,mxbr,mxtr,sdb,sdbr,sdtr,seb,sebr,\
+sxbr,sxtr,tcdb,tceb,tcxb,tdcdt,tdcet,tdcxt,vab,vaccb,vacccq,vaccf,vaccg,vacch,\
+vaccq,vacq,vaf,vag,vah,vaq,vavgb,vavgf,vavgg,vavgh,vavglb,vavglf,vavglg,vavglh,\
+vavglq,vavgq,vblendb,vblendf,vblendg,vblendh,vblendq,vbperm,vcdgb,vcdlgb,vcefb,\
+vcelfb,vceqb,vceqbs,vceqf,vceqfs,vceqg,vceqgs,vceqh,vceqhs,vceqq,vceqqs,vcfeb,\
+vcfn,vcgdb,vchb,vchbs,vchf,vchfs,vchg,vchgs,vchh,vchhs,vchlb,vchlbs,vchlf,\
+vchlfs,vchlg,vchlgs,vchlh,vchlhs,vchlq,vchlqs,vchq,vchqs,vcksm,vclfeb,vclfnh,\
+vclfnl,vclgdb,vclzb,vclzf,vclzg,vclzh,vclzq,vcnf,vcrnf,vctzb,vctzf,vctzg,vctzh,\
+vctzq,verimb,verimf,verimg,verimh,verllb,verllf,verllg,verllh,verllvb,verllvf,\
+verllvg,verllvh,veslb,veslf,veslg,veslh,veslvb,veslvf,veslvg,veslvh,vesrab,\
+vesraf,vesrag,vesrah,vesravb,vesravf,vesravg,vesravh,vesrlb,vesrlf,vesrlg,\
+vesrlh,vesrlvb,vesrlvf,vesrlvg,vesrlvh,veval,vfadb,vfasb,vfcedb,vfcedbs,vfcesb,\
+vfcesbs,vfchdb,vfchdbs,vfchedb,vfchedbs,vfchesb,vfchesbs,vfchsb,vfchsbs,vfeeb,\
+vfeef,vfeeh,vfeezbs,vfeezfs,vfeezhs,vfeneb,vfenef,vfeneh,vfenezb,vfenezf,\
+vfenezh,vfidb,vfisb,vfkedb,vfkesb,vfkhdb,vfkhedb,vfkhesb,vfkhsb,vflcdb,vflcsb,\
+vflndb,vflnsb,vflpdb,vflpsb,vfmadb,vfmasb,vfmaxdb,vfmaxsb,vfmdb,vfmindb,\
+vfminsb,vfmsb,vfmsdb,vfmssb,vfnmadb,vfnmasb,vfnmsdb,vfnmssb,vfsdb,vfssb,\
+vftcidb,vftcisb,vgbm,vgemb,vgemf,vgemg,vgemh,vgemq,vgfmab,vgfmaf,vgfmag,vgfmah,\
+vgfmb,vgfmf,vgfmg,vgfmh,vgm,vistrb,vistrbs,vistrf,vistrfs,vistrh,vistrhs,vlcb,\
+vlcf,vlcg,vlch,vldeb,vleb,vlebrf,vlebrg,vlebrh,vledb,vlef,vleg,vleh,vleib,\
+vleif,vleig,vleih,vlpb,vlpf,vlpg,vlph,vlpq,vmaeb,vmaef,vmaeg,vmaeh,vmahb,vmahf,\
+vmahg,vmahh,vmahq,vmalb,vmaleb,vmalef,vmaleg,vmaleh,vmalf,vmalg,vmalhb,vmalhf,\
+vmalhg,vmalhh,vmalhq,vmalhw,vmalob,vmalof,vmalog,vmaloh,vmalq,vmaob,vmaof,\
+vmaog,vmaoh,vmeb,vmef,vmeg,vmeh,vmhb,vmhf,vmhg,vmhh,vmhq,vmlb,vmleb,vmlef,\
+vmleg,vmleh,vmlf,vmlg,vmlhb,vmlhf,vmlhg,vmlhh,vmlhq,vmlhw,vmlob,vmlof,vmlog,\
+vmloh,vmlq,vmnb,vmnf,vmng,vmnh,vmnlb,vmnlf,vmnlg,vmnlh,vmnlq,vmnq,vmob,vmof,\
+vmog,vmoh,vmrhb,vmrhf,vmrhg,vmrhh,vmrlb,vmrlf,vmrlg,vmrlh,vmslg,vmxb,vmxf,vmxg,\
+vmxh,vmxlb,vmxlf,vmxlg,vmxlh,vmxlq,vmxq,vn,vnc,vnn,vno,vnot,vnx,vo,voc,vone,\
+vpdi,vperm,vpkf,vpkg,vpkh,vpklsf,vpklsfs,vpklsg,vpklsgs,vpklsh,vpklshs,vpksf,\
+vpksfs,vpksg,vpksgs,vpksh,vpkshs,vpopct,vpopctb,vpopctf,vpopctg,vpopcth,vrepb,\
+vrepf,vrepg,vreph,vrepi,vrepib,vrepif,vrepig,vrepih,vsb,vsbcbiq,vsbiq,vscbib,\
+vscbif,vscbig,vscbih,vscbiq,vsegb,vsegf,vsegh,vsel,vsf,vsg,vsh,vsl,vslb,vsld,\
+vsldb,vsq,vsra,vsrab,vsrd,vsrl,vsrlb,vsumb,vsumgf,vsumgh,vsumh,vsumqf,vsumqg,\
+vtm,vuphb,vuphf,vuphg,vuphh,vuplb,vuplf,vuplg,vuplhb,vuplhf,vuplhg,vuplhh,\
+vuplhw,vupllb,vupllf,vupllg,vupllh,vx,vzero,wcdgb,wcdlgb,wcefb,wcelfb,wcfeb,\
+wcgdb,wclfeb,wclgdb,wfadb,wfasb,wfaxb,wfcdb,wfcedb,wfcesb,wfcexb,wfcexbs,\
+wfchdb,wfchedb,wfchesb,wfchexb,wfchexbs,wfchsb,wfchxb,wfchxbs,wfcsb,wfcxb,\
+wfidb,wfisb,wfixb,wfkdb,wfkedb,wfkesb,wfkexb,wfkhdb,wfkhedb,wfkhesb,wfkhexb,\
+wfkhsb,wfkhxb,wfksb,wfkxb,wflcdb,wflcsb,wflcxb,wflld,wflndb,wflnsb,wflnxb,\
+wflpdb,wflpsb,wflpxb,wflrx,wfmadb,wfmasb,wfmaxb,wfmaxxb,wfmdb,wfminxb,wfmsb,\
+wfmsdb,wfmssb,wfmsxb,wfmxb,wfnmaxb,wfnmsxb,wfsdb,wfssb,wfsxb,wftcixb,wldeb,\
+wledb")
+ (const_int 1)] (const_int 0)))
+
+(define_attr "z17_cracked" ""
+ (cond [(eq_attr "mnemonic" "bas,basr,bras,brasl,cdfbr,cdftr,cdgbr,cdgtr,\
+cdlfbr,cdlftr,cdlgbr,cdlgtr,cefbr,cegbr,celfbr,celgbr,cfdbr,cfebr,cfxbr,cgdbr,\
+cgdtr,cgebr,cgxbr,cgxtr,chhsi,clfdbr,clfdtr,clfebr,clfxbr,clfxtr,clgdbr,clgdtr,\
+clgebr,clgxbr,clgxtr,cs,csg,csy,efpc,ex,exrl,lcgfr,lngfr,lpgfr,lpq,lxr,lzxr,\
+mvc,nc,oc,rnsbg,rosbg,rxsbg,stpq,vgef,vgeg,vscef,vsceg,vsteb,vstebrh,vsteh,xc")
+ (const_int 1)] (const_int 0)))
+
+(define_attr "z17_expanded" ""
+ (cond [(eq_attr "mnemonic" "cds,cdsg,cdsy,cxfbr,cxftr,cxgbr,cxgtr,cxlfbr,\
+cxlftr,cxlgbr,cxlgtr,d,dl,dlg,dsg,dsgf,lam,lm,lmg,lmy,sldl,srda,srdl,stam,stm,\
+stmg,stmy,tbegin,tbeginc")
+ (const_int 1)] (const_int 0)))
+
+(define_attr "z17_groupalone" ""
+ (cond [(eq_attr "mnemonic" "alc,alcg,alcgr,alcr,axbr,axtr,clc,cxbr,cxfbr,\
+cxftr,cxgbr,cxgtr,cxlfbr,cxlftr,cxlgbr,cxlgtr,cxtr,d,dl,dlg,dlgr,dlr,dr,dsg,\
+dsgf,dsgfr,dsgr,dxbr,dxtr,ex,exrl,fixbr,fixbra,fixtr,flogr,kxbr,kxtr,lcxbr,\
+lnxbr,lpxbr,ltxbr,ltxtr,lxdb,lxdbr,lxdtr,lxeb,lxebr,m,madb,maeb,maebr,mfy,mg,\
+mgrk,ml,mlg,mlgr,mlr,mr,msdb,mseb,msebr,mvc,mvcrl,mxbr,mxtr,nc,oc,ppa,sfpc,slb,\
+slbg,slbgr,slbr,sqxbr,sxbr,sxtr,tabort,tbegin,tbeginc,tcxb,tdcxt,tend,xc")
+ (const_int 1)] (const_int 0)))
+
+(define_attr "z17_endgroup" ""
+ (cond [(eq_attr "mnemonic" "bas,basr,bcr,br,bras,brasl,cdsg,clfebr,cs,csg,csy,\
+efpc,ex,exrl,ipm,lam,lpq,lxr,nopr,sldl,srda,srdl,stam,stm,stmg,stmy,tbegin,\
+tbeginc")
+ (const_int 1)] (const_int 0)))
+
+(define_attr "z17_groupoftwo" ""
+ (cond [(eq_attr "mnemonic" "cdfbr,cdftr,cdgbr,cdgtr,cdlfbr,cdlftr,cdlgbr,\
+cdlgtr,cefbr,cegbr,celfbr,celgbr,cfdbr,cfebr,cfxbr,cgdbr,cgdtr,cgebr,cgxbr,\
+cgxtr,chhsi,clfdbr,clfdtr,clfxbr,clfxtr,clgdbr,clgdtr,clgebr,clgxbr,clgxtr,\
+lcgfr,lngfr,lpgfr,lzxr,vacccq,vacq,vblendb,vblendf,vblendg,vblendh,vblendq,\
+veval,vfmadb,vfmasb,vfmsdb,vfmssb,vfnmadb,vfnmasb,vfnmsdb,vfnmssb,vgef,vgeg,\
+vgfmab,vgfmaf,vgfmag,vgfmah,vmaeb,vmaef,vmaeg,vmaeh,vmahb,vmahf,vmahg,vmahh,\
+vmahq,vmalb,vmaleb,vmalef,vmaleg,vmaleh,vmalf,vmalg,vmalhb,vmalhf,vmalhg,\
+vmalhh,vmalhq,vmalhw,vmalob,vmalof,vmalog,vmaloh,vmalq,vmaob,vmaof,vmaog,vmaoh,\
+vmslg,vperm,vsbcbiq,vsbiq,vscef,vsceg,vsel,vsteb,vstebrh,vsteh,wfmadb,wfmasb,\
+wfmaxb,wfmsdb,wfmssb,wfmsxb,wfnmaxb,wfnmsxb")
+ (const_int 1)] (const_int 0)))
+
+(define_insn_reservation "z17_0" 0
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "a,afi,ag,agfi,aghi,aghik,agr,agrk,ahi,ahik,al,alfi,alg,\
+algf,algfi,algfr,alghsik,algr,algrk,alhsik,alr,alrk,aly,ar,ark,ay,b,bc,bcr,bi,\
+br,brcl,c,cfi,cg,cgfi,cghi,cghsi,cgit,cgr,cgrl,cgrt,chi,chsi,cit,cl,clfhsi,\
+clfi,clfit,clg,clgf,clgfi,clgfr,clgfrl,clghrl,clghsi,clgit,clgr,clgrl,clgrt,\
+clgt,clhhsi,clhrl,cli,cliy,clr,clrl,clrt,clt,cly,cr,crl,crt,cy,etnd,ic,icm,\
+icmh,icmy,icy,iihf,iilf,j,jg,la,larl,lat,lay,lb,lbr,lcdfr,lcgr,lcr,ldgr,ldr,\
+lgat,lgb,lgbr,lgf,lgfi,lgfr,lgfrl,lgh,lghi,lghr,lghrl,lgr,lh,lhi,lhr,lhrl,lhy,\
+llcr,llgcr,llgfr,llghr,llgtr,llhr,llihf,llihh,llihl,llilf,llilh,llill,lndfr,\
+lngr,lnr,lpdfr,lpgr,lpr,lr,lrv,lrvg,lrvgr,lrvh,lrvr,lt,ltg,ltgf,ltgfr,ltgr,ltr,\
+lzdr,lzer,n,ncgrk,ncrk,ng,ngr,ngrk,nihf,nihh,nihl,nilf,nilh,nill,nngrk,nnrk,\
+nogrk,nop,nopr,nork,nr,nrk,nxgrk,nxrk,ny,o,ocgrk,ocrk,og,ogr,ogrk,oihf,oihh,\
+oihl,oilf,oilh,oill,or,ork,oy,pfpo,risbg,risbgn,rll,rllg,s,sg,sgr,sgrk,sl,sldl,\
+slfi,slg,slgf,slgfi,slgfr,slgr,slgrk,sll,sllg,sllk,slr,slrk,sly,sr,sra,srag,\
+srak,srda,srdl,srk,srl,srlg,srlk,sy,tm,tmh,tmhh,tmhl,tml,tmlh,tmll,tmy,vlr,\
+vlvgb,vlvgf,vlvgg,vlvgh,x,xg,xgr,xgrk,xihf,xilf,xr,xrk,xy")) "nothing")
+
+(define_insn_reservation "z17_1" 1
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "agf,agfr,agh,agsi,ah,ahy,algsi,alsi,asi,cgf,cgfr,cgfrl,\
+cgh,cghrl,ch,chrl,chy,clm,clmy,cpsdr,laa,laag,lan,lang,lao,laog,lax,laxg,le,\
+ler,ley,llxab,llxaf,llxag,llxah,llxaq,loc,locg,locghi,locgr,lochi,locr,lxab,\
+lxaf,lxag,lxah,lxaq,mvghi,mvhhi,mvhi,mvi,mviy,ni,niy,ntstg,oi,oiy,selgr,selr,\
+sgf,sgfr,sgh,sh,shy,st,stc,stcy,stg,stgrl,sth,sthrl,sthy,stoc,stocg,strl,strv,\
+strvg,strvh,sty,vab,vaccb,vacccq,vaccf,vaccg,vacch,vaccq,vacq,vaf,vag,vah,vaq,\
+vavgb,vavgf,vavgg,vavgh,vavglb,vavglf,vavglg,vavglh,vavglq,vavgq,vblendb,\
+vblendf,vblendg,vblendh,vblendq,vbperm,vceqb,vceqbs,vceqf,vceqfs,vceqg,vceqgs,\
+vceqh,vceqhs,vceqq,vceqqs,vcfn,vchb,vchbs,vchf,vchfs,vchg,vchgs,vchh,vchhs,\
+vchlb,vchlbs,vchlf,vchlfs,vchlg,vchlgs,vchlh,vchlhs,vchlq,vchlqs,vchq,vchqs,\
+vclfnh,vclfnl,vclzb,vclzf,vclzg,vclzh,vclzq,vcnf,vcrnf,vctzb,vctzf,vctzg,vctzh,\
+vctzq,verimb,verimf,verimg,verimh,verllb,verllf,verllg,verllh,verllvb,verllvf,\
+verllvg,verllvh,veslb,veslf,veslg,veslh,veslvb,veslvf,veslvg,veslvh,vesrab,\
+vesraf,vesrag,vesrah,vesravb,vesravf,vesravg,vesravh,vesrlb,vesrlf,vesrlg,\
+vesrlh,vesrlvb,vesrlvf,vesrlvg,vesrlvh,veval,vfcedb,vfcedbs,vfcesb,vfcesbs,\
+vfchdb,vfchdbs,vfchedb,vfchedbs,vfchesb,vfchesbs,vfchsb,vfchsbs,vfkedb,vfkesb,\
+vfkhdb,vfkhedb,vfkhesb,vfkhsb,vflcdb,vflcsb,vflndb,vflnsb,vflpdb,vflpsb,\
+vfmaxdb,vfmaxsb,vfmindb,vfminsb,vgbm,vgemb,vgemf,vgemg,vgemh,vgemq,vgm,vlcb,\
+vlcf,vlcg,vlch,vleb,vlebrf,vlebrg,vlebrh,vlef,vleg,vleh,vleib,vleif,vleig,\
+vleih,vlpb,vlpf,vlpg,vlph,vlpq,vmnb,vmnf,vmng,vmnh,vmnlb,vmnlf,vmnlg,vmnlh,\
+vmnlq,vmnq,vmrhb,vmrhf,vmrhg,vmrhh,vmrlb,vmrlf,vmrlg,vmrlh,vmxb,vmxf,vmxg,vmxh,\
+vmxlb,vmxlf,vmxlg,vmxlh,vmxlq,vmxq,vn,vnc,vnn,vno,vnot,vnx,vo,voc,vone,vpdi,\
+vperm,vpkf,vpkg,vpkh,vpklsf,vpklsfs,vpklsg,vpklsgs,vpklsh,vpklshs,vpksf,vpksfs,\
+vpksg,vpksgs,vpksh,vpkshs,vpopct,vpopctb,vpopctf,vpopctg,vpopcth,vrepb,vrepf,\
+vrepg,vreph,vrepi,vrepib,vrepif,vrepig,vrepih,vsb,vsbcbiq,vsbiq,vscbib,vscbif,\
+vscbig,vscbih,vscbiq,vsegb,vsegf,vsegh,vsel,vsf,vsg,vsh,vsl,vslb,vsld,vsldb,\
+vsq,vsra,vsrab,vsrd,vsrl,vsrlb,vuphb,vuphf,vuphg,vuphh,vuplb,vuplf,vuplg,\
+vuplhb,vuplhf,vuplhg,vuplhh,vuplhw,vupllb,vupllf,vupllg,vupllh,vx,vzero,wfcedb,\
+wfcesb,wfcexb,wfcexbs,wfchdb,wfchedb,wfchesb,wfchexb,wfchexbs,wfchsb,wfchxb,\
+wfchxbs,wfkedb,wfkesb,wfkexb,wfkhdb,wfkhedb,wfkhesb,wfkhexb,wfkhsb,wfkhxb,\
+wflcdb,wflcsb,wflcxb,wflndb,wflnsb,wflnxb,wflpdb,wflpsb,wflpxb,wfmaxxb,wfminxb,\
+xi,xiy")) "nothing")
+
+(define_insn_reservation "z17_2" 2
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "cdb,cdbr,ceb,cebr,clzg,ctzg,ear,ipm,kdb,kdbr,keb,kebr,l,\
+lcbb,lcdbr,lcebr,ld,lde,ldy,lg,lgdr,lgrl,llc,llgc,llgf,llgfrl,llgh,llghrl,llgt,\
+llh,llhrl,lm,lmg,lmy,lndbr,lnebr,lpdbr,lpebr,lrl,ltdbr,ltebr,ly,popcnt,sar,\
+tcdb,tceb,vfeeb,vfeef,vfeeh,vfeezbs,vfeezfs,vfeezhs,vfeneb,vfenef,vfeneh,\
+vfenezb,vfenezf,vfenezh,vftcidb,vftcisb,vistrb,vistrbs,vistrf,vistrfs,vistrh,\
+vistrhs,vlbrrepf,vlbrrepg,vlbrreph,vlgvb,vlgvf,vlgvg,vlgvh,vllebrzf,vllebrzg,\
+vllebrzh,vllezb,vllezf,vllezg,vllezh,vllezlf,vlrepb,vlrepf,vlrepg,vlreph,vlrl,\
+vlvgp,wfcdb,wfcsb,wfcxb,wfkdb,wfksb,wfkxb,wftcixb")) "nothing")
+
+(define_insn_reservation "z17_3" 3
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "bdepg,bextg,cds,cdsy,mgh,mghi,mh,mhi,mhy,ms,msc,msfi,msg,\
+msgc,msgf,msgfi,msgfr,msgr,msgrkc,msr,msrkc,msy,std,stdy,ste,stey,vcksm,vgfmab,\
+vgfmaf,vgfmag,vgfmah,vgfmb,vgfmf,vgfmg,vgfmh,vl,vlbb,vlbrf,vlbrg,vlbrh,vlbrq,\
+vlerf,vlerg,vlerh,vll,vlrlr,vmaeb,vmaef,vmaeg,vmaeh,vmahb,vmahf,vmahg,vmahh,\
+vmahq,vmalb,vmaleb,vmalef,vmaleg,vmaleh,vmalf,vmalg,vmalhb,vmalhf,vmalhg,\
+vmalhh,vmalhq,vmalhw,vmalob,vmalof,vmalog,vmaloh,vmalq,vmaob,vmaof,vmaog,vmaoh,\
+vmeb,vmef,vmeg,vmeh,vmhb,vmhf,vmhg,vmhh,vmhq,vmlb,vmleb,vmlef,vmleg,vmleh,vmlf,\
+vmlg,vmlhb,vmlhf,vmlhg,vmlhh,vmlhq,vmlhw,vmlob,vmlof,vmlog,vmloh,vmlq,vmob,\
+vmof,vmog,vmoh,vsumb,vsumgf,vsumgh,vsumh,vsumqf,vsumqg,vtm")) "nothing")
+
+(define_insn_reservation "z17_4" 4
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "bas,basr,bras,brasl,chhsi,clc,ex,exrl,lam,lcgfr,lngfr,\
+lpgfr,lxr,lzxr,mvcrl,ppa,rnsbg,rosbg,rxsbg,tabort,tend,vst,vstbrf,vstbrg,\
+vstbrh,vstbrq,vstebrf,vstebrg,vstef,vsteg,vsterf,vsterg,vsterh,vstl,vstrl,\
+vstrlr")) "nothing")
+
+(define_insn_reservation "z17_5" 5
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "adb,adbr,aeb,aebr,alc,alcg,alcgr,alcr,cs,csg,csy,fidbr,\
+fidbra,fiebr,fiebra,ldeb,ldebr,ledbr,madbr,mdb,mdbr,meeb,meebr,msdbr,sdb,sdbr,\
+seb,sebr,slb,slbg,slbgr,slbr,stm,stmg,stmy,vcdgb,vcdlgb,vcefb,vcelfb,vcfeb,\
+vcgdb,vclfeb,vclgdb,vldeb,vledb,vmslg,wcdgb,wcdlgb,wcefb,wcelfb,wcfeb,wcgdb,\
+wclfeb,wclgdb,wflld,wflrx,wldeb,wledb")) "nothing")
+
+(define_insn_reservation "z17_6" 6
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "sfpc")) "nothing")
+
+(define_insn_reservation "z17_7" 7
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "adtr,cdtr,fidtr,kdtr,ldetr,ltdtr,sdtr,tdcdt,tdcet,vfadb,\
+vfasb,vfidb,vfisb,vfsdb,vfssb,vgef,vgeg,wfadb,wfasb,wfaxb,wfidb,wfisb,wfixb,\
+wfsdb,wfssb,wfsxb")) "nothing")
+
+(define_insn_reservation "z17_8" 8
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "cdgtr,cdlgtr,cdsg,cxgtr,cxlgtr,flogr,lpq,m,mfy,mg,mgrk,\
+ml,mlg,mlgr,mlr,mr,stpq,vsteb,vstebrh,vsteh")) "nothing")
+
+(define_insn_reservation "z17_9" 9
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "cdfbr,cdgbr,cdlfbr,cdlgbr,cefbr,cegbr,celfbr,celgbr,madb,\
+maeb,maebr,msdb,mseb,msebr,stam")) "nothing")
+
+(define_insn_reservation "z17_10" 10
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "cgdtr,cgxtr,clfdtr,clfxtr,clgdtr,clgxtr,d,dl,dlg,dsg,\
+dsgf,efpc,lxdb,lxdbr,lxeb,lxebr,vscef,vsceg")) "nothing")
+
+(define_insn_reservation "z17_11" 11
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "cfdbr,cfebr,cgdbr,cgebr,clfdbr,clfebr,clgdbr,clgebr")) "nothing")
+
+(define_insn_reservation "z17_12" 12
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "cxbr,cxtr,kxbr,kxtr,tbegin,tbeginc,tcxb,tdcxt")) "nothing")
+
+(define_insn_reservation "z17_13" 13
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "axbr,axtr,cxfbr,cxgbr,cxlfbr,cxlgbr,fixbr,fixbra,fixtr,\
+lcxbr,lnxbr,lpxbr,ltxbr,ltxtr,lxdtr,sxbr,sxtr")) "nothing")
+
+(define_insn_reservation "z17_14" 14
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "cfxbr,cgxbr,clfxbr,clgxbr,ledtr")) "nothing")
+
+(define_insn_reservation "z17_15" 15
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "nc,oc")) "nothing")
+
+(define_insn_reservation "z17_16" 16
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "cdftr,cdlftr,cxftr,cxlftr")) "nothing")
+
+(define_insn_reservation "z17_18" 18
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "xc")) "nothing")
+
+(define_insn_reservation "z17_20" 20
+ (and (eq_attr "cpu" "z17")
+ (eq_attr "mnemonic" "ddb,ddbr,ddtr,deb,debr,dlgr,dlr,dr,dsgfr,dsgr,dxbr,dxtr,\
+mdtr,mvc,mxbr,mxtr,sqdb,sqdbr,sqeb,sqebr,sqxbr,vdf,vdg,vdlf,vdlg,vdlq,vdq,\
+vfddb,vfdsb,vfmadb,vfmasb,vfmdb,vfmsb,vfmsdb,vfmssb,vfnmadb,vfnmasb,vfnmsdb,\
+vfnmssb,vfsqdb,vfsqsb,vrf,vrg,vrlf,vrlg,vrlq,vrq,wfddb,wfdsb,wfdxb,wfmadb,\
+wfmasb,wfmaxb,wfmdb,wfmsb,wfmsdb,wfmssb,wfmsxb,wfmxb,wfnmaxb,wfnmsxb,wfsqdb,\
+wfsqxb")) "nothing")
+
diff --git a/gcc/config/s390/driver-native.cc b/gcc/config/s390/driver-native.cc
index 49e8fa0..7a7ceea 100644
--- a/gcc/config/s390/driver-native.cc
+++ b/gcc/config/s390/driver-native.cc
@@ -127,6 +127,10 @@ s390_host_detect_local_cpu (int argc, const char **argv)
case 0x3932:
cpu = "arch14";
break;
+ case 0x9175:
+ case 0x9176:
+ cpu = "arch15";
+ break;
default:
cpu = "arch15";
break;
diff --git a/gcc/config/s390/s390-builtins.def b/gcc/config/s390/s390-builtins.def
index d9af9b1..cee2326 100644
--- a/gcc/config/s390/s390-builtins.def
+++ b/gcc/config/s390/s390-builtins.def
@@ -300,8 +300,8 @@
#define B_VXE2 (1 << 4) /* Builtins requiring the z15 vector extensions. */
#define B_DEP (1 << 5) /* Builtin has been deprecated and a warning should be issued. */
#define B_NNPA (1 << 6) /* Builtins requiring the NNPA Facility. */
-#define B_VXE3 (1 << 7) /* Builtins requiring the arch15 vector extensions. */
-#define B_ARCH15 (1 << 8) /* Builtins requiring arch15. */
+#define B_VXE3 (1 << 7) /* Builtins requiring the z17 vector extensions. */
+#define B_Z17 (1 << 8) /* Builtins requiring z17. */
/* B_DEF defines a standard (not overloaded) builtin
B_DEF (<builtin name>, <RTL expander name>, <function attributes>, <builtin flags>, <operand flags, see above>, <fntype>)
@@ -3318,8 +3318,8 @@ B_DEF (s390_vcnf, vcnf_v8hi, 0,
/* arch 15 builtins */
-B_DEF (s390_bdepg, bdepg, 0, B_ARCH15, 0, BT_FN_ULONG_ULONG_ULONG)
-B_DEF (s390_bextg, bextg, 0, B_ARCH15, 0, BT_FN_ULONG_ULONG_ULONG)
+B_DEF (s390_bdepg, bdepg, 0, B_Z17, 0, BT_FN_ULONG_ULONG_ULONG)
+B_DEF (s390_bextg, bextg, 0, B_Z17, 0, BT_FN_ULONG_ULONG_ULONG)
OB_DEF (s390_vec_blend, s390_vec_blend_s8, s390_vec_blend_dbl, B_VXE3, BT_FN_OV4SI_OV4SI_OV4SI_OV4SI)
OB_DEF_VAR (s390_vec_blend_s8, s390_vblendb, 0, 0, BT_OV_V16QI_V16QI_V16QI_V16QI)
diff --git a/gcc/config/s390/s390-c.cc b/gcc/config/s390/s390-c.cc
index 311d74a..a01c44c 100644
--- a/gcc/config/s390/s390-c.cc
+++ b/gcc/config/s390/s390-c.cc
@@ -962,7 +962,7 @@ s390_resolve_overloaded_builtin (location_t loc, tree ob_fndecl,
if (!TARGET_VXE3 && (ob_flags & B_VXE3))
{
- error_at (loc, "%qF requires arch15 or higher", ob_fndecl);
+ error_at (loc, "%qF requires z17 or higher", ob_fndecl);
return error_mark_node;
}
@@ -1056,7 +1056,7 @@ s390_resolve_overloaded_builtin (location_t loc, tree ob_fndecl,
if (!TARGET_VXE3
&& bflags_overloaded_builtin_var[last_match_index] & B_VXE3)
{
- error_at (loc, "%qs matching variant requires arch15 or higher",
+ error_at (loc, "%qs matching variant requires z17 or higher",
IDENTIFIER_POINTER (DECL_NAME (ob_fndecl)));
return error_mark_node;
}
diff --git a/gcc/config/s390/s390-opts.h b/gcc/config/s390/s390-opts.h
index 437d3b9..9cacb2c 100644
--- a/gcc/config/s390/s390-opts.h
+++ b/gcc/config/s390/s390-opts.h
@@ -39,7 +39,7 @@ enum processor_type
PROCESSOR_3906_Z14,
PROCESSOR_8561_Z15,
PROCESSOR_3931_Z16,
- PROCESSOR_ARCH15,
+ PROCESSOR_9175_Z17,
PROCESSOR_NATIVE,
PROCESSOR_max
};
diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc
index 0ff3fd5..d82b16e 100644
--- a/gcc/config/s390/s390.cc
+++ b/gcc/config/s390/s390.cc
@@ -342,7 +342,7 @@ const struct s390_processor processor_table[] =
{ "z14", "arch12", PROCESSOR_3906_Z14, &zEC12_cost, 12 },
{ "z15", "arch13", PROCESSOR_8561_Z15, &zEC12_cost, 13 },
{ "z16", "arch14", PROCESSOR_3931_Z16, &zEC12_cost, 14 },
- { "arch15", "arch15", PROCESSOR_ARCH15, &zEC12_cost, 15 },
+ { "z17", "arch15", PROCESSOR_9175_Z17, &zEC12_cost, 15 },
{ "native", "", PROCESSOR_NATIVE, NULL, 0 }
};
@@ -916,7 +916,7 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
if ((bflags & B_VXE3) && !TARGET_VXE3)
{
- error ("Builtin %qF requires arch15 or higher", fndecl);
+ error ("Builtin %qF requires z17 or higher", fndecl);
return const0_rtx;
}
}
@@ -9204,7 +9204,7 @@ s390_issue_rate (void)
case PROCESSOR_3906_Z14:
case PROCESSOR_8561_Z15:
case PROCESSOR_3931_Z16:
- case PROCESSOR_ARCH15:
+ case PROCESSOR_9175_Z17:
default:
return 1;
}
@@ -15632,7 +15632,6 @@ s390_get_sched_attrmask (rtx_insn *insn)
mask |= S390_SCHED_ATTR_MASK_GROUPOFTWO;
break;
case PROCESSOR_3931_Z16:
- case PROCESSOR_ARCH15:
if (get_attr_z16_cracked (insn))
mask |= S390_SCHED_ATTR_MASK_CRACKED;
if (get_attr_z16_expanded (insn))
@@ -15644,6 +15643,18 @@ s390_get_sched_attrmask (rtx_insn *insn)
if (get_attr_z16_groupoftwo (insn))
mask |= S390_SCHED_ATTR_MASK_GROUPOFTWO;
break;
+ case PROCESSOR_9175_Z17:
+ if (get_attr_z17_cracked (insn))
+ mask |= S390_SCHED_ATTR_MASK_CRACKED;
+ if (get_attr_z17_expanded (insn))
+ mask |= S390_SCHED_ATTR_MASK_EXPANDED;
+ if (get_attr_z17_endgroup (insn))
+ mask |= S390_SCHED_ATTR_MASK_ENDGROUP;
+ if (get_attr_z17_groupalone (insn))
+ mask |= S390_SCHED_ATTR_MASK_GROUPALONE;
+ if (get_attr_z17_groupoftwo (insn))
+ mask |= S390_SCHED_ATTR_MASK_GROUPOFTWO;
+ break;
default:
gcc_unreachable ();
}
@@ -15691,7 +15702,6 @@ s390_get_unit_mask (rtx_insn *insn, int *units)
mask |= 1 << 3;
break;
case PROCESSOR_3931_Z16:
- case PROCESSOR_ARCH15:
*units = 4;
if (get_attr_z16_unit_lsu (insn))
mask |= 1 << 0;
@@ -15702,6 +15712,17 @@ s390_get_unit_mask (rtx_insn *insn, int *units)
if (get_attr_z16_unit_vfu (insn))
mask |= 1 << 3;
break;
+ case PROCESSOR_9175_Z17:
+ *units = 4;
+ if (get_attr_z17_unit_lsu (insn))
+ mask |= 1 << 0;
+ if (get_attr_z17_unit_fxa (insn))
+ mask |= 1 << 1;
+ if (get_attr_z17_unit_fxb (insn))
+ mask |= 1 << 2;
+ if (get_attr_z17_unit_vfu (insn))
+ mask |= 1 << 3;
+ break;
default:
gcc_unreachable ();
}
@@ -15715,7 +15736,8 @@ s390_is_fpd (rtx_insn *insn)
return false;
return get_attr_z13_unit_fpd (insn) || get_attr_z14_unit_fpd (insn)
- || get_attr_z15_unit_fpd (insn) || get_attr_z16_unit_fpd (insn);
+ || get_attr_z15_unit_fpd (insn) || get_attr_z16_unit_fpd (insn)
+ || get_attr_z17_unit_fpd (insn);
}
static bool
@@ -15725,7 +15747,8 @@ s390_is_fxd (rtx_insn *insn)
return false;
return get_attr_z13_unit_fxd (insn) || get_attr_z14_unit_fxd (insn)
- || get_attr_z15_unit_fxd (insn) || get_attr_z16_unit_fxd (insn);
+ || get_attr_z15_unit_fxd (insn) || get_attr_z16_unit_fxd (insn)
+ || get_attr_z17_unit_fxd (insn);
}
/* Returns TRUE if INSN is a long-running instruction. */
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 6f7195d..8b04bc9 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -45,12 +45,12 @@ enum processor_flags
PF_NNPA = 32768,
PF_Z16 = 65536,
PF_VXE3 = 131072,
- PF_ARCH15 = 262144
+ PF_Z17 = 262144
};
/* This is necessary to avoid a warning about comparing different enum
types. */
-#define s390_tune_attr ((enum attr_cpu)(s390_tune > PROCESSOR_3931_Z16 ? PROCESSOR_3931_Z16 : s390_tune ))
+#define s390_tune_attr ((enum attr_cpu)(s390_tune > PROCESSOR_9175_Z17 ? PROCESSOR_9175_Z17 : s390_tune ))
/* These flags indicate that the generated code should run on a cpu
providing the respective hardware facility regardless of the
@@ -124,10 +124,10 @@ enum processor_flags
(s390_arch_flags & PF_VXE3)
#define TARGET_CPU_VXE3_P(opts) \
(opts->x_s390_arch_flags & PF_VXE3)
-#define TARGET_CPU_ARCH15 \
- (s390_arch_flags & PF_ARCH15)
-#define TARGET_CPU_ARCH15_P(opts) \
- (opts->x_s390_arch_flags & PF_ARCH15)
+#define TARGET_CPU_Z17 \
+ (s390_arch_flags & PF_Z17)
+#define TARGET_CPU_Z17_P(opts) \
+ (opts->x_s390_arch_flags & PF_Z17)
#define TARGET_HARD_FLOAT_P(opts) (!TARGET_SOFT_FLOAT_P(opts))
@@ -198,9 +198,9 @@ enum processor_flags
(TARGET_VX && TARGET_CPU_VXE3)
#define TARGET_VXE3_P(opts) \
(TARGET_VX_P (opts) && TARGET_CPU_VXE3_P (opts))
-#define TARGET_ARCH15 (TARGET_ZARCH && TARGET_CPU_ARCH15)
-#define TARGET_ARCH15_P(opts) \
- (TARGET_ZARCH_P (opts->x_target_flags) && TARGET_CPU_ARCH15_P (opts))
+#define TARGET_Z17 (TARGET_ZARCH && TARGET_CPU_Z17)
+#define TARGET_Z17_P(opts) \
+ (TARGET_ZARCH_P (opts->x_target_flags) && TARGET_CPU_Z17_P (opts))
#if defined(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13)
#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS TARGET_Z13
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 9d49580..05b9da6 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -599,11 +599,11 @@
;; Processor type. This attribute must exactly match the processor_type
;; enumeration in s390.h.
-(define_attr "cpu" "z900,z990,z9_109,z9_ec,z10,z196,zEC12,z13,z14,z15,z16"
+(define_attr "cpu" "z900,z990,z9_109,z9_ec,z10,z196,zEC12,z13,z14,z15,z16,z17"
(const (symbol_ref "s390_tune_attr")))
(define_attr "cpu_facility"
- "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12,vx,z13,z14,vxe,z15,vxe2,z16,nnpa,vxe3,arch15"
+ "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12,vx,z13,z14,vxe,z15,vxe2,z16,nnpa,vxe3,z17"
(const_string "standard"))
(define_attr "enabled" ""
@@ -681,8 +681,8 @@
(match_test "TARGET_VXE3"))
(const_int 1)
- (and (eq_attr "cpu_facility" "arch15")
- (match_test "TARGET_ARCH15"))
+ (and (eq_attr "cpu_facility" "z17")
+ (match_test "TARGET_Z17"))
(const_int 1)
]
(const_int 0)))
@@ -725,6 +725,9 @@
;; Pipeline description for z16
(include "3931.md")
+;; Pipeline description for z17
+(include "9175.md")
+
;; Predicates
(include "predicates.md")
@@ -2056,7 +2059,7 @@
[(set (match_operand:DI 0 "register_operand" "=d")
(ashift:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "a"))
(const_int LXAMODEITER)))]
- "TARGET_ARCH15 && TARGET_64BIT"
+ "TARGET_Z17 && TARGET_64BIT"
"lxa<lxamode>\t%0,0(%1,0)"
[(set_attr "op_type" "RXY")])
@@ -2066,7 +2069,7 @@
(ashift:DI (sign_extend:DI (plus:SI (match_operand:SI 1 "register_operand" "a")
(match_operand:SI 2 "const_int_operand")))
(const_int LXAMODEITER)))]
- "TARGET_ARCH15 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
+ "TARGET_Z17 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
"lxa<lxamode>\t%0,%2(%1,0)"
[(set_attr "op_type" "RXY")])
@@ -2076,7 +2079,7 @@
(plus:DI (ashift:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "a"))
(const_int LXAMODEITER))
(match_operand:DI 2 "register_operand" "a")))]
- "TARGET_ARCH15 && TARGET_64BIT"
+ "TARGET_Z17 && TARGET_64BIT"
"lxa<lxamode>\t%0,0(%1,%2)"
[(set_attr "op_type" "RXY")])
@@ -2087,7 +2090,7 @@
(match_operand:SI 2 "const_int_operand")))
(const_int LXAMODEITER))
(match_operand:DI 3 "register_operand" "a")))]
- "TARGET_ARCH15 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
+ "TARGET_Z17 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
"lxa<lxamode>\t%0,%2(%1,%3)"
[(set_attr "op_type" "RXY")])
@@ -2096,7 +2099,7 @@
(plus:DI (sign_extend:DI (plus:SI (match_operand:SI 1 "register_operand" "a")
(match_operand:SI 2 "const_int_operand")))
(match_operand:DI 3 "register_operand" "a")))]
- "TARGET_ARCH15 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
+ "TARGET_Z17 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
"lxab\t%0,%2(%1,%3)"
[(set_attr "op_type" "RXY")])
@@ -2113,7 +2116,7 @@
0)
(const_int LXAMODEITER))
(const_int <LLXAMASK>)))]
- "TARGET_ARCH15 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
+ "TARGET_Z17 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
"llxa<lxamode>\t%0,%2(%1,0)"
[(set_attr "op_type" "RXY")])
@@ -2124,7 +2127,7 @@
(const_int LXAMODEITER))
(const_int <LLXAMASK>))
(match_operand:DI 2 "register_operand" "a")))]
- "TARGET_ARCH15 && TARGET_64BIT"
+ "TARGET_Z17 && TARGET_64BIT"
"llxa<lxamode>\t%0,0(%1,%2)"
[(set_attr "op_type" "RXY")])
@@ -2137,7 +2140,7 @@
(const_int LXAMODEITER))
(const_int <LLXAMASK>))
(match_operand:DI 3 "register_operand" "a")))]
- "TARGET_ARCH15 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
+ "TARGET_Z17 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
"llxa<lxamode>\t%0,%2(%1,%3)"
[(set_attr "op_type" "RXY")])
@@ -2146,7 +2149,7 @@
(plus:DI (zero_extend:DI (plus:SI (match_operand:SI 1 "register_operand" "a")
(match_operand:SI 2 "const_int_operand")))
(match_operand:DI 3 "register_operand" "a")))]
- "TARGET_ARCH15 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
+ "TARGET_Z17 && TARGET_64BIT && INTVAL (operands[2]) >= -0x80000 && INTVAL (operands[2]) <= 0x7FFFF"
"llxab\t%0,%2(%1,%3)"
[(set_attr "op_type" "RXY")])
@@ -3594,7 +3597,7 @@
(match_operand:BLK 1 "memory_operand" ""))
(use (match_operand 2 "const_int_operand" ""))
(use (match_operand 3 "immediate_operand" ""))
- (clobber (scratch))]
+ (clobber (match_scratch 4))]
"reload_completed"
[(parallel
[(set (match_dup 0) (match_dup 1))
@@ -3606,7 +3609,7 @@
(match_operand:BLK 1 "memory_operand" ""))
(use (match_operand 2 "register_operand" ""))
(use (match_operand 3 "memory_operand" ""))
- (clobber (scratch))]
+ (clobber (match_scratch 4))]
"reload_completed"
[(parallel
[(unspec [(match_dup 2) (match_dup 3)
@@ -3620,14 +3623,14 @@
(match_operand:BLK 1 "memory_operand" ""))
(use (match_operand 2 "register_operand" ""))
(use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
- (clobber (scratch))]
+ (clobber (match_scratch 3))]
"TARGET_Z10 && reload_completed"
[(parallel
[(unspec [(match_dup 2) (const_int 0)
- (label_ref (match_dup 3))] UNSPEC_EXECUTE)
+ (label_ref (match_dup 4))] UNSPEC_EXECUTE)
(set (match_dup 0) (match_dup 1))
(use (const_int 1))])]
- "operands[3] = gen_label_rtx ();")
+ "operands[4] = gen_label_rtx ();")
(define_split
[(set (match_operand:BLK 0 "memory_operand" "")
@@ -3849,7 +3852,7 @@
(const_int 0))
(use (match_operand 1 "const_int_operand" ""))
(use (match_operand 2 "immediate_operand" ""))
- (clobber (scratch))
+ (clobber (match_scratch 3))
(clobber (reg:CC CC_REGNUM))]
"reload_completed"
[(parallel
@@ -3863,7 +3866,7 @@
(const_int 0))
(use (match_operand 1 "register_operand" ""))
(use (match_operand 2 "memory_operand" ""))
- (clobber (scratch))
+ (clobber (match_scratch 3))
(clobber (reg:CC CC_REGNUM))]
"reload_completed"
[(parallel
@@ -3879,7 +3882,7 @@
(const_int 0))
(use (match_operand 1 "register_operand" ""))
(use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
- (clobber (scratch))
+ (clobber (match_scratch 2))
(clobber (reg:CC CC_REGNUM))]
"TARGET_Z10 && reload_completed"
[(parallel
@@ -4044,7 +4047,7 @@
(match_operand:BLK 1 "memory_operand" "")))
(use (match_operand 2 "const_int_operand" ""))
(use (match_operand 3 "immediate_operand" ""))
- (clobber (scratch))]
+ (clobber (match_scratch 4))]
"reload_completed"
[(parallel
[(set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1)))
@@ -4057,7 +4060,7 @@
(match_operand:BLK 1 "memory_operand" "")))
(use (match_operand 2 "register_operand" ""))
(use (match_operand 3 "memory_operand" ""))
- (clobber (scratch))]
+ (clobber (match_scratch 4))]
"reload_completed"
[(parallel
[(unspec [(match_dup 2) (match_dup 3)
@@ -4072,7 +4075,7 @@
(match_operand:BLK 1 "memory_operand" "")))
(use (match_operand 2 "register_operand" ""))
(use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
- (clobber (scratch))]
+ (clobber (match_scratch 3))]
"TARGET_Z10 && reload_completed"
[(parallel
[(unspec [(match_dup 2) (const_int 0)
@@ -4940,7 +4943,7 @@
(unspec:DI [(match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "register_operand" "d")]
UNSPEC_BDEPG))]
- "TARGET_ARCH15 && TARGET_64BIT"
+ "TARGET_Z17 && TARGET_64BIT"
"bdepg\t%0,%1,%2"
[(set_attr "op_type" "RRF")])
@@ -4953,7 +4956,7 @@
(unspec:DI [(match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "register_operand" "d")]
UNSPEC_BEXTG))]
- "TARGET_ARCH15 && TARGET_64BIT"
+ "TARGET_Z17 && TARGET_64BIT"
"bextg\t%0,%1,%2"
[(set_attr "op_type" "RRF")])
@@ -9580,7 +9583,7 @@
(clz:DI (match_operand:DI 1 "register_operand" "d")))]
"TARGET_EXTIMM && TARGET_ZARCH"
{
- if (!(TARGET_ARCH15 && TARGET_64BIT))
+ if (!(TARGET_Z17 && TARGET_64BIT))
{
rtx_insn *insn;
rtx clz_equal;
@@ -9601,7 +9604,7 @@
(define_insn "*clzg"
[(set (match_operand:DI 0 "register_operand" "=d")
(clz:DI (match_operand:DI 1 "register_operand" "d")))]
- "TARGET_ARCH15 && TARGET_64BIT"
+ "TARGET_Z17 && TARGET_64BIT"
"clzg\t%0,%1"
[(set_attr "op_type" "RRE")])
@@ -9630,7 +9633,7 @@
(define_insn "ctzdi2"
[(set (match_operand:DI 0 "register_operand" "=d")
(ctz:DI (match_operand:DI 1 "register_operand" "d")))]
- "TARGET_ARCH15 && TARGET_64BIT"
+ "TARGET_Z17 && TARGET_64BIT"
"ctzg\t%0,%1"
[(set_attr "op_type" "RRE")])
diff --git a/gcc/config/s390/s390.opt b/gcc/config/s390/s390.opt
index f064597..6753a93 100644
--- a/gcc/config/s390/s390.opt
+++ b/gcc/config/s390/s390.opt
@@ -122,7 +122,10 @@ EnumValue
Enum(processor_type) String(z16) Value(PROCESSOR_3931_Z16)
EnumValue
-Enum(processor_type) String(arch15) Value(PROCESSOR_ARCH15)
+Enum(processor_type) String(arch15) Value(PROCESSOR_9175_Z17)
+
+EnumValue
+Enum(processor_type) String(z17) Value(PROCESSOR_9175_Z17)
EnumValue
Enum(processor_type) String(native) Value(PROCESSOR_NATIVE) DriverOnly
diff --git a/gcc/config/sh/sh-modes.def b/gcc/config/sh/sh-modes.def
index 80650b4..e31ae69 100644
--- a/gcc/config/sh/sh-modes.def
+++ b/gcc/config/sh/sh-modes.def
@@ -17,6 +17,12 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+/* SH has the same reversed quiet bit as MIPS. */
+RESET_FLOAT_FORMAT (SF, mips_single_format);
+RESET_FLOAT_FORMAT (DF, mips_double_format);
+/* TFmode: IEEE quad floating point (software). */
+FLOAT_MODE (TF, 16, mips_quad_format);
+
/* Vector modes. */
VECTOR_MODE (INT, QI, 2); /* V2QI */
VECTOR_MODES (INT, 4); /* V4QI V2HI */
diff --git a/gcc/configure b/gcc/configure
index ab6bec1..1696595 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -3948,7 +3948,7 @@ if test x"${DEFAULT_LINKER+set}" = x"set"; then
as_fn_error $? "cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" "$LINENO" 5
elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
gnu_ld_flag=yes
- elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep ld64- > /dev/null; then
+ elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep 'PROJECT:ld\(64\)*-' > /dev/null; then
ld64_flag=yes
fi
@@ -12694,6 +12694,42 @@ $as_echo "#define HOST_HAS_O_NONBLOCK 1" >>confdefs.h
fi
+# Check if personality and ADDR_NO_RANDOMIZE are declared
+# in sys/personality.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for personality ADDR_NO_RANDOMIZE" >&5
+$as_echo_n "checking for personality ADDR_NO_RANDOMIZE... " >&6; }
+if ${ac_cv_personality_addr_no_randomize+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/personality.h>
+int
+main ()
+{
+
+personality (personality (0xffffffffU) | ADDR_NO_RANDOMIZE);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_personality_addr_no_randomize=yes
+else
+ ac_cv_personality_addr_no_randomize=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_personality_addr_no_randomize" >&5
+$as_echo "$ac_cv_personality_addr_no_randomize" >&6; }
+if test $ac_cv_personality_addr_no_randomize = yes; then
+
+$as_echo "#define HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE 1" >>confdefs.h
+
+fi
+
# C++ Modules would like some networking features to provide the mapping
# server. You can still use modules without them though.
@@ -21484,7 +21520,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 21487 "configure"
+#line 21523 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -21590,7 +21626,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 21593 "configure"
+#line 21629 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -32694,8 +32730,9 @@ $as_echo "$gcc_cv_ld64_major" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker version" >&5
$as_echo_n "checking linker version... " >&6; }
if test x"${gcc_cv_ld64_version}" = x; then
- gcc_cv_ld64_version=`$gcc_cv_ld -v 2>&1 | $EGREP 'ld64|dyld' \
- | sed -e 's/.*ld64-//' -e 's/.*dyld-//'| awk '{print $1}'`
+ gcc_cv_ld64_version=`$gcc_cv_ld -v 2>&1 | $EGREP 'ld64|dyld|PROJECT:ld' \
+ | sed -e 's/.*ld64-//' -e 's/.*dyld-//' -e 's/.*PROJECT:ld-//' \
+ | awk '{print $1}'`
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld64_version" >&5
$as_echo "$gcc_cv_ld64_version" >&6; }
diff --git a/gcc/configure.ac b/gcc/configure.ac
index fca0579..9f67e62 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -358,7 +358,7 @@ if test x"${DEFAULT_LINKER+set}" = x"set"; then
AC_MSG_ERROR([cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER])
elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
gnu_ld_flag=yes
- elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep ld64- > /dev/null; then
+ elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep 'PROJECT:ld\(64\)*-' > /dev/null; then
ld64_flag=yes
fi
AC_DEFINE_UNQUOTED(DEFAULT_LINKER,"$DEFAULT_LINKER",
@@ -1781,6 +1781,21 @@ if test $ac_cv_have_decl_O_NONBLOCK = yes; then
[Define if O_NONBLOCK supported by fcntl.])
fi
+# Check if personality and ADDR_NO_RANDOMIZE are declared
+# in sys/personality.h
+AC_CACHE_CHECK(for personality ADDR_NO_RANDOMIZE,
+ ac_cv_personality_addr_no_randomize, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/personality.h>]], [[
+personality (personality (0xffffffffU) | ADDR_NO_RANDOMIZE);]])],
+[ac_cv_personality_addr_no_randomize=yes],
+[ac_cv_personality_addr_no_randomize=no])])
+if test $ac_cv_personality_addr_no_randomize = yes; then
+ AC_DEFINE(HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE, 1,
+ [Define if personality and ADDR_NO_RANDOMIZE are declared in
+sys/personality.h.])
+fi
+
# C++ Modules would like some networking features to provide the mapping
# server. You can still use modules without them though.
@@ -6403,8 +6418,9 @@ if test x"$ld64_flag" = x"yes"; then
# If the version was not specified, try to find it.
AC_MSG_CHECKING(linker version)
if test x"${gcc_cv_ld64_version}" = x; then
- gcc_cv_ld64_version=`$gcc_cv_ld -v 2>&1 | $EGREP 'ld64|dyld' \
- | sed -e 's/.*ld64-//' -e 's/.*dyld-//'| awk '{print $1}'`
+ gcc_cv_ld64_version=`$gcc_cv_ld -v 2>&1 | $EGREP 'ld64|dyld|PROJECT:ld' \
+ | sed -e 's/.*ld64-//' -e 's/.*dyld-//' -e 's/.*PROJECT:ld-//' \
+ | awk '{print $1}'`
fi
AC_MSG_RESULT($gcc_cv_ld64_version)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d266ef9..6975efb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,183 @@
+2025-04-19 Jason Merrill <jason@redhat.com>
+
+ * coroutines.cc (coro_build_expr_stmt)
+ (coro_build_cvt_void_expr_stmt): Remove.
+ (build_actor_fn): Use finish_expr_stmt.
+ * semantics.cc (finish_expr_stmt): Avoid wrapping statement in
+ EXPR_STMT.
+ (finish_stmt_expr_expr): Add comment.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ * constexpr.cc (is_valid_constexpr_fn): Improve diagnostic.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ * constexpr.cc (cxx_eval_outermost_constant_expr): Give both
+ expression and allocation location in allocated storage diagnostics.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ * name-lookup.cc (name_lookup::preserve_state): Fix reserve call.
+ * rtti.cc (get_tinfo_desc): Use vec_safe_grow_cleared.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ * semantics.cc (finish_type_pack_element): Add more info
+ to diagnostics.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ * decl.cc (cp_make_fname_decl): Prevent silent failure.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ * lex.cc (unqualified_name_lookup_error): Handle 'requires' better.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/113360
+ * cp-tree.h (struct language_function): Add erroneous bit.
+ * constexpr.cc (explain_invalid_constexpr_fn): Return if set.
+ (cxx_eval_call_expression): Quiet if set.
+ * parser.cc (cp_parser_function_definition_after_declarator)
+ * pt.cc (instantiate_body): Set it.
+
+2025-04-16 Jason Merrill <jason@redhat.com>
+
+ PR c++/114772
+ PR c++/101180
+ * pt.cc (apply_late_template_attributes): Also override
+ target_option_current_node.
+
+2025-04-16 Jason Merrill <jason@redhat.com>
+
+ PR c++/116954
+ * contracts.cc (remove_contract_attributes): Preserve flags
+ on the attribute list.
+
+2025-04-15 Nathaniel Shead <nathanieloshead@gmail.com>
+
+ PR c++/119755
+ * lambda.cc (prune_lambda_captures): Remove pruned capture from
+ function's BLOCK_VARS and BIND_EXPR_VARS.
+
+2025-04-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/111075
+ * constexpr.cc (cxx_eval_call_expression): Allow trivial
+ call from a thunk.
+
+2025-04-15 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/119807
+ PR c++/112288
+ * pt.cc (tsubst_friend_function): Skip remapping an
+ existing specialization if it doesn't match the shape of
+ the new friend definition.
+
+2025-04-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/113835
+ * constexpr.cc (cxx_eval_outermost_constant_expr): Bail out early
+ for std::vector(N).
+
+2025-04-14 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/99214
+ * constraint.cc (satisfy_declaration_constraints): Pass the
+ original ARGS to push_tinst_level.
+
+2025-04-13 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/115639
+ * constexpr.cc (struct constexpr_call): Add NSDMIs to each
+ field. Replace 'result' data member with 3-element 'results'
+ array and a 'result' accessor function. Remove
+ 'manifestly_const_eval' data member.
+ (constexpr_call_hasher::equal): Adjust after constexpr_call
+ layout change.
+ (cxx_eval_call_expression): Likewise. Define some local
+ variables closer to their first use. Use unknown_type_node
+ instead of NULL_TREE as the "in progress" result. After
+ successully evaluating a call with mce_unknown, also cache the
+ result in the corresponding mce_true and mce_false slots.
+
+2025-04-13 Nathaniel Shead <nathanieloshead@gmail.com>
+
+ * module.cc (trees_in::is_matching_decl): Don't check for
+ mismatches when importing a DECL_MAYBE_DELETED function over one
+ that's already finished.
+
+2025-04-13 Nathaniel Shead <nathanieloshead@gmail.com>
+
+ * module.cc (trees_in::is_matching_decl): Add custom errors for
+ different kinds of mismatches.
+
+2025-04-12 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/116416
+ * constexpr.cc (maybe_constant_init_1): Generalize type of
+ of manifestly_const_eval parameter from bool to mce_value.
+ (maybe_constant_init): Define 3-parameter version taking a
+ manifestly_const_eval instead of bool parameter.
+ (cxx_constant_init): Adjust.
+ * cp-gimplify.cc (cp_fold_r) <case TARGET_EXPR>: Pass mce_false
+ to maybe_constant_init during prvalue folding if ff_mce_false is
+ set.
+ * cp-tree.h (maybe_constant_init): Declare new overload.
+
+2025-04-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/114970
+ * cp-gimplify.cc (cp_build_init_expr_for_ctor): Suppress warnings on
+ return_this COMPOUND_EXPR.
+
+2025-04-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/119345
+ * pt.cc (add_extra_args): Also register a specialization
+ of the captured variable.
+
+2025-04-10 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/119687
+ * pt.cc (alias_ctad_tweaks): Use lkp_range / lkp_iterator
+ instead of ovl_iterator.
+
+2025-04-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR translation/119684
+ * error.cc (cp_print_error_function): Use G_ instead of _ for
+ pp_printf arguments.
+ (function_category): Use G_ instead of _.
+ (print_instantiation_full_context): Use G_ instead of _ in pp_verbatim
+ arguments.
+ (print_location): Likewise.
+ (print_instantiation_partial_context): Likewise.
+ (maybe_print_constexpr_context): Likewise.
+ (print_constrained_decl_info): Use G_() around pp_verbatim argument.
+ (print_concept_check_info): Likewise.
+ (print_constraint_context_head): Likewise.
+ (print_requires_expression_info): Likewise. Merge separate pp_verbatim
+ "in requirements " and "with " into one with conditional messages.
+
+2025-04-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/119175
+ * mangle.cc (decl_mangling_context): Look through lambda type.
+
+2025-04-09 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/119574
+ * pt.cc (add_extra_args): Remove checking assert.
+
+2025-04-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/118698
+ * constraint.cc (struct norm_info): Add tf_partial.
+ * pt.cc (any_template_parm_r): Handle LAMBDA_EXPR_EXTRA_ARGS.
+
2025-04-08 Jason Merrill <jason@redhat.com>
PR c++/117530
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
index 497f64f..f56c5c4 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -307,7 +307,14 @@ is_valid_constexpr_fn (tree fun, bool complain)
{
ret = false;
if (complain)
- error ("%q#T has virtual base classes", DECL_CONTEXT (fun));
+ {
+ if (DECL_CONSTRUCTOR_P (fun))
+ error ("%<constexpr%> constructor in %q#T that has "
+ "virtual base classes", DECL_CONTEXT (fun));
+ else
+ error ("%<constexpr%> destructor in %q#T that has "
+ "virtual base classes", DECL_CONTEXT (fun));
+ }
}
return ret;
@@ -1048,6 +1055,12 @@ explain_invalid_constexpr_fn (tree fun)
{
static hash_set<tree> *diagnosed;
tree body;
+
+ /* Don't try to explain a function we already complained about. */
+ if (function *f = DECL_STRUCT_FUNCTION (fun))
+ if (f->language->erroneous)
+ return;
+
/* In C++23, a function marked 'constexpr' may not actually be a constant
expression. We haven't diagnosed the problem yet: -Winvalid-constexpr
wasn't enabled. The function was called, so diagnose why it cannot be
@@ -1119,20 +1132,22 @@ explain_invalid_constexpr_fn (tree fun)
struct GTY((for_user)) constexpr_call {
/* Description of the constexpr function definition. */
- constexpr_fundef *fundef;
+ constexpr_fundef *fundef = nullptr;
/* Parameter bindings environment. A TREE_VEC of arguments. */
- tree bindings;
- /* Result of the call.
- NULL means the call is being evaluated.
+ tree bindings = NULL_TREE;
+ /* Result of the call, indexed by the value of
+ constexpr_ctx::manifestly_const_eval.
+ unknown_type_node means the call is being evaluated.
error_mark_node means that the evaluation was erroneous or otherwise
uncacheable (e.g. because it depends on the caller).
Otherwise, the actual value of the call. */
- tree result;
+ tree results[3] = { NULL_TREE, NULL_TREE, NULL_TREE };
/* The hash of this call; we remember it here to avoid having to
recalculate it when expanding the hash table. */
- hashval_t hash;
- /* The value of constexpr_ctx::manifestly_const_eval. */
- enum mce_value manifestly_const_eval;
+ hashval_t hash = 0;
+
+ /* The result slot corresponding to the given mce_value. */
+ tree& result (mce_value mce) { return results[1 + int(mce)]; }
};
struct constexpr_call_hasher : ggc_ptr_hash<constexpr_call>
@@ -1427,8 +1442,6 @@ constexpr_call_hasher::equal (constexpr_call *lhs, constexpr_call *rhs)
return true;
if (lhs->hash != rhs->hash)
return false;
- if (lhs->manifestly_const_eval != rhs->manifestly_const_eval)
- return false;
if (!constexpr_fundef_hasher::equal (lhs->fundef, rhs->fundef))
return false;
return cp_tree_equal (lhs->bindings, rhs->bindings);
@@ -2855,9 +2868,6 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
{
location_t loc = cp_expr_loc_or_input_loc (t);
tree fun = get_function_named_in_call (t);
- constexpr_call new_call
- = { NULL, NULL, NULL, 0, ctx->manifestly_const_eval };
- int depth_ok;
if (fun == NULL_TREE)
return cxx_eval_internal_function (ctx, t, lval,
@@ -3082,6 +3092,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
}
constexpr_ctx new_ctx = *ctx;
+ ctx = &new_ctx;
if (DECL_CONSTRUCTOR_P (fun) && !ctx->object
&& TREE_CODE (t) == AGGR_INIT_EXPR)
{
@@ -3091,27 +3102,26 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
tree ctor = new_ctx.ctor = build_constructor (DECL_CONTEXT (fun), NULL);
CONSTRUCTOR_NO_CLEARING (ctor) = true;
ctx->global->put_value (new_ctx.object, ctor);
- ctx = &new_ctx;
}
/* An immediate invocation is manifestly constant evaluated including the
arguments of the call, so use mce_true even for the argument
evaluation. */
if (DECL_IMMEDIATE_FUNCTION_P (fun))
- {
- new_ctx.manifestly_const_eval = mce_true;
- new_call.manifestly_const_eval = mce_true;
- ctx = &new_ctx;
- }
+ new_ctx.manifestly_const_eval = mce_true;
/* We used to shortcut trivial constructor/op= here, but nowadays
we can only get a trivial function here with -fno-elide-constructors. */
gcc_checking_assert (!trivial_fn_p (fun)
|| !flag_elide_constructors
+ /* Or it's a call from maybe_thunk_body (111075). */
+ || (TREE_CODE (t) == CALL_EXPR ? CALL_FROM_THUNK_P (t)
+ : AGGR_INIT_FROM_THUNK_P (t))
/* We don't elide constructors when processing
a noexcept-expression. */
|| cp_noexcept_operand);
bool non_constant_args = false;
+ constexpr_call new_call;
new_call.bindings
= cxx_bind_parameters_in_call (ctx, t, fun, non_constant_p,
overflow_p, &non_constant_args);
@@ -3185,7 +3195,12 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
}
}
- depth_ok = push_cx_call_context (t);
+ /* Don't complain about problems evaluating an ill-formed function. */
+ if (function *f = DECL_STRUCT_FUNCTION (fun))
+ if (f->language->erroneous)
+ new_ctx.quiet = true;
+
+ int depth_ok = push_cx_call_context (t);
/* Remember the object we are constructing or destructing. */
tree new_obj = NULL_TREE;
@@ -3227,8 +3242,6 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
new_call.hash = constexpr_fundef_hasher::hash (new_call.fundef);
new_call.hash
= iterative_hash_template_arg (new_call.bindings, new_call.hash);
- new_call.hash
- = iterative_hash_object (ctx->manifestly_const_eval, new_call.hash);
/* If we have seen this call before, we are done. */
maybe_initialize_constexpr_call_table ();
@@ -3246,22 +3259,23 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
the slot can move during evaluation of the body. */
*slot = entry = ggc_alloc<constexpr_call> ();
*entry = new_call;
+ entry->result (ctx->manifestly_const_eval) = unknown_type_node;
fb.preserve ();
}
}
- /* Calls that are in progress have their result set to NULL, so that we
- can detect circular dependencies. Now that we only cache up to
- constexpr_cache_depth this won't catch circular dependencies that
+ /* Calls that are in progress have their result set to unknown_type_node,
+ so that we can detect circular dependencies. Now that we only cache
+ up to constexpr_cache_depth this won't catch circular dependencies that
start deeper, but they'll hit the recursion or ops limit. */
- else if (entry->result == NULL)
+ else if (entry->result (ctx->manifestly_const_eval) == unknown_type_node)
{
if (!ctx->quiet)
error ("call has circular dependency");
*non_constant_p = true;
- entry->result = result = error_mark_node;
+ entry->result (ctx->manifestly_const_eval) = result = error_mark_node;
}
else
- result = entry->result;
+ result = entry->result (ctx->manifestly_const_eval);
}
if (!depth_ok)
@@ -3482,7 +3496,22 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
else if (!result)
result = void_node;
if (entry)
- entry->result = cacheable ? result : error_mark_node;
+ {
+ entry->result (ctx->manifestly_const_eval)
+ = cacheable ? result : error_mark_node;
+
+ if (result != error_mark_node
+ && ctx->manifestly_const_eval == mce_unknown)
+ {
+ /* Evaluation succeeded and was independent of whether we're in a
+ manifestly constant-evaluated context, so we can also reuse
+ this result when evaluating this call with a fixed context. */
+ if (!entry->result (mce_true))
+ entry->result (mce_true) = entry->result (mce_unknown);
+ if (!entry->result (mce_false))
+ entry->result (mce_false) = entry->result (mce_unknown);
+ }
+ }
}
/* The result of a constexpr function must be completely initialized.
@@ -9116,6 +9145,15 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant,
tree fndecl = cp_get_callee_fndecl_nofold (x);
if (fndecl && DECL_IMMEDIATE_FUNCTION_P (fndecl))
is_consteval = true;
+ /* Don't try to evaluate a std::vector constructor taking an integer, it
+ will fail in the 'if (heap_var)' block below after doing all the work
+ (c++/113835). This will need adjustment if P3554 is accepted. Note
+ that evaluation of e.g. the vector default constructor can succeed, so
+ we don't shortcut all vector constructors. */
+ if (fndecl && DECL_CONSTRUCTOR_P (fndecl) && allow_non_constant
+ && is_std_class (type, "vector") && call_expr_nargs (x) > 1
+ && TREE_CODE (TREE_TYPE (get_nth_callarg (x, 1))) == INTEGER_TYPE)
+ return t;
}
if (AGGREGATE_TYPE_P (type) || VECTOR_TYPE_P (type))
{
@@ -9231,9 +9269,11 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant,
if (heap_var)
{
if (!allow_non_constant && !non_constant_p)
- error_at (DECL_SOURCE_LOCATION (heap_var),
- "%qE is not a constant expression because it refers to "
- "a result of %<operator new%>", t);
+ {
+ error ("%qE is not a constant expression because it refers to "
+ "a result of %<operator new%>", t);
+ inform (DECL_SOURCE_LOCATION (heap_var), "allocated here");
+ }
r = t;
non_constant_p = true;
}
@@ -9242,9 +9282,11 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant,
if (DECL_NAME (heap_var) != heap_deleted_identifier)
{
if (!allow_non_constant && !non_constant_p)
- error_at (DECL_SOURCE_LOCATION (heap_var),
- "%qE is not a constant expression because allocated "
- "storage has not been deallocated", t);
+ {
+ error ("%qE is not a constant expression because allocated "
+ "storage has not been deallocated", t);
+ inform (DECL_SOURCE_LOCATION (heap_var), "allocated here");
+ }
r = t;
non_constant_p = true;
}
@@ -9679,7 +9721,7 @@ fold_non_dependent_init (tree t,
static tree
maybe_constant_init_1 (tree t, tree decl, bool allow_non_constant,
- bool manifestly_const_eval)
+ mce_value manifestly_const_eval)
{
if (!t)
return t;
@@ -9709,13 +9751,13 @@ maybe_constant_init_1 (tree t, tree decl, bool allow_non_constant,
bool is_static = (decl && DECL_P (decl)
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)));
if (is_static)
- manifestly_const_eval = true;
+ manifestly_const_eval = mce_true;
- if (cp_unevaluated_operand && !manifestly_const_eval)
+ if (cp_unevaluated_operand && manifestly_const_eval != mce_true)
return fold_to_constant (t);
t = cxx_eval_outermost_constant_expr (t, allow_non_constant, !is_static,
- mce_value (manifestly_const_eval),
+ manifestly_const_eval,
false, decl);
}
if (TREE_CODE (t) == TARGET_EXPR)
@@ -9732,6 +9774,12 @@ maybe_constant_init_1 (tree t, tree decl, bool allow_non_constant,
tree
maybe_constant_init (tree t, tree decl, bool manifestly_const_eval)
{
+ return maybe_constant_init_1 (t, decl, true, mce_value (manifestly_const_eval));
+}
+
+tree
+maybe_constant_init (tree t, tree decl, mce_value manifestly_const_eval)
+{
return maybe_constant_init_1 (t, decl, true, manifestly_const_eval);
}
@@ -9740,7 +9788,7 @@ maybe_constant_init (tree t, tree decl, bool manifestly_const_eval)
tree
cxx_constant_init (tree t, tree decl)
{
- return maybe_constant_init_1 (t, decl, false, true);
+ return maybe_constant_init_1 (t, decl, false, mce_true);
}
#if 0
diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc
index 2f1678c..44fb086 100644
--- a/gcc/cp/constraint.cc
+++ b/gcc/cp/constraint.cc
@@ -2704,6 +2704,8 @@ satisfy_declaration_constraints (tree t, sat_info info)
static tree
satisfy_declaration_constraints (tree t, tree args, sat_info info)
{
+ tree orig_args = args;
+
/* Update the declaration for diagnostics. */
info.in_decl = t;
@@ -2732,7 +2734,7 @@ satisfy_declaration_constraints (tree t, tree args, sat_info info)
tree result = boolean_true_node;
if (tree norm = get_normalized_constraints_from_decl (t, info.noisy ()))
{
- if (!push_tinst_level (t, args))
+ if (!push_tinst_level (t, orig_args))
return result;
tree pattern = DECL_TEMPLATE_RESULT (t);
push_to_top_level ();
diff --git a/gcc/cp/contracts.cc b/gcc/cp/contracts.cc
index f2b126c..3ca2102 100644
--- a/gcc/cp/contracts.cc
+++ b/gcc/cp/contracts.cc
@@ -863,7 +863,11 @@ remove_contract_attributes (tree fndecl)
tree list = NULL_TREE;
for (tree p = DECL_ATTRIBUTES (fndecl); p; p = TREE_CHAIN (p))
if (!cxx_contract_attribute_p (p))
- list = tree_cons (TREE_PURPOSE (p), TREE_VALUE (p), list);
+ {
+ tree nl = copy_node (p);
+ TREE_CHAIN (nl) = list;
+ list = nl;
+ }
DECL_ATTRIBUTES (fndecl) = nreverse (list);
}
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index b92d09f..743da06 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -1852,21 +1852,6 @@ coro_build_frame_access_expr (tree coro_ref, tree member_id, bool preserve_ref,
return expr;
}
-/* Helpers to build EXPR_STMT and void-cast EXPR_STMT, common ops. */
-
-static tree
-coro_build_expr_stmt (tree expr, location_t loc)
-{
- return maybe_cleanup_point_expr_void (build_stmt (loc, EXPR_STMT, expr));
-}
-
-static tree
-coro_build_cvt_void_expr_stmt (tree expr, location_t loc)
-{
- tree t = build1 (CONVERT_EXPR, void_type_node, expr);
- return coro_build_expr_stmt (t, loc);
-}
-
/* Helpers to build an artificial var, with location LOC, NAME and TYPE, in
CTX, and with initializer INIT. */
@@ -2582,8 +2567,7 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody,
tree hfa = build_new_method_call (ash, hfa_m, &args, NULL_TREE, LOOKUP_NORMAL,
NULL, tf_warning_or_error);
r = cp_build_init_expr (ash, hfa);
- r = coro_build_cvt_void_expr_stmt (r, loc);
- add_stmt (r);
+ finish_expr_stmt (r);
release_tree_vector (args);
/* Now we know the real promise, and enough about the frame layout to
@@ -2678,8 +2662,7 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody,
we must tail call them. However, some targets do not support indirect
tail calls to arbitrary callees. See PR94359. */
CALL_EXPR_TAILCALL (resume) = true;
- resume = coro_build_cvt_void_expr_stmt (resume, loc);
- add_stmt (resume);
+ finish_expr_stmt (resume);
r = build_stmt (loc, RETURN_EXPR, NULL);
gcc_checking_assert (maybe_cleanup_point_expr_void (r) == r);
diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc
index 550cea29..d2423fd 100644
--- a/gcc/cp/cp-gimplify.cc
+++ b/gcc/cp/cp-gimplify.cc
@@ -1199,8 +1199,11 @@ cp_build_init_expr_for_ctor (tree call, tree init)
tree s = build_fold_indirect_ref_loc (loc, a);
init = cp_build_init_expr (s, init);
if (return_this)
- init = build2_loc (loc, COMPOUND_EXPR, TREE_TYPE (call), init,
- fold_convert_loc (loc, TREE_TYPE (call), a));
+ {
+ init = build2_loc (loc, COMPOUND_EXPR, TREE_TYPE (call), init,
+ fold_convert_loc (loc, TREE_TYPE (call), a));
+ suppress_warning (init);
+ }
return init;
}
@@ -1480,7 +1483,9 @@ cp_fold_r (tree *stmt_p, int *walk_subtrees, void *data_)
*walk_subtrees = 0;
if (!flag_no_inline)
{
- tree folded = maybe_constant_init (init, TARGET_EXPR_SLOT (stmt));
+ tree folded = maybe_constant_init (init, TARGET_EXPR_SLOT (stmt),
+ (data->flags & ff_mce_false
+ ? mce_false : mce_unknown));
if (folded != init && TREE_CONSTANT (folded))
init = folded;
}
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 927f51b..7798efb 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -2206,6 +2206,8 @@ struct GTY(()) language_function {
BOOL_BITFIELD invalid_constexpr : 1;
BOOL_BITFIELD throwing_cleanup : 1;
+ /* True if we gave any errors in this function. */
+ BOOL_BITFIELD erroneous : 1;
hash_table<named_label_hash> *x_named_labels;
@@ -8837,6 +8839,7 @@ extern void cxx_constant_dtor (tree, tree);
extern tree cxx_constant_init (tree, tree = NULL_TREE);
extern tree maybe_constant_value (tree, tree = NULL_TREE, mce_value = mce_unknown);
extern tree maybe_constant_init (tree, tree = NULL_TREE, bool = false);
+extern tree maybe_constant_init (tree, tree, mce_value);
extern tree fold_non_dependent_expr (tree,
tsubst_flags_t = tf_warning_or_error,
bool = false, tree = NULL_TREE);
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc
index 4e97093..84398e5 100644
--- a/gcc/cp/decl.cc
+++ b/gcc/cp/decl.cc
@@ -5339,6 +5339,8 @@ cp_make_fname_decl (location_t loc, tree id, int type_dep)
decl = pushdecl_outermost_localscope (decl);
if (decl != error_mark_node)
add_decl_expr (decl);
+ else
+ gcc_assert (seen_error ());
}
else
{
diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc
index ec7527e..499eb1b 100644
--- a/gcc/cp/error.cc
+++ b/gcc/cp/error.cc
@@ -3788,18 +3788,18 @@ cp_print_error_function (diagnostic_text_output_format &text_output,
{
if (text_output.show_column_p () && s.column != 0)
pp_printf (pp,
- _(" inlined from %qD at %r%s:%d:%d%R"),
+ G_(" inlined from %qD at %r%s:%d:%d%R"),
fndecl,
"locus", s.file, s.line, s.column);
else
pp_printf (pp,
- _(" inlined from %qD at %r%s:%d%R"),
+ G_(" inlined from %qD at %r%s:%d%R"),
fndecl,
"locus", s.file, s.line);
}
else
- pp_printf (pp, _(" inlined from %qD"),
+ pp_printf (pp, G_(" inlined from %qD"),
fndecl);
}
}
@@ -3825,22 +3825,22 @@ function_category (tree fn)
&& DECL_FUNCTION_MEMBER_P (fn))
{
if (DECL_STATIC_FUNCTION_P (fn))
- return _("In static member function %qD");
+ return G_("In static member function %qD");
else if (DECL_COPY_CONSTRUCTOR_P (fn))
- return _("In copy constructor %qD");
+ return G_("In copy constructor %qD");
else if (DECL_CONSTRUCTOR_P (fn))
- return _("In constructor %qD");
+ return G_("In constructor %qD");
else if (DECL_DESTRUCTOR_P (fn))
- return _("In destructor %qD");
+ return G_("In destructor %qD");
else if (LAMBDA_FUNCTION_P (fn))
- return _("In lambda function");
+ return G_("In lambda function");
else if (DECL_XOBJ_MEMBER_FUNCTION_P (fn))
- return _("In explicit object member function %qD");
+ return G_("In explicit object member function %qD");
else
- return _("In member function %qD");
+ return G_("In member function %qD");
}
else
- return _("In function %qD");
+ return G_("In function %qD");
}
/* Disable warnings about missing quoting in GCC diagnostics for
@@ -3867,8 +3867,8 @@ print_instantiation_full_context (diagnostic_text_output_format &text_output)
char *indent = text_output.build_indent_prefix (true);
pp_verbatim (text_output.get_printer (),
p->list_p ()
- ? _("%s%s%sIn substitution of %qS:\n")
- : _("%s%s%sIn instantiation of %q#D:\n"),
+ ? G_("%s%s%sIn substitution of %qS:\n")
+ : G_("%s%s%sIn instantiation of %q#D:\n"),
indent,
show_file ? LOCATION_FILE (location) : "",
show_file ? ": " : "",
@@ -3888,10 +3888,10 @@ print_location (diagnostic_text_output_format &text_output,
expanded_location xloc = expand_location (loc);
pretty_printer *const pp = text_output.get_printer ();
if (text_output.show_column_p ())
- pp_verbatim (pp, _("%r%s:%d:%d:%R "),
+ pp_verbatim (pp, G_("%r%s:%d:%d:%R "),
"locus", xloc.file, xloc.line, xloc.column);
else
- pp_verbatim (pp, _("%r%s:%d:%R "),
+ pp_verbatim (pp, G_("%r%s:%d:%R "),
"locus", xloc.file, xloc.line);
}
@@ -3984,22 +3984,22 @@ print_instantiation_partial_context_line (diagnostic_text_output_format &text_ou
if (t->list_p ())
pp_verbatim (pp,
recursive_p
- ? _("recursively required by substitution of %qS\n")
- : _("required by substitution of %qS\n"),
+ ? G_("recursively required by substitution of %qS\n")
+ : G_("required by substitution of %qS\n"),
t->get_node ());
else
pp_verbatim (pp,
recursive_p
- ? _("recursively required from %q#D\n")
- : _("required from %q#D\n"),
+ ? G_("recursively required from %q#D\n")
+ : G_("required from %q#D\n"),
t->get_node ());
}
else
{
pp_verbatim (pp,
recursive_p
- ? _("recursively required from here\n")
- : _("required from here\n"));
+ ? G_("recursively required from here\n")
+ : G_("required from here\n"));
}
}
@@ -4049,8 +4049,8 @@ print_instantiation_partial_context (diagnostic_text_output_format &text_output,
{
auto_context_line sentinel (text_output, loc);
pp_verbatim (text_output.get_printer (),
- _("[ skipping %d instantiation contexts,"
- " use -ftemplate-backtrace-limit=0 to disable ]\n"),
+ G_("[ skipping %d instantiation contexts,"
+ " use -ftemplate-backtrace-limit=0 to disable ]\n"),
skip);
do {
loc = t->locus;
@@ -4101,7 +4101,7 @@ maybe_print_constexpr_context (diagnostic_text_output_format &text_output)
pretty_printer *const pp = text_output.get_printer ();
auto_context_line sentinel (text_output, EXPR_LOCATION (t));
pp_verbatim (pp,
- _("in %<constexpr%> expansion of %qs"),
+ G_("in %<constexpr%> expansion of %qs"),
s);
pp_newline (pp);
}
@@ -4114,7 +4114,7 @@ print_constrained_decl_info (diagnostic_text_output_format &text_output,
{
auto_context_line sentinel (text_output, DECL_SOURCE_LOCATION (decl));
pretty_printer *const pp = text_output.get_printer ();
- pp_verbatim (pp, "required by the constraints of %q#D\n", decl);
+ pp_verbatim (pp, G_("required by the constraints of %q#D\n"), decl);
}
static void
@@ -4129,7 +4129,7 @@ print_concept_check_info (diagnostic_text_output_format &text_output,
cxx_pretty_printer *const pp
= (cxx_pretty_printer *)text_output.get_printer ();
- pp_verbatim (pp, "required for the satisfaction of %qE", expr);
+ pp_verbatim (pp, G_("required for the satisfaction of %qE"), expr);
if (map && map != error_mark_node)
{
tree subst_map = tsubst_parameter_mapping (map, args, tf_none, NULL_TREE);
@@ -4151,7 +4151,7 @@ print_constraint_context_head (diagnostic_text_output_format &text_output,
{
auto_context_line sentinel (text_output, input_location);
pretty_printer *const pp = text_output.get_printer ();
- pp_verbatim (pp, "required for constraint satisfaction\n");
+ pp_verbatim (pp, G_("required for constraint satisfaction\n"));
return NULL_TREE;
}
if (DECL_P (src))
@@ -4180,11 +4180,10 @@ print_requires_expression_info (diagnostic_text_output_format &text_output,
auto_context_line sentinel (text_output, cp_expr_loc_or_input_loc (expr));
cxx_pretty_printer *const pp
= static_cast <cxx_pretty_printer *> (text_output.get_printer ());
- pp_verbatim (pp, "in requirements ");
tree parms = TREE_OPERAND (expr, 0);
- if (parms)
- pp_verbatim (pp, "with ");
+ pp_verbatim (pp, parms ? G_("in requirements with ")
+ : G_("in requirements "));
while (parms)
{
pp_verbatim (pp, "%q#D", parms);
diff --git a/gcc/cp/lambda.cc b/gcc/cp/lambda.cc
index f0a54b6..b2e0ecd 100644
--- a/gcc/cp/lambda.cc
+++ b/gcc/cp/lambda.cc
@@ -1858,6 +1858,13 @@ prune_lambda_captures (tree body)
cp_walk_tree_without_duplicates (&body, mark_const_cap_r, &const_vars);
+ tree bind_expr = expr_single (DECL_SAVED_TREE (lambda_function (lam)));
+ if (bind_expr && TREE_CODE (bind_expr) == MUST_NOT_THROW_EXPR)
+ bind_expr = expr_single (TREE_OPERAND (bind_expr, 0));
+ /* FIXME: We don't currently handle noexcept lambda captures correctly,
+ so bind_expr may not be set; see PR c++/119764. */
+ gcc_assert (!bind_expr || TREE_CODE (bind_expr) == BIND_EXPR);
+
tree *fieldp = &TYPE_FIELDS (LAMBDA_EXPR_CLOSURE (lam));
for (tree *capp = &LAMBDA_EXPR_CAPTURE_LIST (lam); *capp; )
{
@@ -1879,6 +1886,23 @@ prune_lambda_captures (tree body)
fieldp = &DECL_CHAIN (*fieldp);
*fieldp = DECL_CHAIN (*fieldp);
+ /* And out of the bindings for the function. */
+ tree *blockp = &BLOCK_VARS (current_binding_level->blocks);
+ while (*blockp != DECL_EXPR_DECL (**use))
+ blockp = &DECL_CHAIN (*blockp);
+ *blockp = DECL_CHAIN (*blockp);
+
+ /* And maybe out of the vars declared in the containing
+ BIND_EXPR, if it's listed there. */
+ if (bind_expr)
+ {
+ tree *bindp = &BIND_EXPR_VARS (bind_expr);
+ while (*bindp && *bindp != DECL_EXPR_DECL (**use))
+ bindp = &DECL_CHAIN (*bindp);
+ if (*bindp)
+ *bindp = DECL_CHAIN (*bindp);
+ }
+
/* And remove the capture proxy declaration. */
**use = void_node;
continue;
diff --git a/gcc/cp/lex.cc b/gcc/cp/lex.cc
index c12b084..12af81e 100644
--- a/gcc/cp/lex.cc
+++ b/gcc/cp/lex.cc
@@ -749,6 +749,9 @@ unqualified_name_lookup_error (tree name, location_t loc)
if (IDENTIFIER_ANY_OP_P (name))
error_at (loc, "%qD not defined", name);
+ else if (!flag_concepts && name == ridpointers[(int)RID_REQUIRES])
+ error_at (loc, "%<requires%> only available with %<-std=c++20%> or "
+ "%<-fconcepts%>");
else
{
if (!objc_diagnose_private_ivar (name))
diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc
index 02129c6..3d5e96b 100644
--- a/gcc/cp/mangle.cc
+++ b/gcc/cp/mangle.cc
@@ -1048,6 +1048,12 @@ decl_mangling_context (tree decl)
tree extra = LAMBDA_TYPE_EXTRA_SCOPE (TREE_TYPE (decl));
if (extra)
return extra;
+ tcontext = CP_DECL_CONTEXT (decl);
+ if (LAMBDA_TYPE_P (tcontext))
+ /* Lambda type context means this lambda appears between the
+ lambda-introducer and the open brace of another lambda (c++/119175).
+ That isn't a real scope; look further into the enclosing scope. */
+ return decl_mangling_context (TYPE_NAME (tcontext));
}
else if (template_type_parameter_p (decl))
/* template type parms have no mangling context. */
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 37fab5b..5ff5c46 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -12090,6 +12090,8 @@ trees_in::is_matching_decl (tree existing, tree decl, bool is_typedef)
gcc_checking_assert (TREE_CODE (e_inner) == TREE_CODE (d_inner));
}
+ // FIXME: do more precise errors at point of mismatch
+ const char *mismatch_msg = nullptr;
if (TREE_CODE (d_inner) == FUNCTION_DECL)
{
tree e_ret = fndecl_declared_return_type (existing);
@@ -12099,13 +12101,20 @@ trees_in::is_matching_decl (tree existing, tree decl, bool is_typedef)
&& LAMBDA_TYPE_P (DECL_CONTEXT (d_inner)))
/* This has a recursive type that will compare different. */;
else if (!same_type_p (d_ret, e_ret))
- goto mismatch;
+ {
+ mismatch_msg = G_("conflicting type for imported declaration %#qD");
+ goto mismatch;
+ }
tree e_type = TREE_TYPE (e_inner);
tree d_type = TREE_TYPE (d_inner);
if (DECL_EXTERN_C_P (d_inner) != DECL_EXTERN_C_P (e_inner))
- goto mismatch;
+ {
+ mismatch_msg = G_("conflicting language linkage for imported "
+ "declaration %#qD");
+ goto mismatch;
+ }
for (tree e_args = TYPE_ARG_TYPES (e_type),
d_args = TYPE_ARG_TYPES (d_type);
@@ -12113,10 +12122,18 @@ trees_in::is_matching_decl (tree existing, tree decl, bool is_typedef)
e_args = TREE_CHAIN (e_args), d_args = TREE_CHAIN (d_args))
{
if (!(e_args && d_args))
- goto mismatch;
+ {
+ mismatch_msg = G_("conflicting argument list for imported "
+ "declaration %#qD");
+ goto mismatch;
+ }
if (!same_type_p (TREE_VALUE (d_args), TREE_VALUE (e_args)))
- goto mismatch;
+ {
+ mismatch_msg = G_("conflicting argument types for imported "
+ "declaration %#qD");
+ goto mismatch;
+ }
}
/* If EXISTING has an undeduced or uninstantiated exception
@@ -12147,9 +12164,14 @@ trees_in::is_matching_decl (tree existing, tree decl, bool is_typedef)
}
}
}
- else if (!DEFERRED_NOEXCEPT_SPEC_P (d_spec)
+ else if (!DECL_MAYBE_DELETED (d_inner)
+ && !DEFERRED_NOEXCEPT_SPEC_P (d_spec)
&& !comp_except_specs (d_spec, e_spec, ce_type))
- goto mismatch;
+ {
+ mismatch_msg = G_("conflicting %<noexcept%> specifier for "
+ "imported declaration %#qD");
+ goto mismatch;
+ }
/* Similarly if EXISTING has an undeduced return type, but DECL's
is already deduced. */
@@ -12163,16 +12185,26 @@ trees_in::is_matching_decl (tree existing, tree decl, bool is_typedef)
}
else if (type_uses_auto (d_ret)
&& !same_type_p (TREE_TYPE (d_type), TREE_TYPE (e_type)))
- goto mismatch;
+ {
+ mismatch_msg = G_("conflicting deduced return type for "
+ "imported declaration %#qD");
+ goto mismatch;
+ }
/* Similarly if EXISTING has undeduced constexpr, but DECL's
is already deduced. */
if (DECL_MAYBE_DELETED (e_inner) && !DECL_MAYBE_DELETED (d_inner)
&& DECL_DECLARED_CONSTEXPR_P (d_inner))
DECL_DECLARED_CONSTEXPR_P (e_inner) = true;
+ else if (!DECL_MAYBE_DELETED (e_inner) && DECL_MAYBE_DELETED (d_inner))
+ /* Nothing to do. */;
else if (DECL_DECLARED_CONSTEXPR_P (e_inner)
!= DECL_DECLARED_CONSTEXPR_P (d_inner))
- goto mismatch;
+ {
+ mismatch_msg = G_("conflicting %<constexpr%> for imported "
+ "declaration %#qD");
+ goto mismatch;
+ }
/* Don't synthesize a defaulted function if we're importing one
we've already determined. */
@@ -12184,13 +12216,17 @@ trees_in::is_matching_decl (tree existing, tree decl, bool is_typedef)
if (!DECL_ORIGINAL_TYPE (e_inner)
|| !same_type_p (DECL_ORIGINAL_TYPE (d_inner),
DECL_ORIGINAL_TYPE (e_inner)))
- goto mismatch;
+ {
+ mismatch_msg = G_("conflicting imported declaration %q#D");
+ goto mismatch;
+ }
}
/* Using cp_tree_equal because we can meet TYPE_ARGUMENT_PACKs
here. I suspect the entities that directly do that are things
that shouldn't go to duplicate_decls (FIELD_DECLs etc). */
else if (!cp_tree_equal (TREE_TYPE (decl), TREE_TYPE (existing)))
{
+ mismatch_msg = G_("conflicting type for imported declaration %#qD");
mismatch:
if (DECL_IS_UNDECLARED_BUILTIN (existing))
/* Just like duplicate_decls, presum the user knows what
@@ -12203,11 +12239,9 @@ trees_in::is_matching_decl (tree existing, tree decl, bool is_typedef)
equality isn't feasible in general for local entities. */;
else
{
- // FIXME:QOI Might be template specialization from a module,
- // not necessarily global module
+ gcc_checking_assert (mismatch_msg);
auto_diagnostic_group d;
- error_at (DECL_SOURCE_LOCATION (decl),
- "conflicting global module declaration %#qD", decl);
+ error_at (DECL_SOURCE_LOCATION (decl), mismatch_msg, decl);
inform (DECL_SOURCE_LOCATION (existing),
"existing declaration %#qD", existing);
return false;
diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc
index 1cd982e..498126a 100644
--- a/gcc/cp/name-lookup.cc
+++ b/gcc/cp/name-lookup.cc
@@ -583,7 +583,7 @@ name_lookup::preserve_state ()
if (previous)
{
unsigned length = vec_safe_length (previous->scopes);
- vec_safe_reserve (previous->scopes, length * 2);
+ vec_safe_reserve (previous->scopes, length);
for (unsigned ix = length; ix--;)
{
tree decl = (*previous->scopes)[ix];
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 812a7c5..3628cfe 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -33634,6 +33634,8 @@ cp_parser_function_definition_after_declarator (cp_parser* parser,
= parser->num_template_parameter_lists;
parser->num_template_parameter_lists = 0;
+ int errs = errorcount + sorrycount;
+
/* If the next token is `try', `__transaction_atomic', or
`__transaction_relaxed`, then we are looking at either function-try-block
or function-transaction-block. Note that all of these include the
@@ -33653,6 +33655,9 @@ cp_parser_function_definition_after_declarator (cp_parser* parser,
fn = finish_function (inline_p);
check_module_decl_linkage (fn);
+ if ((errorcount + sorrycount) > errs)
+ DECL_STRUCT_FUNCTION (fn)->language->erroneous = true;
+
if (modules_p ()
&& !inline_p
&& TYPE_P (DECL_CONTEXT (fn))
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 63c2ec0..a71705f 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -11772,6 +11772,10 @@ tsubst_friend_function (tree decl, tree args)
elt.args = DECL_TI_ARGS (spec);
elt.spec = NULL_TREE;
+ if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (DECL_TI_ARGS (spec))
+ && !is_specialization_of_friend (spec, new_template))
+ continue;
+
decl_specializations->remove_elt (&elt);
tree& spec_args = DECL_TI_ARGS (spec);
@@ -12425,6 +12429,8 @@ apply_late_template_attributes (tree *decl_p, tree attributes, int attr_flags,
auto o4 = make_temp_override (scope_chain->omp_declare_target_attribute,
NULL);
auto o5 = make_temp_override (scope_chain->omp_begin_assumes, NULL);
+ auto o6 = make_temp_override (target_option_current_node,
+ target_option_default_node);
cplus_decl_attributes (decl_p, late_attrs, attr_flags);
@@ -13748,6 +13754,8 @@ add_extra_args (tree extra, tree args, tsubst_flags_t complain, tree in_decl)
inst = local;
/* else inst is already a full instantiation of the pack. */
register_local_specialization (inst, gen);
+ if (is_normal_capture_proxy (gen))
+ register_local_specialization (inst, DECL_CAPTURED_VARIABLE (gen));
}
gcc_assert (!TREE_PURPOSE (extra));
extra = TREE_VALUE (extra);
@@ -27750,6 +27758,11 @@ instantiate_body (tree pattern, tree args, tree d, bool nested_p)
if (DECL_OMP_DECLARE_REDUCTION_P (code_pattern))
cp_check_omp_declare_reduction (d);
+
+ if (int errs = errorcount + sorrycount)
+ if (errs > current_tinst_level->errors)
+ if (function *f = DECL_STRUCT_FUNCTION (d))
+ f->language->erroneous = true;
}
/* We're not deferring instantiation any more. */
@@ -30936,9 +30949,8 @@ alias_ctad_tweaks (tree tmpl, tree uguides)
tree aguides = NULL_TREE;
tree atparms = INNERMOST_TEMPLATE_PARMS (fullatparms);
unsigned natparms = TREE_VEC_LENGTH (atparms);
- for (ovl_iterator iter (uguides); iter; ++iter)
+ for (tree f : lkp_range (uguides))
{
- tree f = *iter;
tree in_decl = f;
location_t loc = DECL_SOURCE_LOCATION (f);
tree ret = TREE_TYPE (TREE_TYPE (f));
diff --git a/gcc/cp/rtti.cc b/gcc/cp/rtti.cc
index 3539962..18bc479 100644
--- a/gcc/cp/rtti.cc
+++ b/gcc/cp/rtti.cc
@@ -1318,18 +1318,9 @@ get_pseudo_ti_index (tree type)
static tinfo_s *
get_tinfo_desc (unsigned ix)
{
- unsigned len = tinfo_descs->length ();
-
- if (len <= ix)
- {
- /* too short, extend. */
- len = ix + 1 - len;
- vec_safe_reserve (tinfo_descs, len);
- tinfo_s elt;
- elt.type = elt.vtable = elt.name = NULL_TREE;
- while (len--)
- tinfo_descs->quick_push (elt);
- }
+ if (tinfo_descs->length () <= ix)
+ /* too short, extend. */
+ vec_safe_grow_cleared (tinfo_descs, ix + 1);
tinfo_s *res = &(*tinfo_descs)[ix];
diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc
index a10ef34..1aa35d3 100644
--- a/gcc/cp/semantics.cc
+++ b/gcc/cp/semantics.cc
@@ -1180,10 +1180,13 @@ finish_expr_stmt (tree expr)
expr = error_mark_node;
/* Simplification of inner statement expressions, compound exprs,
- etc can result in us already having an EXPR_STMT. */
+ etc can result in us already having an EXPR_STMT or other statement
+ tree. Don't wrap them in EXPR_STMT. */
if (TREE_CODE (expr) != CLEANUP_POINT_EXPR)
{
- if (TREE_CODE (expr) != EXPR_STMT)
+ if (TREE_CODE (expr) != EXPR_STMT
+ && !STATEMENT_CLASS_P (expr)
+ && TREE_CODE (expr) != STATEMENT_LIST)
expr = build_stmt (loc, EXPR_STMT, expr);
expr = maybe_cleanup_point_expr_void (expr);
}
@@ -3082,6 +3085,7 @@ finish_stmt_expr_expr (tree expr, tree stmt_expr)
}
else if (processing_template_decl)
{
+ /* Not finish_expr_stmt because we don't want convert_to_void. */
expr = build_stmt (input_location, EXPR_STMT, expr);
expr = add_stmt (expr);
/* Mark the last statement so that we can recognize it as such at
@@ -5088,22 +5092,32 @@ static tree
finish_type_pack_element (tree idx, tree types, tsubst_flags_t complain)
{
idx = maybe_constant_value (idx, NULL_TREE, mce_true);
- if (TREE_CODE (idx) != INTEGER_CST || !INTEGRAL_TYPE_P (TREE_TYPE (idx)))
+ if (!INTEGRAL_TYPE_P (TREE_TYPE (idx)))
{
if (complain & tf_error)
- error ("pack index is not an integral constant");
+ error ("pack index has non-integral type %qT", TREE_TYPE (idx));
+ return error_mark_node;
+ }
+ if (TREE_CODE (idx) != INTEGER_CST)
+ {
+ if (complain & tf_error)
+ {
+ error ("pack index is not an integral constant");
+ cxx_constant_value (idx);
+ }
return error_mark_node;
}
if (tree_int_cst_sgn (idx) < 0)
{
if (complain & tf_error)
- error ("pack index is negative");
+ error ("pack index %qE is negative", idx);
return error_mark_node;
}
if (wi::to_widest (idx) >= TREE_VEC_LENGTH (types))
{
if (complain & tf_error)
- error ("pack index is out of range");
+ error ("pack index %qE is out of range for pack of length %qd",
+ idx, TREE_VEC_LENGTH (types));
return error_mark_node;
}
return TREE_VEC_ELT (types, tree_to_shwi (idx));
diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog
index 23b8a81..f816c70 100644
--- a/gcc/d/ChangeLog
+++ b/gcc/d/ChangeLog
@@ -1,3 +1,78 @@
+2025-04-17 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * dmd/MERGE: Merge upstream dmd 956e73d64e.
+
+2025-04-15 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/119826
+ * types.cc (TypeVisitor::visit (TypeEnum *)): Propagate flags of main
+ enum types to all forward-referenced variants.
+
+2025-04-15 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/119799
+ * decl.cc (DeclVisitor::visit (VarDeclaration *)): Check front-end
+ type size before building the VAR_DECL. Allow C symbols to have a
+ size of `0'.
+
+2025-04-15 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/119817
+ * imports.cc (ImportVisitor::visit (OverloadSet *)): Don't push
+ NULL_TREE to vector of import symbols.
+
+2025-04-12 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/109023
+ * d-compiler.cc: Include dmd/errors.h.
+ (Compiler::onImport): Implement.
+ * d-lang.cc (d_handle_option): Handle -finclude-imports.
+ (d_parse_file): Run semantic on included imports.
+ * gdc.texi: Document -finclude-imports.
+ * lang.opt: Add finclude-imports.
+ * lang.opt.urls: Regenerate.
+
+2025-04-12 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/119758
+ * d-lang.cc (d_parse_file): Use endswith in test for -fonly= argument.
+ * d-spec.cc (lang_specific_driver): Rework -fonly= and pass all input
+ files to the front-end compiler when the option is seen.
+
+2025-04-11 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * dmd/MERGE: Merge upstream dmd 1b34fea478.
+
+2025-04-09 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/118309
+ * modules.cc: Include debug.h
+ (d_finish_compilation): Call debug_hooks->type_decl on all TYPE_DECLs.
+ * types.cc: Remove toplev.h include.
+ (finish_aggregate_type): Don't call rest_of_type_compilation or
+ rest_of_decl_compilation on type.
+ (TypeVisitor::visit (TypeEnum *)): Likewise.
+
+2025-04-09 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/117832
+ * d-tree.h (build_padded_constructor): New prototype.
+ * d-codegen.cc (build_padded_constructor): New function.
+ (d_array_value): Call it.
+ (build_memset_call): Likewise.
+ (build_struct_literal): Likewise.
+ (underlying_complex_expr): Likewise.
+ (build_array_from_val): Likewise.
+ (build_array_from_exprs): Likewise.
+ (d_build_call): Likewise.
+ (get_frame_for_symbol): Likewise.
+ * d-convert.cc (convert_for_rvalue): Likewise.
+ (convert_for_assignment): Likewise.
+ * decl.cc (class DeclVisitor): Likewise.
+ * expr.cc (class ExprVisitor): Likewise.
+ * modules.cc (layout_moduleinfo): Likewise.
+ * typeinfo.cc (class TypeInfoVisitor): Likewise.
+
2025-04-08 Iain Buclaw <ibuclaw@gdcproject.org>
* dmd/MERGE: Merge upstream dmd 51816cd01d.
diff --git a/gcc/d/d-compiler.cc b/gcc/d/d-compiler.cc
index 160539d..e18f5d3 100644
--- a/gcc/d/d-compiler.cc
+++ b/gcc/d/d-compiler.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "dmd/compiler.h"
+#include "dmd/errors.h"
#include "dmd/expression.h"
#include "dmd/identifier.h"
#include "dmd/module.h"
@@ -164,7 +165,39 @@ Compiler::onParseModule (Module *m)
driver intends on compiling the import. */
bool
-Compiler::onImport (Module *)
+Compiler::onImport (Module *m)
{
- return false;
+ if (!includeImports)
+ return false;
+
+ if (m->filetype != FileType::d && m->filetype != FileType::c)
+ return false;
+
+ /* All imports modules are included except those in the runtime library. */
+ ModuleDeclaration *md = m->md;
+ if (md && md->id)
+ {
+ if (md->packages.length >= 1)
+ {
+ if (!strcmp (md->packages.ptr[0]->toChars (), "core")
+ || !strcmp (md->packages.ptr[0]->toChars (), "std")
+ || !strcmp (md->packages.ptr[0]->toChars (), "gcc")
+ || !strcmp (md->packages.ptr[0]->toChars (), "etc"))
+ return false;
+ }
+ else if (!strcmp (md->id->toChars (), "object"))
+ return false;
+ }
+ else if (m->ident)
+ {
+ if (!strcmp (m->ident->toChars (), "object"))
+ return false;
+ }
+
+ /* This import will be compiled. */
+ if (global.params.v.verbose)
+ message ("compileimport (%s)", m->srcfile.toChars ());
+
+ compiledImports.push (m);
+ return true;
}
diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc
index b3786be..ec2ea59 100644
--- a/gcc/d/d-lang.cc
+++ b/gcc/d/d-lang.cc
@@ -523,6 +523,10 @@ d_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
global.params.ignoreUnsupportedPragmas = value;
break;
+ case OPT_finclude_imports:
+ includeImports = true;
+ break;
+
case OPT_finvariants:
global.params.useInvariants = value ? CHECKENABLEon : CHECKENABLEoff;
break;
@@ -1085,9 +1089,9 @@ d_parse_file (void)
/* Buffer for contents of .ddoc files. */
OutBuffer ddocbuf;
- /* In this mode, the first file name is supposed to be a duplicate
- of one of the input files. */
- if (d_option.fonly && strcmp (d_option.fonly, main_input_filename) != 0)
+ /* In this mode, the main input file is supposed to be the same as the one
+ given by -fonly=. */
+ if (d_option.fonly && !endswith (main_input_filename, d_option.fonly))
error ("%<-fonly=%> argument is different from first input file name");
for (size_t i = 0; i < num_in_fnames; i++)
@@ -1309,6 +1313,21 @@ d_parse_file (void)
dmd::semantic3 (m, NULL);
}
+ if (includeImports)
+ {
+ for (size_t i = 0; i < compiledImports.length; i++)
+ {
+ Module *m = compiledImports[i];
+ gcc_assert (m->isRoot ());
+
+ if (global.params.v.verbose)
+ message ("semantic3 %s", m->toChars ());
+
+ dmd::semantic3 (m, NULL);
+ modules.push (m);
+ }
+ }
+
Module::runDeferredSemantic3 ();
/* Check again, incase semantic3 pass loaded any more modules. */
diff --git a/gcc/d/d-spec.cc b/gcc/d/d-spec.cc
index 7f4a779..c788048 100644
--- a/gcc/d/d-spec.cc
+++ b/gcc/d/d-spec.cc
@@ -104,8 +104,8 @@ lang_specific_driver (cl_decoded_option **in_decoded_options,
/* The total number of arguments with the new stuff. */
unsigned int num_args = 1;
- /* "-fonly" if it appears on the command line. */
- const char *only_source_option = 0;
+ /* "-fonly=" if it appears on the command line. */
+ const char *only_source_arg = 0;
/* Whether the -o option was used. */
bool saw_opt_o = false;
@@ -280,13 +280,13 @@ lang_specific_driver (cl_decoded_option **in_decoded_options,
case OPT_fonly_:
args[i] |= SKIPOPT;
- only_source_option = decoded_options[i].orig_option_with_args_text;
+ only_source_arg = arg;
if (arg != NULL)
{
- const char *suffix = strrchr (only_source_option, '.');
+ const char *suffix = strrchr (only_source_arg, '.');
if (suffix == NULL || strcmp (suffix, ".d") != 0)
- only_source_option = concat (only_source_option, ".d", NULL);
+ only_source_arg = concat (only_source_arg, ".d", NULL);
}
break;
@@ -335,48 +335,52 @@ lang_specific_driver (cl_decoded_option **in_decoded_options,
+ (phobos_library != PHOBOS_NOLINK) * 4 + 2;
new_decoded_options = XNEWVEC (cl_decoded_option, num_args);
- i = 0;
j = 0;
/* Copy the 0th argument, i.e., the name of the program itself. */
- new_decoded_options[j++] = decoded_options[i++];
+ new_decoded_options[j++] = decoded_options[0];
/* NOTE: We start at 1 now, not 0. */
- while (i < argc)
+ for (i = 1; i < argc; i++)
{
if (args[i] & SKIPOPT)
- {
- ++i;
- continue;
- }
-
- new_decoded_options[j] = decoded_options[i];
+ continue;
if (!saw_libcxx && (args[i] & WITHLIBCXX))
{
- --j;
saw_libcxx = &decoded_options[i];
+ continue;
}
- if (args[i] & DSOURCE)
+ if (only_source_arg && (args[i] & DSOURCE))
{
- if (only_source_option)
- --j;
+ if (!endswith (decoded_options[i].arg, only_source_arg))
+ continue;
}
- i++;
+ new_decoded_options[j] = decoded_options[i];
j++;
}
- if (only_source_option)
+ if (only_source_arg)
{
- const char *only_source_arg = only_source_option + 7;
+ /* Generate -fonly= option, then copy D input sources that were initially
+ skipped in first pass over all decoded_options. */
generate_option (OPT_fonly_, only_source_arg, 1, CL_DRIVER,
&new_decoded_options[j]);
j++;
- generate_option_input_file (only_source_arg,
- &new_decoded_options[j++]);
+ for (i = 1; i < argc; i++)
+ {
+ if (!(args[i] & DSOURCE))
+ continue;
+
+ if (endswith (decoded_options[i].arg, only_source_arg))
+ continue;
+
+ new_decoded_options[j] = decoded_options[i];
+ j++;
+ }
}
/* If no reason to link against libphobos library, then don't add it. */
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index 136f78b..9ddf7cf 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -791,6 +791,12 @@ public:
}
else if (d->isDataseg ())
{
+ /* When the front-end type size is invalid, an error has already been
+ given for the declaration or type. */
+ dinteger_t size = dmd::size (d->type, d->loc);
+ if (size == SIZE_INVALID)
+ return;
+
tree decl = get_symbol_decl (d);
/* Only need to build the VAR_DECL for extern declarations. */
@@ -804,9 +810,7 @@ public:
return;
/* How big a symbol can be should depend on back-end. */
- tree size = build_integer_cst (dmd::size (d->type, d->loc),
- build_ctype (Type::tsize_t));
- if (!valid_constant_size_p (size))
+ if (!valid_constant_size_p (build_integer_cst (size, size_type_node)))
{
error_at (make_location_t (d->loc), "size is too large");
return;
@@ -835,8 +839,9 @@ public:
}
/* Frontend should have already caught this. */
- gcc_assert (!integer_zerop (size)
- || d->type->toBasetype ()->isTypeSArray ());
+ gcc_assert ((size != 0 && size != SIZE_INVALID)
+ || d->type->toBasetype ()->isTypeSArray ()
+ || d->isCsymbol ());
d_finish_decl (decl);
diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE
index a05a50e..58d19b4 100644
--- a/gcc/d/dmd/MERGE
+++ b/gcc/d/dmd/MERGE
@@ -1,4 +1,4 @@
-51816cd01deee5cc1d7d2c6e1e24788ec655b73e
+956e73d64e532a68213970316c2590c572ec03f3
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
diff --git a/gcc/d/dmd/expressionsem.d b/gcc/d/dmd/expressionsem.d
index 19111e3..b02f6ea 100644
--- a/gcc/d/dmd/expressionsem.d
+++ b/gcc/d/dmd/expressionsem.d
@@ -6978,10 +6978,10 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
while (1)
{
AttribDeclaration ad = s.isAttribDeclaration();
- if (!ad)
- break;
- if (ad.decl && ad.decl.length == 1)
+ if (ad && ad.decl && ad.decl.length == 1)
s = (*ad.decl)[0];
+ else
+ break;
}
//printf("inserting '%s' %p into sc = %p\n", s.toChars(), s, sc);
diff --git a/gcc/d/dmd/globals.h b/gcc/d/dmd/globals.h
index 59952a2..62a575e 100644
--- a/gcc/d/dmd/globals.h
+++ b/gcc/d/dmd/globals.h
@@ -421,6 +421,7 @@ struct SourceLoc
uint32_t line;
uint32_t column;
uint32_t fileOffset;
+ DString fileContent;
};
struct Loc
diff --git a/gcc/d/dmd/lexer.d b/gcc/d/dmd/lexer.d
index 63313ac..ed9f7f1 100644
--- a/gcc/d/dmd/lexer.d
+++ b/gcc/d/dmd/lexer.d
@@ -132,7 +132,7 @@ class Lexer
// debug printf("Lexer::Lexer(%p)\n", base);
// debug printf("lexer.filename = %s\n", filename);
token = Token.init;
- this.baseLoc = newBaseLoc(filename, endoffset);
+ this.baseLoc = newBaseLoc(filename, base[0 .. endoffset]);
this.linnum = 1;
this.base = base;
this.end = base + endoffset;
@@ -224,7 +224,7 @@ class Lexer
inTokenStringConstant = 0;
lastDocLine = 0;
- baseLoc = newBaseLoc("#defines", slice.length);
+ baseLoc = newBaseLoc("#defines", slice);
scanloc = baseLoc.getLoc(0);
}
diff --git a/gcc/d/dmd/location.d b/gcc/d/dmd/location.d
index 54b3fb6..393ffb8 100644
--- a/gcc/d/dmd/location.d
+++ b/gcc/d/dmd/location.d
@@ -64,7 +64,7 @@ nothrow:
extern (C++) static Loc singleFilename(const char* filename)
{
Loc result;
- locFileTable ~= new BaseLoc(filename.toDString, locIndex, 0, [0]);
+ locFileTable ~= new BaseLoc(filename.toDString, null, locIndex, 0, [0]);
result.index = locIndex++;
return result;
}
@@ -235,16 +235,20 @@ struct SourceLoc
uint column; /// column number (starts at 1)
uint fileOffset; /// byte index into file
+ /// Index `fileOffset` into this to to obtain source code context of this location
+ const(char)[] fileContent;
+
// aliases for backwards compatibility
alias linnum = line;
alias charnum = column;
- this(const(char)[] filename, uint line, uint column, uint fileOffset = 0) nothrow @nogc pure @safe
+ this(const(char)[] filename, uint line, uint column, uint fileOffset = 0, const(char)[] fileContent = null) nothrow @nogc pure @safe
{
this.filename = filename;
this.line = line;
this.column = column;
this.fileOffset = fileOffset;
+ this.fileContent = fileContent;
}
this(Loc loc) nothrow @nogc @trusted
@@ -300,15 +304,15 @@ private size_t fileTableIndex(uint index) nothrow @nogc
* Create a new source location map for a file
* Params:
* filename = source file name
- * size = space to reserve for locations, equal to the file size in bytes
+ * fileContent = content of source file
* Returns: new BaseLoc
*/
-BaseLoc* newBaseLoc(const(char)* filename, size_t size) nothrow
+BaseLoc* newBaseLoc(const(char)* filename, const(char)[] fileContent) nothrow
{
- locFileTable ~= new BaseLoc(filename.toDString, locIndex, 1, [0]);
+ locFileTable ~= new BaseLoc(filename.toDString, fileContent, locIndex, 1, [0]);
// Careful: the endloc of a FuncDeclaration can
// point to 1 past the very last byte in the file, so account for that
- locIndex += size + 1;
+ locIndex += fileContent.length + 1;
return locFileTable[$ - 1];
}
@@ -354,6 +358,7 @@ struct BaseLoc
@safe nothrow:
const(char)[] filename; /// Source file name
+ const(char)[] fileContents; /// Source file contents
uint startIndex; /// Subtract this from Loc.index to get file offset
int startLine = 1; /// Line number at index 0
uint[] lines; /// For each line, the file offset at which it starts. At index 0 there's always a 0 entry.
@@ -384,11 +389,11 @@ struct BaseLoc
{
auto fname = filename.toDString;
if (substitutions.length == 0)
- substitutions ~= BaseLoc(this.filename, 0, 0);
+ substitutions ~= BaseLoc(this.filename, null, 0, 0);
if (fname.length == 0)
fname = substitutions[$ - 1].filename;
- substitutions ~= BaseLoc(fname, offset, cast(int) (line - lines.length + startLine - 2));
+ substitutions ~= BaseLoc(fname, null, offset, cast(int) (line - lines.length + startLine - 2));
}
/// Returns: `loc` modified by substitutions from #file / #line directives
@@ -408,7 +413,7 @@ struct BaseLoc
private SourceLoc getSourceLoc(uint offset) @nogc
{
const i = getLineIndex(offset);
- const sl = SourceLoc(filename, cast(int) (i + startLine), cast(int) (1 + offset - lines[i]), offset);
+ const sl = SourceLoc(filename, cast(int) (i + startLine), cast(int) (1 + offset - lines[i]), offset, fileContents);
return substitute(sl);
}
diff --git a/gcc/d/dmd/typesem.d b/gcc/d/dmd/typesem.d
index 3bc0489..d4c7a58 100644
--- a/gcc/d/dmd/typesem.d
+++ b/gcc/d/dmd/typesem.d
@@ -3266,9 +3266,19 @@ Type merge(Type type)
case Tsarray:
// prevents generating the mangle if the array dim is not yet known
- if (!type.isTypeSArray().dim.isIntegerExp())
- return type;
- goto default;
+ if (auto ie = type.isTypeSArray().dim.isIntegerExp())
+ {
+ // After TypeSemantic, the length is always converted to size_t, but the parser
+ // usually generates regular integer types (e.g. in cast(const ubyte[2])) which
+ // it may try to merge, which then leads to failing implicit conversions as 2LU != 2
+ // according to Expression.equals. Only merge array types with size_t lengths for now.
+ // https://github.com/dlang/dmd/issues/21179
+ if (ie.type != Type.tsize_t)
+ return type;
+
+ goto default;
+ }
+ return type;
case Tenum:
break;
diff --git a/gcc/d/gdc.texi b/gcc/d/gdc.texi
index 2cb0c4a62..3a8bea0 100644
--- a/gcc/d/gdc.texi
+++ b/gcc/d/gdc.texi
@@ -277,6 +277,12 @@ Sets @code{__traits(getTargetInfo, "cppStd")} to @code{202002}.
Sets @code{__traits(getTargetInfo, "cppStd")} to @code{202302}.
@end table
+@opindex finclude-imports
+@item -finclude-imports
+Include imported modules in the compilation, as if they were given on the
+command line. When this option is enabled, all imported modules are compiled
+except those that are part of libphobos.
+
@opindex finvariants
@opindex fno-invariants
@item -fno-invariants
diff --git a/gcc/d/imports.cc b/gcc/d/imports.cc
index 776caaf..16e4df6 100644
--- a/gcc/d/imports.cc
+++ b/gcc/d/imports.cc
@@ -182,7 +182,11 @@ public:
vec_alloc (tset, d->a.length);
for (size_t i = 0; i < d->a.length; i++)
- vec_safe_push (tset, build_import_decl (d->a[i]));
+ {
+ tree overload = build_import_decl (d->a[i]);
+ if (overload != NULL_TREE)
+ vec_safe_push (tset, overload);
+ }
this->result_ = build_tree_list_vec (tset);
tset->truncate (0);
diff --git a/gcc/d/lang.opt b/gcc/d/lang.opt
index 50c6f2f..298ff58 100644
--- a/gcc/d/lang.opt
+++ b/gcc/d/lang.opt
@@ -327,6 +327,10 @@ fignore-unknown-pragmas
D
Ignore unsupported pragmas.
+finclude-imports
+D RejectNegative
+Include imported modules in the compilation.
+
finvariants
D Var(flag_invariants)
Generate code for class invariant contracts.
diff --git a/gcc/d/lang.opt.urls b/gcc/d/lang.opt.urls
index fa311d4..b4886bf 100644
--- a/gcc/d/lang.opt.urls
+++ b/gcc/d/lang.opt.urls
@@ -155,6 +155,9 @@ LangUrlSuffix_D(gdc/Runtime-Options.html#index-fextern-std)
fignore-unknown-pragmas
LangUrlSuffix_D(gdc/Warnings.html#index-fignore-unknown-pragmas)
+finclude-imports
+LangUrlSuffix_D(gdc/Runtime-Options.html#index-finclude-imports)
+
finvariants
LangUrlSuffix_D(gdc/Runtime-Options.html#index-finvariants)
diff --git a/gcc/d/types.cc b/gcc/d/types.cc
index e43fa88..1c74840 100644
--- a/gcc/d/types.cc
+++ b/gcc/d/types.cc
@@ -1179,6 +1179,26 @@ public:
layout_type (t->ctype);
+ /* Fix up all forward-referenced variants of this enum type. */
+ for (tree v = TYPE_MAIN_VARIANT (t->ctype); v;
+ v = TYPE_NEXT_VARIANT (v))
+ {
+ if (v == t->ctype)
+ continue;
+
+ TYPE_VALUES (v) = TYPE_VALUES (t->ctype);
+ TYPE_LANG_SPECIFIC (v) = TYPE_LANG_SPECIFIC (t->ctype);
+ TYPE_MIN_VALUE (v) = TYPE_MIN_VALUE (t->ctype);
+ TYPE_MAX_VALUE (v) = TYPE_MAX_VALUE (t->ctype);
+ TYPE_UNSIGNED (v) = TYPE_UNSIGNED (t->ctype);
+ TYPE_SIZE (v) = TYPE_SIZE (t->ctype);
+ TYPE_SIZE_UNIT (v) = TYPE_SIZE_UNIT (t->ctype);
+ SET_TYPE_MODE (v, TYPE_MODE (t->ctype));
+ TYPE_PRECISION (v) = TYPE_PRECISION (t->ctype);
+ SET_TYPE_ALIGN (v, TYPE_ALIGN (t->ctype));
+ TYPE_USER_ALIGN (v) = TYPE_USER_ALIGN (t->ctype);
+ }
+
/* Complete forward-referenced fields of this enum type. */
finish_incomplete_fields (t->ctype);
}
diff --git a/gcc/doc/cfg.texi b/gcc/doc/cfg.texi
index b8c6427..bbd6694 100644
--- a/gcc/doc/cfg.texi
+++ b/gcc/doc/cfg.texi
@@ -297,10 +297,12 @@ edge. The opposite conversion is difficult, but should not happen
anyway. The edges can be eliminated via @code{purge_dead_edges} call.
@findex REG_EH_REGION, EDGE_ABNORMAL_CALL
-In the RTL representation, the destination of an exception edge is
-specified by @code{REG_EH_REGION} note attached to the insn.
-In case of a trapping call the @code{EDGE_ABNORMAL_CALL} flag is set
-too. In the @code{GIMPLE} representation, this extra flag is not set.
+In the RTL representation, a @code{REG_EH_REGION} note is attached to
+an instruction that can throw an exception. The destination of the
+exception edge originating at such an instruction is specified by the
+value of the @code{REG_EH_REGION} note. In case of a trapping call
+the @code{EDGE_ABNORMAL_CALL} flag is set too. In the @code{GIMPLE}
+representation, this extra flag is not set.
@findex may_trap_p, tree_could_trap_p
In the RTL representation, the predicate @code{may_trap_p} may be used
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index ae3357f..0978c4c 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1933,6 +1933,13 @@ Note that if such a function is called indirectly the compiler may
or may not inline it depending on optimization level and a failure
to inline an indirect call may or may not be diagnosed.
+If you need to use the inlined function in multiple translation units,
+you should put the @code{always_inline} attribute on a function
+definition in a header file that is included in all translation units
+where the function is used. Link-time optimization can inline
+functions across translation units, but only if an optimization level
+that normally enables inlining is additionally specified.
+
@cindex @code{artificial} function attribute
@item artificial
This attribute is useful for small inline wrappers that if possible
@@ -12299,15 +12306,6 @@ for the @samp{att} and @samp{intel} dialects of assembler:
@item @code{%3}
@tab @code{$.L3}
@tab @code{OFFSET FLAT:.L3}
-@item @code{%4}
-@tab @code{$8}
-@tab @code{8}
-@item @code{%5}
-@tab @code{%xmm0}
-@tab @code{xmm0}
-@item @code{%7}
-@tab @code{$0}
-@tab @code{0}
@end multitable
The table below shows the list of supported modifiers and their effects.
@@ -12324,32 +12322,17 @@ The table below shows the list of supported modifiers and their effects.
@tab @code{%b0}
@tab @code{%al}
@tab @code{al}
-@item @code{B}
-@tab print the opcode suffix of b.
-@tab @code{%B0}
-@tab @code{b}
-@tab
@item @code{c}
@tab Require a constant operand and print the constant expression with no punctuation.
@tab @code{%c1}
@tab @code{2}
@tab @code{2}
-@item @code{d}
-@tab print duplicated register operand for AVX instruction.
-@tab @code{%d5}
-@tab @code{%xmm0, %xmm0}
-@tab @code{xmm0, xmm0}
@item @code{E}
@tab Print the address in Double Integer (DImode) mode (8 bytes) when the target is 64-bit.
Otherwise mode is unspecified (VOIDmode).
@tab @code{%E1}
@tab @code{%(rax)}
@tab @code{[rax]}
-@item @code{g}
-@tab Print the V16SFmode name of the register.
-@tab @code{%g0}
-@tab @code{%zmm0}
-@tab @code{zmm0}
@item @code{h}
@tab Print the QImode name for a ``high'' register.
@tab @code{%h0}
@@ -12371,16 +12354,6 @@ high 8 bytes of SSE values. For a memref in (%rax), it generates
@tab @code{%l3}
@tab @code{.L3}
@tab @code{.L3}
-@item @code{L}
-@tab print the opcode suffix of l.
-@tab @code{%L0}
-@tab @code{l}
-@tab
-@item @code{N}
-@tab print maskz.
-@tab @code{%N7}
-@tab @code{@{z@}}
-@tab @code{@{z@}}
@item @code{p}
@tab Print raw symbol name (without syntax-specific prefixes).
@tab @code{%p2}
@@ -12396,76 +12369,20 @@ issue the bare constant. See @code{p} above.
@tab @code{%q0}
@tab @code{%rax}
@tab @code{rax}
-@item @code{Q}
-@tab print the opcode suffix of q.
-@tab @code{%Q0}
-@tab @code{q}
-@tab
-@item @code{R}
-@tab print embedded rounding and sae.
-@tab @code{%R4}
-@tab @code{@{rn-sae@}, }
-@tab @code{, @{rn-sae@}}
-@item @code{r}
-@tab print only sae.
-@tab @code{%r4}
-@tab @code{@{sae@}, }
-@tab @code{, @{sae@}}
-@item @code{s}
-@tab print a shift double count, followed by the assemblers argument
-delimiterprint the opcode suffix of s.
-@tab @code{%s1}
-@tab @code{$2, }
-@tab @code{2, }
-@item @code{S}
-@tab print the opcode suffix of s.
-@tab @code{%S0}
-@tab @code{s}
-@tab
-@item @code{t}
-@tab print the V8SFmode name of the register.
-@tab @code{%t5}
-@tab @code{%ymm0}
-@tab @code{ymm0}
-@item @code{T}
-@tab print the opcode suffix of t.
-@tab @code{%T0}
-@tab @code{t}
-@tab
-@item @code{V}
-@tab print naked full integer register name without %.
-@tab @code{%V0}
-@tab @code{eax}
-@tab @code{eax}
@item @code{w}
@tab Print the HImode name of the register.
@tab @code{%w0}
@tab @code{%ax}
@tab @code{ax}
-@item @code{W}
-@tab print the opcode suffix of w.
-@tab @code{%W0}
-@tab @code{w}
-@tab
-@item @code{x}
-@tab print the V4SFmode name of the register.
-@tab @code{%x5}
-@tab @code{%xmm0}
-@tab @code{xmm0}
-@item @code{y}
-@tab print "st(0)" instead of "st" as a register.
-@tab @code{%y6}
-@tab @code{%st(0)}
-@tab @code{st(0)}
@item @code{z}
@tab Print the opcode suffix for the size of the current integer operand (one of @code{b}/@code{w}/@code{l}/@code{q}).
@tab @code{%z0}
@tab @code{l}
@tab
-@item @code{Z}
-@tab Like @code{z}, with special suffixes for x87 instructions.
@end multitable
+@code{V} is a special modifier which prints the name of the full integer
+register without @code{%}.
@anchor{x86floatingpointasmoperands}
@subsubsection x86 Floating-Point @code{asm} Operands
@@ -13061,6 +12978,7 @@ C and/or C++ standards, while others remain specific to GNU C.
* Binary constants:: Binary constants using the @samp{0b} prefix.
* Dollar Signs:: Dollar sign is allowed in identifiers.
* Character Escapes:: @samp{\e} stands for the character @key{ESC}.
+* Raw String Literals:: C++ raw string literals are supported in C.
* Alternate Keywords:: @code{__const__}, @code{__asm__}, etc., for header files.
* Function Names:: Printable strings which are the name of the current
function.
@@ -14082,6 +14000,25 @@ machines, typically because the target assembler does not allow them.
You can use the sequence @samp{\e} in a string or character constant to
stand for the ASCII character @key{ESC}.
+@node Raw String Literals
+@subsection Raw String Literals
+@cindex raw string literals
+@cindex string literals, raw
+
+The C++11 standard added syntax for raw string literals prefixed
+with @samp{R}. This syntax allows you to use an arbitrary delimiter
+sequence instead of escaping special characters within the string.
+For example, these string constants are all equivalent:
+
+@smallexample
+const char *s1 = "\\";
+const char *s2 = R"(\)";
+const char *s3 = R"foo(\)foo";
+@end smallexample
+
+As an extension, GCC also accepts raw string literals in C with
+@option{-std=gnu99} or later.
+
@node Alternate Keywords
@subsection Alternate Keywords
@cindex alternate keywords
diff --git a/gcc/doc/gm2.texi b/gcc/doc/gm2.texi
index 8baee24..cb52e8c 100644
--- a/gcc/doc/gm2.texi
+++ b/gcc/doc/gm2.texi
@@ -2699,10 +2699,10 @@ PROCEDURE Example (foo, bar: CARDINAL) : CARDINAL ;
VAR
myout: CARDINAL ;
BEGIN
- ASM VOLATILE ("movq %1,%%rax; addq %2,%%rax; movq %%rax,%0"
+ ASM VOLATILE ("movl %1,%%eax; addl %2,%%eax; movl %%eax,%0"
: "=rm" (myout) (* outputs *)
: "rm" (foo), "rm" (bar) (* inputs *)
- : "rax") ; (* we trash *)
+ : "eax") ; (* we trash *)
RETURN( myout )
END Example ;
@end example
@@ -2720,10 +2720,10 @@ VAR
myout: CARDINAL ;
BEGIN
ASM VOLATILE (
- "movq %[left],%%rax; addq %[right],%%rax; movq %%rax,%[output]"
+ "movl %[left],%%eax; addl %[right],%%eax; movl %%eax,%[output]"
: [output] "=rm" (myout) (* outputs *)
: [left] "rm" (foo), [right] "rm" (bar) (* inputs *)
- : "rax") ; (* we trash *)
+ : "eax") ; (* we trash *)
RETURN( myout )
END Example ;
@end example
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index b5509ff..1af0082 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -350,6 +350,12 @@ documentation including the target @code{SYSTEM} definition module.
If Python3 is unavailable Modula-2 documentation will include a target
independent version of the SYSTEM modules.
+@item @anchor{gccrs-prerequisite}gccrs
+
+The official Rust compiler and Rust build system (cargo) are required for
+building various parts of the gccrs frontend, until gccrs can compile them
+by itself. The minimum supported Rust version is 1.49.
+
@item A ``working'' POSIX compatible shell, or GNU bash
Necessary when running @command{configure} because some
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a040d65..020442a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -211,8 +211,7 @@ in the following sections.
@item C++ Language Options
@xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
@gccoptlist{-fabi-version=@var{n} -fno-access-control
--faligned-new=@var{n} -fargs-in-order=@var{n}
--fno-assume-sane-operators-new-delete
+-faligned-new=@var{n} -fno-assume-sane-operators-new-delete
-fchar8_t -fcheck-new
-fconcepts -fconstexpr-depth=@var{n} -fconstexpr-cache-depth=@var{n}
-fconstexpr-loop-limit=@var{n} -fconstexpr-ops-limit=@var{n}
@@ -235,6 +234,7 @@ in the following sections.
-fno-optional-diags
-fno-pretty-templates -frange-for-ext-temps
-fno-rtti -fsized-deallocation
+-fstrong-eval-order@r{[}=@var{kind}@r{]}
-ftemplate-backtrace-limit=@var{n}
-ftemplate-depth=@var{n}
-fno-threadsafe-statics -fuse-cxa-atexit
@@ -593,7 +593,7 @@ Objective-C and Objective-C++ Dialects}.
-finline-functions -finline-functions-called-once -finline-limit=@var{n}
-finline-small-functions -fipa-modref -fipa-cp -fipa-cp-clone
-fipa-bit-cp -fipa-vrp -fipa-pta -fipa-profile -fipa-pure-const
--fipa-reference -fipa-reference-addressable
+-fipa-reference -fipa-reference-addressable -fipa-reorder-for-locality
-fipa-stack-alignment -fipa-icf -fira-algorithm=@var{algorithm}
-flate-combine-instructions -flifetime-dse -flive-patching=@var{level}
-fira-region=@var{region} -fira-hoist-pressure
@@ -642,8 +642,8 @@ Objective-C and Objective-C++ Dialects}.
-fsplit-wide-types -fsplit-wide-types-early -fssa-backprop -fssa-phiopt
-fstdarg-opt -fstore-merging -fstrict-aliasing -fipa-strict-aliasing
-fthread-jumps -ftracer -ftree-bit-ccp
--ftree-builtin-call-dce -ftree-ccp -ftree-ch
--ftree-coalesce-vars -ftree-copy-prop -ftree-dce -ftree-dominator-opts
+-ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-coalesce-vars
+-ftree-copy-prop -ftree-cselim -ftree-dce -ftree-dominator-opts
-ftree-dse -ftree-forwprop -ftree-fre -fcode-hoisting
-ftree-loop-if-convert -ftree-loop-im
-ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns
@@ -2199,6 +2199,7 @@ those that have already been displayed. If @option{--help} is also
specified anywhere on the command line then this takes precedence
over any @option{--help=} option.
+@opindex Q
If the @option{-Q} option appears on the command line before the
@option{--help=} option, then the descriptive text displayed by
@option{--help=} is changed. Instead of describing the displayed
@@ -3581,12 +3582,19 @@ type.
@opindex fstrong-eval-order
@item -fstrong-eval-order
+@itemx -fstrong-eval-order=@var{kind}
Evaluate member access, array subscripting, and shift expressions in
left-to-right order, and evaluate assignment in right-to-left order,
-as adopted for C++17. Enabled by default with @option{-std=c++17}.
+as adopted for C++17. @option{-fstrong-eval-order} is equivalent to
+@option{-fstrong-eval-order=all},
+and is enabled by default with @option{-std=c++17} or later.
+
@option{-fstrong-eval-order=some} enables just the ordering of member
-access and shift expressions, and is the default without
-@option{-std=c++17}.
+access and shift expressions, and is the default for C++ dialects prior to
+C++17.
+
+@option{-fstrong-eval-order=none} is equivalent to
+@option{-fno-strong-eval-order}.
@opindex ftemplate-backtrace-limit
@item -ftemplate-backtrace-limit=@var{n}
@@ -12739,6 +12747,7 @@ complexity than at @option{-O}.
-fipa-pure-const
-fipa-reference
-fipa-reference-addressable
+-fivopts
-fmerge-constants
-fmove-loop-invariants
-fmove-loop-stores
@@ -12847,6 +12856,13 @@ by @option{-O2} and also turns on the following optimization flags:
Reduce compilation time and make debugging produce the expected
results. This is the default.
+At @option{-O0}, GCC completely disables most optimization passes;
+they are not run even if you explicitly enable them on the command
+line, or are listed by @option{-Q --help=optimizers} as being enabled by
+default. Many optimizations performed by GCC depend on code analysis
+or canonicalization passes that are enabled by @option{-O}, and it would
+not be useful to run individual optimization passes in isolation.
+
@opindex Os
@item -Os
Optimize for size. @option{-Os} enables all @option{-O2} optimizations
@@ -13864,6 +13880,21 @@ Enabled by default at @option{-O1} and higher.
Discover read-only, write-only and non-addressable static variables.
Enabled by default at @option{-O1} and higher.
+@opindex fipa-reorder-for-locality
+@item -fipa-reorder-for-locality
+Group call chains close together in the binary layout to improve code
+locality and minimize jump distances between frequently called functions.
+Unlike @option{-freorder-functions} this pass considers the call
+chains between functions and groups them together, rather than grouping all
+hot/normal/cold/never-executed functions into separate sections.
+Unlike @option{-fprofile-reorder-functions} it aims to improve code locality
+throughout the runtime of the program rather than focusing on program startup.
+This option is incompatible with an explicit
+@option{-flto-partition=} option since it enforces a custom partitioning
+scheme.
+If using this option it is recommended to also use profile feedback, but this
+option is not enabled by default otherwise.
+
@opindex fipa-stack-alignment
@item -fipa-stack-alignment
Reduce stack alignment on call sites if possible.
@@ -14072,6 +14103,12 @@ in this pass can
be limited using @option{max-tail-merge-comparisons} parameter and
@option{max-tail-merge-iterations} parameter.
+@opindex ftree-cselim
+@item -ftree-cselim
+Perform conditional store elimination on trees. This flag is enabled by
+default at @option{-O1} and higher on targets that have conditional
+move instructions.
+
@opindex ftree-dce
@item -ftree-dce
Perform dead code elimination (DCE) on trees. This flag is enabled by
@@ -14278,6 +14315,7 @@ Enabled by default at @option{-O1} and higher.
@item -fivopts
Perform induction variable optimizations (strength reduction, induction
variable merging and induction variable elimination) on trees.
+Enabled by default at @option{-O1} and higher.
@opindex ftree-parallelize-loops
@item -ftree-parallelize-loops=n
@@ -14593,11 +14631,13 @@ Enabled for x86 at levels @option{-O2}, @option{-O3}, @option{-Os}.
@opindex freorder-functions
@item -freorder-functions
Reorder functions in the object file in order to
-improve code locality. This is implemented by using special
-subsections @code{.text.hot} for most frequently executed functions and
-@code{.text.unlikely} for unlikely executed functions. Reordering is done by
-the linker so object file format must support named sections and linker must
-place them in a reasonable way.
+improve code locality. Unlike @option{-fipa-reorder-for-locality} this option
+prioritises grouping all functions within a category
+(hot/normal/cold/never-executed) together.
+This is implemented by using special subsections @code{.text.hot} for most
+frequently executed functions and @code{.text.unlikely} for unlikely executed
+functions. Reordering is done by the linker so object file format must support
+named sections and linker must place them in a reasonable way.
This option isn't effective unless you either provide profile feedback
(see @option{-fprofile-arcs} for details) or manually annotate functions with
@@ -14609,12 +14649,14 @@ Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
@item -fstrict-aliasing
Allow the compiler to assume the strictest aliasing rules applicable to
the language being compiled. For C (and C++), this activates
-optimizations based on the type of expressions. In particular, an
-object of one type is assumed never to reside at the same address as an
-object of a different type, unless the types are almost the same. For
-example, an @code{unsigned int} can alias an @code{int}, but not a
-@code{void*} or a @code{double}. A character type may alias any other
-type.
+optimizations based on the type of expressions. In particular, accessing
+an object of one type via an expression of a different type is not allowed,
+unless the types are @dfn{compatible types}, differ only in signedness or
+qualifiers, or the expression has a character type. Accessing scalar
+objects via a corresponding vector type is also allowed.
+
+For example, an @code{unsigned int} can alias an @code{int}, but not a
+@code{void*} or a @code{double}. A character type may alias any other type.
@anchor{Type-punning}Pay special attention to code like this:
@smallexample
@@ -15318,32 +15360,24 @@ arithmetic. These options trade off between speed and
correctness. All must be specifically enabled.
@table @gcctabopt
-@opindex ffloat-store
-@item -ffloat-store
-Do not store floating-point variables in registers, and inhibit other
-options that might change whether a floating-point value is taken from a
-register or memory.
-
-@cindex floating-point precision
-This option prevents undesirable excess precision on machines such as
-the 68000 where the floating registers (of the 68881) keep more
-precision than a @code{double} is supposed to have. Similarly for the
-x86 architecture. For most programs, the excess precision does only
-good, but a few programs rely on the precise definition of IEEE floating
-point. Use @option{-ffloat-store} for such programs, after modifying
-them to store all pertinent intermediate computations into variables.
-
@opindex fexcess-precision
@item -fexcess-precision=@var{style}
-This option allows further control over excess precision on machines
+This option allows control over excess precision on machines
where floating-point operations occur in a format with more precision or
-range than the IEEE standard and interchange floating-point types. By
-default, @option{-fexcess-precision=fast} is in effect; this means that
+range than the IEEE standard and interchange floating-point types.
+An example of such a target is x87 floating point on x86 processors,
+which uses an 80-bit representation internally instead of the 64-bit
+IEEE format. For most programs, the excess precision is harmless,
+but some programs may rely on the
+requirements of the C or C++ language standards for handling IEEE values.
+
+By default, @option{-fexcess-precision=fast} is in effect; this means that
operations may be carried out in a wider precision than the types specified
in the source if that would result in faster code, and it is unpredictable
when rounding to the types specified in the source code takes place.
When compiling C or C++, if @option{-fexcess-precision=standard} is specified
-then excess precision follows the rules specified in ISO C99 or C++; in particular,
+then excess precision follows the rules specified in ISO C99 or C++;
+in particular,
both casts and assignments cause values to be rounded to their
semantic types (whereas @option{-ffloat-store} only affects
assignments). This option is enabled by default for C or C++ if a strict
@@ -15361,6 +15395,18 @@ or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
semantics apply without excess precision, and in the latter, rounding
is unpredictable.
+@opindex ffloat-store
+@item -ffloat-store
+Do not store floating-point variables in registers, and inhibit other
+options that might change whether a floating-point value is taken from a
+register or memory. This option has generally been subsumed by
+@option{-fexcess-precision=standard}, which is more general. If you do use
+@option{-ffloat-store}, you may need to modify your program to explicitly
+store intermediate computations in temporary variables since
+@option{-ffloat-store} handles rounding to IEEE format
+only on assignments and not casts as @option{-fexcess-precision=standard}
+does.
+
@opindex ffast-math
@item -ffast-math
Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
@@ -15495,9 +15541,8 @@ default state for @code{FENV_ACCESS}.
@opindex frounding-math
@item -frounding-math
Disable transformations and optimizations that assume default floating-point
-rounding behavior. This is round-to-zero for all floating point
-to integer conversions, and round-to-nearest for all other arithmetic
-truncations. This option should be specified for programs that change
+rounding behavior (round-to-nearest).
+This option should be specified for programs that change
the FP rounding mode dynamically, or that may be executed with a
non-default rounding mode. This option disables constant folding of
floating-point expressions at compile time (which may be affected by
@@ -15619,7 +15664,8 @@ Enabled by @option{-fprofile-generate}, @option{-fprofile-use}, and
@item -fprofile-reorder-functions
Function reordering based on profile instrumentation collects
first time of execution of a function and orders these functions
-in ascending order.
+in ascending order, aiming to optimize program startup through more
+efficient loading of text segments.
Enabled with @option{-fprofile-use}.
@@ -21268,8 +21314,13 @@ Toggle @option{-fvar-tracking-assignments}, in the same way that
@opindex Q
@item -Q
-Makes the compiler print out each function name as it is compiled, and
-print some statistics about each pass when it finishes.
+When used on the command line prior to @option{--help=}, @option{-Q}
+acts as a modifier to the help output. @xref{Overall Options},
+for details about @option{--help=}.
+
+Otherwise, this option makes the compiler print out each function name
+as it is compiled, and print some statistics about each pass when it
+finishes.
@opindex ftime-report
@item -ftime-report
@@ -33328,7 +33379,7 @@ system representing a certain processor type. Possible values for
@samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
@samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11},
@samp{z14}/@samp{arch12}, @samp{z15}/@samp{arch13},
-@samp{z16}/@samp{arch14}, and @samp{native}.
+@samp{z16}/@samp{arch14}, @samp{z17}/@samp{arch15}, and @samp{native}.
The default is @option{-march=z900}.
@@ -34822,7 +34873,8 @@ produces code optimized for the local machine under the constraints
of the selected instruction set.
@item x86-64
-A generic CPU with 64-bit extensions.
+A generic CPU with 64-bit extensions, MMX, SSE, SSE2, and FXSR instruction set
+support.
@item x86-64-v2
@itemx x86-64-v3
@@ -34855,7 +34907,7 @@ Intel Lakemont MCU, based on Intel Pentium CPU.
Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
@item pentiumpro
-Intel Pentium Pro CPU@.
+Intel Pentium Pro CPU with no MMX support.
@item i686
When used with @option{-march}, the Pentium Pro
diff --git a/gcc/except.cc b/gcc/except.cc
index d5eb927..205811c 100644
--- a/gcc/except.cc
+++ b/gcc/except.cc
@@ -970,12 +970,26 @@ expand_dw2_landing_pad_for_region (eh_region region)
{ /* Nothing */ }
if (region->exc_ptr_reg)
- emit_move_insn (region->exc_ptr_reg,
- gen_rtx_REG (ptr_mode, EH_RETURN_DATA_REGNO (0)));
+ {
+ rtx exc_ptr_reg;
+ if (EH_RETURN_DATA_REGNO (0) != INVALID_REGNUM)
+ exc_ptr_reg = gen_rtx_REG (ptr_mode, EH_RETURN_DATA_REGNO (0));
+ else
+ /* The target must be doing something special. Submit a dummy. */
+ exc_ptr_reg = constm1_rtx;
+ emit_move_insn (region->exc_ptr_reg, exc_ptr_reg);
+ }
if (region->filter_reg)
- emit_move_insn (region->filter_reg,
- gen_rtx_REG (targetm.eh_return_filter_mode (),
- EH_RETURN_DATA_REGNO (1)));
+ {
+ rtx filter_reg;
+ if (EH_RETURN_DATA_REGNO (1) != INVALID_REGNUM)
+ filter_reg = gen_rtx_REG (targetm.eh_return_filter_mode (),
+ EH_RETURN_DATA_REGNO (1));
+ else
+ /* The target must be doing something special. Submit a dummy. */
+ filter_reg = constm1_rtx;
+ emit_move_insn (region->filter_reg, filter_reg);
+ }
}
/* Expand the extra code needed at landing pads for dwarf2 unwinding. */
diff --git a/gcc/expmed.cc b/gcc/expmed.cc
index df09cbc..8cf10d9 100644
--- a/gcc/expmed.cc
+++ b/gcc/expmed.cc
@@ -285,7 +285,7 @@ init_expmed (void)
for (speed = 0; speed < 2; speed++)
{
crtl->maybe_hot_insn_p = speed;
- set_zero_cost (speed, set_src_cost (const0_rtx, mode, speed));
+ set_zero_cost (speed, set_src_cost (const0_rtx, QImode, speed));
for (mode = MIN_MODE_INT; mode <= MAX_MODE_INT;
mode = (machine_mode)(mode + 1))
diff --git a/gcc/flag-types.h b/gcc/flag-types.h
index 0127698..db57376 100644
--- a/gcc/flag-types.h
+++ b/gcc/flag-types.h
@@ -404,7 +404,15 @@ enum lto_partition_model {
LTO_PARTITION_BALANCED = 2,
LTO_PARTITION_1TO1 = 3,
LTO_PARTITION_MAX = 4,
- LTO_PARTITION_CACHE = 5
+ LTO_PARTITION_CACHE = 5,
+ LTO_PARTITION_DEFAULT= 6
+};
+
+/* flag_lto_locality_cloning initialization values. */
+enum lto_locality_cloning_model {
+ LTO_LOCALITY_NO_CLONING = 0,
+ LTO_LOCALITY_NON_INTERPOSABLE_CLONING = 1,
+ LTO_LOCALITY_MAXIMAL_CLONING = 2,
};
/* flag_lto_linker_output initialization values. */
diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc
index 1275ef7..c9471ea 100644
--- a/gcc/fold-const.cc
+++ b/gcc/fold-const.cc
@@ -7246,6 +7246,12 @@ tree_swap_operands_p (const_tree arg0, const_tree arg1)
if (TREE_CONSTANT (arg0))
return true;
+ /* Put invariant address in arg1. */
+ if (is_gimple_invariant_address (arg1))
+ return false;
+ if (is_gimple_invariant_address (arg0))
+ return true;
+
/* It is preferable to swap two SSA_NAME to ensure a canonical form
for commutative and comparison operators. Ensuring a canonical
form allows the optimizers to find additional redundancies without
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index c9c07b35..56325a9 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,94 @@
+2025-04-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/119836
+ * resolve.cc (check_pure_function): Fix checking for
+ an impure subprogram within a DO CONCURRENT construct.
+ (pure_subroutine): Ditto.
+
+2025-04-16 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/106948
+ * resolve.cc (gfc_pure_function): If a function has been resolved,
+ but esym is not yet set, look at its attributes to see whether it
+ is pure or elemental.
+
+2025-04-15 Tobias Burnus <tburnus@baylibre.com>
+
+ * f95-lang.cc (LANG_HOOKS_OMP_DEEP_MAPPING,
+ LANG_HOOKS_OMP_DEEP_MAPPING_P, LANG_HOOKS_OMP_DEEP_MAPPING_CNT):
+ Define.
+ * openmp.cc (gfc_match_omp_clause_reduction): Fix location setting.
+ (resolve_omp_clauses): Permit allocatable components, reject
+ them and polymorphic variables in PRIVATE/FIRSTPRIVATE.
+ * trans-decl.cc (add_clause): Set clause location.
+ * trans-openmp.cc (gfc_has_alloc_comps): Add ptr_ok and
+ shallow_alloc_only Boolean arguments.
+ (gfc_omp_replace_alloc_by_to_mapping): New.
+ (gfc_omp_private_outer_ref, gfc_walk_alloc_comps,
+ gfc_omp_clause_default_ctor, gfc_omp_clause_copy_ctor,
+ gfc_omp_clause_assign_op, gfc_omp_clause_dtor): Update call to it.
+ (gfc_omp_finish_clause): Minor cleanups, improve location data,
+ handle allocatable components.
+ (gfc_omp_deep_mapping_map, gfc_omp_deep_mapping_item,
+ gfc_omp_deep_mapping_comps, gfc_omp_gen_simple_loop,
+ gfc_omp_get_array_size, gfc_omp_elmental_loop,
+ gfc_omp_deep_map_kind_p, gfc_omp_deep_mapping_int_p,
+ gfc_omp_deep_mapping_p, gfc_omp_deep_mapping_do,
+ gfc_omp_deep_mapping_cnt, gfc_omp_deep_mapping): New.
+ (gfc_trans_omp_array_section): Save array descriptor in case
+ deep-mapping lang hook will need it.
+ (gfc_trans_omp_clauses): Likewise; use better clause location data.
+ * trans.h (gfc_omp_deep_mapping_p, gfc_omp_deep_mapping_cnt,
+ gfc_omp_deep_mapping): Add function prototypes.
+
+2025-04-13 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/119669
+ * interface.cc (compare_parameter): Error when mismatch between
+ formal argument as subroutine and function. If the dummy
+ argument is a known function, set its typespec.
+
+2025-04-12 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR fortran/101602
+ * trans-stmt.cc (gfc_trans_concurrent_locality_spec): Fix
+ 'static_assert'.
+
+2025-04-09 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/119656
+ * interface.cc (gfc_compare_actual_formal): Fix front-end memleak
+ when searching for matching interfaces.
+ * trans-expr.cc (gfc_conv_procedure_call): If there is a formal
+ dummy corresponding to an absent argument, use its type, and only
+ fall back to inferred type otherwise.
+
+2025-04-09 Paul Thomas <pault@gcc.gnu.org>
+ and Harald Anlauf <anlauf@gcc.gnu.org>
+
+ PR fortran/119460
+ * iresolve.cc (generate_reduce_op_wrapper): Increase the size
+ of 'tname'. Change intent of 'a' and 'b' to intent_in.
+ * trans-decl.cc (add_argument_checking): Do not test artificial
+ formal symbols.
+ * trans-expr.cc (gfc_conv_procedure_call): Remove reduce_scalar
+ and the blocks triggered by it.
+ * trans-intrinsic.cc (gfc_conv_intrinsic_function): Set the
+ result of non-character, scalar reduce to be allocatable.
+
+2025-04-09 Tobias Burnus <tburnus@baylibre.com>
+
+ PR fortran/101602
+ * resolve.cc (resolve_locality_spec): Remove 'sorry, unimplemented'.
+ * trans-stmt.cc (struct symbol_and_tree_t): New.
+ (gfc_trans_concurrent_locality_spec): New.
+ (gfc_trans_forall_1): Call it; update to handle local and local_init.
+ * trans-decl.cc (gfc_start_saved_local_decls,
+ gfc_stop_saved_local_decls): New; moved code from ...
+ (gfc_process_block_locals): ... here. Call it.
+ * trans.h (gfc_start_saved_local_decls,
+ gfc_stop_saved_local_decls): Declare.
+
2025-04-02 Sandra Loosemore <sloosemore@baylibre.com>
PR middle-end/118965
diff --git a/gcc/fortran/f95-lang.cc b/gcc/fortran/f95-lang.cc
index 124d62f..1f09553 100644
--- a/gcc/fortran/f95-lang.cc
+++ b/gcc/fortran/f95-lang.cc
@@ -148,6 +148,9 @@ gfc_get_sarif_source_language (const char *)
#undef LANG_HOOKS_OMP_CLAUSE_LINEAR_CTOR
#undef LANG_HOOKS_OMP_CLAUSE_DTOR
#undef LANG_HOOKS_OMP_FINISH_CLAUSE
+#undef LANG_HOOKS_OMP_DEEP_MAPPING
+#undef LANG_HOOKS_OMP_DEEP_MAPPING_P
+#undef LANG_HOOKS_OMP_DEEP_MAPPING_CNT
#undef LANG_HOOKS_OMP_ALLOCATABLE_P
#undef LANG_HOOKS_OMP_SCALAR_TARGET_P
#undef LANG_HOOKS_OMP_SCALAR_P
@@ -188,6 +191,9 @@ gfc_get_sarif_source_language (const char *)
#define LANG_HOOKS_OMP_CLAUSE_LINEAR_CTOR gfc_omp_clause_linear_ctor
#define LANG_HOOKS_OMP_CLAUSE_DTOR gfc_omp_clause_dtor
#define LANG_HOOKS_OMP_FINISH_CLAUSE gfc_omp_finish_clause
+#define LANG_HOOKS_OMP_DEEP_MAPPING gfc_omp_deep_mapping
+#define LANG_HOOKS_OMP_DEEP_MAPPING_P gfc_omp_deep_mapping_p
+#define LANG_HOOKS_OMP_DEEP_MAPPING_CNT gfc_omp_deep_mapping_cnt
#define LANG_HOOKS_OMP_ALLOCATABLE_P gfc_omp_allocatable_p
#define LANG_HOOKS_OMP_SCALAR_P gfc_omp_scalar_p
#define LANG_HOOKS_OMP_SCALAR_TARGET_P gfc_omp_scalar_target_p
diff --git a/gcc/fortran/interface.cc b/gcc/fortran/interface.cc
index c702239..1e552a3 100644
--- a/gcc/fortran/interface.cc
+++ b/gcc/fortran/interface.cc
@@ -2534,16 +2534,33 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
gfc_find_symbol (actual_name, gsym->ns, 0, &global_asym);
if (global_asym != NULL)
{
- gcc_assert (formal->attr.function);
- if (!gfc_compare_types (&global_asym->ts, &formal->ts))
+ if (formal->attr.subroutine)
{
- gfc_error ("Type mismatch at %L passing global "
- "function %qs declared at %L (%s/%s)",
- &actual->where, actual_name, &gsym->where,
- gfc_typename (&global_asym->ts),
- gfc_dummy_typename (&formal->ts));
+ gfc_error ("Mismatch between subroutine and "
+ "function at %L", &actual->where);
return false;
}
+ else if (formal->attr.function)
+ {
+ if (!gfc_compare_types (&global_asym->ts,
+ &formal->ts))
+ {
+ gfc_error ("Type mismatch at %L passing global "
+ "function %qs declared at %L (%s/%s)",
+ &actual->where, actual_name,
+ &gsym->where,
+ gfc_typename (&global_asym->ts),
+ gfc_dummy_typename (&formal->ts));
+ return false;
+ }
+ }
+ else
+ {
+ /* The global symbol is a function. Set the formal
+ argument acordingly. */
+ formal->attr.function = 1;
+ formal->ts = global_asym->ts;
+ }
}
}
}
diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc
index ded80b7..df82940 100644
--- a/gcc/fortran/openmp.cc
+++ b/gcc/fortran/openmp.cc
@@ -1588,7 +1588,7 @@ gfc_match_omp_clause_reduction (char pc, gfc_omp_clauses *c, bool openacc,
{
gfc_omp_namelist *p = gfc_get_omp_namelist (), **tl;
p->sym = n->sym;
- p->where = p->where;
+ p->where = n->where;
p->u.map.op = OMP_MAP_ALWAYS_TOFROM;
tl = &c->lists[OMP_LIST_MAP];
@@ -9681,22 +9681,6 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
&& n->sym->as->type == AS_ASSUMED_SIZE)
gfc_error ("Assumed size array %qs in %s clause at %L",
n->sym->name, name, &n->where);
- if (!openacc
- && list == OMP_LIST_MAP
- && n->sym->ts.type == BT_DERIVED
- && n->sym->ts.u.derived->attr.alloc_comp)
- gfc_error ("List item %qs with allocatable components is not "
- "permitted in map clause at %L", n->sym->name,
- &n->where);
- if (!openacc
- && (list == OMP_LIST_MAP
- || list == OMP_LIST_FROM
- || list == OMP_LIST_TO)
- && ((n->expr && n->expr->ts.type == BT_CLASS)
- || (!n->expr && n->sym->ts.type == BT_CLASS)))
- gfc_warning (OPT_Wopenmp,
- "Mapping polymorphic list item at %L is "
- "unspecified behavior", &n->where);
if (list == OMP_LIST_MAP && !openacc)
switch (code->op)
{
@@ -10008,9 +9992,11 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
n->sym->name, name, &n->where);
if (!openacc
- && list == OMP_LIST_FIRSTPRIVATE
- && ((n->expr && n->expr->ts.type == BT_CLASS)
- || (!n->expr && n->sym->ts.type == BT_CLASS)))
+ && (list == OMP_LIST_PRIVATE
+ || list == OMP_LIST_FIRSTPRIVATE)
+ && ((n->sym->ts.type == BT_DERIVED
+ && n->sym->ts.u.derived->attr.alloc_comp)
+ || n->sym->ts.type == BT_CLASS))
switch (code->op)
{
case EXEC_OMP_TARGET:
@@ -10025,9 +10011,19 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD:
case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD:
case EXEC_OMP_TARGET_TEAMS_LOOP:
- gfc_warning (OPT_Wopenmp,
- "FIRSTPRIVATE with polymorphic list item at "
- "%L is unspecified behavior", &n->where);
+ if (n->sym->ts.type == BT_DERIVED
+ && n->sym->ts.u.derived->attr.alloc_comp)
+ gfc_error ("Sorry, list item %qs at %L with allocatable"
+ " components is not yet supported in %s "
+ "clause", n->sym->name, &n->where,
+ list == OMP_LIST_PRIVATE ? "PRIVATE"
+ : "FIRSTPRIVATE");
+ else
+ gfc_error ("Polymorphic list item %qs at %L in %s "
+ "clause has unspecified behavior and "
+ "unsupported", n->sym->name, &n->where,
+ list == OMP_LIST_PRIVATE ? "PRIVATE"
+ : "FIRSTPRIVATE");
break;
default:
break;
diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index cdf043b..f03708e 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -3190,6 +3190,13 @@ gfc_pure_function (gfc_expr *e, const char **name)
|| e->value.function.isym->elemental;
*name = e->value.function.isym->name;
}
+ else if (e->symtree && e->symtree->n.sym && e->symtree->n.sym->attr.dummy)
+ {
+ /* The function has been resolved, but esym is not yet set.
+ This can happen with functions as dummy argument. */
+ pure = e->symtree->n.sym->attr.pure;
+ *name = e->symtree->n.sym->name;
+ }
else
{
/* Implicit functions are not pure. */
@@ -3253,14 +3260,30 @@ static bool check_pure_function (gfc_expr *e)
gfc_do_concurrent_flag = 0 when the check for an impure function
occurs. Check the stack to see if the source code has a nested
BLOCK construct. */
+
for (stack = cs_base; stack; stack = stack->prev)
{
- if (stack->current->op == EXEC_BLOCK) saw_block = true;
+ if (!saw_block && stack->current->op == EXEC_BLOCK)
+ {
+ saw_block = true;
+ continue;
+ }
+
if (saw_block && stack->current->op == EXEC_DO_CONCURRENT)
{
- gfc_error ("Reference to impure function at %L inside a "
- "DO CONCURRENT", &e->where);
- return false;
+ bool is_pure;
+ is_pure = (e->value.function.isym
+ && (e->value.function.isym->pure
+ || e->value.function.isym->elemental))
+ || (e->value.function.esym
+ && (e->value.function.esym->attr.pure
+ || e->value.function.esym->attr.elemental));
+ if (!is_pure)
+ {
+ gfc_error ("Reference to impure function at %L inside a "
+ "DO CONCURRENT", &e->where);
+ return false;
+ }
}
}
@@ -3656,16 +3679,29 @@ pure_subroutine (gfc_symbol *sym, const char *name, locus *loc)
/* A BLOCK construct within a DO CONCURRENT construct leads to
gfc_do_concurrent_flag = 0 when the check for an impure subroutine
- occurs. Check the stack to see if the source code has a nested
- BLOCK construct. */
+ occurs. Walk up the stack to see if the source code has a nested
+ construct. */
+
for (stack = cs_base; stack; stack = stack->prev)
{
- if (stack->current->op == EXEC_BLOCK) saw_block = true;
+ if (stack->current->op == EXEC_BLOCK)
+ {
+ saw_block = true;
+ continue;
+ }
+
if (saw_block && stack->current->op == EXEC_DO_CONCURRENT)
{
- gfc_error ("Subroutine call at %L in a DO CONCURRENT block "
- "is not PURE", loc);
- return false;
+
+ bool is_pure = true;
+ is_pure = sym->attr.pure || sym->attr.elemental;
+
+ if (!is_pure)
+ {
+ gfc_error ("Subroutine call at %L in a DO CONCURRENT block "
+ "is not PURE", loc);
+ return false;
+ }
}
}
diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
index aea132d..ddc4960 100644
--- a/gcc/fortran/trans-decl.cc
+++ b/gcc/fortran/trans-decl.cc
@@ -6920,6 +6920,7 @@ add_clause (gfc_symbol *sym, gfc_omp_map_op map_op)
n = gfc_get_omp_namelist ();
n->sym = sym;
+ n->where = sym->declared_at;
n->u.map.op = map_op;
if (!module_oacc_clauses)
diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc
index 03d9432..0b8150f 100644
--- a/gcc/fortran/trans-openmp.cc
+++ b/gcc/fortran/trans-openmp.cc
@@ -25,6 +25,10 @@ along with GCC; see the file COPYING3. If not see
#include "options.h"
#include "tree.h"
#include "gfortran.h"
+#include "basic-block.h"
+#include "tree-ssa.h"
+#include "function.h"
+#include "gimple.h"
#include "gimple-expr.h"
#include "trans.h"
#include "stringpool.h"
@@ -41,6 +45,8 @@ along with GCC; see the file COPYING3. If not see
#include "omp-low.h"
#include "memmodel.h" /* For MEMMODEL_ enums. */
#include "dependency.h"
+#include "gimple-iterator.h" /* For gsi_iterator_update. */
+#include "gimplify-me.h" /* For force_gimple_operand. */
#undef GCC_DIAG_STYLE
#define GCC_DIAG_STYLE __gcc_tdiag__
@@ -375,22 +381,28 @@ gfc_omp_report_decl (tree decl)
return decl;
}
-/* Return true if TYPE has any allocatable components. */
+/* Return true if TYPE has any allocatable components;
+ if ptr_ok, the decl itself is permitted to have the POINTER attribute.
+ if shallow_alloc_only, returns only true if any of the fields is an
+ allocatable; called with true by gfc_omp_replace_alloc_by_to_mapping. */
static bool
-gfc_has_alloc_comps (tree type, tree decl)
+gfc_has_alloc_comps (tree type, tree decl, bool ptr_ok,
+ bool shallow_alloc_only=false)
{
tree field, ftype;
if (POINTER_TYPE_P (type))
{
- if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl))
+ if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)
+ || (ptr_ok && GFC_DECL_GET_SCALAR_POINTER (decl)))
type = TREE_TYPE (type);
else if (GFC_DECL_GET_SCALAR_POINTER (decl))
return false;
}
- if (GFC_DESCRIPTOR_TYPE_P (type)
+ if (!ptr_ok
+ && GFC_DESCRIPTOR_TYPE_P (type)
&& (GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_POINTER
|| GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_POINTER_CONT))
return false;
@@ -409,12 +421,51 @@ gfc_has_alloc_comps (tree type, tree decl)
if (GFC_DESCRIPTOR_TYPE_P (ftype)
&& GFC_TYPE_ARRAY_AKIND (ftype) == GFC_ARRAY_ALLOCATABLE)
return true;
- if (gfc_has_alloc_comps (ftype, field))
+ if (!shallow_alloc_only
+ && gfc_has_alloc_comps (ftype, field, false))
return true;
}
return false;
}
+/* gfc_omp_replace_alloc_by_to_mapping is used with gfc_omp_deep_mapping... to
+ handle the following:
+
+ For map(alloc: dt), the array descriptors of allocatable components should
+ be mapped as 'to'; this could be done by (A) adding 'map(to: dt%alloc_comp)'
+ for each component (and avoiding to increment the reference count).
+ Or (B) by just mapping all of 'dt' as 'to'.
+
+ If 'dt' contains several allocatable components and not much other data,
+ (A) is more efficient. If 'dt' contains a large const-size array, (A) will
+ copy it to the device instead of only 'alloc'ating it.
+
+ IMPLEMENTATION CHOICE: We do (A). It avoids the ref-count issue and it is
+ expected that, for real-world code, derived types with allocatable
+ components only have few other components and either no const-size arrays.
+ This copying is done irrespectively whether the allocatables are allocated.
+
+ If users wanted to save memory, they have to use 'map(alloc:dt%comp)' as
+ also with 'map(alloc:dt)' all components get copied.
+
+ For the copy to the device, only allocatable arrays are relevant as their
+ the bounds are required; the pointer is set separately (GOMP_MAP_ATTACH)
+ and the only setting required for scalars. However, when later copying out
+ of the device, an unallocated allocatable must remain unallocated/NULL on
+ the host; to achieve this we also must have it set to NULL on the device
+ to avoid issues with uninitialized memory being copied back for the pointer
+ address. If we could set the pointer to NULL, gfc_has_alloc_comps's
+ shallow_alloc_only could be restricted to return true only for arrays.
+
+ We only need to return true if there are allocatable-array components. */
+
+static bool
+gfc_omp_replace_alloc_by_to_mapping (tree type, tree decl, bool ptr_ok)
+{
+ return gfc_has_alloc_comps (type, decl, ptr_ok, true);
+}
+
+
/* Return true if TYPE is polymorphic but not with pointer attribute. */
static bool
@@ -487,7 +538,7 @@ gfc_omp_private_outer_ref (tree decl)
if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl))
return true;
- if (gfc_has_alloc_comps (type, decl))
+ if (gfc_has_alloc_comps (type, decl, false))
return true;
return false;
@@ -627,7 +678,7 @@ gfc_walk_alloc_comps (tree decl, tree dest, tree var,
{
tree ftype = TREE_TYPE (field);
tree declf, destf = NULL_TREE;
- bool has_alloc_comps = gfc_has_alloc_comps (ftype, field);
+ bool has_alloc_comps = gfc_has_alloc_comps (ftype, field, false);
if ((!GFC_DESCRIPTOR_TYPE_P (ftype)
|| GFC_TYPE_ARRAY_AKIND (ftype) != GFC_ARRAY_ALLOCATABLE)
&& !GFC_DECL_GET_SCALAR_ALLOCATABLE (field)
@@ -751,7 +802,7 @@ gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer)
&& (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
|| !POINTER_TYPE_P (type)))
{
- if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
+ if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause), false))
{
gcc_assert (outer);
gfc_start_block (&block);
@@ -804,7 +855,7 @@ gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer)
else
gfc_add_modify (&cond_block, unshare_expr (decl),
fold_convert (TREE_TYPE (decl), ptr));
- if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
+ if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause), false))
{
tree tem = gfc_walk_alloc_comps (outer, decl,
OMP_CLAUSE_DECL (clause),
@@ -945,7 +996,7 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src)
&& (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
|| !POINTER_TYPE_P (type)))
{
- if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
+ if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause), false))
{
gfc_start_block (&block);
gfc_add_modify (&block, dest, src);
@@ -1004,7 +1055,7 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src)
builtin_decl_explicit (BUILT_IN_MEMCPY), 3, ptr,
srcptr, size);
gfc_add_expr_to_block (&cond_block, fold_convert (void_type_node, call));
- if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
+ if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause), false))
{
tree tem = gfc_walk_alloc_comps (src, dest,
OMP_CLAUSE_DECL (clause),
@@ -1049,7 +1100,7 @@ gfc_omp_clause_assign_op (tree clause, tree dest, tree src)
&& (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
|| !POINTER_TYPE_P (type)))
{
- if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
+ if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause), false))
{
gfc_start_block (&block);
/* First dealloc any allocatable components in DEST. */
@@ -1071,7 +1122,7 @@ gfc_omp_clause_assign_op (tree clause, tree dest, tree src)
gfc_start_block (&block);
- if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
+ if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause), false))
{
then_b = gfc_walk_alloc_comps (dest, NULL_TREE, OMP_CLAUSE_DECL (clause),
WALK_ALLOC_COMPS_DTOR);
@@ -1186,7 +1237,7 @@ gfc_omp_clause_assign_op (tree clause, tree dest, tree src)
builtin_decl_explicit (BUILT_IN_MEMCPY), 3, ptr,
srcptr, size);
gfc_add_expr_to_block (&cond_block, fold_convert (void_type_node, call));
- if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
+ if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause), false))
{
tree tem = gfc_walk_alloc_comps (src, dest,
OMP_CLAUSE_DECL (clause),
@@ -1438,7 +1489,7 @@ gfc_omp_clause_dtor (tree clause, tree decl)
&& (!GFC_DECL_GET_SCALAR_ALLOCATABLE (OMP_CLAUSE_DECL (clause))
|| !POINTER_TYPE_P (type)))
{
- if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
+ if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause), false))
return gfc_walk_alloc_comps (decl, NULL_TREE,
OMP_CLAUSE_DECL (clause),
WALK_ALLOC_COMPS_DTOR);
@@ -1458,7 +1509,7 @@ gfc_omp_clause_dtor (tree clause, tree decl)
tem = gfc_call_free (decl);
tem = gfc_omp_unshare_expr (tem);
- if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause)))
+ if (gfc_has_alloc_comps (type, OMP_CLAUSE_DECL (clause), false))
{
stmtblock_t block;
tree then_b;
@@ -1538,6 +1589,7 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
return;
tree decl = OMP_CLAUSE_DECL (c);
+ location_t loc = OMP_CLAUSE_LOCATION (c);
/* Assumed-size arrays can't be mapped implicitly, they have to be
mapped explicitly using array sections. */
@@ -1553,13 +1605,9 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
return;
}
- if (!openacc && GFC_CLASS_TYPE_P (TREE_TYPE (decl)))
- warning_at (OMP_CLAUSE_LOCATION (c), OPT_Wopenmp,
- "Implicit mapping of polymorphic variable %qD is "
- "unspecified behavior", decl);
-
tree c2 = NULL_TREE, c3 = NULL_TREE, c4 = NULL_TREE;
tree present = gfc_omp_check_optional_argument (decl, true);
+ tree orig_decl = NULL_TREE;
if (POINTER_TYPE_P (TREE_TYPE (decl)))
{
if (!gfc_omp_privatize_by_reference (decl)
@@ -1568,7 +1616,7 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
&& !GFC_DECL_CRAY_POINTEE (decl)
&& !GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (decl))))
return;
- tree orig_decl = decl;
+ orig_decl = decl;
c4 = build_omp_clause (OMP_CLAUSE_LOCATION (c), OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (c4, GOMP_MAP_POINTER);
@@ -1579,16 +1627,16 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
&& (GFC_DECL_GET_SCALAR_POINTER (orig_decl)
|| GFC_DECL_GET_SCALAR_ALLOCATABLE (orig_decl)))
{
- c2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
+ c2 = build_omp_clause (loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (c2, GOMP_MAP_POINTER);
- OMP_CLAUSE_DECL (c2) = decl;
+ OMP_CLAUSE_DECL (c2) = unshare_expr (decl);
OMP_CLAUSE_SIZE (c2) = size_int (0);
stmtblock_t block;
gfc_start_block (&block);
- tree ptr = decl;
- ptr = gfc_build_cond_assign_expr (&block, present, decl,
- null_pointer_node);
+ tree ptr = gfc_build_cond_assign_expr (&block, present,
+ unshare_expr (decl),
+ null_pointer_node);
gimplify_and_add (gfc_finish_block (&block), pre_p);
ptr = build_fold_indirect_ref (ptr);
OMP_CLAUSE_DECL (c) = ptr;
@@ -1605,10 +1653,10 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
{
c3 = build_omp_clause (OMP_CLAUSE_LOCATION (c), OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (c3, GOMP_MAP_POINTER);
- OMP_CLAUSE_DECL (c3) = unshare_expr (decl);
+ OMP_CLAUSE_DECL (c3) = decl;
OMP_CLAUSE_SIZE (c3) = size_int (0);
decl = build_fold_indirect_ref (decl);
- OMP_CLAUSE_DECL (c) = decl;
+ OMP_CLAUSE_DECL (c) = unshare_expr (decl);
}
}
if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl)))
@@ -1634,7 +1682,7 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
ptr = build_fold_indirect_ref (ptr);
OMP_CLAUSE_DECL (c) = ptr;
- c2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
+ c2 = build_omp_clause (loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (c2, GOMP_MAP_TO_PSET);
if (present)
{
@@ -1651,7 +1699,7 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
: GOMP_MAP_POINTER);
if (present)
{
- ptr = gfc_conv_descriptor_data_get (decl);
+ ptr = gfc_conv_descriptor_data_get (unshare_expr (decl));
ptr = gfc_build_addr_expr (NULL, ptr);
ptr = gfc_build_cond_assign_expr (&block, present,
ptr, null_pointer_node);
@@ -1664,6 +1712,17 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
tree size = create_tmp_var (gfc_array_index_type);
tree elemsz = TYPE_SIZE_UNIT (gfc_get_element_type (type));
elemsz = fold_convert (gfc_array_index_type, elemsz);
+
+ if (orig_decl == NULL_TREE)
+ orig_decl = decl;
+ if (!openacc
+ && gfc_has_alloc_comps (type, orig_decl, true))
+ {
+ /* Save array descriptor for use in gfc_omp_deep_mapping{,_p,_cnt};
+ force evaluate to ensure that it is not gimplified + is a decl. */
+ gfc_allocate_lang_decl (size);
+ GFC_DECL_SAVED_DESCRIPTOR (size) = orig_decl;
+ }
enum gfc_array_kind akind = GFC_TYPE_ARRAY_AKIND (type);
if (akind == GFC_ARRAY_ALLOCATABLE
|| akind == GFC_ARRAY_POINTER
@@ -1692,14 +1751,14 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
else_b = gfc_finish_block (&cond_block);
tem = gfc_conv_descriptor_data_get (unshare_expr (decl));
tem = fold_convert (pvoid_type_node, tem);
- cond = fold_build2_loc (input_location, NE_EXPR,
+ cond = fold_build2_loc (loc, NE_EXPR,
boolean_type_node, tem, null_pointer_node);
if (present)
{
- cond = fold_build2_loc (input_location, TRUTH_ANDIF_EXPR,
+ cond = fold_build2_loc (loc, TRUTH_ANDIF_EXPR,
boolean_type_node, present, cond);
}
- gfc_add_expr_to_block (&block, build3_loc (input_location, COND_EXPR,
+ gfc_add_expr_to_block (&block, build3_loc (loc, COND_EXPR,
void_type_node, cond,
then_b, else_b));
}
@@ -1739,11 +1798,30 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
tree stmt = gfc_finish_block (&block);
gimplify_and_add (stmt, pre_p);
}
+ else
+ {
+ if (OMP_CLAUSE_SIZE (c) == NULL_TREE)
+ OMP_CLAUSE_SIZE (c)
+ = DECL_P (decl) ? DECL_SIZE_UNIT (decl)
+ : TYPE_SIZE_UNIT (TREE_TYPE (decl));
+
+ tree type = TREE_TYPE (decl);
+ if (POINTER_TYPE_P (type) && POINTER_TYPE_P (TREE_TYPE (type)))
+ type = TREE_TYPE (type);
+ if (!openacc
+ && orig_decl != NULL_TREE
+ && gfc_has_alloc_comps (type, orig_decl, true))
+ {
+ /* Save array descriptor for use in gfc_omp_deep_mapping{,_p,_cnt};
+ force evaluate to ensure that it is not gimplified + is a decl. */
+ tree size = create_tmp_var (TREE_TYPE (OMP_CLAUSE_SIZE (c)));
+ gfc_allocate_lang_decl (size);
+ GFC_DECL_SAVED_DESCRIPTOR (size) = orig_decl;
+ gimplify_assign (size, OMP_CLAUSE_SIZE (c), pre_p);
+ OMP_CLAUSE_SIZE (c) = size;
+ }
+ }
tree last = c;
- if (OMP_CLAUSE_SIZE (c) == NULL_TREE)
- OMP_CLAUSE_SIZE (c)
- = DECL_P (decl) ? DECL_SIZE_UNIT (decl)
- : TYPE_SIZE_UNIT (TREE_TYPE (decl));
if (gimplify_expr (&OMP_CLAUSE_SIZE (c), pre_p,
NULL, is_gimple_val, fb_rvalue) == GS_ERROR)
OMP_CLAUSE_SIZE (c) = size_int (0);
@@ -1767,6 +1845,715 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p, bool openacc)
}
+/* map(<flag>: data [len: <size>])
+ map(attach: &data [bias: <bias>])
+ offset += 2; offset_data += 2 */
+static void
+gfc_omp_deep_mapping_map (tree data, tree size, unsigned HOST_WIDE_INT tkind,
+ location_t loc, tree data_array, tree sizes_array,
+ tree kinds_array, tree offset_data, tree offset,
+ gimple_seq *seq, const gimple *ctx)
+{
+ tree one = build_int_cst (size_type_node, 1);
+
+ STRIP_NOPS (data);
+ if (!POINTER_TYPE_P (TREE_TYPE (data)))
+ {
+ gcc_assert (TREE_CODE (data) == INDIRECT_REF);
+ data = TREE_OPERAND (data, 0);
+ }
+
+ /* data_array[offset_data] = data; */
+ tree tmp = build4 (ARRAY_REF, TREE_TYPE (TREE_TYPE (data_array)),
+ unshare_expr (data_array), offset_data,
+ NULL_TREE, NULL_TREE);
+ gimplify_assign (tmp, data, seq);
+
+ /* offset_data++ */
+ tmp = build2_loc (loc, PLUS_EXPR, size_type_node, offset_data, one);
+ gimplify_assign (offset_data, tmp, seq);
+
+ /* data_array[offset_data] = &data; */
+ tmp = build4 (ARRAY_REF, TREE_TYPE (TREE_TYPE (data_array)),
+ unshare_expr (data_array),
+ offset_data, NULL_TREE, NULL_TREE);
+ gimplify_assign (tmp, build_fold_addr_expr (data), seq);
+
+ /* offset_data++ */
+ tmp = build2_loc (loc, PLUS_EXPR, size_type_node, offset_data, one);
+ gimplify_assign (offset_data, tmp, seq);
+
+ /* sizes_array[offset] = size */
+ tmp = build2_loc (loc, MULT_EXPR, size_type_node,
+ TYPE_SIZE_UNIT (size_type_node), offset);
+ tmp = build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (sizes_array),
+ sizes_array, tmp);
+ gimple_seq seq2 = NULL;
+ tmp = force_gimple_operand (tmp, &seq2, true, NULL_TREE);
+ gimple_seq_add_seq (seq, seq2);
+ tmp = build_fold_indirect_ref_loc (loc, tmp);
+ gimplify_assign (tmp, size, seq);
+
+ /* FIXME: tkind |= talign << talign_shift; */
+ /* kinds_array[offset] = tkind. */
+ tmp = build2_loc (loc, MULT_EXPR, size_type_node,
+ TYPE_SIZE_UNIT (short_unsigned_type_node), offset);
+ tmp = build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (kinds_array),
+ kinds_array, tmp);
+ seq2 = NULL;
+ tmp = force_gimple_operand (tmp, &seq2, true, NULL_TREE);
+ gimple_seq_add_seq (seq, seq2);
+ tmp = build_fold_indirect_ref_loc (loc, tmp);
+ gimplify_assign (tmp, build_int_cst (short_unsigned_type_node, tkind), seq);
+
+ /* offset++ */
+ tmp = build2_loc (loc, PLUS_EXPR, size_type_node, offset, one);
+ gimplify_assign (offset, tmp, seq);
+
+ /* sizes_array[offset] = bias (= 0). */
+ tmp = build2_loc (loc, MULT_EXPR, size_type_node,
+ TYPE_SIZE_UNIT (size_type_node), offset);
+ tmp = build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (sizes_array),
+ sizes_array, tmp);
+ seq2 = NULL;
+ tmp = force_gimple_operand (tmp, &seq2, true, NULL_TREE);
+ gimple_seq_add_seq (seq, seq2);
+ tmp = build_fold_indirect_ref_loc (loc, tmp);
+ gimplify_assign (tmp, build_zero_cst (size_type_node), seq);
+
+ gcc_assert (gimple_code (ctx) == GIMPLE_OMP_TARGET);
+ tkind = (gimple_omp_target_kind (ctx) == GF_OMP_TARGET_KIND_EXIT_DATA
+ ? GOMP_MAP_DETACH : GOMP_MAP_ATTACH);
+
+ /* kinds_array[offset] = tkind. */
+ tmp = build2_loc (loc, MULT_EXPR, size_type_node,
+ TYPE_SIZE_UNIT (short_unsigned_type_node), offset);
+ tmp = build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (kinds_array),
+ kinds_array, tmp);
+ seq2 = NULL;
+ tmp = force_gimple_operand (tmp, &seq2, true, NULL_TREE);
+ gimple_seq_add_seq (seq, seq2);
+ tmp = build_fold_indirect_ref_loc (loc, tmp);
+ gimplify_assign (tmp, build_int_cst (short_unsigned_type_node, tkind), seq);
+
+ /* offset++ */
+ tmp = build2_loc (loc, PLUS_EXPR, size_type_node, offset, one);
+ gimplify_assign (offset, tmp, seq);
+}
+
+static void gfc_omp_deep_mapping_item (bool, bool, bool, location_t, tree,
+ tree *, unsigned HOST_WIDE_INT, tree,
+ tree, tree, tree, tree, tree,
+ gimple_seq *, const gimple *, bool *);
+
+/* Map allocatable components. */
+static void
+gfc_omp_deep_mapping_comps (bool is_cnt, location_t loc, tree decl,
+ tree *token, unsigned HOST_WIDE_INT tkind,
+ tree data_array, tree sizes_array, tree kinds_array,
+ tree offset_data, tree offset, tree num,
+ gimple_seq *seq, const gimple *ctx,
+ bool *poly_warned)
+{
+ tree type = TREE_TYPE (decl);
+ if (TREE_CODE (type) != RECORD_TYPE)
+ return;
+ for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
+ {
+ type = TREE_TYPE (field);
+ if (gfc_is_polymorphic_nonptr (type)
+ || GFC_DECL_GET_SCALAR_ALLOCATABLE (field)
+ || (GFC_DESCRIPTOR_TYPE_P (type)
+ && GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE))
+ {
+ tree tmp = fold_build3_loc (loc, COMPONENT_REF, TREE_TYPE (field),
+ decl, field, NULL_TREE);
+ gfc_omp_deep_mapping_item (is_cnt, true, true, loc, tmp, token,
+ tkind, data_array, sizes_array,
+ kinds_array, offset_data, offset, num,
+ seq, ctx, poly_warned);
+ }
+ else if (GFC_DECL_GET_SCALAR_POINTER (field)
+ || GFC_DESCRIPTOR_TYPE_P (type))
+ continue;
+ else if (gfc_has_alloc_comps (TREE_TYPE (field), field, false))
+ {
+ tree tmp = fold_build3_loc (loc, COMPONENT_REF, TREE_TYPE (field),
+ decl, field, NULL_TREE);
+ if (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE)
+ gfc_omp_deep_mapping_item (is_cnt, false, false, loc, tmp,
+ token, tkind, data_array, sizes_array,
+ kinds_array, offset_data, offset, num,
+ seq, ctx, poly_warned);
+ else
+ gfc_omp_deep_mapping_comps (is_cnt, loc, tmp, token, tkind,
+ data_array, sizes_array, kinds_array,
+ offset_data, offset, num, seq, ctx,
+ poly_warned);
+ }
+ }
+}
+
+static void
+gfc_omp_gen_simple_loop (tree var, tree begin, tree end, enum tree_code cond,
+ tree step, location_t loc, gimple_seq *seq1,
+ gimple_seq *seq2)
+{
+ tree tmp;
+
+ /* var = begin. */
+ gimplify_assign (var, begin, seq1);
+
+ /* Loop: for (var = begin; var <cond> end; var += step). */
+ tree label_loop = create_artificial_label (loc);
+ tree label_cond = create_artificial_label (loc);
+
+ gimplify_and_add (fold_build1_loc (loc, GOTO_EXPR, void_type_node,
+ label_cond), seq1);
+ gimple_seq_add_stmt (seq1, gimple_build_label (label_loop));
+
+ /* Everything above is seq1; place loop body here. */
+
+ /* End of loop body -> put into seq2. */
+ tmp = fold_build2_loc (loc, PLUS_EXPR, TREE_TYPE (var), var, step);
+ gimplify_assign (var, tmp, seq2);
+ gimple_seq_add_stmt (seq2, gimple_build_label (label_cond));
+ tmp = fold_build2_loc (loc, cond, boolean_type_node, var, end);
+ tmp = build3_v (COND_EXPR, tmp, build1_v (GOTO_EXPR, label_loop),
+ build_empty_stmt (loc));
+ gimplify_and_add (tmp, seq2);
+}
+
+/* Return size variable with the size of an array. */
+static tree
+gfc_omp_get_array_size (location_t loc, tree desc, gimple_seq *seq)
+{
+ tree tmp;
+ gimple_seq seq1 = NULL, seq2 = NULL;
+ tree size = build_decl (loc, VAR_DECL, create_tmp_var_name ("size"),
+ size_type_node);
+ tree extent = build_decl (loc, VAR_DECL, create_tmp_var_name ("extent"),
+ gfc_array_index_type);
+ tree idx = build_decl (loc, VAR_DECL, create_tmp_var_name ("idx"),
+ signed_char_type_node);
+
+ tree begin = build_zero_cst (signed_char_type_node);
+ tree end;
+ if (GFC_TYPE_ARRAY_AKIND (TREE_TYPE (desc)) == GFC_ARRAY_ASSUMED_SHAPE_CONT
+ || GFC_TYPE_ARRAY_AKIND (TREE_TYPE (desc)) == GFC_ARRAY_ASSUMED_SHAPE)
+ end = gfc_conv_descriptor_rank (desc);
+ else
+ end = build_int_cst (signed_char_type_node,
+ GFC_TYPE_ARRAY_RANK (TREE_TYPE (desc)));
+ tree step = build_int_cst (signed_char_type_node, 1);
+
+ /* size = 0
+ for (idx = 0; idx < rank; idx++)
+ extent = gfc->dim[i].ubound - gfc->dim[i].lbound + 1
+ if (extent < 0) extent = 0
+ size *= extent. */
+ gimplify_assign (size, build_int_cst (size_type_node, 1), seq);
+
+ gfc_omp_gen_simple_loop (idx, begin, end, LT_EXPR, step, loc, &seq1, &seq2);
+ gimple_seq_add_seq (seq, seq1);
+
+ tmp = fold_build2_loc (loc, MINUS_EXPR, gfc_array_index_type,
+ gfc_conv_descriptor_ubound_get (desc, idx),
+ gfc_conv_descriptor_lbound_get (desc, idx));
+ tmp = fold_build2_loc (loc, PLUS_EXPR, gfc_array_index_type,
+ tmp, gfc_index_one_node);
+ gimplify_assign (extent, tmp, seq);
+ tmp = fold_build2_loc (loc, LT_EXPR, boolean_type_node,
+ extent, gfc_index_zero_node);
+ tmp = build3_v (COND_EXPR, tmp,
+ fold_build2_loc (loc, MODIFY_EXPR,
+ gfc_array_index_type,
+ extent, gfc_index_zero_node),
+ build_empty_stmt (loc));
+ gimplify_and_add (tmp, seq);
+ /* size *= extent. */
+ gimplify_assign (size, fold_build2_loc (loc, MULT_EXPR, size_type_node, size,
+ fold_convert (size_type_node,
+ extent)), seq);
+ gimple_seq_add_seq (seq, seq2);
+ return size;
+}
+
+/* Generate loop to access every array element; takes addr of first element
+ (decl's data comp); returns loop code in seq1 + seq2
+ and the pointer to the element as return value. */
+static tree
+gfc_omp_elmental_loop (location_t loc, tree decl, tree size, tree elem_len,
+ gimple_seq *seq1, gimple_seq *seq2)
+{
+ tree idx = build_decl (loc, VAR_DECL, create_tmp_var_name ("idx"),
+ size_type_node);
+ tree begin = build_zero_cst (size_type_node);
+ tree end = size;
+ tree step = build_int_cst (size_type_node, 1);
+ tree ptr;
+
+ gfc_omp_gen_simple_loop (idx, begin, end, LT_EXPR, step, loc, seq1, seq2);
+
+ tree type = TREE_TYPE (decl);
+ if (POINTER_TYPE_P (type))
+ {
+ type = TREE_TYPE (type);
+ gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
+ decl = fold_convert (build_pointer_type (TREE_TYPE (type)), decl);
+ }
+ else
+ {
+ gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
+ decl = build_fold_addr_expr_loc (loc, decl);
+ }
+ decl = fold_convert (build_pointer_type (TREE_TYPE (type)), decl);
+ tree tmp = build2_loc (loc, MULT_EXPR, size_type_node, idx,
+ fold_convert (size_type_node, elem_len));
+ ptr = build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (decl), decl, tmp);
+ gimple_seq seq3 = NULL;
+ ptr = force_gimple_operand (ptr, &seq3, true, NULL_TREE);
+ gimple_seq_add_seq (seq1, seq3);
+
+ return ptr;
+}
+
+
+/* If do_copy, copy data pointer and vptr (if applicable) as well.
+ Otherwise, only handle allocatable components.
+ do_copy == false can happen only with nonpolymorphic arguments
+ to a copy clause.
+ if (is_cnt) token ... offset is ignored and num is used, otherwise
+ num is NULL_TREE and unused. */
+
+static void
+gfc_omp_deep_mapping_item (bool is_cnt, bool do_copy, bool do_alloc_check,
+ location_t loc, tree decl, tree *token,
+ unsigned HOST_WIDE_INT tkind, tree data_array,
+ tree sizes_array, tree kinds_array, tree offset_data,
+ tree offset, tree num, gimple_seq *seq,
+ const gimple *ctx, bool *poly_warned)
+{
+ tree tmp;
+ tree type = TREE_TYPE (decl);
+ if (POINTER_TYPE_P (type))
+ type = TREE_TYPE (type);
+ tree end_label = NULL_TREE;
+ tree size = NULL_TREE, elem_len = NULL_TREE;
+
+ bool poly = gfc_is_polymorphic_nonptr (type);
+ if (poly && is_cnt && !*poly_warned)
+ {
+ if (gfc_is_unlimited_polymorphic_nonptr (type))
+ error_at (loc,
+ "Mapping of unlimited polymorphic list item %qD is "
+ "unspecified behavior and unsupported", decl);
+
+ else
+ warning_at (loc, OPT_Wopenmp,
+ "Mapping of polymorphic list item %qD is "
+ "unspecified behavior", decl);
+ *poly_warned = true;
+ }
+ if (do_alloc_check)
+ {
+ tree then_label = create_artificial_label (loc);
+ end_label = create_artificial_label (loc);
+ tmp = decl;
+ if (TREE_CODE (TREE_TYPE (tmp)) == REFERENCE_TYPE
+ || (POINTER_TYPE_P (TREE_TYPE (tmp))
+ && (POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (tmp)))
+ || GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (TREE_TYPE (tmp))))))
+ tmp = build_fold_indirect_ref_loc (loc, tmp);
+ if (poly)
+ tmp = gfc_class_data_get (tmp);
+ if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (tmp)))
+ tmp = gfc_conv_descriptor_data_get (tmp);
+ gimple_seq seq2 = NULL;
+ tmp = force_gimple_operand (tmp, &seq2, true, NULL_TREE);
+ gimple_seq_add_seq (seq, seq2);
+
+ gimple_seq_add_stmt (seq,
+ gimple_build_cond (NE_EXPR, tmp, null_pointer_node,
+ then_label, end_label));
+ gimple_seq_add_stmt (seq, gimple_build_label (then_label));
+ }
+ tree class_decl = decl;
+ if (poly)
+ {
+ decl = gfc_class_data_get (decl);
+ type = TREE_TYPE (decl);
+ }
+ if (POINTER_TYPE_P (TREE_TYPE (decl)))
+ {
+ decl = build_fold_indirect_ref (decl);
+ type = TREE_TYPE (decl);
+ }
+
+ if (is_cnt && do_copy)
+ {
+ tree tmp = fold_build2_loc (loc, PLUS_EXPR, size_type_node,
+ num, build_int_cst (size_type_node, 1));
+ gimplify_assign (num, tmp, seq);
+ }
+ else if (do_copy)
+ {
+ /* copy data pointer */
+ tree bytesize;
+ if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl)))
+ {
+ /* TODO: Optimization: Shouldn't this be an expr. const, except for
+ deferred-length strings. (Cf. also below). */
+ elem_len = (poly ? gfc_class_vtab_size_get (class_decl)
+ : gfc_conv_descriptor_elem_len (decl));
+ tmp = (POINTER_TYPE_P (TREE_TYPE (decl))
+ ? build_fold_indirect_ref (decl) : decl);
+ size = gfc_omp_get_array_size (loc, tmp, seq);
+ bytesize = fold_build2_loc (loc, MULT_EXPR, size_type_node,
+ fold_convert (size_type_node, size),
+ fold_convert (size_type_node, elem_len));
+ tmp = gfc_conv_descriptor_data_get (decl);
+ }
+ else if (poly)
+ {
+ tmp = decl;
+ bytesize = fold_convert (size_type_node,
+ gfc_class_vtab_size_get (class_decl));
+ }
+ else
+ {
+ tmp = decl;
+ bytesize = TYPE_SIZE_UNIT (TREE_TYPE (decl));
+ }
+ unsigned HOST_WIDE_INT tkind2 = tkind;
+ if (!is_cnt
+ && (tkind == GOMP_MAP_ALLOC
+ || (tkind == GOMP_MAP_FROM
+ && (gimple_omp_target_kind (ctx)
+ != GF_OMP_TARGET_KIND_EXIT_DATA)))
+ && gfc_omp_replace_alloc_by_to_mapping (TREE_TYPE (decl), decl, true))
+ tkind2 = tkind == GOMP_MAP_ALLOC ? GOMP_MAP_TO : GOMP_MAP_TOFROM;
+
+ gfc_omp_deep_mapping_map (tmp, bytesize, tkind2, loc, data_array,
+ sizes_array, kinds_array, offset_data,
+ offset, seq, ctx);
+ }
+
+ tmp = decl;
+ if (POINTER_TYPE_P (TREE_TYPE (decl)))
+ while (TREE_CODE (tmp) == COMPONENT_REF || TREE_CODE (tmp) == ARRAY_REF)
+ tmp = TREE_OPERAND (tmp, TREE_CODE (tmp) == COMPONENT_REF ? 1 : 0);
+ if (poly || gfc_has_alloc_comps (type, tmp, true))
+ {
+ gimple_seq seq2 = NULL;
+ if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl)))
+ {
+ if (elem_len == NULL_TREE)
+ {
+ elem_len = gfc_conv_descriptor_elem_len (decl);
+ size = fold_convert (size_type_node,
+ gfc_omp_get_array_size (loc, decl, seq));
+ }
+ decl = gfc_conv_descriptor_data_get (decl);
+ decl = gfc_omp_elmental_loop (loc, decl, size, elem_len, seq, &seq2);
+ decl = build_fold_indirect_ref_loc (loc, decl);
+ }
+ else if (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE)
+ {
+ type = TREE_TYPE (tmp);
+ /* FIXME: PR95868 - for var%str of deferred length, elem_len == 0;
+ len is stored as var%_str_length, but not in GFC_DECL_STRING_LEN
+ nor in TYPE_SIZE_UNIT as expression. */
+ elem_len = TYPE_SIZE_UNIT (TREE_TYPE (type));
+ size = fold_convert (size_type_node, GFC_TYPE_ARRAY_SIZE (type));
+ decl = gfc_omp_elmental_loop (loc, decl, size, elem_len, seq, &seq2);
+ decl = build_fold_indirect_ref_loc (loc, decl);
+ }
+ else if (POINTER_TYPE_P (TREE_TYPE (decl)))
+ decl = build_fold_indirect_ref (decl);
+
+ gfc_omp_deep_mapping_comps (is_cnt, loc, decl, token, tkind,
+ data_array, sizes_array, kinds_array,
+ offset_data, offset, num, seq, ctx,
+ poly_warned);
+ gimple_seq_add_seq (seq, seq2);
+ }
+ if (end_label)
+ gimple_seq_add_stmt (seq, gimple_build_label (end_label));
+}
+
+
+/* Which map types to check/handle for deep mapping. */
+static bool
+gfc_omp_deep_map_kind_p (tree clause)
+{
+ switch (OMP_CLAUSE_CODE (clause))
+ {
+ case OMP_CLAUSE_MAP:
+ break;
+ case OMP_CLAUSE_FIRSTPRIVATE:
+ case OMP_CLAUSE_TO:
+ case OMP_CLAUSE_FROM:
+ return true;
+ default:
+ gcc_unreachable ();
+ }
+
+ switch (OMP_CLAUSE_MAP_KIND (clause))
+ {
+ case GOMP_MAP_TO:
+ case GOMP_MAP_FROM:
+ case GOMP_MAP_TOFROM:
+ case GOMP_MAP_ALWAYS_TO:
+ case GOMP_MAP_ALWAYS_FROM:
+ case GOMP_MAP_ALWAYS_TOFROM:
+ case GOMP_MAP_ALWAYS_PRESENT_FROM:
+ case GOMP_MAP_ALWAYS_PRESENT_TO:
+ case GOMP_MAP_ALWAYS_PRESENT_TOFROM:
+ case GOMP_MAP_FIRSTPRIVATE:
+ case GOMP_MAP_ALLOC:
+ return true;
+ case GOMP_MAP_POINTER:
+ case GOMP_MAP_TO_PSET:
+ case GOMP_MAP_FORCE_PRESENT:
+ case GOMP_MAP_DELETE:
+ case GOMP_MAP_FORCE_DEVICEPTR:
+ case GOMP_MAP_DEVICE_RESIDENT:
+ case GOMP_MAP_LINK:
+ case GOMP_MAP_IF_PRESENT:
+ case GOMP_MAP_PRESENT_ALLOC:
+ case GOMP_MAP_PRESENT_FROM:
+ case GOMP_MAP_PRESENT_TO:
+ case GOMP_MAP_PRESENT_TOFROM:
+ case GOMP_MAP_FIRSTPRIVATE_INT:
+ case GOMP_MAP_USE_DEVICE_PTR:
+ case GOMP_MAP_ZERO_LEN_ARRAY_SECTION:
+ case GOMP_MAP_FORCE_ALLOC:
+ case GOMP_MAP_FORCE_TO:
+ case GOMP_MAP_FORCE_FROM:
+ case GOMP_MAP_FORCE_TOFROM:
+ case GOMP_MAP_USE_DEVICE_PTR_IF_PRESENT:
+ case GOMP_MAP_STRUCT:
+ case GOMP_MAP_STRUCT_UNORD:
+ case GOMP_MAP_ALWAYS_POINTER:
+ case GOMP_MAP_POINTER_TO_ZERO_LENGTH_ARRAY_SECTION:
+ case GOMP_MAP_DELETE_ZERO_LEN_ARRAY_SECTION:
+ case GOMP_MAP_RELEASE:
+ case GOMP_MAP_ATTACH:
+ case GOMP_MAP_DETACH:
+ case GOMP_MAP_FORCE_DETACH:
+ case GOMP_MAP_ATTACH_ZERO_LENGTH_ARRAY_SECTION:
+ case GOMP_MAP_FIRSTPRIVATE_POINTER:
+ case GOMP_MAP_FIRSTPRIVATE_REFERENCE:
+ case GOMP_MAP_ATTACH_DETACH:
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ return false;
+}
+
+/* Three OpenMP deep-mapping lang hooks: gfc_omp_deep_mapping{_p,_cnt,}. */
+
+/* Common check for gfc_omp_deep_mapping_p and gfc_omp_deep_mapping_do. */
+
+static tree
+gfc_omp_deep_mapping_int_p (const gimple *ctx, tree clause)
+{
+ if (is_gimple_omp_oacc (ctx) || !gfc_omp_deep_map_kind_p (clause))
+ return NULL_TREE;
+ tree decl = OMP_CLAUSE_DECL (clause);
+ if (OMP_CLAUSE_SIZE (clause) != NULL_TREE
+ && DECL_P (OMP_CLAUSE_SIZE (clause))
+ && DECL_LANG_SPECIFIC (OMP_CLAUSE_SIZE (clause))
+ && GFC_DECL_SAVED_DESCRIPTOR (OMP_CLAUSE_SIZE (clause)))
+ /* Saved decl. */
+ decl = GFC_DECL_SAVED_DESCRIPTOR (OMP_CLAUSE_SIZE (clause));
+ else if (TREE_CODE (decl) == MEM_REF || TREE_CODE (decl) == INDIRECT_REF)
+ /* The following can happen for, e.g., class(t) :: var(..) */
+ decl = TREE_OPERAND (decl, 0);
+ if (TREE_CODE (decl) == INDIRECT_REF)
+ /* The following can happen for, e.g., class(t) :: var(..) */
+ decl = TREE_OPERAND (decl, 0);
+ if (DECL_P (decl)
+ && DECL_LANG_SPECIFIC (decl)
+ && GFC_DECL_SAVED_DESCRIPTOR (decl))
+ decl = GFC_DECL_SAVED_DESCRIPTOR (decl);
+ /* Handle map(to: var.desc) map([to/from/tofrom:] var.desc.data)
+ to get proper map kind by skipping to the next item. */
+ tree tmp = OMP_CLAUSE_CHAIN (clause);
+ if (tmp != NULL_TREE
+ && OMP_CLAUSE_CODE (tmp) == OMP_CLAUSE_CODE (clause)
+ && OMP_CLAUSE_SIZE (tmp) != NULL_TREE
+ && DECL_P (OMP_CLAUSE_SIZE (tmp))
+ && DECL_LANG_SPECIFIC (OMP_CLAUSE_SIZE (tmp))
+ && GFC_DECL_SAVED_DESCRIPTOR (OMP_CLAUSE_SIZE (tmp)) == decl)
+ return NULL_TREE;
+ if (DECL_P (decl)
+ && DECL_LANG_SPECIFIC (decl)
+ && GFC_DECL_SAVED_DESCRIPTOR (decl))
+ decl = GFC_DECL_SAVED_DESCRIPTOR (decl);
+ tree type = TREE_TYPE (decl);
+ if (POINTER_TYPE_P (type))
+ type = TREE_TYPE (type);
+ if (POINTER_TYPE_P (type))
+ type = TREE_TYPE (type);
+ tmp = decl;
+ while (TREE_CODE (tmp) == COMPONENT_REF || TREE_CODE (tmp) == ARRAY_REF)
+ tmp = TREE_OPERAND (tmp, TREE_CODE (tmp) == COMPONENT_REF ? 1 : 0);
+ if (!gfc_is_polymorphic_nonptr (type)
+ && !gfc_has_alloc_comps (type, tmp, true))
+ return NULL_TREE;
+ return decl;
+}
+
+/* Return true if there is deep mapping, even if the number of mapping is known
+ at compile time. */
+bool
+gfc_omp_deep_mapping_p (const gimple *ctx, tree clause)
+{
+ tree decl = gfc_omp_deep_mapping_int_p (ctx, clause);
+ if (decl == NULL_TREE)
+ return false;
+ return true;
+}
+
+/* Handle gfc_omp_deep_mapping{,_cnt} */
+static tree
+gfc_omp_deep_mapping_do (bool is_cnt, const gimple *ctx, tree clause,
+ unsigned HOST_WIDE_INT tkind, tree data, tree sizes,
+ tree kinds, tree offset_data, tree offset,
+ gimple_seq *seq)
+{
+ tree num = NULL_TREE;
+ location_t loc = OMP_CLAUSE_LOCATION (clause);
+ tree decl = gfc_omp_deep_mapping_int_p (ctx, clause);
+ bool poly_warned = false;
+ if (decl == NULL_TREE)
+ return NULL_TREE;
+ /* Handle: map(alloc:dt%cmp [len: ptr_size]) map(tofrom: D.0123...),
+ where GFC_DECL_SAVED_DESCRIPTOR(D.0123) is the same (here: dt%cmp). */
+ if (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_MAP
+ && (OMP_CLAUSE_MAP_KIND (clause) == GOMP_MAP_ALLOC
+ || OMP_CLAUSE_MAP_KIND (clause) == GOMP_MAP_PRESENT_ALLOC))
+ {
+ tree c = clause;
+ while ((c = OMP_CLAUSE_CHAIN (c)) != NULL_TREE)
+ {
+ if (!gfc_omp_deep_map_kind_p (c))
+ continue;
+ tree d = gfc_omp_deep_mapping_int_p (ctx, c);
+ if (d != NULL_TREE && operand_equal_p (decl, d, 0))
+ return NULL_TREE;
+ }
+ }
+ tree type = TREE_TYPE (decl);
+ if (POINTER_TYPE_P (type))
+ type = TREE_TYPE (type);
+ if (POINTER_TYPE_P (type))
+ type = TREE_TYPE (type);
+ bool poly = gfc_is_polymorphic_nonptr (type);
+
+ if (is_cnt)
+ {
+ num = build_decl (loc, VAR_DECL,
+ create_tmp_var_name ("n_deepmap"), size_type_node);
+ tree tmp = fold_build2_loc (loc, MODIFY_EXPR, size_type_node, num,
+ build_int_cst (size_type_node, 0));
+ gimple_add_tmp_var (num);
+ gimplify_and_add (tmp, seq);
+ }
+ else
+ gcc_assert (short_unsigned_type_node == TREE_TYPE (TREE_TYPE (kinds)));
+
+ bool do_copy = poly;
+ bool do_alloc_check = false;
+ tree token = NULL_TREE;
+ tree tmp = decl;
+ if (poly)
+ {
+ tmp = TYPE_FIELDS (type);
+ type = TREE_TYPE (tmp);
+ }
+ else
+ while (TREE_CODE (tmp) == COMPONENT_REF || TREE_CODE (tmp) == ARRAY_REF)
+ tmp = TREE_OPERAND (tmp, TREE_CODE (tmp) == COMPONENT_REF ? 1 : 0);
+ /* If the clause argument is nonallocatable, skip is-allocate check. */
+ if (GFC_DECL_GET_SCALAR_ALLOCATABLE (tmp)
+ || GFC_DECL_GET_SCALAR_POINTER (tmp)
+ || (GFC_DESCRIPTOR_TYPE_P (type)
+ && (GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE
+ || GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_POINTER
+ || GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_POINTER_CONT)))
+ do_alloc_check = true;
+
+ if (!is_cnt
+ && OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_MAP
+ && (tkind == GOMP_MAP_ALLOC
+ || (tkind == GOMP_MAP_FROM
+ && (gimple_omp_target_kind (ctx)
+ != GF_OMP_TARGET_KIND_EXIT_DATA)))
+ && (poly || gfc_omp_replace_alloc_by_to_mapping (type, tmp, true)))
+ OMP_CLAUSE_SET_MAP_KIND (clause, tkind == GOMP_MAP_ALLOC ? GOMP_MAP_TO
+ : GOMP_MAP_TOFROM);
+
+ /* TODO: For map(a(:)), we know it is present & allocated. */
+
+ tree present = (DECL_P (decl) ? gfc_omp_check_optional_argument (decl, true)
+ : NULL_TREE);
+ if (POINTER_TYPE_P (TREE_TYPE (decl))
+ && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (decl))))
+ decl = build_fold_indirect_ref (decl);
+ if (present)
+ {
+ tree then_label = create_artificial_label (loc);
+ tree end_label = create_artificial_label (loc);
+ gimple_seq seq2 = NULL;
+ tmp = force_gimple_operand (present, &seq2, true, NULL_TREE);
+ gimple_seq_add_seq (seq, seq2);
+ gimple_seq_add_stmt (seq,
+ gimple_build_cond_from_tree (present,
+ then_label, end_label));
+ gimple_seq_add_stmt (seq, gimple_build_label (then_label));
+ gfc_omp_deep_mapping_item (is_cnt, do_copy, do_alloc_check, loc, decl,
+ &token, tkind, data, sizes, kinds,
+ offset_data, offset, num, seq, ctx,
+ &poly_warned);
+ gimple_seq_add_stmt (seq, gimple_build_label (end_label));
+ }
+ else
+ gfc_omp_deep_mapping_item (is_cnt, do_copy, do_alloc_check, loc, decl,
+ &token, tkind, data, sizes, kinds, offset_data,
+ offset, num, seq, ctx, &poly_warned);
+ /* Multiply by 2 as there are two mappings: data + pointer assign. */
+ if (is_cnt)
+ gimplify_assign (num,
+ fold_build2_loc (loc, MULT_EXPR,
+ size_type_node, num,
+ build_int_cst (size_type_node, 2)), seq);
+ return num;
+}
+
+/* Return tree with a variable which contains the count of deep-mappyings
+ (value depends, e.g., on allocation status) */
+tree
+gfc_omp_deep_mapping_cnt (const gimple *ctx, tree clause, gimple_seq *seq)
+{
+ return gfc_omp_deep_mapping_do (true, ctx, clause, 0, NULL_TREE, NULL_TREE,
+ NULL_TREE, NULL_TREE, NULL_TREE, seq);
+}
+
+/* Does the actual deep mapping. */
+void
+gfc_omp_deep_mapping (const gimple *ctx, tree clause,
+ unsigned HOST_WIDE_INT tkind, tree data,
+ tree sizes, tree kinds, tree offset_data, tree offset,
+ gimple_seq *seq)
+{
+ (void) gfc_omp_deep_mapping_do (false, ctx, clause, tkind, data, sizes, kinds,
+ offset_data, offset, seq);
+}
+
/* Return true if DECL is a scalar variable (for the purpose of
implicit firstprivatization/mapping). Only if 'ptr_alloc_ok.'
is true, allocatables and pointers are permitted. */
@@ -2478,6 +3265,18 @@ gfc_trans_omp_array_section (stmtblock_t *block, gfc_exec_op op,
elemsz = fold_convert (gfc_array_index_type, elemsz);
OMP_CLAUSE_SIZE (node) = fold_build2 (MULT_EXPR, gfc_array_index_type,
OMP_CLAUSE_SIZE (node), elemsz);
+ if (n->expr->ts.type == BT_DERIVED
+ && n->expr->ts.u.derived->attr.alloc_comp)
+ {
+ /* Save array descriptor for use in gfc_omp_deep_mapping{,_p,_cnt};
+ force evaluate to ensure that it is not gimplified + is a decl. */
+ tree tmp = OMP_CLAUSE_SIZE (node);
+ tree var = gfc_create_var (TREE_TYPE (tmp), NULL);
+ gfc_add_modify_loc (input_location, block, var, tmp);
+ OMP_CLAUSE_SIZE (node) = var;
+ gfc_allocate_lang_decl (var);
+ GFC_DECL_SAVED_DESCRIPTOR (var) = se.expr;
+ }
}
gcc_assert (se.post.head == NULL_TREE);
gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
@@ -3213,8 +4012,9 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
if (!n->sym->attr.referenced)
continue;
+ location_t map_loc = gfc_get_location (&n->where);
bool always_modifier = false;
- tree node = build_omp_clause (input_location, OMP_CLAUSE_MAP);
+ tree node = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
tree node2 = NULL_TREE;
tree node3 = NULL_TREE;
tree node4 = NULL_TREE;
@@ -3361,7 +4161,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
&& n->u.map.op != OMP_MAP_RELEASE)
{
gcc_assert (n->sym->ts.u.cl->backend_decl);
- node5 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
+ node5 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (node5, GOMP_MAP_ALWAYS_TO);
OMP_CLAUSE_DECL (node5) = n->sym->ts.u.cl->backend_decl;
OMP_CLAUSE_SIZE (node5)
@@ -3378,7 +4178,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
ptr = build_fold_indirect_ref (ptr);
OMP_CLAUSE_DECL (node) = ptr;
OMP_CLAUSE_SIZE (node) = gfc_class_vtab_size_get (decl);
- node2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
+ node2 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (node2, GOMP_MAP_ATTACH_DETACH);
OMP_CLAUSE_DECL (node2) = gfc_class_data_get (decl);
OMP_CLAUSE_SIZE (node2) = size_int (0);
@@ -3434,8 +4234,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
size = TYPE_SIZE_UNIT (TREE_TYPE (decl));
else
size = size_int (0);
- node4 = build_omp_clause (input_location,
- OMP_CLAUSE_MAP);
+ node4 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (node4, gmk);
OMP_CLAUSE_DECL (node4) = decl;
OMP_CLAUSE_SIZE (node4) = size;
@@ -3459,8 +4258,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
size = TYPE_SIZE_UNIT (TREE_TYPE (decl));
else
size = size_int (0);
- node3 = build_omp_clause (input_location,
- OMP_CLAUSE_MAP);
+ node3 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (node3, gmk);
OMP_CLAUSE_DECL (node3) = decl;
OMP_CLAUSE_SIZE (node3) = size;
@@ -3477,7 +4275,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
ptr = build_fold_indirect_ref (ptr);
OMP_CLAUSE_DECL (node) = ptr;
- node2 = build_omp_clause (input_location, OMP_CLAUSE_MAP);
+ node2 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_DECL (node2) = decl;
OMP_CLAUSE_SIZE (node2) = TYPE_SIZE_UNIT (type);
if (n->u.map.op == OMP_MAP_DELETE)
@@ -3493,8 +4291,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
&& n->u.map.op != OMP_MAP_DELETE
&& n->u.map.op != OMP_MAP_RELEASE)
{
- node3 = build_omp_clause (input_location,
- OMP_CLAUSE_MAP);
+ node3 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
if (present)
{
ptr = gfc_conv_descriptor_data_get (decl);
@@ -3634,10 +4431,10 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
{
/* A single indirectref is handled by the middle end. */
gcc_assert (!POINTER_TYPE_P (TREE_TYPE (decl)));
- decl = TREE_OPERAND (decl, 0);
- decl = gfc_build_cond_assign_expr (block, present, decl,
+ tree tmp = TREE_OPERAND (decl, 0);
+ tmp = gfc_build_cond_assign_expr (block, present, tmp,
null_pointer_node);
- OMP_CLAUSE_DECL (node) = build_fold_indirect_ref (decl);
+ OMP_CLAUSE_DECL (node) = build_fold_indirect_ref (tmp);
}
else
OMP_CLAUSE_DECL (node) = decl;
@@ -3672,6 +4469,33 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
size = gfc_evaluate_now (size, block);
OMP_CLAUSE_SIZE (node) = size;
}
+ if ((TREE_CODE (decl) != PARM_DECL
+ || DECL_ARTIFICIAL (OMP_CLAUSE_DECL (node)))
+ && n->sym->ts.type == BT_DERIVED
+ && n->sym->ts.u.derived->attr.alloc_comp)
+ {
+ /* Save array descriptor for use in
+ gfc_omp_deep_mapping{,_p,_cnt}; force evaluate
+ to ensure that it is not gimplified + is a decl. */
+ tree tmp = OMP_CLAUSE_SIZE (node);
+ if (tmp == NULL_TREE)
+ tmp = DECL_P (decl) ? DECL_SIZE_UNIT (decl)
+ : TYPE_SIZE_UNIT (TREE_TYPE (decl));
+ tree var = gfc_create_var (TREE_TYPE (tmp), NULL);
+ gfc_add_modify_loc (input_location, block, var, tmp);
+ OMP_CLAUSE_SIZE (node) = var;
+ gfc_allocate_lang_decl (var);
+ if (TREE_CODE (decl) == INDIRECT_REF)
+ decl = TREE_OPERAND (decl, 0);
+ if (TREE_CODE (decl) == INDIRECT_REF)
+ decl = TREE_OPERAND (decl, 0);
+ if (DECL_LANG_SPECIFIC (decl)
+ && GFC_DECL_SAVED_DESCRIPTOR (decl))
+ GFC_DECL_SAVED_DESCRIPTOR (var)
+ = GFC_DECL_SAVED_DESCRIPTOR (decl);
+ else
+ GFC_DECL_SAVED_DESCRIPTOR (var) = decl;
+ }
}
else if (n->expr
&& n->expr->expr_type == EXPR_VARIABLE
@@ -3727,8 +4551,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
goto finalize_map_clause;
}
- node2 = build_omp_clause (input_location,
- OMP_CLAUSE_MAP);
+ node2 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (node2, GOMP_MAP_ATTACH_DETACH);
OMP_CLAUSE_DECL (node2)
= POINTER_TYPE_P (TREE_TYPE (se.expr))
@@ -3754,13 +4577,37 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
kind = GOMP_MAP_RELEASE;
else
kind = GOMP_MAP_TO;
- node3 = build_omp_clause (input_location,
- OMP_CLAUSE_MAP);
+ node3 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (node3, kind);
OMP_CLAUSE_DECL (node3) = se.string_length;
OMP_CLAUSE_SIZE (node3)
= TYPE_SIZE_UNIT (gfc_charlen_type_node);
}
+ if (!openacc
+ && n->expr->ts.type == BT_DERIVED
+ && n->expr->ts.u.derived->attr.alloc_comp)
+ {
+ /* Save array descriptor for use in
+ gfc_omp_deep_mapping{,_p,_cnt}; force evaluate
+ to ensure that it is not gimplified + is a decl. */
+ tree tmp = OMP_CLAUSE_SIZE (node);
+ if (tmp == NULL_TREE)
+ tmp = (DECL_P (se.expr)
+ ? DECL_SIZE_UNIT (se.expr)
+ : TYPE_SIZE_UNIT (TREE_TYPE (se.expr)));
+ tree var = gfc_create_var (TREE_TYPE (tmp), NULL);
+ gfc_add_modify_loc (input_location, block, var, tmp);
+ OMP_CLAUSE_SIZE (node) = var;
+ gfc_allocate_lang_decl (var);
+ if (TREE_CODE (se.expr) == INDIRECT_REF)
+ se.expr = TREE_OPERAND (se.expr, 0);
+ if (DECL_LANG_SPECIFIC (se.expr)
+ && GFC_DECL_SAVED_DESCRIPTOR (se.expr))
+ GFC_DECL_SAVED_DESCRIPTOR (var)
+ = GFC_DECL_SAVED_DESCRIPTOR (se.expr);
+ else
+ GFC_DECL_SAVED_DESCRIPTOR (var) = se.expr;
+ }
}
}
else if (n->expr
@@ -3800,7 +4647,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
&& (lastref->u.c.component->ts.type == BT_DERIVED
|| lastref->u.c.component->ts.type == BT_CLASS))
{
- if (pointer || (openacc && allocatable))
+ if (pointer || allocatable)
{
/* If it's a bare attach/detach clause, we just want
to perform a single attach/detach operation, of the
@@ -3880,8 +4727,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
OMP_CLAUSE_DECL (node) = data;
OMP_CLAUSE_SIZE (node) = size;
- node2 = build_omp_clause (input_location,
- OMP_CLAUSE_MAP);
+ node2 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (node2,
GOMP_MAP_ATTACH_DETACH);
OMP_CLAUSE_DECL (node2) = build_fold_addr_expr (data);
@@ -3893,6 +4739,22 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
OMP_CLAUSE_SIZE (node)
= TYPE_SIZE_UNIT (TREE_TYPE (inner));
}
+ if (!openacc
+ && n->expr->ts.type == BT_DERIVED
+ && n->expr->ts.u.derived->attr.alloc_comp)
+ {
+ /* Save array descriptor for use in
+ gfc_omp_deep_mapping{,_p,_cnt}; force evaluate
+ to ensure that it is not gimplified + is a decl. */
+ tree tmp = OMP_CLAUSE_SIZE (node);
+ tree var = gfc_create_var (TREE_TYPE (tmp), NULL);
+ gfc_add_modify_loc (input_location, block, var, tmp);
+ OMP_CLAUSE_SIZE (node) = var;
+ gfc_allocate_lang_decl (var);
+ if (TREE_CODE (inner) == INDIRECT_REF)
+ inner = TREE_OPERAND (inner, 0);
+ GFC_DECL_SAVED_DESCRIPTOR (var) = inner;
+ }
}
else if (lastref->type == REF_ARRAY
&& lastref->u.ar.type == AR_FULL)
@@ -3952,8 +4814,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
elemsz = TYPE_SIZE_UNIT (elemsz);
elemsz = fold_build2 (MULT_EXPR, size_type_node,
len, elemsz);
- node4 = build_omp_clause (input_location,
- OMP_CLAUSE_MAP);
+ node4 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (node4, map_kind);
OMP_CLAUSE_DECL (node4) = se.string_length;
OMP_CLAUSE_SIZE (node4)
@@ -3963,8 +4824,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
OMP_CLAUSE_SIZE (node)
= fold_build2 (MULT_EXPR, gfc_array_index_type,
OMP_CLAUSE_SIZE (node), elemsz);
- node2 = build_omp_clause (input_location,
- OMP_CLAUSE_MAP);
+ node2 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
if (map_kind == GOMP_MAP_RELEASE
|| map_kind == GOMP_MAP_DELETE)
{
@@ -3978,6 +4838,23 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
OMP_CLAUSE_SIZE (node2) = TYPE_SIZE_UNIT (type);
if (!openacc)
{
+ if (n->expr->ts.type == BT_DERIVED
+ && n->expr->ts.u.derived->attr.alloc_comp)
+ {
+ /* Save array descriptor for use
+ in gfc_omp_deep_mapping{,_p,_cnt}; force
+ evaluate to ensure that it is
+ not gimplified + is a decl. */
+ tree tmp = OMP_CLAUSE_SIZE (node);
+ tree var = gfc_create_var (TREE_TYPE (tmp),
+ NULL);
+ gfc_add_modify_loc (map_loc, block,
+ var, tmp);
+ OMP_CLAUSE_SIZE (node) = var;
+ gfc_allocate_lang_decl (var);
+ GFC_DECL_SAVED_DESCRIPTOR (var) = inner;
+ }
+
gfc_omp_namelist *n2
= clauses->lists[OMP_LIST_MAP];
@@ -4035,8 +4912,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
if (drop_mapping)
continue;
}
- node3 = build_omp_clause (input_location,
- OMP_CLAUSE_MAP);
+ node3 = build_omp_clause (map_loc, OMP_CLAUSE_MAP);
OMP_CLAUSE_SET_MAP_KIND (node3,
GOMP_MAP_ATTACH_DETACH);
OMP_CLAUSE_DECL (node3)
@@ -4107,7 +4983,8 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
default:
gcc_unreachable ();
}
- tree node = build_omp_clause (input_location, clause_code);
+ tree node = build_omp_clause (gfc_get_location (&n->where),
+ clause_code);
if (n->expr == NULL
|| (n->expr->ref->type == REF_ARRAY
&& n->expr->ref->u.ar.type == AR_FULL
diff --git a/gcc/fortran/trans-stmt.cc b/gcc/fortran/trans-stmt.cc
index 94ecde0..37f8aca 100644
--- a/gcc/fortran/trans-stmt.cc
+++ b/gcc/fortran/trans-stmt.cc
@@ -5154,7 +5154,7 @@ gfc_trans_concurrent_locality_spec (bool after_body, stmtblock_t *body,
gfc_start_saved_local_decls ();
cnt = 0;
- static_assert (LOCALITY_LOCAL_INIT - LOCALITY_LOCAL == 1);
+ static_assert (LOCALITY_LOCAL_INIT - LOCALITY_LOCAL == 1, "locality_type");
for (int type = LOCALITY_LOCAL;
type <= LOCALITY_LOCAL_INIT; type++)
for (el = locality_list[type]; el; el = el->next)
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 63a566a..ae7be9f 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -839,6 +839,10 @@ tree gfc_omp_clause_assign_op (tree, tree, tree);
tree gfc_omp_clause_linear_ctor (tree, tree, tree, tree);
tree gfc_omp_clause_dtor (tree, tree);
void gfc_omp_finish_clause (tree, gimple_seq *, bool);
+bool gfc_omp_deep_mapping_p (const gimple *, tree);
+tree gfc_omp_deep_mapping_cnt (const gimple *, tree, gimple_seq *);
+void gfc_omp_deep_mapping (const gimple *, tree, unsigned HOST_WIDE_INT, tree,
+ tree, tree, tree, tree, gimple_seq *);
bool gfc_omp_allocatable_p (tree);
bool gfc_omp_scalar_p (tree, bool);
bool gfc_omp_scalar_target_p (tree);
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index aac33e9..4fd87f2 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -30,6 +30,9 @@ compilation is specified by a string called a "spec". */
#define INCLUDE_STRING
#include "config.h"
#include "system.h"
+#ifdef HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE
+#include <sys/personality.h>
+#endif
#include "coretypes.h"
#include "multilib.h" /* before tm.h */
#include "tm.h"
@@ -7744,55 +7747,58 @@ print_configuration (FILE *file)
#define RETRY_ICE_ATTEMPTS 3
-/* Returns true if FILE1 and FILE2 contain equivalent data, 0 otherwise. */
+/* Returns true if FILE1 and FILE2 contain equivalent data, 0 otherwise.
+ If lines start with 0x followed by 1-16 lowercase hexadecimal digits
+ followed by a space, ignore anything before that space. These are
+ typically function addresses from libbacktrace and those can differ
+ due to ASLR. */
static bool
files_equal_p (char *file1, char *file2)
{
- struct stat st1, st2;
- off_t n, len;
- int fd1, fd2;
- const int bufsize = 8192;
- char *buf = XNEWVEC (char, bufsize);
-
- fd1 = open (file1, O_RDONLY);
- fd2 = open (file2, O_RDONLY);
-
- if (fd1 < 0 || fd2 < 0)
- goto error;
-
- if (fstat (fd1, &st1) < 0 || fstat (fd2, &st2) < 0)
- goto error;
+ FILE *f1 = fopen (file1, "rb");
+ FILE *f2 = fopen (file2, "rb");
+ char line1[256], line2[256];
- if (st1.st_size != st2.st_size)
- goto error;
-
- for (n = st1.st_size; n; n -= len)
+ bool line_start = true;
+ while (fgets (line1, sizeof (line1), f1))
{
- len = n;
- if ((int) len > bufsize / 2)
- len = bufsize / 2;
-
- if (read (fd1, buf, len) != (int) len
- || read (fd2, buf + bufsize / 2, len) != (int) len)
+ if (!fgets (line2, sizeof (line2), f2))
+ goto error;
+ char *p1 = line1, *p2 = line2;
+ if (line_start
+ && line1[0] == '0'
+ && line1[1] == 'x'
+ && line2[0] == '0'
+ && line2[1] == 'x')
{
- goto error;
+ int i, j;
+ for (i = 0; i < 16; ++i)
+ if (!ISXDIGIT (line1[2 + i]) || ISUPPER (line1[2 + i]))
+ break;
+ for (j = 0; j < 16; ++j)
+ if (!ISXDIGIT (line2[2 + j]) || ISUPPER (line2[2 + j]))
+ break;
+ if (i && line1[2 + i] == ' ' && j && line2[2 + j] == ' ')
+ {
+ p1 = line1 + i + 3;
+ p2 = line2 + j + 3;
+ }
}
-
- if (memcmp (buf, buf + bufsize / 2, len) != 0)
+ if (strcmp (p1, p2) != 0)
goto error;
+ line_start = strchr (line1, '\n') != NULL;
}
+ if (fgets (line2, sizeof (line2), f2))
+ goto error;
- free (buf);
- close (fd1);
- close (fd2);
-
+ fclose (f1);
+ fclose (f2);
return 1;
error:
- free (buf);
- close (fd1);
- close (fd2);
+ fclose (f1);
+ fclose (f2);
return 0;
}
@@ -8000,6 +8006,10 @@ try_generate_repro (const char **argv)
else
new_argv[out_arg] = "-o-";
+#ifdef HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE
+ personality (personality (0xffffffffU) | ADDR_NO_RANDOMIZE);
+#endif
+
int status;
for (attempt = 0; attempt < RETRY_ICE_ATTEMPTS; ++attempt)
{
diff --git a/gcc/gimple-expr.cc b/gcc/gimple-expr.cc
index a670e46..c0367f4 100644
--- a/gcc/gimple-expr.cc
+++ b/gcc/gimple-expr.cc
@@ -884,7 +884,7 @@ bool
is_gimple_mem_ref_addr (tree t)
{
return (is_gimple_reg (t)
- || TREE_CODE (t) == INTEGER_CST
+ || poly_int_tree_p (t)
|| (TREE_CODE (t) == ADDR_EXPR
&& (CONSTANT_CLASS_P (TREE_OPERAND (t, 0))
|| decl_address_invariant_p (TREE_OPERAND (t, 0)))));
diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc
index b645613..94d5a1e 100644
--- a/gcc/gimple-fold.cc
+++ b/gcc/gimple-fold.cc
@@ -906,20 +906,60 @@ size_must_be_zero_p (tree size)
static bool
optimize_memcpy_to_memset (gimple_stmt_iterator *gsip, tree dest, tree src, tree len)
{
+ ao_ref read;
gimple *stmt = gsi_stmt (*gsip);
if (gimple_has_volatile_ops (stmt))
return false;
- tree vuse = gimple_vuse (stmt);
- if (vuse == NULL || TREE_CODE (vuse) != SSA_NAME)
- return false;
- gimple *defstmt = SSA_NAME_DEF_STMT (vuse);
tree src2 = NULL_TREE, len2 = NULL_TREE;
poly_int64 offset, offset2;
tree val = integer_zero_node;
+ bool len_was_null = len == NULL_TREE;
+ if (len == NULL_TREE)
+ len = (TREE_CODE (src) == COMPONENT_REF
+ ? DECL_SIZE_UNIT (TREE_OPERAND (src, 1))
+ : TYPE_SIZE_UNIT (TREE_TYPE (src)));
+ if (len == NULL_TREE
+ || !poly_int_tree_p (len))
+ return false;
+
+ ao_ref_init (&read, src);
+ tree vuse = gimple_vuse (stmt);
+ gimple *defstmt;
+ do {
+ if (vuse == NULL || TREE_CODE (vuse) != SSA_NAME)
+ return false;
+ defstmt = SSA_NAME_DEF_STMT (vuse);
+ if (is_a <gphi*>(defstmt))
+ return false;
+
+ /* If the len was null, then we can use TBBA. */
+ if (stmt_may_clobber_ref_p_1 (defstmt, &read,
+ /* tbaa_p = */ len_was_null))
+ break;
+ vuse = gimple_vuse (defstmt);
+ } while (true);
+
if (gimple_store_p (defstmt)
&& gimple_assign_single_p (defstmt)
+ && TREE_CODE (gimple_assign_rhs1 (defstmt)) == STRING_CST
+ && !gimple_clobber_p (defstmt))
+ {
+ tree str = gimple_assign_rhs1 (defstmt);
+ src2 = gimple_assign_lhs (defstmt);
+ /* The string must contain all null char's for now. */
+ for (int i = 0; i < TREE_STRING_LENGTH (str); i++)
+ {
+ if (TREE_STRING_POINTER (str)[i] != 0)
+ {
+ src2 = NULL_TREE;
+ break;
+ }
+ }
+ }
+ else if (gimple_store_p (defstmt)
+ && gimple_assign_single_p (defstmt)
&& TREE_CODE (gimple_assign_rhs1 (defstmt)) == CONSTRUCTOR
&& !gimple_clobber_p (defstmt))
src2 = gimple_assign_lhs (defstmt);
@@ -939,17 +979,11 @@ optimize_memcpy_to_memset (gimple_stmt_iterator *gsip, tree dest, tree src, tree
if (src2 == NULL_TREE)
return false;
- if (len == NULL_TREE)
- len = (TREE_CODE (src) == COMPONENT_REF
- ? DECL_SIZE_UNIT (TREE_OPERAND (src, 1))
- : TYPE_SIZE_UNIT (TREE_TYPE (src)));
if (len2 == NULL_TREE)
len2 = (TREE_CODE (src2) == COMPONENT_REF
? DECL_SIZE_UNIT (TREE_OPERAND (src2, 1))
: TYPE_SIZE_UNIT (TREE_TYPE (src2)));
- if (len == NULL_TREE
- || !poly_int_tree_p (len)
- || len2 == NULL_TREE
+ if (len2 == NULL_TREE
|| !poly_int_tree_p (len2))
return false;
diff --git a/gcc/gimple-lower-bitint.cc b/gcc/gimple-lower-bitint.cc
index cf30d8e..6fefc83 100644
--- a/gcc/gimple-lower-bitint.cc
+++ b/gcc/gimple-lower-bitint.cc
@@ -1547,14 +1547,15 @@ bitint_large_huge::handle_cast (tree lhs_type, tree rhs1, tree idx)
}
else
{
- if (tree_to_uhwi (idx) < low)
+ unsigned tidx = tree_to_uhwi (idx);
+ if (tidx < low)
{
t = handle_operand (rhs1, idx);
if (m_first)
m_data[save_data_cnt + 2]
= build_int_cst (NULL_TREE, m_data_cnt);
}
- else if (tree_to_uhwi (idx) < high)
+ else if (tidx < high)
{
t = handle_operand (rhs1, size_int (low));
if (m_first)
@@ -1587,7 +1588,9 @@ bitint_large_huge::handle_cast (tree lhs_type, tree rhs1, tree idx)
m_data_cnt = tree_to_uhwi (m_data[save_data_cnt + 2]);
if (TYPE_UNSIGNED (rhs_type))
t = build_zero_cst (m_limb_type);
- else if (m_bb && m_data[save_data_cnt])
+ else if (m_bb
+ && m_data[save_data_cnt]
+ && ((tidx & 1) == 0 || tidx != low + 1))
t = m_data[save_data_cnt];
else
t = m_data[save_data_cnt + 1];
@@ -5916,7 +5919,8 @@ build_bitint_stmt_ssa_conflicts (gimple *stmt, live_track *live,
ssa_conflicts *graph, bitmap names,
void (*def) (live_track *, tree,
ssa_conflicts *),
- void (*use) (live_track *, tree))
+ void (*use) (live_track *, tree),
+ void (*clear) (live_track *, tree))
{
bool muldiv_p = false;
tree lhs = NULL_TREE;
@@ -5933,6 +5937,25 @@ build_bitint_stmt_ssa_conflicts (gimple *stmt, live_track *live,
{
if (!bitmap_bit_p (names, SSA_NAME_VERSION (lhs)))
return;
+
+ /* A copy between 2 partitions does not introduce an interference
+ by itself. If they did, you would never be able to coalesce
+ two things which are copied. If the two variables really do
+ conflict, they will conflict elsewhere in the program.
+
+ This is handled by simply removing the SRC of the copy from
+ the live list, and processing the stmt normally.
+
+ Don't do this if lhs is not in names though, in such cases
+ it is actually used at some point later in the basic
+ block. */
+ if (gimple_assign_copy_p (stmt))
+ {
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ if (TREE_CODE (rhs1) == SSA_NAME)
+ clear (live, rhs1);
+ }
+
switch (gimple_assign_rhs_code (stmt))
{
case MULT_EXPR:
@@ -6624,10 +6647,28 @@ gimple_lower_bitint (void)
bitmap_set_bit (large_huge.m_names, SSA_NAME_VERSION (s));
if (has_single_use (s))
{
- if (!large_huge.m_single_use_names)
- large_huge.m_single_use_names = BITMAP_ALLOC (NULL);
- bitmap_set_bit (large_huge.m_single_use_names,
- SSA_NAME_VERSION (s));
+ tree s2 = s;
+ /* The coalescing hook special cases SSA_NAME copies.
+ Make sure not to mark in m_single_use_names single
+ use SSA_NAMEs copied from non-single use SSA_NAMEs. */
+ while (gimple_assign_copy_p (SSA_NAME_DEF_STMT (s2)))
+ {
+ s2 = gimple_assign_rhs1 (SSA_NAME_DEF_STMT (s2));
+ if (TREE_CODE (s2) != SSA_NAME)
+ break;
+ if (!has_single_use (s2))
+ {
+ s2 = NULL_TREE;
+ break;
+ }
+ }
+ if (s2)
+ {
+ if (!large_huge.m_single_use_names)
+ large_huge.m_single_use_names = BITMAP_ALLOC (NULL);
+ bitmap_set_bit (large_huge.m_single_use_names,
+ SSA_NAME_VERSION (s));
+ }
}
if (SSA_NAME_VAR (s)
&& ((TREE_CODE (SSA_NAME_VAR (s)) == PARM_DECL
diff --git a/gcc/gimple-lower-bitint.h b/gcc/gimple-lower-bitint.h
index 8662c4b..4798484 100644
--- a/gcc/gimple-lower-bitint.h
+++ b/gcc/gimple-lower-bitint.h
@@ -26,6 +26,7 @@ extern void build_bitint_stmt_ssa_conflicts (gimple *, live_track *,
ssa_conflicts *, bitmap,
void (*) (live_track *, tree,
ssa_conflicts *),
+ void (*) (live_track *, tree),
void (*) (live_track *, tree));
#endif /* GCC_GIMPLE_LOWER_BITINT_H */
diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
index 0d53103..bacf24d 100644
--- a/gcc/ginclude/stddef.h
+++ b/gcc/ginclude/stddef.h
@@ -89,6 +89,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#undef _PTRDIFF_T_
#endif
+/* When modular code is enabled with macOS SDKs from version 15, the
+ include guards are set in the includers of this code, rather than as
+ part of it. This means the we must unset them or the intended code
+ here will be bypassed (resulting in undefined values). */
+#if defined (__APPLE__)
+# if defined(__has_feature) && __has_feature(modules)
+# if defined (__need_ptrdiff_t)
+# undef __PTRDIFF_T
+# endif
+# if defined (__need_size_t)
+# undef __SIZE_T
+# endif
+# endif
+#endif
+
/* On VxWorks, <type/vxTypesBase.h> may have defined macros like
_TYPE_size_t which will typedef size_t. fixincludes patched the
vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index 2645689..806c2bd 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -307,14 +307,31 @@ ipcp_lattice<valtype>::print (FILE * f, bool dump_sources, bool dump_benefits)
fprintf (f, "\n");
}
-/* If VALUE has all bits set to one, print "-1" to F, otherwise simply print it
- hexadecimally to F. */
+/* Print VALUE to F in a form which in usual cases does not take thousands of
+ characters. */
static void
ipcp_print_widest_int (FILE *f, const widest_int &value)
{
- if (wi::eq_p (wi::bit_not (value), 0))
+ if (value == -1)
fprintf (f, "-1");
+ else if (wi::arshift (value, 128) == -1)
+ {
+ char buf[35], *p = buf + 2;
+ widest_int v = wi::zext (value, 128);
+ size_t len;
+ print_hex (v, buf);
+ len = strlen (p);
+ if (len == 32)
+ {
+ fprintf (f, "0xf..f");
+ while (*p == 'f')
+ ++p;
+ }
+ else
+ fprintf (f, "0xf..f%0*d", (int) (32 - len), 0);
+ fputs (p, f);
+ }
else
print_hex (value, f);
}
@@ -331,7 +348,7 @@ ipcp_bits_lattice::print (FILE *f)
fprintf (f, " Bits: value = ");
ipcp_print_widest_int (f, get_value ());
fprintf (f, ", mask = ");
- print_hex (get_mask (), f);
+ ipcp_print_widest_int (f, get_mask ());
fprintf (f, "\n");
}
}
@@ -916,11 +933,13 @@ ipcp_bits_lattice::meet_with_1 (widest_int value, widest_int mask,
m_mask = (m_mask | mask) | (m_value ^ value);
if (drop_all_ones)
m_mask |= m_value;
- m_value &= ~m_mask;
+ widest_int cap_mask = wi::shifted_mask <widest_int> (0, precision, true);
+ m_mask |= cap_mask;
if (wi::sext (m_mask, precision) == -1)
return set_to_bottom ();
+ m_value &= ~m_mask;
return m_mask != old_mask;
}
@@ -996,6 +1015,8 @@ ipcp_bits_lattice::meet_with (ipcp_bits_lattice& other, unsigned precision,
adjusted_mask |= adjusted_value;
adjusted_value &= ~adjusted_mask;
}
+ widest_int cap_mask = wi::shifted_mask <widest_int> (0, precision, true);
+ adjusted_mask |= cap_mask;
if (wi::sext (adjusted_mask, precision) == -1)
return set_to_bottom ();
return set_to_constant (adjusted_value, adjusted_mask);
@@ -1467,10 +1488,12 @@ ipacp_value_safe_for_type (tree param_type, tree value)
return NULL_TREE;
}
-/* Return the result of a (possibly arithmetic) operation on the constant value
- INPUT. OPERAND is 2nd operand for binary operation. RES_TYPE is the type
- in which any operation is to be performed. Return NULL_TREE if that cannot
- be determined or be considered an interprocedural invariant. */
+/* Return the result of a (possibly arithmetic) operation determined by OPCODE
+ on the constant value INPUT. OPERAND is 2nd operand for binary operation
+ and is required for binary operations. RES_TYPE, required when opcode is
+ not NOP_EXPR, is the type in which any operation is to be performed. Return
+ NULL_TREE if that cannot be determined or be considered an interprocedural
+ invariant. */
static tree
ipa_get_jf_arith_result (enum tree_code opcode, tree input, tree operand,
@@ -1491,16 +1514,6 @@ ipa_get_jf_arith_result (enum tree_code opcode, tree input, tree operand,
return NULL_TREE;
}
- if (!res_type)
- {
- if (TREE_CODE_CLASS (opcode) == tcc_comparison)
- res_type = boolean_type_node;
- else if (expr_type_first_operand_type_p (opcode))
- res_type = TREE_TYPE (input);
- else
- return NULL_TREE;
- }
-
if (TREE_CODE_CLASS (opcode) == tcc_unary)
res = fold_unary (opcode, res_type, input);
else
@@ -1584,7 +1597,10 @@ ipa_value_from_jfunc (class ipa_node_params *info, struct ipa_jump_func *jfunc,
return NULL_TREE;
enum tree_code opcode = ipa_get_jf_pass_through_operation (jfunc);
tree op2 = ipa_get_jf_pass_through_operand (jfunc);
- tree cstval = ipa_get_jf_arith_result (opcode, input, op2, NULL_TREE);
+ tree op_type
+ = (opcode == NOP_EXPR) ? NULL_TREE
+ : ipa_get_jf_pass_through_op_type (jfunc);
+ tree cstval = ipa_get_jf_arith_result (opcode, input, op2, op_type);
return ipacp_value_safe_for_type (parm_type, cstval);
}
else
@@ -1724,24 +1740,7 @@ ipa_vr_intersect_with_arith_jfunc (vrange &vr,
const value_range *inter_vr;
if (operation != NOP_EXPR)
{
- /* Since we construct arithmetic jump functions even when there is a
- type conversion in between the operation encoded in the jump
- function and when it is passed in a call argument, the IPA
- propagation phase must also perform the operation and conversion
- in two separate steps.
-
- TODO: In order to remove the use of expr_type_first_operand_type_p
- predicate we would need to stream the operation type, ideally
- encoding the whole jump function as a series of expr_eval_op
- structures. */
-
- tree operation_type;
- if (expr_type_first_operand_type_p (operation))
- operation_type = src_type;
- else if (operation == ABSU_EXPR)
- operation_type = unsigned_type_for (src_type);
- else
- return;
+ tree operation_type = ipa_get_jf_pass_through_op_type (jfunc);
op_res.set_varying (operation_type);
if (!ipa_vr_operation_and_type_effects (op_res, src_vr, operation,
operation_type, src_type))
@@ -1771,14 +1770,7 @@ ipa_vr_intersect_with_arith_jfunc (vrange &vr,
value_range op_vr (TREE_TYPE (operand));
ipa_get_range_from_ip_invariant (op_vr, operand, context_node);
- tree operation_type;
- if (TREE_CODE_CLASS (operation) == tcc_comparison)
- operation_type = boolean_type_node;
- else if (expr_type_first_operand_type_p (operation))
- operation_type = src_type;
- else
- return;
-
+ tree operation_type = ipa_get_jf_pass_through_op_type (jfunc);
value_range op_res (operation_type);
if (!ipa_vr_supported_type_p (operation_type)
|| !handler.operand_check_p (operation_type, src_type, op_vr.type ())
@@ -1918,10 +1910,11 @@ ipa_agg_value_from_jfunc (ipa_node_params *info, cgraph_node *node,
return NULL_TREE;
}
- return ipa_get_jf_arith_result (item->value.pass_through.operation,
- value,
- item->value.pass_through.operand,
- item->type);
+ tree cstval = ipa_get_jf_arith_result (item->value.pass_through.operation,
+ value,
+ item->value.pass_through.operand,
+ item->value.pass_through.op_type);
+ return ipacp_value_safe_for_type (item->type, cstval);
}
/* Process all items in AGG_JFUNC relative to caller (or the node the original
@@ -2150,13 +2143,15 @@ ipcp_lattice<valtype>::add_value (valtype newval, cgraph_edge *cs,
/* A helper function that returns result of operation specified by OPCODE on
the value of SRC_VAL. If non-NULL, OPND1_TYPE is expected type for the
value of SRC_VAL. If the operation is binary, OPND2 is a constant value
- acting as its second operand. */
+ acting as its second operand. OP_TYPE is the type in which the operation is
+ performed. */
static tree
get_val_across_arith_op (enum tree_code opcode,
tree opnd1_type,
tree opnd2,
- ipcp_value<tree> *src_val)
+ ipcp_value<tree> *src_val,
+ tree op_type)
{
tree opnd1 = src_val->value;
@@ -2165,17 +2160,19 @@ get_val_across_arith_op (enum tree_code opcode,
&& !useless_type_conversion_p (opnd1_type, TREE_TYPE (opnd1)))
return NULL_TREE;
- return ipa_get_jf_arith_result (opcode, opnd1, opnd2, NULL_TREE);
+ return ipa_get_jf_arith_result (opcode, opnd1, opnd2, op_type);
}
/* Propagate values through an arithmetic transformation described by a jump
function associated with edge CS, taking values from SRC_LAT and putting
- them into DEST_LAT. OPND1_TYPE is expected type for the values in SRC_LAT.
- OPND2 is a constant value if transformation is a binary operation.
- SRC_OFFSET specifies offset in an aggregate if SRC_LAT describes lattice of
- a part of the aggregate. SRC_IDX is the index of the source parameter.
- RES_TYPE is the value type of result being propagated into. Return true if
- DEST_LAT changed. */
+ them into DEST_LAT. OPND1_TYPE, if non-NULL, is the expected type for the
+ values in SRC_LAT. OPND2 is a constant value if transformation is a binary
+ operation. SRC_OFFSET specifies offset in an aggregate if SRC_LAT describes
+ lattice of a part of an aggregate, otherwise it should be -1. SRC_IDX is
+ the index of the source parameter. OP_TYPE is the type in which the
+ operation is performed and can be NULL when OPCODE is NOP_EXPR. RES_TYPE is
+ the value type of result being propagated into. Return true if DEST_LAT
+ changed. */
static bool
propagate_vals_across_arith_jfunc (cgraph_edge *cs,
@@ -2186,6 +2183,7 @@ propagate_vals_across_arith_jfunc (cgraph_edge *cs,
ipcp_lattice<tree> *dest_lat,
HOST_WIDE_INT src_offset,
int src_idx,
+ tree op_type,
tree res_type)
{
ipcp_value<tree> *src_val;
@@ -2241,7 +2239,7 @@ propagate_vals_across_arith_jfunc (cgraph_edge *cs,
for (int j = 1; j < max_recursive_depth; j++)
{
tree cstval = get_val_across_arith_op (opcode, opnd1_type, opnd2,
- src_val);
+ src_val, op_type);
cstval = ipacp_value_safe_for_type (res_type, cstval);
if (!cstval)
break;
@@ -2266,7 +2264,7 @@ propagate_vals_across_arith_jfunc (cgraph_edge *cs,
}
tree cstval = get_val_across_arith_op (opcode, opnd1_type, opnd2,
- src_val);
+ src_val, op_type);
cstval = ipacp_value_safe_for_type (res_type, cstval);
if (cstval)
ret |= dest_lat->add_value (cstval, cs, src_val, src_idx,
@@ -2290,11 +2288,13 @@ propagate_vals_across_pass_through (cgraph_edge *cs, ipa_jump_func *jfunc,
tree parm_type)
{
gcc_checking_assert (parm_type);
- return propagate_vals_across_arith_jfunc (cs,
- ipa_get_jf_pass_through_operation (jfunc),
- NULL_TREE,
+ enum tree_code opcode = ipa_get_jf_pass_through_operation (jfunc);
+ tree op_type = (opcode == NOP_EXPR) ? NULL_TREE
+ : ipa_get_jf_pass_through_op_type (jfunc);
+ return propagate_vals_across_arith_jfunc (cs, opcode, NULL_TREE,
ipa_get_jf_pass_through_operand (jfunc),
- src_lat, dest_lat, -1, src_idx, parm_type);
+ src_lat, dest_lat, -1, src_idx, op_type,
+ parm_type);
}
/* Propagate values through an ancestor jump function JFUNC associated with
@@ -2507,14 +2507,12 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx,
return dest_lattice->set_to_bottom ();
}
- unsigned precision = TYPE_PRECISION (parm_type);
- signop sgn = TYPE_SIGN (parm_type);
-
if (jfunc->type == IPA_JF_PASS_THROUGH
|| jfunc->type == IPA_JF_ANCESTOR)
{
ipa_node_params *caller_info = ipa_node_params_sum->get (cs->caller);
tree operand = NULL_TREE;
+ tree op_type = NULL_TREE;
enum tree_code code;
unsigned src_idx;
bool keep_null = false;
@@ -2524,7 +2522,10 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx,
code = ipa_get_jf_pass_through_operation (jfunc);
src_idx = ipa_get_jf_pass_through_formal_id (jfunc);
if (code != NOP_EXPR)
- operand = ipa_get_jf_pass_through_operand (jfunc);
+ {
+ operand = ipa_get_jf_pass_through_operand (jfunc);
+ op_type = ipa_get_jf_pass_through_op_type (jfunc);
+ }
}
else
{
@@ -2551,6 +2552,11 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx,
if (!src_lats->bits_lattice.bottom_p ())
{
+ if (!op_type)
+ op_type = ipa_get_type (caller_info, src_idx);
+
+ unsigned precision = TYPE_PRECISION (op_type);
+ signop sgn = TYPE_SIGN (op_type);
bool drop_all_ones
= keep_null && !src_lats->bits_lattice.known_nonzero_p ();
@@ -2570,7 +2576,8 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx,
= widest_int::from (bm.mask (), TYPE_SIGN (parm_type));
widest_int value
= widest_int::from (bm.value (), TYPE_SIGN (parm_type));
- return dest_lattice->meet_with (value, mask, precision);
+ return dest_lattice->meet_with (value, mask,
+ TYPE_PRECISION (parm_type));
}
}
return dest_lattice->set_to_bottom ();
@@ -2869,6 +2876,7 @@ propagate_aggregate_lattice (struct cgraph_edge *cs,
src_lat, aglat,
src_offset,
src_idx,
+ item->value.pass_through.op_type,
item->type);
if (src_lat->contains_variable)
@@ -5394,11 +5402,14 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node,
if (self_recursive_pass_through_p (cs, jump_func, i, false))
{
gcc_assert (newval);
- t = ipa_get_jf_arith_result (
- ipa_get_jf_pass_through_operation (jump_func),
- newval,
+ enum tree_code opcode
+ = ipa_get_jf_pass_through_operation (jump_func);
+ tree op_type = (opcode == NOP_EXPR) ? NULL_TREE
+ : ipa_get_jf_pass_through_op_type (jump_func);
+ t = ipa_get_jf_arith_result (opcode, newval,
ipa_get_jf_pass_through_operand (jump_func),
- type);
+ op_type);
+ t = ipacp_value_safe_for_type (type, t);
}
else
t = ipa_value_from_jfunc (ipa_node_params_sum->get (cs->caller),
@@ -5603,10 +5614,13 @@ push_agg_values_for_index_from_edge (struct cgraph_edge *cs, int index,
&& self_recursive_agg_pass_through_p (cs, &agg_jf, index, false)
&& (srcvalue = interim->get_value(index,
agg_jf.offset / BITS_PER_UNIT)))
- value = ipa_get_jf_arith_result (agg_jf.value.pass_through.operation,
- srcvalue,
- agg_jf.value.pass_through.operand,
- agg_jf.type);
+ {
+ value = ipa_get_jf_arith_result (agg_jf.value.pass_through.operation,
+ srcvalue,
+ agg_jf.value.pass_through.operand,
+ agg_jf.value.pass_through.op_type);
+ value = ipacp_value_safe_for_type (agg_jf.type, value);
+ }
else
value = ipa_agg_value_from_jfunc (caller_info, cs->caller,
&agg_jf);
@@ -6426,7 +6440,7 @@ ipcp_store_vr_results (void)
fprintf (dump_file, " param %i: value = ", i);
ipcp_print_widest_int (dump_file, bits->get_value ());
fprintf (dump_file, ", mask = ");
- print_hex (bits->get_mask (), dump_file);
+ ipcp_print_widest_int (dump_file, bits->get_mask ());
fprintf (dump_file, "\n");
}
}
diff --git a/gcc/ipa-locality-cloning.cc b/gcc/ipa-locality-cloning.cc
new file mode 100644
index 0000000..2684046
--- /dev/null
+++ b/gcc/ipa-locality-cloning.cc
@@ -0,0 +1,1137 @@
+/* Code locality based function cloning.
+ Copyright The GNU Toolchain Authors
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* This file implements cloning required to improve partitioning of the
+ callgraph for locality considerations.
+
+ Partitioning for improving code locality.
+ This pass aims to place frequently executed callchains closer together in
+ memory to improve performance through improved locality. If any frequent
+ callchains cannot be placed together because they are already placed
+ elsewhere, local function clones are created and all callers near to the
+ clones are redirected to use this copy.
+
+ Locality code placement is done in 2 parts.
+ 1. IPA pass to be executed after ipa-inline and before ipa-pure-const.
+ Execute stage prepares the plan to place all nodes into partitions.
+ 2. WPA Partition stage actually implements the plan.
+
+ Brief overview of the IPA pass:
+ 1. Create and sort callchains. If PGO is available, use real profile
+ counts. Otherwise, use a set of heuristics to sort the callchains.
+ 2. Create a partition plan for the callchains, processing them in the sorted
+ order.
+ 1. If a function is unpartitioned, place it in the current partition.
+ 2. If a function is already placed in a partition away from current
+ partition as part of another callchain:
+ Create a local clone in current partition, if cloning criteria is
+ satisfied.
+ 3. Redirect any new caller to a local clone if one exists.
+ Partition size is param controlled to fine tune per program behavior. */
+
+#include "config.h"
+#define INCLUDE_ALGORITHM
+#include "system.h"
+#include "coretypes.h"
+#include "target.h"
+#include "function.h"
+#include "tree.h"
+#include "alloc-pool.h"
+#include "tree-pass.h"
+#include "cgraph.h"
+#include "symbol-summary.h"
+#include "tree-vrp.h"
+#include "symtab-thunks.h"
+#include "sreal.h"
+#include "ipa-cp.h"
+#include "ipa-prop.h"
+#include "ipa-fnsummary.h"
+#include "ipa-modref-tree.h"
+#include "ipa-modref.h"
+#include "symtab-clones.h"
+#include "ipa-locality-cloning.h"
+
+/* Locality partitions, assigns nodes to partitions. These are used later in
+ WPA partitioning. */
+vec<locality_partition> locality_partitions;
+
+/* Map from original node to its latest clone. Gets overwritten whenever a new
+ clone is created from the same node. */
+hash_map<cgraph_node *, cgraph_node *> node_to_clone;
+/* Map from clone to its original node. */
+hash_map<cgraph_node *, cgraph_node *> clone_to_node;
+
+/* Data structure to hold static heuristics and orders for cgraph_nodes. */
+struct locality_order
+{
+ cgraph_node *node;
+ sreal order;
+ locality_order (cgraph_node *node, sreal order) : node (node), order (order)
+ {}
+};
+
+/* Return true if NODE is already in some partition. */
+static inline bool
+node_partitioned_p (cgraph_node *node)
+{
+ return node->aux;
+}
+
+/* Add symbol NODE to partition PART. */
+static void
+add_node_to_partition (locality_partition part, cgraph_node *node)
+{
+ struct cgraph_edge *e;
+ if (node_partitioned_p (node))
+ return;
+
+ part->nodes.safe_push (node);
+ node->aux = (void *) (uintptr_t) (part->part_id);
+
+ if (!node->alias && node->get_partitioning_class () == SYMBOL_PARTITION)
+ part->insns += ipa_size_summaries->get (node)->size;
+
+ /* Add all inline clones and callees that are duplicated. */
+ for (e = node->callees; e; e = e->next_callee)
+ if (!e->inline_failed)
+ add_node_to_partition (part, e->callee);
+ /* omp declare_variant_alt or transparent_alias with definition or linker
+ discardable (non-local comdat but not forced and not
+ used by non-LTO). */
+ else if (e->callee->get_partitioning_class () == SYMBOL_DUPLICATE)
+ add_node_to_partition (part, e->callee);
+
+ /* Add all thunks associated with the function. */
+ for (e = node->callers; e; e = e->next_caller)
+ if (e->caller->thunk && !e->caller->inlined_to)
+ add_node_to_partition (part, e->caller);
+
+ /* Add all aliases associated with the symbol. */
+ struct ipa_ref *ref;
+ FOR_EACH_ALIAS (node, ref)
+ if (!ref->referring->transparent_alias)
+ {
+ cgraph_node *referring = dyn_cast<cgraph_node *> (ref->referring);
+ /* Only add function aliases.
+ Varpool refs are added later in LTO partitioning pass. */
+ if (referring)
+ add_node_to_partition (part, referring);
+ }
+ else
+ {
+ struct ipa_ref *ref2;
+ /* We do not need to add transparent aliases if they are not used.
+ However we must add aliases of transparent aliases if they exist. */
+ FOR_EACH_ALIAS (ref->referring, ref2)
+ {
+ /* Nested transparent aliases are not permitted. */
+ gcc_checking_assert (!ref2->referring->transparent_alias);
+ cgraph_node *referring = dyn_cast<cgraph_node *> (ref2->referring);
+ if (referring)
+ add_node_to_partition (part, referring);
+ }
+ }
+}
+
+/* Return TRUE if NODE is in PARTITION. */
+static bool
+node_in_partition_p (locality_partition partition, cgraph_node *node)
+{
+ return ((uintptr_t) (partition->part_id) == (uintptr_t) (node->aux));
+}
+
+/* Helper function for qsort; to break ties. */
+static int
+compare_node_uids (cgraph_node *n1, cgraph_node *n2)
+{
+ int res = n1->get_uid () - n2->get_uid ();
+ gcc_assert (res != 0);
+ return res > 0 ? 1 : -1;
+}
+
+/* Helper function for qsort; sort nodes by order. */
+static int
+static_profile_cmp (const void *pa, const void *pb)
+{
+ const locality_order *a = *static_cast<const locality_order *const *> (pa);
+ const locality_order *b = *static_cast<const locality_order *const *> (pb);
+ /* Ascending order. */
+ if (b->order < a->order)
+ return 1;
+ if (b->order > a->order)
+ return -1;
+ return compare_node_uids (a->node, b->node);
+}
+
+/* Helper function for qsort; sort nodes by profile count. */
+static int
+compare_edge_profile_counts (const void *pa, const void *pb)
+{
+ const locality_order *a = *static_cast<const locality_order *const *> (pa);
+ const locality_order *b = *static_cast<const locality_order *const *> (pb);
+
+ profile_count cnt1 = a->node->count.ipa ();
+ profile_count cnt2 = b->node->count.ipa ();
+ if (!cnt1.compatible_p (cnt2))
+ return static_profile_cmp (pa, pb);
+
+ if (cnt1 < cnt2)
+ return 1;
+ if (cnt1 > cnt2)
+ return -1;
+ return static_profile_cmp (pa, pb);
+}
+
+/* Create and return a new partition and increment NPARTITIONS. */
+
+static locality_partition
+create_partition (int &npartitions)
+{
+ locality_partition part = XCNEW (struct locality_partition_def);
+ npartitions++;
+ part->part_id = npartitions;
+ part->nodes.create (1);
+ part->insns = 0;
+ locality_partitions.safe_push (part);
+ return part;
+}
+
+/* Structure for holding profile count information of callers of a node. */
+struct profile_stats
+{
+ /* Sum of non-recursive call counts. */
+ profile_count nonrec_count;
+
+ /* Sum of recursive call counts. */
+ profile_count rec_count;
+
+ /* If non-NULL, this node is the target of alias or thunk and calls from this
+ should be count in rec_count. */
+ cgraph_node *target;
+};
+
+/* Initialize fields of STATS. */
+static inline void
+init_profile_stats (profile_stats *stats, cgraph_node *target = NULL)
+{
+ stats->nonrec_count = profile_count::zero ();
+ stats->rec_count = profile_count::zero ();
+ stats->target = target;
+}
+
+/* Helper function of to accumulate call counts. */
+static bool
+accumulate_profile_counts_after_cloning (cgraph_node *node, void *data)
+{
+ struct profile_stats *stats = (struct profile_stats *) data;
+ for (cgraph_edge *e = node->callers; e; e = e->next_caller)
+ {
+ if (!e->count.initialized_p ())
+ continue;
+
+ if (e->caller == stats->target)
+ stats->rec_count += e->count.ipa ();
+ else
+ stats->nonrec_count += e->count.ipa ();
+ }
+ return false;
+}
+
+/* NEW_NODE is a previously created clone of ORIG_NODE already present in
+ current partition. EDGES contains newly redirected edges to NEW_NODE.
+ Adjust profile information for both nodes and the edge. */
+
+static void
+adjust_profile_info_for_non_self_rec_edges (auto_vec<cgraph_edge *> &edges,
+ cgraph_node *new_node,
+ cgraph_node *orig_node)
+{
+ profile_count orig_node_count = orig_node->count.ipa ();
+ profile_count edge_count = profile_count::zero ();
+ profile_count final_new_count = profile_count::zero ();
+ profile_count final_orig_count = profile_count::zero ();
+
+ for (unsigned i = 0; i < edges.length (); ++i)
+ if (edges[i]->count.initialized_p ())
+ edge_count += edges[i]->count.ipa ();
+
+ final_orig_count = orig_node_count - edge_count;
+
+ /* NEW_NODE->count was adjusted for other callers when the clone was
+ first created. Just add the new edge count. */
+ final_new_count = new_node->count + edge_count;
+
+ final_new_count = orig_node_count.combine_with_ipa_count (final_new_count);
+ orig_node->count = final_orig_count;
+ new_node->count = final_new_count;
+
+ if (dump_file)
+ {
+ fprintf (dump_file, "Adjusting profile information for %s\n",
+ new_node->dump_asm_name ());
+ fprintf (dump_file, "\tOriginal node %s\n", orig_node->dump_asm_name ());
+ fprintf (dump_file, "\tOriginal count: ");
+ orig_node_count.dump (dump_file);
+ fprintf (dump_file, "\n\tAdjusted original count to: ");
+ final_orig_count.dump (dump_file);
+ fprintf (dump_file, "\n\tAdjusted clone count to: ");
+ final_new_count.dump (dump_file);
+ fprintf (dump_file, "\n");
+ }
+
+ /* Scale all callee edges according to adjusted counts. */
+ profile_count orig_node_count_copy = orig_node_count;
+ profile_count::adjust_for_ipa_scaling (&final_new_count,
+ &orig_node_count_copy);
+ for (cgraph_edge *cs = new_node->callees; cs; cs = cs->next_callee)
+ cs->count = cs->count.apply_scale (final_new_count, orig_node_count_copy);
+ for (cgraph_edge *cs = new_node->indirect_calls; cs; cs = cs->next_callee)
+ cs->count = cs->count.apply_scale (final_new_count, orig_node_count_copy);
+
+ profile_count::adjust_for_ipa_scaling (&final_orig_count, &orig_node_count);
+ for (cgraph_edge *cs = orig_node->callees; cs; cs = cs->next_callee)
+ cs->count = cs->count.apply_scale (final_orig_count, orig_node_count);
+ for (cgraph_edge *cs = orig_node->indirect_calls; cs; cs = cs->next_callee)
+ cs->count = cs->count.apply_scale (final_orig_count, orig_node_count);
+}
+
+/* Adjust profile counts of NEW_NODE and ORIG_NODE, where NEW_NODE is a clone
+ of OLD_NODE.
+ Assumes that all eligible edges from current partition so far are redirected
+ to NEW_NODE and recursive edges are adjusted. */
+
+static void
+adjust_profile_info (cgraph_node *new_node, cgraph_node *orig_node)
+{
+ /* If all calls to NEW_NODE are non-recursive, subtract corresponding count
+ from ORIG_NODE and assign to NEW_NODE, any unexpected remainder stays with
+ ORIG_NODE.
+ Recursive calls if present, likely contribute to majority of count;
+ scale according to redirected callers' count. */
+
+ profile_count orig_node_count = orig_node->count.ipa ();
+ profile_stats new_stats, orig_stats;
+
+ init_profile_stats (&new_stats);
+ init_profile_stats (&orig_stats);
+
+ new_node->call_for_symbol_thunks_and_aliases
+ (accumulate_profile_counts_after_cloning, &new_stats, false);
+ orig_node->call_for_symbol_thunks_and_aliases
+ (accumulate_profile_counts_after_cloning, &orig_stats, false);
+
+ profile_count orig_nonrec_count = orig_stats.nonrec_count;
+ profile_count orig_rec_count = orig_stats.rec_count;
+ profile_count new_nonrec_count = new_stats.nonrec_count;
+ profile_count new_rec_count = new_stats.rec_count;
+
+ profile_count final_new_count = new_nonrec_count;
+ profile_count final_orig_count = profile_count::zero ();
+
+ /* All calls to NEW_NODE are non-recursive or recursive calls have
+ zero count. */
+ if (!new_rec_count.nonzero_p ())
+ final_orig_count = orig_node_count - new_nonrec_count;
+ else
+ {
+ /* If ORIG_NODE is externally visible, indirect calls or calls from
+ another part of the code may contribute to the count.
+ update_profiling_info () from ipa-cp.cc pretends to have an extra
+ caller to represent the extra counts. */
+ if (!orig_node->local)
+ {
+ profile_count pretend_count = (orig_node_count - new_nonrec_count -
+ orig_nonrec_count - orig_rec_count);
+ orig_nonrec_count += pretend_count;
+ }
+
+ /* Remaining rec_count is assigned in proportion to clone's non-recursive
+ count. */
+ profile_count rec_count = orig_node_count - new_nonrec_count
+ - orig_nonrec_count;
+ profile_count new_rec_scaled
+ = rec_count.apply_scale (new_nonrec_count,
+ new_nonrec_count + orig_nonrec_count);
+ final_new_count += new_rec_scaled;
+ final_orig_count = orig_node_count - final_new_count;
+ }
+
+ final_new_count = orig_node_count.combine_with_ipa_count (final_new_count);
+ new_node->count = final_new_count;
+ orig_node->count = final_orig_count;
+
+ if (dump_file)
+ {
+ fprintf (dump_file, "Adjusting profile information for %s\n",
+ new_node->dump_asm_name ());
+ fprintf (dump_file, "\tOriginal node %s\n", orig_node->dump_asm_name ());
+ fprintf (dump_file, "\tOriginal count: ");
+ orig_node_count.dump (dump_file);
+ fprintf (dump_file, "\n\tAdjusted original count to: ");
+ final_orig_count.dump (dump_file);
+ fprintf (dump_file, "\n\tAdjusted clone count to: ");
+ final_new_count.dump (dump_file);
+ fprintf (dump_file, "\n");
+ }
+
+ /* Scale all callee edges according to adjusted counts. */
+ profile_count orig_node_count_copy = orig_node_count;
+ profile_count::adjust_for_ipa_scaling (&final_new_count,
+ &orig_node_count_copy);
+ for (cgraph_edge *cs = new_node->callees; cs; cs = cs->next_callee)
+ cs->count = cs->count.apply_scale (final_new_count, orig_node_count_copy);
+ for (cgraph_edge *cs = new_node->indirect_calls; cs; cs = cs->next_callee)
+ cs->count = cs->count.apply_scale (final_new_count, orig_node_count_copy);
+
+ profile_count::adjust_for_ipa_scaling (&final_orig_count, &orig_node_count);
+ for (cgraph_edge *cs = orig_node->callees; cs; cs = cs->next_callee)
+ cs->count = cs->count.apply_scale (final_orig_count, orig_node_count);
+ for (cgraph_edge *cs = orig_node->indirect_calls; cs; cs = cs->next_callee)
+ cs->count = cs->count.apply_scale (final_orig_count, orig_node_count);
+}
+
+/* Return true if EDGE can be safely redirected to another callee. */
+static inline bool
+edge_redirectable_p (cgraph_edge *edge, lto_locality_cloning_model cm)
+{
+ if (cm == LTO_LOCALITY_NON_INTERPOSABLE_CLONING)
+ {
+ /* Interposability may change on edge basis. */
+ enum availability avail;
+ avail = edge->callee->get_availability (edge->caller);
+ if (avail <= AVAIL_INTERPOSABLE)
+ return false;
+ }
+ return true;
+}
+
+/* Create a locality clone of CNODE and redirect all callers present in
+ PARTITION.
+ Create a clone dpending on whether CNODE itself is a clone or not. */
+
+static cgraph_node *
+create_locality_clone (cgraph_node *cnode,
+ locality_partition partition, int &cl_num,
+ lto_locality_cloning_model cm)
+{
+ cgraph_node *cl_node = NULL;
+ vec<cgraph_edge *> redirect_callers = vNULL;
+ /* All callers of cnode in current partition are redirected. */
+ struct cgraph_edge *edge;
+ for (edge = cnode->callers; edge; edge = edge->next_caller)
+ {
+ struct cgraph_node *caller = edge->caller;
+ if (node_in_partition_p (partition, caller) && caller->definition
+ && caller != cnode && edge_redirectable_p (edge, cm))
+ redirect_callers.safe_push (edge);
+ }
+
+ const char *suffix = "locality_clone";
+
+ tree old_decl = cnode->decl;
+ tree new_decl = copy_node (old_decl);
+
+ /* Generate a new name for the new version. */
+ const char *name = IDENTIFIER_POINTER (DECL_NAME (old_decl));
+ DECL_NAME (new_decl) = clone_function_name (name, suffix, cl_num);
+ SET_DECL_ASSEMBLER_NAME (new_decl,
+ clone_function_name (old_decl, suffix, cl_num));
+ cl_num++;
+ if (dump_file)
+ fprintf (dump_file, "\tNew name %s\n",
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (new_decl)));
+
+ cl_node = cnode->create_clone (new_decl, cnode->count /*profile_count*/,
+ false /*update_original*/, redirect_callers,
+ false /*call_duplication_hook*/,
+ NULL /*new_inlined_to*/,
+ NULL /*param_adjustments*/, suffix);
+
+ set_new_clone_decl_and_node_flags (cl_node);
+
+ if (cnode->ipa_transforms_to_apply.exists ())
+ cl_node->ipa_transforms_to_apply
+ = cnode->ipa_transforms_to_apply.copy ();
+
+ if (dump_file)
+ {
+ fprintf (dump_file, "Cloned Node: %s %s\n", cnode->dump_asm_name (),
+ cl_node->dump_asm_name ());
+
+ for (edge = cl_node->callers; edge; edge = edge->next_caller)
+ fprintf (dump_file, "Redirected callers: %s\n",
+ edge->caller->dump_asm_name ());
+
+ for (edge = cl_node->callees; edge; edge = edge->next_callee)
+ fprintf (dump_file, "Callees of clone: %s %d\n",
+ edge->callee->dump_asm_name (), edge->frequency ());
+ }
+ return cl_node;
+}
+
+/* Redirect recursive edges of CLONE to correctly point to CLONE. As part of
+ cloning process, all callee edges of a node are just duplicated but not
+ redirected. Therefore, these edges still call to original of CLONE.
+
+ For non-inlined CLONEs, NEW_CALLEE == CLONE and ORIG_CALLEE is CLONE's
+ original node.
+
+ For inlined node, self recursion to CLONE's original same as non-inlined,
+ additionally, calls to CLONE->inlined_to are also recursive:
+ NEW_CALLEE == CLONE->inlined_into and
+ ORIG_CALLEE == original node of CLONE->inlined_into. */
+
+static void
+adjust_recursive_callees (cgraph_node *clone, cgraph_node *new_callee,
+ cgraph_node *orig_callee)
+{
+ cgraph_node *alias = NULL;
+ for (cgraph_edge *e = clone->callees; e; e = e->next_callee)
+ {
+ if (!e->inline_failed)
+ continue;
+
+ /* Only self-cycle or local alias are handled. */
+ cgraph_node *callee = e->callee;
+ if (callee == orig_callee)
+ {
+ cgraph_node **cl = node_to_clone.get (orig_callee);
+ gcc_assert (cl && *cl == new_callee);
+ e->redirect_callee_duplicating_thunks (new_callee);
+ if (dump_file)
+ fprintf (dump_file, "recursive call from %s to %s orig %s\n",
+ e->caller->dump_asm_name (), e->callee->dump_asm_name (),
+ callee->dump_asm_name ());
+ }
+ else if (callee->alias
+ && e->callee->ultimate_alias_target () == orig_callee)
+ {
+ if (!alias)
+ {
+ alias = dyn_cast<cgraph_node *> (
+ new_callee->noninterposable_alias ());
+ }
+ e->redirect_callee_duplicating_thunks (alias);
+ if (dump_file)
+ fprintf (dump_file, "recursive call from %s to %s orig %s\n",
+ e->caller->dump_asm_name (), e->callee->dump_asm_name (),
+ callee->dump_asm_name ());
+ }
+ }
+ new_callee->expand_all_artificial_thunks ();
+ if (alias)
+ alias->expand_all_artificial_thunks ();
+}
+
+/* Create clones for CALLER's inlined callees, ORIG_INLINED_TO is the original
+ node from clone_as_needed () such that new_inlined_to is a clone of it. */
+
+static void
+inline_clones (cgraph_node *caller, cgraph_node *orig_inlined_to)
+{
+ struct cgraph_edge *edge;
+ for (edge = caller->callees; edge; edge = edge->next_callee)
+ {
+ struct cgraph_node *callee = edge->callee;
+ if (edge->inline_failed)
+ continue;
+
+ if (callee->inlined_to != orig_inlined_to)
+ continue;
+
+ struct cgraph_node *new_inlined_to, *cl;
+ if (caller->inlined_to)
+ new_inlined_to = caller->inlined_to;
+ else
+ new_inlined_to = caller;
+
+ cl = callee->create_clone (callee->decl,
+ edge->count /*profile_count*/,
+ true /*update_original*/,
+ vNULL /*redirect_callers*/,
+ false /*call_duplication_hook*/,
+ new_inlined_to /*new_inlined_to*/,
+ NULL /*param_adjustments*/,
+ "locality_clone" /*suffix*/);
+ edge->redirect_callee (cl);
+
+ node_to_clone.put (callee, cl);
+ clone_to_node.put (cl, callee);
+
+ if (callee->thunk)
+ {
+ thunk_info *info = thunk_info::get (callee);
+ *thunk_info::get_create (cl) = *info;
+ }
+
+ adjust_recursive_callees (cl, new_inlined_to, orig_inlined_to);
+ adjust_recursive_callees (cl, cl, callee);
+ if (dump_file)
+ {
+ fprintf (dump_file, "Inline cloned\n");
+ cl->dump (dump_file);
+ }
+
+ /* Recursively inline till end of this callchain. */
+ inline_clones (cl, orig_inlined_to);
+ }
+}
+
+/* Clone EDGE->CALLEE if it or a clone of it is not already in PARTITION.
+ Redirect all callers of EDGE->CALLEE that are in PARTITION, not just the
+ EDGE. If a clone is already present in PARTITION, redirect all edges from
+ EDGE->CALLER to EDGE->CALLEE. This is because we only visit one edge per
+ caller to callee and redirect for all others from there.
+
+ If cloning, also recursively clone inlined functions till the end of the
+ callchain because inlined clones have 1-1 exclusive copy and edge from
+ caller to inlined node.
+
+ There are 2 flows possible:
+ 1. Only redirect
+ 1.1. cnode is already in current partition - cnode mustn't be a
+ locality_clone -> nothing to do
+ 1.2. A clone of cnode is in current partition - find out if it's the
+ correct clone for edge - must be a locality_clone but the exact same
+ kind as callee i.e. orig or cp/sra clone, if yes, redirect, else go to #2
+ 1.3. Cnode/a clone of cnode is in current partition but caller is inlined
+ 2. Clone and redirect
+ 2.1. cnode is original node
+ 2.2. cnode itself is a clone
+ Clone inlines
+ Flavors of edges:
+ 1. Normal -> orig nodes, locality clones or cp/sra clones
+ 2. Recursive -> direct recursion
+ 3. Alias -> recursion via aliasing or as a result of IPA code duplication
+ 4. Inline -> shouldn't be included in callchain. */
+
+static cgraph_node *
+clone_node_as_needed (cgraph_edge *edge, locality_partition partition,
+ int &cl_num, lto_locality_cloning_model cm)
+{
+ /* suitable_for_locality_cloning_p () currently prohibits cloning aliases due
+ to potential versioning and materialization issues. Could be enabled in
+ the future. suitable_for_locality_cloning_p () also checks for
+ interposability for CNODE but not for edge redirection. */
+ struct cgraph_node *cnode = edge->callee;
+ struct cgraph_node *caller = edge->caller;
+
+ /* If clone of cnode is already in the partition
+ Get latest clone of cnode. If current partition has cloned cnode, that
+ clone should be returned. Otherwise, clone from previous partition is
+ returned
+ Original node and its clone shouldn't co-exist in current partition
+
+ This is required if callee is partitioned via another edge before caller
+ was, and we are now visiting caller->callee edge
+
+ 1) a -> b ==> a -> bc1; b was cloned say via d -> bc1, a is orig
+ 2) ac1 -> b ==> ac1 -> bc1; b was cloned and a was just cloned
+ 3) a -> bc1 and bc2 present, mustn't happen, b was cloned and a was
+ redirected without being partitioned first.
+ Why will we do this again - multiple edges and something's wrong in
+ partition_callchain ()
+ 4) ac1 -> bc1 ==> ac1 -> bc2; a was cloned and we already got (1) in some
+ other partition
+ 5) ac1 -> bc1 but no clone present in this PARTITION. Create from b, not
+ from bc1?
+ 6) a -> b; a -> bc0; create new clone, no clone present
+ 7) ac0 -> b; ac0 -> bc0 same as (6)
+ 8) a -> bc0 and no clone present, mustn't happen, same as (3)
+
+ Redirect when bc1 is present and:
+ a -> b or ac -> b or ac -> bc0 */
+
+ cgraph_node *orig_cnode = cnode;
+ cgraph_node **o_cnode = clone_to_node.get (cnode);
+ if (o_cnode)
+ orig_cnode = *o_cnode;
+
+ cgraph_node **cnode_cl = node_to_clone.get (orig_cnode);
+
+ if (cnode_cl && node_in_partition_p (partition, *cnode_cl))
+ {
+ if (node_in_partition_p (partition, caller))
+ {
+ bool clone_p = false;
+ auto_vec<cgraph_edge *> redirected_edges;
+ for (cgraph_edge *ec = caller->callees; ec; ec = ec->next_callee)
+ if (ec->callee == cnode && edge_redirectable_p (ec, cm))
+ {
+ ec->redirect_callee_duplicating_thunks (*cnode_cl);
+ clone_p = true;
+ redirected_edges.safe_push (ec);
+ if (dump_file)
+ {
+ fprintf (dump_file, "clone present %s %s redirecting %s\n",
+ cnode->dump_asm_name (),
+ (*cnode_cl)->dump_asm_name (),
+ caller->dump_asm_name ());
+ }
+ }
+ if (clone_p)
+ {
+ (*cnode_cl)->expand_all_artificial_thunks ();
+ adjust_profile_info_for_non_self_rec_edges (redirected_edges,
+ *cnode_cl, cnode);
+ return NULL;
+ }
+ }
+ }
+
+ /* Create a new clone for a -> b, ac -> b.
+ For ac -> bc, should be done on bc or b?
+ bc could be from b_cp/b_sra or b. */
+
+ if (orig_cnode != cnode)
+ {
+ if (dump_file)
+ fprintf (dump_file, "Clone of clone %s %s\n", cnode->dump_asm_name (),
+ orig_cnode->dump_asm_name ());
+ return NULL;
+ }
+
+ struct cgraph_node *cloned_node
+ = create_locality_clone (cnode, partition, cl_num, cm);
+
+ gcc_assert (cloned_node);
+ if (!cloned_node)
+ return NULL;
+
+ node_to_clone.put (cnode, cloned_node);
+ clone_to_node.put (cloned_node, cnode);
+
+ adjust_recursive_callees (cloned_node, cloned_node, cnode);
+ symtab->call_cgraph_duplication_hooks (cnode, cloned_node);
+
+ adjust_profile_info (cloned_node, cnode);
+ /* Inline clones are created iff their inlined_to == CNODE. */
+ inline_clones (cloned_node, cnode);
+
+ return cloned_node;
+}
+
+/* Accumulate frequency of all edges from EDGE->caller to EDGE->callee. */
+
+static sreal
+accumulate_incoming_edge_frequency (cgraph_edge *edge)
+{
+ sreal count = 0;
+ struct cgraph_edge *e;
+ for (e = edge->callee->callers; e; e = e->next_caller)
+ {
+ /* Make a local decision about all edges for EDGE->caller but not the
+ other nodes already in the partition. Their edges will be visited
+ later or may have been visited before and not fit the
+ cut-off criteria. */
+ if (e->caller == edge->caller)
+ count += e->sreal_frequency ();
+ }
+ return count;
+}
+
+/* Determine if EDGE->CALLEE is suitable for cloning. It is assummed that the
+ callee is not an inlined node. */
+
+static bool
+suitable_for_locality_cloning_p (cgraph_edge *edge,
+ lto_locality_cloning_model cm)
+{
+ cgraph_node *node = edge->callee;
+ if (!node->versionable)
+ return false;
+
+ /* Out-of-line locality clones of ipcp or sra clones will be created in this
+ pass after IPA inline is run. A locality clone has the same function
+ body and the same updated signature as the ipcp/sra clone.
+ This fails or asserts based on how the clone is created:
+ 1. If param_adjustments and tree_map are not recorded for locality clone:
+ clone materialization (tree_function_versioning ()) fails when
+ updating signature and remapping calls because clone_of (ipcp/sra
+ clone) and locality clone differ in param information.
+ 2. If param_adjustments and tree_map are provided: asserts are triggered
+ in fnsummary duplication because IPA inline resets some summaries.
+
+ One inelegant solution is to provide param_adjustments and tree_map, and
+ then set clone_of to ipcp/sra clone's clone_of. However, this sometimes
+ results in segmentation fault when the compiled program is run.
+ Disabling clone of clones altogether for now with an aim to resolve this
+ is future. */
+ if (node->clone_of)
+ return false;
+
+ if (node->alias)
+ return false;
+
+ if (edge->recursive_p ())
+ return false;
+
+ if (!node->definition)
+ return false;
+
+ /* Don't clone NODE if IPA count of NODE or EDGE is zero. */
+ if (!node->count.ipa ().nonzero_p () || !edge->count.ipa ().nonzero_p ())
+ return false;
+
+ if (cm == LTO_LOCALITY_NON_INTERPOSABLE_CLONING)
+ {
+ /* Interposability may change on edge basis. */
+ enum availability avail;
+ edge->callee->ultimate_alias_target (&avail, edge->caller);
+ if (avail <= AVAIL_INTERPOSABLE)
+ return false;
+ }
+
+ return true;
+}
+
+/* Map from caller to all callees already visited for partitioning. */
+hash_map<cgraph_node *, auto_vec<cgraph_node *> > caller_to_callees;
+
+/* Partition EDGE->CALLEE into PARTITION or clone if already partitioned and
+ satisfies cloning criteria such as CLONING_MODEL, REAL_FREQ and SIZE
+ cut-offs and CLONE_FURTHER_P set by previous caller. */
+
+/* callgraph can have multiple caller to callee edges for multiple callsites
+ For the first such edge, we make decisions about cutoffs and cloning because
+ we redirect ALL callsites to cloned callee, not just one of them. */
+
+static void
+partition_callchain (cgraph_edge *edge, locality_partition partition,
+ bool clone_further_p,
+ lto_locality_cloning_model cloning_model,
+ double freq_cutoff, int size, int &cl_num)
+{
+ /* Aliases are added in the same partition as their targets.
+ Aliases are not cloned and their callees are not processed separately. */
+ cgraph_node *node = edge->callee->ultimate_alias_target ();
+ cgraph_node *caller = edge->caller;
+ cgraph_node *caller_node = node, *cl_node = NULL;
+
+ /* Already visited the caller to callee edges. */
+ auto_vec<cgraph_node *> &callees = caller_to_callees.get_or_insert (caller);
+ if (std::find (callees.begin (), callees.end (), node) != callees.end ())
+ return;
+
+ callees.safe_push (node);
+
+ if (node->get_partitioning_class () == SYMBOL_PARTITION)
+ {
+ if (!node_partitioned_p (node))
+ {
+ add_node_to_partition (partition, node);
+ if (dump_file)
+ fprintf (dump_file, "Partitioned node: %s\n",
+ node->dump_asm_name ());
+ }
+ else if (cloning_model >= LTO_LOCALITY_NON_INTERPOSABLE_CLONING
+ && !node_in_partition_p (partition, node))
+ {
+ /* Non-inlined node, or alias, already partitioned
+ If cut-off, don't clone callees but partition unpartitioned
+ callees.
+ size is node + inlined nodes. */
+ if (clone_further_p)
+ {
+ if (!node->alias)
+ if (ipa_size_summaries->get (node)->size >= size)
+ clone_further_p = false;
+
+ if (freq_cutoff != 0.0)
+ {
+ sreal acc_freq = accumulate_incoming_edge_frequency (edge);
+ if (acc_freq.to_double () < freq_cutoff)
+ clone_further_p = false;
+ }
+ }
+
+ if (!suitable_for_locality_cloning_p (edge, cloning_model))
+ clone_further_p = false;
+
+ if (clone_further_p)
+ {
+ /* Try to clone NODE and its inline chain. */
+ if (dump_file)
+ fprintf (dump_file, "Cloning node: %s\n",
+ node->dump_asm_name ());
+ cl_node = clone_node_as_needed (edge, partition, cl_num,
+ cloning_model);
+ if (cl_node)
+ {
+ add_node_to_partition (partition, cl_node);
+ caller_node = cl_node;
+ }
+ else
+ caller_node = NULL;
+ }
+ }
+ }
+ else if (!node->inlined_to)
+ return;
+
+ if (caller_node)
+ for (cgraph_edge *e = caller_node->callees; e; e = e->next_callee)
+ partition_callchain (e, partition, clone_further_p, cloning_model,
+ freq_cutoff, size, cl_num);
+}
+
+/* Determine whether NODE is an entrypoint to a callchain. */
+
+static bool
+is_entry_node_p (cgraph_node *node)
+{
+ /* node->inlined_to is returned as SYMBOL_DUPLICATE. */
+ if (node->get_partitioning_class () != SYMBOL_PARTITION)
+ return false;
+
+ if (!node->callers)
+ return true;
+
+ for (cgraph_edge *e = node->callers; e; e = e->next_caller)
+ {
+ if (! e->recursive_p ())
+ return false;
+ }
+ if (node->alias
+ && !is_entry_node_p (node->ultimate_alias_target ()))
+ return false;
+ return true;
+}
+
+/* Determine order of all external nodes if PGO profile is available.
+ Store the order in ORDER. */
+
+static bool
+locality_determine_ipa_order (auto_vec<locality_order *> *order)
+{
+ struct cgraph_node *node;
+ auto_vec<locality_order *> non_comparable_nodes;
+ FOR_EACH_DEFINED_FUNCTION (node)
+ if (node->get_partitioning_class () == SYMBOL_PARTITION)
+ {
+ if (node->no_reorder)
+ {
+ if (dump_file)
+ fprintf (dump_file, "no reorder %s\n", node->dump_asm_name ());
+ return false;
+ }
+ else if (is_entry_node_p (node))
+ {
+ profile_count pcnt = node->count.ipa ();
+ if (!pcnt.initialized_p () || !pcnt.ipa_p ())
+ {
+ sreal cnt = 0;
+ locality_order *lo = new locality_order (node, cnt);
+ non_comparable_nodes.safe_push (lo);
+ continue;
+ }
+ sreal count = 0;
+ struct cgraph_edge *edge;
+ for (edge = node->callees; edge; edge = edge->next_callee)
+ {
+ /* For PGO, frequency is not used in
+ compare_edge_profile_counts (), it's used only as part of
+ static profile order. */
+ sreal freq = edge->sreal_frequency ();
+ count += freq;
+ }
+ locality_order *cl = new locality_order (node, count);
+ order->safe_push (cl);
+ }
+ }
+ order->qsort (compare_edge_profile_counts);
+ for (auto el : non_comparable_nodes)
+ order->safe_push (el);
+ return true;
+}
+
+/* Determine order of all external nodes if only static profile is available.
+ Store the order in ORDER. */
+
+static bool
+locality_determine_static_order (auto_vec<locality_order *> *order)
+{
+ struct cgraph_node *node;
+ FOR_EACH_DEFINED_FUNCTION (node)
+ if (node->get_partitioning_class () == SYMBOL_PARTITION)
+ {
+ if (node->no_reorder)
+ {
+ if (dump_file)
+ fprintf (dump_file, "no reorder %s\n", node->dump_asm_name ());
+ return false;
+ }
+ else if (is_entry_node_p (node))
+ {
+ sreal count = 0;
+ struct cgraph_edge *edge;
+ for (edge = node->callees; edge; edge = edge->next_callee)
+ {
+ sreal freq = edge->sreal_frequency ();
+ count += freq;
+ }
+ locality_order *cl = new locality_order (node, count);
+ order->safe_push (cl);
+ }
+ }
+ order->qsort (static_profile_cmp);
+ return true;
+}
+
+/* Partitioning for code locality.
+ 1. Create and sort callchains. If PGO is available, use real profile
+ counts. Otherwise, use a set of heuristics to sort the callchains.
+ 2. Partition the external nodes and their callchains in the determined order
+ 2.1. If !partition, partition, else try and clone if it satisfies cloning
+ criteria.
+ 3. Partition all other unpartitioned nodes. */
+
+static void
+locality_partition_and_clone (int max_locality_partition_size,
+ lto_locality_cloning_model cloning_model,
+ int freq_denominator, int size)
+{
+ locality_partition partition;
+ int npartitions = 0;
+
+ auto_vec<locality_order *> order;
+ auto_vec<varpool_node *> varpool_order;
+ struct cgraph_node *node;
+ bool order_p;
+
+ int cl_num = 0;
+
+ double real_freq = 0.0;
+ if (freq_denominator > 0)
+ real_freq = 1.0 / (double) freq_denominator;
+
+ cgraph_node *n = symtab->first_defined_function ();
+ if (n && n->count.ipa_p ())
+ order_p = locality_determine_ipa_order (&order);
+ else
+ order_p = locality_determine_static_order (&order);
+ if (!order_p)
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file, "Locality partition: falling back to balanced"
+ "model\n");
+ }
+
+ return;
+ }
+
+ int64_t partition_size
+ = max_locality_partition_size
+ ? max_locality_partition_size : param_max_partition_size;
+ partition = create_partition (npartitions);
+
+ for (unsigned i = 0; i < order.length (); i++)
+ {
+ node = order[i]->node;
+ if (node_partitioned_p (node))
+ continue;
+
+ if (partition->insns > partition_size)
+ partition = create_partition (npartitions);
+ if (dump_file)
+ fprintf (dump_file, "Partition id: %d\n", partition->part_id);
+
+ add_node_to_partition (partition, node);
+ if (dump_file)
+ fprintf (dump_file, "Ordered Node: %s\n", node->dump_asm_name ());
+
+ for (cgraph_edge *edge = node->callees; edge; edge = edge->next_callee)
+ {
+ /* Recursively partition the callchain of edge->callee. */
+ partition_callchain (edge, partition, true, cloning_model, real_freq,
+ size, cl_num);
+ }
+ }
+
+ for (unsigned i = 0; i < order.length (); i++)
+ delete order[i];
+ order = vNULL;
+}
+
+/* Entry point to locality-clone pass. */
+static int
+lc_execute (void)
+{
+ symtab_node *node;
+ FOR_EACH_SYMBOL (node)
+ node->aux = NULL;
+
+ locality_partition_and_clone (param_max_locality_partition_size,
+ flag_lto_locality_cloning,
+ param_lto_locality_frequency,
+ param_lto_locality_size);
+
+ FOR_EACH_SYMBOL (node)
+ node->aux = NULL;
+ return 0;
+}
+
+namespace {
+
+const pass_data pass_data_ipa_locality_clone = {
+ IPA_PASS, /* type */
+ "locality-clone", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ TV_IPA_LC, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ (TODO_dump_symtab | TODO_remove_functions), /* todo_flags_finish */
+};
+
+class pass_ipa_locality_cloning : public ipa_opt_pass_d
+{
+public:
+ pass_ipa_locality_cloning (gcc::context *ctxt)
+ : ipa_opt_pass_d (pass_data_ipa_locality_clone, ctxt,
+ NULL, /* generate_summary */
+ NULL, /* write_summary */
+ NULL, /* read_summary */
+ NULL, /* write_optimization_summary */
+ NULL, /* read_optimization_summary */
+ NULL, /* stmt_fixup */
+ 0, /* function_transform_todo_flags_start */
+ NULL, /* function_transform */
+ NULL) /* variable_transform */
+ {}
+
+ /* opt_pass methods: */
+ virtual bool gate (function *)
+ {
+ return (flag_wpa && flag_ipa_reorder_for_locality);
+ }
+
+ virtual unsigned int execute (function *) { return lc_execute (); }
+
+}; // class pass_ipa_locality_cloning
+
+} // namespace
+
+ipa_opt_pass_d *
+make_pass_ipa_locality_cloning (gcc::context *ctxt)
+{
+ return new pass_ipa_locality_cloning (ctxt);
+}
diff --git a/gcc/ipa-locality-cloning.h b/gcc/ipa-locality-cloning.h
new file mode 100644
index 0000000..591ce57
--- /dev/null
+++ b/gcc/ipa-locality-cloning.h
@@ -0,0 +1,35 @@
+/* LTO partitioning logic routines.
+ Copyright The GNU Toolchain Authors
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef IPA_LOCALITY_CLONING_H
+#define IPA_LOCALITY_CLONING_H
+
+/* Structure describing locality partitions. */
+struct locality_partition_def
+{
+ int part_id;
+ vec<cgraph_node *> nodes;
+ int insns;
+};
+
+typedef struct locality_partition_def *locality_partition;
+
+extern vec<locality_partition> locality_partitions;
+
+#endif /* IPA_LOCALITY_CLONING_H */
diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
index a120f94..0398d69 100644
--- a/gcc/ipa-prop.cc
+++ b/gcc/ipa-prop.cc
@@ -60,6 +60,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-range.h"
#include "value-range-storage.h"
#include "vr-values.h"
+#include "lto-streamer.h"
/* Function summary where the parameter infos are actually stored. */
ipa_node_params_t *ipa_node_params_sum = NULL;
@@ -454,7 +455,11 @@ ipa_dump_jump_function (FILE *f, ipa_jump_func *jump_func,
if (jump_func->value.pass_through.operation != NOP_EXPR)
{
fprintf (f, " ");
- print_generic_expr (f, jump_func->value.pass_through.operand);
+ if (jump_func->value.pass_through.operand)
+ print_generic_expr (f, jump_func->value.pass_through.operand);
+ fprintf (f, " (in type ");
+ print_generic_expr (f, jump_func->value.pass_through.op_type);
+ fprintf (f, ")");
}
if (jump_func->value.pass_through.agg_preserved)
fprintf (f, ", agg_preserved");
@@ -510,7 +515,11 @@ ipa_dump_jump_function (FILE *f, ipa_jump_func *jump_func,
if (item->value.pass_through.operation != NOP_EXPR)
{
fprintf (f, " ");
- print_generic_expr (f, item->value.pass_through.operand);
+ if (item->value.pass_through.operand)
+ print_generic_expr (f, item->value.pass_through.operand);
+ fprintf (f, " (in type ");
+ print_generic_expr (f, jump_func->value.pass_through.op_type);
+ fprintf (f, ")");
}
}
else if (item->jftype == IPA_JF_CONST)
@@ -682,6 +691,7 @@ ipa_set_jf_simple_pass_through (struct ipa_jump_func *jfunc, int formal_id,
{
jfunc->type = IPA_JF_PASS_THROUGH;
jfunc->value.pass_through.operand = NULL_TREE;
+ jfunc->value.pass_through.op_type = NULL_TREE;
jfunc->value.pass_through.formal_id = formal_id;
jfunc->value.pass_through.operation = NOP_EXPR;
jfunc->value.pass_through.agg_preserved = agg_preserved;
@@ -692,10 +702,11 @@ ipa_set_jf_simple_pass_through (struct ipa_jump_func *jfunc, int formal_id,
static void
ipa_set_jf_unary_pass_through (struct ipa_jump_func *jfunc, int formal_id,
- enum tree_code operation)
+ enum tree_code operation, tree op_type)
{
jfunc->type = IPA_JF_PASS_THROUGH;
jfunc->value.pass_through.operand = NULL_TREE;
+ jfunc->value.pass_through.op_type = op_type;
jfunc->value.pass_through.formal_id = formal_id;
jfunc->value.pass_through.operation = operation;
jfunc->value.pass_through.agg_preserved = false;
@@ -705,10 +716,12 @@ ipa_set_jf_unary_pass_through (struct ipa_jump_func *jfunc, int formal_id,
static void
ipa_set_jf_arith_pass_through (struct ipa_jump_func *jfunc, int formal_id,
- tree operand, enum tree_code operation)
+ tree operand, enum tree_code operation,
+ tree op_type)
{
jfunc->type = IPA_JF_PASS_THROUGH;
jfunc->value.pass_through.operand = unshare_expr_without_location (operand);
+ jfunc->value.pass_through.op_type = op_type;
jfunc->value.pass_through.formal_id = formal_id;
jfunc->value.pass_through.operation = operation;
jfunc->value.pass_through.agg_preserved = false;
@@ -1513,6 +1526,9 @@ compute_complex_assign_jump_func (struct ipa_func_body_info *fbi,
if (index >= 0)
{
+ if (lto_variably_modified_type_p (TREE_TYPE (name)))
+ return;
+
switch (gimple_assign_rhs_class (stmt))
{
case GIMPLE_BINARY_RHS:
@@ -1526,7 +1542,8 @@ compute_complex_assign_jump_func (struct ipa_func_body_info *fbi,
return;
ipa_set_jf_arith_pass_through (jfunc, index, op2,
- gimple_assign_rhs_code (stmt));
+ gimple_assign_rhs_code (stmt),
+ TREE_TYPE (name));
break;
}
case GIMPLE_SINGLE_RHS:
@@ -1539,7 +1556,8 @@ compute_complex_assign_jump_func (struct ipa_func_body_info *fbi,
case GIMPLE_UNARY_RHS:
if (!CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt)))
ipa_set_jf_unary_pass_through (jfunc, index,
- gimple_assign_rhs_code (stmt));
+ gimple_assign_rhs_code (stmt),
+ TREE_TYPE (name));
default:;
}
return;
@@ -1912,6 +1930,7 @@ analyze_agg_content_value (struct ipa_func_body_info *fbi,
if (!is_gimple_assign (stmt))
break;
+ lhs = gimple_assign_lhs (stmt);
rhs1 = gimple_assign_rhs1 (stmt);
}
@@ -1931,7 +1950,8 @@ analyze_agg_content_value (struct ipa_func_body_info *fbi,
PASS-THROUGH jump function with ASSERT_EXPR operation whith operand 1
(the constant from the PHI node). */
- if (gimple_phi_num_args (phi) != 2)
+ if (gimple_phi_num_args (phi) != 2
+ || lto_variably_modified_type_p (TREE_TYPE (lhs)))
return;
tree arg0 = gimple_phi_arg_def (phi, 0);
tree arg1 = gimple_phi_arg_def (phi, 1);
@@ -1956,6 +1976,7 @@ analyze_agg_content_value (struct ipa_func_body_info *fbi,
code = ASSERT_EXPR;
agg_value->pass_through.operand = operand;
+ agg_value->pass_through.op_type = TREE_TYPE (lhs);
}
else if (is_gimple_assign (stmt))
{
@@ -1980,10 +2001,12 @@ analyze_agg_content_value (struct ipa_func_body_info *fbi,
with one operand, here we only allow tc_unary operation to avoid
possible problem. Then we can use (opclass == tc_unary) or not to
distinguish unary and binary. */
- if (TREE_CODE_CLASS (code) != tcc_unary || CONVERT_EXPR_CODE_P (code))
+ if (TREE_CODE_CLASS (code) != tcc_unary || CONVERT_EXPR_CODE_P (code)
+ || lto_variably_modified_type_p (TREE_TYPE (lhs)))
return;
rhs1 = get_ssa_def_if_simple_copy (rhs1, &stmt);
+ agg_value->pass_through.op_type = TREE_TYPE (lhs);
break;
case GIMPLE_BINARY_RHS:
@@ -1992,12 +2015,16 @@ analyze_agg_content_value (struct ipa_func_body_info *fbi,
gimple *rhs2_stmt = stmt;
tree rhs2 = gimple_assign_rhs2 (stmt);
+ if (lto_variably_modified_type_p (TREE_TYPE (lhs)))
+ return;
+
rhs1 = get_ssa_def_if_simple_copy (rhs1, &rhs1_stmt);
rhs2 = get_ssa_def_if_simple_copy (rhs2, &rhs2_stmt);
if (is_gimple_ip_invariant (rhs2))
{
agg_value->pass_through.operand = rhs2;
+ agg_value->pass_through.op_type = TREE_TYPE (lhs);
stmt = rhs1_stmt;
}
else if (is_gimple_ip_invariant (rhs1))
@@ -2008,6 +2035,7 @@ analyze_agg_content_value (struct ipa_func_body_info *fbi,
return;
agg_value->pass_through.operand = rhs1;
+ agg_value->pass_through.op_type = TREE_TYPE (lhs);
stmt = rhs2_stmt;
rhs1 = rhs2;
}
@@ -3520,12 +3548,17 @@ update_jump_functions_after_inlining (struct cgraph_edge *cs,
ipa_set_jf_simple_pass_through (dst, formal_id, agg_p);
}
else if (TREE_CODE_CLASS (operation) == tcc_unary)
- ipa_set_jf_unary_pass_through (dst, formal_id, operation);
+ {
+ tree op_t = ipa_get_jf_pass_through_op_type (src);
+ ipa_set_jf_unary_pass_through (dst, formal_id, operation,
+ op_t);
+ }
else
{
tree operand = ipa_get_jf_pass_through_operand (src);
+ tree op_t = ipa_get_jf_pass_through_op_type (src);
ipa_set_jf_arith_pass_through (dst, formal_id, operand,
- operation);
+ operation, op_t);
}
break;
}
@@ -4935,9 +4968,13 @@ ipa_write_jump_function (struct output_block *ob,
}
else if (TREE_CODE_CLASS (jump_func->value.pass_through.operation)
== tcc_unary)
- streamer_write_uhwi (ob, jump_func->value.pass_through.formal_id);
+ {
+ stream_write_tree (ob, jump_func->value.pass_through.op_type, true);
+ streamer_write_uhwi (ob, jump_func->value.pass_through.formal_id);
+ }
else
{
+ stream_write_tree (ob, jump_func->value.pass_through.op_type, true);
stream_write_tree (ob, jump_func->value.pass_through.operand, true);
streamer_write_uhwi (ob, jump_func->value.pass_through.formal_id);
}
@@ -4979,6 +5016,8 @@ ipa_write_jump_function (struct output_block *ob,
case IPA_JF_LOAD_AGG:
streamer_write_uhwi (ob, item->value.pass_through.operation);
streamer_write_uhwi (ob, item->value.pass_through.formal_id);
+ if (item->value.pass_through.operation != NOP_EXPR)
+ stream_write_tree (ob, item->value.pass_through.op_type, true);
if (TREE_CODE_CLASS (item->value.pass_through.operation)
!= tcc_unary)
stream_write_tree (ob, item->value.pass_through.operand, true);
@@ -5047,15 +5086,18 @@ ipa_read_jump_function (class lto_input_block *ib,
}
else if (TREE_CODE_CLASS (operation) == tcc_unary)
{
+ tree op_type = stream_read_tree (ib, data_in);
int formal_id = streamer_read_uhwi (ib);
- ipa_set_jf_unary_pass_through (jump_func, formal_id, operation);
+ ipa_set_jf_unary_pass_through (jump_func, formal_id, operation,
+ op_type);
}
else
{
+ tree op_type = stream_read_tree (ib, data_in);
tree operand = stream_read_tree (ib, data_in);
int formal_id = streamer_read_uhwi (ib);
ipa_set_jf_arith_pass_through (jump_func, formal_id, operand,
- operation);
+ operation, op_type);
}
break;
case IPA_JF_ANCESTOR:
@@ -5103,6 +5145,10 @@ ipa_read_jump_function (class lto_input_block *ib,
operation = (enum tree_code) streamer_read_uhwi (ib);
item.value.pass_through.operation = operation;
item.value.pass_through.formal_id = streamer_read_uhwi (ib);
+ if (operation != NOP_EXPR)
+ item.value.pass_through.op_type = stream_read_tree (ib, data_in);
+ else
+ item.value.pass_through.op_type = NULL_TREE;
if (TREE_CODE_CLASS (operation) == tcc_unary)
item.value.pass_through.operand = NULL_TREE;
else
@@ -5393,6 +5439,49 @@ ipa_read_node_info (class lto_input_block *ib, struct cgraph_node *node,
}
}
+/* Stream out ipa_return_summary. */
+static void
+ipa_write_return_summaries (output_block *ob)
+{
+ if (!ipa_return_value_sum)
+ {
+ streamer_write_uhwi (ob, 0);
+ return;
+ }
+
+ lto_symtab_encoder_t encoder = ob->decl_state->symtab_node_encoder;
+ unsigned int count = 0;
+ for (int i = 0; i < lto_symtab_encoder_size (encoder); i++)
+ {
+ symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
+ cgraph_node *cnode = dyn_cast <cgraph_node *> (snode);
+ ipa_return_value_summary *v;
+
+ if (cnode && cnode->definition && !cnode->alias
+ && (v = ipa_return_value_sum->get (cnode))
+ && v->vr)
+ count++;
+ }
+ streamer_write_uhwi (ob, count);
+
+ for (int i = 0; i < lto_symtab_encoder_size (encoder); i++)
+ {
+ symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
+ cgraph_node *cnode = dyn_cast <cgraph_node *> (snode);
+ ipa_return_value_summary *v;
+
+ if (cnode && cnode->definition && !cnode->alias
+ && (v = ipa_return_value_sum->get (cnode))
+ && v->vr)
+ {
+ streamer_write_uhwi
+ (ob,
+ lto_symtab_encoder_encode (encoder, cnode));
+ v->vr->streamer_write (ob);
+ }
+ }
+}
+
/* Write jump functions for nodes in SET. */
void
@@ -5429,11 +5518,58 @@ ipa_prop_write_jump_functions (void)
&& ipa_node_params_sum->get (node) != NULL)
ipa_write_node_info (ob, node);
}
- streamer_write_char_stream (ob->main_stream, 0);
+ ipa_write_return_summaries (ob);
produce_asm (ob);
destroy_output_block (ob);
}
+/* Record that return value range of N is VAL. */
+
+static void
+ipa_record_return_value_range_1 (cgraph_node *n, value_range val)
+{
+ if (!ipa_return_value_sum)
+ {
+ if (!ipa_vr_hash_table)
+ ipa_vr_hash_table = hash_table<ipa_vr_ggc_hash_traits>::create_ggc (37);
+ ipa_return_value_sum = new (ggc_alloc_no_dtor <ipa_return_value_sum_t> ())
+ ipa_return_value_sum_t (symtab, true);
+ ipa_return_value_sum->disable_insertion_hook ();
+ }
+ ipa_return_value_sum->get_create (n)->vr = ipa_get_value_range (val);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Recording return range of %s:", n->dump_name ());
+ val.dump (dump_file);
+ fprintf (dump_file, "\n");
+ }
+}
+
+/* Stream out ipa_return_summary. */
+static void
+ipa_read_return_summaries (lto_input_block *ib,
+ struct lto_file_decl_data *file_data,
+ class data_in *data_in)
+{
+ unsigned int f_count = streamer_read_uhwi (ib);
+ for (unsigned int i = 0; i < f_count; i++)
+ {
+ unsigned int index = streamer_read_uhwi (ib);
+ lto_symtab_encoder_t encoder = file_data->symtab_node_encoder;
+ struct cgraph_node *node
+ = dyn_cast <cgraph_node *>
+ (lto_symtab_encoder_deref (encoder, index));
+ ipa_vr rvr;
+ rvr.streamer_read (ib, data_in);
+ if (node->prevailing_p ())
+ {
+ value_range tmp;
+ rvr.get_vrange (tmp);
+ ipa_record_return_value_range_1 (node, tmp);
+ }
+ }
+}
+
/* Read section in file FILE_DATA of length LEN with data DATA. */
static void
@@ -5470,6 +5606,7 @@ ipa_prop_read_section (struct lto_file_decl_data *file_data, const char *data,
gcc_assert (node->definition);
ipa_read_node_info (&ib_main, node, data_in);
}
+ ipa_read_return_summaries (&ib_main, file_data, data_in);
lto_free_section_data (file_data, LTO_section_jump_functions, NULL, data,
len);
lto_data_in_delete (data_in);
@@ -5589,6 +5726,7 @@ read_ipcp_transformation_info (lto_input_block *ib, cgraph_node *node,
}
}
+
/* Write all aggregate replacement for nodes in set. */
void
@@ -5627,7 +5765,7 @@ ipcp_write_transformation_summaries (void)
&& lto_symtab_encoder_encode_body_p (encoder, cnode))
write_ipcp_transformation_info (ob, cnode, ts);
}
- streamer_write_char_stream (ob->main_stream, 0);
+ ipa_write_return_summaries (ob);
produce_asm (ob);
destroy_output_block (ob);
}
@@ -5668,6 +5806,7 @@ read_replacements_section (struct lto_file_decl_data *file_data,
index));
read_ipcp_transformation_info (&ib_main, node, data_in);
}
+ ipa_read_return_summaries (&ib_main, file_data, data_in);
lto_free_section_data (file_data, LTO_section_jump_functions, NULL, data,
len);
lto_data_in_delete (data_in);
@@ -6148,22 +6287,8 @@ ipcp_transform_function (struct cgraph_node *node)
void
ipa_record_return_value_range (value_range val)
{
- cgraph_node *n = cgraph_node::get (current_function_decl);
- if (!ipa_return_value_sum)
- {
- if (!ipa_vr_hash_table)
- ipa_vr_hash_table = hash_table<ipa_vr_ggc_hash_traits>::create_ggc (37);
- ipa_return_value_sum = new (ggc_alloc_no_dtor <ipa_return_value_sum_t> ())
- ipa_return_value_sum_t (symtab, true);
- ipa_return_value_sum->disable_insertion_hook ();
- }
- ipa_return_value_sum->get_create (n)->vr = ipa_get_value_range (val);
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "Recording return range ");
- val.dump (dump_file);
- fprintf (dump_file, "\n");
- }
+ ipa_record_return_value_range_1
+ (cgraph_node::get (current_function_decl), val);
}
/* Return true if value range of DECL is known and if so initialize RANGE. */
@@ -6224,6 +6349,10 @@ ipa_agg_pass_through_jf_equivalent_p (ipa_pass_through_data *ipt1,
|| ipt1->formal_id != ipt2->formal_id
|| (!agg_jf && (ipt1->agg_preserved != ipt2->agg_preserved)))
return false;
+ if (ipt1->operation != NOP_EXPR
+ && (TYPE_MAIN_VARIANT (ipt1->op_type)
+ != TYPE_MAIN_VARIANT (ipt2->op_type)))
+ return false;
if (((ipt1->operand != NULL_TREE) != (ipt2->operand != NULL_TREE))
|| (ipt1->operand
&& !values_equal_for_ipcp_p (ipt1->operand, ipt2->operand)))
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 7735b57..3bd442f 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -96,6 +96,9 @@ struct GTY(()) ipa_pass_through_data
/* If an operation is to be performed on the original parameter, this is the
second (constant) operand. */
tree operand;
+ /* The result type of the operation. In case of no operation (represented by
+ NOP_EXPR) it should be NULL_TREE. */
+ tree op_type;
/* Number of the caller's formal parameter being passed. */
int formal_id;
/* Operation that is performed on the argument before it is passed on.
@@ -387,6 +390,18 @@ ipa_get_jf_pass_through_operand (struct ipa_jump_func *jfunc)
return jfunc->value.pass_through.operand;
}
+/* Return the type of the operation in a non-NOP pass through jmp function
+ JFUNC. */
+
+inline tree
+ipa_get_jf_pass_through_op_type (struct ipa_jump_func *jfunc)
+{
+ gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH
+ && jfunc->value.pass_through.operation != NOP_EXPR);
+
+ return jfunc->value.pass_through.op_type;
+}
+
/* Return the number of the caller's formal parameter that a pass through jump
function JFUNC refers to. */
diff --git a/gcc/lto-cgraph.cc b/gcc/lto-cgraph.cc
index ac835a4..8439c51 100644
--- a/gcc/lto-cgraph.cc
+++ b/gcc/lto-cgraph.cc
@@ -229,6 +229,8 @@ lto_set_symtab_encoder_in_partition (lto_symtab_encoder_t encoder,
symtab_node *node)
{
int index = lto_symtab_encoder_encode (encoder, node);
+ if (dump_file)
+ fprintf(dump_file, "Node %s, index %d\n", node->asm_name(), index);
encoder->nodes[index].in_partition = true;
}
diff --git a/gcc/lto-streamer-out.cc b/gcc/lto-streamer-out.cc
index d5b6ee7..a055d12d 100644
--- a/gcc/lto-streamer-out.cc
+++ b/gcc/lto-streamer-out.cc
@@ -130,7 +130,7 @@ destroy_output_block (struct output_block *ob)
/* Wrapper around variably_modified_type_p avoiding type modification
during WPA streaming. */
-static bool
+bool
lto_variably_modified_type_p (tree type)
{
return (in_lto_p
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index ff33bf0..4b7209e3 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -906,6 +906,7 @@ void lto_output_decl_state_streams (struct output_block *,
void lto_output_decl_state_refs (struct output_block *,
struct lto_output_stream *,
struct lto_out_decl_state *);
+bool lto_variably_modified_type_p (tree);
void lto_output_location (struct output_block *, struct bitpack_d *,
location_t);
void lto_output_location_and_block (struct output_block *, struct bitpack_d *,
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index ee53915..4da9ca3 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,13 @@
+2025-04-15 Kyrylo Tkachov <ktkachov@nvidia.com>
+
+ * lto-partition.cc (add_node_references_to_partition): Define.
+ (create_partition): Likewise.
+ (lto_locality_map): Likewise.
+ (lto_promote_cross_file_statics): Add extra dumping.
+ * lto-partition.h (lto_locality_map): Declare prototype.
+ * lto.cc (do_whole_program_analysis): Handle
+ flag_ipa_reorder_for_locality.
+
2025-02-28 Richard Biener <rguenther@suse.de>
PR lto/91299
diff --git a/gcc/lto/lto-partition.cc b/gcc/lto/lto-partition.cc
index 3046951..c7e69ee 100644
--- a/gcc/lto/lto-partition.cc
+++ b/gcc/lto/lto-partition.cc
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-prop.h"
#include "ipa-fnsummary.h"
#include "lto-partition.h"
+#include "ipa-locality-cloning.h"
#include <limits>
@@ -1418,6 +1419,126 @@ lto_balanced_map (int n_lto_partitions, int max_partition_size)
}
}
+/* Add all references of NODE into PARTITION. */
+
+static void
+add_node_references_to_partition (ltrans_partition partition, symtab_node *node)
+{
+ struct ipa_ref *ref = NULL;
+ varpool_node *vnode;
+ for (int j = 0; node->iterate_reference (j, ref); j++)
+ if (is_a <varpool_node *> (ref->referred))
+ {
+ vnode = dyn_cast <varpool_node *> (ref->referred);
+ if (!symbol_partitioned_p (vnode)
+ && !vnode->no_reorder
+ && vnode->get_partitioning_class () == SYMBOL_PARTITION)
+ {
+ add_symbol_to_partition (partition, vnode);
+ if (dump_file)
+ fprintf (dump_file, "Varpool Node: %s\n", vnode->dump_asm_name ());
+ add_node_references_to_partition (partition, vnode);
+ }
+ }
+
+ for (int j = 0; node->iterate_referring (j, ref); j++)
+ if (is_a <varpool_node *> (ref->referring))
+ {
+ vnode = dyn_cast <varpool_node *> (ref->referring);
+ gcc_assert (vnode->definition);
+ if (!symbol_partitioned_p (vnode)
+ && !vnode->no_reorder
+ && !vnode->can_remove_if_no_refs_p ()
+ && vnode->get_partitioning_class () == SYMBOL_PARTITION)
+ {
+ add_symbol_to_partition (partition, vnode);
+ if (dump_file)
+ fprintf (dump_file, "Varpool Node: %s\n", vnode->dump_asm_name ());
+ add_node_references_to_partition (partition, vnode);
+ }
+ }
+ if (cgraph_node *cnode = dyn_cast <cgraph_node *> (node))
+ {
+ struct cgraph_edge *e;
+
+ /* Add all inline clones and callees that are duplicated. */
+ for (e = cnode->callees; e; e = e->next_callee)
+ if (e->callee->get_partitioning_class () == SYMBOL_DUPLICATE)
+ add_node_references_to_partition (partition, e->callee);
+
+ /* Add all thunks associated with the function. */
+ for (e = cnode->callers; e; e = e->next_caller)
+ if (e->caller->thunk && !e->caller->inlined_to)
+ add_node_references_to_partition (partition, e->caller);
+ }
+
+}
+
+/* Create and return the created partition of name NAME. */
+
+static ltrans_partition
+create_partition (int &npartitions, const char *name)
+{
+ npartitions++;
+ return new_partition (name);
+}
+
+/* Partitioning for code locality.
+ The partitioning plan (and prerequisite cloning) will have been done by the
+ IPA locality cloning pass. This function just implements that plan by
+ assigning those partitions to ltrans_parititions. */
+
+void
+lto_locality_map (int max_partition_size)
+{
+ symtab_node *snode;
+ int npartitions = 0;
+
+ auto_vec<varpool_node *> varpool_order;
+ struct cgraph_node *node;
+
+ if (locality_partitions.length () == 0)
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file, "Locality partition: falling back to balanced "
+ "model\n");
+ }
+ lto_balanced_map (param_lto_partitions, param_max_partition_size);
+ return;
+ }
+ ltrans_partition partition = nullptr;
+ for (auto part : locality_partitions)
+ {
+ partition = create_partition (npartitions, "");
+ for (unsigned j = 0; j < part->nodes.length (); j++)
+ {
+ node = part->nodes[j];
+ if (symbol_partitioned_p (node))
+ continue;
+
+ add_symbol_to_partition (partition, node);
+ add_node_references_to_partition (partition, node);
+ }
+ }
+
+ int64_t partition_size = max_partition_size;
+ /* All other unpartitioned symbols. */
+ FOR_EACH_SYMBOL (snode)
+ {
+ if (snode->get_partitioning_class () == SYMBOL_PARTITION
+ && !symbol_partitioned_p (snode))
+ {
+ if (partition->insns > partition_size)
+ partition = create_partition (npartitions, "");
+
+ add_symbol_to_partition (partition, snode);
+ if (dump_file)
+ fprintf (dump_file, "Un-ordered Node: %s\n", snode->dump_asm_name ());
+ }
+ }
+}
+
/* Return true if we must not change the name of the NODE. The name as
extracted from the corresponding decl should be passed in NAME. */
@@ -1732,7 +1853,12 @@ lto_promote_cross_file_statics (void)
{
ltrans_partition part
= ltrans_partitions[i];
+ if (dump_file)
+ fprintf (dump_file, "lto_promote_cross_file_statics for part %s %p\n",
+ part->name, (void *)part->encoder);
part->encoder = compute_ltrans_boundary (part->encoder);
+ if (dump_file)
+ fprintf (dump_file, "new encoder %p\n", (void *)part->encoder);
}
lto_clone_numbers = new hash_map<const char *, unsigned>;
diff --git a/gcc/lto/lto-partition.h b/gcc/lto/lto-partition.h
index 38b3f1e..a6a4195 100644
--- a/gcc/lto/lto-partition.h
+++ b/gcc/lto/lto-partition.h
@@ -37,6 +37,7 @@ void lto_1_to_1_map (void);
void lto_max_map (void);
void lto_cache_map (int, int);
void lto_balanced_map (int, int);
+void lto_locality_map (int);
void lto_promote_cross_file_statics (void);
void free_ltrans_partitions (void);
void lto_promote_statics_nonwpa (void);
diff --git a/gcc/lto/lto.cc b/gcc/lto/lto.cc
index 18ca475..183634f 100644
--- a/gcc/lto/lto.cc
+++ b/gcc/lto/lto.cc
@@ -547,7 +547,9 @@ do_whole_program_analysis (void)
symtab_node::checking_verify_symtab_nodes ();
bitmap_obstack_release (NULL);
- if (flag_lto_partition == LTO_PARTITION_1TO1)
+ if (flag_ipa_reorder_for_locality)
+ lto_locality_map (param_max_locality_partition_size);
+ else if (flag_lto_partition == LTO_PARTITION_1TO1)
lto_1_to_1_map ();
else if (flag_lto_partition == LTO_PARTITION_MAX)
lto_max_map ();
diff --git a/gcc/m2/ChangeLog b/gcc/m2/ChangeLog
index 234578d..eeb5f66 100644
--- a/gcc/m2/ChangeLog
+++ b/gcc/m2/ChangeLog
@@ -1,3 +1,22 @@
+2025-04-11 Gaius Mulley <gaiusmod2@gmail.com>
+
+ PR modula2/119735
+ * gm2-compiler/M2MetaError.def: Hide %n from comment.
+ * gm2-compiler/SymbolTable.def (PutIncludedByDefinition): Remove '
+ from comment.
+ * gm2-gcc/m2expr.def (init): Ditto.
+ * gm2-libiberty/pexecute.def: Ditto.
+ * gm2-libs-coroutines/Executive.def (InitSemaphore): Ditto.
+ (Wait): Ditto.
+ * gm2-libs-iso/ClientSocket.def: Ditto.
+ * gm2-libs-log/BlockOps.def (BlockMoveBackward): Ditto.
+ * gm2-libs-log/InOut.def: Ditto.
+ * mc/mcFileName.def: Ditto.
+
+2025-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ * gm2-compiler/M2MetaError.def: Fix comment typo, range" -> "range2".
+
2025-03-30 Sandra Loosemore <sloosemore@baylibre.com>
* lang.opt.urls: Regenerate.
diff --git a/gcc/m2/gm2-compiler/M2MetaError.def b/gcc/m2/gm2-compiler/M2MetaError.def
index 92c4ad2..cfe9195 100644
--- a/gcc/m2/gm2-compiler/M2MetaError.def
+++ b/gcc/m2/gm2-compiler/M2MetaError.def
@@ -73,7 +73,8 @@ FROM NameKey IMPORT Name ;
{%kword} the string word is unquoted and rendered as a keyword.
{%C} chain this error on the previous rooted error.
{%R} this error will be the root of the future chained errors.
- {%n} decimal number. Not quoted.
+ {% n} decimal number. Not quoted. There is no space between the
+ % and n (this has been added to hide this comment from gettext).
{%N} count (number), for example, 1st, 2nd, 3rd, 4th. Not quoted.
{%X} push contents of the output string onto the string stack.
{%Yname} place contents of dictionary entry name onto the output string.
diff --git a/gcc/m2/gm2-compiler/SymbolTable.def b/gcc/m2/gm2-compiler/SymbolTable.def
index d9d4c87..85a3672 100644
--- a/gcc/m2/gm2-compiler/SymbolTable.def
+++ b/gcc/m2/gm2-compiler/SymbolTable.def
@@ -2025,7 +2025,7 @@ PROCEDURE PutIncludedByDefinition (Sym: CARDINAL) ;
(*
IsIncludedByDefinition - returns TRUE if definition module symbol, Sym, was included
- by ModSym's definition module.
+ by ModSyms definition module.
*)
PROCEDURE IsIncludedByDefinition (ModSym, Sym: CARDINAL) : BOOLEAN ;
diff --git a/gcc/m2/gm2-gcc/m2expr.def b/gcc/m2/gm2-gcc/m2expr.def
index e9f48b8..a9f5f37 100644
--- a/gcc/m2/gm2-gcc/m2expr.def
+++ b/gcc/m2/gm2-gcc/m2expr.def
@@ -45,7 +45,7 @@ PROCEDURE init (location: location_t) ;
(*
CSTIntToString - return an integer string using base 10 and no padding.
- The string returned will have been malloc'd.
+ The string returned will have been mallocd.
*)
PROCEDURE CSTIntToString (t: tree) : CharStar ;
diff --git a/gcc/m2/gm2-libiberty/pexecute.def b/gcc/m2/gm2-libiberty/pexecute.def
index 30a41e1..49af52c 100644
--- a/gcc/m2/gm2-libiberty/pexecute.def
+++ b/gcc/m2/gm2-libiberty/pexecute.def
@@ -31,16 +31,16 @@ EXPORT UNQUALIFIED pexecute ;
THIS_PNAME is name of the calling program (i.e. argv[0]).
TEMP_BASE is the path name, sans suffix, of a temporary file to use
- if needed. This is currently only needed for MSDOS ports that don't use
- GO32 (do any still exist?). Ports that don't need it can pass NULL.
+ if needed. This is currently only needed for MSDOS ports that dont use
+ GO32 (do any still exist?). Ports that dont need it can pass NULL.
(FLAGS & PEXECUTE_SEARCH) is non-zero if $PATH should be searched
- (??? It's not clear that GCC passes this flag correctly).
+ (??? Its not clear that GCC passes this flag correctly).
(FLAGS & PEXECUTE_FIRST) is nonzero for the first process in chain.
(FLAGS & PEXECUTE_FIRST) is nonzero for the last process in chain.
FIRST_LAST could be simplified to only mark the last of a chain of processes
but that requires the caller to always mark the last one (and not give up
- early if some error occurs). It's more robust to require the caller to
+ early if some error occurs). Its more robust to require the caller to
mark both ends of the chain.
The result is the pid on systems like Unix where we fork/exec and on systems
@@ -52,20 +52,20 @@ EXPORT UNQUALIFIED pexecute ;
Upon failure, ERRMSG_FMT and ERRMSG_ARG are set to the text of the error
message with an optional argument (if not needed, ERRMSG_ARG is set to
- NULL), and -1 is returned. `errno' is available to the caller to use.
+ NULL), and -1 is returned. errno is available to the caller to use.
pwait: cover function for wait.
PID is the process id of the task to wait for.
- STATUS is the `status' argument to wait.
+ STATUS is the status argument to wait.
FLAGS is currently unused (allows future enhancement without breaking
upward compatibility). Pass 0 for now.
The result is the pid of the child reaped,
or -1 for failure (errno says why).
- On systems that don't support waiting for a particular child, PID is
- ignored. On systems like MSDOS that don't really multitask pwait
+ On systems that dont support waiting for a particular child, PID is
+ ignored. On systems like MSDOS that dont really multitask pwait
is just a mechanism to provide a consistent interface for the caller.
pfinish: finish generation of script
diff --git a/gcc/m2/gm2-libs-coroutines/Executive.def b/gcc/m2/gm2-libs-coroutines/Executive.def
index 40eb8f1..f21a066 100644
--- a/gcc/m2/gm2-libs-coroutines/Executive.def
+++ b/gcc/m2/gm2-libs-coroutines/Executive.def
@@ -32,7 +32,7 @@ EXPORT QUALIFIED SEMAPHORE, DESCRIPTOR,
RotateRunQueue, ProcessName, DebugProcess ;
TYPE
- SEMAPHORE ; (* defines Dijkstra's semaphores *)
+ SEMAPHORE ; (* defines Dijkstras semaphores *)
DESCRIPTOR ; (* handle onto a process *)
@@ -85,7 +85,7 @@ PROCEDURE InitSemaphore (v: CARDINAL; Name: ARRAY OF CHAR) : SEMAPHORE ;
(*
- Wait - performs dijkstra's P operation on a semaphore.
+ Wait - performs dijkstras P operation on a semaphore.
A process which calls this procedure will
wait until the value of the semaphore is > 0
and then it will decrement this value.
@@ -95,7 +95,7 @@ PROCEDURE Wait (s: SEMAPHORE) ;
(*
- Signal - performs dijkstra's V operation on a semaphore.
+ Signal - performs dijkstras V operation on a semaphore.
A process which calls the procedure will increment
the semaphores value.
*)
diff --git a/gcc/m2/gm2-libs-iso/ClientSocket.def b/gcc/m2/gm2-libs-iso/ClientSocket.def
index 293b53a..98aefc6 100644
--- a/gcc/m2/gm2-libs-iso/ClientSocket.def
+++ b/gcc/m2/gm2-libs-iso/ClientSocket.def
@@ -1,4 +1,4 @@
-(* ClientSocket.def provides a client TCP interface for ChanId's.
+(* ClientSocket.def provides a client TCP interface for ChanIds.
Copyright (C) 2008-2025 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
diff --git a/gcc/m2/gm2-libs-log/BlockOps.def b/gcc/m2/gm2-libs-log/BlockOps.def
index 2978920..b770acc 100644
--- a/gcc/m2/gm2-libs-log/BlockOps.def
+++ b/gcc/m2/gm2-libs-log/BlockOps.def
@@ -50,7 +50,7 @@ PROCEDURE BlockMoveBackward (dest, src: ADDRESS; n: CARDINAL) ;
(*
- BlockClear - fills, block..block+n-1, with zero's.
+ BlockClear - fills, block..block+n-1, with zeros.
*)
PROCEDURE BlockClear (block: ADDRESS; n: CARDINAL) ;
diff --git a/gcc/m2/gm2-libs-log/InOut.def b/gcc/m2/gm2-libs-log/InOut.def
index 9335d0a..f2294e9 100644
--- a/gcc/m2/gm2-libs-log/InOut.def
+++ b/gcc/m2/gm2-libs-log/InOut.def
@@ -45,7 +45,7 @@ VAR
(*
OpenInput - reads a string from stdin as the filename for reading.
- If the filename ends with `.' then it appends the defext
+ If the filename ends with '.' then it appends the defext
extension. The global variable Done is set if all
was successful.
*)
@@ -63,7 +63,7 @@ PROCEDURE CloseInput ;
(*
OpenOutput - reads a string from stdin as the filename for writing.
- If the filename ends with `.' then it appends the defext
+ If the filename ends with '.' then it appends the defext
extension. The global variable Done is set if all
was successful.
*)
diff --git a/gcc/m2/mc/mcFileName.def b/gcc/m2/mc/mcFileName.def
index da9db60..7768c2f 100644
--- a/gcc/m2/mc/mcFileName.def
+++ b/gcc/m2/mc/mcFileName.def
@@ -29,7 +29,7 @@ FROM DynamicStrings IMPORT String ;
given a module and an extension. This file name
length will be operating system specific.
String, Extension, is concatenated onto
- Module and thus it is safe to `Mark' the extension
+ Module and thus it is safe to Mark the extension
for garbage collection.
*)
diff --git a/gcc/opts.cc b/gcc/opts.cc
index 80c7a97..5e7b77d 100644
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
@@ -1037,6 +1037,25 @@ report_conflicting_sanitizer_options (struct gcc_options *opts, location_t loc,
}
}
+/* Validate from OPTS and OPTS_SET that when -fipa-reorder-for-locality is
+ enabled no explicit -flto-partition is also passed as the locality cloning
+ pass uses its own partitioning scheme. */
+
+static void
+validate_ipa_reorder_locality_lto_partition (struct gcc_options *opts,
+ struct gcc_options *opts_set)
+{
+ static bool validated_p = false;
+
+ if (opts->x_flag_lto_partition != LTO_PARTITION_DEFAULT)
+ {
+ if (opts_set->x_flag_ipa_reorder_for_locality && !validated_p)
+ error ("%<-fipa-reorder-for-locality%> is incompatible with"
+ " an explicit %qs option", "-flto-partition");
+ }
+ validated_p = true;
+}
+
/* After all options at LOC have been read into OPTS and OPTS_SET,
finalize settings of those options and diagnose incompatible
combinations. */
@@ -1249,6 +1268,10 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
if (opts->x_flag_reorder_blocks_and_partition)
SET_OPTION_IF_UNSET (opts, opts_set, flag_reorder_functions, 1);
+ validate_ipa_reorder_locality_lto_partition (opts, opts_set);
+ if (opts_set->x_flag_lto_partition != LTO_PARTITION_DEFAULT)
+ opts_set->x_flag_lto_partition = opts->x_flag_lto_partition = LTO_PARTITION_BALANCED;
+
/* The -gsplit-dwarf option requires -ggnu-pubnames. */
if (opts->x_dwarf_split_debug_info)
opts->x_debug_generate_pub_sections = 2;
diff --git a/gcc/params.opt b/gcc/params.opt
index 422d082..a2b606f 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -469,6 +469,33 @@ Minimal size of a partition for LTO (in estimated instructions).
Common Joined UInteger Var(param_lto_partitions) Init(128) IntegerRange(1, 65536) Param
Number of partitions the program should be split to.
+Enum
+Name(lto_locality_cloning_model) Type(enum lto_locality_cloning_model) UnknownError(unknown LTO partitioning model %qs)
+
+EnumValue
+Enum(lto_locality_cloning_model) String(no) Value(LTO_LOCALITY_NO_CLONING)
+
+EnumValue
+Enum(lto_locality_cloning_model) String(non_interposable) Value(LTO_LOCALITY_NON_INTERPOSABLE_CLONING)
+
+EnumValue
+Enum(lto_locality_cloning_model) String(maximal) Value(LTO_LOCALITY_MAXIMAL_CLONING)
+
+-param=lto-partition-locality-cloning=
+Common Joined RejectNegative Enum(lto_locality_cloning_model) Var(flag_lto_locality_cloning) Init(LTO_LOCALITY_MAXIMAL_CLONING) Optimization
+
+-param=lto-partition-locality-frequency-cutoff=
+Common Joined UInteger Var(param_lto_locality_frequency) Init(1) IntegerRange(0, 65536) Param Optimization
+The denominator n of fraction 1/n of the execution frequency of callee to be cloned for a particular caller. Special value of 0 dictates to always clone without a cut-off.
+
+-param=lto-partition-locality-size-cutoff=
+Common Joined UInteger Var(param_lto_locality_size) Init(1000) IntegerRange(1, 65536) Param Optimization
+Size cut-off for callee including inlined calls to be cloned for a particular caller.
+
+-param=lto-max-locality-partition=
+Common Joined UInteger Var(param_max_locality_partition_size) Init(1000000) Param
+Maximal size of a locality partition for LTO (in estimated instructions). Value of 0 results in default value being used.
+
-param=max-average-unrolled-insns=
Common Joined UInteger Var(param_max_average_unrolled_insns) Init(80) Param Optimization
The maximum number of instructions to consider to unroll in a loop on average.
diff --git a/gcc/passes.def b/gcc/passes.def
index 9fd85a3..3b25105 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -162,6 +162,7 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_ipa_sra);
NEXT_PASS (pass_ipa_fn_summary);
NEXT_PASS (pass_ipa_inline);
+ NEXT_PASS (pass_ipa_locality_cloning);
NEXT_PASS (pass_ipa_pure_const);
NEXT_PASS (pass_ipa_modref);
NEXT_PASS (pass_ipa_free_fn_summary, false /* small_p */);
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index a3ea29f..b1537f7 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,13 @@
+2025-04-09 Joseph Myers <josmyers@redhat.com>
+
+ * de.po: Update.
+
+2025-04-09 Joseph Myers <josmyers@redhat.com>
+
+ * be.po, da.po, de.po, el.po, es.po, fi.po, fr.po, hr.po, id.po,
+ ja.po, ka.po, nl.po, ru.po, sr.po, sv.po, tr.po, uk.po, vi.po,
+ zh_CN.po, zh_TW.po: Update.
+
2025-04-07 Joseph Myers <josmyers@redhat.com>
* sv.po: Update.
diff --git a/gcc/rust/ChangeLog b/gcc/rust/ChangeLog
index 64053d4..453b9f7 100644
--- a/gcc/rust/ChangeLog
+++ b/gcc/rust/ChangeLog
@@ -1,3 +1,162 @@
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * util/rust-lang-item.h: Add new manually_drop lang item.
+ * util/rust-lang-item.cc: Likewise.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * util/rust-attribute-values.h: Add RUSTFMT value.
+ * util/rust-attributes.cc: Define the attribute.
+ * util/rust-attributes.h (enum CompilerPass): Add EXTERNAL variant.
+ * expand/rust-macro-builtins.cc: Fix formatting.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes): Remove assertion.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * util/rust-attribute-values.h: Add missing attributes.
+ * util/rust-attributes.cc: Likewise.
+ * util/rust-attributes.h (enum CompilerPass): Mention adding something for const
+ functions.
+
+2025-04-14 beamandala <mandalapubhavesh@gmail.com>
+
+ * expand/rust-macro-builtins.cc (MacroBuiltin::builtin_transcribers):
+ Add entry for track_caller.
+ * util/rust-attribute-values.h: add `TRACK_CALLER` attribute.
+ * util/rust-attributes.cc: add `track_caller` attribute definition.
+
+2025-04-14 Owen Avery <powerboat9.gamer@gmail.com>
+
+ * checks/errors/rust-const-checker.cc
+ (ConstChecker::visit): Visit the enum items of enums.
+ * resolve/rust-ast-resolve-item.cc
+ (ResolveItem::visit): Resolve enum discriminants during nr1.0.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * expand/rust-macro-builtins-format-args.cc (format_args_parse_arguments): Improve safety,
+ allow extra commas after end of argument list.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Call into
+ TokenTreeDesugar.
+ * expand/rust-token-tree-desugar.cc: New file.
+ * expand/rust-token-tree-desugar.h: New file.
+ * Make-lang.in: Compile them.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * expand/rust-macro-expand.cc (MacroExpander::match_n_matches): Do not
+ insert fragments and substack fragments if the matcher failed.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * rust-session-manager.cc (Session::compile_crate): Call the visitor later in the pipeline.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * ast/rust-ast.h (DelimTokenTree::get_locus): New function.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * ast/rust-expr.h (class RangeExpr): Add empty outer attributes and allow getting them
+ and setting them.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Return if module
+ is unloaded.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * typecheck/rust-hir-type-check-expr.cc (is_default_fn): New.
+ (emit_ambiguous_resolution_error): New.
+ (handle_multiple_candidates): Properly handle multiple candidates in
+ the case of specialization.
+ (TypeCheckExpr::visit): Call `handle_multiple_candidates`.
+
+2025-04-14 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR rust/119342
+ * rust-gcc.cc (block): Add comment on why chaining
+ the variables of the scope toether.
+
+2025-04-14 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR rust/119341
+ * rust-gcc.cc (function_type): Use range fors.
+ (function_type_variadic): Likewise.
+ (fill_in_fields): Likewise.
+ (statement_list): Likewise.
+ (block): Likewise.
+ (block_add_statements): Likewise.
+ (function_set_parameters): Likewise.
+ (write_global_definitions): Likewise.
+
+2025-04-14 Andrew Pinski <quic_apinski@quicinc.com>
+
+ * rust-gcc.cc (Bvariable::get_tree): Use error_operand_p.
+ (pointer_type): Likewise.
+ (reference_type): Likewise.
+ (immutable_type): Likewise.
+ (function_type): Likewise.
+ (function_type_variadic): Likewise.
+ Cleanup the check for receiver.type first.
+ (function_ptr_type): Use error_operand_p.
+ (fill_in_fields): Likewise.
+ (fill_in_array): Likewise.
+ (named_type): Likewise.
+ (type_size): Likewise.
+ (type_alignment): Likewise.
+ (type_field_alignment): Likewise.
+ (type_field_offset): Likewise.
+ (zero_expression): Likewise.
+ (float_constant_expression): Likewise.
+ (convert_expression): Likewise.
+ (struct_field_expression): Likewise.
+ (compound_expression): Likewise.
+ (conditional_expression): Likewise.
+ (negation_expression): Likewise.
+ (arithmetic_or_logical_expression): Likewise.
+ (arithmetic_or_logical_expression_checked): Likewise.
+ (comparison_expression): Likewise.
+ (lazy_boolean_expression): Likewise.
+ (constructor_expression): Likewise.
+ (array_constructor_expression): Likewise.
+ (array_index_expression): Likewise.
+ (call_expression): Likewise.
+ (init_statement): Likewise.
+ (assignment_statement): Likewise.
+ (return_statement): Likewise.
+ (exception_handler_statement): Likewise.
+ (if_statement): Likewise.
+ (compound_statement): Likewise.
+ Tighten up the code, removing t variable.
+ (statement_list): Use error_operand_p.
+ (block): Likewise.
+ (block_add_statements): Likewise.
+ (convert_tree): Likewise.
+ (global_variable): Likewise.
+ (global_variable_set_init): Likewise.
+ (local_variable): Likewise.
+ (parameter_variable): Likewise.
+ (static_chain_variable): Likewise.
+ (temporary_variable): Likewise.
+ (function): Likewise. Tighten up the code.
+ (function_defer_statement): Use error_operand_p.
+ (function_set_parameters): Use error_operand_p.
+ (write_global_definitions): Use error_operand_p.
+ Tighten up the code around the loop.
+
+2025-04-14 Andrew Pinski <quic_apinski@quicinc.com>
+
+ * rust-gcc.cc (is_floating_point): Use FLOAT_TYPE_P
+ instead of manually checking the type.
+
2025-04-08 Matty Kuhn <matty.kuhn.1@gmail.com>
* ast/rust-ast.h: (AST::Attribute): add empty_input function
diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in
index 4028b47..835e113 100644
--- a/gcc/rust/Make-lang.in
+++ b/gcc/rust/Make-lang.in
@@ -115,6 +115,7 @@ GRS_OBJS = \
rust/rust-macro-builtins-format-args.o \
rust/rust-macro-builtins-location.o \
rust/rust-macro-builtins-include.o \
+ rust/rust-token-tree-desugar.o \
rust/rust-fmt.o \
rust/rust-hir.o \
rust/rust-hir-map.o \
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 09e0fce..91611ec 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -1018,6 +1018,7 @@ public:
}
DelimType get_delim_type () const { return delim_type; }
+ location_t get_locus () const { return locus; }
};
/* Forward decl - definition moved to rust-expr.h as it requires LiteralExpr
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h
index 84cdfdb..69538df 100644
--- a/gcc/rust/ast/rust-expr.h
+++ b/gcc/rust/ast/rust-expr.h
@@ -3004,6 +3004,10 @@ class RangeExpr : public ExprWithoutBlock
{
location_t locus;
+ // Some visitors still check for attributes on RangeExprs, and they will need
+ // to be supported in the future - so keep that for now
+ std::vector<Attribute> empty_attributes = {};
+
protected:
// outer attributes not allowed before range expressions
RangeExpr (location_t locus) : locus (locus) {}
@@ -3013,15 +3017,11 @@ public:
std::vector<Attribute> &get_outer_attrs () override final
{
- // RangeExpr cannot have any outer attributes
- rust_assert (false);
+ return empty_attributes;
}
// should never be called - error if called
- void set_outer_attrs (std::vector<Attribute> /* new_attrs */) override
- {
- rust_assert (false);
- }
+ void set_outer_attrs (std::vector<Attribute> /* new_attrs */) override {}
Expr::Kind get_expr_kind () const override { return Expr::Kind::Range; }
};
diff --git a/gcc/rust/checks/errors/rust-const-checker.cc b/gcc/rust/checks/errors/rust-const-checker.cc
index 4904322..4c2257a 100644
--- a/gcc/rust/checks/errors/rust-const-checker.cc
+++ b/gcc/rust/checks/errors/rust-const-checker.cc
@@ -646,6 +646,9 @@ ConstChecker::visit (Enum &enum_item)
{
check_default_const_generics (enum_item.get_generic_params (),
ConstGenericCtx::Enum);
+
+ for (auto &item : enum_item.get_variants ())
+ item->accept_vis (*this);
}
void
diff --git a/gcc/rust/expand/rust-macro-builtins-format-args.cc b/gcc/rust/expand/rust-macro-builtins-format-args.cc
index 8eb32d5..3e1249d 100644
--- a/gcc/rust/expand/rust-macro-builtins-format-args.cc
+++ b/gcc/rust/expand/rust-macro-builtins-format-args.cc
@@ -55,6 +55,8 @@ format_args_parse_arguments (AST::MacroInvocData &invoc)
if (parser.peek_current_token ()->get_id () == STRING_LITERAL)
format_expr = parser.parse_literal_expr ();
+ rust_assert (format_expr);
+
// TODO(Arthur): Clean this up - if we haven't parsed a string literal but a
// macro invocation, what do we do here? return a tl::unexpected?
auto format_str = static_cast<AST::LiteralExpr &> (*format_expr)
@@ -81,6 +83,11 @@ format_args_parse_arguments (AST::MacroInvocData &invoc)
{
parser.skip_token (COMMA);
+ // Check in case of an extraneous comma in the args list, which is
+ // allowed - format_args!("fmt", arg, arg2,)
+ if (parser.peek_current_token ()->get_id () == last_token_id)
+ break;
+
if (parser.peek_current_token ()->get_id () == IDENTIFIER
&& parser.peek (1)->get_id () == EQUAL)
{
diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index 39c4c46..8b406ff 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -83,7 +83,6 @@ const BiMap<std::string, BuiltinMacro> MacroBuiltin::builtins = {{
{"Ord", BuiltinMacro::Ord},
{"PartialOrd", BuiltinMacro::PartialOrd},
{"Hash", BuiltinMacro::Hash},
-
}};
AST::MacroTranscriberFunc
@@ -137,6 +136,7 @@ std::unordered_map<std::string, AST::MacroTranscriberFunc>
{"cfg_accessible", MacroBuiltin::sorry},
{"rustc_const_stable", MacroBuiltin::sorry},
{"rustc_const_unstable", MacroBuiltin::sorry},
+ {"track_caller", MacroBuiltin::sorry},
/* Derive builtins do not need a real transcriber, but still need one. It
should however never be called since builtin derive macros get expanded
differently, and benefit from knowing on what kind of items they are
diff --git a/gcc/rust/expand/rust-macro-expand.cc b/gcc/rust/expand/rust-macro-expand.cc
index cd17a3f..673b8fb 100644
--- a/gcc/rust/expand/rust-macro-expand.cc
+++ b/gcc/rust/expand/rust-macro-expand.cc
@@ -28,6 +28,7 @@
#include "rust-cfg-strip.h"
#include "rust-early-name-resolver.h"
#include "rust-proc-macro.h"
+#include "rust-token-tree-desugar.h"
namespace Rust {
@@ -78,7 +79,10 @@ MacroExpander::expand_decl_macro (location_t invoc_locus,
* trees.
*/
- AST::DelimTokenTree &invoc_token_tree = invoc.get_delim_tok_tree ();
+ AST::DelimTokenTree &invoc_token_tree_sugar = invoc.get_delim_tok_tree ();
+
+ // We must first desugar doc comments into proper attributes
+ auto invoc_token_tree = AST::TokenTreeDesugar ().go (invoc_token_tree_sugar);
// find matching arm
AST::MacroRule *matched_rule = nullptr;
@@ -621,9 +625,10 @@ MacroExpander::match_n_matches (Parser<MacroInvocLexer> &parser,
// matched fragment get the offset in the token stream
size_t offs_end = source.get_offs ();
- sub_stack.insert_metavar (
- MatchedFragment (fragment->get_ident ().as_string (),
- offs_begin, offs_end));
+ if (valid_current_match)
+ sub_stack.insert_metavar (
+ MatchedFragment (fragment->get_ident ().as_string (),
+ offs_begin, offs_end));
}
break;
@@ -650,15 +655,15 @@ MacroExpander::match_n_matches (Parser<MacroInvocLexer> &parser,
}
auto old_stack = sub_stack.pop ();
- // nest metavars into repetitions
- for (auto &ent : old_stack)
- sub_stack.append_fragment (ent.first, std::move (ent.second));
-
// If we've encountered an error once, stop trying to match more
// repetitions
if (!valid_current_match)
break;
+ // nest metavars into repetitions
+ for (auto &ent : old_stack)
+ sub_stack.append_fragment (ent.first, std::move (ent.second));
+
match_amount++;
// Break early if we notice there's too many expressions already
diff --git a/gcc/rust/expand/rust-token-tree-desugar.cc b/gcc/rust/expand/rust-token-tree-desugar.cc
new file mode 100644
index 0000000..3b47180
--- /dev/null
+++ b/gcc/rust/expand/rust-token-tree-desugar.cc
@@ -0,0 +1,72 @@
+// Copyright (C) 2025 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC 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.
+
+// GCC 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 GCC; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include "rust-token-tree-desugar.h"
+#include "rust-ast.h"
+#include "rust-token.h"
+
+namespace Rust {
+namespace AST {
+
+DelimTokenTree
+TokenTreeDesugar::go (DelimTokenTree &tts)
+{
+ tts.accept_vis (*this);
+
+ return DelimTokenTree (tts.get_delim_type (), std::move (desugared),
+ tts.get_locus ());
+}
+
+void
+TokenTreeDesugar::append (TokenPtr &&new_token)
+{
+ desugared.emplace_back (std::make_unique<Token> (std::move (new_token)));
+}
+
+void
+TokenTreeDesugar::append (std::unique_ptr<TokenTree> &&new_token)
+{
+ desugared.emplace_back (std::move (new_token));
+}
+
+void
+TokenTreeDesugar::visit (Token &tts)
+{
+ if (tts.get_id () == TokenId::OUTER_DOC_COMMENT
+ || tts.get_id () == TokenId::INNER_DOC_COMMENT)
+ {
+ append (Rust::Token::make (TokenId::HASH, tts.get_locus ()));
+
+ if (tts.get_id () == TokenId::INNER_DOC_COMMENT)
+ append (Rust::Token::make (EXCLAM, tts.get_locus ()));
+
+ append (Rust::Token::make (TokenId::LEFT_SQUARE, tts.get_locus ()));
+ append (Rust::Token::make_identifier (tts.get_locus (), "doc"));
+ append (Rust::Token::make (TokenId::EQUAL, tts.get_locus ()));
+ append (Rust::Token::make_string (tts.get_locus (),
+ std::string (tts.get_str ())));
+ append (Rust::Token::make (TokenId::RIGHT_SQUARE, tts.get_locus ()));
+ }
+ else
+ {
+ append (tts.clone_token ());
+ }
+}
+
+}; // namespace AST
+}; // namespace Rust
diff --git a/gcc/rust/expand/rust-token-tree-desugar.h b/gcc/rust/expand/rust-token-tree-desugar.h
new file mode 100644
index 0000000..ccba53b
--- /dev/null
+++ b/gcc/rust/expand/rust-token-tree-desugar.h
@@ -0,0 +1,55 @@
+// Copyright (C) 2025 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC 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.
+
+// GCC 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 GCC; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#ifndef RUST_TOKEN_TREE_DESUGAR_H
+#define RUST_TOKEN_TREE_DESUGAR_H
+
+#include "rust-ast-visitor.h"
+#include "rust-system.h"
+#include "rust-ast.h"
+
+namespace Rust {
+namespace AST {
+
+/**
+ * Desugar a given token-tree before parsing it for a macro invocation. At the
+ * moment, the sole purpose of this desugar is to transform doc-comments into
+ * their attribute form (/// comment -> #[doc = "comment"])
+ */
+class TokenTreeDesugar : public DefaultASTVisitor
+{
+public:
+ TokenTreeDesugar () : desugared (std::vector<std::unique_ptr<TokenTree>> ())
+ {}
+
+ DelimTokenTree go (DelimTokenTree &tts);
+
+private:
+ std::vector<std::unique_ptr<TokenTree>> desugared;
+ void append (TokenPtr &&new_token);
+ void append (std::unique_ptr<TokenTree> &&new_token);
+
+ using DefaultASTVisitor::visit;
+
+ virtual void visit (Token &tts) override;
+};
+
+}; // namespace AST
+}; // namespace Rust
+
+#endif //! RUST_TOKEN_TREE_DESUGAR_H
diff --git a/gcc/rust/resolve/rust-ast-resolve-item.cc b/gcc/rust/resolve/rust-ast-resolve-item.cc
index d584961..30f6d43 100644
--- a/gcc/rust/resolve/rust-ast-resolve-item.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-item.cc
@@ -356,6 +356,8 @@ ResolveItem::visit (AST::EnumItemDiscriminant &item)
auto cpath = canonical_prefix.append (decl);
mappings.insert_canonical_path (item.get_node_id (), cpath);
+
+ ResolveExpr::go (item.get_expr (), path, cpath);
}
void
diff --git a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc
index afaca1f..36456e1 100644
--- a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc
@@ -325,10 +325,9 @@ Early::visit_attributes (std::vector<AST::Attribute> &attrs)
auto pm_def = mappings.lookup_derive_proc_macro_def (
definition->get_node_id ());
- rust_assert (pm_def.has_value ());
-
- mappings.insert_derive_proc_macro_invocation (trait,
- pm_def.value ());
+ if (pm_def.has_value ())
+ mappings.insert_derive_proc_macro_invocation (trait,
+ pm_def.value ());
}
}
else if (Analysis::BuiltinAttributeMappings::get ()
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index 8863be7..ba37dee 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -113,7 +113,17 @@ TopLevel::visit (AST::Module &module)
// This was copied from the old early resolver method
// 'accumulate_escaped_macros'
if (module.get_kind () == AST::Module::UNLOADED)
- module.load_items ();
+ {
+ module.load_items ();
+
+ // If the module was previously unloaded, then we don't want to visit it
+ // this time around as the CfgStrip hasn't run on its inner items yet.
+ // Skip it for now, mark the visitor as dirty and try again
+
+ dirty = true;
+
+ return;
+ }
DefaultResolver::visit (module);
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index 72aef08..234721c 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -61,7 +61,7 @@
tree
Bvariable::get_tree (location_t location) const
{
- if (this->t_ == error_mark_node)
+ if (error_operand_p (this->t_))
return error_mark_node;
TREE_USED (this->t_) = 1;
@@ -431,7 +431,7 @@ float_type (int bits)
tree
pointer_type (tree to_type)
{
- if (to_type == error_mark_node)
+ if (error_operand_p (to_type))
return error_mark_node;
tree type = build_pointer_type (to_type);
return type;
@@ -442,7 +442,7 @@ pointer_type (tree to_type)
tree
reference_type (tree to_type)
{
- if (to_type == error_mark_node)
+ if (error_operand_p (to_type))
return error_mark_node;
tree type = build_reference_type (to_type);
return type;
@@ -453,7 +453,7 @@ reference_type (tree to_type)
tree
immutable_type (tree base)
{
- if (base == error_mark_node)
+ if (error_operand_p (base))
return error_mark_node;
tree constified = build_qualified_type (base, TYPE_QUAL_CONST);
return constified;
@@ -472,17 +472,16 @@ function_type (const typed_identifier &receiver,
if (receiver.type != NULL_TREE)
{
tree t = receiver.type;
- if (t == error_mark_node)
+ if (error_operand_p (t))
return error_mark_node;
*pp = tree_cons (NULL_TREE, t, NULL_TREE);
pp = &TREE_CHAIN (*pp);
}
- for (std::vector<typed_identifier>::const_iterator p = parameters.begin ();
- p != parameters.end (); ++p)
+ for (const auto &p : parameters)
{
- tree t = p->type;
- if (t == error_mark_node)
+ tree t = p.type;
+ if (error_operand_p (t))
return error_mark_node;
*pp = tree_cons (NULL_TREE, t, NULL_TREE);
pp = &TREE_CHAIN (*pp);
@@ -502,11 +501,11 @@ function_type (const typed_identifier &receiver,
gcc_assert (result_struct != NULL);
result = result_struct;
}
- if (result == error_mark_node)
+ if (error_operand_p (result))
return error_mark_node;
tree fntype = build_function_type (result, args);
- if (fntype == error_mark_node)
+ if (error_operand_p (fntype))
return error_mark_node;
return build_pointer_type (fntype);
@@ -521,21 +520,16 @@ function_type_variadic (const typed_identifier &receiver,
size_t n = parameters.size () + (receiver.type != NULL_TREE ? 1 : 0);
tree *args = XALLOCAVEC (tree, n);
size_t offs = 0;
+ if (error_operand_p (receiver.type))
+ return error_mark_node;
if (receiver.type != NULL_TREE)
- {
- tree t = receiver.type;
- if (t == error_mark_node)
- return error_mark_node;
-
- args[offs++] = t;
- }
+ args[offs++] = receiver.type;
- for (std::vector<typed_identifier>::const_iterator p = parameters.begin ();
- p != parameters.end (); ++p)
+ for (const auto &p : parameters)
{
- tree t = p->type;
- if (t == error_mark_node)
+ tree t = p.type;
+ if (error_operand_p (t))
return error_mark_node;
args[offs++] = t;
}
@@ -550,11 +544,11 @@ function_type_variadic (const typed_identifier &receiver,
gcc_assert (result_struct != NULL_TREE);
result = result_struct;
}
- if (result == error_mark_node)
+ if (error_operand_p (result))
return error_mark_node;
tree fntype = build_varargs_function_type_array (result, n, args);
- if (fntype == error_mark_node)
+ if (error_operand_p (fntype))
return error_mark_node;
return build_pointer_type (fntype);
@@ -569,7 +563,7 @@ function_ptr_type (tree result_type, const std::vector<tree> &parameters,
for (auto &param : parameters)
{
- if (param == error_mark_node)
+ if (error_operand_p (param))
return error_mark_node;
*pp = tree_cons (NULL_TREE, param, NULL_TREE);
@@ -583,7 +577,7 @@ function_ptr_type (tree result_type, const std::vector<tree> &parameters,
result = void_type_node;
tree fntype = build_function_type (result, args);
- if (fntype == error_mark_node)
+ if (error_operand_p (fntype))
return error_mark_node;
return build_pointer_type (fntype);
@@ -613,14 +607,13 @@ fill_in_fields (tree fill, const std::vector<typed_identifier> &fields,
{
tree field_trees = NULL_TREE;
tree *pp = &field_trees;
- for (std::vector<typed_identifier>::const_iterator p = fields.begin ();
- p != fields.end (); ++p)
+ for (const auto &p : fields)
{
- tree name_tree = get_identifier_from_string (p->name);
- tree type_tree = p->type;
- if (type_tree == error_mark_node)
+ tree name_tree = get_identifier_from_string (p.name);
+ tree type_tree = p.type;
+ if (error_operand_p (type_tree))
return error_mark_node;
- tree field = build_decl (p->location, FIELD_DECL, name_tree, type_tree);
+ tree field = build_decl (p.location, FIELD_DECL, name_tree, type_tree);
DECL_CONTEXT (field) = fill;
*pp = field;
pp = &DECL_CHAIN (field);
@@ -652,7 +645,7 @@ array_type (tree element_type, tree length)
tree
fill_in_array (tree fill, tree element_type, tree length_tree)
{
- if (element_type == error_mark_node || length_tree == error_mark_node)
+ if (error_operand_p (element_type) || error_operand_p (length_tree))
return error_mark_node;
gcc_assert (TYPE_SIZE (element_type) != NULL_TREE);
@@ -684,7 +677,7 @@ fill_in_array (tree fill, tree element_type, tree length_tree)
tree
named_type (const std::string &name, tree type, location_t location)
{
- if (type == error_mark_node)
+ if (error_operand_p (type))
return error_mark_node;
// The middle-end expects a basic type to have a name. In Rust every
@@ -714,7 +707,7 @@ named_type (const std::string &name, tree type, location_t location)
int64_t
type_size (tree t)
{
- if (t == error_mark_node)
+ if (error_operand_p (t))
return 1;
if (t == void_type_node)
return 0;
@@ -732,7 +725,7 @@ type_size (tree t)
int64_t
type_alignment (tree t)
{
- if (t == error_mark_node)
+ if (error_operand_p (t))
return 1;
return TYPE_ALIGN_UNIT (t);
}
@@ -742,7 +735,7 @@ type_alignment (tree t)
int64_t
type_field_alignment (tree t)
{
- if (t == error_mark_node)
+ if (error_operand_p (t))
return 1;
return rust_field_alignment (t);
}
@@ -752,7 +745,7 @@ type_field_alignment (tree t)
int64_t
type_field_offset (tree struct_tree, size_t index)
{
- if (struct_tree == error_mark_node)
+ if (error_operand_p (struct_tree))
return 0;
gcc_assert (TREE_CODE (struct_tree) == RECORD_TYPE);
tree field = TYPE_FIELDS (struct_tree);
@@ -773,7 +766,7 @@ tree
zero_expression (tree t)
{
tree ret;
- if (t == error_mark_node)
+ if (error_operand_p (t))
ret = error_mark_node;
else
ret = build_zero_cst (t);
@@ -794,7 +787,7 @@ tree
float_constant_expression (tree t, mpfr_t val)
{
tree ret;
- if (t == error_mark_node)
+ if (error_operand_p (t))
return error_mark_node;
REAL_VALUE_TYPE r1;
@@ -845,8 +838,7 @@ boolean_constant_expression (bool val)
tree
convert_expression (tree type_tree, tree expr_tree, location_t location)
{
- if (type_tree == error_mark_node || expr_tree == error_mark_node
- || TREE_TYPE (expr_tree) == error_mark_node)
+ if (error_operand_p (type_tree) || error_operand_p (expr_tree))
return error_mark_node;
tree ret;
@@ -878,8 +870,7 @@ convert_expression (tree type_tree, tree expr_tree, location_t location)
tree
struct_field_expression (tree struct_tree, size_t index, location_t location)
{
- if (struct_tree == error_mark_node
- || TREE_TYPE (struct_tree) == error_mark_node)
+ if (error_operand_p (struct_tree))
return error_mark_node;
gcc_assert (TREE_CODE (TREE_TYPE (struct_tree)) == RECORD_TYPE
|| TREE_CODE (TREE_TYPE (struct_tree)) == UNION_TYPE);
@@ -895,7 +886,7 @@ struct_field_expression (tree struct_tree, size_t index, location_t location)
field = DECL_CHAIN (field);
gcc_assert (field != NULL_TREE);
}
- if (TREE_TYPE (field) == error_mark_node)
+ if (error_operand_p (TREE_TYPE (field)))
return error_mark_node;
tree ret = fold_build3_loc (location, COMPONENT_REF, TREE_TYPE (field),
struct_tree, field, NULL_TREE);
@@ -909,7 +900,7 @@ struct_field_expression (tree struct_tree, size_t index, location_t location)
tree
compound_expression (tree stat, tree expr, location_t location)
{
- if (stat == error_mark_node || expr == error_mark_node)
+ if (error_operand_p (stat) || error_operand_p (expr))
return error_mark_node;
tree ret
= fold_build2_loc (location, COMPOUND_EXPR, TREE_TYPE (expr), stat, expr);
@@ -923,8 +914,8 @@ tree
conditional_expression (tree, tree type_tree, tree cond_expr, tree then_expr,
tree else_expr, location_t location)
{
- if (type_tree == error_mark_node || cond_expr == error_mark_node
- || then_expr == error_mark_node || else_expr == error_mark_node)
+ if (error_operand_p (type_tree) || error_operand_p (cond_expr)
+ || error_operand_p (then_expr) || error_operand_p (else_expr))
return error_mark_node;
tree ret = build3_loc (location, COND_EXPR, type_tree, cond_expr, then_expr,
else_expr);
@@ -1021,12 +1012,12 @@ operator_to_tree_code (LazyBooleanOperator op)
}
}
-/* Helper function for deciding if a tree is a floating point node. */
+/* Returns true if the type of EXP is a floating point type.
+ False otherwise. */
bool
-is_floating_point (tree t)
+is_floating_point (tree exp)
{
- auto tree_type = TREE_CODE (TREE_TYPE (t));
- return tree_type == REAL_TYPE || tree_type == COMPLEX_TYPE;
+ return FLOAT_TYPE_P (TREE_TYPE (exp));
}
// Return an expression for the negation operation OP EXPR.
@@ -1035,7 +1026,7 @@ negation_expression (NegationOperator op, tree expr_tree, location_t location)
{
/* Check if the expression is an error, in which case we return an error
expression. */
- if (expr_tree == error_mark_node || TREE_TYPE (expr_tree) == error_mark_node)
+ if (error_operand_p (expr_tree))
return error_mark_node;
/* For negation operators, the resulting type should be the same as its
@@ -1071,7 +1062,7 @@ arithmetic_or_logical_expression (ArithmeticOrLogicalOperator op, tree left,
{
/* Check if either expression is an error, in which case we return an error
expression. */
- if (left == error_mark_node || right == error_mark_node)
+ if (error_operand_p (left) || error_operand_p (right))
return error_mark_node;
// unwrap the const decls if set
@@ -1182,7 +1173,7 @@ arithmetic_or_logical_expression_checked (ArithmeticOrLogicalOperator op,
{
/* Check if either expression is an error, in which case we return an error
expression. */
- if (left == error_mark_node || right == error_mark_node)
+ if (error_operand_p (left) || error_operand_p (right))
return error_mark_node;
// FIXME: Add `if (!debug_mode)`
@@ -1222,7 +1213,7 @@ comparison_expression (ComparisonOperator op, tree left_tree, tree right_tree,
{
/* Check if either expression is an error, in which case we return an error
expression. */
- if (left_tree == error_mark_node || right_tree == error_mark_node)
+ if (error_operand_p (left_tree) || error_operand_p (right_tree))
return error_mark_node;
/* For comparison operators, the resulting type should be boolean. */
@@ -1242,7 +1233,7 @@ lazy_boolean_expression (LazyBooleanOperator op, tree left_tree,
{
/* Check if either expression is an error, in which case we return an error
expression. */
- if (left_tree == error_mark_node || right_tree == error_mark_node)
+ if (error_operand_p (left_tree) || error_operand_p (right_tree))
return error_mark_node;
/* For lazy boolean operators, the resulting type should be the same as the
@@ -1263,7 +1254,7 @@ constructor_expression (tree type_tree, bool is_variant,
const std::vector<tree> &vals, int union_index,
location_t location)
{
- if (type_tree == error_mark_node)
+ if (error_operand_p (type_tree))
return error_mark_node;
vec<constructor_elt, va_gc> *init;
@@ -1305,8 +1296,8 @@ constructor_expression (tree type_tree, bool is_variant,
gcc_assert (field != NULL_TREE);
field = DECL_CHAIN (field);
}
- if (TREE_TYPE (field) == error_mark_node || val == error_mark_node
- || TREE_TYPE (val) == error_mark_node)
+
+ if (TREE_TYPE (field) == error_mark_node || error_operand_p (val))
return error_mark_node;
if (int_size_in_bytes (TREE_TYPE (field)) == 0)
@@ -1336,8 +1327,7 @@ constructor_expression (tree type_tree, bool is_variant,
{
gcc_assert (field != NULL_TREE);
tree val = (*p);
- if (TREE_TYPE (field) == error_mark_node || val == error_mark_node
- || TREE_TYPE (val) == error_mark_node)
+ if (TREE_TYPE (field) == error_mark_node || error_operand_p (val))
return error_mark_node;
if (int_size_in_bytes (TREE_TYPE (field)) == 0)
@@ -1376,7 +1366,7 @@ array_constructor_expression (tree type_tree,
const std::vector<tree> &vals,
location_t location)
{
- if (type_tree == error_mark_node)
+ if (error_operand_p (type_tree))
return error_mark_node;
gcc_assert (indexes.size () == vals.size ());
@@ -1393,7 +1383,7 @@ array_constructor_expression (tree type_tree,
tree index = size_int (indexes[i]);
tree val = vals[i];
- if (index == error_mark_node || val == error_mark_node)
+ if (error_operand_p (index) || error_operand_p (val))
return error_mark_node;
if (element_size == 0)
@@ -1497,8 +1487,7 @@ array_initializer (tree fndecl, tree block, tree array_type, tree length,
tree
array_index_expression (tree array_tree, tree index_tree, location_t location)
{
- if (array_tree == error_mark_node || TREE_TYPE (array_tree) == error_mark_node
- || index_tree == error_mark_node)
+ if (error_operand_p (array_tree) || error_operand_p (index_tree))
return error_mark_node;
// A function call that returns a zero sized object will have been
@@ -1520,7 +1509,7 @@ tree
call_expression (tree fn, const std::vector<tree> &fn_args, tree chain_expr,
location_t location)
{
- if (fn == error_mark_node || TREE_TYPE (fn) == error_mark_node)
+ if (error_operand_p (fn))
return error_mark_node;
gcc_assert (FUNCTION_POINTER_TYPE_P (TREE_TYPE (fn)));
@@ -1600,7 +1589,7 @@ tree
init_statement (tree, Bvariable *var, tree init_tree)
{
tree var_tree = var->get_decl ();
- if (var_tree == error_mark_node || init_tree == error_mark_node)
+ if (error_operand_p (var_tree) || error_operand_p (init_tree))
return error_mark_node;
gcc_assert (TREE_CODE (var_tree) == VAR_DECL);
@@ -1631,7 +1620,7 @@ init_statement (tree, Bvariable *var, tree init_tree)
tree
assignment_statement (tree lhs, tree rhs, location_t location)
{
- if (lhs == error_mark_node || rhs == error_mark_node)
+ if (error_operand_p (lhs) || error_operand_p (rhs))
return error_mark_node;
// To avoid problems with GNU ld, we don't make zero-sized
@@ -1656,14 +1645,14 @@ assignment_statement (tree lhs, tree rhs, location_t location)
tree
return_statement (tree fntree, tree val, location_t location)
{
- if (fntree == error_mark_node)
+ if (error_operand_p (fntree))
return error_mark_node;
tree result = DECL_RESULT (fntree);
- if (result == error_mark_node)
+ if (error_operand_p (result))
return error_mark_node;
- if (val == error_mark_node)
+ if (error_operand_p (val))
return error_mark_node;
tree set
@@ -1681,8 +1670,8 @@ tree
exception_handler_statement (tree try_stmt, tree except_stmt, tree finally_stmt,
location_t location)
{
- if (try_stmt == error_mark_node || except_stmt == error_mark_node
- || finally_stmt == error_mark_node)
+ if (error_operand_p (try_stmt) || error_operand_p (except_stmt)
+ || error_operand_p (finally_stmt))
return error_mark_node;
if (except_stmt != NULL_TREE)
@@ -1701,8 +1690,8 @@ tree
if_statement (tree, tree cond_tree, tree then_tree, tree else_tree,
location_t location)
{
- if (cond_tree == error_mark_node || then_tree == error_mark_node
- || else_tree == error_mark_node)
+ if (error_operand_p (cond_tree) || error_operand_p (then_tree)
+ || error_operand_p (else_tree))
return error_mark_node;
tree ret = build3_loc (location, COND_EXPR, void_type_node, cond_tree,
then_tree, else_tree);
@@ -1728,15 +1717,12 @@ exit_expression (tree cond_tree, location_t locus)
tree
compound_statement (tree s1, tree s2)
{
- tree stmt_list = NULL_TREE;
- tree t = s1;
- if (t == error_mark_node)
- return error_mark_node;
- append_to_statement_list (t, &stmt_list);
- t = s2;
- if (t == error_mark_node)
+ if (error_operand_p (s1) || error_operand_p (s2))
return error_mark_node;
- append_to_statement_list (t, &stmt_list);
+
+ tree stmt_list = NULL_TREE;
+ append_to_statement_list (s1, &stmt_list);
+ append_to_statement_list (s2, &stmt_list);
// If neither statement has any side effects, stmt_list can be NULL
// at this point.
@@ -1752,11 +1738,9 @@ tree
statement_list (const std::vector<tree> &statements)
{
tree stmt_list = NULL_TREE;
- for (std::vector<tree>::const_iterator p = statements.begin ();
- p != statements.end (); ++p)
+ for (tree t : statements)
{
- tree t = (*p);
- if (t == error_mark_node)
+ if (error_operand_p (t))
return error_mark_node;
append_to_statement_list (t, &stmt_list);
}
@@ -1808,12 +1792,13 @@ block (tree fndecl, tree enclosing, const std::vector<Bvariable *> &vars,
*pp = block_tree;
}
+ // Chain the variables of the scope together so they are all connected
+ // to the block.
tree *pp = &BLOCK_VARS (block_tree);
- for (std::vector<Bvariable *>::const_iterator pv = vars.begin ();
- pv != vars.end (); ++pv)
+ for (Bvariable *bv : vars)
{
- *pp = (*pv)->get_decl ();
- if (*pp != error_mark_node)
+ *pp = bv->get_decl ();
+ if (!error_operand_p (*pp))
pp = &DECL_CHAIN (*pp);
}
*pp = NULL_TREE;
@@ -1832,11 +1817,9 @@ void
block_add_statements (tree bind_tree, const std::vector<tree> &statements)
{
tree stmt_list = NULL_TREE;
- for (std::vector<tree>::const_iterator p = statements.begin ();
- p != statements.end (); ++p)
+ for (tree s : statements)
{
- tree s = (*p);
- if (s != error_mark_node)
+ if (!error_operand_p (s))
append_to_statement_list (s, &stmt_list);
}
@@ -1914,8 +1897,7 @@ convert_tree (tree type_tree, tree expr_tree, location_t location)
if (type_tree == TREE_TYPE (expr_tree))
return expr_tree;
- if (type_tree == error_mark_node || expr_tree == error_mark_node
- || TREE_TYPE (expr_tree) == error_mark_node)
+ if (error_operand_p (type_tree) || error_operand_p (expr_tree))
return error_mark_node;
if (POINTER_TYPE_P (type_tree) || INTEGRAL_TYPE_P (type_tree)
@@ -1944,7 +1926,7 @@ global_variable (const std::string &var_name, const std::string &asm_name,
tree type_tree, bool is_external, bool is_hidden,
bool in_unique_section, location_t location)
{
- if (type_tree == error_mark_node)
+ if (error_operand_p (type_tree))
return Bvariable::error_variable ();
// The GNU linker does not like dynamic variables with zero size.
@@ -1983,11 +1965,11 @@ global_variable (const std::string &var_name, const std::string &asm_name,
void
global_variable_set_init (Bvariable *var, tree expr_tree)
{
- if (expr_tree == error_mark_node)
+ if (error_operand_p (expr_tree))
return;
gcc_assert (TREE_CONSTANT (expr_tree));
tree var_decl = var->get_decl ();
- if (var_decl == error_mark_node)
+ if (error_operand_p (var_decl))
return;
DECL_INITIAL (var_decl) = expr_tree;
@@ -2008,7 +1990,7 @@ Bvariable *
local_variable (tree function, const std::string &name, tree type_tree,
Bvariable *decl_var, location_t location)
{
- if (type_tree == error_mark_node)
+ if (error_operand_p (type_tree))
return Bvariable::error_variable ();
tree decl = build_decl (location, VAR_DECL, get_identifier_from_string (name),
type_tree);
@@ -2029,7 +2011,7 @@ Bvariable *
parameter_variable (tree function, const std::string &name, tree type_tree,
location_t location)
{
- if (type_tree == error_mark_node)
+ if (error_operand_p (type_tree))
return Bvariable::error_variable ();
tree decl = build_decl (location, PARM_DECL,
get_identifier_from_string (name), type_tree);
@@ -2046,7 +2028,7 @@ Bvariable *
static_chain_variable (tree fndecl, const std::string &name, tree type_tree,
location_t location)
{
- if (type_tree == error_mark_node)
+ if (error_operand_p (type_tree))
return Bvariable::error_variable ();
tree decl = build_decl (location, PARM_DECL,
get_identifier_from_string (name), type_tree);
@@ -2080,8 +2062,8 @@ temporary_variable (tree fndecl, tree bind_tree, tree type_tree, tree init_tree,
tree *pstatement)
{
gcc_assert (fndecl != NULL_TREE);
- if (type_tree == error_mark_node || init_tree == error_mark_node
- || fndecl == error_mark_node)
+ if (error_operand_p (type_tree) || error_operand_p (init_tree)
+ || error_operand_p (fndecl))
{
*pstatement = error_mark_node;
return Bvariable::error_variable ();
@@ -2198,13 +2180,13 @@ tree
function (tree functype, const std::string &name, const std::string &asm_name,
unsigned int flags, location_t location)
{
- if (functype != error_mark_node)
- {
- gcc_assert (FUNCTION_POINTER_TYPE_P (functype));
- functype = TREE_TYPE (functype);
- }
+ if (error_operand_p (functype))
+ return error_mark_node;
+
+ gcc_assert (FUNCTION_POINTER_TYPE_P (functype));
+ functype = TREE_TYPE (functype);
tree id = get_identifier_from_string (name);
- if (functype == error_mark_node || id == error_mark_node)
+ if (error_operand_p (id))
return error_mark_node;
tree decl = build_decl (location, FUNCTION_DECL, id, functype);
@@ -2242,8 +2224,8 @@ tree
function_defer_statement (tree function, tree undefer_tree, tree defer_tree,
location_t location)
{
- if (undefer_tree == error_mark_node || defer_tree == error_mark_node
- || function == error_mark_node)
+ if (error_operand_p (undefer_tree) || error_operand_p (defer_tree)
+ || error_operand_p (function))
return error_mark_node;
if (DECL_STRUCT_FUNCTION (function) == NULL)
@@ -2275,16 +2257,15 @@ bool
function_set_parameters (tree function,
const std::vector<Bvariable *> &param_vars)
{
- if (function == error_mark_node)
+ if (error_operand_p (function))
return false;
tree params = NULL_TREE;
tree *pp = &params;
- for (std::vector<Bvariable *>::const_iterator pv = param_vars.begin ();
- pv != param_vars.end (); ++pv)
+ for (Bvariable *bv : param_vars)
{
- *pp = (*pv)->get_decl ();
- gcc_assert (*pp != error_mark_node);
+ *pp = bv->get_decl ();
+ gcc_assert (!error_operand_p (*pp));
pp = &DECL_CHAIN (*pp);
}
*pp = NULL_TREE;
@@ -2309,23 +2290,19 @@ write_global_definitions (const std::vector<tree> &type_decls,
// Convert all non-erroneous declarations into Gimple form.
size_t i = 0;
- for (std::vector<Bvariable *>::const_iterator p = variable_decls.begin ();
- p != variable_decls.end (); ++p)
+ for (Bvariable *bv : variable_decls)
{
- tree v = (*p)->get_decl ();
- if (v != error_mark_node)
- {
- defs[i] = v;
- rust_preserve_from_gc (defs[i]);
- ++i;
- }
+ tree v = bv->get_decl ();
+ if (error_operand_p (v))
+ continue;
+ defs[i] = v;
+ rust_preserve_from_gc (defs[i]);
+ ++i;
}
- for (std::vector<tree>::const_iterator p = type_decls.begin ();
- p != type_decls.end (); ++p)
+ for (tree type_tree : type_decls)
{
- tree type_tree = (*p);
- if (type_tree != error_mark_node && IS_TYPE_OR_DECL_P (type_tree))
+ if (!error_operand_p (type_tree) && IS_TYPE_OR_DECL_P (type_tree))
{
defs[i] = TYPE_NAME (type_tree);
gcc_assert (defs[i] != NULL);
@@ -2333,21 +2310,18 @@ write_global_definitions (const std::vector<tree> &type_decls,
++i;
}
}
- for (std::vector<tree>::const_iterator p = constant_decls.begin ();
- p != constant_decls.end (); ++p)
+ for (tree t : constant_decls)
{
- if ((*p) != error_mark_node)
+ if (!error_operand_p (t))
{
- defs[i] = (*p);
+ defs[i] = t;
rust_preserve_from_gc (defs[i]);
++i;
}
}
- for (std::vector<tree>::const_iterator p = function_decls.begin ();
- p != function_decls.end (); ++p)
+ for (tree decl : function_decls)
{
- tree decl = (*p);
- if (decl != error_mark_node)
+ if (!error_operand_p (decl))
{
rust_preserve_from_gc (decl);
if (DECL_STRUCT_FUNCTION (decl) == NULL)
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 15f21ef..48acbf34 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -611,7 +611,6 @@ Session::compile_crate (const char *filename)
return;
AST::CollectLangItems ().go (parsed_crate);
- AST::DesugarQuestionMark ().go (parsed_crate);
auto name_resolution_ctx = Resolver2_0::NameResolutionContext ();
// expansion pipeline stage
@@ -619,6 +618,7 @@ Session::compile_crate (const char *filename)
expansion (parsed_crate, name_resolution_ctx);
AST::DesugarForLoops ().go (parsed_crate);
+ AST::DesugarQuestionMark ().go (parsed_crate);
rust_debug ("\033[0;31mSUCCESSFULLY FINISHED EXPANSION \033[0m");
if (options.dump_option_enabled (CompileOptions::EXPANSION_DUMP))
diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc
index 791795f..b2bcac0 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-expr.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-expr.cc
@@ -16,6 +16,8 @@
// along with GCC; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
+#include "optional.h"
+#include "rust-hir-expr.h"
#include "rust-system.h"
#include "rust-tyty-call.h"
#include "rust-hir-type-check-struct-field.h"
@@ -1154,6 +1156,94 @@ TypeCheckExpr::visit (HIR::FieldAccessExpr &expr)
infered = lookup->get_field_type ();
}
+bool
+is_default_fn (const MethodCandidate &candidate)
+{
+ if (candidate.candidate.is_impl_candidate ())
+ {
+ auto *item = candidate.candidate.item.impl.impl_item;
+
+ if (item->get_impl_item_type () == HIR::ImplItem::FUNCTION)
+ {
+ auto &fn = static_cast<HIR::Function &> (*item);
+
+ return fn.is_default ();
+ }
+ }
+
+ return false;
+}
+
+void
+emit_ambiguous_resolution_error (HIR::MethodCallExpr &expr,
+ std::set<MethodCandidate> &candidates)
+{
+ rich_location r (line_table, expr.get_method_name ().get_locus ());
+ std::string rich_msg = "multiple "
+ + expr.get_method_name ().get_segment ().as_string ()
+ + " found";
+
+ // We have to filter out default candidates
+ for (auto &c : candidates)
+ if (!is_default_fn (c))
+ r.add_range (c.candidate.locus);
+
+ r.add_fixit_replace (rich_msg.c_str ());
+
+ rust_error_at (r, ErrorCode::E0592, "duplicate definitions with name %qs",
+ expr.get_method_name ().get_segment ().as_string ().c_str ());
+}
+
+// We are allowed to have multiple candidates if they are all specializable
+// functions or if all of them except one are specializable functions.
+// In the later case, we just return a valid candidate without erroring out
+// about ambiguity. If there are two or more specialized functions, then we
+// error out.
+//
+// FIXME: The first case is not handled at the moment, so we error out
+tl::optional<const MethodCandidate &>
+handle_multiple_candidates (HIR::MethodCallExpr &expr,
+ std::set<MethodCandidate> &candidates)
+{
+ auto all_default = true;
+ tl::optional<const MethodCandidate &> found = tl::nullopt;
+
+ for (auto &c : candidates)
+ {
+ if (!is_default_fn (c))
+ {
+ all_default = false;
+
+ // We haven't found a final candidate yet, so we can select
+ // this one. However, if we already have a candidate, then
+ // that means there are multiple non-default candidates - we
+ // must error out
+ if (!found)
+ {
+ found = c;
+ }
+ else
+ {
+ emit_ambiguous_resolution_error (expr, candidates);
+ return tl::nullopt;
+ }
+ }
+ }
+
+ // None of the candidates were a non-default (specialized) function, so we
+ // error out
+ if (all_default)
+ {
+ rust_sorry_at (expr.get_locus (),
+ "cannot resolve method calls to non-specialized methods "
+ "(all function candidates are %qs)",
+ "default");
+ return tl::nullopt;
+ }
+
+ return found;
+}
+
void
TypeCheckExpr::visit (HIR::MethodCallExpr &expr)
{
@@ -1181,34 +1271,25 @@ TypeCheckExpr::visit (HIR::MethodCallExpr &expr)
return;
}
- if (candidates.size () > 1)
- {
- rich_location r (line_table, expr.get_method_name ().get_locus ());
- std::string rich_msg
- = "multiple " + expr.get_method_name ().get_segment ().as_string ()
- + " found";
+ tl::optional<const MethodCandidate &> candidate = *candidates.begin ();
- for (auto &c : candidates)
- r.add_range (c.candidate.locus);
+ if (candidates.size () > 1)
+ candidate = handle_multiple_candidates (expr, candidates);
- r.add_fixit_replace (rich_msg.c_str ());
+ if (!candidate)
+ return;
- rust_error_at (
- r, ErrorCode::E0592, "duplicate definitions with name %qs",
- expr.get_method_name ().get_segment ().as_string ().c_str ());
- return;
- }
+ auto found_candidate = *candidate;
- auto candidate = *candidates.begin ();
rust_debug_loc (expr.get_method_name ().get_locus (),
"resolved method to: {%u} {%s} with [%lu] adjustments",
- candidate.candidate.ty->get_ref (),
- candidate.candidate.ty->debug_str ().c_str (),
- (unsigned long) candidate.adjustments.size ());
+ found_candidate.candidate.ty->get_ref (),
+ found_candidate.candidate.ty->debug_str ().c_str (),
+ (unsigned long) found_candidate.adjustments.size ());
// Get the adjusted self
Adjuster adj (receiver_tyty);
- TyTy::BaseType *adjusted_self = adj.adjust_type (candidate.adjustments);
+ TyTy::BaseType *adjusted_self = adj.adjust_type (found_candidate.adjustments);
rust_debug ("receiver: %s adjusted self %s",
receiver_tyty->debug_str ().c_str (),
adjusted_self->debug_str ().c_str ());
@@ -1219,10 +1300,10 @@ TypeCheckExpr::visit (HIR::MethodCallExpr &expr)
HirId autoderef_mappings_id
= expr.get_receiver ().get_mappings ().get_hirid ();
context->insert_autoderef_mappings (autoderef_mappings_id,
- std::move (candidate.adjustments));
+ std::move (found_candidate.adjustments));
- PathProbeCandidate &resolved_candidate = candidate.candidate;
- TyTy::BaseType *lookup_tyty = candidate.candidate.ty;
+ PathProbeCandidate &resolved_candidate = found_candidate.candidate;
+ TyTy::BaseType *lookup_tyty = found_candidate.candidate.ty;
NodeId resolved_node_id
= resolved_candidate.is_impl_candidate ()
? resolved_candidate.item.impl.impl_item->get_impl_mappings ()
@@ -1249,8 +1330,8 @@ TypeCheckExpr::visit (HIR::MethodCallExpr &expr)
fn->prepare_higher_ranked_bounds ();
rust_debug_loc (expr.get_locus (), "resolved method call to: {%u} {%s}",
- candidate.candidate.ty->get_ref (),
- candidate.candidate.ty->debug_str ().c_str ());
+ found_candidate.candidate.ty->get_ref (),
+ found_candidate.candidate.ty->debug_str ().c_str ());
if (resolved_candidate.is_impl_candidate ())
{
diff --git a/gcc/rust/util/rust-attribute-values.h b/gcc/rust/util/rust-attribute-values.h
index 9ef5cc5..47e6a17 100644
--- a/gcc/rust/util/rust-attribute-values.h
+++ b/gcc/rust/util/rust-attribute-values.h
@@ -40,12 +40,14 @@ public:
static constexpr auto &NO_MANGLE = "no_mangle";
static constexpr auto &REPR = "repr";
static constexpr auto &RUSTC_BUILTIN_MACRO = "rustc_builtin_macro";
+ static constexpr auto &RUSTC_MACRO_TRANSPARENCY = "rustc_macro_transparency";
static constexpr auto &PATH = "path";
static constexpr auto &MACRO_USE = "macro_use";
static constexpr auto &MACRO_EXPORT = "macro_export";
static constexpr auto &PROC_MACRO = "proc_macro";
static constexpr auto &PROC_MACRO_DERIVE = "proc_macro_derive";
static constexpr auto &PROC_MACRO_ATTRIBUTE = "proc_macro_attribute";
+
static constexpr auto &TARGET_FEATURE = "target_feature";
// From now on, these are reserved by the compiler and gated through
// #![feature(rustc_attrs)]
@@ -54,10 +56,35 @@ public:
= "rustc_inherit_overflow_checks";
static constexpr auto &STABLE = "stable";
static constexpr auto &UNSTABLE = "unstable";
+
+ static constexpr auto &RUSTC_PROMOTABLE = "rustc_promotable";
static constexpr auto &RUSTC_CONST_STABLE = "rustc_const_stable";
static constexpr auto &RUSTC_CONST_UNSTABLE = "rustc_const_unstable";
+
+ static constexpr auto &RUSTC_SPECIALIZATION_TRAIT
+ = "rustc_specialization_trait";
+ static constexpr auto &RUSTC_UNSAFE_SPECIALIZATION_MARKER
+ = "rustc_unsafe_specialization_marker";
+ static constexpr auto &RUSTC_RESERVATION_IMPL = "rustc_reservation_impl";
+ static constexpr auto &RUSTC_PAREN_SUGAR = "rustc_paren_sugar";
+ static constexpr auto &RUSTC_NONNULL_OPTIMIZATION_GUARANTEED
+ = "rustc_nonnull_optimization_guaranteed";
+
+ static constexpr auto &RUSTC_LAYOUT_SCALAR_VALID_RANGE_START
+ = "rustc_layout_scalar_valid_range_start";
+
static constexpr auto &MAY_DANGLE = "may_dangle";
static constexpr auto &PRELUDE_IMPORT = "prelude_import";
+ static constexpr auto &TRACK_CALLER = "track_caller";
+
+ static constexpr auto &RUSTC_DIAGNOSTIC_ITEM = "rustc_diagnostic_item";
+ static constexpr auto &RUSTC_ON_UNIMPLEMENTED = "rustc_on_unimplemented";
+
+ static constexpr auto &FUNDAMENTAL = "fundamental";
+
+ static constexpr auto &NON_EXHAUSTIVE = "non_exhaustive";
+
+ static constexpr auto &RUSTFMT = "rustfmt";
};
} // namespace Values
} // namespace Rust
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index 03452c7..c77e99c 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -57,6 +57,7 @@ static const BuiltinAttrDefinition __definitions[]
{Attrs::NO_MANGLE, CODE_GENERATION},
{Attrs::REPR, CODE_GENERATION},
{Attrs::RUSTC_BUILTIN_MACRO, EXPANSION},
+ {Attrs::RUSTC_MACRO_TRANSPARENCY, EXPANSION},
{Attrs::PATH, EXPANSION},
{Attrs::MACRO_USE, NAME_RESOLUTION},
{Attrs::MACRO_EXPORT, NAME_RESOLUTION},
@@ -72,10 +73,29 @@ static const BuiltinAttrDefinition __definitions[]
{Attrs::RUSTC_INHERIT_OVERFLOW_CHECKS, CODE_GENERATION},
{Attrs::STABLE, STATIC_ANALYSIS},
{Attrs::UNSTABLE, STATIC_ANALYSIS},
+
// assuming we keep these for static analysis
+ {Attrs::RUSTC_PROMOTABLE, CODE_GENERATION},
{Attrs::RUSTC_CONST_STABLE, STATIC_ANALYSIS},
{Attrs::RUSTC_CONST_UNSTABLE, STATIC_ANALYSIS},
- {Attrs::PRELUDE_IMPORT, NAME_RESOLUTION}};
+ {Attrs::PRELUDE_IMPORT, NAME_RESOLUTION},
+ {Attrs::TRACK_CALLER, CODE_GENERATION},
+ {Attrs::RUSTC_SPECIALIZATION_TRAIT, TYPE_CHECK},
+ {Attrs::RUSTC_UNSAFE_SPECIALIZATION_MARKER, TYPE_CHECK},
+ {Attrs::RUSTC_RESERVATION_IMPL, TYPE_CHECK},
+ {Attrs::RUSTC_PAREN_SUGAR, TYPE_CHECK},
+ {Attrs::RUSTC_NONNULL_OPTIMIZATION_GUARANTEED, TYPE_CHECK},
+
+ {Attrs::RUSTC_LAYOUT_SCALAR_VALID_RANGE_START, CODE_GENERATION},
+
+ {Attrs::PRELUDE_IMPORT, NAME_RESOLUTION},
+
+ {Attrs::RUSTC_DIAGNOSTIC_ITEM, STATIC_ANALYSIS},
+ {Attrs::RUSTC_ON_UNIMPLEMENTED, STATIC_ANALYSIS},
+
+ {Attrs::FUNDAMENTAL, TYPE_CHECK},
+ {Attrs::NON_EXHAUSTIVE, TYPE_CHECK},
+ {Attrs::RUSTFMT, EXTERNAL}};
BuiltinAttributeMappings *
BuiltinAttributeMappings::get ()
diff --git a/gcc/rust/util/rust-attributes.h b/gcc/rust/util/rust-attributes.h
index c928c8e..7c7a1fc 100644
--- a/gcc/rust/util/rust-attributes.h
+++ b/gcc/rust/util/rust-attributes.h
@@ -40,7 +40,12 @@ enum CompilerPass
HIR_LOWERING,
TYPE_CHECK,
STATIC_ANALYSIS,
- CODE_GENERATION
+ CODE_GENERATION,
+
+ // External Rust tooling attributes, like #[rustfmt::skip]
+ EXTERNAL,
+
+ // Do we need to add something here for const fns?
};
struct BuiltinAttrDefinition
diff --git a/gcc/rust/util/rust-lang-item.cc b/gcc/rust/util/rust-lang-item.cc
index a76cc7f..9aff31b 100644
--- a/gcc/rust/util/rust-lang-item.cc
+++ b/gcc/rust/util/rust-lang-item.cc
@@ -118,6 +118,7 @@ const BiMap<std::string, LangItem::Kind> Rust::LangItem::lang_items = {{
{"discriminant_kind", Kind::DISCRIMINANT_KIND},
{"discriminant_type", Kind::DISCRIMINANT_TYPE},
+ {"manually_drop", Kind::MANUALLY_DROP},
}};
tl::optional<LangItem::Kind>
diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h
index 8f3af36..67a5d9c 100644
--- a/gcc/rust/util/rust-lang-item.h
+++ b/gcc/rust/util/rust-lang-item.h
@@ -150,6 +150,8 @@ public:
DISCRIMINANT_TYPE,
DISCRIMINANT_KIND,
+
+ MANUALLY_DROP,
};
static const BiMap<std::string, Kind> lang_items;
diff --git a/gcc/sanitizer.def b/gcc/sanitizer.def
index 4b7c9dc..c5a9c2d 100644
--- a/gcc/sanitizer.def
+++ b/gcc/sanitizer.def
@@ -247,7 +247,7 @@ DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_INIT, "__tsan_init",
DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_FUNC_ENTRY, "__tsan_func_entry",
BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_FUNC_EXIT, "__tsan_func_exit",
- BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
+ BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_VPTR_UPDATE, "__tsan_vptr_update",
BT_FN_VOID_PTR_PTR, ATTR_NOTHROW_LEAF_LIST)
DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ1, "__tsan_read1",
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c99e6df..521176a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,826 @@
+2025-04-20 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/117863
+ * gcc.dg/rtl/i386/vector_eq-2.c: New test.
+ * gcc.dg/rtl/i386/vector_eq-3.c: Likewise.
+
+2025-04-19 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR testsuite/119508
+ * rust/compile/nr2/compile.exp: Disable parallel testing.
+
+2025-04-19 Co-authored-by: Jeff Law <jlaw@ventanamicro.com>
+
+ PR target/118410
+ * gcc.target/riscv/pr118410-1.c: New test.
+ * gcc.target/riscv/pr118410-2.c: Likewise.
+
+2025-04-19 Andrew Pinski <quic_apinski@quicinc.com>
+
+ * gcc.dg/pr118947-1.c: Use 1025 as the size of the buf.
+ * gcc.dg/pr78408-3.c: Likewise.
+
+2025-04-19 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR rtl-optimization/111949
+ * gcc.target/aarch64/bic-1.c: New test.
+
+2025-04-19 Jiaxun Yang <jiaxun.yang@flygoat.com>
+
+ PR target/111814
+ * gcc.target/sh/pr111814.c: New test.
+
+2025-04-19 Maciej W. Rozycki <macro@orcam.me.uk>
+
+ * gcc.target/alpha/memcpy-nested-offset-long.c: New file.
+ * gcc.target/alpha/memcpy-nested-offset-quad.c: New file.
+
+2025-04-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/119836
+ * gfortran.dg/do_concurrent_all_clauses.f90: Remove invalid
+ dg-error test.
+ * gfortran.dg/pr119836_1.f90: New test.
+ * gfortran.dg/pr119836_2.f90: New test.
+ * gfortran.dg/pr119836_3.f90: New test.
+ * gfortran.dg/pr119836_4.f90: New test.
+
+2025-04-18 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR cobol/119818
+ * cobol.dg/group2/FUNCTION_DATE___TIME_OMNIBUS.cob:
+ 'dg-set-target-env-var TZ UTC0'.
+
+2025-04-18 Jeff Law <jlaw@ventanamicro.com>
+
+ * gcc.target/riscv/bext-ext-2.c: New test
+
+2025-04-18 Jonathan Yong <10walls@gmail.com>
+
+ * g++.dg/abi/ref-temp1.C: Replicate some test based on
+ PE expectations.
+ * lib/target-supports.exp: New check_effective_target_pe.
+
+2025-04-18 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR tree-optimization/87901
+ * gcc.dg/tree-ssa/ssa-dse-53.c: New test.
+ * gcc.dg/tree-ssa/ssa-dse-54.c: New test.
+
+2025-04-18 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR tree-optimization/87901
+ * gcc.dg/tree-ssa/ssa-dse-52.c: New test.
+
+2025-04-18 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR tree-optimization/118902
+ * gcc.dg/tree-ssa/pr118902-1.c: New test.
+
+2025-04-18 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR tree-optimization/118947
+ * gcc.dg/pr118947-1.c: New test.
+
+2025-04-18 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR tree-optimization/78408
+ PR tree-optimization/118947
+ * gcc.dg/pr78408-3.c: New test.
+
+2025-04-18 Dimitar Dimitrov <dimitar@dinux.eu>
+
+ * gcc.dg/pr116357.c: Use sizeof(int) instead of alignof(int).
+
+2025-04-18 Alexey Merzlyakov <alexey.merzlyakov@samsung.com>
+
+ PR middle-end/108016
+ * gcc.target/riscv/pr108016.c: New test.
+
+2025-04-18 kelefth <konstantinos.eleftheriou@vrull.eu>
+
+ PR rtl-optimization/119160
+ * gcc.dg/pr119160.c: New test.
+
+2025-04-18 Xing Li <lixing@loongson.cn>
+
+ * gcc.target/loongarch/vector/loongarch-vector.exp: Change
+ {dg-do-what-default} save and restore logical.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp2a/constexpr-dtor16.C: Adjust diagnostic.
+ * g++.dg/cpp2a/constexpr-dynamic10.C: Likewise.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp1y/constexpr-new.C: Adjust diagnostics.
+ * g++.dg/cpp1z/constexpr-asm-5.C: Likewise.
+ * g++.dg/cpp26/static_assert1.C: Likewise.
+ * g++.dg/cpp2a/constexpr-dtor7.C: Likewise.
+ * g++.dg/cpp2a/constexpr-new26.C: Likewise.
+ * g++.dg/cpp2a/constexpr-new3.C: Likewise.
+ * g++.dg/cpp2a/constinit14.C: Likewise.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp26/pack-indexing2.C: Adjust diagnostics.
+ * g++.dg/ext/type_pack_element2.C: Likewise.
+ * g++.dg/ext/type_pack_element4.C: Likewise.
+
+2025-04-17 Tamar Christina <tamar.christina@arm.com>
+
+ PR tree-optimization/119351
+ * gcc.target/aarch64/sve/pr119351.c: New test.
+ * gcc.target/aarch64/sve/pr119351_run.c: New test.
+
+2025-04-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/119834
+ * g++.target/s390/pr119834.C: New test.
+
+2025-04-17 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * gdc.test/fail_compilation/test21247.d: New test.
+ * gdc.test/fail_compilation/test21247b.d: New test.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/113360
+ * g++.dg/cpp23/constexpr-nonlit18.C: Remove redundant message.
+ * g++.dg/cpp1y/constexpr-diag2.C: New test.
+ * g++.dg/cpp1y/pr63996.C: Adjust expected errors.
+ * g++.dg/template/explicit-args6.C: Likewise.
+ * g++.dg/cpp0x/constexpr-ice21.C: Likewise.
+
+2025-04-16 Alexandre Oliva <oliva@adacore.com>
+
+ * gcc.dg/ipa/ipa-sra-19.c: Add -Wno-psabi on ppc-elf too.
+
+2025-04-16 Peter Bergner <bergner@linux.ibm.com>
+
+ PR tree-optimization/112822
+ * g++.dg/pr112822.C: Replace altivec vector attribute with a generic
+ vector attribute.
+
+2025-04-16 Eric Botcazou <ebotcazou@gcc.gnu.org>
+
+ * gnat.dg/opt105.adb: New test.
+ * gnat.dg/opt105_pkg.ads, gnat.dg/opt105_pkg.adb: New helper.
+
+2025-04-16 Jason Merrill <jason@redhat.com>
+
+ PR c++/114772
+ PR c++/101180
+ * g++.dg/ext/pragma-target2.C: New test.
+
+2025-04-16 Jason Merrill <jason@redhat.com>
+
+ PR c++/116954
+ * g++.dg/warn/Wformat-3.C: New test.
+
+2025-04-16 Ard Biesheuvel <ardb@kernel.org>
+
+ PR target/119386
+ * gcc.target/i386/pr119386-3.c: New test.
+
+2025-04-16 Ard Biesheuvel <ardb@kernel.org>
+
+ PR target/119386
+ * gcc.target/i386/pr119386-1.c: New test.
+ * gcc.target/i386/pr119386-2.c: New test.
+
+2025-04-16 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/106948
+ * gfortran.dg/pure_formal_proc_4.f90: New test.
+
+2025-04-16 Jan Hubicka <hubicka@ucw.cz>
+
+ * g++.dg/lto/pr119614_0.C: New test.
+
+2025-04-16 Tamar Christina <tamar.christina@arm.com>
+
+ PR target/119286
+ * gcc.dg/vect/vect-early-break_18.c: Force -march=gfx908 for amdgcn.
+
+2025-04-16 Tamar Christina <tamar.christina@arm.com>
+
+ PR tree-optimization/119351
+ * gcc.target/aarch64/sve/peel_ind_10.c: New test.
+ * gcc.target/aarch64/sve/peel_ind_10_run.c: New test.
+ * gcc.target/aarch64/sve/peel_ind_5.c: New test.
+ * gcc.target/aarch64/sve/peel_ind_5_run.c: New test.
+ * gcc.target/aarch64/sve/peel_ind_6.c: New test.
+ * gcc.target/aarch64/sve/peel_ind_6_run.c: New test.
+ * gcc.target/aarch64/sve/peel_ind_7.c: New test.
+ * gcc.target/aarch64/sve/peel_ind_7_run.c: New test.
+ * gcc.target/aarch64/sve/peel_ind_8.c: New test.
+ * gcc.target/aarch64/sve/peel_ind_8_run.c: New test.
+ * gcc.target/aarch64/sve/peel_ind_9.c: New test.
+ * gcc.target/aarch64/sve/peel_ind_9_run.c: New test.
+
+2025-04-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/119808
+ * gcc.dg/bitint-121.c: New test.
+
+2025-04-16 Jesse Huang <jesse.huang@sifive.com>
+
+ * gcc.target/riscv/gnu-property-align-rv32.c: New file.
+ * gcc.target/riscv/gnu-property-align-rv64.c: New file.
+
+2025-04-16 Kito Cheng <kito.cheng@sifive.com>
+
+ * gcc.target/riscv/jump-table-large-code-model.c: New test.
+
+2025-04-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/116093
+ * gcc.dg/bitint-122.c: New test.
+
+2025-04-16 Alice Carlotti <alice.carlotti@arm.com>
+
+ * gcc.target/aarch64/acle/rwsr-ungated.c: New test.
+
+2025-04-15 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/119826
+ * gdc.dg/debug/imports/pr119826b.d: New test.
+ * gdc.dg/debug/pr119826.d: New test.
+
+2025-04-15 Nathaniel Shead <nathanieloshead@gmail.com>
+
+ PR c++/119755
+ * g++.dg/modules/lambda-10_a.H: New test.
+ * g++.dg/modules/lambda-10_b.C: New test.
+
+2025-04-15 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/completion-2.c: Expect also -flto-partition=default line.
+
+2025-04-15 Qing Zhao <qing.zhao@oracle.com>
+
+ PR c/119717
+ * gcc.dg/pr119717.c: New test.
+
+2025-04-15 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/119784
+ * gcc.target/i386/apx-interrupt-1.c: Expect 31 .cfi_restore
+ directives.
+
+2025-04-15 Vineet Gupta <vineetg@rivosinc.com>
+
+ PR target/119533
+ * go.dg/pr119533-riscv.go: New test.
+ * go.dg/pr119533-riscv-2.go: New test.
+
+2025-04-15 Robin Dapp <rdapp@ventanamicro.com>
+
+ PR target/119547
+ * gcc.target/riscv/rvv/vsetvl/avl_single-68.c: xfail.
+ * g++.target/riscv/rvv/autovec/pr119547.C: New test.
+ * g++.target/riscv/rvv/autovec/pr119547-2.C: New test.
+ * gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-10.c: Adjust.
+
+2025-04-15 Tobias Burnus <tburnus@baylibre.com>
+
+ * gfortran.dg/gomp/map-alloc-comp-1.f90: Remove dg-error.
+ * gfortran.dg/gomp/polymorphic-mapping-2.f90: Update warn wording.
+ * gfortran.dg/gomp/polymorphic-mapping.f90: Change expected
+ diagnostic; some tests moved to ...
+ * gfortran.dg/gomp/polymorphic-mapping-1.f90: ... here as new test.
+ * gfortran.dg/gomp/polymorphic-mapping-3.f90: New test.
+ * gfortran.dg/gomp/polymorphic-mapping-4.f90: New test.
+ * gfortran.dg/gomp/polymorphic-mapping-5.f90: New test.
+
+2025-04-15 Martin Jambor <mjambor@suse.cz>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR ipa/119803
+ * gcc.dg/ipa/pr119803.c: New test.
+
+2025-04-15 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/119799
+ * gdc.dg/import-c/pr119799.d: New test.
+ * gdc.dg/import-c/pr119799c.c: New test.
+
+2025-04-15 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/119807
+ PR c++/112288
+ * g++.dg/template/friend86.C: New test.
+ * g++.dg/template/friend87.C: New test.
+
+2025-04-15 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/119817
+ * gdc.dg/debug/imports/m119817/a.d: New test.
+ * gdc.dg/debug/imports/m119817/b.d: New test.
+ * gdc.dg/debug/imports/m119817/package.d: New test.
+ * gdc.dg/debug/pr119817.d: New test.
+
+2025-04-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/119801
+ * c-c++-common/tsan/pr119801.c: New test.
+
+2025-04-15 Jonathan Yong <10walls@gmail.com>
+
+ * gcc.dg/Wbuiltin-declaration-mismatch-4.c: Make diagnostic
+ accept long long.
+
+2025-04-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR ipa/119318
+ * gcc.dg/ipa/pr119318.c: Remove dg-additional-options, add -w to
+ dg-options.
+
+2025-04-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/113835
+ * g++.dg/cpp2a/constexpr-vector1.C: New test.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR target/118794
+ * g++.target/gcn/exceptions-bad_cast-2.C: Set
+ '-mno-fake-exceptions'.
+ * g++.target/gcn/exceptions-pr118794-1.C: Likewise.
+ * g++.target/gcn/exceptions-throw-2.C: Likewise.
+ * g++.target/nvptx/exceptions-bad_cast-2.C: Likewise.
+ * g++.target/nvptx/exceptions-pr118794-1.C: Likewise.
+ * g++.target/nvptx/exceptions-throw-2.C: Likewise.
+ * g++.target/gcn/exceptions-bad_cast-2_-mfake-exceptions.C: New.
+ * g++.target/gcn/exceptions-pr118794-1_-mfake-exceptions.C:
+ Likewise.
+ * g++.target/gcn/exceptions-throw-2_-mfake-exceptions.C: Likewise.
+ * g++.target/nvptx/exceptions-bad_cast-2_-mfake-exceptions.C:
+ Likewise.
+ * g++.target/nvptx/exceptions-pr118794-1_-mfake-exceptions.C:
+ Likewise.
+ * g++.target/nvptx/exceptions-throw-2_-mfake-exceptions.C:
+ Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * g++.target/gcn/exceptions-throw-3.C: New.
+ * g++.target/nvptx/exceptions-throw-3.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * g++.target/gcn/exceptions-throw-2.C: New.
+ * g++.target/nvptx/exceptions-throw-2.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * g++.target/gcn/exceptions-throw-1.C: New.
+ * g++.target/nvptx/exceptions-throw-1.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * g++.target/gcn/exceptions-bad_cast-3.C: New.
+ * g++.target/nvptx/exceptions-bad_cast-3.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * g++.target/gcn/exceptions-bad_cast-2.C: New.
+ * g++.target/nvptx/exceptions-bad_cast-2.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * g++.target/gcn/exceptions-bad_cast-1.C: New.
+ * g++.target/nvptx/exceptions-bad_cast-1.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR target/118794
+ * g++.target/gcn/exceptions-pr118794-1.C: New.
+ * g++.target/nvptx/exceptions-pr118794-1.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR c++/119692
+ * g++.target/gcn/pr119692-1-1.C: New.
+ * g++.target/nvptx/pr119692-1-1.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * g++.target/gcn/gcn.exp: New.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * lib/gcc-dg.exp (${tool}_load): Polish 'dg-output-file' test
+ logs.
+
+2025-04-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR ipa/119318
+ * gcc.dg/ipa/pr119530.c (d): Change type from char to signed char.
+ (e): Change argument type from long to long long.
+
+2025-04-14 beamandala <mandalapubhavesh@gmail.com>
+
+ * rust/compile/track_caller.rs: New test.
+
+2025-04-14 Owen Avery <powerboat9.gamer@gmail.com>
+
+ * rust/compile/enum_discriminant2.rs: New test.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * rust/compile/format_args_extra_comma.rs: New test.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * rust/compile/macros/mbe/macro-issue3709-1.rs: New test.
+ * rust/compile/macros/mbe/macro-issue3709-2.rs: New test.
+ * rust/compile/macros/mbe/macro-issue3693.rs: New file.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * rust/compile/macros/mbe/macro-issue3708.rs: New test.
+
+2025-04-14 Arthur Cohen <arthur.cohen@embecosm.com>
+
+ * rust/execute/torture/min_specialization2.rs: New test.
+ * rust/execute/torture/min_specialization3.rs: New test.
+
+2025-04-14 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR tree-optimization/118476
+ * gcc.dg/torture/pr118476-1.c: New test.
+
+2025-04-14 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/99214
+ * g++.dg/concepts/diagnostic20.C: New test.
+
+2025-04-14 H.J. Lu <hjl.tools@gmail.com>
+
+ PR target/119784
+ * gcc.target/i386/pr119784a.c: New test.
+ * gcc.target/i386/pr119784b.c: Likewise.
+
+2025-04-14 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/119318
+ * gcc.dg/ipa/pr119318.c: New test.
+ * gcc.dg/ipa/pr119530.c: Likwise.
+
+2025-04-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/119757
+ * gcc.dg/vect/pr119757.c: New testcase.
+
+2025-04-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/119778
+ * g++.dg/torture/pr119778.C: New testcase.
+
+2025-04-14 Gaius Mulley <gaiusmod2@gmail.com>
+
+ PR modula2/119779
+ * gm2.dg/doc/examples/pass/doc-examples-pass.exp: New test.
+ * gm2.dg/doc/examples/pass/exampleadd.mod: New test.
+ * gm2.dg/doc/examples/pass/exampleadd2.mod: New test.
+ * gm2.dg/doc/examples/pass/hello.mod: New test.
+ * gm2.dg/doc/examples/pass/hellopim.mod: New test.
+
+2025-04-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR lto/119792
+ * gnat.dg/lto29.adb: New test.
+ * gnat.dg/lto29_pkg.ads: New helper.
+
+2025-04-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/119502
+ * gfortran.dg/pr119502.f90: New test.
+
+2025-04-13 Nathaniel Shead <nathanieloshead@gmail.com>
+
+ * g++.dg/modules/noexcept-4_a.H: New test.
+ * g++.dg/modules/noexcept-4_b.C: New test.
+
+2025-04-13 Nathaniel Shead <nathanieloshead@gmail.com>
+
+ * g++.dg/modules/lambda-8_b.C: Adjust error.
+ * g++.dg/modules/leg-merge-4_c.C: Likewise.
+
+2025-04-13 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/119669
+ * gfortran.dg/interface_59.f90: New test.
+
+2025-04-12 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/119761
+ * gdc.dg/import-c/import-c.exp: New test.
+ * gdc.dg/import-c/pr119761.d: New test.
+ * gdc.dg/import-c/pr119761c.c: New test.
+
+2025-04-12 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/109023
+ * gdc.dg/torture/imports/pr109023.d: New test.
+ * gdc.dg/torture/pr109023.d: New test.
+
+2025-04-12 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/119758
+ * gdc.dg/driver_fonly1.d: New test.
+ * gdc.dg/driver_fonly2.d: New test.
+ * gdc.dg/driver_fonly3.d: New test.
+ * gdc.dg/imports/fonly.d: New test.
+
+2025-04-12 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR testsuite/117706
+ * gcc.dg/ira-shrinkwrap-prep-1.c: Unxfail for i?68-*-* and x86_64-*-*.
+ * gcc.dg/ira-shrinkwrap-prep-2.c: Likewise.
+
+2025-04-12 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/116416
+ * g++.dg/cpp1y/constexpr-prvalue1.C: Adjust to instead inspect
+ the 'original' dump.
+ * g++.dg/cpp1y/constexpr-prvalue1a.C: New test.
+
+2025-04-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/119722
+ * gcc.dg/torture/bitint-77.c: New test.
+
+2025-04-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/renaming17.adb: New test.
+
+2025-04-12 Bob Dubner <rdubner@symas.com>
+
+ PR cobol/119694
+ * cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob: GCOBOL_CURRENT_DATE.
+ * cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob: Likewise
+ * cobol.dg/group2/FUNCTION_DATE___TIME_OMNIBUS.cob: Likewise
+
+2025-04-11 Christophe Lyon <christophe.lyon@linaro.org>
+
+ * lib/target-supports.exp: Rename arm_v8_1_lob_ok into
+ arm_v8_1m_lob_hw.
+ Rename arm_thumb2_no_arm_v8_1_lob into
+ arm_thumb2_no_arm_v8_1m_lob.
+ Rename arm_thumb2_ok_no_arm_v8_1_lob into
+ arm_thumb2_ok_no_arm_v8_1m_lob.
+ * gcc.target/arm/lob1.c: Likewise.
+ * gcc.target/arm/lob6.c: Likewise.
+ * gcc.target/arm/ivopts.c: Likewise.
+ * gcc.target/arm/unsigned-extend-2.c: Likewise.
+
+2025-04-11 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR rtl-optimization/118502
+ * g++.dg/opt/shrink-wrapping-vector-1.C: New test.
+
+2025-04-11 Jeff Law <jlaw@ventanamicro.com>
+
+ * gcc.target/riscv/rvv/base/pr115068-run.c: Turn off pedantic diagnostics.
+ * gcc.target/riscv/rvv/base/pr115068.c: Likewise.
+ * gcc.target/riscv/rvv/base/vwaddsub-1.c: Likewise.
+
+2025-04-11 Jason Merrill <jason@redhat.com>
+
+ PR c++/114970
+ * g++.dg/opt/is_constant_evaluated4.C: New test.
+
+2025-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/119707
+ * gcc.dg/torture/bitint-76.c: New test.
+
+2025-04-11 Jennifer Schmitz <jschmitz@nvidia.com>
+
+ PR tree-optimization/119706
+ * g++.target/aarch64/sve/pr119706.C: New test.
+
+2025-04-11 Jonathan Yong <10walls@gmail.com>
+
+ PR target/113633
+ * gcc.dg/bf-ms-attrib.c: Fix expected __ms_struct__ layout
+ size.
+
+2025-04-11 Jonathan Yong <10walls@gmail.com>
+
+ * c-c++-common/analyzer/realloc-1.c: Make diagnostic accept
+ long long for __builtin_realloc warning.
+
+2025-04-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/119345
+ * g++.dg/cpp2a/lambda-targ14.C: New test.
+
+2025-04-10 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/119687
+ * g++.dg/cpp23/class-deduction-inherited8.C: New test.
+
+2025-04-10 Bob Dubner <rdubner@symas.com>
+
+ * cobol.dg/group2/Dynamic_reference_modification.cob: New testcase.
+ * cobol.dg/group2/Length_overflow__1_.cob: Likewise.
+ * cobol.dg/group2/Length_overflow__2_.cob: Likewise.
+ * cobol.dg/group2/Length_overflow_with_offset__1_.cob: Likewise.
+ * cobol.dg/group2/Length_overflow_with_offset__2_.cob: Likewise.
+ * cobol.dg/group2/Length_overflow_with_offset__3_.cob: Likewise.
+ * cobol.dg/group2/Offset_overflow.cob: Likewise.
+ * cobol.dg/group2/Offset_underflow.cob: Likewise.
+ * cobol.dg/group2/Refmod__comparisons_inside_numeric-display.cob: Likewise.
+ * cobol.dg/group2/Refmod_sources_are_figurative_constants.cob: Likewise.
+ * cobol.dg/group2/Static_reference_modification.cob: Likewise.
+ * cobol.dg/group2/Dynamic_reference_modification.out: New known-good result.
+ * cobol.dg/group2/Length_overflow__1_.out: Likewise.
+ * cobol.dg/group2/Length_overflow__2_.out: Likewise.
+ * cobol.dg/group2/Length_overflow_with_offset__1_.out: Likewise.
+ * cobol.dg/group2/Length_overflow_with_offset__2_.out: Likewise.
+ * cobol.dg/group2/Length_overflow_with_offset__3_.out: Likewise.
+ * cobol.dg/group2/Offset_overflow.out: Likewise.
+ * cobol.dg/group2/Offset_underflow.out: Likewise.
+ * cobol.dg/group2/Refmod__comparisons_inside_numeric-display.out: Likewise.
+ * cobol.dg/group2/Refmod_sources_are_figurative_constants.out: Likewise.
+ * cobol.dg/group2/Static_reference_modification.out: Likewise.
+
+2025-04-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/119175
+ * g++.dg/cpp2a/concepts-lambda23.C: New test.
+
+2025-04-10 Iain Sandoe <iain@sandoe.co.uk>
+
+ * lib/cobol.exp: Add libquadmath paths.
+
+2025-04-10 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR tree-optimization/119399
+ * gcc.dg/vect/pr119399.c: New test.
+
+2025-04-10 Kito Cheng <kito.cheng@sifive.com>
+
+ * gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-1.c: Include local
+ riscv_vector.h.
+ * gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-2.c: Ditto.
+ * gcc.target/riscv/rvv/base/abi-callee-saved-1-save-restore.c: Ditto.
+ * gcc.target/riscv/rvv/base/abi-callee-saved-1-zcmp.c: Ditto.
+ * gcc.target/riscv/rvv/base/abi-callee-saved-1.c: Ditto.
+ * gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c: Ditto.
+ * gcc.target/riscv/rvv/base/abi-callee-saved-2-zcmp.c: Ditto.
+ * gcc.target/riscv/rvv/base/abi-callee-saved-2.c: Ditto.
+ * gcc.target/riscv/rvv/base/bug-10-2.c: Ditto.
+ * gcc.target/riscv/rvv/base/bug-10.c: Ditto.
+ * gcc.target/riscv/rvv/base/bug-7.c: Ditto.
+ * gcc.target/riscv/rvv/base/bug-8.c: Ditto.
+ * gcc.target/riscv/rvv/base/bug-9.c: Ditto.
+ * gcc.target/riscv/rvv/base/pr110943.c: Ditto.
+ * gcc.target/riscv/rvv/base/pr112431-21.c: Ditto.
+ * gcc.target/riscv/rvv/base/pr114639-1.c: Ditto.
+ * gcc.target/riscv/rvv/base/pr115068.c: Ditto.
+ * gcc.target/riscv/rvv/base/pr117286.c: Ditto.
+ * gcc.target/riscv/rvv/base/pr117544.c: Ditto.
+ * gcc.target/riscv/rvv/base/pr117955.c: Ditto.
+ * gcc.target/riscv/rvv/base/pr118872.c: Ditto.
+ * gcc.target/riscv/rvv/base/vlmul_ext-1.c: Ditto.
+ * gcc.target/riscv/rvv/base/vssubu-1.c: Ditto.
+ * gcc.target/riscv/rvv/base/vssubu-2.c: Ditto.
+ * gcc.target/riscv/rvv/base/vwaddsub-1.c: Ditto.
+ * gcc.target/riscv/rvv/vsetvl/pr111234.c: Ditto.
+ * gcc.target/riscv/rvv/vsetvl/pr115214.c: Ditto.
+ * gcc.target/riscv/rvv/vsetvl/vsetvl-24.c: Ditto.
+ * gcc.target/riscv/rvv/vsetvl/vsetvl_bug-3.c: Ditto.
+ * gcc.target/riscv/rvv/vsetvl/vsetvl_bug-4.c: Ditto.
+ * gcc.target/riscv/rvv/xtheadvector/pr116591.c: Ditto.
+ * gcc.target/riscv/rvv/xtheadvector/pr116592.c: Ditto.
+ * gcc.target/riscv/rvv/xtheadvector/pr118357.c: Ditto.
+ * gcc.target/riscv/rvv/xtheadvector/vsext.c: Ditto.
+ * gcc.target/riscv/rvv/xtheadvector/vzext.c: Ditto.
+
+2025-04-09 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/119574
+ * g++.dg/cpp2a/lambda-targ13.C: New test.
+ * g++.dg/cpp2a/lambda-targ13a.C: New test.
+ * g++.dg/cpp2a/lambda-targ13b.C: New test.
+
+2025-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/119664
+ * gcc.dg/pr119664.c: New test.
+
+2025-04-09 Andrew Pinski <quic_apinski@quicinc.com>
+
+ PR middle-end/116595
+ * g++.target/aarch64/sve/pr116595.C: New test.
+
+2025-04-09 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/118309
+ * gdc.dg/debug/dwarf2/pr118309.d: New test.
+
+2025-04-09 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/119656
+ * gfortran.dg/optional_absent_13.f90: New test.
+
+2025-04-09 Jeff Law <jlaw@ventanamicro.com>
+
+ * gcc.target/riscv/sat/sat_s_sub-1-i64.c: Update expected output.
+ * gcc.target/riscv/sat/sat_s_sub-2-i64.c: Likewise.
+ * gcc.target/riscv/sat/sat_s_sub-3-i64.c: Likewise.
+ * gcc.target/riscv/sat/sat_s_sub-4-i64.c: Likewise.
+
+2025-04-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/pr67215-1.c: Correctly escape
+ asterisk in scan-assembler dirctive.
+ * gcc.target/i386/pr67215-2.c: Ditto.
+
+2025-04-09 Jonathan Yong <10walls@gmail.com>
+
+ PR analyzer/113253
+ * gcc.dg/analyzer/deref-before-check-pr113253.c:
+ (ptrdiff_t): use stddef.h type.
+ (uintptr_t): ditto.
+ (EMACS_INT): ditto.
+ (set_marker_internal): Add dummy 0 to suppress -Wreturn-type.
+
+2025-04-09 Jeff Law <jlaw@ventanamicro.com>
+
+ * gcc.target/riscv/rvv/autovec/pr117722.c: Adjust expected output.
+
+2025-04-09 Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/119689
+ PR rtl-optimization/115568
+ * g++.target/i386/pr119689.C: New testcase.
+
+2025-04-09 Pan Li <pan2.li@intel.com>
+
+ Revert:
+ 2025-03-15 Pan Li <pan2.li@intel.com>
+
+ * gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3.c: Removed.
+ * gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-f16.c: New test.
+ * gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-f32.c: New test.
+ * gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-i16.c: New test.
+ * gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-i32.c: New test.
+ * gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-i8.c: New test.
+ * gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-u16.c: New test.
+ * gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-u32.c: New test.
+ * gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3-u8.c: New test.
+ * gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-3.h: New test.
+
+2025-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/118674
+ * gcc.dg/cpp/pr118674.c: New test.
+
+2025-04-09 Robin Dapp <rdapp@ventanamicro.com>
+
+ * g++.target/riscv/rvv/autovec/pr116595.C: Add -mabi.
+
+2025-04-09 Robin Dapp <rdapp@ventanamicro.com>
+
+ PR middle-end/116595
+ * g++.target/riscv/rvv/autovec/pr116595.C: New test.
+
+2025-04-09 Paul Thomas <pault@gcc.gnu.org>
+ and Harald Anlauf <anlauf@gcc.gnu.org>
+
+ PR fortran/119460
+ * gfortran.dg/reduce_2.f90: Add test to check that deferred len
+ characters cannot slip through.
+ * gfortran.dg/reduce_3.f90: New test
+ * gfortran.dg/reduce_4.f90: New test
+
+2025-04-09 Tobias Burnus <tburnus@baylibre.com>
+
+ PR fortran/101602
+ * gfortran.dg/do_concurrent_8_f2023.f90: Update for removed 'sorry,
+ unimplemented'.
+ * gfortran.dg/do_concurrent_9.f90: Likewise.
+ * gfortran.dg/do_concurrent_all_clauses.f90: Likewise.
+ * gfortran.dg/do_concurrent_local_init.f90: Likewise.
+ * gfortran.dg/do_concurrent_locality_specs.f90: Likewise.
+ * gfortran.dg/do_concurrent_11.f90: New test.
+ * gfortran.dg/do_concurrent_12.f90: New test.
+ * gfortran.dg/do_concurrent_13.f90: New test.
+ * gfortran.dg/do_concurrent_14.f90: New test.
+ * gfortran.dg/do_concurrent_15.f90: New test.
+
+2025-04-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/118698
+ * g++.dg/cpp2a/concepts-lambda22.C: New test.
+
2025-04-08 Richard Sandiford <richard.sandiford@arm.com>
* gcc.dg/guality/pr36728-3.c: Update XFAILs for aarch64.
diff --git a/gcc/testsuite/c-c++-common/analyzer/realloc-1.c b/gcc/testsuite/c-c++-common/analyzer/realloc-1.c
index 04925cf..0bb846c 100644
--- a/gcc/testsuite/c-c++-common/analyzer/realloc-1.c
+++ b/gcc/testsuite/c-c++-common/analyzer/realloc-1.c
@@ -92,5 +92,5 @@ void test_9 (void *p)
void test_10 (char *s, int n)
{
__builtin_realloc(s, n); /* { dg-warning "ignoring return value of '__builtin_realloc' declared with attribute 'warn_unused_result'" "" { target c } } */
- /* { dg-warning "ignoring return value of 'void\\* __builtin_realloc\\(void\\*, (long )?unsigned int\\)' declared with attribute 'warn_unused_result'" "" { target c++ } .-1 } */
+ /* { dg-warning "ignoring return value of 'void\\* __builtin_realloc\\(void\\*, (long )*unsigned int\\)' declared with attribute 'warn_unused_result'" "" { target c++ } .-1 } */
} /* { dg-warning "leak" } */
diff --git a/gcc/testsuite/c-c++-common/tsan/pr119801.c b/gcc/testsuite/c-c++-common/tsan/pr119801.c
new file mode 100644
index 0000000..d3a6bb4
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/tsan/pr119801.c
@@ -0,0 +1,24 @@
+/* PR sanitizer/119801 */
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=thread" } */
+
+[[gnu::noipa]] int
+bar (int *p)
+{
+ return ++*p;
+}
+
+int
+foo (int *p)
+{
+ ++*p;
+ [[gnu::musttail]] return bar (p);
+}
+
+[[gnu::noinline]] int
+baz (int x)
+{
+ if (x < 10)
+ return x;
+ [[gnu::musttail]] return baz (x - 2);
+}
diff --git a/gcc/testsuite/cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob b/gcc/testsuite/cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob
index 7a404fd..be58878 100644
--- a/gcc/testsuite/cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob
+++ b/gcc/testsuite/cobol.dg/group2/ACCEPT_DATE___DAY_and_intrinsic_functions__2_.cob
@@ -1,5 +1,5 @@
*> { dg-do run }
- *> { dg-set-target-env-var COB_CURRENT_DATE "2020/06/12 18:45:22" }
+ *> { dg-set-target-env-var GCOBOL_CURRENT_DATE "2020/06/12 18:45:22" }
IDENTIFICATION DIVISION.
PROGRAM-ID. prog.
diff --git a/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob b/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob
index 6014220..665787d 100644
--- a/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob
+++ b/gcc/testsuite/cobol.dg/group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.cob
@@ -1,5 +1,5 @@
*> { dg-do run }
- *> { dg-set-target-env-var COB_CURRENT_DATE "2015/04/05 18:45:22" }
+ *> { dg-set-target-env-var GCOBOL_CURRENT_DATE "2015/04/05 18:45:22" }
*> { dg-output-file "group2/ACCEPT_FROM_TIME___DATE___DAY___DAY-OF-WEEK__2_.out" }
IDENTIFICATION DIVISION.
diff --git a/gcc/testsuite/cobol.dg/group2/Dynamic_reference_modification.cob b/gcc/testsuite/cobol.dg/group2/Dynamic_reference_modification.cob
new file mode 100644
index 0000000..99690da
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Dynamic_reference_modification.cob
@@ -0,0 +1,24 @@
+ *> { dg-do run }
+ *> { dg-output-file "group2/Dynamic_reference_modification.out" }
+
+ IDENTIFICATION DIVISION.
+ PROGRAM-ID. prog.
+ DATA DIVISION.
+ WORKING-STORAGE SECTION.
+ 01 X PIC X(4) VALUE "abcd".
+ 01 I PIC 9.
+ PROCEDURE DIVISION.
+ MOVE 1 TO I.
+ DISPLAY X(I:1)
+ END-DISPLAY.
+ MOVE 4 TO I.
+ DISPLAY X(I:1)
+ END-DISPLAY.
+ MOVE 1 TO I.
+ DISPLAY X(1:I)
+ END-DISPLAY.
+ MOVE 4 TO I.
+ DISPLAY X(1:I)
+ END-DISPLAY.
+ STOP RUN.
+
diff --git a/gcc/testsuite/cobol.dg/group2/Dynamic_reference_modification.out b/gcc/testsuite/cobol.dg/group2/Dynamic_reference_modification.out
new file mode 100644
index 0000000..42a4b69
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Dynamic_reference_modification.out
@@ -0,0 +1,5 @@
+a
+d
+a
+abcd
+
diff --git a/gcc/testsuite/cobol.dg/group2/FUNCTION_DATE___TIME_OMNIBUS.cob b/gcc/testsuite/cobol.dg/group2/FUNCTION_DATE___TIME_OMNIBUS.cob
index bb48bb0..88b1b84 100644
--- a/gcc/testsuite/cobol.dg/group2/FUNCTION_DATE___TIME_OMNIBUS.cob
+++ b/gcc/testsuite/cobol.dg/group2/FUNCTION_DATE___TIME_OMNIBUS.cob
@@ -1,4 +1,5 @@
*> { dg-do run }
+ *> { dg-set-target-env-var TZ UTC0 }
identification division.
program-id. test.
@@ -79,7 +80,7 @@
01 minus10 pic s99 value -10.
- 01 forced_date_n pic X(64) VALUE Z"COB_CURRENT_DATE".
+ 01 forced_date_n pic X(64) VALUE Z"GCOBOL_CURRENT_DATE".
01 forced_date_v pic X(64) VALUE Z"1945/06/01 12:34:56".
procedure division.
diff --git a/gcc/testsuite/cobol.dg/group2/Length_overflow__1_.cob b/gcc/testsuite/cobol.dg/group2/Length_overflow__1_.cob
new file mode 100644
index 0000000..6475356
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Length_overflow__1_.cob
@@ -0,0 +1,16 @@
+ *> { dg-do run }
+ *> { dg-xfail-run-if "" { *-*-* } }
+ *> { dg-output-file "group2/Length_overflow__1_.out" }
+
+ IDENTIFICATION DIVISION.
+ PROGRAM-ID. prog.
+ DATA DIVISION.
+ WORKING-STORAGE SECTION.
+ 01 X PIC X(4) VALUE "abcd".
+ 01 I PIC 9 VALUE 5.
+ PROCEDURE DIVISION.
+ >>TURN EC-ALL CHECKING ON
+ DISPLAY X(1:I) NO ADVANCING
+ END-DISPLAY.
+ STOP RUN.
+
diff --git a/gcc/testsuite/cobol.dg/group2/Length_overflow__1_.out b/gcc/testsuite/cobol.dg/group2/Length_overflow__1_.out
new file mode 100644
index 0000000..78981922
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Length_overflow__1_.out
@@ -0,0 +1 @@
+a
diff --git a/gcc/testsuite/cobol.dg/group2/Length_overflow__2_.cob b/gcc/testsuite/cobol.dg/group2/Length_overflow__2_.cob
new file mode 100644
index 0000000..351c9df
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Length_overflow__2_.cob
@@ -0,0 +1,16 @@
+ *> { dg-do run }
+ *> { dg-xfail-run-if "" { *-*-* } }
+ *> { dg-output-file "group2/Length_overflow__2_.out" }
+
+ IDENTIFICATION DIVISION.
+ PROGRAM-ID. prog2.
+ DATA DIVISION.
+ WORKING-STORAGE SECTION.
+ 01 X PIC X(4) VALUE "abcd".
+ 01 I PIC 9 VALUE 5.
+ PROCEDURE DIVISION.
+ >>TURN EC-ALL CHECKING ON
+ DISPLAY X(3:I) NO ADVANCING
+ END-DISPLAY.
+ STOP RUN.
+
diff --git a/gcc/testsuite/cobol.dg/group2/Length_overflow__2_.out b/gcc/testsuite/cobol.dg/group2/Length_overflow__2_.out
new file mode 100644
index 0000000..f2ad6c7
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Length_overflow__2_.out
@@ -0,0 +1 @@
+c
diff --git a/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__1_.cob b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__1_.cob
new file mode 100644
index 0000000..9f7fa83
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__1_.cob
@@ -0,0 +1,15 @@
+ *> { dg-do run }
+ *> { dg-xfail-run-if "" { *-*-* } }
+ *> { dg-output-file "group2/Length_overflow_with_offset__1_.out" }
+
+ IDENTIFICATION DIVISION.
+ PROGRAM-ID. prog.
+ DATA DIVISION.
+ WORKING-STORAGE SECTION.
+ 01 X PIC X(4) VALUE "abcd".
+ 01 I PIC 9 VALUE 3.
+ PROCEDURE DIVISION.
+ >>TURN EC-ALL CHECKING ON
+ DISPLAY X(3:I) NO ADVANCING.
+ STOP RUN.
+
diff --git a/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__1_.out b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__1_.out
new file mode 100644
index 0000000..f2ad6c7
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__1_.out
@@ -0,0 +1 @@
+c
diff --git a/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__2_.cob b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__2_.cob
new file mode 100644
index 0000000..d077373
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__2_.cob
@@ -0,0 +1,16 @@
+ *> { dg-do run }
+ *> { dg-xfail-run-if "" { *-*-* } }
+ *> { dg-output-file "group2/Length_overflow_with_offset__2_.out" }
+
+ IDENTIFICATION DIVISION.
+ PROGRAM-ID. prog.
+ DATA DIVISION.
+ WORKING-STORAGE SECTION.
+ 01 X PIC X(4) VALUE "abcd".
+ 01 I PIC 9 VALUE 3.
+ PROCEDURE DIVISION.
+ >>TURN EC-ALL CHECKING ON
+ IF X(3:I) <> SPACES
+ DISPLAY X(3:I) NO ADVANCING.
+ STOP RUN.
+
diff --git a/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__2_.out b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__2_.out
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__2_.out
@@ -0,0 +1 @@
+
diff --git a/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__3_.cob b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__3_.cob
new file mode 100644
index 0000000..7fa9843
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__3_.cob
@@ -0,0 +1,22 @@
+ *> { dg-do run }
+ *> { dg-xfail-run-if "" { *-*-* } }
+ *> { dg-output-file "group2/Length_overflow_with_offset__3_.out" }
+
+ IDENTIFICATION DIVISION.
+ PROGRAM-ID. prog.
+ DATA DIVISION.
+ WORKING-STORAGE SECTION.
+ 01 X PIC X(4) VALUE "abcd".
+ 01 I PIC 9 VALUE 3.
+ PROCEDURE DIVISION.
+ >>TURN EC-ALL CHECKING ON
+ EVALUATE TRUE
+ WHEN I < 2
+ AND X(3:I) <> SPACES
+ DISPLAY "1-" X(3:I) NO ADVANCING
+ WHEN I < 2
+ WHEN X(3:I) <> SPACES
+ DISPLAY "2-" X(3:I) NO ADVANCING
+ END-EVALUATE
+ STOP RUN.
+
diff --git a/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__3_.out b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__3_.out
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Length_overflow_with_offset__3_.out
@@ -0,0 +1 @@
+
diff --git a/gcc/testsuite/cobol.dg/group2/Offset_overflow.cob b/gcc/testsuite/cobol.dg/group2/Offset_overflow.cob
new file mode 100644
index 0000000..8fd5421
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Offset_overflow.cob
@@ -0,0 +1,16 @@
+ *> { dg-do run }
+ *> { dg-xfail-run-if "" { *-*-* } }
+ *> { dg-output-file "group2/Offset_overflow.out" }
+
+ IDENTIFICATION DIVISION.
+ PROGRAM-ID. prog.
+ DATA DIVISION.
+ WORKING-STORAGE SECTION.
+ 01.
+ 03 X PIC X(4) VALUE "abcd".
+ 03 I PIC 9 VALUE 5.
+ PROCEDURE DIVISION.
+ >>TURN EC-ALL CHECKING ON
+ DISPLAY X(I:1) NO ADVANCING.
+ STOP RUN.
+
diff --git a/gcc/testsuite/cobol.dg/group2/Offset_overflow.out b/gcc/testsuite/cobol.dg/group2/Offset_overflow.out
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Offset_overflow.out
@@ -0,0 +1 @@
+5
diff --git a/gcc/testsuite/cobol.dg/group2/Offset_underflow.cob b/gcc/testsuite/cobol.dg/group2/Offset_underflow.cob
new file mode 100644
index 0000000..51100a8
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Offset_underflow.cob
@@ -0,0 +1,16 @@
+ *> { dg-do run }
+ *> { dg-xfail-run-if "" { *-*-* } }
+ *> { dg-output-file "group2/Offset_underflow.out" }
+
+ IDENTIFICATION DIVISION.
+ PROGRAM-ID. prog.
+ DATA DIVISION.
+ WORKING-STORAGE SECTION.
+ 01 X PIC X(4) VALUE "abcd".
+ 01 I PIC 9 VALUE 0.
+ PROCEDURE DIVISION.
+ >>TURN EC-ALL CHECKING ON
+ DISPLAY X(I:1) NO ADVANCING
+ END-DISPLAY.
+ STOP RUN.
+
diff --git a/gcc/testsuite/cobol.dg/group2/Offset_underflow.out b/gcc/testsuite/cobol.dg/group2/Offset_underflow.out
new file mode 100644
index 0000000..78981922
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Offset_underflow.out
@@ -0,0 +1 @@
+a
diff --git a/gcc/testsuite/cobol.dg/group2/Refmod__comparisons_inside_numeric-display.cob b/gcc/testsuite/cobol.dg/group2/Refmod__comparisons_inside_numeric-display.cob
new file mode 100644
index 0000000..6fb70f4
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Refmod__comparisons_inside_numeric-display.cob
@@ -0,0 +1,20 @@
+ *> { dg-do run }
+ *> { dg-output-file "group2/Refmod__comparisons_inside_numeric-display.out" }
+ identification division.
+ program-id. prog.
+ data division.
+ working-storage section.
+ 01 n pic 9(9).
+ 01 i pic 99.
+ procedure division.
+ perform varying i from 1 by 1 until i > 8
+ move 88888888 to n
+ move "12" to n(i:2)
+ display n
+ if n(i:2) not equal to "12"
+ display "Equality is flawed"
+ end-if
+ end-perform.
+ goback.
+ end program prog.
+
diff --git a/gcc/testsuite/cobol.dg/group2/Refmod__comparisons_inside_numeric-display.out b/gcc/testsuite/cobol.dg/group2/Refmod__comparisons_inside_numeric-display.out
new file mode 100644
index 0000000..ac48dc8
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Refmod__comparisons_inside_numeric-display.out
@@ -0,0 +1,9 @@
+128888888
+012888888
+081288888
+088128888
+088812888
+088881288
+088888128
+088888812
+
diff --git a/gcc/testsuite/cobol.dg/group2/Refmod_sources_are_figurative_constants.cob b/gcc/testsuite/cobol.dg/group2/Refmod_sources_are_figurative_constants.cob
new file mode 100644
index 0000000..c4af57d
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Refmod_sources_are_figurative_constants.cob
@@ -0,0 +1,29 @@
+ *> { dg-do run }
+ *> { dg-output-file "group2/Refmod_sources_are_figurative_constants.out" }
+
+ id division.
+ program-id. prog.
+ data division.
+ working-storage section.
+ 01 varx pic x(8) VALUE '""""""""'.
+ 01 varp redefines varx pointer.
+ procedure division.
+ move "12345678" to varx
+ display """" varx """"
+ move "999" to varx(4:3)
+ display """" varx """"
+ move LOW-VALUE to varx(4:3).
+ display """" varx """"
+ move ZERO to varx(4:3).
+ display """" varx """"
+ move SPACE to varx(4:3).
+ display """" varx """"
+ move QUOTE to varx(4:3).
+ display """" varx """"
+ move HIGH-VALUE to varx(4:3).
+ display varp
+ initialize varx all to value
+ display """" varx """"
+ .
+ end program prog.
+
diff --git a/gcc/testsuite/cobol.dg/group2/Refmod_sources_are_figurative_constants.out b/gcc/testsuite/cobol.dg/group2/Refmod_sources_are_figurative_constants.out
new file mode 100644
index 0000000..2f5dadc
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Refmod_sources_are_figurative_constants.out
@@ -0,0 +1,9 @@
+"12345678"
+"12399978"
+"123"
+"12300078"
+"123 78"
+"123"""78"
+0x3837ffffff333231
+""""""""""
+
diff --git a/gcc/testsuite/cobol.dg/group2/Static_reference_modification.cob b/gcc/testsuite/cobol.dg/group2/Static_reference_modification.cob
new file mode 100644
index 0000000..919ddb3
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Static_reference_modification.cob
@@ -0,0 +1,19 @@
+ *> { dg-do run }
+ *> { dg-output-file "group2/Static_reference_modification.out" }
+
+ IDENTIFICATION DIVISION.
+ PROGRAM-ID. prog.
+ DATA DIVISION.
+ WORKING-STORAGE SECTION.
+ 01 X PIC X(4) VALUE "abcd".
+ PROCEDURE DIVISION.
+ DISPLAY X(1:1) ":" X(1:2) ":" X(1:3) ":" X(1:4) ":" X(1:)
+ END-DISPLAY.
+ DISPLAY X(2:1) ":" X(2:2) ":" X(2:3) ":" X(2:)
+ END-DISPLAY.
+ DISPLAY X(3:1) ":" X(3:2) ":" X(3:)
+ END-DISPLAY.
+ DISPLAY X(4:1) ":" X(4:)
+ END-DISPLAY.
+ STOP RUN.
+
diff --git a/gcc/testsuite/cobol.dg/group2/Static_reference_modification.out b/gcc/testsuite/cobol.dg/group2/Static_reference_modification.out
new file mode 100644
index 0000000..fe51165
--- /dev/null
+++ b/gcc/testsuite/cobol.dg/group2/Static_reference_modification.out
@@ -0,0 +1,5 @@
+a:ab:abc:abcd:abcd
+b:bc:bcd:bcd
+c:cd:cd
+d:d
+
diff --git a/gcc/testsuite/g++.dg/abi/ref-temp1.C b/gcc/testsuite/g++.dg/abi/ref-temp1.C
index 70c9a7a..b02dcf6 100644
--- a/gcc/testsuite/g++.dg/abi/ref-temp1.C
+++ b/gcc/testsuite/g++.dg/abi/ref-temp1.C
@@ -7,11 +7,16 @@ struct B { const A (&x)[2]; };
template <typename T> B &&b = { { { { 1, 2, 3 } }, { { 4, 5, 6 } } } };
B &temp = b<void>;
-// { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZGR1bIvE_" } }
-// { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZGR1bIvE0_" } }
-// { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZGR1bIvE1_" } }
-// { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZGR1bIvE2_" } }
+// { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZGR1bIvE_" { target { ! pe } } } }
+// { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZGR1bIvE0_" { target { ! pe } } } }
+// { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZGR1bIvE1_" { target { ! pe } } } }
+// { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZGR1bIvE2_" { target { ! pe } } } }
+// { dg-final { scan-assembler "\.section\t\.data\\\$_ZGR1bIvE_,\"w\"\n\t\.linkonce same_size" { target pe } } }
+// { dg-final { scan-assembler "\.section\t\.rdata\\\$_ZGR1bIvE0_,\"dr\"\n\t\.linkonce same_size" { target pe } } }
+// { dg-final { scan-assembler "\.section\t\.rdata\\\$_ZGR1bIvE1_,\"dr\"\n\t\.linkonce same_size" { target pe } } }
+// { dg-final { scan-assembler "\.section\t\.rdata\\\$_ZGR1bIvE2_,\"dr\"\n\t\.linkonce same_size" { target pe } } }
+//
// { dg-final { scan-assembler "_ZGR1bIvE_:\n\[^\n]+_ZGR1bIvE0_" } }
// { dg-final { scan-assembler "_ZGR1bIvE0_:\n\[^\n]+_ZGR1bIvE1_" } }
// { dg-final { scan-assembler "_ZGR1bIvE1_:\n\[^\n]+\[ \t\]1" } }
diff --git a/gcc/testsuite/g++.dg/concepts/diagnostic20.C b/gcc/testsuite/g++.dg/concepts/diagnostic20.C
new file mode 100644
index 0000000..2bb01db
--- /dev/null
+++ b/gcc/testsuite/g++.dg/concepts/diagnostic20.C
@@ -0,0 +1,13 @@
+// PR c++/99214
+// { dg-do compile { target c++20 } }
+
+template <class T>
+struct A {
+ template <class U> static void f() requires requires { T::fail; };
+};
+
+int main() {
+ A<int>::f<char>(); // { dg-error "no match" }
+}
+
+// { dg-message "In substitution of '\[^\r\n\]* \\\[with U = char\\\]'" "" { target *-*-* } 0 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ice21.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice21.C
index 4627365..dcc4044 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-ice21.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice21.C
@@ -3,7 +3,7 @@
struct NoMut1 { int a, b; };
struct NoMut3 : virtual NoMut1 {
- constexpr NoMut3(int a, int b) // { dg-error "virtual base" "" { target c++23 } }
+ constexpr NoMut3(int a, int b)
: NoMut1{a, b}
{} // { dg-error "virtual base" }
};
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-diag2.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-diag2.C
new file mode 100644
index 0000000..93f3f10
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-diag2.C
@@ -0,0 +1,12 @@
+// PR c++/113360
+// { dg-do compile { target c++14 } }
+
+constexpr bool init_list() // { dg-bogus "because" }
+{
+ int total{};
+ for (int x : {1, 2, 3}) // { dg-error "initializer list" }
+ total += x;
+ return total == 6;
+}
+
+static_assert(init_list(), ""); // { dg-error "constant" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C
index d0ca0b7..f4c6d2e 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C
@@ -6,7 +6,9 @@ constexpr int *f4(bool b) {
return nullptr;
} else {
return new int{42}; // { dg-error "call to non-.constexpr." "" { target c++17_down } }
- } // { dg-error "is not a constant expression because allocated storage has not been deallocated" "" { target c++2a } .-1 }
+ // { dg-message "allocated here" "" { target c++20 } .-1 }
+ }
}
static_assert(f4(true) == nullptr, "");
-static_assert(f4(false) == nullptr, ""); // { dg-error "non-.constant. condition|" }
+static_assert(f4(false) == nullptr, ""); // { dg-error "non-constant condition" }
+// { dg-error "is not a constant expression because allocated storage has not been deallocated" "" { target c++20 } .-1 }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-prvalue1.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-prvalue1.C
index ad31e30..6ad2ec8 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-prvalue1.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-prvalue1.C
@@ -1,6 +1,6 @@
// PR c++/116416
// { dg-do compile { target c++14 } }
-// { dg-options "-O" }
+// { dg-options "-O -fdump-tree-original" }
struct Str {
constexpr Str() {}
@@ -17,14 +17,16 @@ extern void callback(Str str);
void
func1()
{
- callback(Str{"Test"});
+ callback(Str{"Test1"});
}
void
func2()
{
- Str str{"Test"};
+ Str str{"Test2"};
callback(str);
}
-// Check that we don't call Str::Str(char const*)
-// { dg-final { scan-assembler-not "_ZN3StrC1EPKc" } }
+// Check that the front end folds both the temporary initializer and
+// that of 'str'.
+// { dg-final { scan-tree-dump "{.str=\\(const char \\*\\) \"Test1\", .length=5}" "original" } }
+// { dg-final { scan-tree-dump "{.str=\\(const char \\*\\) \"Test2\", .length=5}" "original" } }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-prvalue1a.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-prvalue1a.C
new file mode 100644
index 0000000..54176bf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-prvalue1a.C
@@ -0,0 +1,33 @@
+// PR c++/116416
+// A version of constexpr-prvalue1.C that calls __builtin_is_constant_evaluated.
+// { dg-do compile { target c++14 } }
+// { dg-options "-O -fdump-tree-original" }
+
+struct Str {
+ constexpr Str() {}
+ constexpr Str(const char *instr) {
+ str = instr; length = 0;
+ for (auto index = 0; instr[index]; ++index) {
+ length += __builtin_is_constant_evaluated() ? 1 : 1;
+ }
+ }
+ const char *str = nullptr;
+ int length = 0;
+};
+extern void callback(Str str);
+void
+func1()
+{
+ callback(Str{"Test1"});
+}
+void
+func2()
+{
+ Str str{"Test2"};
+ callback(str);
+}
+
+// Check that the front end folds both the temporary initializer and
+// that of 'str'.
+// { dg-final { scan-tree-dump "{.str=\\(const char \\*\\) \"Test1\", .length=5}" "original" } }
+// { dg-final { scan-tree-dump "{.str=\\(const char \\*\\) \"Test2\", .length=5}" "original" } }
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr63996.C b/gcc/testsuite/g++.dg/cpp1y/pr63996.C
index 8eee2e0..347c86c 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr63996.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr63996.C
@@ -1,5 +1,4 @@
// { dg-do compile { target c++14 } }
-// { dg-additional-options "-Wno-return-type" }
constexpr int
foo (int i)
@@ -8,4 +7,4 @@ foo (int i)
if (i == 23) return 0;
}
-constexpr int j = foo (1); // { dg-error "flows off the end|in .constexpr. expansion of" }
+constexpr int j = foo (1);
diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C
index bcecea9..35beb27 100644
--- a/gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C
+++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-asm-5.C
@@ -28,7 +28,7 @@ struct M { constexpr K size () const { return {}; }
constexpr L data () const { return {}; } };
#if __cpp_constexpr_dynamic_alloc >= 201907L
struct N { constexpr int size () const { return 3; }
- constexpr const char *data () const { return new char[3] { 'b', 'a', 'd' }; } }; // { dg-error "'\\\* N\\\(\\\).N::data\\\(\\\)' is not a constant expression because allocated storage has not been deallocated" "" { target c++20 } }
+ constexpr const char *data () const { return new char[3] { 'b', 'a', 'd' }; } };
#endif
constexpr const char a[] = { 't', 'e', 's', 't' };
struct O { constexpr int size () const { return 4; }
@@ -117,6 +117,7 @@ foo ()
asm ((M {}));
#if __cpp_constexpr_dynamic_alloc >= 201907L
asm ((N {})); // { dg-error "constexpr string 'data\\\(\\\)\\\[0\\\]' must be a constant expression" "" { target c++20 } }
+ // { dg-error "'\\\* N\\\(\\\).N::data\\\(\\\)' is not a constant expression because allocated storage has not been deallocated" "" { target c++20 } .-1 }
#endif
asm ((O {}));
asm ((P (0)));
@@ -190,6 +191,7 @@ bar ()
asm ((M {}));
#if __cpp_constexpr_dynamic_alloc >= 201907L
asm ((N {})); // { dg-error "constexpr string 'data\\\(\\\)\\\[0\\\]' must be a constant expression" "" { target c++20 } }
+ // { dg-error "'\\\* N\\\(\\\).N::data\\\(\\\)' is not a constant expression because allocated storage has not been deallocated" "" { target c++20 } .-1 }
#endif
asm ((O {}));
asm ((P (0)));
diff --git a/gcc/testsuite/g++.dg/cpp23/class-deduction-inherited8.C b/gcc/testsuite/g++.dg/cpp23/class-deduction-inherited8.C
new file mode 100644
index 0000000..4494c70
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp23/class-deduction-inherited8.C
@@ -0,0 +1,21 @@
+// PR c++/119687
+// { dg-do compile { target c++17 } }
+
+template <typename> class QFlagsStorage{};
+
+template <typename Enum> struct QFlagsStorageHelper : QFlagsStorage<Enum> {
+ using QFlagsStorage<Enum>::QFlagsStorage;
+
+public:
+ QFlagsStorageHelper(Enum);
+};
+
+template <typename Enum> struct QFlags : public QFlagsStorageHelper<Enum> {
+ using Base = QFlagsStorageHelper<Enum>;
+ using Base::Base;
+ QFlags(Enum);
+};
+
+void f(int flag) {
+ QFlags{int{}};
+}
diff --git a/gcc/testsuite/g++.dg/cpp23/constexpr-nonlit18.C b/gcc/testsuite/g++.dg/cpp23/constexpr-nonlit18.C
index 8e230ef..f891814 100644
--- a/gcc/testsuite/g++.dg/cpp23/constexpr-nonlit18.C
+++ b/gcc/testsuite/g++.dg/cpp23/constexpr-nonlit18.C
@@ -24,7 +24,7 @@ f3 ()
}
constexpr int
-f4 () // { dg-message "declared here" "" { target c++20_down } }
+f4 ()
{ // { dg-message "is not usable as a 'constexpr' function because:" "" { target c++23 } .-1 }
static const int a = f1 (1); // { dg-error "'a' defined 'static' in 'constexpr' function only available with" "" { target c++20_down } }
return 0; // { dg-error "'a' defined 'static' in 'constexpr' context" "" { target c++23 } .-1 }
diff --git a/gcc/testsuite/g++.dg/cpp26/pack-indexing2.C b/gcc/testsuite/g++.dg/cpp26/pack-indexing2.C
index fdc8320..4a7e494 100644
--- a/gcc/testsuite/g++.dg/cpp26/pack-indexing2.C
+++ b/gcc/testsuite/g++.dg/cpp26/pack-indexing2.C
@@ -49,7 +49,7 @@ template<int N>
int
getT2 (auto... Ts)
{
- return Ts...[N]; // { dg-error "pack index is negative" }
+ return Ts...[N]; // { dg-error "pack index '-1' is negative" }
}
template<auto N, typename... Ts>
@@ -63,7 +63,7 @@ template<auto N, typename... Ts>
void
badtype2 ()
{
- Ts...[N] t; // { dg-error "pack index is out of range" }
+ Ts...[N] t; // { dg-error "pack index '1' is out of range for pack of length '1'" }
}
template<auto N, typename... Ts>
@@ -77,7 +77,7 @@ template<auto N, typename... Ts>
void
badtype4 ()
{
- Ts...[N] t; // { dg-error "pack index is negative" }
+ Ts...[N] t; // { dg-error "pack index '-1' is negative" }
}
int nonconst () { return 42; }
diff --git a/gcc/testsuite/g++.dg/cpp26/static_assert1.C b/gcc/testsuite/g++.dg/cpp26/static_assert1.C
index f9ac831..1d0e6f2 100644
--- a/gcc/testsuite/g++.dg/cpp26/static_assert1.C
+++ b/gcc/testsuite/g++.dg/cpp26/static_assert1.C
@@ -69,10 +69,11 @@ static_assert (false, M {}); // { dg-warning "'static_assert' with non-string me
// { dg-error "static assertion failed: test" "" { target *-*-* } .-1 }
#if __cpp_constexpr_dynamic_alloc >= 201907L
struct N { constexpr int size () const { return 3; }
- constexpr const char *data () const { return new char[3] { 'b', 'a', 'd' }; } }; // { dg-error "'\\\* N\\\(\\\).N::data\\\(\\\)' is not a constant expression because allocated storage has not been deallocated" "" { target c++20 } }
+ constexpr const char *data () const { return new char[3] { 'b', 'a', 'd' }; } };
static_assert (true, N {}); // { dg-warning "'static_assert' with non-string message only available with" "" { target { c++20 && c++23_down } } }
static_assert (false, N {}); // { dg-warning "'static_assert' with non-string message only available with" "" { target { c++20 && c++23_down } } }
// { dg-error "constexpr string 'data\\\(\\\)\\\[0\\\]' must be a constant expression" "" { target c++20 } .-1 }
+ // { dg-error "'\\\* N\\\(\\\).N::data\\\(\\\)' is not a constant expression because allocated storage has not been deallocated" "" { target c++20 } .-2 }
#endif
constexpr const char a[] = { 't', 'e', 's', 't' };
struct O { constexpr int size () const { return 4; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-lambda23.C b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda23.C
new file mode 100644
index 0000000..f442120
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda23.C
@@ -0,0 +1,12 @@
+// PR c++/119175
+// { dg-do compile { target c++20 } }
+
+template<int = 0>
+static void from() requires requires {
+ []<int> requires requires { [] {}; } {};
+}
+{}
+
+int main() {
+ from();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor16.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor16.C
index b84aaf9..99d1307 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor16.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor16.C
@@ -3,5 +3,5 @@
struct A { virtual ~A (); };
struct B : virtual A { constexpr ~B () {} };
-// { dg-error "'struct B' has virtual base classes" "" { target c++20 } .-1 }
+// { dg-error "'constexpr' destructor in 'struct B' that has virtual base classes" "" { target c++20 } .-1 }
// { dg-error "'constexpr' destructors only available with" "" { target c++17_down } .-2 }
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor7.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor7.C
index 463eaca..f4546c1 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor7.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dtor7.C
@@ -3,7 +3,7 @@
struct S {
int *s;
- constexpr S () : s(new int) {} // { dg-error "is not a constant expression because allocated storage has not been deallocated" }
+ constexpr S () : s(new int) {}
S (const S &) = delete;
S &operator= (const S &) = delete;
constexpr ~S () { delete s; }
@@ -17,3 +17,4 @@ foo (S v)
}
static_assert (foo (S ())); // { dg-error "non-constant condition for static assertion" }
+// { dg-error "is not a constant expression because allocated storage has not been deallocated" "" { target *-*-* } .-1 }
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic10.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic10.C
index f9f8223..e543ce4 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic10.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic10.C
@@ -5,7 +5,7 @@
struct C { virtual void a(); };
struct B { virtual void b(); };
-struct A : virtual B, C { virtual void c(); }; // { dg-error ".struct A. has virtual base classes" }
+struct A : virtual B, C { virtual void c(); }; // { dg-error "virtual base classes" }
constexpr A a; // { dg-error "call" }
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new26.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new26.C
index c82bd43..d8e53b2 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new26.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new26.C
@@ -4,7 +4,7 @@
constexpr int *
f7 ()
{
- int *p = new int (2); // { dg-error "is not a constant expression because it refers to a result of" }
+ int *p = new int (2); // { dg-message "allocated here" }
delete p;
return p;
}
@@ -12,6 +12,5 @@ f7 ()
void
g ()
{
- constexpr auto v7 = f7 ();
+ constexpr auto v7 = f7 (); // { dg-error "is not a constant expression because it refers to a result of" }
}
-
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C
index 5d9f1925..30e453e 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C
@@ -5,19 +5,19 @@
constexpr int *
f1 ()
{
- return new int (2); // { dg-error "is not a constant expression because it refers to a result of" }
+ return new int (2); // { dg-message "allocated here" }
}
-constexpr auto v1 = f1 ();
+constexpr auto v1 = f1 (); // { dg-error "is not a constant expression because it refers to a result of" }
constexpr bool
f2 ()
{
- int *p = new int (3); // { dg-error "is not a constant expression because allocated storage has not been deallocated" }
+ int *p = new int (3); // { dg-message "allocated here" }
return false;
}
-constexpr auto v2 = f2 ();
+constexpr auto v2 = f2 (); // { dg-error "is not a constant expression because allocated storage has not been deallocated" }
constexpr bool
f3 ()
@@ -64,12 +64,12 @@ constexpr auto v6 = f6 (); // { dg-message "in 'constexpr' expansion of" }
constexpr int *
f7 ()
{
- int *p = new int (2); // { dg-error "is not a constant expression because it refers to a result of" }
+ int *p = new int (2); // { dg-message "allocated here" }
delete p;
return p;
}
-constexpr auto v7 = f7 ();
+constexpr auto v7 = f7 (); // { dg-error "is not a constant expression because it refers to a result of" }
constexpr bool
f8_impl (int *p)
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-vector1.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-vector1.C
new file mode 100644
index 0000000..196c6ec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-vector1.C
@@ -0,0 +1,8 @@
+// PR c++/113835
+// { dg-timeout-factor 0.05 }
+// { dg-do compile { target c++20_only } }
+
+#include <vector>
+const std::size_t N = 1'000'000;
+std::vector<int> x(N);
+int main() {}
diff --git a/gcc/testsuite/g++.dg/cpp2a/constinit14.C b/gcc/testsuite/g++.dg/cpp2a/constinit14.C
index 06c4cb4..26d82fe67 100644
--- a/gcc/testsuite/g++.dg/cpp2a/constinit14.C
+++ b/gcc/testsuite/g++.dg/cpp2a/constinit14.C
@@ -2,12 +2,13 @@
// { dg-do compile { target c++20 } }
struct Value {
- Value() : v{new int{42}} {} // { dg-error "result of 'operator new'" "" { target implicit_constexpr } }
+ Value() : v{new int{42}} {}
int* v;
};
struct S {
static constinit inline Value v{}; // { dg-error "variable .S::v. does not have a constant initializer|call to non-.constexpr. function" }
+ // { dg-error "result of 'operator new'" "" { target implicit_constexpr } .-1 }
};
int main() { return *S::v.v; }
diff --git a/gcc/testsuite/g++.dg/cpp2a/lambda-targ14.C b/gcc/testsuite/g++.dg/cpp2a/lambda-targ14.C
new file mode 100644
index 0000000..debb15e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/lambda-targ14.C
@@ -0,0 +1,12 @@
+// PR c++/119345
+// { dg-do compile { target c++20 } }
+
+void f(auto... args) {
+ [args...]<int... i> {
+ (..., [args...] { i; });
+ }.template operator()<0>();
+}
+
+int main() {
+ f();
+}
diff --git a/gcc/testsuite/g++.dg/ext/pragma-target2.C b/gcc/testsuite/g++.dg/ext/pragma-target2.C
new file mode 100644
index 0000000..53eb7dd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/pragma-target2.C
@@ -0,0 +1,18 @@
+// PR c++/114772
+// { dg-do compile { target x86_64-*-* } }
+
+template<typename V, bool STREAMING>
+inline __attribute__((always_inline))
+__attribute__((warn_unused_result))
+int walk_document(V visitor) {return 0;}
+
+template<bool STREAMING>
+void parse_document() {
+ int r = walk_document<bool, STREAMING>(false);
+}
+
+void stage2_next() {
+ parse_document<true>();
+}
+
+#pragma GCC target("pclmul")
diff --git a/gcc/testsuite/g++.dg/ext/type_pack_element2.C b/gcc/testsuite/g++.dg/ext/type_pack_element2.C
index 1bf7753..1b07673 100644
--- a/gcc/testsuite/g++.dg/ext/type_pack_element2.C
+++ b/gcc/testsuite/g++.dg/ext/type_pack_element2.C
@@ -2,7 +2,7 @@
int p;
-using type = __type_pack_element<&p, int>; // { dg-error "not an integral constant" }
+using type = __type_pack_element<&p, int>; // { dg-error "non-integral type" }
using type = __type_pack_element<1, int>; // { dg-error "out of range" }
using type = __type_pack_element<2, int, char>; // { dg-error "out of range" }
using type = __type_pack_element<-1, int>; // { dg-error "negative" }
diff --git a/gcc/testsuite/g++.dg/ext/type_pack_element4.C b/gcc/testsuite/g++.dg/ext/type_pack_element4.C
index aa508c7..5a39194 100644
--- a/gcc/testsuite/g++.dg/ext/type_pack_element4.C
+++ b/gcc/testsuite/g++.dg/ext/type_pack_element4.C
@@ -3,7 +3,7 @@
template <typename... _Elements> class tuple{};
template <unsigned long __i, typename... _Elements>
-__type_pack_element<__i, _Elements...> &get(tuple<_Elements...> &__t) noexcept; // { dg-error "index is out of range" }
+__type_pack_element<__i, _Elements...> &get(tuple<_Elements...> &__t) noexcept; // { dg-error "out of range" }
tuple<int,int> data;
template <unsigned long Level>
unsigned take_impl(unsigned idx) {
diff --git a/gcc/testsuite/g++.dg/lto/pr119614_0.C b/gcc/testsuite/g++.dg/lto/pr119614_0.C
new file mode 100644
index 0000000..09c07fb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr119614_0.C
@@ -0,0 +1,34 @@
+// PR tree-optimization/119614
+// { dg-lto-do link }
+// { dg-lto-options { { -O2 -fPIC -flto -flto-partition=max } } }
+// { dg-require-effective-target shared }
+// { dg-require-effective-target fpic }
+// { dg-require-effective-target musttail }
+// { dg-extra-ld-options "-shared" }
+
+struct S {} b;
+char *foo ();
+int e, g;
+void bar ();
+void corge (S);
+
+[[gnu::noinline]] static char *
+baz ()
+{
+ bar ();
+ return 0;
+}
+
+const char *
+qux ()
+{
+ if (e)
+ {
+ S a = b;
+ corge (a);
+ if (g)
+ return 0;
+ [[gnu::musttail]] return baz ();
+ }
+ return foo ();
+}
diff --git a/gcc/testsuite/g++.dg/modules/lambda-10_a.H b/gcc/testsuite/g++.dg/modules/lambda-10_a.H
new file mode 100644
index 0000000..1ad1a80
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/lambda-10_a.H
@@ -0,0 +1,17 @@
+// PR c++/119755
+// { dg-additional-options "-fmodule-header" }
+// { dg-module-cmi {} }
+
+template <typename _Out> void format(_Out) {
+ constexpr int __term = 1;
+ [&] { __term; };
+ [&] { const int outer = __term; { __term; } };
+ [&]() noexcept { __term; };
+ [&]() noexcept { const int outer = __term; { __term; } };
+ [&](auto) { int n[__term]; }(0);
+ [&](auto) noexcept { int n[__term]; }(0);
+}
+
+inline void vformat() {
+ format(0);
+}
diff --git a/gcc/testsuite/g++.dg/modules/lambda-10_b.C b/gcc/testsuite/g++.dg/modules/lambda-10_b.C
new file mode 100644
index 0000000..3556bce
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/lambda-10_b.C
@@ -0,0 +1,7 @@
+// PR c++/119755
+// { dg-additional-options "-fmodules" }
+
+import "lambda-10_a.H";
+int main() {
+ vformat();
+}
diff --git a/gcc/testsuite/g++.dg/modules/lambda-8_b.C b/gcc/testsuite/g++.dg/modules/lambda-8_b.C
index 7ace494..96578ba 100644
--- a/gcc/testsuite/g++.dg/modules/lambda-8_b.C
+++ b/gcc/testsuite/g++.dg/modules/lambda-8_b.C
@@ -4,4 +4,4 @@
#include "lambda-8.h"
import "lambda-8_a.H";
-// { dg-error "conflicting global module declaration" "" { target *-*-* } 0 }
+// { dg-error "conflicting imported declaration" "" { target *-*-* } 0 }
diff --git a/gcc/testsuite/g++.dg/modules/leg-merge-4_c.C b/gcc/testsuite/g++.dg/modules/leg-merge-4_c.C
index f1b1aeb..5756057 100644
--- a/gcc/testsuite/g++.dg/modules/leg-merge-4_c.C
+++ b/gcc/testsuite/g++.dg/modules/leg-merge-4_c.C
@@ -11,8 +11,8 @@ void foo ()
X *p;
}
-// { dg-regexp "\nIn module \[^\n]*leg-merge-4_b.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_b.H:4:\[0-9]*: error: conflicting global module declaration 'float bob'\nIn module \[^\n]*leg-merge-4_a.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_a.H:4:\[0-9]*: note: existing declaration 'int bob'\n\[^\n]*leg-merge-4_c.C:9:\[0-9]*: note: during load of binding '::bob'$" }
+// { dg-regexp "\nIn module \[^\n]*leg-merge-4_b.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_b.H:4:\[0-9]*: error: conflicting type for imported declaration 'float bob'\nIn module \[^\n]*leg-merge-4_a.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_a.H:4:\[0-9]*: note: existing declaration 'int bob'\n\[^\n]*leg-merge-4_c.C:9:\[0-9]*: note: during load of binding '::bob'$" }
-// { dg-regexp "\nIn module \[^\n]*leg-merge-4_b.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_b.H:5:\[0-9]*: error: conflicting global module declaration 'int frob\\(\\)'\nIn module \[^\n]*leg-merge-4_a.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_a.H:5:\[0-9]*: note: existing declaration 'void frob\\(\\)'\n\[^\n]*leg-merge-4_c.C:10:\[0-9]*: note: during load of binding '::frob'$" }
+// { dg-regexp "\nIn module \[^\n]*leg-merge-4_b.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_b.H:5:\[0-9]*: error: conflicting type for imported declaration 'int frob\\(\\)'\nIn module \[^\n]*leg-merge-4_a.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_a.H:5:\[0-9]*: note: existing declaration 'void frob\\(\\)'\n\[^\n]*leg-merge-4_c.C:10:\[0-9]*: note: during load of binding '::frob'$" }
-// { dg-regexp "In module \[^\n]*leg-merge-4_b.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_b.H:6:\[0-9]*: error: conflicting global module declaration 'union X'\nIn module \[^\n]*leg-merge-4_a.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_a.H:6:\[0-9]*: note: existing declaration 'class X'\n\[^\n]*leg-merge-4_c.C:11:\[0-9]*: note: during load of binding '::X'$" }
+// { dg-regexp "In module \[^\n]*leg-merge-4_b.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_b.H:6:\[0-9]*: error: conflicting type for imported declaration 'union X'\nIn module \[^\n]*leg-merge-4_a.H, imported at \[^\n]*leg-merge-4_c.C:\[0-9]*:\n\[^\n]*leg-merge-4_a.H:6:\[0-9]*: note: existing declaration 'class X'\n\[^\n]*leg-merge-4_c.C:11:\[0-9]*: note: during load of binding '::X'$" }
diff --git a/gcc/testsuite/g++.dg/modules/noexcept-4_a.H b/gcc/testsuite/g++.dg/modules/noexcept-4_a.H
new file mode 100644
index 0000000..b888a1b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/noexcept-4_a.H
@@ -0,0 +1,6 @@
+// { dg-additional-options "-fmodule-header -std=c++20" }
+// { dg-module-cmi {} }
+
+struct exception_ptr {
+ friend bool operator==(const exception_ptr&, const exception_ptr&) = default;
+};
diff --git a/gcc/testsuite/g++.dg/modules/noexcept-4_b.C b/gcc/testsuite/g++.dg/modules/noexcept-4_b.C
new file mode 100644
index 0000000..7cc5531
--- /dev/null
+++ b/gcc/testsuite/g++.dg/modules/noexcept-4_b.C
@@ -0,0 +1,18 @@
+// { dg-additional-options "-fmodules -std=c++20" }
+
+struct exception_ptr {
+ friend bool operator==(const exception_ptr&, const exception_ptr&) = default;
+};
+
+void enqueue() {
+ exception_ptr e;
+ e == e;
+}
+
+import "noexcept-4_a.H";
+
+int main() {
+ constexpr exception_ptr e;
+ static_assert(e == e);
+ static_assert(noexcept(e == e));
+}
diff --git a/gcc/testsuite/g++.dg/opt/is_constant_evaluated4.C b/gcc/testsuite/g++.dg/opt/is_constant_evaluated4.C
new file mode 100644
index 0000000..9650004
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/is_constant_evaluated4.C
@@ -0,0 +1,20 @@
+// PR c++/114970
+// { dg-do compile { target c++17 } }
+// { dg-additional-options "-O -Wunused-value" }
+
+struct sv
+{
+ const char* str;
+ unsigned len;
+
+ constexpr sv(const char *p): str(p), len(0)
+ {
+ if (__builtin_is_constant_evaluated ()) { len = 42; }
+ }
+};
+
+int main()
+{
+ sv s ("foo");
+ return s.len;
+}
diff --git a/gcc/testsuite/g++.dg/opt/shrink-wrapping-vector-1.C b/gcc/testsuite/g++.dg/opt/shrink-wrapping-vector-1.C
new file mode 100644
index 0000000..8b1ad53
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/shrink-wrapping-vector-1.C
@@ -0,0 +1,17 @@
+// { dg-do compile { target { { { i?86-*-* x86_64-*-* } && { ! ia32 } } || { powerpc*-*-* aarch64*-*-* riscv*-*-* } } } }
+// { dg-options "-O2 -fdump-rtl-pro_and_epilogue" }
+// { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } }
+
+// PR rtl-optimization/118502
+
+// The shrink-wrapping should happen around the slow path of vector<int>::push_back,
+// The fast path is just checking if there is enough space and doing a few stores.
+// We want to verify that shrink wrapping always happens.
+
+#include <vector>
+
+void push_back(std::vector<int>& xs, unsigned char x) {
+ xs.push_back(x);
+}
+
+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" } } */
diff --git a/gcc/testsuite/g++.dg/pr112822.C b/gcc/testsuite/g++.dg/pr112822.C
index a855752..f88bd83 100644
--- a/gcc/testsuite/g++.dg/pr112822.C
+++ b/gcc/testsuite/g++.dg/pr112822.C
@@ -89,7 +89,7 @@ template <typename aj, typename cm> struct cg<aj, cm> { typedef aj cn; };
namespace ai {
template <typename cj, int> cj cp;
template <typename bu, typename cj, int> void cl(bu *cr, cj cs) { ct(cr, cs); }
-typedef __attribute__((altivec(vector__))) double co;
+typedef double co __attribute__ ((vector_size (16)));
void ct(double *cr, co cs) { *(co *)cr = cs; }
struct cq {
co q;
diff --git a/gcc/testsuite/g++.dg/template/explicit-args6.C b/gcc/testsuite/g++.dg/template/explicit-args6.C
index 18663d7b..0d9718c 100644
--- a/gcc/testsuite/g++.dg/template/explicit-args6.C
+++ b/gcc/testsuite/g++.dg/template/explicit-args6.C
@@ -24,10 +24,12 @@ frob()
// narrowing check, reject negative values
return unsigned{N}; // { dg-prune-output "narrowing" }
-} // { dg-prune-output "flows off the end" }
-// { dg-prune-output "not a return-statement" }
+}
-template<int N> void get_n(tuple& t) { get<frob<N>()>(t); } // { dg-error "" }
+// This complains about calling frob only in C++11 because
+// maybe_save_constexpr_fundef fails; in later standards it succeeds,
+// and the evaluation failure is silent due to the earlier errors.
+template<int N> void get_n(tuple& t) { get<frob<N>()>(t); } // { dg-error "" "" { target c++11_only } }
int main()
{
diff --git a/gcc/testsuite/g++.dg/template/friend86.C b/gcc/testsuite/g++.dg/template/friend86.C
new file mode 100644
index 0000000..9e2c1af
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/friend86.C
@@ -0,0 +1,25 @@
+// PR c++/119807
+// { dg-do run }
+
+template<int N>
+struct A {
+ template<class T> friend int f(A<N>, T);
+};
+
+template struct A<0>;
+template struct A<1>;
+
+int main() {
+ A<0> x;
+ A<1> y;
+ if (f(x, true) != 0) __builtin_abort();
+ if (f(y, true) != 1) __builtin_abort();
+}
+
+template<int N>
+struct B {
+ template<class T> friend int f(A<N>, T) { return N; }
+};
+
+template struct B<0>;
+template struct B<1>;
diff --git a/gcc/testsuite/g++.dg/template/friend87.C b/gcc/testsuite/g++.dg/template/friend87.C
new file mode 100644
index 0000000..94c0dfc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/friend87.C
@@ -0,0 +1,42 @@
+// PR c++/119807
+// { dg-do compile { target c++20 } }
+
+using size_t = decltype(sizeof(0));
+
+template<auto tag, size_t current>
+struct CounterReader {
+ template<typename>
+ friend auto counterFlag(CounterReader<tag, current>) noexcept;
+};
+
+template<auto tag, size_t current>
+struct CounterWriter {
+ static constexpr size_t value = current;
+
+ template<typename>
+ friend auto counterFlag(CounterReader<tag, current>) noexcept {}
+};
+
+template<auto tag, auto unique, size_t current = 0, size_t mask = size_t(1) << (sizeof(size_t) * 8 - 1)>
+[[nodiscard]] constexpr size_t counterAdvance() noexcept {
+ if constexpr (!mask) {
+ return CounterWriter<tag, current + 1>::value;
+ } else if constexpr (requires { counterFlag<void>(CounterReader<tag, current | mask>()); }) {
+ return counterAdvance<tag, unique, current | mask, (mask >> 1)>();
+ }
+ else {
+ return counterAdvance<tag, unique, current, (mask >> 1)>();
+ }
+}
+
+constexpr auto defaultCounterTag = [] {};
+
+template<auto tag = defaultCounterTag, auto unique = [] {}>
+constexpr size_t counter() noexcept {
+ return counterAdvance<tag, unique>();
+}
+
+int main() {
+ static_assert(counter() == 1);
+ static_assert(counter() == 2);
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr119778.C b/gcc/testsuite/g++.dg/torture/pr119778.C
new file mode 100644
index 0000000..4948056
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr119778.C
@@ -0,0 +1,20 @@
+// { dg-do compile }
+// { dg-additional-options "-Wall" }
+
+struct jmp_buf { long l[16]; };
+extern "C" int setjmp (jmp_buf *);
+struct S {
+ void foo () { bar (); }
+ virtual char bar () { return 0; }
+};
+void baz ();
+jmp_buf *a;
+
+void
+qux (bool x, S *y)
+{
+ if (x)
+ setjmp (a);
+ y->foo ();
+ baz ();
+}
diff --git a/gcc/testsuite/g++.dg/warn/Wformat-3.C b/gcc/testsuite/g++.dg/warn/Wformat-3.C
new file mode 100644
index 0000000..e308530
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wformat-3.C
@@ -0,0 +1,19 @@
+// PR c++/116954
+// { dg-additional-options -Wformat }
+
+#ifndef WORKS
+template<int N>
+int fn(char (&buf)[N], const char fmt[], ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+#endif
+
+template<int N>
+__attribute__ ((__format__ (__printf__, 2, 3)))
+int fn(char (&)[N], const char [], ...)
+{ return 0; }
+
+int main()
+{
+ char buf[20];
+ return fn(buf, "%s", 42); /* { dg-warning "Wformat" } */
+}
diff --git a/gcc/testsuite/g++.target/aarch64/sve/pr119706.C b/gcc/testsuite/g++.target/aarch64/sve/pr119706.C
new file mode 100644
index 0000000..40fefe5
--- /dev/null
+++ b/gcc/testsuite/g++.target/aarch64/sve/pr119706.C
@@ -0,0 +1,178 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mcpu=neoverse-v2 --param=aarch64-autovec-preference=sve-only -w" } */
+
+namespace a {
+typedef long unsigned b;
+typedef int c;
+template <bool, typename d> struct e { using f = d; };
+template <bool g, typename d = void> using h = typename e<g, d>::f;
+template <typename aa, typename, template <typename> class> struct i {
+ using f = aa;
+};
+template <typename aa, template <typename> class j> using k = i<aa, void, j>;
+template <typename aa, template <typename> class j>
+using l = typename k<aa, j>::f;
+} // namespace a
+inline void *operator new(a::b, void *ab) { return ab; }
+namespace a {
+template <typename> class ac {
+public:
+ typedef b m;
+ template <typename ad, typename... n> void ae(ad *ab, n... w) {
+ new (ab) ad(w...);
+ }
+};
+template <typename d> using x = ac<d>;
+template <typename d> class af : public x<d> {
+public:
+ typedef d o;
+ template <typename> struct ag { typedef af ah; };
+};
+struct ai {};
+struct aj : ai {};
+struct ak : aj {};
+template <typename> struct al;
+template <typename d> struct al<d *> {
+ typedef ak an;
+ typedef c ao;
+ typedef d ap;
+};
+template <typename aq> typename aq ::an ar(aq) { return typename aq ::an(); }
+template <typename as> typename as ::ao at(as au, as av, ak) { return av - au; }
+template <typename aw> typename aw ::ao ax(aw au, aw av) {
+ return at(au, av, ar(au));
+}
+template <typename> struct ay { typedef c ao; };
+} // namespace a
+namespace az {
+template <typename am, typename> class ba {
+ am bb;
+ typedef a::al<am> bc;
+
+public:
+ typedef typename bc::an an;
+ typedef typename bc::ao ao;
+ typedef typename bc::ap ap;
+ ba(am bd) : bb(bd) {}
+ ap operator*() { return *bb; }
+ ba operator++() {
+ ++bb;
+ return *this;
+ }
+ am base() { return bb; }
+};
+template <typename be, typename bf, typename bg>
+bool operator!=(ba<be, bg> bh, ba<bf, bg> p) {
+ return bh.base() != p.base();
+}
+template <typename be, typename bf, typename bg>
+auto operator-(ba<be, bg> bh, ba<bf, bg> p) {
+ return bh.base() - p.base();
+}
+} // namespace az
+namespace a {
+struct bi {
+ template <typename d, typename> struct bj {
+ using f = typename d::ag<d>::ah;
+ };
+ template <typename> using bk = b;
+ template <typename...> static constexpr bool bl = false;
+ template <typename, typename> static constexpr bool bm = bl<>;
+ template <typename d, typename... n> static constexpr bool bn = bm<d, n...>;
+};
+template <typename bo, typename ad> using bp = typename bi::bj<bo, ad>::f;
+template <typename bo> struct bq : bi {
+ typedef typename bo::o o;
+ using br = l<o *, bk>;
+ template <typename, typename bs> struct bt { using f = typename ay<bs>::ao; };
+ template <typename bu, typename> struct bv { using f = typename bu::m; };
+ using ao = typename bt<bo, c>::f;
+ using m = typename bv<bo, ao>::f;
+ template <typename d> using bw = bp<bo, d>;
+ static br allocate(bo, m);
+ template <typename d, typename... n>
+ static h<bn<bo, d>> ae(bo ci, d ab, n... w) {
+ ci.ae(ab, w...);
+ }
+};
+template <typename d> struct bx {
+ static bool by(d &bz) try { d(bz.begin(), bz.ca(), bz.cb()); } catch (...) {
+ }
+};
+} // namespace a
+namespace az {
+template <typename bo> struct cc : a::bq<bo> {
+ typedef a::bq<bo> q;
+ template <typename d> struct ag { typedef typename q::bw<d> ah; };
+};
+} // namespace az
+enum cd {};
+using ce = double;
+namespace a {
+template <typename aw, typename cf, typename cg, typename ch>
+cg cj(aw au, cf av, cg ck, ch cl) {
+ typedef az::cc<ch> cx;
+ for (; au != av; ++au, ++ck)
+ cx::ae(cl, ck, *au);
+}
+template <typename d, typename bo> struct cm {
+ typedef typename az::cc<bo>::ag<d>::ah cn;
+ typedef typename az::cc<cn>::br br;
+ struct co {
+ br db;
+ br cp;
+ };
+ struct cq : cn, co {
+ cq(cn) {}
+ } typedef cr;
+ cn cs();
+ cr cb() noexcept;
+ cm(cr ci) : ct(ci) {}
+ cq ct;
+ br cu(b cv) {
+ typedef az::cc<cn> cw;
+ return cv ? cw::allocate(ct, cv) : c();
+ }
+};
+template <typename d, typename bo = af<d>> class cy : cm<d, bo> {
+ typedef cm<d, bo> cz;
+
+public:
+ typedef typename cz::br br;
+ typedef az::ba<br, cy> da;
+ typedef b m;
+ typedef bo cr;
+ cz::cs;
+ template <typename aw> cy(aw au, aw av, cr ci) : cz(ci) {
+ dg(au, av, ar(au));
+ }
+ cz::cb;
+ da begin() { return this->ct.db; }
+ da ca() { return this->ct.cp; }
+ void r() { s(); }
+ void clear() { t(this->ct.db); }
+ template <typename cg> void dg(cg au, cg av, ai) { y(au, av, ax(au, av)); }
+ template <typename am, typename cf> void y(am au, cf av, m cv) {
+ br z = this->cu(dc(cv, cs()));
+ cj(au, av, z, cs());
+ }
+ bool s();
+ m dc(m cv, cr) { return cv; }
+ void t(br dd) {
+ if (this->ct.cp - dd)
+ this->ct.cp = dd;
+ }
+};
+template <typename d, typename bo> bool cy<d, bo>::s() { bx<cy>::by(*this); }
+namespace basic {
+class u {
+ using de = ce;
+ void v(cd, b);
+ cy<de> df;
+};
+void u::v(cd, b) {
+ df.clear();
+ df.r();
+}
+} // namespace basic
+} // namespace a \ No newline at end of file
diff --git a/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-1.C b/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-1.C
new file mode 100644
index 0000000..f3e3099
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-1.C
@@ -0,0 +1,15 @@
+/* 'std::bad_cast' exception. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-1.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ We don't print anything, but just 'abort'.
+
+ { dg-shouldfail {'std::bad_cast' exception} } */
diff --git a/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-2.C b/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-2.C
new file mode 100644
index 0000000..b047cbed
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-2.C
@@ -0,0 +1,13 @@
+/* 'std::bad_cast' exception, caught. */
+
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ Compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'int main\(\)':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.) */
diff --git a/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-2_-mfake-exceptions.C b/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-2_-mfake-exceptions.C
new file mode 100644
index 0000000..2904188
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-2_-mfake-exceptions.C
@@ -0,0 +1,18 @@
+/* 'std::bad_cast' exception, caught, '-mfake-exceptions'. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mfake-exceptions }
+ { dg-bogus {sorry, unimplemented: exception handling not supported} {} { target *-*-* } 0 } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "exceptions-bad_cast-2.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ We don't print anything, but just 'abort'.
+
+ There is no 'catch'ing; any exception is fatal.
+ { dg-shouldfail {'std::bad_cast' exception} } */
diff --git a/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-3.C b/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-3.C
new file mode 100644
index 0000000..3d0118c
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/exceptions-bad_cast-3.C
@@ -0,0 +1,10 @@
+/* 'std::bad_cast' exception, dead code. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-3.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } } */
diff --git a/gcc/testsuite/g++.target/gcn/exceptions-pr118794-1.C b/gcc/testsuite/g++.target/gcn/exceptions-pr118794-1.C
new file mode 100644
index 0000000..20f9d49
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/exceptions-pr118794-1.C
@@ -0,0 +1,17 @@
+/* Exception handling constructs in dead code. */
+
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mno-fake-exceptions } */
+/* { dg-additional-options -O0 } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1.C"
+
+/* In this specific C++ arrangement, distilled from PR118794, GCC synthesizes
+ '__builtin_eh_pointer', '__builtin_unwind_resume' calls as dead code in 'f':
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized } }
+ Given '-O0', compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'void f\(\)':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.) */
diff --git a/gcc/testsuite/g++.target/gcn/exceptions-pr118794-1_-mfake-exceptions.C b/gcc/testsuite/g++.target/gcn/exceptions-pr118794-1_-mfake-exceptions.C
new file mode 100644
index 0000000..a5f0da2
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/exceptions-pr118794-1_-mfake-exceptions.C
@@ -0,0 +1,16 @@
+/* Exception handling constructs in dead code, '-mfake-exceptions'. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mfake-exceptions }
+ { dg-bogus {sorry, unimplemented: exception handling not supported} {} { target *-*-* } 0 } */
+/* { dg-additional-options -O0 } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "exceptions-pr118794-1.C"
+
+/* In this specific C++ arrangement, distilled from PR118794, GCC synthesizes
+ '__builtin_eh_pointer', '__builtin_unwind_resume' calls as dead code in 'f':
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized } } */
diff --git a/gcc/testsuite/g++.target/gcn/exceptions-throw-1.C b/gcc/testsuite/g++.target/gcn/exceptions-throw-1.C
new file mode 100644
index 0000000..6cadf58
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/exceptions-throw-1.C
@@ -0,0 +1,16 @@
+/* 'throw'. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-1.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ We don't print anything, but just 'abort'.
+
+ { dg-shouldfail {'MyException' exception} } */
diff --git a/gcc/testsuite/g++.target/gcn/exceptions-throw-2.C b/gcc/testsuite/g++.target/gcn/exceptions-throw-2.C
new file mode 100644
index 0000000..671c810
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/exceptions-throw-2.C
@@ -0,0 +1,14 @@
+/* 'throw', caught. */
+
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ Compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'int main\(\)':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.) */
diff --git a/gcc/testsuite/g++.target/gcn/exceptions-throw-2_-mfake-exceptions.C b/gcc/testsuite/g++.target/gcn/exceptions-throw-2_-mfake-exceptions.C
new file mode 100644
index 0000000..f1fd505
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/exceptions-throw-2_-mfake-exceptions.C
@@ -0,0 +1,19 @@
+/* 'throw', caught, '-mfake-exceptions'. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mfake-exceptions }
+ { dg-bogus {sorry, unimplemented: exception handling not supported} {} { target *-*-* } 0 } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "exceptions-throw-2.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ We don't print anything, but just 'abort'.
+
+ There is no 'catch'ing; any exception is fatal.
+ { dg-shouldfail {'MyException' exception} } */
diff --git a/gcc/testsuite/g++.target/gcn/exceptions-throw-3.C b/gcc/testsuite/g++.target/gcn/exceptions-throw-3.C
new file mode 100644
index 0000000..5c1ad7a
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/exceptions-throw-3.C
@@ -0,0 +1,11 @@
+/* 'throw', dead code. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-3.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } } */
diff --git a/gcc/testsuite/g++.target/gcn/gcn.exp b/gcc/testsuite/g++.target/gcn/gcn.exp
new file mode 100644
index 0000000..a3bd75f
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/gcn.exp
@@ -0,0 +1,56 @@
+# Specific regression driver for GCN.
+# Copyright (C) 2000-2025 Free Software Foundation, Inc.
+
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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 GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# G++ testsuite that uses the `dg.exp' driver.
+
+# Exit immediately if this isn't a GCN target.
+if ![istarget amdgcn*-*-*] then {
+ return
+}
+
+# Load support procs.
+load_lib g++-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CXXFLAGS
+if ![info exists DEFAULT_CXXFLAGS] then {
+ set DEFAULT_CXXFLAGS " -pedantic-errors -Wno-long-long"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Recursively find files in $dir and subdirs, do not walk into subdirs
+# that contain their own .exp file.
+proc find-cxx-tests { dir suffix } {
+ set tests [lsort [glob -nocomplain -directory $dir "*.$suffix" ]]
+ foreach subdir [lsort [glob -nocomplain -type d -directory $dir *]] {
+ if { [glob -nocomplain -directory $subdir *.exp] eq "" } {
+ eval lappend tests [find-cxx-tests $subdir $suffix]
+ }
+ }
+ return $tests
+}
+
+set tests [find-cxx-tests $srcdir/$subdir {C}]
+
+# Main loop.
+g++-dg-runtest $tests "" $DEFAULT_CXXFLAGS
+
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/g++.target/gcn/pr119692-1-1.C b/gcc/testsuite/g++.target/gcn/pr119692-1-1.C
new file mode 100644
index 0000000..b44b08d
--- /dev/null
+++ b/gcc/testsuite/g++.target/gcn/pr119692-1-1.C
@@ -0,0 +1,6 @@
+/* PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/pr119692-1-1.C"
diff --git a/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-1.C b/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-1.C
new file mode 100644
index 0000000..f3e3099
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-1.C
@@ -0,0 +1,15 @@
+/* 'std::bad_cast' exception. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-1.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ We don't print anything, but just 'abort'.
+
+ { dg-shouldfail {'std::bad_cast' exception} } */
diff --git a/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-2.C b/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-2.C
new file mode 100644
index 0000000..b047cbed
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-2.C
@@ -0,0 +1,13 @@
+/* 'std::bad_cast' exception, caught. */
+
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ Compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'int main\(\)':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.) */
diff --git a/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-2_-mfake-exceptions.C b/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-2_-mfake-exceptions.C
new file mode 100644
index 0000000..3f40951
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-2_-mfake-exceptions.C
@@ -0,0 +1,19 @@
+/* 'std::bad_cast' exception, caught, '-mfake-exceptions'. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mfake-exceptions }
+ { dg-bogus {sorry, unimplemented: exception handling not supported} {} { target *-*-* } 0 } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+/* { dg-bogus {_ZTISt8bad_cast} PR119734 { xfail *-*-* } 0 } */
+
+#include "exceptions-bad_cast-2.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ We don't print anything, but just 'abort'.
+
+ There is no 'catch'ing; any exception is fatal.
+ { dg-shouldfail {'std::bad_cast' exception} } */
diff --git a/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-3.C b/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-3.C
new file mode 100644
index 0000000..3d0118c
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-3.C
@@ -0,0 +1,10 @@
+/* 'std::bad_cast' exception, dead code. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-3.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } } */
diff --git a/gcc/testsuite/g++.target/nvptx/exceptions-pr118794-1.C b/gcc/testsuite/g++.target/nvptx/exceptions-pr118794-1.C
new file mode 100644
index 0000000..20f9d49
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/exceptions-pr118794-1.C
@@ -0,0 +1,17 @@
+/* Exception handling constructs in dead code. */
+
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mno-fake-exceptions } */
+/* { dg-additional-options -O0 } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1.C"
+
+/* In this specific C++ arrangement, distilled from PR118794, GCC synthesizes
+ '__builtin_eh_pointer', '__builtin_unwind_resume' calls as dead code in 'f':
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized } }
+ Given '-O0', compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'void f\(\)':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.) */
diff --git a/gcc/testsuite/g++.target/nvptx/exceptions-pr118794-1_-mfake-exceptions.C b/gcc/testsuite/g++.target/nvptx/exceptions-pr118794-1_-mfake-exceptions.C
new file mode 100644
index 0000000..a5f0da2
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/exceptions-pr118794-1_-mfake-exceptions.C
@@ -0,0 +1,16 @@
+/* Exception handling constructs in dead code, '-mfake-exceptions'. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mfake-exceptions }
+ { dg-bogus {sorry, unimplemented: exception handling not supported} {} { target *-*-* } 0 } */
+/* { dg-additional-options -O0 } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "exceptions-pr118794-1.C"
+
+/* In this specific C++ arrangement, distilled from PR118794, GCC synthesizes
+ '__builtin_eh_pointer', '__builtin_unwind_resume' calls as dead code in 'f':
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized } } */
diff --git a/gcc/testsuite/g++.target/nvptx/exceptions-throw-1.C b/gcc/testsuite/g++.target/nvptx/exceptions-throw-1.C
new file mode 100644
index 0000000..6cadf58
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/exceptions-throw-1.C
@@ -0,0 +1,16 @@
+/* 'throw'. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-1.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ We don't print anything, but just 'abort'.
+
+ { dg-shouldfail {'MyException' exception} } */
diff --git a/gcc/testsuite/g++.target/nvptx/exceptions-throw-2.C b/gcc/testsuite/g++.target/nvptx/exceptions-throw-2.C
new file mode 100644
index 0000000..671c810
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/exceptions-throw-2.C
@@ -0,0 +1,14 @@
+/* 'throw', caught. */
+
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ Compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'int main\(\)':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.) */
diff --git a/gcc/testsuite/g++.target/nvptx/exceptions-throw-2_-mfake-exceptions.C b/gcc/testsuite/g++.target/nvptx/exceptions-throw-2_-mfake-exceptions.C
new file mode 100644
index 0000000..f1fd505
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/exceptions-throw-2_-mfake-exceptions.C
@@ -0,0 +1,19 @@
+/* 'throw', caught, '-mfake-exceptions'. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -mfake-exceptions }
+ { dg-bogus {sorry, unimplemented: exception handling not supported} {} { target *-*-* } 0 } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "exceptions-throw-2.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ We don't print anything, but just 'abort'.
+
+ There is no 'catch'ing; any exception is fatal.
+ { dg-shouldfail {'MyException' exception} } */
diff --git a/gcc/testsuite/g++.target/nvptx/exceptions-throw-3.C b/gcc/testsuite/g++.target/nvptx/exceptions-throw-3.C
new file mode 100644
index 0000000..5c1ad7a
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/exceptions-throw-3.C
@@ -0,0 +1,11 @@
+/* 'throw', dead code. */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+/* { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-3.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } } */
diff --git a/gcc/testsuite/g++.target/nvptx/pr119692-1-1.C b/gcc/testsuite/g++.target/nvptx/pr119692-1-1.C
new file mode 100644
index 0000000..b44b08d
--- /dev/null
+++ b/gcc/testsuite/g++.target/nvptx/pr119692-1-1.C
@@ -0,0 +1,6 @@
+/* PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" */
+
+/* { dg-do run } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+
+#include "../../../../libgomp/testsuite/libgomp.oacc-c++/pr119692-1-1.C"
diff --git a/gcc/testsuite/g++.target/riscv/rvv/autovec/pr119547-2.C b/gcc/testsuite/g++.target/riscv/rvv/autovec/pr119547-2.C
new file mode 100644
index 0000000..1b98d3d
--- /dev/null
+++ b/gcc/testsuite/g++.target/riscv/rvv/autovec/pr119547-2.C
@@ -0,0 +1,212 @@
+/* { dg-do run { target rv64 } } */
+/* { dg-require-effective-target riscv_v_ok } */
+/* { dg-options "-O3 -march=rv64gcv -mabi=lp64d --param=logical-op-non-short-circuit=0" } */
+
+#include <riscv_vector.h>
+
+using v_uint8 = vuint8m2_t;
+using v_int8 = vint8m2_t;
+using v_uint16 = vuint16m2_t;
+using v_int16 = vint16m2_t;
+using v_uint32 = vuint32m2_t;
+using v_int32 = vint32m2_t;
+using v_uint64 = vuint64m2_t;
+using v_int64 = vint64m2_t;
+using v_float32 = vfloat32m2_t;
+using v_float64 = vfloat64m2_t;
+
+using uchar = unsigned char;
+using schar = signed char;
+using ushort = unsigned short;
+using uint = unsigned int;
+using uint64 = unsigned long int;
+using int64 = long int;
+
+struct Size
+{
+ int width;
+ int height;
+};
+
+template <class T> struct VTraits;
+
+template <> struct VTraits<vint32m1_t>
+{
+ static inline int vlanes () { return __riscv_vsetvlmax_e32m1 (); }
+ using lane_type = int32_t;
+ static const int max_nlanes = 1024 / 32 * 2;
+};
+template <> struct VTraits<vint32m2_t>
+{
+ static inline int vlanes () { return __riscv_vsetvlmax_e32m2 (); }
+ using lane_type = int32_t;
+ static const int max_nlanes = 1024 / 32 * 2;
+};
+template <> struct VTraits<vint32m4_t>
+{
+ static inline int vlanes () { return __riscv_vsetvlmax_e32m4 (); }
+ using lane_type = int32_t;
+ static const int max_nlanes = 1024 / 32 * 2;
+};
+template <> struct VTraits<vint32m8_t>
+{
+ static inline int vlanes () { return __riscv_vsetvlmax_e32m8 (); }
+ using lane_type = int32_t;
+ static const int max_nlanes = 1024 / 32 * 2;
+};
+
+template <> struct VTraits<vfloat64m1_t>
+{
+ static inline int vlanes () { return __riscv_vsetvlmax_e64m1 (); }
+ using lane_type = double;
+ static const int max_nlanes = 1024 / 64 * 2;
+};
+template <> struct VTraits<vfloat64m2_t>
+{
+ static inline int vlanes () { return __riscv_vsetvlmax_e64m2 (); }
+ using lane_type = double;
+ static const int max_nlanes = 1024 / 64 * 2;
+};
+template <> struct VTraits<vfloat64m4_t>
+{
+ static inline int vlanes () { return __riscv_vsetvlmax_e64m4 (); }
+ using lane_type = double;
+ static const int max_nlanes = 1024 / 64 * 2;
+};
+template <> struct VTraits<vfloat64m8_t>
+{
+ static inline int vlanes () { return __riscv_vsetvlmax_e64m8 (); }
+ using lane_type = double;
+ static const int max_nlanes = 1024 / 64 * 2;
+};
+
+static inline v_float64
+v_setall_f64 (double v)
+{
+ return __riscv_vfmv_v_f_f64m2 (v, VTraits<v_float64>::vlanes ());
+}
+static inline v_float64
+vx_setall_f64 (double v)
+{
+ return v_setall_f64 (v);
+}
+
+inline v_int32
+v_load_expand_q (const schar *ptr)
+{
+ return __riscv_vwcvt_x (
+ __riscv_vwcvt_x (__riscv_vle8_v_i8mf2 (ptr, VTraits<v_int32>::vlanes ()),
+ VTraits<v_int32>::vlanes ()),
+ VTraits<v_int32>::vlanes ());
+}
+
+static inline v_int32
+vx_load_expand_q (const schar *ptr)
+{
+ return v_load_expand_q (ptr);
+}
+
+inline v_float64
+v_cvt_f64 (const v_int32 &a)
+{
+ return __riscv_vget_f64m2 (__riscv_vfwcvt_f (a, VTraits<v_int32>::vlanes ()),
+ 0);
+}
+
+inline v_float64
+v_cvt_f64_high (const v_int32 &a)
+{
+ return __riscv_vget_f64m2 (__riscv_vfwcvt_f (a, VTraits<v_int32>::vlanes ()),
+ 1);
+}
+
+inline void
+v_store (double *ptr, const v_float64 &a)
+{
+ __riscv_vse64 (ptr, a, VTraits<v_float64>::vlanes ());
+}
+
+static inline void
+v_store_pair_as (double *ptr, const v_float64 &a, const v_float64 &b)
+{
+ v_store (ptr, a);
+ v_store (ptr + VTraits<v_float64>::vlanes (), b);
+}
+
+static inline void
+vx_load_pair_as (const schar *ptr, v_float64 &a, v_float64 &b)
+{
+ v_int32 v0 = vx_load_expand_q (ptr);
+ a = v_cvt_f64 (v0);
+ b = v_cvt_f64_high (v0);
+}
+
+inline v_float64
+v_fma (const v_float64 &a, const v_float64 &b, const v_float64 &c)
+{
+ return __riscv_vfmacc_vv_f64m2 (c, a, b, VTraits<v_float64>::vlanes ());
+}
+
+template <typename _Tp>
+static inline _Tp
+saturate_cast (double v)
+{
+ return _Tp (v);
+}
+
+template <typename _Ts, typename _Td>
+__attribute__ ((noipa)) void
+cvt_64f (const _Ts *src, size_t sstep, _Td *dst, size_t dstep, Size size,
+ double a, double b)
+{
+ v_float64 va = vx_setall_f64 (a), vb = vx_setall_f64 (b);
+ const int VECSZ = VTraits<v_float64>::vlanes () * 2;
+
+ sstep /= sizeof (src[0]);
+ dstep /= sizeof (dst[0]);
+
+ for (int i = 0; i < size.height; i++, src += sstep, dst += dstep)
+ {
+ int j = 0;
+
+ for (; j < size.width; j += VECSZ)
+ {
+ if (j > size.width - VECSZ)
+ {
+ if (j == 0 || src == (_Ts *) dst)
+ break;
+ j = size.width - VECSZ;
+ }
+ v_float64 v0, v1;
+ vx_load_pair_as (src + j, v0, v1);
+ v0 = v_fma (v0, va, vb);
+ v1 = v_fma (v1, va, vb);
+ v_store_pair_as (dst + j, v0, v1);
+ }
+
+ for (; j < size.width; j++)
+ dst[j] = saturate_cast<_Td> (src[j] * a + b);
+ }
+}
+
+void
+__attribute__ ((noipa))
+cvtScale8s64f (const uchar *src_, size_t sstep, const uchar *, size_t,
+ uchar *dst_, size_t dstep, Size size, void *scale_)
+{
+ const schar *src = (const schar *) src_;
+ double *dst = (double *) dst_;
+ double *scale = (double *) scale_;
+ cvt_64f (src, sstep, dst, dstep, size, (double) scale[0], (double) scale[1]);
+}
+
+int main ()
+{
+ uchar src[1024];
+ uchar dst[1024];
+
+ double scale[2] = {2.0, 3.0};
+ Size size {4, 1};
+
+ cvtScale8s64f (src, 4, NULL, 0, dst, 32, size, (void *)scale);
+}
diff --git a/gcc/testsuite/g++.target/riscv/rvv/autovec/pr119547.C b/gcc/testsuite/g++.target/riscv/rvv/autovec/pr119547.C
new file mode 100644
index 0000000..bac0fb1
--- /dev/null
+++ b/gcc/testsuite/g++.target/riscv/rvv/autovec/pr119547.C
@@ -0,0 +1,82 @@
+/* { dg-do run { target rv64 } } */
+/* { dg-require-effective-target riscv_v_ok } */
+/* { dg-options "-O3 -march=rv64gcv -mabi=lp64d --param=logical-op-non-short-circuit=0" } */
+
+#include <riscv_vector.h>
+using v_int32 = vint32m2_t;
+using v_float64 = vfloat64m2_t;
+struct Size
+{
+ int width;
+ int height;
+};
+template <class> struct VTraits
+{
+ static int vlanes () { return __riscv_vsetvlmax_e32m2 (); }
+};
+v_int32
+v_load_expand_q (const signed char *ptr)
+{
+ return __riscv_vwcvt_x (
+ __riscv_vwcvt_x (__riscv_vle8_v_i8mf2 (ptr, VTraits<v_int32>::vlanes ()),
+ VTraits<v_int32>::vlanes ()),
+ VTraits<v_int32>::vlanes ());
+}
+v_float64
+v_cvt_f64_high (v_int32 a)
+{
+ return __riscv_vget_f64m2 (__riscv_vfwcvt_f (a, VTraits<v_int32>::vlanes ()),
+ 1);
+}
+void
+v_store (double *ptr, v_float64 a)
+{
+ __riscv_vse64 (ptr, a, __riscv_vsetvlmax_e64m2 ());
+}
+void
+v_store_pair_as (double *ptr, v_float64 b)
+{
+ v_store (ptr, b);
+}
+void
+vx_load_pair_as (const signed char *ptr, v_float64, v_float64 &b)
+{
+ v_int32 v0;
+ b = v_cvt_f64_high (v0);
+};
+void
+cvt_64f (const signed char *src, double *dst, Size size)
+{
+ int VECSZ = __riscv_vsetvlmax_e64m2 ();
+ for (int i; i < size.height; i++)
+ {
+ int j;
+ for (;; j += VECSZ)
+ {
+ if (j > -VECSZ)
+ if (j == 0 || dst)
+ break;
+ v_float64 v0, v1;
+ vx_load_pair_as (src, v0, v1);
+ v_store_pair_as (dst, v1);
+ }
+ for (; j < size.width; j++)
+ dst[j] = (src[j]);
+ }
+}
+void
+cvtScale8s64f (unsigned char *src_, unsigned char *dst_,
+ size_t, Size size, void *)
+{
+ signed char src;
+ double dst = *dst_;
+ cvt_64f (&src, &dst, size);
+}
+int main ()
+{
+ unsigned char src[1];
+ unsigned char dst[1024];
+ double scale[1];
+ Size size{4, 1};
+ cvtScale8s64f (src, dst, 32, size, scale);
+}
diff --git a/gcc/testsuite/g++.target/s390/pr119834.C b/gcc/testsuite/g++.target/s390/pr119834.C
new file mode 100644
index 0000000..66c0a69
--- /dev/null
+++ b/gcc/testsuite/g++.target/s390/pr119834.C
@@ -0,0 +1,76 @@
+// PR target/119834
+// { dg-do compile { target c++11 } }
+// { dg-options "-O2 -march=z900" }
+
+int *a;
+struct A;
+struct B {
+ A begin ();
+ A end ();
+ operator bool * ();
+ void operator++ ();
+};
+template <typename T>
+auto operator| (int, T x) -> decltype (x (0));
+struct A : B { bool a; };
+struct C { A operator () (int); };
+enum D {} d;
+int e;
+void foo ();
+struct E {
+ template <typename T>
+ T *garply ()
+ {
+ if (d)
+ return 0;
+ if (e)
+ foo ();
+ return reinterpret_cast<T *> (f);
+ }
+ template <typename>
+ void bar (long x, bool)
+ {
+ if (&g - f)
+ __builtin_memset (a, 0, x);
+ f += x;
+ }
+ template <typename T>
+ T *baz (T *x, long y, bool z = true)
+ {
+ if (d)
+ return nullptr;
+ bar<T> ((char *)x + y - f, z);
+ return x;
+ }
+ template <typename T>
+ void qux (T x) { baz (x, x->j); }
+ char *f, g;
+} *h;
+struct F {
+ template <typename T>
+ int corge (T x) { x.freddy (this); return 0; }
+ template <typename T>
+ int boo (T x) { corge (x); return 0; }
+} i;
+template <typename T>
+struct G {
+ template <typename U> friend T operator+ (U, G);
+ template <typename U>
+ void waldo (F *x, G y, U z) { x->boo (z + y); }
+ template <typename... Ts>
+ void plugh (E *y, Ts... z) { T *x = y->garply<T> (); x->thud (y, z...); }
+};
+template <typename T> using H = G<T>;
+struct I {
+ static constexpr unsigned j = 2;
+ void thud (E *x, A y) { x->qux (this); for (auto g : y) ; }
+};
+H<I> k;
+struct J {
+ void freddy (F *) { C a; auto b = 0 | a; k.plugh (h, b); }
+};
+H<J> l;
+struct K {
+ void freddy () { l.waldo (&i, l, this); }
+};
+void grault () { K m; m.freddy (); }
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
index c48fe5f..09aaaa6 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
@@ -77,9 +77,9 @@ void test_integer_conversion_memset (void *d)
/* Passing a ptrdiff_t where size_t is expected may not be unsafe
but because GCC may emits suboptimal code for such calls warning
for them helps improve efficiency. */
- memset (d, 0, diffi); /* { dg-warning ".memset. argument 3 promotes to .ptrdiff_t. {aka .\(long \)?\(int\)?\(__int20\)?.} where .\(long \)?\(__int20 \)?unsigned\( int\)?. is expected" } */
+ memset (d, 0, diffi); /* { dg-warning ".memset. argument 3 promotes to .ptrdiff_t. {aka .\(long \)*\(int\)?\(__int20\)?.} where .\(long \)*\(__int20 \)?unsigned\( int\)?. is expected" } */
- memset (d, 0, 2.0); /* { dg-warning ".memset. argument 3 type is .double. where '\(long \)?\(__int20 \)?unsigned\( int\)?' is expected" } */
+ memset (d, 0, 2.0); /* { dg-warning ".memset. argument 3 type is .double. where '\(long \)*\(__int20 \)?unsigned\( int\)?' is expected" } */
/* Verify that the same call as above but to the built-in doesn't
trigger a warning. */
diff --git a/gcc/testsuite/gcc.dg/bf-ms-attrib.c b/gcc/testsuite/gcc.dg/bf-ms-attrib.c
index 2da4f03..5208c7f 100644
--- a/gcc/testsuite/gcc.dg/bf-ms-attrib.c
+++ b/gcc/testsuite/gcc.dg/bf-ms-attrib.c
@@ -32,7 +32,7 @@ main()
/* As long as the sizes are as expected, we know attributes are working.
bf-ms-layout.c makes sure the right thing happens when the attribute
is on. */
- if (sizeof(struct one_ms) != 8)
+ if (sizeof(struct one_ms) != 12)
abort();
if (sizeof(struct one_gcc) != 8)
abort();
diff --git a/gcc/testsuite/gcc.dg/bitint-121.c b/gcc/testsuite/gcc.dg/bitint-121.c
new file mode 100644
index 0000000..335b9a1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/bitint-121.c
@@ -0,0 +1,24 @@
+/* PR middle-end/119808 */
+/* { dg-do run { target { bitint && fstack_protector } } } */
+/* { dg-options "-O0 -ftree-coalesce-vars -fstack-protector-strong" } */
+
+#if __BITINT_MAXWIDTH__ >= 129
+_BitInt(129)
+foo ()
+{
+ _BitInt(129) b = 0;
+ _BitInt(8) a
+ =__builtin_stdc_rotate_right (0x8c82111b5d2d37c57e9ada7213ed95a49uwb, b);
+ return b;
+}
+#endif
+
+int
+main ()
+{
+#if __BITINT_MAXWIDTH__ >= 129
+ _BitInt(129) x = foo ();
+ if (x)
+ __builtin_abort ();
+#endif
+}
diff --git a/gcc/testsuite/gcc.dg/bitint-122.c b/gcc/testsuite/gcc.dg/bitint-122.c
new file mode 100644
index 0000000..c791969
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/bitint-122.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/116093 */
+/* { dg-do run { target bitint } } */
+/* { dg-options "-Og -ftree-vrp -fno-tree-dce" } */
+
+#if __BITINT_MAXWIDTH__ >= 129
+char
+foo (int a, _BitInt (129) b, char c)
+{
+ return c << (5 / b % (0xdb75dbf5 | a));
+}
+#endif
+
+int
+main ()
+{
+#if __BITINT_MAXWIDTH__ >= 129
+ if (foo (0, 6, 1) != 1)
+ __builtin_abort ();
+#endif
+}
diff --git a/gcc/testsuite/gcc.dg/completion-2.c b/gcc/testsuite/gcc.dg/completion-2.c
index 99e6531..46c511c 100644
--- a/gcc/testsuite/gcc.dg/completion-2.c
+++ b/gcc/testsuite/gcc.dg/completion-2.c
@@ -5,6 +5,7 @@
-flto-partition=1to1
-flto-partition=balanced
-flto-partition=cache
+-flto-partition=default
-flto-partition=max
-flto-partition=none
-flto-partition=one
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-19.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-19.c
index c34c89e..39874ad 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-19.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-19.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-additional-options "-msse2" { target ia32 } } */
-/* { dg-additional-options "-Wno-psabi" { target powerpc-ibm-aix* powerpc-wrs-vxworks* } } */
+/* { dg-additional-options "-Wno-psabi" { target powerpc-ibm-aix* powerpc-wrs-vxworks* powerpc-*-elf } } */
typedef int __attribute__((__vector_size__(16))) vectype;
diff --git a/gcc/testsuite/gcc.dg/ipa/pr119318.c b/gcc/testsuite/gcc.dg/ipa/pr119318.c
new file mode 100644
index 0000000..f179aed
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr119318.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-Wno-psabi -w -O2" } */
+
+typedef unsigned V __attribute__((vector_size (64)));
+typedef unsigned __int128 W __attribute__((vector_size (64)));
+
+W a;
+W b;
+W c = { -0xffff, -0xffff, -0xffff, -0xffff };
+
+static __attribute__((__noinline__, __noclone__)) W
+bar (unsigned __int128 u)
+{
+ return u + c;
+}
+
+static inline W
+foo (unsigned short s, V v)
+{
+ V y = (V) bar ((unsigned short) ~s);
+ v >>= y;
+ b ^= (W) a;
+ v *= v;
+ return (W) v + b;
+}
+
+
+int
+main ()
+{
+ W x = foo (0, (V) { 0, 5 });
+ for (unsigned i = 0; i < sizeof(x)/sizeof(x[0]); i++)
+ if (x[i] != (i ? 0 : 0x1900000000))
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/pr119530.c b/gcc/testsuite/gcc.dg/ipa/pr119530.c
new file mode 100644
index 0000000..f99c4fd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr119530.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -fno-tree-vrp -fno-inline" } */
+
+struct a {
+ int b;
+};
+int c;
+signed char d;
+static int e(long long f) { return f < 0; }
+static void g(unsigned f) { c = e(~f); }
+int main() {
+ int h;
+ struct a i = {128};
+ h = d > i.b;
+ g(h);
+ if (h)
+ __builtin_abort();
+ if (c)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/pr119803.c b/gcc/testsuite/gcc.dg/ipa/pr119803.c
new file mode 100644
index 0000000..1a7bfd2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr119803.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern void f(int p);
+int a, b;
+char c;
+static int d(int e) { return !e || a == 1 ? 0 : a / e; }
+static void h(short e) {
+ int g = d(e);
+ f(g);
+}
+void i() {
+ c = 128;
+ h(c);
+ b = d(65536);
+}
diff --git a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
index 8c15097..2be31fa 100644
--- a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
+++ b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
@@ -25,5 +25,5 @@ bar (long a)
}
/* { dg-final { scan-rtl-dump "Will split live ranges of parameters" "ira" } } */
-/* { dg-final { scan-rtl-dump "Split live-range of register" "ira" { xfail { ! aarch64*-*-* } } } } */
+/* { dg-final { scan-rtl-dump "Split live-range of register" "ira" { xfail { ! { aarch64*-*-* i?86-*-* x86_64-*-* } } } } } */
/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" } } */
diff --git a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-2.c b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-2.c
index 0690e03..61ee4c6 100644
--- a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-2.c
+++ b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-2.c
@@ -30,6 +30,6 @@ bar (long a)
}
/* { dg-final { scan-rtl-dump "Will split live ranges of parameters" "ira" } } */
-/* { dg-final { scan-rtl-dump "Split live-range of register" "ira" { xfail { ! aarch64*-*-* } } } } */
+/* { dg-final { scan-rtl-dump "Split live-range of register" "ira" { xfail { ! { aarch64*-*-* i?86-*-* x86_64-*-* } } } } } */
/* XFAIL due to PR70681. */
/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail arm*-*-* powerpc*-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/pr116357.c b/gcc/testsuite/gcc.dg/pr116357.c
index 07effa1..12aaf62 100644
--- a/gcc/testsuite/gcc.dg/pr116357.c
+++ b/gcc/testsuite/gcc.dg/pr116357.c
@@ -2,9 +2,9 @@
/* { dg-do compile } */
/* { dg-options "" } */
-typedef int A __attribute__((aligned (2 * alignof (int))));
+typedef int A __attribute__((aligned (2 * sizeof (int))));
A a[4]; /* { dg-error "alignment of array elements is greater than element size" } */
-typedef volatile int B __attribute__((aligned (2 * alignof (int))));
+typedef volatile int B __attribute__((aligned (2 * sizeof (int))));
B b[4]; /* { dg-error "alignment of array elements is greater than element size" } */
-typedef const int C __attribute__((aligned (2 * alignof (int))));
+typedef const int C __attribute__((aligned (2 * sizeof (int))));
C c[4]; /* { dg-error "alignment of array elements is greater than element size" } */
diff --git a/gcc/testsuite/gcc.dg/pr118947-1.c b/gcc/testsuite/gcc.dg/pr118947-1.c
new file mode 100644
index 0000000..8733e8d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr118947-1.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/118947 */
+/* { dg-do compile { target size32plus } } */
+/* { dg-options "-O2 -fdump-tree-forwprop1-details" } */
+/* { dg-final { scan-tree-dump-times "after previous" 1 "forwprop1" } } */
+
+void* aaa();
+void* bbb()
+{
+ char buf[1025] = {};
+ /* Tha call to aaa should not matter and clobber buf. */
+ void* ret = aaa();
+ __builtin_memcpy(ret, buf, sizeof(buf));
+ return ret;
+}
+
diff --git a/gcc/testsuite/gcc.dg/pr119160.c b/gcc/testsuite/gcc.dg/pr119160.c
new file mode 100644
index 0000000..b4629a1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr119160.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -finstrument-functions-once -favoid-store-forwarding -fnon-call-exceptions -fschedule-insns -mgeneral-regs-only -Wno-psabi" } */
+
+typedef __attribute__((__vector_size__ (32))) int V;
+
+void
+foo (V v, V, V, V *r)
+{
+ V u = (V){} + v[0];
+ *r = u;
+}
+
+__attribute__((__noipa__)) void
+bar(int x)
+{
+ if (x != 2) __builtin_abort();
+}
+
+int
+main ()
+{
+ V x;
+ foo ((V){ 2, 3 }, (V){ }, (V){ }, &x);
+ for (unsigned i = 0; i < sizeof(x)/sizeof(x[0]); i++)
+ bar(x[i]);
+} \ No newline at end of file
diff --git a/gcc/testsuite/gcc.dg/pr119717.c b/gcc/testsuite/gcc.dg/pr119717.c
new file mode 100644
index 0000000..e5eedc5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr119717.c
@@ -0,0 +1,24 @@
+/* PR c/119717 */
+/* { dg-additional-options "-std=c23" } */
+/* { dg-do compile } */
+
+struct annotated {
+ unsigned count;
+ [[gnu::counted_by(count)]] char array[];
+};
+
+[[gnu::noinline,gnu::noipa]]
+static unsigned
+size_of (bool x, struct annotated *a)
+{
+ char *p = (x ? a : 0)->array;
+ return __builtin_dynamic_object_size (p, 1);
+}
+
+int main()
+{
+ struct annotated *p = __builtin_malloc(sizeof *p);
+ p->count = 0;
+ __builtin_printf ("the bdos whole is %ld\n", size_of (0, p));
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr78408-3.c b/gcc/testsuite/gcc.dg/pr78408-3.c
new file mode 100644
index 0000000..5ea5458
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr78408-3.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/78408 */
+/* { dg-do compile { target size32plus } } */
+/* { dg-options "-O2 -fdump-tree-forwprop1-details" } */
+/* { dg-final { scan-tree-dump-times "after previous" 1 "forwprop1" } } */
+
+void* aaa();
+void* bbb()
+{
+ void* ret = aaa();
+ char buf[1025] = {};
+ __builtin_memcpy(ret, buf, sizeof(buf));
+ return ret;
+}
+
diff --git a/gcc/testsuite/gcc.dg/rtl/i386/vector_eq-2.c b/gcc/testsuite/gcc.dg/rtl/i386/vector_eq-2.c
new file mode 100644
index 0000000..871d489
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/rtl/i386/vector_eq-2.c
@@ -0,0 +1,71 @@
+/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-additional-options "-O2 -march=x86-64-v3" } */
+
+typedef int v4si __attribute__((vector_size(16)));
+typedef int v8si __attribute__((vector_size(32)));
+typedef int v2di __attribute__((vector_size(16)));
+
+v4si __RTL (startwith ("vregs1")) foo1 (void)
+{
+(function "foo1"
+ (insn-chain
+ (block 2
+ (edge-from entry (flags "FALLTHRU"))
+ (cnote 1 [bb 2] NOTE_INSN_BASIC_BLOCK)
+ (cnote 2 NOTE_INSN_FUNCTION_BEG)
+ (cinsn 3 (set (reg:V4SI <0>) (const_vector:V4SI [(const_int -1) (const_int -1) (const_int -1) (const_int -1)])))
+ (cinsn 4 (set (reg:V4SI <1>) (const_vector:V4SI [(const_int -1) (const_int -1) (const_int -1) (const_int -1)])))
+ (cinsn 5 (set (reg:V4SI <2>)
+ (eq:V4SI (reg:V4SI <0>) (reg:V4SI <1>))))
+ (cinsn 6 (set (reg:V4SI <3>) (reg:V4SI <2>)))
+ (cinsn 7 (set (reg:V4SI xmm0) (reg:V4SI <3>)))
+ (edge-to exit (flags "FALLTHRU"))
+ )
+ )
+ (crtl (return_rtx (reg/i:V4SI xmm0)))
+)
+}
+
+v8si __RTL (startwith ("vregs1")) foo2 (void)
+{
+(function "foo2"
+ (insn-chain
+ (block 2
+ (edge-from entry (flags "FALLTHRU"))
+ (cnote 1 [bb 2] NOTE_INSN_BASIC_BLOCK)
+ (cnote 2 NOTE_INSN_FUNCTION_BEG)
+ (cinsn 3 (set (reg:V8SI <0>) (const_vector:V8SI [(const_int -1) (const_int -1) (const_int -1) (const_int -1) (const_int -1) (const_int -1) (const_int -1) (const_int -1)])))
+ (cinsn 4 (set (reg:V8SI <1>) (const_vector:V8SI [(const_int -1) (const_int -1) (const_int -1) (const_int -1) (const_int -1) (const_int -1) (const_int -1) (const_int -1)])))
+ (cinsn 5 (set (reg:V8SI <2>)
+ (eq:V8SI (reg:V8SI <0>) (reg:V8SI <1>))))
+ (cinsn 6 (set (reg:V8SI <3>) (reg:V8SI <2>)))
+ (cinsn 7 (set (reg:V8SI xmm0) (reg:V8SI <3>)))
+ (edge-to exit (flags "FALLTHRU"))
+ )
+ )
+ (crtl (return_rtx (reg/i:V8SI xmm0)))
+)
+}
+
+v2di __RTL (startwith ("vregs1")) foo3 (void)
+{
+(function "foo3"
+ (insn-chain
+ (block 2
+ (edge-from entry (flags "FALLTHRU"))
+ (cnote 1 [bb 2] NOTE_INSN_BASIC_BLOCK)
+ (cnote 2 NOTE_INSN_FUNCTION_BEG)
+ (cinsn 3 (set (reg:V2DI <0>) (const_vector:V2DI [(const_int -1) (const_int -1)])))
+ (cinsn 4 (set (reg:V2DI <1>) (const_vector:V2DI [(const_int -1) (const_int -1)])))
+ (cinsn 5 (set (reg:V2DI <2>)
+ (eq:V2DI (reg:V2DI <0>) (reg:V2DI <1>))))
+ (cinsn 6 (set (reg:V2DI <3>) (reg:V2DI <2>)))
+ (cinsn 7 (set (reg:V2DI xmm0) (reg:V2DI <3>)))
+ (edge-to exit (flags "FALLTHRU"))
+ )
+ )
+ (crtl (return_rtx (reg/i:V2DI xmm0)))
+)
+}
+
+/* { dg-final { scan-assembler-times "vpcmpeq" 3 } } */
diff --git a/gcc/testsuite/gcc.dg/rtl/i386/vector_eq-3.c b/gcc/testsuite/gcc.dg/rtl/i386/vector_eq-3.c
new file mode 100644
index 0000000..276c4c2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/rtl/i386/vector_eq-3.c
@@ -0,0 +1,74 @@
+/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-additional-options "-O2 -march=x86-64-v3" } */
+
+typedef int v4si __attribute__((vector_size(16)));
+typedef int v8si __attribute__((vector_size(32)));
+typedef int v2di __attribute__((vector_size(16)));
+
+v4si __RTL (startwith ("vregs1")) foo1 (void)
+{
+(function "foo1"
+ (insn-chain
+ (block 2
+ (edge-from entry (flags "FALLTHRU"))
+ (cnote 1 [bb 2] NOTE_INSN_BASIC_BLOCK)
+ (cnote 2 NOTE_INSN_FUNCTION_BEG)
+ (cinsn 3 (set (reg:V4SI <1>)
+ (mem:V4SI (reg:SI di) [0 ptr S128 A128])))
+ (cinsn 4 (set (reg:V4SI <2>)
+ (eq:V4SI (reg:V4SI <1>)
+ (mem:V4SI (reg:SI di) [0 ptr S128 A128]))))
+ (cinsn 5 (set (reg:V4SI <3>) (reg:V4SI <2>)))
+ (cinsn 6 (set (reg:V4SI xmm0) (reg:V4SI <3>)))
+ (edge-to exit (flags "FALLTHRU"))
+ )
+ )
+ (crtl (return_rtx (reg/i:V4SI xmm0)))
+)
+}
+
+v8si __RTL (startwith ("vregs1")) foo2 (void)
+{
+(function "foo2"
+ (insn-chain
+ (block 2
+ (edge-from entry (flags "FALLTHRU"))
+ (cnote 1 [bb 2] NOTE_INSN_BASIC_BLOCK)
+ (cnote 2 NOTE_INSN_FUNCTION_BEG)
+ (cinsn 3 (set (reg:V8SI <1>)
+ (mem:V8SI (reg:SI di) [0 ptr S256 A256])))
+ (cinsn 4 (set (reg:V8SI <2>)
+ (eq:V8SI (mem:V8SI (reg:SI di) [0 ptr S256 A256])
+ (reg:V8SI <1>))))
+ (cinsn 5 (set (reg:V8SI <3>) (reg:V8SI <2>)))
+ (cinsn 6 (set (reg:V8SI xmm0) (reg:V8SI <3>)))
+ (edge-to exit (flags "FALLTHRU"))
+ )
+ )
+ (crtl (return_rtx (reg/i:V8SI xmm0)))
+)
+}
+
+v2di __RTL (startwith ("vregs1")) foo3 (void)
+{
+(function "foo3"
+ (insn-chain
+ (block 2
+ (edge-from entry (flags "FALLTHRU"))
+ (cnote 1 [bb 2] NOTE_INSN_BASIC_BLOCK)
+ (cnote 2 NOTE_INSN_FUNCTION_BEG)
+ (cinsn 3 (set (reg:V2DI <1>)
+ (mem:V2DI (reg:SI di) [0 ptr S128 A128])))
+ (cinsn 4 (set (reg:V2DI <2>)
+ (eq:V2DI (reg:V2DI <1>)
+ (mem:V2DI (reg:SI di) [0 ptr S128 A128]))))
+ (cinsn 5 (set (reg:V2DI <3>) (reg:V2DI <2>)))
+ (cinsn 6 (set (reg:V2DI xmm0) (reg:V2DI <3>)))
+ (edge-to exit (flags "FALLTHRU"))
+ )
+ )
+ (crtl (return_rtx (reg/i:V2DI xmm0)))
+)
+}
+
+/* { dg-final { scan-assembler-times "vpcmpeq" 3 } } */
diff --git a/gcc/testsuite/gcc.dg/torture/bitint-76.c b/gcc/testsuite/gcc.dg/torture/bitint-76.c
new file mode 100644
index 0000000..df47857
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/bitint-76.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/119707 */
+/* { dg-do run { target bitint } } */
+
+#if __BITINT_MAXWIDTH__ >= 256
+__attribute__((noipa)) unsigned _BitInt(256)
+foo (unsigned _BitInt(256) x, _BitInt(129) y)
+{
+ return x + (unsigned _BitInt(255)) y;
+}
+#endif
+
+int
+main ()
+{
+#if __BITINT_MAXWIDTH__ >= 256
+ if (foo (0, -1) != 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffuwb)
+ __builtin_abort ();
+#endif
+}
diff --git a/gcc/testsuite/gcc.dg/torture/bitint-77.c b/gcc/testsuite/gcc.dg/torture/bitint-77.c
new file mode 100644
index 0000000..3e2523f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/bitint-77.c
@@ -0,0 +1,26 @@
+/* PR tree-optimization/119722 */
+/* { dg-do run { target bitint } } */
+/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-copy-prop -fno-tree-fre" } */
+
+#if __BITINT_MAXWIDTH__ >= 33300
+unsigned _BitInt(33300) g;
+
+unsigned
+foo (long c)
+{
+ unsigned _BitInt(33300) b
+ = __builtin_stdc_rotate_left ((unsigned _BitInt(13)) 8, c);
+ return ((unsigned _BitInt(50)) (g >> 50)
+ + ({ unsigned _BitInt(300) unused; b; }));
+}
+#endif
+
+int
+main ()
+{
+#if __BITINT_MAXWIDTH__ >= 33300
+ unsigned x = foo (0);
+ if (x != 8)
+ __builtin_abort ();
+#endif
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr118476-1.c b/gcc/testsuite/gcc.dg/torture/pr118476-1.c
new file mode 100644
index 0000000..33509403
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr118476-1.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+/* PR tree-optimization/118476 */
+
+typedef unsigned long long poly64x1 __attribute__((__vector_size__(1*sizeof(long long))));
+
+poly64x1 vext_p64(poly64x1 a, poly64x1 b, const int n)
+{
+ poly64x1 r = a;
+ unsigned src = (unsigned)n;
+ long long t = b[0];
+ r[0] = (src < 1) ? a[src] : t;
+ return r;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr118902-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr118902-1.c
new file mode 100644
index 0000000..fa21b8a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr118902-1.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+void foo(int);
+void l(int**);
+int f1(int j, int t)
+{
+ int p = 0;
+ int *a = &p;
+ l(&a);
+ if (a == &p)
+ return 0;
+ for(int i = 0; i < j; i++)
+ {
+ if (a == &p) foo(p);
+ }
+ return 0;
+}
+
+/* We should be able to remove the call to foo because a is never equal to &p inside the loop. */
+/* { dg-final { scan-tree-dump-not "foo " "optimized"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-52.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-52.c
new file mode 100644
index 0000000..9e605ac
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-52.c
@@ -0,0 +1,30 @@
+/* { dg-options "-O2 -fdump-tree-dse-details -fno-tree-fre -fdump-tree-optimized" } */
+
+/* PR tree-optimization/87901 */
+
+char z[32];
+void foo1(void)
+{
+ char z1[17];
+ char z2[24];
+ __builtin_memset (z1, 0, 17);
+ __builtin_memcpy (z, z1, 17);
+ __builtin_memset (z2, 0, 24);
+ __builtin_memcpy (z+8, z2, 24);
+}
+
+/* we should get:
+ MEM <unsigned char[8]> [(char * {ref-all})&z] = {};
+ MEM <unsigned char[24]> [(char * {ref-all})&z + 8B] = {};
+ after DSE; trimming the first memset to z (which was memcpy) to 8 bytes
+ from the original 17.
+ and not have a [17] in the IR after DSE.
+ The two memset to z1/z2 will also be removed.
+ */
+/* { dg-final { scan-tree-dump-not "\\\[17\\\]" "optimized" } } */
+/* { dg-final { scan-tree-dump "\\\[8\\\]" "dse1" } } */
+
+/* { dg-final { scan-tree-dump-times "Trimming statement " 1 "dse1" } } */
+/* { dg-final { scan-tree-dump-times "Deleted dead call:" 2 "dse1" } } */
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-53.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-53.c
new file mode 100644
index 0000000..a2df591
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-53.c
@@ -0,0 +1,26 @@
+/* { dg-options "-O2 -fno-strict-aliasing -fdump-tree-dse-details -fno-tree-fre -fdump-tree-optimized" } */
+
+/* PR tree-optimization/87901 */
+
+
+int i;
+int foo ()
+{
+ i = 0;
+ *((short *)&i + 1) = 1;
+ return i;
+}
+
+/* we should get:
+ MEM <char[2]> [(int *)&i] = {};
+ MEM[(short int *)&i + 2B] = 1;
+ in DSE1.
+
+ Note later on the stores will be merged. */
+/* { dg-final { scan-tree-dump "return 65536;" "optimized" { target le } } } */
+/* { dg-final { scan-tree-dump "return 1;" "optimized" { target be } } } */
+/* { dg-final { scan-tree-dump "\\\[2\\\]" "dse1" } } */
+
+/* { dg-final { scan-tree-dump-times "Trimming statement " 1 "dse1" } } */
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-54.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-54.c
new file mode 100644
index 0000000..7e79a73
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-54.c
@@ -0,0 +1,25 @@
+/* { dg-options "-O2 -fdump-tree-dse-details -fno-tree-fre -fdump-tree-optimized" } */
+
+/* PR tree-optimization/87901 */
+
+int z[128];
+void foo1(void)
+{
+ int z1;
+ int z2[24/sizeof(int)];
+ __builtin_memset (&z1, 0, sizeof(int));
+ __builtin_memcpy (z, &z1, sizeof(int));
+ __builtin_memset (z2, 0, 24);
+ __builtin_memcpy (((char*)z)+1, z2, 24);
+}
+
+/* we should get:
+ MEM[(char * {ref-all})&z] = {};
+ __builtin_memset (&MEM <int[128]> [(void *)&z + 1B], 0, 24);
+ */
+
+/* { dg-final { scan-tree-dump-not "MEM <unsigned int>" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "MEM \\\[" "dse1" } } */
+/* { dg-final { scan-tree-dump-times "Trimming statement " 1 "dse1" } } */
+/* { dg-final { scan-tree-dump-times "Deleted dead call:" 1 "dse1" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/pr119399.c b/gcc/testsuite/gcc.dg/vect/pr119399.c
new file mode 100644
index 0000000..8d868f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr119399.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fdump-tree-vect-raw" } */
+
+void foo(int *p, int *q, int n)
+{
+ for (int i = 0; i < n; i++)
+ p[i] = q[i] + 1;
+}
+
+/* { dg-final { scan-tree-dump-not {<pointer_diff_expr,} "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr119757.c b/gcc/testsuite/gcc.dg/vect/pr119757.c
new file mode 100644
index 0000000..8644299
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr119757.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+void base64_encode(const char *table64,
+ const char *inputbuff, int insize,
+ char * __restrict output)
+{
+ const unsigned char *in = (const unsigned char *)inputbuff;
+
+ while(insize >= 3) {
+ *output++ = table64[ in[0] >> 2 ];
+ *output++ = table64[ ((in[0] & 0x03) << 4) | (in[1] >> 4) ];
+ *output++ = table64[ ((in[1] & 0x0F) << 2) | ((in[2] & 0xC0) >> 6) ];
+ *output++ = table64[ in[2] & 0x3F ];
+ insize -= 3;
+ in += 3;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_18.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_18.c
index edddb44..cd39704 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_18.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_18.c
@@ -2,7 +2,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target vect_early_break } */
/* { dg-require-effective-target vect_int } */
-
+/* { dg-additional-options "-march=gfx908" { target amdgcn*-*-* } } */
/* { dg-additional-options "-Ofast" } */
/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target vect_load_lanes } } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/acle/rwsr-ungated.c b/gcc/testsuite/gcc.target/aarch64/acle/rwsr-ungated.c
new file mode 100644
index 0000000..d67a426
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/acle/rwsr-ungated.c
@@ -0,0 +1,13 @@
+/* Test that __arm_[r,w]sr intrinsics aren't gated (by default). */
+
+/* { dg-do compile } */
+/* { dg-options "-march=armv8-a" } */
+
+#include <arm_acle.h>
+
+uint64_t
+foo (uint64_t a)
+{
+ __arm_wsr64 ("zcr_el1", a);
+ return __arm_rsr64 ("smcr_el1");
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/bic-1.c b/gcc/testsuite/gcc.target/aarch64/bic-1.c
new file mode 100644
index 0000000..65e1514
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/bic-1.c
@@ -0,0 +1,40 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { check-function-bodies "**" "" "" } } */
+
+/* PR rtl-optmization/111949 */
+
+/*
+**func1:
+** bic w([0-9]+), w0, w1
+** and w0, w\1, 1
+** ret
+*/
+
+unsigned func1(unsigned a, bool b)
+{
+ int c = a & b;
+ return (c ^ a)&1;
+}
+
+/*
+**func2:
+** bic w([0-9]+), w1, w0
+** and w0, w\1, 255
+** ret
+*/
+unsigned func2(bool a, bool b)
+{
+ return ~a & b;
+}
+
+/*
+**func3:
+** bic w([0-9]+), w1, w0
+** and w0, w\1, 1
+** ret
+*/
+bool func3(bool a, unsigned char b)
+{
+ return !a & b;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10.c
new file mode 100644
index 0000000..b7a7bc5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10.c
@@ -0,0 +1,24 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -msve-vector-bits=256 --param aarch64-autovec-preference=sve-only -fdump-tree-vect-details" } */
+
+#define N 512
+#define START 0
+#define END 505
+
+int x[N] __attribute__((aligned(32)));
+
+int __attribute__((noipa))
+foo (int start)
+{
+ for (unsigned int i = start; i < END; ++i)
+ {
+ if (x[i] == 0)
+ return i;
+ }
+ return -1;
+}
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */
+/* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10_run.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10_run.c
new file mode 100644
index 0000000..6169aeb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_10_run.c
@@ -0,0 +1,17 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do run { target aarch64_sve_hw } } */
+/* { dg-options "-Ofast --param aarch64-autovec-preference=sve-only" } */
+/* { dg-additional-options "-msve-vector-bits=256" { target aarch64_sve256_hw } } */
+/* { dg-additional-options "-msve-vector-bits=128" { target aarch64_sve128_hw } } */
+
+#include "peel_ind_10.c"
+
+int __attribute__ ((optimize (1)))
+main (void)
+{
+ int res = foo (START);
+ asm volatile ("");
+ if (res != START)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5.c
new file mode 100644
index 0000000..a03bb1d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5.c
@@ -0,0 +1,24 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -msve-vector-bits=256 --param aarch64-autovec-preference=sve-only -fdump-tree-vect-details" } */
+
+#define N 512
+#define START 2
+#define END 505
+
+int x[N] __attribute__((aligned(32)));
+
+int __attribute__((noipa))
+foo (void)
+{
+ for (signed int i = START; i < END; ++i)
+ {
+ if (x[i] == 0)
+ return i;
+ }
+ return -1;
+}
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */
+/* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5_run.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5_run.c
new file mode 100644
index 0000000..f26befe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_5_run.c
@@ -0,0 +1,17 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do run { target aarch64_sve_hw } } */
+/* { dg-options "-Ofast --param aarch64-autovec-preference=sve-only" } */
+/* { dg-additional-options "-msve-vector-bits=256" { target aarch64_sve256_hw } } */
+/* { dg-additional-options "-msve-vector-bits=128" { target aarch64_sve128_hw } } */
+
+#include "peel_ind_5.c"
+
+int __attribute__ ((optimize (1)))
+main (void)
+{
+ int res = foo ();
+ asm volatile ("");
+ if (res != START)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6.c
new file mode 100644
index 0000000..9bfd1a6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6.c
@@ -0,0 +1,24 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -msve-vector-bits=256 --param aarch64-autovec-preference=sve-only -fdump-tree-vect-details" } */
+
+#define N 512
+#define START 1
+#define END 505
+
+int x[N] __attribute__((aligned(32)));
+
+int __attribute__((noipa))
+foo (int start)
+{
+ for (unsigned int i = start; i < END; ++i)
+ {
+ if (x[i] == 0)
+ return i;
+ }
+ return -1;
+}
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */
+/* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6_run.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6_run.c
new file mode 100644
index 0000000..4fdf3e4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_6_run.c
@@ -0,0 +1,17 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do run { target aarch64_sve_hw } } */
+/* { dg-options "-Ofast --param aarch64-autovec-preference=sve-only" } */
+/* { dg-additional-options "-msve-vector-bits=256" { target aarch64_sve256_hw } } */
+/* { dg-additional-options "-msve-vector-bits=128" { target aarch64_sve128_hw } } */
+
+#include "peel_ind_6.c"
+
+int __attribute__ ((optimize (1)))
+main (void)
+{
+ int res = foo (START);
+ asm volatile ("");
+ if (res != START)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7.c
new file mode 100644
index 0000000..0182e13
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7.c
@@ -0,0 +1,24 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -msve-vector-bits=256 --param aarch64-autovec-preference=sve-only -fdump-tree-vect-details" } */
+
+#define N 512
+#define START 1
+#define END 505
+
+int x[N] __attribute__((aligned(32)));
+
+int __attribute__((noipa))
+foo (void)
+{
+ for (unsigned int i = START; i < END; ++i)
+ {
+ if (x[i] == 0)
+ return i;
+ }
+ return -1;
+}
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */
+/* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7_run.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7_run.c
new file mode 100644
index 0000000..05608dd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_7_run.c
@@ -0,0 +1,17 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do run { target aarch64_sve_hw } } */
+/* { dg-options "-Ofast --param aarch64-autovec-preference=sve-only" } */
+/* { dg-additional-options "-msve-vector-bits=256" { target aarch64_sve256_hw } } */
+/* { dg-additional-options "-msve-vector-bits=128" { target aarch64_sve128_hw } } */
+
+#include "peel_ind_7.c"
+
+int __attribute__ ((optimize (1)))
+main (void)
+{
+ int res = foo ();
+ asm volatile ("");
+ if (res != START)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_8.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_8.c
new file mode 100644
index 0000000..043348b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_8.c
@@ -0,0 +1,24 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -msve-vector-bits=256 --param aarch64-autovec-preference=sve-only -fdump-tree-vect-details" } */
+
+#define N 512
+#define START 1
+#define END 505
+
+int x[N] __attribute__((aligned(32)));
+
+int __attribute__((noipa))
+foo (void)
+{
+ for (unsigned int i = START; i < END; i*=2)
+ {
+ if (x[i] == 0)
+ return i;
+ }
+ return -1;
+}
+
+/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" } } */
+/* { dg-final { scan-tree-dump-not "pfa_iv_offset" "vect" } } */
+/* { dg-final { scan-tree-dump-not "Alignment of access forced using peeling" "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_8_run.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_8_run.c
new file mode 100644
index 0000000..aa86122
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_8_run.c
@@ -0,0 +1,17 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do run { target aarch64_sve_hw } } */
+/* { dg-options "-Ofast --param aarch64-autovec-preference=sve-only" } */
+/* { dg-additional-options "-msve-vector-bits=256" { target aarch64_sve256_hw } } */
+/* { dg-additional-options "-msve-vector-bits=128" { target aarch64_sve128_hw } } */
+
+#include "peel_ind_8.c"
+
+int __attribute__ ((optimize (1)))
+main (void)
+{
+ int res = foo ();
+ asm volatile ("");
+ if (res != START)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9.c
new file mode 100644
index 0000000..cc904e8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9.c
@@ -0,0 +1,25 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -msve-vector-bits=256 --param aarch64-autovec-preference=sve-only -fdump-tree-vect-details" } */
+
+#define N 512
+#define START 1
+#define END 505
+
+int x[N] __attribute__((aligned(32)));
+
+int __attribute__((noipa))
+foo (void)
+{
+ for (int *p = x + START; p < x + END; p++)
+ {
+ if (*p == 0)
+ return START;
+ }
+ return -1;
+}
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+/* Peels using a scalar loop. */
+/* { dg-final { scan-tree-dump-not "pfa_iv_offset" "vect" } } */
+/* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9_run.c b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9_run.c
new file mode 100644
index 0000000..767f8bd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/peel_ind_9_run.c
@@ -0,0 +1,17 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do run { target aarch64_sve_hw } } */
+/* { dg-options "-Ofast --param aarch64-autovec-preference=sve-only" } */
+/* { dg-additional-options "-msve-vector-bits=256" { target aarch64_sve256_hw } } */
+/* { dg-additional-options "-msve-vector-bits=128" { target aarch64_sve128_hw } } */
+
+#include "peel_ind_9.c"
+
+int __attribute__ ((optimize (1)))
+main (void)
+{
+ int res = foo ();
+ asm volatile ("");
+ if (res != START)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr119351.c b/gcc/testsuite/gcc.target/aarch64/sve/pr119351.c
new file mode 100644
index 0000000..85aab35
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr119351.c
@@ -0,0 +1,39 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -msve-vector-bits=256 --param aarch64-autovec-preference=sve-only -fdump-tree-vect-details" } */
+/* { dg-final { check-function-bodies "**" "" ""} } */
+
+#define N 512
+#define START 1
+#define END 505
+
+int x[N] __attribute__((aligned(32)));
+
+/*
+** foo:
+** ...
+** ld1w z[0-9]+.s, p[0-9]+/z, \[x[0-9], x[0-9], lsl 2\]
+** cmple p[0-9]+.s, p[0-9]+/z, z[0-9]+.s, #0
+** ptest p[0-9]+, p[0-9]+.b
+** ...
+*/
+
+int __attribute__((noipa))
+foo (void)
+{
+ int z = 0;
+ for (unsigned int i = START; i < END; ++i)
+ {
+ z++;
+ if (x[i] > 0)
+ continue;
+
+ return z;
+ }
+ return -1;
+}
+
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
+/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */
+/* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */
+
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr119351_run.c b/gcc/testsuite/gcc.target/aarch64/sve/pr119351_run.c
new file mode 100644
index 0000000..d36ab0e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr119351_run.c
@@ -0,0 +1,20 @@
+/* Fix for PR119351 alignment peeling with vectors and VLS. */
+/* { dg-do run { target aarch64_sve_hw } } */
+/* { dg-options "-Ofast --param aarch64-autovec-preference=sve-only" } */
+/* { dg-additional-options "-msve-vector-bits=256" { target aarch64_sve256_hw } } */
+/* { dg-additional-options "-msve-vector-bits=128" { target aarch64_sve128_hw } } */
+
+#include "pr119351.c"
+
+int __attribute__ ((optimize (1)))
+main (void)
+{
+ x[0] = 1;
+ x[1] = 21;
+ x[2] = 39;
+ x[3] = 59;
+ int res = foo ();
+ if (res != 4)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-long.c b/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-long.c
new file mode 100644
index 0000000..631d14f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-long.c
@@ -0,0 +1,76 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" } } */
+
+typedef unsigned int __attribute__ ((mode (DI))) int64_t;
+typedef unsigned int __attribute__ ((mode (SI))) int32_t;
+
+typedef union
+ {
+ int32_t l[8];
+ }
+val;
+
+typedef struct
+ {
+ int32_t l[2];
+ val v;
+ }
+tre;
+
+typedef struct
+ {
+ int32_t l[3];
+ tre t;
+ }
+due;
+
+typedef struct
+ {
+ val v;
+ int64_t q;
+ int32_t l[2];
+ due d;
+ }
+uno;
+
+void
+memcpy_nested_offset_long (uno *u)
+{
+ u->d.t.v = u->v;
+}
+
+/* Expect assembly such as:
+
+ ldq $4,0($16)
+ ldq $3,8($16)
+ ldq $2,16($16)
+ srl $4,32,$7
+ ldq $1,24($16)
+ srl $3,32,$6
+ stl $4,68($16)
+ srl $2,32,$5
+ stl $7,72($16)
+ srl $1,32,$4
+ stl $3,76($16)
+ stl $6,80($16)
+ stl $2,84($16)
+ stl $5,88($16)
+ stl $1,92($16)
+ stl $4,96($16)
+
+ that is with four quadword loads at offsets 0, 8, 16, 24 each and
+ eight longword stores at offsets 68, 72, 76, 80, 84, 88, 92, 96 each. */
+
+/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,0\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,8\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,16\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,24\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,68\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,72\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,76\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,80\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,84\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,88\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,92\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstl\\s\\\$\[0-9\]+,96\\\(\\\$16\\\)\\s" 1 } } */
diff --git a/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-quad.c b/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-quad.c
new file mode 100644
index 0000000..1d2227e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/alpha/memcpy-nested-offset-quad.c
@@ -0,0 +1,64 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" } } */
+
+typedef unsigned int __attribute__ ((mode (DI))) int64_t;
+typedef unsigned int __attribute__ ((mode (SI))) int32_t;
+
+typedef union
+ {
+ int32_t l[8];
+ }
+val;
+
+typedef struct
+ {
+ int32_t l[2];
+ val v;
+ }
+tre;
+
+typedef struct
+ {
+ int32_t l[3];
+ tre t;
+ }
+due;
+
+typedef struct
+ {
+ val v;
+ int64_t q;
+ int32_t l[3];
+ due d;
+ }
+uno;
+
+void
+memcpy_nested_offset_quad (uno *u)
+{
+ u->d.t.v = u->v;
+}
+
+/* Expect assembly such as:
+
+ ldq $4,0($16)
+ ldq $3,8($16)
+ ldq $2,16($16)
+ ldq $1,24($16)
+ stq $4,72($16)
+ stq $3,80($16)
+ stq $2,88($16)
+ stq $1,96($16)
+
+ that is with four quadword loads at offsets 0, 8, 16, 24 each
+ and four quadword stores at offsets 72, 80, 88, 96 each. */
+
+/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,0\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,8\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,16\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sldq\\s\\\$\[0-9\]+,24\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,72\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,80\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,88\\\(\\\$16\\\)\\s" 1 } } */
+/* { dg-final { scan-assembler-times "\\sstq\\s\\\$\[0-9\]+,96\\\(\\\$16\\\)\\s" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/ivopts.c b/gcc/testsuite/gcc.target/arm/ivopts.c
index d7d72a5..582fdab 100644
--- a/gcc/testsuite/gcc.target/arm/ivopts.c
+++ b/gcc/testsuite/gcc.target/arm/ivopts.c
@@ -11,6 +11,6 @@ tr5 (short array[], int n)
}
/* { dg-final { scan-tree-dump-times "PHI <" 1 "ivopts"} } */
-/* { dg-final { object-size text <= 20 { target { arm_thumb2_no_arm_v8_1_lob } } } } */
+/* { dg-final { object-size text <= 20 { target { arm_thumb2_no_arm_v8_1m_lob } } } } */
/* { dg-final { object-size text <= 32 { target { arm_nothumb && { ! arm_iwmmxt_ok } } } } } */
/* { dg-final { object-size text <= 36 { target { arm_nothumb && arm_iwmmxt_ok } } } } */
diff --git a/gcc/testsuite/gcc.target/arm/lob1.c b/gcc/testsuite/gcc.target/arm/lob1.c
index c8ce653..f42a367 100644
--- a/gcc/testsuite/gcc.target/arm/lob1.c
+++ b/gcc/testsuite/gcc.target/arm/lob1.c
@@ -1,7 +1,7 @@
/* Check that GCC generates Armv8.1-M low over head loop instructions
for some simple loops. */
/* { dg-do run } */
-/* { dg-require-effective-target arm_v8_1_lob_ok } */
+/* { dg-require-effective-target arm_v8_1m_lob_hw } */
/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps" } */
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.target/arm/lob6.c b/gcc/testsuite/gcc.target/arm/lob6.c
index 4fe116e..e19635b 100644
--- a/gcc/testsuite/gcc.target/arm/lob6.c
+++ b/gcc/testsuite/gcc.target/arm/lob6.c
@@ -1,7 +1,7 @@
/* Check that GCC generates Armv8.1-M low over head loop instructions
with some less trivial loops and the result is correct. */
/* { dg-do run } */
-/* { dg-require-effective-target arm_v8_1_lob_ok } */
+/* { dg-require-effective-target arm_v8_1m_lob_hw } */
/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps" } */
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c b/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
index 9272e4c..41ee994 100644
--- a/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
+++ b/gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-require-effective-target arm_thumb2_ok_no_arm_v8_1_lob } */
+/* { dg-require-effective-target arm_thumb2_ok_no_arm_v8_1m_lob } */
/* { dg-options "-O" } */
unsigned short foo (unsigned short x, unsigned short c)
diff --git a/gcc/testsuite/gcc.target/i386/apx-interrupt-1.c b/gcc/testsuite/gcc.target/i386/apx-interrupt-1.c
index fefe2e6..fa1acc7 100644
--- a/gcc/testsuite/gcc.target/i386/apx-interrupt-1.c
+++ b/gcc/testsuite/gcc.target/i386/apx-interrupt-1.c
@@ -66,7 +66,7 @@ void foo (void *frame)
/* { dg-final { scan-assembler-times {\t\.cfi_offset 132, -120} 1 } } */
/* { dg-final { scan-assembler-times {\t\.cfi_offset 131, -128} 1 } } */
/* { dg-final { scan-assembler-times {\t\.cfi_offset 130, -136} 1 } } */
-/* { dg-final { scan-assembler-times ".cfi_restore" 15} } */
+/* { dg-final { scan-assembler-times ".cfi_restore" 31 } } */
/* { dg-final { scan-assembler-times "pop(?:l|q)\[\\t \]*%(?:e|r)ax" 1 } } */
/* { dg-final { scan-assembler-times "pop(?:l|q)\[\\t \]*%(?:e|r)bx" 1 } } */
/* { dg-final { scan-assembler-times "pop(?:l|q)\[\\t \]*%(?:e|r)cx" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr119386-1.c b/gcc/testsuite/gcc.target/i386/pr119386-1.c
new file mode 100644
index 0000000..9a0dc64
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr119386-1.c
@@ -0,0 +1,10 @@
+/* PR target/119386 */
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -pg" } */
+/* { dg-final { scan-assembler "call\[ \t\]+mcount@PLT" } } */
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr119386-2.c b/gcc/testsuite/gcc.target/i386/pr119386-2.c
new file mode 100644
index 0000000..3ea978e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr119386-2.c
@@ -0,0 +1,12 @@
+/* PR target/119386 */
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -fno-plt -pg" } */
+/* { dg-final { scan-assembler "call\[ \t\]+\\*mcount@GOTPCREL\\(" { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler "call\[ \t\]+\\*mcount@GOT\\(" { target ia32 } } } */
+
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr119386-3.c b/gcc/testsuite/gcc.target/i386/pr119386-3.c
new file mode 100644
index 0000000..287410b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr119386-3.c
@@ -0,0 +1,10 @@
+/* PR target/119386 */
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fpic -pg -mnop-mcount" } */
+/* { dg-final { scan-assembler ".byte\[ \t\]+0x0f, 0x1f, 0x44, 0x00, 0x00" } } */
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr119784a.c b/gcc/testsuite/gcc.target/i386/pr119784a.c
new file mode 100644
index 0000000..8a119d4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr119784a.c
@@ -0,0 +1,96 @@
+/* { dg-do compile { target { *-*-linux* && lp64 } } } */
+/* { dg-options "-O2 -fno-pic -mtune=generic -mgeneral-regs-only -mapxf -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */
+
+/* start must save and restore all caller saved registers. */
+
+/*
+**start:
+**.LFB[0-9]+:
+** .cfi_startproc
+** subq \$248, %rsp
+**...
+** movq %rax, \(%rsp\)
+** movq %rdx, 8\(%rsp\)
+** movq %rcx, 16\(%rsp\)
+** movq %rbx, 24\(%rsp\)
+** movq %rsi, 32\(%rsp\)
+** movq %rdi, 40\(%rsp\)
+**...
+** movq %rbp, 48\(%rsp\)
+** movq %r8, 56\(%rsp\)
+** movq %r9, 64\(%rsp\)
+** movq %r10, 72\(%rsp\)
+** movq %r11, 80\(%rsp\)
+** movq %r12, 88\(%rsp\)
+** movq %r13, 96\(%rsp\)
+** movq %r14, 104\(%rsp\)
+** movq %r15, 112\(%rsp\)
+** movq %r16, 120\(%rsp\)
+** movq %r17, 128\(%rsp\)
+** movq %r18, 136\(%rsp\)
+** movq %r19, 144\(%rsp\)
+** movq %r20, 152\(%rsp\)
+** movq %r21, 160\(%rsp\)
+** movq %r22, 168\(%rsp\)
+** movq %r23, 176\(%rsp\)
+** movq %r24, 184\(%rsp\)
+** movq %r25, 192\(%rsp\)
+** movq %r26, 200\(%rsp\)
+** movq %r27, 208\(%rsp\)
+** movq %r28, 216\(%rsp\)
+** movq %r29, 224\(%rsp\)
+** movq %r30, 232\(%rsp\)
+** movq %r31, 240\(%rsp\)
+**...
+** call \*code\(%rip\)
+** movq \(%rsp\), %rax
+** movq 8\(%rsp\), %rdx
+** movq 16\(%rsp\), %rcx
+** movq 24\(%rsp\), %rbx
+** movq 32\(%rsp\), %rsi
+** movq 40\(%rsp\), %rdi
+** movq 48\(%rsp\), %rbp
+** movq 56\(%rsp\), %r8
+** movq 64\(%rsp\), %r9
+** movq 72\(%rsp\), %r10
+** movq 80\(%rsp\), %r11
+** movq 88\(%rsp\), %r12
+** movq 96\(%rsp\), %r13
+** movq 104\(%rsp\), %r14
+** movq 112\(%rsp\), %r15
+** movq 120\(%rsp\), %r16
+** movq 128\(%rsp\), %r17
+** movq 136\(%rsp\), %r18
+** movq 144\(%rsp\), %r19
+** movq 152\(%rsp\), %r20
+** movq 160\(%rsp\), %r21
+** movq 168\(%rsp\), %r22
+** movq 176\(%rsp\), %r23
+** movq 184\(%rsp\), %r24
+** movq 192\(%rsp\), %r25
+** movq 200\(%rsp\), %r26
+** movq 208\(%rsp\), %r27
+** movq 216\(%rsp\), %r28
+** movq 224\(%rsp\), %r29
+** movq 232\(%rsp\), %r30
+** movq 240\(%rsp\), %r31
+** addq \$248, %rsp
+**...
+** ret
+** .cfi_endproc
+**...
+*/
+
+#define DONT_SAVE_REGS __attribute__((no_callee_saved_registers))
+#define SAVE_REGS __attribute__((no_caller_saved_registers))
+
+typedef DONT_SAVE_REGS void (*op_t)(void);
+
+extern op_t code[];
+
+SAVE_REGS void start()
+{
+ code[0]();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr119784b.c b/gcc/testsuite/gcc.target/i386/pr119784b.c
new file mode 100644
index 0000000..c676197
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr119784b.c
@@ -0,0 +1,87 @@
+/* { dg-do compile { target { *-*-linux* && x32 } } } */
+/* { dg-options "-O2 -fno-pic -mtune=generic -mgeneral-regs-only -mapxf -mtune-ctrl=prologue_using_move,epilogue_using_move" } */
+/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
+/* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */
+
+/* start must save and restore all caller saved registers. */
+
+/*
+**start:
+**.LFB[0-9]+:
+** .cfi_startproc
+** subl \$248, %esp
+**...
+** movq %rax, \(%rsp\)
+** movq %rdx, 8\(%rsp\)
+** movq %rcx, 16\(%rsp\)
+** movq %rbx, 24\(%rsp\)
+** movq %rsi, 32\(%rsp\)
+** movq %rdi, 40\(%rsp\)
+**...
+** movq %rbp, 48\(%rsp\)
+** movq %r8, 56\(%rsp\)
+** movq %r9, 64\(%rsp\)
+** movq %r10, 72\(%rsp\)
+** movq %r11, 80\(%rsp\)
+** movq %r12, 88\(%rsp\)
+** movq %r13, 96\(%rsp\)
+** movq %r14, 104\(%rsp\)
+** movq %r15, 112\(%rsp\)
+** movq %r16, 120\(%rsp\)
+** movq %r17, 128\(%rsp\)
+** movq %r18, 136\(%rsp\)
+** movq %r19, 144\(%rsp\)
+** movq %r20, 152\(%rsp\)
+** movq %r21, 160\(%rsp\)
+** movq %r22, 168\(%rsp\)
+** movq %r23, 176\(%rsp\)
+** movq %r24, 184\(%rsp\)
+** movq %r25, 192\(%rsp\)
+** movq %r26, 200\(%rsp\)
+** movq %r27, 208\(%rsp\)
+** movq %r28, 216\(%rsp\)
+** movq %r29, 224\(%rsp\)
+** movq %r30, 232\(%rsp\)
+** movq %r31, 240\(%rsp\)
+**...
+** movl code\(%rip\), %ebp
+** call \*%rbp
+** movq \(%rsp\), %rax
+** movq 8\(%rsp\), %rdx
+** movq 16\(%rsp\), %rcx
+** movq 24\(%rsp\), %rbx
+** movq 32\(%rsp\), %rsi
+** movq 40\(%rsp\), %rdi
+** movq 48\(%rsp\), %rbp
+** movq 56\(%rsp\), %r8
+** movq 64\(%rsp\), %r9
+** movq 72\(%rsp\), %r10
+** movq 80\(%rsp\), %r11
+** movq 88\(%rsp\), %r12
+** movq 96\(%rsp\), %r13
+** movq 104\(%rsp\), %r14
+** movq 112\(%rsp\), %r15
+** movq 120\(%rsp\), %r16
+** movq 128\(%rsp\), %r17
+** movq 136\(%rsp\), %r18
+** movq 144\(%rsp\), %r19
+** movq 152\(%rsp\), %r20
+** movq 160\(%rsp\), %r21
+** movq 168\(%rsp\), %r22
+** movq 176\(%rsp\), %r23
+** movq 184\(%rsp\), %r24
+** movq 192\(%rsp\), %r25
+** movq 200\(%rsp\), %r26
+** movq 208\(%rsp\), %r27
+** movq 216\(%rsp\), %r28
+** movq 224\(%rsp\), %r29
+** movq 232\(%rsp\), %r30
+** movq 240\(%rsp\), %r31
+** addl \$248, %esp
+**...
+** ret
+** .cfi_endproc
+**...
+*/
+
+#include "pr119784a.c"
diff --git a/gcc/testsuite/gcc.target/i386/recip-vec-divf-fma.c b/gcc/testsuite/gcc.target/i386/recip-vec-divf-fma.c
new file mode 100644
index 0000000..ad9e07b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/recip-vec-divf-fma.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast -mfma -mavx2" } */
+/* { dg-final { scan-assembler-times {(?n)vfn?m(add|sub)[1-3]*ps} 2 } } */
+
+typedef float v4sf __attribute__((vector_size(16)));
+/* (a - (rcp(b) * a * b)) * rcp(b) + rcp(b) * a */
+
+v4sf
+foo (v4sf a, v4sf b)
+{
+ return a / b;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/vector/loongarch-vector.exp b/gcc/testsuite/gcc.target/loongarch/vector/loongarch-vector.exp
index f56d2f1..9df3f29 100644
--- a/gcc/testsuite/gcc.target/loongarch/vector/loongarch-vector.exp
+++ b/gcc/testsuite/gcc.target/loongarch/vector/loongarch-vector.exp
@@ -35,7 +35,7 @@ dg-init
# If the target hardware supports LSX, the default action is "run", otherwise
# just "compile".
-global dg-do-what-default
+set saved-dg-do-what-default ${dg-do-what-default}
if {[check_effective_target_loongarch_sx_hw]} then {
set dg-do-what-default run
} else {
@@ -45,6 +45,7 @@ if {[check_effective_target_loongarch_sx_hw]} then {
#Main loop.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/lsx/*.\[cS\]]] \
" -mlsx" $DEFAULT_CFLAGS
+set dg-do-what-default ${saved-dg-do-what-default}
dg-finish
@@ -52,7 +53,7 @@ dg-init
# If the target hardware supports LASX, the default action is "run", otherwise
# just "compile".
-global dg-do-what-default
+set saved-dg-do-what-default ${dg-do-what-default}
if {[check_effective_target_loongarch_asx_hw]} then {
set dg-do-what-default run
} else {
@@ -61,5 +62,6 @@ if {[check_effective_target_loongarch_asx_hw]} then {
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/lasx/*.\[cS\]]] \
" -mlasx" $DEFAULT_CFLAGS
+set dg-do-what-default ${saved-dg-do-what-default}
# All done.
dg-finish
diff --git a/gcc/testsuite/gcc.target/riscv/bext-ext-2.c b/gcc/testsuite/gcc.target/riscv/bext-ext-2.c
new file mode 100644
index 0000000..aa170d0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/bext-ext-2.c
@@ -0,0 +1,74 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcb -mabi=lp64" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" } } */
+
+struct obstack;
+struct bitmap_head_def;
+typedef struct bitmap_head_def *bitmap;
+struct obstack
+{
+ long chunk_size;
+ struct _obstack_chunk *chunk;
+ char *object_base;
+ char *next_free;
+ char *chunk_limit;
+ long int temp;
+ int alignment_mask;
+
+
+
+ struct _obstack_chunk *(*chunkfun) (void *, long);
+ void (*freefun) (void *, struct _obstack_chunk *);
+ void *extra_arg;
+ unsigned use_extra_arg:1;
+ unsigned maybe_empty_object:1;
+
+
+
+ unsigned alloc_failed:1;
+
+
+};
+
+typedef unsigned long BITMAP_WORD;
+typedef struct bitmap_obstack {
+ struct bitmap_element_def *elements;
+ struct bitmap_head_def *heads;
+ struct obstack obstack;
+} bitmap_obstack;
+typedef struct bitmap_element_def {
+ struct bitmap_element_def *next;
+ struct bitmap_element_def *prev;
+ unsigned int indx;
+ BITMAP_WORD bits[((128 + (8
+ * 8 * 1u) - 1) / (8
+ * 8 * 1u))];
+} bitmap_element;
+bitmap_element *bitmap_find_bit (bitmap, unsigned int);
+
+
+int
+bitmap_bit_p (bitmap head, int bit)
+{
+ bitmap_element *ptr;
+ unsigned bit_num;
+ unsigned word_num;
+
+ ptr = bitmap_find_bit (head, bit);
+ if (ptr == 0)
+ return 0;
+
+ bit_num = bit % (8
+ * 8 * 1u);
+ word_num = bit / (8
+ * 8 * 1u) % ((128 + (8
+ * 8 * 1u) - 1) / (8
+ * 8 * 1u));
+
+ return (ptr->bits[word_num] >> bit_num) & 1;
+}
+
+/* { dg-final { scan-assembler-times "bext\t" 1 } } */
+/* { dg-final { scan-assembler-not "slr\t"} } */
+/* { dg-final { scan-assembler-not "andi\t"} } */
+
diff --git a/gcc/testsuite/gcc.target/riscv/gnu-property-align-rv32.c b/gcc/testsuite/gcc.target/riscv/gnu-property-align-rv32.c
new file mode 100644
index 0000000..4f48cff
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/gnu-property-align-rv32.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv32g_zicfiss -fcf-protection=return -mabi=ilp32d " } */
+
+void foo() {}
+
+/* { dg-final { scan-assembler-times ".p2align\t2" 3 } } */
+/* { dg-final { scan-assembler-not ".p2align\t3" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/gnu-property-align-rv64.c b/gcc/testsuite/gcc.target/riscv/gnu-property-align-rv64.c
new file mode 100644
index 0000000..1bfd127
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/gnu-property-align-rv64.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64g_zicfiss -fcf-protection=return -mabi=lp64d " } */
+
+void foo() {}
+
+/* { dg-final { scan-assembler-times ".p2align\t3" 3 } } */
+/* { dg-final { scan-assembler-not ".p2align\t2" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/jump-table-large-code-model.c b/gcc/testsuite/gcc.target/riscv/jump-table-large-code-model.c
new file mode 100644
index 0000000..1ee7f6c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/jump-table-large-code-model.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc -mabi=lp64 -mcmodel=large" } */
+
+int foo(int x, int y)
+{
+ switch(x){
+ case 0:
+ return 123 + y;
+ case 1:
+ return 456 + y;
+ case 2:
+ return 789 - y;
+ case 3:
+ return 12 * y;
+ case 4:
+ return 13 % y;
+ case 5:
+ return 11 *y;
+ }
+ return 0;
+}
+
+
+/* { dg-final { scan-assembler-not "\.section \.rodata" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/pr108016.c b/gcc/testsuite/gcc.target/riscv/pr108016.c
new file mode 100644
index 0000000..b60df42
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr108016.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc -mabi=lp64" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" } } */
+
+unsigned int addu (unsigned int a, unsigned int b)
+{
+ unsigned int out;
+ unsigned int overflow = __builtin_add_overflow (a, b, &out);
+ return overflow & out;
+}
+
+int addi (int a, int b)
+{
+ int out;
+ int overflow = __builtin_add_overflow (a, b, &out);
+ return overflow & out;
+}
+
+unsigned int subu (unsigned int a, unsigned int b)
+{
+ unsigned int out;
+ unsigned int overflow = __builtin_sub_overflow (a, b, &out);
+ return overflow & out;
+}
+
+int subi (int a, int b)
+{
+ int out;
+ int overflow = __builtin_sub_overflow (a, b, &out);
+ return overflow & out;
+}
+
+/* { dg-final { scan-assembler-not "sext\.w\t" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/pr118410-1.c b/gcc/testsuite/gcc.target/riscv/pr118410-1.c
new file mode 100644
index 0000000..4a8b847
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr118410-1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" } } */
+/* { dg-options "-march=rv64gcb -mabi=lp64d" { target { rv64} } } */
+/* { dg-options "-march=rv32gcb -mabi=ilp32" { target { rv32} } } */
+
+long orlow(long x) { return x | ((1L << 24) - 1); }
+
+/* { dg-final { scan-assembler-times "orn\t" 1 } } */
+/* { dg-final { scan-assembler-not "addi\t" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/pr118410-2.c b/gcc/testsuite/gcc.target/riscv/pr118410-2.c
new file mode 100644
index 0000000..b63a1d9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr118410-2.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" } } */
+/* { dg-options "-march=rv64gcb -mabi=lp64d" { target { rv64} } } */
+/* { dg-options "-march=rv32gcb -mabi=ilp32" { target { rv32} } } */
+
+long xorlow(long x) { return x ^ ((1L << 24) - 1); }
+
+/* { dg-final { scan-assembler-times "xnor\t" 1 } } */
+/* { dg-final { scan-assembler-not "addi\t" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-1.c
index 638e90f..69a94d5 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-1.c
@@ -2,7 +2,7 @@
/* { dg-options "-O1 -march=rv64gczve32x -mabi=lp64d -mrvv-vector-bits=zvl" } */
/* { dg-final { check-function-bodies "**" "" } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void bar (int8_t *data);
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-2.c
index 380d0c1..5e0f136 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-fixed-2.c
@@ -2,7 +2,7 @@
/* { dg-options "-O1 -march=rv64gcv_zvl4096b -mabi=lp64d -mrvv-vector-bits=zvl" } */
/* { dg-final { check-function-bodies "**" "" } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void bar (int8_t *data);
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-save-restore.c b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-save-restore.c
index 9ed72a6..a3c0a6d 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-save-restore.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-save-restore.c
@@ -2,7 +2,7 @@
/* { dg-options "-O1 -march=rv64gcv_zfh -mabi=lp64d -msave-restore" } */
/* { dg-final { check-function-bodies "**" "" } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void bar (int8_t *data);
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-zcmp.c b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-zcmp.c
index b6b708f..b1cf6aa 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-zcmp.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1-zcmp.c
@@ -2,7 +2,7 @@
/* { dg-options "-O1 -march=rv64gv_zfh_zca_zcmp -mabi=lp64d -fno-shrink-wrap-separate" } */
/* { dg-final { check-function-bodies "**" "" } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void bar (int8_t *data);
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1.c
index 13e3328..8838f0d 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-1.c
@@ -2,7 +2,7 @@
/* { dg-options "-O1 -march=rv64gcv_zfh -mabi=lp64d" } */
/* { dg-final { check-function-bodies "**" "" } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void bar (int8_t *data);
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c
index d21b810..77f1c7c 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c
@@ -2,7 +2,7 @@
/* { dg-options "-O1 -march=rv64gcv_zfh -mabi=lp64d -msave-restore" } */
/* { dg-final { check-function-bodies "**" "" } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void bar1 (vint8m1_t a);
void bar2 ();
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-zcmp.c b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-zcmp.c
index 70a32d7..37127a8 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-zcmp.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-zcmp.c
@@ -2,7 +2,7 @@
/* { dg-options "-O1 -march=rv64gv_zfh_zca_zcmp -mabi=lp64d -fno-shrink-wrap-separate" } */
/* { dg-final { check-function-bodies "**" "" } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void bar1 (vint8m1_t a);
void bar2 ();
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2.c
index 3f2cb2f..a8daeeb 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2.c
@@ -2,7 +2,7 @@
/* { dg-options "-O1 -march=rv64gcv_zfh -mabi=lp64d" } */
/* { dg-final { check-function-bodies "**" "" } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void bar1 (vint8m1_t a);
void bar2 ();
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/bug-10-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-10-2.c
index fe3a1ef..f8143b9 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/bug-10-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-10-2.c
@@ -4,7 +4,7 @@
/* { dg-require-effective-target riscv_zvfh_ok } */
/* { dg-options " -march=rv64gcv_zvfh -mabi=lp64d -O2" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
int8_t a[1];
uint16_t b[1];
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/bug-10.c b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-10.c
index 60fdfc4..05628d5 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/bug-10.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-10.c
@@ -4,7 +4,7 @@
/* { dg-require-effective-target riscv_zvfh_ok } */
/* { dg-options " -march=rv64gcv_zvfh -mabi=lp64d -O2 --param=vsetvl-strategy=optim -fno-schedule-insns -fno-schedule-insns2 -fno-schedule-fusion " } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void
__attribute__ ((noipa))
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/bug-7.c b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-7.c
index 28766ce..3180f71 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/bug-7.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-7.c
@@ -3,7 +3,7 @@
/* { dg-options "-march=rv64gcv -mabi=lp64d -O2" { target { rv64 } } } */
/* { dg-options "-march=rv32gcv -mabi=ilp32d -O2" { target { rv32 } } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
vint64m1_t f1 (vint64m1_t vd, vint64m1_t vs2, size_t vl)
{
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/bug-8.c b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-8.c
index 975f755..31b68c4 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/bug-8.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-8.c
@@ -3,7 +3,7 @@
/* { dg-options "-march=rv64gcv -mabi=lp64d -O0" { target { rv64 } } } */
/* { dg-options "-march=rv32gcv -mabi=ilp32d -O0" { target { rv32 } } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
vint64m1_t f1 (vint64m1_t vd, vint64m1_t vs2, size_t vl)
{
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/bug-9.c b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-9.c
index 8cfe965..f7c9ad1 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/bug-9.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/bug-9.c
@@ -3,7 +3,7 @@
/* { dg-options "-march=rv64gcv -mabi=lp64d -O2" { target { rv64 } } } */
/* { dg-options "-march=rv32gcv -mabi=ilp32d -O2" { target { rv32 } } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
vfloat16m1_t f0 (vfloat16m1_t vs2, vfloat16m1_t vs1, size_t vl)
{
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr110943.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr110943.c
index 8a6c00f..a08ac6e 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr110943.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr110943.c
@@ -2,7 +2,7 @@
/* { dg-options "-O3 -march=rv64gcv -mabi=lp64d" } */
/* { dg-final { check-function-bodies "**" "" } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
/*
** foo9:
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-21.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-21.c
index 3e43c94..a0ed793 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-21.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr112431-21.c
@@ -1,7 +1,7 @@
/* { dg-do run { target { riscv_v } } } */
/* { dg-additional-options "-O3 -ansi -pedantic-errors -std=gnu99" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
size_t __attribute__ ((noinline))
sumation (size_t sum0, size_t sum1, size_t sum2, size_t sum3, size_t sum4,
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr114639-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr114639-1.c
index 3ad91db..c5b35c8 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr114639-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr114639-1.c
@@ -2,7 +2,7 @@
/* { dg-do compile } */
/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
extern size_t get_vl ();
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr115068-run.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr115068-run.c
index d552eb5..e9e41f7 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr115068-run.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr115068-run.c
@@ -1,6 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target riscv_v_ok } */
/* { dg-add-options riscv_v } */
-/* { dg-additional-options "-std=gnu99" } */
+/* { dg-additional-options "-std=gnu99 -Wno-pedantic" } */
#include "pr115068.c"
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr115068.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr115068.c
index af2cba6..ce9a389 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr115068.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr115068.c
@@ -1,9 +1,9 @@
/* { dg-do compile { target { ! riscv_abi_e } } } */
/* { dg-add-options riscv_v } */
-/* { dg-additional-options "-std=gnu99" } */
+/* { dg-additional-options "-std=gnu99 -Wno-pedantic" } */
#include <stdint.h>
-#include <riscv_vector.h>
+#include "riscv_vector.h"
vfloat64m8_t
test_vfwadd_wf_f64m8_m (vbool8_t vm, vfloat64m8_t vs2, float rs1, size_t vl)
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr117286.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr117286.c
index dabb8ae..7b6eefe 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr117286.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr117286.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -O1" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
_Float16 a[10];
void func(){
int placeholder0 = 10;
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr117544.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr117544.c
index af3532a..81e0ec3 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr117544.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr117544.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void bar() __attribute__((riscv_vector_cc));
vint32m1_t foo(vint32m1_t a, vint32m1_t b) {
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr117955.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr117955.c
index 81e3a6e..4904c92 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr117955.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr117955.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target { rv64 } } } */
/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -O3" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
_Float16 a (uint64_t);
int8_t b () {
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr118872.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr118872.c
index adb54d6..d62751e 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/pr118872.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr118872.c
@@ -3,7 +3,7 @@
/* { dg-options "-march=rv64gcv -mabi=lp64d -O2" { target { rv64 } } } */
/* { dg-options "-march=rv32gcv -mabi=ilp32d -O2" { target { rv32 } } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
vfloat32m2_t foo (vfloat16m1_t a, size_t vl)
{
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-1.c
index 4253729..6bb7e1c 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/vlmul_ext-1.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
vint16m8_t test_vlmul_ext_v_i16mf4_i16m8(vint16mf4_t op1) {
return __riscv_vlmul_ext_v_i16mf4_i16m8(op1);
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/vssubu-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/vssubu-1.c
index 606854b..a278709 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/vssubu-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/vssubu-1.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv64gcv -mabi=lp64d" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
vuint64m1_t test_vssubu_vx_u64m1(vuint64m1_t op1)
{
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/vssubu-2.c b/gcc/testsuite/gcc.target/riscv/rvv/base/vssubu-2.c
index 78abd09..2f8c146 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/vssubu-2.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/vssubu-2.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv32gcv -mabi=ilp32d" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
vuint64m1_t test_vssubu_vx_u64m1(vuint64m1_t op1)
{
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/vwaddsub-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/vwaddsub-1.c
index 84d3c4c..43be202 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/vwaddsub-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/vwaddsub-1.c
@@ -1,9 +1,9 @@
/* { dg-do compile { target { { ! riscv_abi_e } && rv64 } } } */
/* { dg-add-options riscv_v } */
-/* { dg-additional-options "-std=gnu99 -O3 -fno-schedule-insns -fno-schedule-insns2" } */
+/* { dg-additional-options "-std=gnu99 -O3 -fno-schedule-insns -fno-schedule-insns2 -Wno-pedantic" } */
#include <stdint.h>
-#include <riscv_vector.h>
+#include "riscv_vector.h"
/*
** vwadd_wx_i64m8_m:
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/avl_single-68.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/avl_single-68.c
index bf95e1c..64666d3 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/avl_single-68.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/avl_single-68.c
@@ -21,6 +21,12 @@ void f2 (void * restrict in, void * restrict out, int l, int n, int m)
}
}
+/* The second check is XFAILed because we currently don't lift
+ vsetvls into non-transparent (in LCM parlance) blocks.
+ See PR119547.
+ In this test it is still possible because the conflicting
+ register only ever feeds vsetvls. */
+
/* { dg-final { scan-assembler-times {vsetvli} 2 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-g" no-opts "-funroll-loops" } } } } */
-/* { dg-final { scan-assembler-times {vsetvli\s+zero,\s*[a-x0-9]+,\s*e8,\s*mf8,\s*tu,\s*m[au]} 2 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-g" no-opts "-funroll-loops" } } } } */
+/* { dg-final { scan-assembler-times {vsetvli\s+zero,\s*[a-x0-9]+,\s*e8,\s*mf8,\s*tu,\s*m[au]} 2 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-g" no-opts "-funroll-loops" } xfail { *-*-* } } } } */
/* { dg-final { scan-assembler-times {addi\s+[a-x0-9]+,\s*[a-x0-9]+,\s*44} 1 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-g" no-opts "-funroll-loops" } } } } */
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111234.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111234.c
index 871cf65..f594217 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111234.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111234.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-mrvv-vector-bits=scalable -march=rv64gcv -mabi=lp64d -O3" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void
f (vint32m1_t *in, vint64m2_t *out, vbool32_t *m, int b)
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr115214.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr115214.c
index b76760b..48f200f 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr115214.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr115214.c
@@ -2,7 +2,7 @@
/* { dg-options "-mrvv-vector-bits=scalable -march=rv64gcv -mabi=lp64d -O3 -w -std=gnu17" } */
/* { dg-skip-if "" { *-*-* } { "-flto" } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
static inline __attribute__(()) int vaddq_f32();
static inline __attribute__(()) int vload_tillz_f32(int nlane) {
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-10.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-10.c
index ddf53ca..0dbf34a 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-10.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-10.c
@@ -43,6 +43,6 @@ void foo (int8_t * restrict in, int8_t * restrict out, int n, int cond)
}
}
-/* { dg-final { scan-assembler-times {vsetvli} 15 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */
+/* { dg-final { scan-assembler-times {vsetvli} 14 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */
/* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 3 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */
-/* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf2,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */
+/* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf2,\s*t[au],\s*m[au]} 3 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl-24.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl-24.c
index 7096159e..3867681 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl-24.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl-24.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-mrvv-vector-bits=scalable -march=rv64gcv -mabi=lp64d" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
size_t foo ()
{
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-3.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-3.c
index c155f56..3acbc73 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-3.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-3.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-march=rv32gcv -mabi=ilp32d -O2 -fdump-rtl-vsetvl-details" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
uint64_t a[2], b[2];
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-4.c b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-4.c
index 04a8ff2..2b2fe27 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-4.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvl_bug-4.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-march=rv64gcv -mabi=lp64d -O2 -fno-schedule-insns -fdump-rtl-vsetvl-details" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
vuint16m1_t
foo (vuint16m1_t a, vuint16m1_t b, size_t avl)
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr116591.c b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr116591.c
index dfaf82c..ad27c38 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr116591.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr116591.c
@@ -2,7 +2,7 @@
/* { dg-options "-march=rv32gc_xtheadvector -mabi=ilp32d -O2 -save-temps" { target { rv32 } } } */
/* { dg-options "-march=rv64gc_xtheadvector -mabi=lp64d -O2 -save-temps" { target { rv64 } } } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
void
foo (float *a, int b)
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr116592.c b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr116592.c
index a7cd8c5..c8056a8 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr116592.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr116592.c
@@ -3,7 +3,7 @@
/* { dg-options "-march=rv64gc_zfh_xtheadvector -mabi=lp64d -O2 -save-temps" { target { rv64 } } } */
#include <math.h>
-#include <riscv_vector.h>
+#include "riscv_vector.h"
static vfloat32m8_t atan2_ps(vfloat32m8_t a, vfloat32m8_t b, size_t vl)
{
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr118357.c b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr118357.c
index aebb0e3..b3c3428 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr118357.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/pr118357.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target { rv64 } } } */
/* { dg-options "-march=rv64gc_xtheadvector -mabi=lp64d -O2" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
vfloat16m4_t foo (float *ptr, size_t vl)
{
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/vsext.c b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/vsext.c
index 55db283..42fa43e 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/vsext.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/vsext.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target { rv64 } } } */
/* { dg-options "-march=rv64gc_xtheadvector -mabi=lp64d -O3" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
struct a
{
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/vzext.c b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/vzext.c
index fcb5659..d622b72 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/vzext.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/xtheadvector/vzext.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target { rv64 } } } */
/* { dg-options "-march=rv64gc_xtheadvector -mabi=lp64d -O3" } */
-#include <riscv_vector.h>
+#include "riscv_vector.h"
struct a
{
diff --git a/gcc/testsuite/gcc.target/sh/pr111814.c b/gcc/testsuite/gcc.target/sh/pr111814.c
new file mode 100644
index 0000000..a88e5d7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/pr111814.c
@@ -0,0 +1,7 @@
+/* Verify that __builtin_nan("") produces a constant matches
+ architecture specification. */
+/* { dg-do compile } */
+
+double d = __builtin_nan ("");
+
+/* { dg-final { scan-assembler "\t.long\t-1\n\t.long\t2146959359\n" } } */
diff --git a/gcc/testsuite/gdc.dg/debug/imports/m119817/a.d b/gcc/testsuite/gdc.dg/debug/imports/m119817/a.d
new file mode 100644
index 0000000..a137472
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/debug/imports/m119817/a.d
@@ -0,0 +1,2 @@
+module imports.m119817.a;
+void f119817()() { }
diff --git a/gcc/testsuite/gdc.dg/debug/imports/m119817/b.d b/gcc/testsuite/gdc.dg/debug/imports/m119817/b.d
new file mode 100644
index 0000000..aef0e37
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/debug/imports/m119817/b.d
@@ -0,0 +1,2 @@
+module imports.m119817.b;
+void f119817() { }
diff --git a/gcc/testsuite/gdc.dg/debug/imports/m119817/package.d b/gcc/testsuite/gdc.dg/debug/imports/m119817/package.d
new file mode 100644
index 0000000..188827e
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/debug/imports/m119817/package.d
@@ -0,0 +1,4 @@
+module imports.m119817;
+public import
+ imports.m119817.a,
+ imports.m119817.b;
diff --git a/gcc/testsuite/gdc.dg/debug/imports/pr119826b.d b/gcc/testsuite/gdc.dg/debug/imports/pr119826b.d
new file mode 100644
index 0000000..3c5a6ac
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/debug/imports/pr119826b.d
@@ -0,0 +1,14 @@
+module imports.pr119826b;
+
+import pr119826 : t119826;
+
+class C119826
+{
+ enum E119826 { Evalue }
+ const E119826 em = void;
+}
+
+void f119826(C119826 c)
+{
+ t119826(c.em);
+}
diff --git a/gcc/testsuite/gdc.dg/debug/pr119817.d b/gcc/testsuite/gdc.dg/debug/pr119817.d
new file mode 100644
index 0000000..3eea6ba
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/debug/pr119817.d
@@ -0,0 +1,6 @@
+// { dg-do compile }
+// { dg-additional-sources "imports/m119817/package.d" }
+// { dg-additional-sources "imports/m119817/a.d" }
+// { dg-additional-sources "imports/m119817/b.d" }
+module pr119817;
+import imports.m119817 : f119817;
diff --git a/gcc/testsuite/gdc.dg/debug/pr119826.d b/gcc/testsuite/gdc.dg/debug/pr119826.d
new file mode 100644
index 0000000..2fb98c7
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/debug/pr119826.d
@@ -0,0 +1,8 @@
+// { dg-do compile }
+// { dg-additional-sources "imports/pr119826b.d" }
+module pr119826;
+
+int t119826(A)(A args)
+{
+ assert(false);
+}
diff --git a/gcc/testsuite/gdc.dg/driver_fonly1.d b/gcc/testsuite/gdc.dg/driver_fonly1.d
new file mode 100644
index 0000000..1af956a
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/driver_fonly1.d
@@ -0,0 +1,2 @@
+// { dg-additional-options "-fonly=not-a-file" }
+// { dg-error "argument is different from first input file name" "" { target *-*-* } 0 }
diff --git a/gcc/testsuite/gdc.dg/driver_fonly2.d b/gcc/testsuite/gdc.dg/driver_fonly2.d
new file mode 100644
index 0000000..97cd93d
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/driver_fonly2.d
@@ -0,0 +1,8 @@
+// { dg-do "compile" }
+// { dg-additional-options "-fonly=driver_fonly2.d" }
+// { dg-additional-sources "imports/fonly.d" }
+// { dg-final { scan-assembler "_D1a10fonly_testFZv" } }
+// { dg-final { scan-assembler-not "_D1b10fonly_testFZv" } }
+module a;
+
+void fonly_test() { }
diff --git a/gcc/testsuite/gdc.dg/driver_fonly3.d b/gcc/testsuite/gdc.dg/driver_fonly3.d
new file mode 100644
index 0000000..de2983f
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/driver_fonly3.d
@@ -0,0 +1,8 @@
+// { dg-do "compile" }
+// { dg-additional-options "-fonly=imports/fonly" }
+// { dg-additional-sources "imports/fonly.d" }
+// { dg-final { scan-assembler-not "_D1a10fonly_testFZv" } }
+// { dg-final { scan-assembler "_D1b10fonly_testFZv" } }
+module a;
+
+void fonly_test() { }
diff --git a/gcc/testsuite/gdc.dg/import-c/import-c.exp b/gcc/testsuite/gdc.dg/import-c/import-c.exp
new file mode 100644
index 0000000..53d1478
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/import-c/import-c.exp
@@ -0,0 +1,29 @@
+# Copyright (C) 2025 Free Software Foundation, Inc.
+
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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 GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Load support procs.
+load_lib gdc-dg.exp
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+gdc-dg-runtest [lsort \
+ [glob -nocomplain $srcdir/$subdir/*.d ] ] "" \
+ "-I $srcdir/$subdir -finclude-imports"
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gdc.dg/import-c/pr119761.d b/gcc/testsuite/gdc.dg/import-c/pr119761.d
new file mode 100644
index 0000000..20eff31
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/import-c/pr119761.d
@@ -0,0 +1,2 @@
+// { dg-do compile }
+import pr119761c;
diff --git a/gcc/testsuite/gdc.dg/import-c/pr119761c.c b/gcc/testsuite/gdc.dg/import-c/pr119761c.c
new file mode 100644
index 0000000..522f1bf
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/import-c/pr119761c.c
@@ -0,0 +1,4 @@
+int f119761(const char *, ...)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gdc.dg/import-c/pr119799.d b/gcc/testsuite/gdc.dg/import-c/pr119799.d
new file mode 100644
index 0000000..d8b0fa2
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/import-c/pr119799.d
@@ -0,0 +1,2 @@
+// { dg-do compile }
+import pr119799c;
diff --git a/gcc/testsuite/gdc.dg/import-c/pr119799c.c b/gcc/testsuite/gdc.dg/import-c/pr119799c.c
new file mode 100644
index 0000000..b80e856
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/import-c/pr119799c.c
@@ -0,0 +1 @@
+static struct {} s119799;
diff --git a/gcc/testsuite/gdc.dg/imports/fonly.d b/gcc/testsuite/gdc.dg/imports/fonly.d
new file mode 100644
index 0000000..2b7755e
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/imports/fonly.d
@@ -0,0 +1,3 @@
+module b;
+
+void fonly_test() { }
diff --git a/gcc/testsuite/gdc.dg/torture/imports/pr109023.d b/gcc/testsuite/gdc.dg/torture/imports/pr109023.d
new file mode 100644
index 0000000..e85e0ed
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/torture/imports/pr109023.d
@@ -0,0 +1,3 @@
+module imports.pr109023;
+
+void f109023() { }
diff --git a/gcc/testsuite/gdc.dg/torture/pr109023.d b/gcc/testsuite/gdc.dg/torture/pr109023.d
new file mode 100644
index 0000000..3060446
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/torture/pr109023.d
@@ -0,0 +1,6 @@
+// { dg-do "compile" }
+// { dg-additional-options "-I[srcdir] -finclude-imports" }
+// { dg-additional-files "imports/pr109023.d" }
+// { dg-final { scan-assembler "_D7imports8pr1090237f109023FZv" } }
+module pr109023;
+import imports.pr109023;
diff --git a/gcc/testsuite/gdc.test/compilable/test21179.d b/gcc/testsuite/gdc.test/compilable/test21179.d
new file mode 100644
index 0000000..78bdffd
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/test21179.d
@@ -0,0 +1,11 @@
+// https://github.com/dlang/dmd/issues/21179
+
+void bigEndianToNative(ubyte[2] a) {}
+
+void main()
+{
+ ubyte[] arr;
+ const ubyte[2] bytes;
+ bigEndianToNative(bytes);
+ auto b = cast(const ubyte[2][]) arr;
+}
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail_pretty_errors.d b/gcc/testsuite/gdc.test/fail_compilation/fail_pretty_errors.d
index 2016a50..79242b1 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/fail_pretty_errors.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail_pretty_errors.d
@@ -1,22 +1,24 @@
-/*
+/*
REQUIRED_ARGS: -verrors=context
TEST_OUTPUT:
---
-fail_compilation/fail_pretty_errors.d(27): Error: undefined identifier `a`
+fail_compilation/fail_pretty_errors.d(29): Error: undefined identifier `a`
a = 1;
^
-fail_compilation/fail_pretty_errors.d-mixin-32(32): Error: undefined identifier `b`
-fail_compilation/fail_pretty_errors.d(37): Error: cannot implicitly convert expression `5` of type `int` to `string`
+fail_compilation/fail_pretty_errors.d-mixin-34(34): Error: undefined identifier `b`
+b = 1;
+^
+fail_compilation/fail_pretty_errors.d(39): Error: cannot implicitly convert expression `5` of type `int` to `string`
string x = 5;
^
-fail_compilation/fail_pretty_errors.d(42): Error: mixin `fail_pretty_errors.testMixin2.mixinTemplate!()` error instantiating
+fail_compilation/fail_pretty_errors.d(44): Error: mixin `fail_pretty_errors.testMixin2.mixinTemplate!()` error instantiating
mixin mixinTemplate;
^
-fail_compilation/fail_pretty_errors.d(48): Error: invalid array operation `"" + ""` (possible missing [])
+fail_compilation/fail_pretty_errors.d(50): Error: invalid array operation `"" + ""` (possible missing [])
auto x = ""+"";
^
-fail_compilation/fail_pretty_errors.d(48): did you mean to concatenate (`"" ~ ""`) instead ?
-fail_compilation/fail_pretty_errors.d(51): Error: cannot implicitly convert expression `1111` of type `int` to `byte`
+fail_compilation/fail_pretty_errors.d(50): did you mean to concatenate (`"" ~ ""`) instead ?
+fail_compilation/fail_pretty_errors.d(53): Error: cannot implicitly convert expression `1111` of type `int` to `byte`
byte ɑ = 1111;
^
---
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test21247.d b/gcc/testsuite/gdc.test/fail_compilation/test21247.d
new file mode 100644
index 0000000..c3e4105
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/test21247.d
@@ -0,0 +1,20 @@
+/*
+TEST_OUTPUT:
+---
+fail_compilation/test21247.d(13): Error: anonymous union can only be a part of an aggregate, not function `hang_dmd`
+fail_compilation/test21247.d(17): Error: undefined identifier `u`
+fail_compilation/test21247.d(18): Error: undefined identifier `b`
+fail_compilation/test21247.d(20): called from here: `hang_dmd(0u)`
+---
+ */
+// https://github.com/dlang/dmd/issues/21247
+ubyte[4] hang_dmd(uint a)
+{
+ union {
+ uint u = void;
+ ubyte[4] b;
+ }
+ u = a;
+ return b;
+}
+enum T = hang_dmd(0);
diff --git a/gcc/testsuite/gdc.test/fail_compilation/test21247b.d b/gcc/testsuite/gdc.test/fail_compilation/test21247b.d
new file mode 100644
index 0000000..ecd4603
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/test21247b.d
@@ -0,0 +1,14 @@
+/*
+TEST_OUTPUT:
+---
+fail_compilation/test21247b.d(10): Error: anonymous union can only be a part of an aggregate, not function `test21247`
+---
+ */
+// https://github.com/dlang/dmd/issues/21247
+void test21247()
+{
+ union {
+ uint u = void;
+ ubyte[4] b;
+ }
+}
diff --git a/gcc/testsuite/gfortran.dg/do_concurrent_all_clauses.f90 b/gcc/testsuite/gfortran.dg/do_concurrent_all_clauses.f90
index 0c8a6ad..a7fa7c3 100644
--- a/gcc/testsuite/gfortran.dg/do_concurrent_all_clauses.f90
+++ b/gcc/testsuite/gfortran.dg/do_concurrent_all_clauses.f90
@@ -18,7 +18,7 @@ program do_concurrent_all_clauses
squared = i * i
arr(i) = temp2 + squared
sum = sum + arr(i)
- max_val = max(max_val, arr(i)) ! { dg-error "Reference to impure function" }
+ max_val = max(max_val, arr(i))
end block
end do
print *, arr, sum, max_val
diff --git a/gcc/testsuite/gfortran.dg/gomp/map-alloc-comp-1.f90 b/gcc/testsuite/gfortran.dg/gomp/map-alloc-comp-1.f90
index 0c44296..f48addc 100644
--- a/gcc/testsuite/gfortran.dg/gomp/map-alloc-comp-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/map-alloc-comp-1.f90
@@ -10,5 +10,5 @@ type sct
end type
type(sct) var
-!$omp target enter data map(to:var) ! { dg-error "allocatable components is not permitted in map clause" }
+!$omp target enter data map(to:var)
end
diff --git a/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-1.f90 b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-1.f90
new file mode 100644
index 0000000..750cec9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-1.f90
@@ -0,0 +1,30 @@
+type t
+ integer :: t
+end type t
+class(t), target, allocatable :: c, ca(:)
+class(t), pointer :: p, pa(:)
+integer :: x
+allocate( t :: c, ca(5))
+p => c
+pa => ca
+
+! 11111111112222222222333333333344
+!2345678901234567890123456789012345678901
+!$omp target enter data map(c, ca, p, pa)
+! { dg-warning "29:Mapping of polymorphic list item 'c' is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-1 }
+! { dg-warning "32:Mapping of polymorphic list item 'ca' is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-2 }
+! { dg-warning "36:Mapping of polymorphic list item 'p' is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-3 }
+! { dg-warning "39:Mapping of polymorphic list item 'pa' is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-4 }
+
+! 11111111112222222222333333333344
+!2345678901234567890123456789012345678901
+
+! 11111111112222222222333333333344
+!2345678901234567890123456789012345678901
+!$omp target update from(c,ca), to(p,pa)
+! { dg-warning "26:Mapping of polymorphic list item 'c' is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-1 }
+! { dg-warning "28:Mapping of polymorphic list item 'ca' is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-2 }
+! { dg-warning "36:Mapping of polymorphic list item 'p' is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-3 }
+! { dg-warning "38:Mapping of polymorphic list item 'pa' is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-4 }
+
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-2.f90 b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-2.f90
index e25db68..3bedc9b 100644
--- a/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-2.f90
@@ -9,7 +9,7 @@ allocate( t :: c, ca(5))
p => c
pa => ca
-!$omp target ! { dg-warning "Implicit mapping of polymorphic variable 'ca' is unspecified behavior \\\[-Wopenmp\\\]" }
+!$omp target ! { dg-warning "Mapping of polymorphic list item 'ca' is unspecified behavior \\\[-Wopenmp\\\]" }
ll = allocated(ca)
!$omp end target
diff --git a/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-3.f90 b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-3.f90
new file mode 100644
index 0000000..9777ecf
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-3.f90
@@ -0,0 +1,23 @@
+subroutine sub(var, var2)
+type t
+ integer :: x
+end type t
+
+type t2
+ integer :: x
+ integer, allocatable :: y
+end type
+
+class(t) var, var2
+type(t2) :: var3, var4
+!$omp target firstprivate(var) & ! { dg-error "Polymorphic list item 'var' at .1. in FIRSTPRIVATE clause has unspecified behavior and unsupported" }
+!$omp& private(var2) ! { dg-error "Polymorphic list item 'var2' at .1. in PRIVATE clause has unspecified behavior and unsupported" }
+ var%x = 5
+ var2%x = 5
+!$omp end target
+!$omp target firstprivate(var3) & ! { dg-error "Sorry, list item 'var3' at .1. with allocatable components is not yet supported in FIRSTPRIVATE clause" }
+!$omp& private(var4) ! { dg-error "Sorry, list item 'var4' at .1. with allocatable components is not yet supported in PRIVATE clause" }
+ var3%x = 5
+ var4%x = 5
+!$omp end target
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-4.f90 b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-4.f90
new file mode 100644
index 0000000..5a1a70a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-4.f90
@@ -0,0 +1,9 @@
+subroutine one
+implicit none
+type t
+ class(*), allocatable :: ul
+end type
+
+type(t) :: var
+!$omp target enter data map(to:var) ! { dg-error "Mapping of unlimited polymorphic list item 'var.ul' is unspecified behavior and unsupported" }
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-5.f90 b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-5.f90
new file mode 100644
index 0000000..4b5814e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping-5.f90
@@ -0,0 +1,9 @@
+subroutine one
+implicit none
+type t
+ class(*), allocatable :: ul
+end type
+
+class(*), allocatable :: ul_var
+!$omp target enter data map(to: ul_var) ! { dg-error "Mapping of unlimited polymorphic list item 'ul_var' is unspecified behavior and unsupported" }
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping.f90 b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping.f90
index dd7eb31..752cca2 100644
--- a/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/polymorphic-mapping.f90
@@ -10,37 +10,21 @@ pa => ca
! 11111111112222222222333333333344
!2345678901234567890123456789012345678901
-!$omp target enter data map(c, ca, p, pa)
-! { dg-warning "29:Mapping polymorphic list item at .1. is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-1 }
-! { dg-warning "32:Mapping polymorphic list item at .1. is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-2 }
-! { dg-warning "36:Mapping polymorphic list item at .1. is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-3 }
-! { dg-warning "39:Mapping polymorphic list item at .1. is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-4 }
-
-! 11111111112222222222333333333344
-!2345678901234567890123456789012345678901
-!$omp target firstprivate(ca) ! { dg-warning "27:FIRSTPRIVATE with polymorphic list item at .1. is unspecified behavior \\\[-Wopenmp\\\]" }
+!$omp target firstprivate(ca) ! { dg-error "27:Polymorphic list item 'ca' at .1. in FIRSTPRIVATE clause has unspecified behavior and unsupported" }
!$omp end target
-!$omp target parallel do firstprivate(ca) ! { dg-warning "39:FIRSTPRIVATE with polymorphic list item at .1. is unspecified behavior \\\[-Wopenmp\\\]" }
+!$omp target parallel do firstprivate(ca) ! { dg-error "39:Polymorphic list item 'ca' at .1. in FIRSTPRIVATE clause has unspecified behavior and unsupported" }
do x = 0, 5
end do
-!$omp target parallel do private(ca) ! OK; should map declared type
+!$omp target parallel do private(ca) ! { dg-error "34:Polymorphic list item 'ca' at .1. in PRIVATE clause has unspecified behavior and unsupported" }
do x = 0, 5
end do
-!$omp target private(ca) ! OK; should map declared type
+!$omp target private(ca) ! { dg-error "22:Polymorphic list item 'ca' at .1. in PRIVATE clause has unspecified behavior and unsupported" }
block
end block
-! 11111111112222222222333333333344
-!2345678901234567890123456789012345678901
-!$omp target update from(c,ca), to(p,pa)
-! { dg-warning "26:Mapping polymorphic list item at .1. is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-1 }
-! { dg-warning "28:Mapping polymorphic list item at .1. is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-2 }
-! { dg-warning "36:Mapping polymorphic list item at .1. is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-3 }
-! { dg-warning "38:Mapping polymorphic list item at .1. is unspecified behavior \\\[-Wopenmp\\\]" "" { target *-*-* } .-4 }
-
! -------------------------
!$omp target parallel map(release: x) ! { dg-error "36:TARGET with map-type other than TO, FROM, TOFROM, or ALLOC on MAP clause" }
diff --git a/gcc/testsuite/gfortran.dg/interface_59.f90 b/gcc/testsuite/gfortran.dg/interface_59.f90
new file mode 100644
index 0000000..c9ccd67
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_59.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! PR fortran/119669 - this used to generate an ICE.
+
+program a
+ implicit real(a-h,o-z)
+ external abstract_caller, caller, func
+! real func
+ call abstract_caller (caller, func, 1.5)
+ call abstract_caller (caller, func, 1.5)
+end program a
+
+function func (x)
+ real func, x
+ func = x * x - 1.
+end
diff --git a/gcc/testsuite/gfortran.dg/pr119502.f90 b/gcc/testsuite/gfortran.dg/pr119502.f90
new file mode 100644
index 0000000..80d7c61
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr119502.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+
+! PR119502, negative unit numbers are not allowed without using NEWUNIT
+
+program foo
+ integer :: iun = -1
+ integer :: ios
+ open (iun, iostat=ios)
+ if (ios == 0) stop 1
+ write(iun,*, iostat=ios) "This is a test."
+ if (ios == 0) stop 2
+ close (iun, iostat=ios)
+ if (ios == 0) stop 3
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pr119836_1.f90 b/gcc/testsuite/gfortran.dg/pr119836_1.f90
new file mode 100644
index 0000000..984e2d0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr119836_1.f90
@@ -0,0 +1,18 @@
+!
+! { dg-do run }
+!
+! PR fortran/119836
+!
+program p
+ implicit none
+ integer, parameter :: n = 4
+ integer :: i
+ integer :: y(n), x(n)
+ do concurrent (i=1:n)
+ x(i) = shiftl (i,1) ! accepted
+ block
+ y(i) = shiftl (i,1) ! wrongly rejected
+ end block
+ end do
+ if (any(x /= y)) stop 1
+end program p
diff --git a/gcc/testsuite/gfortran.dg/pr119836_2.f90 b/gcc/testsuite/gfortran.dg/pr119836_2.f90
new file mode 100644
index 0000000..5e2d0c9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr119836_2.f90
@@ -0,0 +1,21 @@
+!
+! { dg-do compile }
+!
+! PR fortran/119836
+!
+! Although intrinsic functions contained within the Fortran standard
+! are pure procedures, many of the additional intrinsic functions
+! supplied in libgfortran are impure. RAND() is one such function.
+!
+program foo
+ implicit none
+ integer i
+ real x(4)
+ do concurrent (i=1:4)
+ x = rand() ! { dg-error "Reference to impure function" }
+ block
+ x = rand() ! { dg-error "Reference to impure function" }
+ end block
+ end do
+ print *, x
+end program foo
diff --git a/gcc/testsuite/gfortran.dg/pr119836_3.f90 b/gcc/testsuite/gfortran.dg/pr119836_3.f90
new file mode 100644
index 0000000..69a5fcf
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr119836_3.f90
@@ -0,0 +1,30 @@
+!
+! { dg-do run }
+!
+! PR fortran/119836
+!
+program p
+ implicit none
+ integer, parameter :: n = 4
+ integer :: i
+ integer :: y(n), x(n)
+ x = [(i,i=1,n)]
+ do concurrent (i=1:n)
+ call bar(x, y)
+ end do
+ if (any(x /= y)) stop 1
+ x = 2 * x
+ do concurrent (i=1:n)
+ block
+ call bar(x, y)
+ end block
+ end do
+ if (any(x /= y)) stop 1
+
+ contains
+ elemental subroutine bar(x, y)
+ integer, intent(in) :: x
+ integer, intent(out) :: y
+ y = x
+ end subroutine
+end program p
diff --git a/gcc/testsuite/gfortran.dg/pr119836_4.f90 b/gcc/testsuite/gfortran.dg/pr119836_4.f90
new file mode 100644
index 0000000..dc6f72b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr119836_4.f90
@@ -0,0 +1,30 @@
+!
+! { dg-do compile }
+!
+! PR fortran/119836
+!
+program p
+ implicit none
+ integer, parameter :: n = 4
+ integer :: i
+ integer :: y(n), x(n)
+ x = [(i,i=1,n)]
+ do concurrent (i=1:n)
+ call bar(x, y) ! { dg-error "Subroutine call" }
+ end do
+ if (any(x /= y)) stop 1
+ x = 2 * x
+ do concurrent (i=1:n)
+ block
+ call bar(x, y) ! { dg-error "Subroutine call" }
+ end block
+ end do
+ if (any(x /= y)) stop 1
+
+ contains
+ subroutine bar(x, y)
+ integer, intent(in) :: x(:)
+ integer, intent(out) :: y(:)
+ y = x
+ end subroutine
+end program p
diff --git a/gcc/testsuite/gfortran.dg/pure_formal_proc_4.f90 b/gcc/testsuite/gfortran.dg/pure_formal_proc_4.f90
new file mode 100644
index 0000000..92640e2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pure_formal_proc_4.f90
@@ -0,0 +1,49 @@
+! { dg-do compile }
+! PR fortran/106948 - check that passing of PURE procedures works
+!
+! Contributed by Jim Feng
+
+module a
+ implicit none
+
+ interface new
+ pure module subroutine b(x, f)
+ integer, intent(inout) :: x
+ interface
+ pure function f(x) result(r)
+ real, intent(in) :: x
+ real :: r
+ end function f
+ end interface
+ end subroutine b
+ end interface new
+end module a
+
+submodule(a) a_b
+ implicit none
+
+contains
+ module procedure b
+ x = int(f(real(x)) * 0.15)
+ end procedure b
+end submodule a_b
+
+program test
+ use a
+ implicit none
+
+ integer :: x
+
+ x = 100
+ call new(x, g)
+ print *, x
+
+contains
+
+ pure function g(y) result(r)
+ real, intent(in) :: y
+ real :: r
+
+ r = sqrt(y)
+ end function g
+end program test
diff --git a/gcc/testsuite/gm2.dg/doc/examples/pass/doc-examples-pass.exp b/gcc/testsuite/gm2.dg/doc/examples/pass/doc-examples-pass.exp
new file mode 100644
index 0000000..0bfcea0
--- /dev/null
+++ b/gcc/testsuite/gm2.dg/doc/examples/pass/doc-examples-pass.exp
@@ -0,0 +1,18 @@
+# Compile tests, no torture testing.
+#
+# These tests should all pass.
+
+# Load support procs.
+load_lib gm2-dg.exp
+
+gm2_init_pim4 $srcdir/$subdir
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] "" ""
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gm2.dg/doc/examples/pass/exampleadd.mod b/gcc/testsuite/gm2.dg/doc/examples/pass/exampleadd.mod
new file mode 100644
index 0000000..84020a8
--- /dev/null
+++ b/gcc/testsuite/gm2.dg/doc/examples/pass/exampleadd.mod
@@ -0,0 +1,32 @@
+(* { dg-do assemble { target { x86_64-*-* } } } *)
+(* { dg-options "-g" } *)
+
+MODULE exampleadd ;
+
+FROM libc IMPORT printf, exit ;
+
+
+PROCEDURE Example (foo, bar: CARDINAL) : CARDINAL ;
+VAR
+ myout: CARDINAL ;
+BEGIN
+ ASM VOLATILE ("movl %1,%%eax; addl %2,%%eax; movl %%eax,%0"
+ : "=rm" (myout) (* outputs *)
+ : "rm" (foo), "rm" (bar) (* inputs *)
+ : "eax") ; (* we trash *)
+ RETURN( myout )
+END Example ;
+
+
+VAR
+ a, b, c: CARDINAL ;
+BEGIN
+ a := 1 ;
+ b := 2 ;
+ c := Example (a, b) ;
+ IF c # 3
+ THEN
+ printf ("Example procedure function failed to return 3, seen %d", c) ;
+ exit (1)
+ END
+END exampleadd.
diff --git a/gcc/testsuite/gm2.dg/doc/examples/pass/exampleadd2.mod b/gcc/testsuite/gm2.dg/doc/examples/pass/exampleadd2.mod
new file mode 100644
index 0000000..f25397f
--- /dev/null
+++ b/gcc/testsuite/gm2.dg/doc/examples/pass/exampleadd2.mod
@@ -0,0 +1,32 @@
+(* { dg-do assemble { target { x86_64-*-* } } } *)
+(* { dg-options "-g" } *)
+
+MODULE exampleadd2 ;
+
+FROM libc IMPORT printf, exit ;
+
+
+PROCEDURE Example (foo, bar: CARDINAL) : CARDINAL ;
+VAR
+ myout: CARDINAL ;
+BEGIN
+ ASM VOLATILE (
+ "movl %[left],%%eax; addl %[right],%%eax; movl %%eax,%[output]"
+ : [output] "=rm" (myout) (* outputs *)
+ : [left] "rm" (foo), [right] "rm" (bar) (* inputs *)
+ : "eax") ; (* we trash *)
+ RETURN( myout )
+END Example ;
+
+VAR
+ a, b, c: CARDINAL ;
+BEGIN
+ a := 1 ;
+ b := 2 ;
+ c := Example (a, b) ;
+ IF c # 3
+ THEN
+ printf ("Example procedure function failed to return 3, seen %d", c) ;
+ exit (1)
+ END
+END exampleadd2.
diff --git a/gcc/testsuite/gm2.dg/doc/examples/pass/hello.mod b/gcc/testsuite/gm2.dg/doc/examples/pass/hello.mod
new file mode 100644
index 0000000..f9770ec
--- /dev/null
+++ b/gcc/testsuite/gm2.dg/doc/examples/pass/hello.mod
@@ -0,0 +1,10 @@
+(* { dg-do run } *)
+(* { dg-options "-g -fno-scaffold-dynamic" } *)
+
+MODULE hello ;
+
+FROM libc IMPORT printf ;
+
+BEGIN
+ printf ("hello world\n")
+END hello.
diff --git a/gcc/testsuite/gm2.dg/doc/examples/pass/hellopim.mod b/gcc/testsuite/gm2.dg/doc/examples/pass/hellopim.mod
new file mode 100644
index 0000000..b7876cd
--- /dev/null
+++ b/gcc/testsuite/gm2.dg/doc/examples/pass/hellopim.mod
@@ -0,0 +1,10 @@
+(* { dg-do run } *)
+(* { dg-options "-g -fno-scaffold-dynamic" } *)
+
+MODULE hellopim ;
+
+FROM StrIO IMPORT WriteString, WriteLn ;
+
+BEGIN
+ WriteString ("hello world") ; WriteLn
+END hellopim.
diff --git a/gcc/testsuite/gnat.dg/lto29.adb b/gcc/testsuite/gnat.dg/lto29.adb
new file mode 100644
index 0000000..44f556f
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/lto29.adb
@@ -0,0 +1,9 @@
+-- { dg-do run }
+-- { dg-options "-O -flto" { target lto } }
+
+with Lto29_Pkg;
+
+procedure Lto29 is
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/lto29_pkg.ads b/gcc/testsuite/gnat.dg/lto29_pkg.ads
new file mode 100644
index 0000000..6008dc5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/lto29_pkg.ads
@@ -0,0 +1,15 @@
+with Ada.Strings.Bounded;
+
+package Lto29_Pkg is
+
+ package M is new Ada.Strings.Bounded.Generic_Bounded_Length (10);
+
+ type T is new M.Bounded_String;
+
+ Null_T : constant T;
+
+private
+
+ Null_T : constant T := To_Bounded_String ("");
+
+end Lto29_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt105.adb b/gcc/testsuite/gnat.dg/opt105.adb
new file mode 100644
index 0000000..eb2c197
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt105.adb
@@ -0,0 +1,30 @@
+-- { dg-do run }
+-- { dg-options "-O" }
+
+with Opt105_Pkg; use Opt105_Pkg;
+
+procedure Opt105 is
+
+ Val : constant Enum :=
+ (if Enabled then (if Disabled then Two else One) else Three);
+
+begin
+ if Cond1 then
+ return;
+ end if;
+
+ if Cond2 then
+ return;
+ end if;
+
+ case Val is
+ when One =>
+ raise Program_Error;
+
+ when Two =>
+ raise Constraint_Error;
+
+ when Three =>
+ null;
+ end case;
+end;
diff --git a/gcc/testsuite/gnat.dg/opt105_pkg.adb b/gcc/testsuite/gnat.dg/opt105_pkg.adb
new file mode 100644
index 0000000..e00de94
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt105_pkg.adb
@@ -0,0 +1,6 @@
+package body Opt105_Pkg is
+
+ function Cond1 return Boolean is (False);
+ function Cond2 return Boolean is (False);
+
+end Opt105_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt105_pkg.ads b/gcc/testsuite/gnat.dg/opt105_pkg.ads
new file mode 100644
index 0000000..2b373b7
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt105_pkg.ads
@@ -0,0 +1,11 @@
+package Opt105_Pkg is
+
+ type Enum is (One, Two, Three);
+
+ Enabled : Boolean := False;
+ Disabled : Boolean := False;
+
+ function Cond1 return Boolean;
+ function Cond2 return Boolean;
+
+end Opt105_Pkg;
diff --git a/gcc/testsuite/gnat.dg/renaming17.adb b/gcc/testsuite/gnat.dg/renaming17.adb
new file mode 100644
index 0000000..d826433
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/renaming17.adb
@@ -0,0 +1,17 @@
+-- { dg-do run }
+
+procedure Renaming17 is
+
+ function Incr (V : Integer; I : Integer := 1) return Integer is
+ (V + I);
+
+ function Incr_Ren (V : Integer; I : Positive := 1) return Positive
+ renames Incr;
+
+ I : Integer;
+
+begin
+ I := Incr_Ren (-3);
+ I := Incr_Ren (-3, 2);
+ I := Incr_Ren (-3, 0);
+end;
diff --git a/gcc/testsuite/go.dg/pr119533-riscv-2.go b/gcc/testsuite/go.dg/pr119533-riscv-2.go
new file mode 100644
index 0000000..ce3ffaf
--- /dev/null
+++ b/gcc/testsuite/go.dg/pr119533-riscv-2.go
@@ -0,0 +1,42 @@
+// { dg-do compile { target riscv64*-*-* } }
+// { dg-options "-O2 -march=rv64gcv -mabi=lp64d" }
+
+package ast
+
+type as struct {
+ bt []struct{}
+ an string
+}
+
+func bj(a *as) string {
+ if b := a.bt; len(a.an) == 1 {
+ _ = b[0]
+ }
+ return a.an
+}
+
+func MergePackageFiles(f map[string][]interface{}, g uint) []interface{} {
+ bl := make([]string, len(f))
+ var bo []interface{}
+ bu := make(map[string]int)
+ for _, bm := range bl {
+ a := f[bm]
+ for _, d := range a {
+ if g != 0 {
+ if a, p := d.(*as); p {
+ n := bj(a)
+ if j, bp := bu[n]; bp {
+ _ = j
+ }
+ }
+ }
+ }
+ }
+ for _, bm := range bl {
+ _ = bm
+ }
+ for _, bm := range bl {
+ _ = f[bm]
+ }
+ return bo
+}
diff --git a/gcc/testsuite/go.dg/pr119533-riscv.go b/gcc/testsuite/go.dg/pr119533-riscv.go
new file mode 100644
index 0000000..30f52d2
--- /dev/null
+++ b/gcc/testsuite/go.dg/pr119533-riscv.go
@@ -0,0 +1,120 @@
+// { dg-do compile { target riscv64*-*-* } }
+// { dg-options "-O2 -march=rv64gcv -mabi=lp64d" }
+
+// Reduced from libgo build (multi-file reduction, merged mnaully
+// and hand reduced again).
+
+package ast
+import (
+ "go/token"
+ "go/scanner"
+ "reflect"
+)
+type v struct {}
+type w func( string, reflect.Value) bool
+func x( string, reflect.Value) bool
+type r struct {
+ scanner.ErrorList
+}
+type ab interface {}
+type ae interface {}
+type af interface {}
+type ag struct {}
+func (ag) Pos() token.Pos
+func (ag) ah() token.Pos
+type c struct {
+ aj ae }
+type ak struct {
+ al []c }
+type (
+ am struct {
+ an string }
+ bs struct {
+ Value string
+ }
+)
+func ao(string) *am
+type (
+ ap interface {}
+ aq struct {
+ ar bs }
+as struct {
+ bt ak
+ an am }
+)
+type File struct {
+ *ag
+ token.Pos
+ *am
+ at []af
+ *v
+ au []*aq
+ av *am
+ aw []*ag }
+type ax struct {
+ an string
+ *v
+ ay map[string]File }
+func a(az *token.FileSet, b token.Pos) int
+type k struct {
+ l token.Pos
+ ah token.Pos
+}
+type m struct {
+ bb bool
+ bc *ag
+}
+
+type bi uint
+func bj(a *as) string {
+ if b := a.bt; len(b.al) == 1 {
+ c := b.al[0].aj
+ if e := c; e != nil {}
+ }
+ return a.an.an
+}
+func MergePackageFiles(f ax, g bi) *File {
+ h := 0
+ bk := 0
+ k := 0
+ bl := make([]string, len(f.ay))
+ i := 0
+ for bm, a := range f.ay {
+ bl[i] = bm
+ k += len(a.at)
+ }
+ var bn *ag
+ var l token.Pos
+ if h > 0 {}
+ var bo []af
+ bu := make(map[string]int)
+ m := 0
+ for _, bm := range bl {
+ a := f.ay[bm]
+ for _, d := range a.at {
+ if g!= 0 {
+ if a, p := d.(*as); p {
+ n := bj(a)
+ if j, bp := bu[n]; bp {
+ if bo != nil && bo[j]== nil {}
+ }
+ }
+ }
+ }
+ }
+ if m > 0 {}
+ var bq []*aq
+ q := make(map[string]bool)
+ for _, bm := range bl {
+ a := f.ay[bm]
+ for _, br := range a.au {
+ if o := br.ar.Value; q[o] {}
+ }
+ }
+ var bh = make([]*ag, bk)
+ for _, bm := range bl {
+ a := f.ay[bm]
+ copy(bh, a.aw)
+ }
+ return &File{bn, l, ao(f.an), bo, f.v, bq, nil, bh}
+}
diff --git a/gcc/testsuite/lib/cobol.exp b/gcc/testsuite/lib/cobol.exp
index 8ea91e3..723989e 100644
--- a/gcc/testsuite/lib/cobol.exp
+++ b/gcc/testsuite/lib/cobol.exp
@@ -122,6 +122,15 @@ proc cobol_link_flags { paths } {
}
append ld_library_path ":${gccpath}/libgcobol/.libs"
}
+ if { [file exists "${gccpath}/libquadmath/.libs/libquadmath.a"] ||
+ [file exists "${gccpath}/libquadmath/.libs/libquadmath.${shlib_ext}"] } {
+ if { $target_wants_B_option } {
+ append flags "-B${gccpath}/libquadmath/.libs "
+ } else {
+ append flags "-L${gccpath}/libquadmath/.libs "
+ }
+ append ld_library_path ":${gccpath}/libquadmath/.libs"
+ }
if { [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.a"] ||
[file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.${shlib_ext}"] } {
if { $target_wants_B_option } {
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index eadc1cd..6dd8fa3 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -507,8 +507,7 @@ if { [info procs ${tool}_load] != [list] \
set linenum 1
set outfile [open [lindex ${output-file} 1]]
set do_fail 0
- set name [file tail [lindex ${output-file} 1]]
- verbose "output-file args is $args program is $program" 1
+ set name [testname-for-summary]
while { [gets $outfile line] >= 0 } {
if { $linenum != 1 } {
set c [string index $output $idx]
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index ee4138a..869d150 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -562,6 +562,16 @@ proc check_effective_target_elf { } {
}
}
+# Returns 1 if the target uses the PE/COFF object format, 0 otherwise.
+
+proc check_effective_target_pe { } {
+ if { [gcc_target_object_format] == "pe" } {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
# Returns 1 if the target toolchain supports ifunc, 0 otherwise.
proc check_ifunc_available { } {
@@ -13489,11 +13499,11 @@ proc check_effective_target_arm_v8_3a_bkey_directive { } {
# Return 1 if the target supports executing the Armv8.1-M Mainline Low
# Overhead Loop, 0 otherwise. The test is valid for ARM.
-proc check_effective_target_arm_v8_1_lob_ok { } {
+proc check_effective_target_arm_v8_1m_lob_hw { } {
if { ![check_effective_target_arm_cortex_m] } {
return 0;
} else {
- return [check_runtime arm_v8_1_lob_hw_available {
+ return [check_runtime arm_v8_1m_lob_hw_available {
int
main (void)
{ int i = 0;
@@ -13513,9 +13523,9 @@ proc check_effective_target_arm_v8_1_lob_ok { } {
# the Armv8.1-M Mainline Low Overhead Loop, 0 otherwise. The test is
# valid for ARM.
-proc check_effective_target_arm_thumb2_no_arm_v8_1_lob { } {
+proc check_effective_target_arm_thumb2_no_arm_v8_1m_lob { } {
if { [check_effective_target_arm_thumb2]
- && ![check_effective_target_arm_v8_1_lob_ok] } {
+ && ![check_effective_target_arm_v8_1m_lob_hw] } {
return 1
}
return 0
@@ -13525,9 +13535,9 @@ proc check_effective_target_arm_thumb2_no_arm_v8_1_lob { } {
# used and the target does not support executing the Armv8.1-M
# Mainline Low Overhead Loop, 0 otherwise. The test is valid for ARM.
-proc check_effective_target_arm_thumb2_ok_no_arm_v8_1_lob { } {
+proc check_effective_target_arm_thumb2_ok_no_arm_v8_1m_lob { } {
if { [check_effective_target_arm_thumb2_ok]
- && ![check_effective_target_arm_v8_1_lob_ok] } {
+ && ![check_effective_target_arm_v8_1m_lob_hw] } {
return 1
}
return 0
diff --git a/gcc/testsuite/rust/compile/enum_discriminant2.rs b/gcc/testsuite/rust/compile/enum_discriminant2.rs
new file mode 100644
index 0000000..351dfbb
--- /dev/null
+++ b/gcc/testsuite/rust/compile/enum_discriminant2.rs
@@ -0,0 +1,9 @@
+fn test() -> isize {
+ 1
+}
+
+enum Foo {
+ Bar = test() // { dg-error "only functions marked as .const." }
+}
+
+fn main() {}
diff --git a/gcc/testsuite/rust/compile/format_args_extra_comma.rs b/gcc/testsuite/rust/compile/format_args_extra_comma.rs
new file mode 100644
index 0000000..fcc435c
--- /dev/null
+++ b/gcc/testsuite/rust/compile/format_args_extra_comma.rs
@@ -0,0 +1,47 @@
+#![feature(rustc_attrs)]
+
+#[rustc_builtin_macro]
+macro_rules! format_args {
+ () => {};
+}
+
+#[lang = "sized"]
+trait Sized {}
+
+pub mod core {
+ pub mod fmt {
+ pub struct Formatter;
+ pub struct Result;
+
+ pub struct Arguments<'a>;
+
+ impl<'a> Arguments<'a> {
+ pub fn new_v1(_: &'a [&'static str], _: &'a [ArgumentV1<'a>]) -> Arguments<'a> {
+ Arguments
+ }
+ }
+
+ pub struct ArgumentV1<'a>;
+
+ impl<'a> ArgumentV1<'a> {
+ pub fn new<'b, T>(_: &'b T, _: fn(&T, &mut Formatter) -> Result) -> ArgumentV1 {
+ ArgumentV1
+ }
+ }
+
+ pub trait Display {
+ fn fmt(&self, _: &mut Formatter) -> Result;
+ }
+
+ impl Display for i32 {
+ fn fmt(&self, _: &mut Formatter) -> Result {
+ // { dg-warning "unused name .self." "" { target *-*-* } .-1 }
+ Result
+ }
+ }
+ }
+}
+
+fn main() {
+ let _formatted = format_args!("extra commas {} {}", 15, 14,);
+}
diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue3693.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3693.rs
new file mode 100644
index 0000000..e990c8b
--- /dev/null
+++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3693.rs
@@ -0,0 +1,10 @@
+macro_rules! generate_pattern_iterators {
+ {
+ $(#[$forward_iterator_attribute:meta])*
+ } => {
+ }
+}
+
+generate_pattern_iterators! {
+ /// Created with the method [`split`].
+}
diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue3708.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3708.rs
new file mode 100644
index 0000000..e5b38bb
--- /dev/null
+++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3708.rs
@@ -0,0 +1,80 @@
+// { dg-additional-options "-frust-name-resolution-2.0 -frust-compile-until=lowering" }
+
+macro_rules! impl_fn_for_zst {
+ ($(
+ $( #[$attr: meta] )*
+ struct $Name: ident impl$( <$( $lifetime : lifetime ),+> )? Fn =
+ |$( $arg: ident: $ArgTy: ty ),*| -> $ReturnTy: ty
+ $body: block;
+ )+) => {
+ $(
+ $( #[$attr] )*
+ struct $Name;
+
+ impl $( <$( $lifetime ),+> )? Fn<($( $ArgTy, )*)> for $Name {
+ #[inline]
+ extern "rust-call" fn call(&self, ($( $arg, )*): ($( $ArgTy, )*)) -> $ReturnTy {
+ $body
+ }
+ }
+
+ impl $( <$( $lifetime ),+> )? FnMut<($( $ArgTy, )*)> for $Name {
+ #[inline]
+ extern "rust-call" fn call_mut(
+ &mut self,
+ ($( $arg, )*): ($( $ArgTy, )*)
+ ) -> $ReturnTy {
+ Fn::call(&*self, ($( $arg, )*))
+ }
+ }
+
+ impl $( <$( $lifetime ),+> )? FnOnce<($( $ArgTy, )*)> for $Name {
+ type Output = $ReturnTy;
+
+ #[inline]
+ extern "rust-call" fn call_once(self, ($( $arg, )*): ($( $ArgTy, )*)) -> $ReturnTy {
+ Fn::call(&self, ($( $arg, )*))
+ }
+ }
+ )+
+ }
+}
+
+#[lang = "sized"]
+trait Sized {}
+
+#[lang = "copy"]
+trait Copy {}
+
+#[lang = "fn"]
+pub trait Fn<Args>: FnMut<Args> {
+ /// Performs the call operation.
+ #[unstable(feature = "fn_traits", issue = "29625")]
+ extern "rust-call" fn call(&self, args: Args) -> Self::Output;
+}
+
+#[lang = "fn_mut"]
+#[must_use = "closures are lazy and do nothing unless called"]
+pub trait FnMut<Args>: FnOnce<Args> {
+ /// Performs the call operation.
+ #[unstable(feature = "fn_traits", issue = "29625")]
+ extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
+}
+
+#[lang = "fn_once"]
+pub trait FnOnce<Args> {
+ /// The returned type after the call operator is used.
+ #[lang = "fn_once_output"]
+ #[stable(feature = "fn_once_output", since = "1.12.0")]
+ type Output;
+
+ /// Performs the call operation.
+ #[unstable(feature = "fn_traits", issue = "29625")]
+ extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
+}
+
+impl_fn_for_zst! {
+ #[derive(Copy)]
+ struct LinesAnyMap impl<'a> Fn = |line: &'a str| -> () {
+ };
+}
diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-1.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-1.rs
new file mode 100644
index 0000000..6fc3a31
--- /dev/null
+++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-1.rs
@@ -0,0 +1,10 @@
+macro_rules! doc_comment {
+ (#[ $attr: meta ]) => {
+ #[$attr]
+ struct Generated; // { dg-warning "never constructed" }
+ };
+}
+
+doc_comment! {
+ /// This is a generated struct
+}
diff --git a/gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-2.rs b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-2.rs
new file mode 100644
index 0000000..cfc8ab4
--- /dev/null
+++ b/gcc/testsuite/rust/compile/macros/mbe/macro-issue3709-2.rs
@@ -0,0 +1,81 @@
+// { dg-additional-options "-frust-name-resolution-2.0 -frust-compile-until=lowering" }
+
+macro_rules! impl_fn_for_zst {
+ ($(
+ $( #[$attr: meta] )*
+ struct $Name: ident impl$( <$( $lifetime : lifetime ),+> )? Fn =
+ |$( $arg: ident: $ArgTy: ty ),*| -> $ReturnTy: ty
+ $body: block;
+ )+) => {
+ $(
+ $( #[$attr] )*
+ struct $Name;
+
+ impl $( <$( $lifetime ),+> )? Fn<($( $ArgTy, )*)> for $Name {
+ #[inline]
+ extern "rust-call" fn call(&self, ($( $arg, )*): ($( $ArgTy, )*)) -> $ReturnTy {
+ $body
+ }
+ }
+
+ impl $( <$( $lifetime ),+> )? FnMut<($( $ArgTy, )*)> for $Name {
+ #[inline]
+ extern "rust-call" fn call_mut(
+ &mut self,
+ ($( $arg, )*): ($( $ArgTy, )*)
+ ) -> $ReturnTy {
+ Fn::call(&*self, ($( $arg, )*))
+ }
+ }
+
+ impl $( <$( $lifetime ),+> )? FnOnce<($( $ArgTy, )*)> for $Name {
+ type Output = $ReturnTy;
+
+ #[inline]
+ extern "rust-call" fn call_once(self, ($( $arg, )*): ($( $ArgTy, )*)) -> $ReturnTy {
+ Fn::call(&self, ($( $arg, )*))
+ }
+ }
+ )+
+ }
+}
+
+#[lang = "sized"]
+trait Sized {}
+
+#[lang = "copy"]
+trait Copy {}
+
+#[lang = "fn"]
+pub trait Fn<Args>: FnMut<Args> {
+ /// Performs the call operation.
+ #[unstable(feature = "fn_traits", issue = "29625")]
+ extern "rust-call" fn call(&self, args: Args) -> Self::Output;
+}
+
+#[lang = "fn_mut"]
+#[must_use = "closures are lazy and do nothing unless called"]
+pub trait FnMut<Args>: FnOnce<Args> {
+ /// Performs the call operation.
+ #[unstable(feature = "fn_traits", issue = "29625")]
+ extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
+}
+
+#[lang = "fn_once"]
+pub trait FnOnce<Args> {
+ /// The returned type after the call operator is used.
+ #[lang = "fn_once_output"]
+ #[stable(feature = "fn_once_output", since = "1.12.0")]
+ type Output;
+
+ /// Performs the call operation.
+ #[unstable(feature = "fn_traits", issue = "29625")]
+ extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
+}
+
+impl_fn_for_zst! {
+ /// Documentation for the zst
+ #[derive(Copy)]
+ struct LinesAnyMap impl<'a> Fn = |line: &'a str| -> () {
+ };
+}
diff --git a/gcc/testsuite/rust/compile/nr2/compile.exp b/gcc/testsuite/rust/compile/nr2/compile.exp
index 4d91dd0..9e15cdd 100644
--- a/gcc/testsuite/rust/compile/nr2/compile.exp
+++ b/gcc/testsuite/rust/compile/nr2/compile.exp
@@ -19,6 +19,15 @@
# Load support procs.
load_lib rust-dg.exp
+# These tests don't run runtest_file_p consistently if it
+# doesn't return the same values, so disable parallelization
+# of this *.exp file. The first parallel runtest to reach
+# this will run all the tests serially.
+if ![gcc_parallel_test_run_p compile] {
+ return
+}
+gcc_parallel_test_enable 0
+
# Initialize `dg'.
dg-init
@@ -136,3 +145,5 @@ namespace eval rust-nr2-ns {
# All done.
dg-finish
+
+gcc_parallel_test_enable 1
diff --git a/gcc/testsuite/rust/compile/track_caller.rs b/gcc/testsuite/rust/compile/track_caller.rs
new file mode 100644
index 0000000..fd1d842
--- /dev/null
+++ b/gcc/testsuite/rust/compile/track_caller.rs
@@ -0,0 +1,6 @@
+#[track_caller]
+fn foo() {}
+
+fn main() {
+ foo();
+}
diff --git a/gcc/testsuite/rust/execute/torture/min_specialization2.rs b/gcc/testsuite/rust/execute/torture/min_specialization2.rs
new file mode 100644
index 0000000..d3239ee
--- /dev/null
+++ b/gcc/testsuite/rust/execute/torture/min_specialization2.rs
@@ -0,0 +1,31 @@
+#![feature(min_specialization)]
+
+#[lang = "sized"]
+trait Sized {}
+
+trait Foo {
+ fn foo(&self) -> i32;
+}
+
+impl<T> Foo for T {
+ default fn foo(&self) -> i32 { // { dg-warning "unused" }
+ 15
+ }
+}
+
+impl Foo for bool {
+ fn foo(&self) -> i32 {
+ if *self {
+ 1
+ } else {
+ 0
+ }
+ }
+}
+
+fn main() -> i32 {
+ let a = 1.foo() - 15;
+ let b = true.foo() - 1;
+
+ a + b
+}
diff --git a/gcc/testsuite/rust/execute/torture/min_specialization3.rs b/gcc/testsuite/rust/execute/torture/min_specialization3.rs
new file mode 100644
index 0000000..9eccd97
--- /dev/null
+++ b/gcc/testsuite/rust/execute/torture/min_specialization3.rs
@@ -0,0 +1,36 @@
+#![feature(min_specialization)]
+
+#[lang = "sized"]
+trait Sized {}
+
+trait Foo {
+ fn foo(&self) -> i32;
+}
+
+struct Wrap<T>(T);
+
+impl<T> Foo for T {
+ default fn foo(&self) -> i32 {
+ 15
+ }
+}
+
+impl<T> Foo for Wrap<T> {
+ default fn foo(&self) -> i32 {
+ 16
+ }
+}
+
+impl Foo for Wrap<bool> {
+ fn foo(&self) -> i32 {
+ if self.0 {
+ 1
+ } else {
+ 0
+ }
+ }
+}
+
+fn main() -> i32 {
+ Wrap(true).foo() - 1
+}
diff --git a/gcc/timevar.def b/gcc/timevar.def
index c1029d9..02ace46 100644
--- a/gcc/timevar.def
+++ b/gcc/timevar.def
@@ -105,6 +105,7 @@ DEFTIMEVAR (TV_IPA_PURE_CONST , "ipa pure const")
DEFTIMEVAR (TV_IPA_ICF , "ipa icf")
DEFTIMEVAR (TV_IPA_PTA , "ipa points-to")
DEFTIMEVAR (TV_IPA_SRA , "ipa SRA")
+DEFTIMEVAR (TV_IPA_LC , "ipa locality clone")
DEFTIMEVAR (TV_IPA_FREE_LANG_DATA , "ipa free lang data")
DEFTIMEVAR (TV_IPA_FREE_INLINE_SUMMARY, "ipa free inline summary")
DEFTIMEVAR (TV_IPA_MODREF , "ipa modref")
diff --git a/gcc/tree-data-ref.cc b/gcc/tree-data-ref.cc
index 18d9f0f..8a46e6d 100644
--- a/gcc/tree-data-ref.cc
+++ b/gcc/tree-data-ref.cc
@@ -2498,9 +2498,10 @@ create_waw_or_war_checks (tree *cond_expr,
limit = fold_build2 (PLUS_EXPR, sizetype, limit,
size_int (last_chunk_a + last_chunk_b));
- tree subject = fold_build2 (POINTER_DIFF_EXPR, ssizetype, addr_b, addr_a);
- subject = fold_build2 (PLUS_EXPR, sizetype,
- fold_convert (sizetype, subject), bias);
+ tree subject = fold_build2 (MINUS_EXPR, sizetype,
+ fold_convert (sizetype, addr_b),
+ fold_convert (sizetype, addr_a));
+ subject = fold_build2 (PLUS_EXPR, sizetype, subject, bias);
*cond_expr = fold_build2 (GT_EXPR, boolean_type_node, subject, limit);
if (dump_enabled_p ())
diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc
index 05843b8..3289b4f 100644
--- a/gcc/tree-inline.cc
+++ b/gcc/tree-inline.cc
@@ -2729,8 +2729,11 @@ copy_edges_for_bb (basic_block bb, profile_count num, profile_count den,
&& gimple_call_arg (copy_stmt, 0) == boolean_true_node)
nonlocal_goto = false;
else
- make_single_succ_edge (copy_stmt_bb, abnormal_goto_dest,
- EDGE_ABNORMAL);
+ {
+ make_single_succ_edge (copy_stmt_bb, abnormal_goto_dest,
+ EDGE_ABNORMAL);
+ gimple_call_set_ctrl_altering (copy_stmt, true);
+ }
}
if ((can_throw || nonlocal_goto)
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 217c31f..7cb5a12 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -551,6 +551,7 @@ extern ipa_opt_pass_d *make_pass_ipa_cdtor_merge (gcc::context *ctxt);
extern ipa_opt_pass_d *make_pass_ipa_single_use (gcc::context *ctxt);
extern ipa_opt_pass_d *make_pass_ipa_comdats (gcc::context *ctxt);
extern ipa_opt_pass_d *make_pass_ipa_modref (gcc::context *ctxt);
+extern ipa_opt_pass_d *make_pass_ipa_locality_cloning (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_cleanup_cfg_post_optimizing (gcc::context
*ctxt);
diff --git a/gcc/tree-pretty-print.cc b/gcc/tree-pretty-print.cc
index a2a4f5b..c1a21e7 100644
--- a/gcc/tree-pretty-print.cc
+++ b/gcc/tree-pretty-print.cc
@@ -3201,6 +3201,8 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags,
pp_string (pp, " [return slot optimization]");
if (CALL_EXPR_TAILCALL (node))
pp_string (pp, " [tail call]");
+ if (CALL_EXPR_MUST_TAIL_CALL (node))
+ pp_string (pp, " [must tail call]");
break;
case WITH_CLEANUP_EXPR:
diff --git a/gcc/tree-ssa-coalesce.cc b/gcc/tree-ssa-coalesce.cc
index b78ffd7..7cc39f7 100644
--- a/gcc/tree-ssa-coalesce.cc
+++ b/gcc/tree-ssa-coalesce.cc
@@ -896,6 +896,18 @@ build_ssa_conflict_graph (tree_live_info_p liveinfo)
tree var;
gimple *stmt = gsi_stmt (gsi);
+ if (is_gimple_debug (stmt))
+ continue;
+
+ if (map->bitint)
+ {
+ build_bitint_stmt_ssa_conflicts (stmt, live, graph, map->bitint,
+ live_track_process_def,
+ live_track_process_use,
+ live_track_clear_var);
+ continue;
+ }
+
/* A copy between 2 partitions does not introduce an interference
by itself. If they did, you would never be able to coalesce
two things which are copied. If the two variables really do
@@ -912,16 +924,6 @@ build_ssa_conflict_graph (tree_live_info_p liveinfo)
&& TREE_CODE (rhs1) == SSA_NAME)
live_track_clear_var (live, rhs1);
}
- else if (is_gimple_debug (stmt))
- continue;
-
- if (map->bitint)
- {
- build_bitint_stmt_ssa_conflicts (stmt, live, graph, map->bitint,
- live_track_process_def,
- live_track_process_use);
- continue;
- }
/* For stmts with more than one SSA_NAME definition pretend all the
SSA_NAME outputs but the first one are live at this point, so
diff --git a/gcc/tree-ssa-dse.cc b/gcc/tree-ssa-dse.cc
index bc632e3..d1d58bf 100644
--- a/gcc/tree-ssa-dse.cc
+++ b/gcc/tree-ssa-dse.cc
@@ -566,16 +566,17 @@ maybe_trim_complex_store (ao_ref *ref, sbitmap live, gimple *stmt)
The most common case for getting here is a CONSTRUCTOR with no elements
being used to zero initialize an object. We do not try to handle other
cases as those would force us to fully cover the object with the
- CONSTRUCTOR node except for the components that are dead. */
+ CONSTRUCTOR node except for the components that are dead.
+ Also handles integer stores of 0 which can happen with memset/memcpy optimizations. */
static void
-maybe_trim_constructor_store (ao_ref *ref, sbitmap live, gimple *stmt)
+maybe_trim_constructor_store (ao_ref *ref, sbitmap live, gimple *stmt, bool was_integer_cst)
{
tree ctor = gimple_assign_rhs1 (stmt);
/* This is the only case we currently handle. It actually seems to
catch most cases of actual interest. */
- gcc_assert (CONSTRUCTOR_NELTS (ctor) == 0);
+ gcc_assert (was_integer_cst ? integer_zerop (ctor) : CONSTRUCTOR_NELTS (ctor) == 0);
int head_trim = 0;
int tail_trim = 0;
@@ -588,6 +589,8 @@ maybe_trim_constructor_store (ao_ref *ref, sbitmap live, gimple *stmt)
/* We want &lhs for the MEM_REF expression. */
tree lhs_addr = build_fold_addr_expr (gimple_assign_lhs (stmt));
+ STRIP_USELESS_TYPE_CONVERSION (lhs_addr);
+
if (! is_gimple_min_invariant (lhs_addr))
return;
@@ -802,11 +805,16 @@ maybe_trim_partially_dead_store (ao_ref *ref, sbitmap live, gimple *stmt)
switch (gimple_assign_rhs_code (stmt))
{
case CONSTRUCTOR:
- maybe_trim_constructor_store (ref, live, stmt);
+ maybe_trim_constructor_store (ref, live, stmt, false);
break;
case COMPLEX_CST:
maybe_trim_complex_store (ref, live, stmt);
break;
+ case INTEGER_CST:
+ if (integer_zerop (gimple_assign_rhs1 (stmt))
+ && type_has_mode_precision_p (TREE_TYPE (gimple_assign_lhs (stmt))))
+ maybe_trim_constructor_store (ref, live, stmt, true);
+ break;
default:
break;
}
diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index 7d2d169..a194bf6 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -403,12 +403,15 @@ factor_out_conditional_operation (edge e0, edge e1, basic_block merge,
if (dominated_by_p (CDI_DOMINATORS, gimple_bb (phi), gimple_bb (arg0_def_stmt)))
return false;
- /* Only handle if arg1 is a INTEGER_CST and one that fits
- into the new type or if it is the same precision. */
+ /* If arg1 is an INTEGER_CST, fold it to new type if it fits, or else
+ if the bits will not be modified during the conversion, except for
+ boolean types whose precision is not 1 (see int_fits_type_p). */
if (!INTEGRAL_TYPE_P (TREE_TYPE (new_arg0))
|| !(int_fits_type_p (arg1, TREE_TYPE (new_arg0))
|| (TYPE_PRECISION (TREE_TYPE (new_arg0))
- == TYPE_PRECISION (TREE_TYPE (arg1)))))
+ == TYPE_PRECISION (TREE_TYPE (arg1))
+ && (TREE_CODE (TREE_TYPE (new_arg0)) != BOOLEAN_TYPE
+ || TYPE_PRECISION (TREE_TYPE (new_arg0)) == 1))))
return false;
/* For the INTEGER_CST case, we are just moving the
diff --git a/gcc/tree-tailcall.cc b/gcc/tree-tailcall.cc
index f51bb97..f593363 100644
--- a/gcc/tree-tailcall.cc
+++ b/gcc/tree-tailcall.cc
@@ -51,6 +51,8 @@ along with GCC; see the file COPYING3. If not see
#include "symbol-summary.h"
#include "ipa-cp.h"
#include "ipa-prop.h"
+#include "attribs.h"
+#include "asan.h"
/* The file implements the tail recursion elimination. It is also used to
analyze the tail calls in general, passing the results to the rtl level
@@ -122,6 +124,9 @@ struct tailcall
/* True if it is a call to the current function. */
bool tail_recursion;
+ /* True if there is __tsan_func_exit call after the call. */
+ bool has_tsan_func_exit;
+
/* The return value of the caller is mult * f + add, where f is the return
value of the call. */
tree mult, add;
@@ -492,10 +497,10 @@ maybe_error_musttail (gcall *call, const char *err, bool diag_musttail)
gimple_call_set_must_tail (call, false); /* Avoid another error. */
gimple_call_set_tail (call, false);
}
- if (dump_file)
+ if (dump_file && (dump_flags & TDF_DETAILS))
{
+ fprintf (dump_file, "Cannot tail-call: %s: ", err);
print_gimple_stmt (dump_file, call, 0, TDF_SLIM);
- fprintf (dump_file, "Cannot convert: %s\n", err);
}
}
@@ -504,7 +509,7 @@ maybe_error_musttail (gcall *call, const char *err, bool diag_musttail)
Search at most CNT basic blocks (so that we don't need to do trivial
loop discovery). */
static bool
-empty_eh_cleanup (basic_block bb, int cnt)
+empty_eh_cleanup (basic_block bb, int *eh_has_tsan_func_exit, int cnt)
{
if (EDGE_COUNT (bb->succs) > 1)
return false;
@@ -515,6 +520,14 @@ empty_eh_cleanup (basic_block bb, int cnt)
gimple *g = gsi_stmt (gsi);
if (is_gimple_debug (g) || gimple_clobber_p (g))
continue;
+ if (eh_has_tsan_func_exit
+ && !*eh_has_tsan_func_exit
+ && sanitize_flags_p (SANITIZE_THREAD)
+ && gimple_call_builtin_p (g, BUILT_IN_TSAN_FUNC_EXIT))
+ {
+ *eh_has_tsan_func_exit = 1;
+ continue;
+ }
if (is_gimple_resx (g) && stmt_can_throw_external (cfun, g))
return true;
return false;
@@ -523,7 +536,7 @@ empty_eh_cleanup (basic_block bb, int cnt)
return false;
if (cnt == 1)
return false;
- return empty_eh_cleanup (single_succ (bb), cnt - 1);
+ return empty_eh_cleanup (single_succ (bb), eh_has_tsan_func_exit, cnt - 1);
}
/* Argument for compute_live_vars/live_vars_at_stmt and what compute_live_vars
@@ -531,14 +544,22 @@ empty_eh_cleanup (basic_block bb, int cnt)
static live_vars_map *live_vars;
static vec<bitmap_head> live_vars_vec;
-/* Finds tailcalls falling into basic block BB. The list of found tailcalls is
+/* Finds tailcalls falling into basic block BB. The list of found tailcalls is
added to the start of RET. When ONLY_MUSTTAIL is set only handle musttail.
Update OPT_TAILCALLS as output parameter. If DIAG_MUSTTAIL, diagnose
- failures for musttail calls. */
+ failures for musttail calls. RETRY_TSAN_FUNC_EXIT is initially 0 and
+ in that case the last call is attempted to be tail called, including
+ __tsan_func_exit with -fsanitize=thread. It is set to -1 if we
+ detect __tsan_func_exit call and in that case tree_optimize_tail_calls_1
+ will retry with it set to 1 (regardless of whether turning the
+ __tsan_func_exit was successfully detected as tail call or not) and that
+ will allow turning musttail calls before that call into tail calls as well
+ by adding __tsan_func_exit call before the call. */
static void
find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
- bool &opt_tailcalls, bool diag_musttail)
+ bool &opt_tailcalls, bool diag_musttail,
+ int &retry_tsan_func_exit)
{
tree ass_var = NULL_TREE, ret_var, func, param;
gimple *stmt;
@@ -552,6 +573,8 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
size_t idx;
tree var;
bool only_tailr = false;
+ bool has_tsan_func_exit = false;
+ int eh_has_tsan_func_exit = -1;
if (!single_succ_p (bb)
&& (EDGE_COUNT (bb->succs) || !cfun->has_musttail || !diag_musttail))
@@ -585,6 +608,17 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
|| is_gimple_debug (stmt))
continue;
+ if (cfun->has_musttail
+ && sanitize_flags_p (SANITIZE_THREAD)
+ && gimple_call_builtin_p (stmt, BUILT_IN_TSAN_FUNC_EXIT)
+ && diag_musttail)
+ {
+ if (retry_tsan_func_exit == 0)
+ retry_tsan_func_exit = -1;
+ else if (retry_tsan_func_exit == 1)
+ continue;
+ }
+
if (!last_stmt)
last_stmt = stmt;
/* Check for a call. */
@@ -596,9 +630,8 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
return;
if (bad_stmt)
{
- maybe_error_musttail (call,
- _("memory reference or volatile after "
- "call"), diag_musttail);
+ maybe_error_musttail (call, _("memory reference or volatile "
+ "after call"), diag_musttail);
return;
}
ass_var = gimple_call_lhs (call);
@@ -636,7 +669,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
/* Recurse to the predecessors. */
FOR_EACH_EDGE (e, ei, bb->preds)
find_tail_calls (e->src, ret, only_musttail, opt_tailcalls,
- diag_musttail);
+ diag_musttail, retry_tsan_func_exit);
return;
}
@@ -711,19 +744,22 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
if (!e)
{
- maybe_error_musttail (call,
- _("call may throw exception that does not "
- "propagate"), diag_musttail);
+ maybe_error_musttail (call, _("call may throw exception that does not "
+ "propagate"), diag_musttail);
return;
}
+ if (diag_musttail && gimple_call_must_tail_p (call))
+ eh_has_tsan_func_exit = 0;
if (!gimple_call_must_tail_p (call)
- || !empty_eh_cleanup (e->dest, 20)
+ || !empty_eh_cleanup (e->dest,
+ eh_has_tsan_func_exit
+ ? NULL : &eh_has_tsan_func_exit, 20)
|| EDGE_COUNT (bb->succs) > 2)
{
- maybe_error_musttail (call,
- _("call may throw exception caught locally "
- "or perform cleanups"), diag_musttail);
+ maybe_error_musttail (call, _("call may throw exception caught "
+ "locally or perform cleanups"),
+ diag_musttail);
return;
}
}
@@ -854,9 +890,8 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
}
if (local_live_vars)
BITMAP_FREE (local_live_vars);
- maybe_error_musttail (call,
- _("call invocation refers to locals"),
- diag_musttail);
+ maybe_error_musttail (call, _("call invocation refers to "
+ "locals"), diag_musttail);
return;
}
else
@@ -883,9 +918,8 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
continue;
}
BITMAP_FREE (local_live_vars);
- maybe_error_musttail (call,
- _("call invocation refers to locals"),
- diag_musttail);
+ maybe_error_musttail (call, _("call invocation refers to "
+ "locals"), diag_musttail);
return;
}
}
@@ -951,6 +985,17 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
|| is_gimple_debug (stmt))
continue;
+ if (cfun->has_musttail
+ && sanitize_flags_p (SANITIZE_THREAD)
+ && retry_tsan_func_exit == 1
+ && gimple_call_builtin_p (stmt, BUILT_IN_TSAN_FUNC_EXIT)
+ && !has_tsan_func_exit
+ && gimple_call_must_tail_p (call))
+ {
+ has_tsan_func_exit = true;
+ continue;
+ }
+
if (gimple_code (stmt) != GIMPLE_ASSIGN)
{
maybe_error_musttail (call, _("unhandled code after call"),
@@ -1020,8 +1065,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
if (!VOID_TYPE_P (rettype)
&& !useless_type_conversion_p (rettype, calltype))
{
- maybe_error_musttail (call,
- _("call and return value are different"),
+ maybe_error_musttail (call, _("call and return value are different"),
diag_musttail);
return;
}
@@ -1092,8 +1136,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
}
if (!ok)
{
- maybe_error_musttail (call,
- _("call and return value are different"),
+ maybe_error_musttail (call, _("call and return value are different"),
diag_musttail);
return;
}
@@ -1103,18 +1146,29 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
multiplicands. */
if (!tail_recursion && (m || a))
{
- maybe_error_musttail (call,
- _("operations after non tail recursive call"),
- diag_musttail);
+ maybe_error_musttail (call, _("operations after non tail recursive "
+ "call"), diag_musttail);
return;
}
/* For pointers only allow additions. */
if (m && POINTER_TYPE_P (TREE_TYPE (DECL_RESULT (current_function_decl))))
{
- maybe_error_musttail (call,
- _("tail recursion with pointers can only use "
- "additions"), diag_musttail);
+ maybe_error_musttail (call, _("tail recursion with pointers can only "
+ "use additions"), diag_musttail);
+ return;
+ }
+
+ if (eh_has_tsan_func_exit != -1
+ && eh_has_tsan_func_exit != has_tsan_func_exit)
+ {
+ if (eh_has_tsan_func_exit)
+ maybe_error_musttail (call, _("call may throw exception caught "
+ "locally or perform cleanups"),
+ diag_musttail);
+ else
+ maybe_error_musttail (call, _("exception cleanups omit "
+ "__tsan_func_exit call"), diag_musttail);
return;
}
@@ -1146,6 +1200,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
nw->call_gsi = gsi;
nw->tail_recursion = tail_recursion;
+ nw->has_tsan_func_exit = has_tsan_func_exit;
nw->mult = m;
nw->add = a;
@@ -1480,6 +1535,14 @@ static bool
optimize_tail_call (struct tailcall *t, bool opt_tailcalls,
class loop *&new_loop)
{
+ if (t->has_tsan_func_exit && (t->tail_recursion || opt_tailcalls))
+ {
+ tree builtin_decl = builtin_decl_implicit (BUILT_IN_TSAN_FUNC_EXIT);
+ gimple *g = gimple_build_call (builtin_decl, 0);
+ gimple_set_location (g, cfun->function_end_locus);
+ gsi_insert_before (&t->call_gsi, g, GSI_SAME_STMT);
+ }
+
if (t->tail_recursion)
{
eliminate_tail_call (t, new_loop);
@@ -1498,6 +1561,7 @@ optimize_tail_call (struct tailcall *t, bool opt_tailcalls,
print_gimple_stmt (dump_file, stmt, 0, dump_flags);
fprintf (dump_file, " in bb %i\n", (gsi_bb (t->call_gsi))->index);
}
+ return t->has_tsan_func_exit;
}
return false;
@@ -1547,12 +1611,23 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls, bool only_musttail,
/* Only traverse the normal exits, i.e. those that end with return
statement. */
if (safe_is_a <greturn *> (*gsi_last_bb (e->src)))
- find_tail_calls (e->src, &tailcalls, only_musttail, opt_tailcalls,
- diag_musttail);
+ {
+ int retry_tsan_func_exit = 0;
+ find_tail_calls (e->src, &tailcalls, only_musttail, opt_tailcalls,
+ diag_musttail, retry_tsan_func_exit);
+ if (retry_tsan_func_exit == -1)
+ {
+ retry_tsan_func_exit = 1;
+ find_tail_calls (e->src, &tailcalls, only_musttail,
+ opt_tailcalls, diag_musttail,
+ retry_tsan_func_exit);
+ }
+ }
}
if (cfun->has_musttail && diag_musttail)
{
basic_block bb;
+ int retry_tsan_func_exit = 0;
FOR_EACH_BB_FN (bb, cfun)
if (EDGE_COUNT (bb->succs) == 0
|| (single_succ_p (bb)
@@ -1562,7 +1637,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls, bool only_musttail,
&& gimple_call_must_tail_p (as_a <gcall *> (c))
&& gimple_call_noreturn_p (as_a <gcall *> (c)))
find_tail_calls (bb, &tailcalls, only_musttail, opt_tailcalls,
- diag_musttail);
+ diag_musttail, retry_tsan_func_exit);
}
if (live_vars)
@@ -1594,10 +1669,10 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls, bool only_musttail,
struct tailcall *a = *p;
*p = (*p)->next;
gcall *call = as_a <gcall *> (gsi_stmt (a->call_gsi));
- maybe_error_musttail (call,
- _("tail recursion with accumulation "
- "mixed with musttail "
- "non-recursive call"), diag_musttail);
+ maybe_error_musttail (call, _("tail recursion with "
+ "accumulation mixed with "
+ "musttail non-recursive call"),
+ diag_musttail);
free (a);
}
else
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 9413dce..2d35fa1 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -653,6 +653,10 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, class loop *loop,
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location, "Detected induction.\n");
STMT_VINFO_DEF_TYPE (stmt_vinfo) = vect_induction_def;
+
+ /* Mark if we have a non-linear IV. */
+ LOOP_VINFO_NON_LINEAR_IV (loop_vinfo)
+ = STMT_VINFO_LOOP_PHI_EVOLUTION_TYPE (stmt_vinfo) != vect_step_op_add;
}
@@ -1046,12 +1050,14 @@ _loop_vec_info::_loop_vec_info (class loop *loop_in, vec_info_shared *shared)
suggested_unroll_factor (1),
max_vectorization_factor (0),
mask_skip_niters (NULL_TREE),
+ mask_skip_niters_pfa_offset (NULL_TREE),
rgroup_compare_type (NULL_TREE),
simd_if_cond (NULL_TREE),
partial_vector_style (vect_partial_vectors_none),
unaligned_dr (NULL),
peeling_for_alignment (0),
ptr_mask (0),
+ nonlinear_iv (false),
ivexpr_map (NULL),
scan_map (NULL),
slp_unrolling_factor (1),
@@ -10678,6 +10684,54 @@ vectorizable_induction (loop_vec_info loop_vinfo,
LOOP_VINFO_MASK_SKIP_NITERS (loop_vinfo));
peel_mul = gimple_build_vector_from_val (&init_stmts,
step_vectype, peel_mul);
+
+ /* If early break then we have to create a new PHI which we can use as
+ an offset to adjust the induction reduction in early exits.
+
+ This is because when peeling for alignment using masking, the first
+ few elements of the vector can be inactive. As such if we find the
+ entry in the first iteration we have adjust the starting point of
+ the scalar code.
+
+ We do this by creating a new scalar PHI that keeps track of whether
+ we are the first iteration of the loop (with the additional masking)
+ or whether we have taken a loop iteration already.
+
+ The generated sequence:
+
+ pre-header:
+ bb1:
+ i_1 = <number of leading inactive elements>
+
+ header:
+ bb2:
+ i_2 = PHI <i_1(bb1), 0(latch)>
+ …
+
+ early-exit:
+ bb3:
+ i_3 = iv_step * i_2 + PHI<vector-iv>
+
+ The first part of the adjustment to create i_1 and i_2 are done here
+ and the last part creating i_3 is done in
+ vectorizable_live_operations when the induction extraction is
+ materialized. */
+ if (LOOP_VINFO_EARLY_BREAKS (loop_vinfo)
+ && !LOOP_VINFO_MASK_NITERS_PFA_OFFSET (loop_vinfo))
+ {
+ auto skip_niters = LOOP_VINFO_MASK_SKIP_NITERS (loop_vinfo);
+ tree ty_skip_niters = TREE_TYPE (skip_niters);
+ tree break_lhs_phi = vect_get_new_vect_var (ty_skip_niters,
+ vect_scalar_var,
+ "pfa_iv_offset");
+ gphi *nphi = create_phi_node (break_lhs_phi, bb);
+ add_phi_arg (nphi, skip_niters, pe, UNKNOWN_LOCATION);
+ add_phi_arg (nphi, build_zero_cst (ty_skip_niters),
+ loop_latch_edge (iv_loop), UNKNOWN_LOCATION);
+
+ LOOP_VINFO_MASK_NITERS_PFA_OFFSET (loop_vinfo)
+ = PHI_RESULT (nphi);
+ }
}
tree step_mul = NULL_TREE;
unsigned ivn;
@@ -11565,8 +11619,10 @@ vectorizable_live_operation (vec_info *vinfo, stmt_vec_info stmt_info,
/* For early exit where the exit is not in the BB that leads
to the latch then we're restarting the iteration in the
scalar loop. So get the first live value. */
- if ((all_exits_as_early_p || !main_exit_edge)
- && STMT_VINFO_DEF_TYPE (stmt_info) == vect_induction_def)
+ bool early_break_first_element_p
+ = (all_exits_as_early_p || !main_exit_edge)
+ && STMT_VINFO_DEF_TYPE (stmt_info) == vect_induction_def;
+ if (early_break_first_element_p)
{
tmp_vec_lhs = vec_lhs0;
tmp_bitstart = build_zero_cst (TREE_TYPE (bitstart));
@@ -11581,6 +11637,45 @@ vectorizable_live_operation (vec_info *vinfo, stmt_vec_info stmt_info,
lhs_type, &exit_gsi);
auto gsi = gsi_for_stmt (use_stmt);
+ if (early_break_first_element_p
+ && LOOP_VINFO_MASK_NITERS_PFA_OFFSET (loop_vinfo))
+ {
+ tree step_expr
+ = STMT_VINFO_LOOP_PHI_EVOLUTION_PART (stmt_info);
+ tree break_lhs_phi
+ = LOOP_VINFO_MASK_NITERS_PFA_OFFSET (loop_vinfo);
+ tree ty_skip_niters = TREE_TYPE (break_lhs_phi);
+ gimple_seq iv_stmts = NULL;
+
+ /* Now create the PHI for the outside loop usage to
+ retrieve the value for the offset counter. */
+ tree rphi_step
+ = gimple_convert (&iv_stmts, ty_skip_niters, step_expr);
+ tree tmp2
+ = gimple_build (&iv_stmts, MULT_EXPR,
+ ty_skip_niters, rphi_step,
+ break_lhs_phi);
+
+ if (POINTER_TYPE_P (TREE_TYPE (new_tree)))
+ {
+ tmp2 = gimple_convert (&iv_stmts, sizetype, tmp2);
+ tmp2 = gimple_build (&iv_stmts, POINTER_PLUS_EXPR,
+ TREE_TYPE (new_tree), new_tree,
+ tmp2);
+ }
+ else
+ {
+ tmp2 = gimple_convert (&iv_stmts, TREE_TYPE (new_tree),
+ tmp2);
+ tmp2 = gimple_build (&iv_stmts, PLUS_EXPR,
+ TREE_TYPE (new_tree), new_tree,
+ tmp2);
+ }
+
+ new_tree = tmp2;
+ gsi_insert_seq_before (&exit_gsi, iv_stmts, GSI_SAME_STMT);
+ }
+
tree lhs_phi = gimple_phi_result (use_stmt);
remove_phi_node (&gsi, false);
gimple *copy = gimple_build_assign (lhs_phi, new_tree);
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index ecb4a65..19beeed 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -1099,7 +1099,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
tree first_lhs = NULL_TREE;
tree first_op1 = NULL_TREE;
stmt_vec_info first_load = NULL, prev_first_load = NULL;
- bool first_stmt_ldst_p = false;
+ bool first_stmt_ldst_p = false, first_stmt_ldst_masklen_p = false;
bool first_stmt_phi_p = false;
int first_reduc_idx = -1;
bool maybe_soft_fail = false;
@@ -1133,6 +1133,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
FOR_EACH_VEC_ELT (stmts, i, stmt_info)
{
bool ldst_p = false;
+ bool ldst_masklen_p = false;
bool phi_p = false;
code_helper rhs_code = ERROR_MARK;
@@ -1195,17 +1196,22 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
else
rhs_code = CALL_EXPR;
- if (cfn == CFN_MASK_LOAD
- || cfn == CFN_GATHER_LOAD
- || cfn == CFN_MASK_GATHER_LOAD
- || cfn == CFN_MASK_LEN_GATHER_LOAD
- || cfn == CFN_SCATTER_STORE
- || cfn == CFN_MASK_SCATTER_STORE
- || cfn == CFN_MASK_LEN_SCATTER_STORE)
+ if (cfn == CFN_GATHER_LOAD
+ || cfn == CFN_SCATTER_STORE)
ldst_p = true;
+ else if (cfn == CFN_MASK_LOAD
+ || cfn == CFN_MASK_GATHER_LOAD
+ || cfn == CFN_MASK_LEN_GATHER_LOAD
+ || cfn == CFN_MASK_SCATTER_STORE
+ || cfn == CFN_MASK_LEN_SCATTER_STORE)
+ {
+ ldst_p = true;
+ ldst_masklen_p = true;
+ }
else if (cfn == CFN_MASK_STORE)
{
ldst_p = true;
+ ldst_masklen_p = true;
rhs_code = CFN_MASK_STORE;
}
else if (cfn == CFN_GOMP_SIMD_LANE)
@@ -1246,6 +1252,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
first_lhs = lhs;
first_stmt_code = rhs_code;
first_stmt_ldst_p = ldst_p;
+ first_stmt_ldst_masklen_p = ldst_masklen_p;
first_stmt_phi_p = phi_p;
first_reduc_idx = STMT_VINFO_REDUC_IDX (stmt_info);
@@ -1364,6 +1371,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
&& (STMT_VINFO_GATHER_SCATTER_P (stmt_info)
!= STMT_VINFO_GATHER_SCATTER_P (first_stmt_info)))
|| first_stmt_ldst_p != ldst_p
+ || (ldst_p && first_stmt_ldst_masklen_p != ldst_masklen_p)
|| first_stmt_phi_p != phi_p)
{
if (dump_enabled_p ())
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 7f87435..5af1973 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -13615,29 +13615,23 @@ vectorizable_early_exit (vec_info *vinfo, stmt_vec_info stmt_info,
codegen so we must replace the original insn. */
gimple *orig_stmt = STMT_VINFO_STMT (vect_orig_stmt (stmt_info));
gcond *cond_stmt = as_a <gcond *>(orig_stmt);
+
+ tree cst = build_zero_cst (vectype);
+ auto bb = gimple_bb (cond_stmt);
+ edge exit_true_edge = EDGE_SUCC (bb, 0);
+ if (exit_true_edge->flags & EDGE_FALSE_VALUE)
+ exit_true_edge = EDGE_SUCC (bb, 1);
+ gcc_assert (exit_true_edge->flags & EDGE_TRUE_VALUE);
+
/* When vectorizing we assume that if the branch edge is taken that we're
exiting the loop. This is not however always the case as the compiler will
rewrite conditions to always be a comparison against 0. To do this it
sometimes flips the edges. This is fine for scalar, but for vector we
- then have to flip the test, as we're still assuming that if you take the
- branch edge that we found the exit condition. i.e. we need to know whether
- we are generating a `forall` or an `exist` condition. */
- auto new_code = NE_EXPR;
- auto reduc_optab = ior_optab;
- auto reduc_op = BIT_IOR_EXPR;
- tree cst = build_zero_cst (vectype);
- edge exit_true_edge = EDGE_SUCC (gimple_bb (cond_stmt), 0);
- if (exit_true_edge->flags & EDGE_FALSE_VALUE)
- exit_true_edge = EDGE_SUCC (gimple_bb (cond_stmt), 1);
- gcc_assert (exit_true_edge->flags & EDGE_TRUE_VALUE);
- if (flow_bb_inside_loop_p (LOOP_VINFO_LOOP (loop_vinfo),
- exit_true_edge->dest))
- {
- new_code = EQ_EXPR;
- reduc_optab = and_optab;
- reduc_op = BIT_AND_EXPR;
- cst = build_minus_one_cst (vectype);
- }
+ then have to negate the result of the test, as we're still assuming that if
+ you take the branch edge that we found the exit condition. i.e. we need to
+ know whether we are generating a `forall` or an `exist` condition. */
+ bool flipped = flow_bb_inside_loop_p (LOOP_VINFO_LOOP (loop_vinfo),
+ exit_true_edge->dest);
/* Analyze only. */
if (!vec_stmt)
@@ -13653,14 +13647,13 @@ vectorizable_early_exit (vec_info *vinfo, stmt_vec_info stmt_info,
}
if (ncopies > 1
- && direct_optab_handler (reduc_optab, mode) == CODE_FOR_nothing)
+ && direct_optab_handler (ior_optab, mode) == CODE_FOR_nothing)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"can't vectorize early exit because the "
- "target does not support boolean vector %s "
+ "target does not support boolean vector IOR "
"for type %T.\n",
- reduc_optab == ior_optab ? "OR" : "AND",
vectype);
return false;
}
@@ -13720,6 +13713,29 @@ vectorizable_early_exit (vec_info *vinfo, stmt_vec_info stmt_info,
stmts.quick_push (gimple_assign_lhs (stmt));
}
+ /* If we're comparing against a previous forall we need to negate the resullts
+ before we do the final comparison or reduction. */
+ if (flipped)
+ {
+ /* Rewrite the if(all(mask)) into if (!all(mask)) which is the same as
+ if (any(~mask)) by negating the masks and flipping the branches.
+
+ 1. For unmasked loops we simply reduce the ~mask.
+ 2. For masked loops we reduce (~mask & loop_mask) which is the same as
+ doing (mask & loop_mask) ^ loop_mask. */
+ for (unsigned i = 0; i < stmts.length (); i++)
+ {
+ tree inv_lhs = make_temp_ssa_name (vectype, NULL, "vexit_inv");
+ auto inv_stmt = gimple_build_assign (inv_lhs, BIT_NOT_EXPR, stmts[i]);
+ vect_finish_stmt_generation (loop_vinfo, stmt_info, inv_stmt,
+ &cond_gsi);
+ stmts[i] = inv_lhs;
+ }
+
+ EDGE_SUCC (bb, 0)->flags ^= (EDGE_TRUE_VALUE|EDGE_FALSE_VALUE);
+ EDGE_SUCC (bb, 1)->flags ^= (EDGE_TRUE_VALUE|EDGE_FALSE_VALUE);
+ }
+
/* Determine if we need to reduce the final value. */
if (stmts.length () > 1)
{
@@ -13758,7 +13774,7 @@ vectorizable_early_exit (vec_info *vinfo, stmt_vec_info stmt_info,
new_temp = make_temp_ssa_name (vectype, NULL, "vexit_reduc");
tree arg0 = workset.pop ();
tree arg1 = workset.pop ();
- new_stmt = gimple_build_assign (new_temp, reduc_op, arg0, arg1);
+ new_stmt = gimple_build_assign (new_temp, BIT_IOR_EXPR, arg0, arg1);
vect_finish_stmt_generation (loop_vinfo, stmt_info, new_stmt,
&cond_gsi);
workset.quick_insert (0, new_temp);
@@ -13781,7 +13797,7 @@ vectorizable_early_exit (vec_info *vinfo, stmt_vec_info stmt_info,
gcc_assert (new_temp);
- gimple_cond_set_condition (cond_stmt, new_code, new_temp, cst);
+ gimple_cond_set_condition (cond_stmt, NE_EXPR, new_temp, cst);
update_stmt (orig_stmt);
if (slp_node)
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 97caf61..01d19c7 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -818,6 +818,11 @@ public:
elements that should be false in the first mask). */
tree mask_skip_niters;
+ /* If we are using a loop mask to align memory addresses and we're in an
+ early break loop then this variable contains the number of elements that
+ were skipped during the initial iteration of the loop. */
+ tree mask_skip_niters_pfa_offset;
+
/* The type that the loop control IV should be converted to before
testing which of the VF scalars are active and inactive.
Only meaningful if LOOP_VINFO_USING_PARTIAL_VECTORS_P. */
@@ -854,6 +859,9 @@ public:
/* The mask used to check the alignment of pointers or arrays. */
int ptr_mask;
+ /* Indicates whether the loop has any non-linear IV. */
+ bool nonlinear_iv;
+
/* Data Dependence Relations defining address ranges that are candidates
for a run-time aliasing check. */
auto_vec<ddr_p> may_alias_ddrs;
@@ -1064,6 +1072,7 @@ public:
#define LOOP_VINFO_MASKS(L) (L)->masks
#define LOOP_VINFO_LENS(L) (L)->lens
#define LOOP_VINFO_MASK_SKIP_NITERS(L) (L)->mask_skip_niters
+#define LOOP_VINFO_MASK_NITERS_PFA_OFFSET(L) (L)->mask_skip_niters_pfa_offset
#define LOOP_VINFO_RGROUP_COMPARE_TYPE(L) (L)->rgroup_compare_type
#define LOOP_VINFO_RGROUP_IV_TYPE(L) (L)->rgroup_iv_type
#define LOOP_VINFO_PARTIAL_VECTORS_STYLE(L) (L)->partial_vector_style
@@ -1073,6 +1082,7 @@ public:
#define LOOP_VINFO_DDRS(L) (L)->shared->ddrs
#define LOOP_VINFO_INT_NITERS(L) (TREE_INT_CST_LOW ((L)->num_iters))
#define LOOP_VINFO_PEELING_FOR_ALIGNMENT(L) (L)->peeling_for_alignment
+#define LOOP_VINFO_NON_LINEAR_IV(L) (L)->nonlinear_iv
#define LOOP_VINFO_UNALIGNED_DR(L) (L)->unaligned_dr
#define LOOP_VINFO_MAY_MISALIGN_STMTS(L) (L)->may_misalign_stmts
#define LOOP_VINFO_MAY_ALIAS_DDRS(L) (L)->may_alias_ddrs
@@ -2138,8 +2148,14 @@ unlimited_cost_model (loop_p loop)
inline bool
vect_use_loop_mask_for_alignment_p (loop_vec_info loop_vinfo)
{
+ /* With early break vectorization we don't know whether the accesses will stay
+ inside the loop or not. TODO: The early break adjustment code can be
+ implemented the same way as vectorizable_linear_induction. However we
+ can't test this today so reject it. */
return (LOOP_VINFO_FULLY_MASKED_P (loop_vinfo)
- && LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo));
+ && LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo)
+ && !(LOOP_VINFO_NON_LINEAR_IV (loop_vinfo)
+ && LOOP_VINFO_EARLY_BREAKS (loop_vinfo)));
}
/* Return the number of vectors of type VECTYPE that are needed to get
diff --git a/gcc/tree.def b/gcc/tree.def
index c4ad8d0..2c37e44 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -135,7 +135,11 @@ DEFTREECODE (OFFSET_TYPE, "offset_type", tcc_type, 0)
DEFTREECODE (ENUMERAL_TYPE, "enumeral_type", tcc_type, 0)
/* Boolean type (true or false are the only values). Looks like an
- INTEGRAL_TYPE. */
+ INTEGER_TYPE, but must be dealt with specially because TYPE_PRECISION
+ may be arbitrary despite the restricted set of valid values (in other
+ words, boolean types with TYPE_PRECISION > 1 exist in some languages).
+ Similarly, TYPE_UNSIGNED may be false for components of vector masks,
+ as well as for boolean types in languages other than C. */
DEFTREECODE (BOOLEAN_TYPE, "boolean_type", tcc_type, 0)
/* Integer types in all languages, including char in C.
diff --git a/libatomic/ChangeLog b/libatomic/ChangeLog
index ac7e729..62e6c4e 100644
--- a/libatomic/ChangeLog
+++ b/libatomic/ChangeLog
@@ -1,3 +1,23 @@
+2025-04-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR libgcc/101075
+ PR libgcc/119796
+ * config/mingw/lock.c (libat_lock_n, libat_unlock_n): Start with
+ computing how many locks will be needed and take into account
+ ((uintptr_t)ptr % WATCH_SIZE). If some locks from the end of the
+ locks array and others from the start of it will be needed, first
+ lock the ones from the start followed by ones from the end.
+
+2025-04-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR libgcc/101075
+ PR libgcc/119796
+ * config/posix/lock.c (libat_lock_n, libat_unlock_n): Start with
+ computing how many locks will be needed and take into account
+ ((uintptr_t)ptr % WATCH_SIZE). If some locks from the end of the
+ locks array and others from the start of it will be needed, first
+ lock the ones from the start followed by ones from the end.
+
2025-01-10 Wilco Dijkstra <wilco.dijkstra@arm.com>
* config/linux/aarch64/host-config.h (has_lse2): Cleanup.
diff --git a/libatomic/config/mingw/lock.c b/libatomic/config/mingw/lock.c
index 17faa66..8b0b4dd 100644
--- a/libatomic/config/mingw/lock.c
+++ b/libatomic/config/mingw/lock.c
@@ -87,21 +87,30 @@ libat_lock_n (void *ptr, size_t n)
{
uintptr_t h = addr_hash (ptr);
size_t i = 0;
+ size_t nlocks
+ = (n + ((uintptr_t)ptr % WATCH_SIZE) + WATCH_SIZE - 1) / WATCH_SIZE;
/* Don't lock more than all the locks we have. */
- if (n > PAGE_SIZE)
- n = PAGE_SIZE;
+ if (nlocks > NLOCKS)
+ nlocks = NLOCKS;
- do
+ if (__builtin_expect (h + nlocks > NLOCKS, 0))
+ {
+ size_t j = h + nlocks - NLOCKS;
+ for (; i < j; ++i)
+ {
+ if (!locks[i].mutex)
+ locks[i].mutex = CreateMutex (NULL, FALSE, NULL);
+ WaitForSingleObject (locks[i].mutex, INFINITE);
+ }
+ }
+
+ for (; i < nlocks; ++i)
{
if (!locks[h].mutex)
- locks[h].mutex = CreateMutex (NULL, FALSE, NULL);
- WaitForSingleObject (locks[h].mutex, INFINITE);
- if (++h == NLOCKS)
- h = 0;
- i += WATCH_SIZE;
+ locks[h].mutex = CreateMutex (NULL, FALSE, NULL);
+ WaitForSingleObject (locks[h++].mutex, INFINITE);
}
- while (i < n);
}
void
@@ -109,17 +118,22 @@ libat_unlock_n (void *ptr, size_t n)
{
uintptr_t h = addr_hash (ptr);
size_t i = 0;
+ size_t nlocks
+ = (n + ((uintptr_t)ptr % WATCH_SIZE) + WATCH_SIZE - 1) / WATCH_SIZE;
- if (n > PAGE_SIZE)
- n = PAGE_SIZE;
+ /* Don't lock more than all the locks we have. */
+ if (nlocks > NLOCKS)
+ nlocks = NLOCKS;
- do
+ if (__builtin_expect (h + nlocks > NLOCKS, 0))
{
- if (locks[h].mutex)
- ReleaseMutex (locks[h].mutex);
- if (++h == NLOCKS)
- h = 0;
- i += WATCH_SIZE;
+ size_t j = h + nlocks - NLOCKS;
+ for (; i < j; ++i)
+ if (locks[i].mutex)
+ ReleaseMutex (locks[i].mutex);
}
- while (i < n);
+
+ for (; i < nlocks; ++i, ++h)
+ if (locks[h].mutex)
+ ReleaseMutex (locks[h].mutex);
}
diff --git a/libatomic/config/posix/lock.c b/libatomic/config/posix/lock.c
index 6ee4240..5662b77 100644
--- a/libatomic/config/posix/lock.c
+++ b/libatomic/config/posix/lock.c
@@ -81,19 +81,22 @@ libat_lock_n (void *ptr, size_t n)
{
uintptr_t h = addr_hash (ptr);
size_t i = 0;
+ size_t nlocks
+ = (n + ((uintptr_t)ptr % WATCH_SIZE) + WATCH_SIZE - 1) / WATCH_SIZE;
/* Don't lock more than all the locks we have. */
- if (n > PAGE_SIZE)
- n = PAGE_SIZE;
+ if (nlocks > NLOCKS)
+ nlocks = NLOCKS;
- do
+ if (__builtin_expect (h + nlocks > NLOCKS, 0))
{
- pthread_mutex_lock (&locks[h].mutex);
- if (++h == NLOCKS)
- h = 0;
- i += WATCH_SIZE;
+ size_t j = h + nlocks - NLOCKS;
+ for (; i < j; ++i)
+ pthread_mutex_lock (&locks[i].mutex);
}
- while (i < n);
+
+ for (; i < nlocks; ++i)
+ pthread_mutex_lock (&locks[h++].mutex);
}
void
@@ -101,16 +104,20 @@ libat_unlock_n (void *ptr, size_t n)
{
uintptr_t h = addr_hash (ptr);
size_t i = 0;
+ size_t nlocks
+ = (n + ((uintptr_t)ptr % WATCH_SIZE) + WATCH_SIZE - 1) / WATCH_SIZE;
- if (n > PAGE_SIZE)
- n = PAGE_SIZE;
+ /* Don't lock more than all the locks we have. */
+ if (nlocks > NLOCKS)
+ nlocks = NLOCKS;
- do
+ if (__builtin_expect (h + nlocks > NLOCKS, 0))
{
- pthread_mutex_unlock (&locks[h].mutex);
- if (++h == NLOCKS)
- h = 0;
- i += WATCH_SIZE;
+ size_t j = h + nlocks - NLOCKS;
+ for (; i < j; ++i)
+ pthread_mutex_unlock (&locks[i].mutex);
}
- while (i < n);
+
+ for (; i < nlocks; ++i)
+ pthread_mutex_unlock (&locks[h++].mutex);
}
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog
index 7761573..87abec9 100644
--- a/libbacktrace/ChangeLog
+++ b/libbacktrace/ChangeLog
@@ -1,3 +1,15 @@
+2025-04-10 John David Anglin <danglin@gcc.gnu.org>
+
+ * fileline.c (hpux_get_executable_path): New.
+ (fileline_initialize): Add pass to get hpux executable path.
+
+2025-04-09 Richard Biener <rguenther@suse.de>
+
+ PR bootstrap/119680
+ * configure.ac (--enable-host-pie): Handle by setting PIC_FLAG
+ to -fPIE.
+ * configure: Regenerate.
+
2025-04-07 Jonathan Wakely <jwakely@redhat.com>
* atomic.c (backtrace_atomic_store_int): Use int for old value.
diff --git a/libbacktrace/fileline.c b/libbacktrace/fileline.c
index c9fd86b..d2900aa 100644
--- a/libbacktrace/fileline.c
+++ b/libbacktrace/fileline.c
@@ -47,6 +47,10 @@ POSSIBILITY OF SUCH DAMAGE. */
#include <mach-o/dyld.h>
#endif
+#ifdef __hpux__
+#include <dl.h>
+#endif
+
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
@@ -66,6 +70,33 @@ POSSIBILITY OF SUCH DAMAGE. */
#define getexecname() NULL
#endif
+#ifdef __hpux__
+static char *
+hpux_get_executable_path (struct backtrace_state *state,
+ backtrace_error_callback error_callback, void *data)
+{
+ struct shl_descriptor *desc;
+ size_t len = sizeof (struct shl_descriptor);
+
+ desc = backtrace_alloc (state, len, error_callback, data);
+ if (desc == NULL)
+ return NULL;
+
+ if (shl_get_r (0, desc) == -1)
+ {
+ backtrace_free (state, desc, len, error_callback, data);
+ return NULL;
+ }
+
+ return desc->filename;
+}
+
+#else
+
+#define hpux_get_executable_path(state, error_callback, data) NULL
+
+#endif
+
#if !defined (HAVE_KERN_PROC_ARGS) && !defined (HAVE_KERN_PROC)
#define sysctl_exec_name1(state, error_callback, data) NULL
@@ -245,7 +276,7 @@ fileline_initialize (struct backtrace_state *state,
descriptor = -1;
called_error_callback = 0;
- for (pass = 0; pass < 10; ++pass)
+ for (pass = 0; pass < 11; ++pass)
{
int does_not_exist;
@@ -285,6 +316,9 @@ fileline_initialize (struct backtrace_state *state,
case 9:
filename = windows_get_executable_path (buf, error_callback, data);
break;
+ case 10:
+ filename = hpux_get_executable_path (state, error_callback, data);
+ break;
default:
abort ();
}
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index e2ed956..353227a 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/118674
+ * macro.cc (parse_params) <case CPP_ELLIPSIS>: If _cpp_save_parameter
+ failed for __VA_ARGS__, goto out.
+
2025-04-04 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/119391
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 9df44ba..66feed5 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,83 @@
+2025-04-19 Jiaxun Yang <jiaxun.yang@flygoat.com>
+
+ PR target/118257
+ * config/sh/sfp-machine.h (_FPU_GETCW): Implement with builtin.
+ (_FPU_SETCW): Likewise.
+ (FP_EX_ENABLE_SHIFT): Derive from arch spec.
+ (FP_EX_CAUSE_SHIFT): Likewise.
+ (FP_RND_MASK): Likewise.
+ (FP_EX_INVALID): Likewise.
+ (FP_EX_DIVZERO): Likewise.
+ (FP_EX_ALL): Likewise.
+ (FP_EX_OVERFLOW): Likewise.
+ (FP_EX_UNDERFLOW): Likewise.
+ (FP_EX_INEXACT): Likewise.
+ (_FP_DECL_EX): Declear default FCSR value.
+ (FP_RND_NEAREST): Derive from arch spec.
+ (FP_RND_ZERO): Likewise.
+ (FP_INIT_ROUNDMODE): Likewise.
+ (FP_ROUNDMODE): Likewise.
+ (FP_TRAPPING_EXCEPTIONS): Likewise.
+ (FP_HANDLE_EXCEPTIONS): Implement with _FPU_SETCW.
+
+2025-04-19 Jiaxun Yang <jiaxun.yang@flygoat.com>
+
+ PR target/111814
+ * config/sh/sfp-machine.h (_FP_NANFRAC_B): Reverse signaling bit.
+ (_FP_NANFRAC_H): Likewise.
+ (_FP_NANFRAC_S): Likewise.
+ (_FP_NANFRAC_D): Likewise.
+ (_FP_NANFRAC_Q): Likewise.
+ (_FP_KEEPNANFRACP): Enable for target.
+ (_FP_QNANNEGATEDP): Enable for target.
+ (_FP_CHOOSENAN): Port from MIPS.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR target/118794
+ * config/gcn/unwind-gcn.c (_Unwind_Resume): New.
+ * config/nvptx/unwind-nvptx.c (_Unwind_Resume): Likewise.
+
+2025-04-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/119673
+ * config/i386/gthr-win32.h (__GTHREAD_ALWAYS_INLINE): New macro.
+ (__GTHREAD_INLINE): Likewise.
+ (__GTHR_W32_InterlockedCompareExchange): Delete.
+ (__gthread_active_p): Mark as __GTHREAD_INLINE instead of
+ static inline.
+ (__gthread_create): Likewise.
+ (__gthread_join): Likewise.
+ (__gthread_self): Likewise.
+ (__gthread_detach): Likewise.
+ (__gthread_equal): Likewise.
+ (__gthread_yield): Likewise.
+ (__gthread_once): Likewise.
+ (__gthread_key_create): Likewise.
+ (__gthread_key_delete): Likewise.
+ (__gthread_getspecific): Likewise.
+ (__gthread_setspecific): Likewise.
+ (__gthread_mutex_init_function): Likewise.
+ (__gthread_mutex_destroy): Likewise.
+ (__gthread_mutex_lock): Likewise.
+ (__gthread_mutex_trylock): Likewise.
+ (__gthread_mutex_timedlock): Likewise.
+ (__gthread_mutex_unlock): Likewise.
+ (__gthread_recursive_mutex_trylock): Likewise.
+ (__gthread_cond_init_function): Likewise.
+ (__gthread_cond_broadcast): Likewise.
+ (__gthread_cond_signal): Likewise.
+ (__gthread_cond_wait): Likewise.
+ (__gthread_cond_timedwait): Likewise.
+ (__GTHREAD_WIN32_INLINE): Likewise.
+ (__GTHREAD_WIN32_COND_INLINE): Likewise.
+ (__gthread_recursive_mutex_init_function): Likewise.
+ (__gthread_recursive_mutex_destroy): Likewise.
+ (__gthread_recursive_mutex_lock): Likewise.
+ (__gthread_recursive_mutex_unlock): Likewise.
+ (__gthread_cond_destroy): Likewise.
+ (__gthread_cond_wait_recursive): Likewise.
+
2025-04-08 Thomas Schwinge <tschwinge@baylibre.com>
* config/gcn/unwind-gcn.c (_Unwind_RaiseException)
diff --git a/libgcc/config/gcn/unwind-gcn.c b/libgcc/config/gcn/unwind-gcn.c
index eae741c..97e22c0 100644
--- a/libgcc/config/gcn/unwind-gcn.c
+++ b/libgcc/config/gcn/unwind-gcn.c
@@ -38,6 +38,12 @@ _Unwind_DeleteException (struct _Unwind_Exception *exc)
(*exc->exception_cleanup) (_URC_FOREIGN_EXCEPTION_CAUGHT, exc);
}
+void
+_Unwind_Resume (struct _Unwind_Exception *exc __attribute__ ((__unused__)))
+{
+ __builtin_abort ();
+}
+
_Unwind_Reason_Code
_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc __attribute__ ((__unused__)))
{
diff --git a/libgcc/config/i386/gthr-win32.h b/libgcc/config/i386/gthr-win32.h
index 98e11b4..34988d4 100644
--- a/libgcc/config/i386/gthr-win32.h
+++ b/libgcc/config/i386/gthr-win32.h
@@ -71,6 +71,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#error Timed lock primitives are not supported on Windows targets
#endif
+#ifdef __has_attribute
+# if __has_attribute(__always_inline__)
+# define __GTHREAD_ALWAYS_INLINE __attribute__((__always_inline__))
+# endif
+#endif
+#ifndef __GTHREAD_ALWAYS_INLINE
+# define __GTHREAD_ALWAYS_INLINE
+#endif
+
+#ifdef __cplusplus
+# define __GTHREAD_INLINE inline __GTHREAD_ALWAYS_INLINE
+#else
+# define __GTHREAD_INLINE static inline
+#endif
+
/* Make sure CONST_CAST2 (origin in system.h) is declared. */
#ifndef CONST_CAST2
#ifdef __cplusplus
@@ -398,11 +413,7 @@ extern int _CRT_MT;
extern int __mingwthr_key_dtor (unsigned long, void (*) (void *));
#endif /* _WIN32 && !__CYGWIN__ */
-/* __GTHR_W32_InterlockedCompareExchange is left over from win95,
- which did not support InterlockedCompareExchange. */
-#define __GTHR_W32_InterlockedCompareExchange InterlockedCompareExchange
-
-static inline int
+__GTHREAD_INLINE int
__gthread_active_p (void)
{
#ifdef MINGW32_SUPPORTS_MT_EH
@@ -438,20 +449,20 @@ extern int __gthr_win32_cond_timedwait (__gthread_cond_t *, __gthread_mutex_t *,
const __gthread_time_t *);
#endif
-static inline int
+__GTHREAD_INLINE int
__gthread_create (__gthread_t *__thr, void *(*__func) (void*),
void *__args)
{
return __gthr_win32_create (__thr, __func, __args);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_join (__gthread_t __thr, void **__value_ptr)
{
return __gthr_win32_join (__thr, __value_ptr);
}
-static inline __gthread_t
+__GTHREAD_INLINE __gthread_t
__gthread_self (void)
{
return __gthr_win32_self ();
@@ -463,25 +474,25 @@ __gthread_self (void)
Only stubs are exposed to avoid polluting the C++ namespace with
Win32 API definitions. */
-static inline int
+__GTHREAD_INLINE int
__gthread_detach (__gthread_t __thr)
{
return __gthr_win32_detach (__thr);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_equal (__gthread_t __thr1, __gthread_t __thr2)
{
return __gthr_win32_equal (__thr1, __thr2);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_yield (void)
{
return __gthr_win32_yield ();
}
-static inline int
+__GTHREAD_INLINE int
__gthread_once (__gthread_once_t *__once, void (*__func) (void))
{
if (__gthread_active_p ())
@@ -490,43 +501,43 @@ __gthread_once (__gthread_once_t *__once, void (*__func) (void))
return -1;
}
-static inline int
+__GTHREAD_INLINE int
__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
{
return __gthr_win32_key_create (__key, __dtor);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_key_delete (__gthread_key_t __key)
{
return __gthr_win32_key_delete (__key);
}
-static inline void *
+__GTHREAD_INLINE void *
__gthread_getspecific (__gthread_key_t __key)
{
return __gthr_win32_getspecific (__key);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
{
return __gthr_win32_setspecific (__key, __ptr);
}
-static inline void
+__GTHREAD_INLINE void
__gthread_mutex_init_function (__gthread_mutex_t *__mutex)
{
__gthr_win32_mutex_init_function (__mutex);
}
-static inline void
+__GTHREAD_INLINE void
__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
{
__gthr_win32_mutex_destroy (__mutex);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_mutex_lock (__gthread_mutex_t *__mutex)
{
if (__gthread_active_p ())
@@ -535,7 +546,7 @@ __gthread_mutex_lock (__gthread_mutex_t *__mutex)
return 0;
}
-static inline int
+__GTHREAD_INLINE int
__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
{
if (__gthread_active_p ())
@@ -544,7 +555,7 @@ __gthread_mutex_trylock (__gthread_mutex_t *__mutex)
return 0;
}
-static inline int
+__GTHREAD_INLINE int
__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
{
if (__gthread_active_p ())
@@ -553,7 +564,7 @@ __gthread_mutex_unlock (__gthread_mutex_t *__mutex)
return 0;
}
-static inline int
+__GTHREAD_INLINE int
__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
{
if (__gthread_active_p ())
@@ -564,31 +575,31 @@ __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
#if __GTHREAD_HAS_COND
-static inline void
+__GTHREAD_INLINE void
__gthread_cond_init_function (__gthread_cond_t *__cond)
{
__gthr_win32_cond_init_function (__cond);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_cond_broadcast (__gthread_cond_t *__cond)
{
return __gthr_win32_cond_broadcast (__cond);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_cond_signal (__gthread_cond_t *__cond)
{
return __gthr_win32_cond_signal (__cond);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
{
return __gthr_win32_cond_wait (__cond, __mutex);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
const __gthread_time_t *__abs_time)
{
@@ -600,11 +611,11 @@ __gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
#else /* ! __GTHREAD_HIDE_WIN32API */
#ifndef __GTHREAD_WIN32_INLINE
-#define __GTHREAD_WIN32_INLINE static inline
+#define __GTHREAD_WIN32_INLINE __GTHREAD_INLINE
#endif
#ifndef __GTHREAD_WIN32_COND_INLINE
-#define __GTHREAD_WIN32_COND_INLINE static inline
+#define __GTHREAD_WIN32_COND_INLINE __GTHREAD_INLINE
#endif
#ifndef __GTHREAD_WIN32_ACTIVE_P
@@ -828,25 +839,25 @@ __gthread_cond_timedwait (__gthread_cond_t *__cond,
#endif /* __GTHREAD_HIDE_WIN32API */
-static inline void
+__GTHREAD_INLINE void
__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
{
__gthread_mutex_init_function (__mutex);
}
-static inline void
+__GTHREAD_INLINE void
__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex)
{
__gthread_mutex_destroy (__mutex);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
{
return __gthread_mutex_lock (__mutex);
}
-static inline int
+__GTHREAD_INLINE int
__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
{
return __gthread_mutex_unlock (__mutex);
@@ -854,13 +865,13 @@ __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
#if __GTHREAD_HAS_COND
-static inline int
+__GTHREAD_INLINE int
__gthread_cond_destroy (__gthread_cond_t *__cond ATTRIBUTE_UNUSED)
{
return 0;
}
-static inline int
+__GTHREAD_INLINE int
__gthread_cond_wait_recursive (__gthread_cond_t *__cond,
__gthread_recursive_mutex_t *__mutex)
{
diff --git a/libgcc/config/nvptx/unwind-nvptx.c b/libgcc/config/nvptx/unwind-nvptx.c
index eae741c..97e22c0 100644
--- a/libgcc/config/nvptx/unwind-nvptx.c
+++ b/libgcc/config/nvptx/unwind-nvptx.c
@@ -38,6 +38,12 @@ _Unwind_DeleteException (struct _Unwind_Exception *exc)
(*exc->exception_cleanup) (_URC_FOREIGN_EXCEPTION_CAUGHT, exc);
}
+void
+_Unwind_Resume (struct _Unwind_Exception *exc __attribute__ ((__unused__)))
+{
+ __builtin_abort ();
+}
+
_Unwind_Reason_Code
_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc __attribute__ ((__unused__)))
{
diff --git a/libgcc/config/sh/sfp-machine.h b/libgcc/config/sh/sfp-machine.h
index 66984d4..8030c80 100644
--- a/libgcc/config/sh/sfp-machine.h
+++ b/libgcc/config/sh/sfp-machine.h
@@ -39,11 +39,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
-#define _FP_NANFRAC_B _FP_QNANBIT_B
-#define _FP_NANFRAC_H _FP_QNANBIT_H
-#define _FP_NANFRAC_S _FP_QNANBIT_S
-#define _FP_NANFRAC_D _FP_QNANBIT_D, 0
-#define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0, 0, 0
+#define _FP_NANFRAC_B (_FP_QNANBIT_B - 1)
+#define _FP_NANFRAC_H (_FP_QNANBIT_H - 1)
+#define _FP_NANFRAC_S (_FP_QNANBIT_S - 1)
+#define _FP_NANFRAC_D (_FP_QNANBIT_D - 1), -1
+#define _FP_NANFRAC_Q (_FP_QNANBIT_Q - 1), -1, -1, -1
/* The type of the result of a floating point comparison. This must
match __libgcc_cmp_return__ in GCC for the target. */
@@ -56,15 +56,71 @@ typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
#define _FP_NANSIGN_D 0
#define _FP_NANSIGN_Q 0
-#define _FP_KEEPNANFRACP 0
-#define _FP_QNANNEGATEDP 0
+#define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 1
+
+/* X is chosen unless one of the NaNs is sNaN. */
+# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do { \
+ if ((_FP_FRAC_HIGH_RAW_##fs(X) | \
+ _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \
+ { \
+ R##_s = _FP_NANSIGN_##fs; \
+ _FP_FRAC_SET_##wc(R,_FP_NANFRAC_##fs); \
+ } \
+ else \
+ { \
+ R##_s = X##_s; \
+ _FP_FRAC_COPY_##wc(R,X); \
+ } \
+ R##_c = FP_CLS_NAN; \
+ } while (0)
+
+#ifdef __SH_FPU_ANY__
+#define _FPU_GETCW(fpscr) fpscr = __builtin_sh_get_fpscr ()
+#define _FPU_SETCW(fpscr) __builtin_sh_set_fpscr (fpscr)
+#define FP_EX_ENABLE_SHIFT 5
+#define FP_EX_CAUSE_SHIFT 10
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
- do { \
- R##_s = _FP_NANSIGN_##fs; \
- _FP_FRAC_SET_##wc(R,_FP_NANFRAC_##fs); \
- R##_c = FP_CLS_NAN; \
+#define FP_EX_INVALID 0x0040
+#define FP_EX_DIVZERO 0x0020
+#if defined (__SH2E__)
+#define FP_EX_ALL (FP_EX_DIVZERO | FP_EX_INVALID)
+#else
+#define FP_EX_OVERFLOW 0x0010
+#define FP_EX_UNDERFLOW 0x0008
+#define FP_EX_INEXACT 0x0004
+#define FP_EX_ALL (FP_EX_DIVZERO | FP_EX_INEXACT | \
+ FP_EX_INVALID | FP_EX_OVERFLOW | FP_EX_UNDERFLOW)
+#endif
+#define _FP_DECL_EX \
+ unsigned int _fcsr __attribute__ ((unused)) = FP_RND_NEAREST
+/* Rounding modes. */
+#define FP_RND_NEAREST 0x0
+#define FP_RND_ZERO 0x1
+/* Placeholder, hardware does not have PINF/MINF modes. */
+#define FP_RND_PINF 0x2
+#define FP_RND_MINF 0x3
+#define FP_RND_MASK 3
+
+#define FP_INIT_ROUNDMODE _FPU_GETCW (_fcsr)
+#define FP_ROUNDMODE (_fcsr & FP_RND_MASK)
+#define FP_TRAPPING_EXCEPTIONS ((_fcsr >> FP_EX_ENABLE_SHIFT) & FP_EX_ALL)
+#define FP_HANDLE_EXCEPTIONS \
+ do { \
+ _fcsr &= ~(FP_EX_ALL << FP_EX_CAUSE_SHIFT); \
+ _fcsr |= _fex | (_fex << FP_EX_CAUSE_SHIFT); \
+ _FPU_SETCW (_fcsr); \
} while (0)
+#else
+#define FP_EX_INVALID (1 << 4)
+#define FP_EX_DIVZERO (1 << 3)
+#if !defined (__SH2E__)
+#define FP_EX_OVERFLOW (1 << 2)
+#define FP_EX_UNDERFLOW (1 << 1)
+#define FP_EX_INEXACT (1 << 0)
+#endif
+#endif
#define _FP_TININESS_AFTER_ROUNDING 1
diff --git a/libgcobol/ChangeLog b/libgcobol/ChangeLog
index 28cd912..6a0e961 100644
--- a/libgcobol/ChangeLog
+++ b/libgcobol/ChangeLog
@@ -1,3 +1,81 @@
+2025-04-15 Andreas Schwab <schwab@suse.de>
+
+ * configure.tgt: Set LIBGCOBOL_SUPPORTED for riscv64-*-linux* with
+ 64-bit multilib.
+
+2025-04-15 Jakub Jelinek <jakub@redhat.com>
+ Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR cobol/119244
+ * acinclude.m4 (LIBGCOBOL_CHECK_FLOAT128): Ensure
+ libgcob_cv_have_float128 is not yes on targets with IEEE quad
+ long double. Don't check for --as-needed nor set LIBQUADSPEC
+ on targets which USE_IEC_60559.
+ * libgcobol-fp.h (FP128_FMT, strtofp128, strfromfp128): Define.
+ * intrinsic.cc (strtof128): Don't redefine.
+ (WEIRD_TRANSCENDENT_RETURN_VALUE): Use GCOB_FP128_LITERAL macro.
+ (__gg__numval_f): Use strtofp128 instead of strtof128.
+ * libgcobol.cc (strtof128): Don't redefine.
+ (format_for_display_internal): Use strfromfp128 instead of
+ strfromf128 or quadmath_snprintf and use FP128_FMT in the format
+ string.
+ (get_float128, __gg__compare_2, __gg__move, __gg__move_literala):
+ Use strtofp128 instead of strtof128.
+ * configure: Regenerate.
+
+2025-04-14 Andreas Schwab <schwab@suse.de>
+
+ * libgcobol.cc (__gg__float64_from_128): Mark literal as float128
+ literal.
+
+2025-04-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * valconv.cc (__gg__string_to_numeric_edited): Use strchr instead
+ of index.
+
+2025-04-12 Bob Dubner <rdubner@symas.com>
+
+ PR cobol/119694
+ * gfileio.cc: Eliminate getenv() calls.
+ * libgcobol.cc: Likewise.
+
+2025-04-10 Iain Sandoe <iain@sandoe.co.uk>
+
+ * configure.tgt: Enable for x86_64 Darwin.
+
+2025-04-10 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR cobol/119244
+ * Makefile.am: Add support for libquadmath.
+ * Makefile.in: Regenerate.
+ * acinclude.m4: Add support for libquadmath.
+ * config.h.in: Regenerate.
+ * configure: Regenerate.
+ * configure.ac: Configure libquadmath support.
+ * gmath.cc: Use GCOB_FP128 to represent the configured
+ 128b floating point type. Use FP128_FUNC to represent
+ the naming of intrinsics in the configure 128b floating
+ point type. Render literals with GCOB_FP128_LITERAL.
+ * intrinsic.cc: Likewise.
+ * libgcobol.cc: Likewise.
+ * libgcobol.h: Likewise.
+ * libgcobol-fp.h: New file.
+ * gfileio.cc: Include libgcobol-fp.h.
+ * libgcobol.spec.in: Add libquadmath configure output.
+
+2025-04-09 Bob Dubner <rdubner@symas.com>
+
+ PR cobol/119682
+ * common-defs.h: Define the REFER_T_REFMOD constant.
+ * intrinsic.cc: (__gg__max): Change the calls to __gg__compare_2(),
+ (__gg__min): Likewise, (__gg__ord_min): Likewise,
+ (__gg__ord_max): Likewise.
+ * libgcobol.cc: (__gg__compare_2): Change definition of calling
+ parameters, eliminate separate flag bit for ALL and ADDRESS_OF,
+ change comparison of alphanumeric to numeric when the numeric
+ is a refmod.
+ * libgcobol.h: Change declaration of __gg__compare_2.
+
2025-04-05 Iain Sandoe <iain@sandoe.co.uk>
* Makefile.am: Add libgcobol.spec and dependency.
diff --git a/libgcobol/Makefile.am b/libgcobol/Makefile.am
index 89d0519..0a17d20 100644
--- a/libgcobol/Makefile.am
+++ b/libgcobol/Makefile.am
@@ -46,7 +46,7 @@ libgcobol_la_SOURCES = \
WARN_CFLAGS = -W -Wall -Wwrite-strings
-AM_CPPFLAGS = -I. -I$(srcdir)
+AM_CPPFLAGS = -I. -I$(srcdir) $(LIBQUADINCLUDE)
AM_CFLAGS = $(XCFLAGS)
AM_CXXFLAGS = $(XCFLAGS)
AM_CXXFLAGS += $(WARN_CFLAGS)
@@ -62,9 +62,8 @@ endif
# We want to link with the c++ runtime.
libgcobol_la_LINK = $(CXXLINK) $(libgcobol_la_LDFLAGS)
version_arg = -version-info $(LIBGCOBOL_VERSION)
-libgcobol_la_LDFLAGS = $(LTLDFLAGS) $(LTLIBICONV) \
- $(extra_ldflags_libgcobol) $(LIBS) \
- $(version_arg)
-libgcobol_la_DEPENDENCIES = libgcobol.spec
+libgcobol_la_LDFLAGS = $(LTLDFLAGS) $(LIBQUADLIB) $(LTLIBICONV) \
+ $(extra_ldflags_libgcobol) $(LIBS) $(version_arg)
+libgcobol_la_DEPENDENCIES = libgcobol.spec $(LIBQUADLIB_DEP)
endif BUILD_LIBGCOBOL
diff --git a/libgcobol/Makefile.in b/libgcobol/Makefile.in
index 88158cb..5fdc42c 100644
--- a/libgcobol/Makefile.in
+++ b/libgcobol/Makefile.in
@@ -288,6 +288,10 @@ LIBGCOBOL_VERSION = @LIBGCOBOL_VERSION@
LIBICONV = @LIBICONV@
LIBM = @LIBM@
LIBOBJS = @LIBOBJS@
+LIBQUADINCLUDE = @LIBQUADINCLUDE@
+LIBQUADLIB = @LIBQUADLIB@
+LIBQUADLIB_DEP = @LIBQUADLIB_DEP@
+LIBQUADSPEC = @LIBQUADSPEC@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
@@ -317,6 +321,7 @@ SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SPEC_LIBGCOBOL_DEPS = @SPEC_LIBGCOBOL_DEPS@
STRIP = @STRIP@
+USE_IEC_60559 = @USE_IEC_60559@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
@@ -402,7 +407,7 @@ gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
@BUILD_LIBGCOBOL_TRUE@ valconv.cc
@BUILD_LIBGCOBOL_TRUE@WARN_CFLAGS = -W -Wall -Wwrite-strings
-@BUILD_LIBGCOBOL_TRUE@AM_CPPFLAGS = -I. -I$(srcdir)
+@BUILD_LIBGCOBOL_TRUE@AM_CPPFLAGS = -I. -I$(srcdir) $(LIBQUADINCLUDE)
@BUILD_LIBGCOBOL_TRUE@AM_CFLAGS = $(XCFLAGS)
@BUILD_LIBGCOBOL_TRUE@AM_CXXFLAGS = $(XCFLAGS) $(WARN_CFLAGS) \
@BUILD_LIBGCOBOL_TRUE@ -DIN_TARGET_LIBS -fno-strict-aliasing
@@ -410,11 +415,10 @@ gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
# We want to link with the c++ runtime.
@BUILD_LIBGCOBOL_TRUE@libgcobol_la_LINK = $(CXXLINK) $(libgcobol_la_LDFLAGS)
@BUILD_LIBGCOBOL_TRUE@version_arg = -version-info $(LIBGCOBOL_VERSION)
-@BUILD_LIBGCOBOL_TRUE@libgcobol_la_LDFLAGS = $(LTLDFLAGS) $(LTLIBICONV) \
-@BUILD_LIBGCOBOL_TRUE@ $(extra_ldflags_libgcobol) $(LIBS) \
-@BUILD_LIBGCOBOL_TRUE@ $(version_arg)
+@BUILD_LIBGCOBOL_TRUE@libgcobol_la_LDFLAGS = $(LTLDFLAGS) $(LIBQUADLIB) $(LTLIBICONV) \
+@BUILD_LIBGCOBOL_TRUE@ $(extra_ldflags_libgcobol) $(LIBS) $(version_arg)
-@BUILD_LIBGCOBOL_TRUE@libgcobol_la_DEPENDENCIES = libgcobol.spec
+@BUILD_LIBGCOBOL_TRUE@libgcobol_la_DEPENDENCIES = libgcobol.spec $(LIBQUADLIB_DEP)
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
diff --git a/libgcobol/acinclude.m4 b/libgcobol/acinclude.m4
index ed340c7..0e81b10 100644
--- a/libgcobol/acinclude.m4
+++ b/libgcobol/acinclude.m4
@@ -24,3 +24,165 @@ AC_DEFUN([AC_LIBTOOL_DLOPEN],)
AC_DEFUN([AC_LIBLTDL_CONVENIENCE],)
AC_SUBST(LIBTOOL)
])
+
+dnl Check whether we have a __float128 and _Float128 type
+dnl Unashamedly plagiarized from libgfortran.
+
+AC_DEFUN([LIBGCOBOL_CHECK_FLOAT128], [
+ LIBQUADSPEC=
+ LIBQUADLIB=
+ LIBQUADLIB_DEP=
+ LIBQUADINCLUDE=
+ USE_IEC_60559=no
+
+ if test "x$enable_libquadmath_support" = "xno"; then
+ if test "x$have_iec_60559_libc_support" = "xyes"; then
+ AC_DEFINE(USE_IEC_60559, 1, [Define if IEC 60559 *f128 APIs should be used for _Float128.])
+ fi
+ else
+
+ AC_CACHE_CHECK([whether we have a usable _Float128 type],
+ libgcob_cv_have_float128, [
+ GCC_TRY_COMPILE_OR_LINK([
+#if __LDBL_MANT_DIG__ == 113 && __LDBL_MIN_EXP__ == -16381
+#error "long double is IEEE quad, no need for libquadmath"
+#endif
+
+ _Float128 foo (_Float128 x)
+ {
+ _Complex _Float128 z1, z2;
+
+ z1 = x;
+ z2 = x / 7.F128;
+ z2 /= z1;
+
+ return __real__ z2;
+ }
+
+ _Float128 bar (_Float128 x)
+ {
+ return x * __builtin_huge_valf128 ();
+ }
+
+ __float128 baz (__float128 x)
+ {
+ return x * __builtin_huge_valf128 ();
+ }
+ ],[
+ foo (1.2F128);
+ bar (1.2F128);
+ baz (1.2F128);
+ foo (1.2Q);
+ bar (1.2Q);
+ baz (1.2Q);
+ ],[
+ libgcob_cv_have_float128=yes
+ ],[
+ libgcob_cv_have_float128=no
+])])
+
+ if test "x$have_iec_60559_libc_support$enable_libquadmath_support$libgcob_cv_have_float128" = xyesdefaultyes; then
+ USE_IEC_60559=yes
+ fi
+
+ if test "x$libgcob_cv_have_float128" = xyes; then
+
+ if test "x$USE_IEC_60559" = xyes; then
+ AC_DEFINE(USE_IEC_60559, 1, [Define if IEC 60559 *f128 APIs should be used for _Float128.])
+ else
+ AC_DEFINE(USE_QUADMATH, 1, [Define if *q APIs should be used for __float128.])
+ fi
+ AC_DEFINE(HAVE_FLOAT128, 1, [Define if target has usable _Float128 and __float128 types.])
+
+ if test "x$USE_IEC_60559" != xyes; then
+ dnl Check whether -Wl,--as-needed resp. -Wl,-zignore is supported
+ dnl
+ dnl Turn warnings into error to avoid testsuite breakage. So enable
+ dnl AC_LANG_WERROR, but there's currently (autoconf 2.64) no way to turn
+ dnl it off again. As a workaround, save and restore werror flag like
+ dnl AC_PATH_XTRA.
+ dnl Cf. http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01889.html
+ ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag
+ AC_CACHE_CHECK([whether --as-needed/-z ignore works],
+ [libgcob_cv_have_as_needed],
+ [
+ # Test for native Solaris options first.
+ # No whitespace after -z to pass it through -Wl.
+ libgcob_cv_as_needed_option="-zignore"
+ libgcob_cv_no_as_needed_option="-zrecord"
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option"
+ libgcob_cv_have_as_needed=no
+ AC_LANG_WERROR
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+ [libgcob_cv_have_as_needed=yes],
+ [libgcob_cv_have_as_needed=no])
+ LDFLAGS="$save_LDFLAGS"
+ if test "x$libgcob_cv_have_as_needed" = xno; then
+ libgcob_cv_as_needed_option="--as-needed"
+ libgcob_cv_no_as_needed_option="--no-as-needed"
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option"
+ libgcob_cv_have_as_needed=no
+ AC_LANG_WERROR
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+ [libgcob_cv_have_as_needed=yes],
+ [libgcob_cv_have_as_needed=no])
+ LDFLAGS="$save_LDFLAGS"
+ fi
+ ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag
+ ])
+
+ dnl Determine -Bstatic ... -Bdynamic etc. support from gfortran -### stderr.
+ touch conftest1.$ac_objext conftest2.$ac_objext
+ LQUADMATH=-lquadmath
+ $CXX -static-libgcobol -### -o conftest \
+ conftest1.$ac_objext -lgcobol conftest2.$ac_objext 2>&1 >/dev/null \
+ | grep "conftest1.$ac_objext.*conftest2.$ac_objext" > conftest.cmd
+ if grep "conftest1.$ac_objext.* -Bstatic -lgcobol -Bdynamic .*conftest2.$ac_objext" \
+ conftest.cmd >/dev/null 2>&1; then
+ LQUADMATH="%{static-libquadmath:-Bstatic} -lquadmath %{static-libquadmath:-Bdynamic}"
+ elif grep "conftest1.$ac_objext.* -bstatic -lgcobol -bdynamic .*conftest2.$ac_objext" \
+ conftest.cmd >/dev/null 2>&1; then
+ LQUADMATH="%{static-libquadmath:-bstatic} -lquadmath %{static-libquadmath:-bdynamic}"
+ elif grep "conftest1.$ac_objext.* -aarchive_shared -lgcobol -adefault .*conftest2.$ac_objext" \
+ conftest.cmd >/dev/null 2>&1; then
+ LQUADMATH="%{static-libquadmath:-aarchive_shared} -lquadmath %{static-libquadmath:-adefault}"
+ elif grep "conftest1.$ac_objext.*libgcobol.a .*conftest2.$ac_objext" \
+ conftest.cmd >/dev/null 2>&1; then
+ LQUADMATH="%{static-libquadmath:libquadmath.a%s;:-lquadmath}"
+ fi
+ rm -f conftest1.$ac_objext conftest2.$ac_objext conftest conftest.cmd
+
+ if test "x$libgcob_cv_have_as_needed" = xyes; then
+ if test "x$USE_IEC_60559" = xyes; then
+ LIBQUADSPEC="$libgcob_cv_as_needed_option $LQUADMATH $libgcob_cv_no_as_needed_option"
+ else
+ LIBQUADSPEC="%{static-libgcobol:$libgcob_cv_as_needed_option} $LQUADMATH %{static-libgcobol:$libgcob_cv_no_as_needed_option}"
+ fi
+ else
+ LIBQUADSPEC="$LQUADMATH"
+ fi
+ if test -f ../libquadmath/libquadmath.la; then
+ LIBQUADLIB=../libquadmath/libquadmath.la
+ LIBQUADLIB_DEP=../libquadmath/libquadmath.la
+ LIBQUADINCLUDE='-I$(srcdir)/../libquadmath'
+ else
+ LIBQUADLIB="-lquadmath"
+ fi
+ fi
+ else
+ if test "x$USE_IEC_60559" = xyes; then
+ AC_DEFINE(USE_IEC_60559, 1, [Define if IEC 60559 *f128 APIs should be used for _Float128.])
+ fi
+ fi
+
+ fi
+
+ dnl For the spec file
+ AC_SUBST(LIBQUADSPEC)
+ AC_SUBST(LIBQUADLIB)
+ AC_SUBST(LIBQUADLIB_DEP)
+ AC_SUBST(LIBQUADINCLUDE)
+ AC_SUBST(USE_IEC_60559)
+])
diff --git a/libgcobol/config.h.in b/libgcobol/config.h.in
index d61ff7a..6a53279 100644
--- a/libgcobol/config.h.in
+++ b/libgcobol/config.h.in
@@ -3,12 +3,30 @@
/* Define to 1 if the target assembler supports thread-local storage. */
#undef HAVE_CC_TLS
+/* Define to 1 if you have the <complex.h> header file. */
+#undef HAVE_COMPLEX_H
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
+/* Define to 1 if you have the <fenv.h> header file. */
+#undef HAVE_FENV_H
+
+/* Define if target has usable _Float128 and __float128 types. */
+#undef HAVE_FLOAT128
+
+/* Define to 1 if you have the <floatingpoint.h> header file. */
+#undef HAVE_FLOATINGPOINT_H
+
+/* Define to 1 if you have the <fptrap.h> header file. */
+#undef HAVE_FPTRAP_H
+
/* Define if you have the iconv() function and it works. */
#undef HAVE_ICONV
+/* Define to 1 if you have the <ieeefp.h> header file. */
+#undef HAVE_IEEEFP_H
+
/* Define to 1 if you have the `initstate_r' function. */
#undef HAVE_INITSTATE_R
@@ -36,6 +54,9 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
+/* Define to 1 if you have the `strfromf128' function. */
+#undef HAVE_STRFROMF128
+
/* Define to 1 if you have the `strfromf32' function. */
#undef HAVE_STRFROMF32
@@ -48,6 +69,9 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strtof128' function. */
+#undef HAVE_STRTOF128
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
@@ -88,6 +112,12 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Define if IEC 60559 *f128 APIs should be used for _Float128. */
+#undef USE_IEC_60559
+
+/* Define if *q APIs should be used for __float128. */
+#undef USE_QUADMATH
+
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
diff --git a/libgcobol/configure b/libgcobol/configure
index 1715b98..e83119d 100755
--- a/libgcobol/configure
+++ b/libgcobol/configure
@@ -629,13 +629,21 @@ ac_includes_default="\
# include <unistd.h>
#endif"
+ac_header_list=
ac_func_list=
+ac_cxx_werror_flag=
+ac_cxx_werror_flag=
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
SPEC_LIBGCOBOL_DEPS
get_gcc_base_ver
+USE_IEC_60559
+LIBQUADINCLUDE
+LIBQUADLIB_DEP
+LIBQUADLIB
+LIBQUADSPEC
extra_ldflags_libgcobol
LIBGCOBOL_VERSION
BUILD_LIBGCOBOL_FALSE
@@ -793,6 +801,7 @@ with_toolexeclibdir
enable_rpath
with_libiconv_prefix
with_libiconv_type
+enable_libquadmath
with_gcc_major_version_only
'
ac_precious_vars='build_alias
@@ -1445,6 +1454,7 @@ Optional Features:
install libraries with @rpath/library-name, requires
rpaths to be added to executables
--disable-rpath do not hardcode runtime library paths
+ --disable-libquadmath disable libquadmath support for libgcobol
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -2339,6 +2349,37 @@ rm -f conftest.val
} # ac_fn_cxx_compute_int
+# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES
+# ---------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_cxx_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_header_compile
+
# ac_fn_cxx_check_func LINENO FUNC VAR
# ------------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -2692,12 +2733,20 @@ $as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
+as_fn_append ac_header_list " floatingpoint.h"
+as_fn_append ac_header_list " ieeefp.h"
+as_fn_append ac_header_list " fenv.h"
+as_fn_append ac_header_list " fptrap.h"
+as_fn_append ac_header_list " complex.h"
+as_fn_append ac_header_list " stdlib.h"
as_fn_append ac_func_list " random_r"
as_fn_append ac_func_list " srandom_r"
as_fn_append ac_func_list " initstate_r"
as_fn_append ac_func_list " setstate_r"
as_fn_append ac_func_list " strfromf32"
as_fn_append ac_func_list " strfromf64"
+as_fn_append ac_func_list " strtof128"
+as_fn_append ac_func_list " strfromf128"
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
@@ -11644,7 +11693,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11647 "configure"
+#line 11696 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11750,7 +11799,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11753 "configure"
+#line 11802 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16861,9 +16910,102 @@ if test "$ac_res" != no; then :
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cosf128" >&5
-$as_echo_n "checking for library containing cosf128... " >&6; }
-if ${ac_cv_search_cosf128+:} false; then :
+
+# libgcobol soname version
+LIBGCOBOL_VERSION=1:0:0
+
+
+## added, currently unused.
+# VERSION_SUFFIX=$(echo $LIBGCOBOL_VERSION | tr ':' '.' )
+# AC_SUBST(VERSION_SUFFIX)
+## end added
+
+extra_ldflags_libgcobol=
+case $host in
+ *-*-darwin*)
+ extra_ldflags_libgcobol=-Wl,-U,___cobol_main ;;
+ *) ;;
+esac
+
+
+
+
+
+ for ac_header in $ac_header_list
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# These are GLIBC
+
+
+
+ for ac_func in $ac_func_list
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+
+
+
+
+
+# Some functions we check to figure out if the libc Float128 support
+# is adequate.
+
+# These are C23.
+
+
+
+
+
+
+# These are GLIBC.
+
+
+
+
+
+# We need to make sure to check libc before adding libm.
+libgcobol_have_sinf128=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sinf128" >&5
+$as_echo_n "checking for library containing sinf128... " >&6; }
+if ${ac_cv_search_sinf128+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
@@ -16876,11 +17018,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char cosf128 ();
+char sinf128 ();
int
main ()
{
-return cosf128 ();
+return sinf128 ();
;
return 0;
}
@@ -16896,75 +17038,396 @@ for ac_lib in '' c m; do
as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
fi
if ac_fn_cxx_try_link "$LINENO"; then :
- ac_cv_search_cosf128=$ac_res
+ ac_cv_search_sinf128=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
- if ${ac_cv_search_cosf128+:} false; then :
+ if ${ac_cv_search_sinf128+:} false; then :
break
fi
done
-if ${ac_cv_search_cosf128+:} false; then :
+if ${ac_cv_search_sinf128+:} false; then :
else
- ac_cv_search_cosf128=no
+ ac_cv_search_sinf128=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cosf128" >&5
-$as_echo "$ac_cv_search_cosf128" >&6; }
-ac_res=$ac_cv_search_cosf128
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sinf128" >&5
+$as_echo "$ac_cv_search_sinf128" >&6; }
+ac_res=$ac_cv_search_sinf128
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ libgcobol_have_sinf128=yes
+fi
+
+libgcobol_have_cacosf128=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cacosf128" >&5
+$as_echo_n "checking for library containing cacosf128... " >&6; }
+if ${ac_cv_search_cacosf128+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cacosf128 ();
+int
+main ()
+{
+return cacosf128 ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' c m; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if test x$gcc_no_link = xyes; then
+ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_search_cacosf128=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_cacosf128+:} false; then :
+ break
fi
+done
+if ${ac_cv_search_cacosf128+:} false; then :
+else
+ ac_cv_search_cacosf128=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cacosf128" >&5
+$as_echo "$ac_cv_search_cacosf128" >&6; }
+ac_res=$ac_cv_search_cacosf128
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ libgcobol_have_cacosf128=yes
+fi
-# libgcobol soname version
-LIBGCOBOL_VERSION=1:0:0
+have_iec_60559_libc_support=no
+if test "x$ac_cv_func_strtof128$ac_cv_func_strfromf128" = xyesyes \
+ && test "x$libgcobol_have_sinf128$libgcobol_have_cacosf128" = xyesyes; then
+ have_iec_60559_libc_support=yes
+fi
-## added, currently unused.
-# VERSION_SUFFIX=$(echo $LIBGCOBOL_VERSION | tr ':' '.' )
-# AC_SUBST(VERSION_SUFFIX)
-## end added
+# Check whether libquadmath should be used
+# Check whether --enable-libquadmath was given.
+if test "${enable_libquadmath+set}" = set; then :
+ enableval=$enable_libquadmath; ENABLE_LIBQUADMATH_SUPPORT=$enableval
+else
+ if test "x$have_iec_60559_libc_support" = xyes; then
+ ENABLE_LIBQUADMATH_SUPPORT=default
+else
+ ENABLE_LIBQUADMATH_SUPPORT=yes
+fi
+fi
-extra_ldflags_libgcobol=
-case $host in
- *-*-darwin*)
- extra_ldflags_libgcobol=-Wl,-U,___cobol_main ;;
- *) ;;
-esac
+enable_libquadmath_support=
+if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
+ enable_libquadmath_support=no
+elif test "${ENABLE_LIBQUADMATH_SUPPORT}" = "default" ; then
+ enable_libquadmath_support=default
+fi
+ LIBQUADSPEC=
+ LIBQUADLIB=
+ LIBQUADLIB_DEP=
+ LIBQUADINCLUDE=
+ USE_IEC_60559=no
-# These are GLIBC
+ if test "x$enable_libquadmath_support" = "xno"; then
+ if test "x$have_iec_60559_libc_support" = "xyes"; then
+$as_echo "#define USE_IEC_60559 1" >>confdefs.h
+ fi
+ else
- for ac_func in $ac_func_list
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have a usable _Float128 type" >&5
+$as_echo_n "checking whether we have a usable _Float128 type... " >&6; }
+if ${libgcob_cv_have_float128+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test x$gcc_no_link = xyes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if __LDBL_MANT_DIG__ == 113 && __LDBL_MIN_EXP__ == -16381
+#error "long double is IEEE quad, no need for libquadmath"
+#endif
+
+ _Float128 foo (_Float128 x)
+ {
+ _Complex _Float128 z1, z2;
+
+ z1 = x;
+ z2 = x / 7.F128;
+ z2 /= z1;
+
+ return __real__ z2;
+ }
+
+ _Float128 bar (_Float128 x)
+ {
+ return x * __builtin_huge_valf128 ();
+ }
+
+ __float128 baz (__float128 x)
+ {
+ return x * __builtin_huge_valf128 ();
+ }
+
+int
+main ()
+{
+
+ foo (1.2F128);
+ bar (1.2F128);
+ baz (1.2F128);
+ foo (1.2Q);
+ bar (1.2Q);
+ baz (1.2Q);
+
+ ;
+ return 0;
+}
_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+ libgcob_cv_have_float128=yes
+
+else
+
+ libgcob_cv_have_float128=no
fi
-done
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ if test x$gcc_no_link = xyes; then
+ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if __LDBL_MANT_DIG__ == 113 && __LDBL_MIN_EXP__ == -16381
+#error "long double is IEEE quad, no need for libquadmath"
+#endif
+
+ _Float128 foo (_Float128 x)
+ {
+ _Complex _Float128 z1, z2;
+
+ z1 = x;
+ z2 = x / 7.F128;
+ z2 /= z1;
+
+ return __real__ z2;
+ }
+
+ _Float128 bar (_Float128 x)
+ {
+ return x * __builtin_huge_valf128 ();
+ }
+
+ __float128 baz (__float128 x)
+ {
+ return x * __builtin_huge_valf128 ();
+ }
+
+int
+main ()
+{
+
+ foo (1.2F128);
+ bar (1.2F128);
+ baz (1.2F128);
+ foo (1.2Q);
+ bar (1.2Q);
+ baz (1.2Q);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ libgcob_cv_have_float128=yes
+
+else
+
+ libgcob_cv_have_float128=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcob_cv_have_float128" >&5
+$as_echo "$libgcob_cv_have_float128" >&6; }
+
+ if test "x$have_iec_60559_libc_support$enable_libquadmath_support$libgcob_cv_have_float128" = xyesdefaultyes; then
+ USE_IEC_60559=yes
+ fi
+ if test "x$libgcob_cv_have_float128" = xyes; then
+ if test "x$USE_IEC_60559" = xyes; then
+
+$as_echo "#define USE_IEC_60559 1" >>confdefs.h
+
+ else
+
+$as_echo "#define USE_QUADMATH 1" >>confdefs.h
+
+ fi
+
+$as_echo "#define HAVE_FLOAT128 1" >>confdefs.h
+
+
+ if test "x$USE_IEC_60559" != xyes; then
+ ac_xsave_cxx_werror_flag=$ac_cxx_werror_flag
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --as-needed/-z ignore works" >&5
+$as_echo_n "checking whether --as-needed/-z ignore works... " >&6; }
+if ${libgcob_cv_have_as_needed+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # Test for native Solaris options first.
+ # No whitespace after -z to pass it through -Wl.
+ libgcob_cv_as_needed_option="-zignore"
+ libgcob_cv_no_as_needed_option="-zrecord"
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option"
+ libgcob_cv_have_as_needed=no
+
+ac_cxx_werror_flag=yes
+ if test x$gcc_no_link = xyes; then
+ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ libgcob_cv_have_as_needed=yes
+else
+ libgcob_cv_have_as_needed=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+ if test "x$libgcob_cv_have_as_needed" = xno; then
+ libgcob_cv_as_needed_option="--as-needed"
+ libgcob_cv_no_as_needed_option="--no-as-needed"
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option"
+ libgcob_cv_have_as_needed=no
+
+ac_cxx_werror_flag=yes
+ if test x$gcc_no_link = xyes; then
+ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int
+main ()
+{
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ libgcob_cv_have_as_needed=yes
+else
+ libgcob_cv_have_as_needed=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+ fi
+ ac_cxx_werror_flag=$ac_xsave_cxx_werror_flag
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcob_cv_have_as_needed" >&5
+$as_echo "$libgcob_cv_have_as_needed" >&6; }
+
+ touch conftest1.$ac_objext conftest2.$ac_objext
+ LQUADMATH=-lquadmath
+ $CXX -static-libgcobol -### -o conftest \
+ conftest1.$ac_objext -lgcobol conftest2.$ac_objext 2>&1 >/dev/null \
+ | grep "conftest1.$ac_objext.*conftest2.$ac_objext" > conftest.cmd
+ if grep "conftest1.$ac_objext.* -Bstatic -lgcobol -Bdynamic .*conftest2.$ac_objext" \
+ conftest.cmd >/dev/null 2>&1; then
+ LQUADMATH="%{static-libquadmath:-Bstatic} -lquadmath %{static-libquadmath:-Bdynamic}"
+ elif grep "conftest1.$ac_objext.* -bstatic -lgcobol -bdynamic .*conftest2.$ac_objext" \
+ conftest.cmd >/dev/null 2>&1; then
+ LQUADMATH="%{static-libquadmath:-bstatic} -lquadmath %{static-libquadmath:-bdynamic}"
+ elif grep "conftest1.$ac_objext.* -aarchive_shared -lgcobol -adefault .*conftest2.$ac_objext" \
+ conftest.cmd >/dev/null 2>&1; then
+ LQUADMATH="%{static-libquadmath:-aarchive_shared} -lquadmath %{static-libquadmath:-adefault}"
+ elif grep "conftest1.$ac_objext.*libgcobol.a .*conftest2.$ac_objext" \
+ conftest.cmd >/dev/null 2>&1; then
+ LQUADMATH="%{static-libquadmath:libquadmath.a%s;:-lquadmath}"
+ fi
+ rm -f conftest1.$ac_objext conftest2.$ac_objext conftest conftest.cmd
+ if test "x$libgcob_cv_have_as_needed" = xyes; then
+ if test "x$USE_IEC_60559" = xyes; then
+ LIBQUADSPEC="$libgcob_cv_as_needed_option $LQUADMATH $libgcob_cv_no_as_needed_option"
+ else
+ LIBQUADSPEC="%{static-libgcobol:$libgcob_cv_as_needed_option} $LQUADMATH %{static-libgcobol:$libgcob_cv_no_as_needed_option}"
+ fi
+ else
+ LIBQUADSPEC="$LQUADMATH"
+ fi
+ if test -f ../libquadmath/libquadmath.la; then
+ LIBQUADLIB=../libquadmath/libquadmath.la
+ LIBQUADLIB_DEP=../libquadmath/libquadmath.la
+ LIBQUADINCLUDE='-I$(srcdir)/../libquadmath'
+ else
+ LIBQUADLIB="-lquadmath"
+ fi
+ fi
+ else
+ if test "x$USE_IEC_60559" = xyes; then
+$as_echo "#define USE_IEC_60559 1" >>confdefs.h
+ fi
+ fi
+ fi
-# These are C23, and might not be available in libc.
diff --git a/libgcobol/configure.ac b/libgcobol/configure.ac
index ca56997..a1e9513 100644
--- a/libgcobol/configure.ac
+++ b/libgcobol/configure.ac
@@ -169,7 +169,6 @@ AM_CONDITIONAL(BUILD_LIBGCOBOL, [test "x$LIBGCOBOL_SUPPORTED" = xyes && test "x$
# Check if functions are available in libc before adding extra libs.
AC_SEARCH_LIBS([malloc], [c])
AC_SEARCH_LIBS([clock_gettime], [c rt])
-AC_SEARCH_LIBS([cosf128], [c m])
# libgcobol soname version
LIBGCOBOL_VERSION=1:0:0
@@ -188,12 +187,50 @@ case $host in
esac
AC_SUBST(extra_ldflags_libgcobol)
+AC_CHECK_HEADERS_ONCE(floatingpoint.h ieeefp.h fenv.h fptrap.h \
+complex.h stdlib.h)
+
# These are GLIBC
AC_CHECK_FUNCS_ONCE(random_r srandom_r initstate_r setstate_r)
-# These are C23, and might not be available in libc.
+# Some functions we check to figure out if the libc Float128 support
+# is adequate.
+
+# These are C23.
AC_CHECK_FUNCS_ONCE(strfromf32 strfromf64)
+# These are GLIBC.
+AC_CHECK_FUNCS_ONCE(strtof128 strfromf128)
+# We need to make sure to check libc before adding libm.
+libgcobol_have_sinf128=no
+AC_SEARCH_LIBS([sinf128], [c m], libgcobol_have_sinf128=yes)
+libgcobol_have_cacosf128=no
+AC_SEARCH_LIBS([cacosf128], [c m], libgcobol_have_cacosf128=yes)
+
+have_iec_60559_libc_support=no
+if test "x$ac_cv_func_strtof128$ac_cv_func_strfromf128" = xyesyes \
+ && test "x$libgcobol_have_sinf128$libgcobol_have_cacosf128" = xyesyes; then
+ have_iec_60559_libc_support=yes
+fi
+
+# Check whether libquadmath should be used
+AC_ARG_ENABLE(libquadmath,
+AS_HELP_STRING([--disable-libquadmath],
+ [disable libquadmath support for libgcobol]),
+ENABLE_LIBQUADMATH_SUPPORT=$enableval,
+if test "x$have_iec_60559_libc_support" = xyes; then
+ ENABLE_LIBQUADMATH_SUPPORT=default
+else
+ ENABLE_LIBQUADMATH_SUPPORT=yes
+fi)
+enable_libquadmath_support=
+if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
+ enable_libquadmath_support=no
+elif test "${ENABLE_LIBQUADMATH_SUPPORT}" = "default" ; then
+ enable_libquadmath_support=default
+fi
+LIBGCOBOL_CHECK_FLOAT128
+
if test "${multilib}" = "yes"; then
multilib_arg="--enable-multilib"
else
diff --git a/libgcobol/configure.tgt b/libgcobol/configure.tgt
index c5e263a..a239252 100644
--- a/libgcobol/configure.tgt
+++ b/libgcobol/configure.tgt
@@ -34,7 +34,12 @@ case "${target}" in
LIBGCOBOL_SUPPORTED=yes
fi
;;
- x86_64-*-linux* | i?86-*-linux*)
+ riscv64-*-linux*)
+ if test x$ac_cv_sizeof_void_p = x8; then
+ LIBGCOBOL_SUPPORTED=yes
+ fi
+ ;;
+ x86_64-*-linux* | i?86-*-linux* | x86_64-*-darwin*)
if test x$ac_cv_sizeof_void_p = x8; then
LIBGCOBOL_SUPPORTED=yes
fi
diff --git a/libgcobol/gfileio.cc b/libgcobol/gfileio.cc
index ed250c4..e6ad03fc 100644
--- a/libgcobol/gfileio.cc
+++ b/libgcobol/gfileio.cc
@@ -41,6 +41,7 @@
#include <algorithm>
#include "config.h"
+#include "libgcobol-fp.h"
#include "ec.h"
#include "io.h"
@@ -4054,34 +4055,6 @@ file_indexed_close(cblc_file_t *file)
file->supplemental = NULL;
}
-static void
-report_open_failure(const char *type,
- const char *structure_name,
- const char *filename)
- {
- bool quiet = true;
- if( !quiet )
- {
- if( getenv(filename) )
- {
- fprintf(stderr,
- "Trying to 'OPEN %s %s %s -> \"%s\"', which doesn't exist\n",
- type,
- structure_name,
- filename,
- getenv(filename));
- }
- else
- {
- fprintf(stderr,
- "Trying to 'OPEN %s %s \"%s\"', which doesn't exist\n",
- type,
- structure_name,
- filename);
- }
- }
- }
-
extern "C"
void
__gg__file_reopen(cblc_file_t *file, int mode_char)
@@ -4210,7 +4183,6 @@ __gg__file_reopen(cblc_file_t *file, int mode_char)
}
else
{
- report_open_failure("INPUT", file->name, trimmed_name);
file->io_status = FsNoFile; // "35"
goto done;
}
@@ -4252,7 +4224,6 @@ __gg__file_reopen(cblc_file_t *file, int mode_char)
else
{
// Trying to extend a non-optional non-existing file is against the rules
- report_open_failure("EXTEND", file->name, trimmed_name);
file->io_status = FsNoFile; // "35"
goto done;
}
@@ -4268,7 +4239,6 @@ __gg__file_reopen(cblc_file_t *file, int mode_char)
}
else
{
- report_open_failure("I-O", file->name, trimmed_name);
file->io_status = FsNoFile; // "35"
goto done;
}
diff --git a/libgcobol/gmath.cc b/libgcobol/gmath.cc
index fb2eae3..3fe2bbb 100644
--- a/libgcobol/gmath.cc
+++ b/libgcobol/gmath.cc
@@ -40,6 +40,7 @@
#include <algorithm>
#include "config.h"
+#include "libgcobol-fp.h"
#include "ec.h"
#include "common-defs.h"
@@ -54,10 +55,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#ifdef __aarch64__
-#define __float128 _Float128
-#endif
-
#define MAX_INTERMEDIATE_BITS 126
#define MAX_INTERMEDIATE_DECIMALS 16
@@ -114,7 +111,7 @@ conditional_stash( cblc_field_t *destination,
size_t destination_o,
size_t destination_s,
bool on_error_flag,
- _Float128 value,
+ GCOB_FP128 value,
cbl_round_t rounded)
{
int retval = compute_error_none;
@@ -150,15 +147,10 @@ conditional_stash( cblc_field_t *destination,
return retval;
}
-
-#if defined(__aarch64__)
-# define __float128 _Float128 /* double */
-#endif
-
static
-_Float128
-divide_helper_float(_Float128 a_value,
- _Float128 b_value,
+GCOB_FP128
+divide_helper_float(GCOB_FP128 a_value,
+ GCOB_FP128 b_value,
int *compute_error)
{
if( b_value == 0 )
@@ -187,9 +179,9 @@ divide_helper_float(_Float128 a_value,
}
static
-_Float128
-multiply_helper_float(_Float128 a_value,
- _Float128 b_value,
+GCOB_FP128
+multiply_helper_float(GCOB_FP128 a_value,
+ GCOB_FP128 b_value,
int *compute_error)
{
a_value *= b_value;
@@ -210,9 +202,9 @@ multiply_helper_float(_Float128 a_value,
}
static
-_Float128
-addition_helper_float(_Float128 a_value,
- _Float128 b_value,
+GCOB_FP128
+addition_helper_float(GCOB_FP128 a_value,
+ GCOB_FP128 b_value,
int *compute_error)
{
a_value += b_value;
@@ -233,9 +225,9 @@ addition_helper_float(_Float128 a_value,
}
static
-_Float128
-subtraction_helper_float(_Float128 a_value,
- _Float128 b_value,
+GCOB_FP128
+subtraction_helper_float(GCOB_FP128 a_value,
+ GCOB_FP128 b_value,
int *compute_error)
{
a_value -= b_value;
@@ -276,9 +268,9 @@ __gg__pow( cbl_arith_format_t,
size_t *C_o = __gg__treeplet_3o;
size_t *C_s = __gg__treeplet_3s;
- _Float128 avalue = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]);
- _Float128 bvalue = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]);
- _Float128 tgt_value;
+ GCOB_FP128 avalue = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]);
+ GCOB_FP128 bvalue = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]);
+ GCOB_FP128 tgt_value;
if( avalue == 0 && bvalue == 0 )
{
@@ -295,7 +287,7 @@ __gg__pow( cbl_arith_format_t,
// Calculate our answer, in floating point:
errno = 0;
feclearexcept(FE_ALL_EXCEPT);
- tgt_value = powf128(avalue, bvalue);
+ tgt_value = FP128_FUNC(pow)(avalue, bvalue);
if( errno || fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) )
{
// One of a large number of errors took place. See math_error(7) and
@@ -568,7 +560,7 @@ get_int256_from_qualified_field(int256 &var,
static int256 phase1_result;
static int phase1_rdigits;
-static _Float128 phase1_result_float;
+static GCOB_FP128 phase1_result_float;
extern "C"
void
@@ -654,11 +646,11 @@ __gg__addf1_fixed_phase2( cbl_arith_format_t ,
// proceed accordingly.
// Convert the intermediate
- _Float128 value_a = (_Float128)phase1_result.i128[0];
+ GCOB_FP128 value_a = (GCOB_FP128)phase1_result.i128[0];
value_a /= __gg__power_of_ten(phase1_rdigits);
// Pick up the target
- _Float128 value_b = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]);
+ GCOB_FP128 value_b = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]);
value_a += value_b;
@@ -740,7 +732,7 @@ __gg__fixed_phase2_assign_to_c( cbl_arith_format_t ,
// proceed accordingly.
// Convert the intermediate
- _Float128 value_a = (_Float128)phase1_result.i128[0];
+ GCOB_FP128 value_a = (GCOB_FP128)phase1_result.i128[0];
value_a /= __gg__power_of_ten(phase1_rdigits);
*compute_error |= conditional_stash(C[0], C_o[0], C_s[0],
@@ -796,7 +788,7 @@ __gg__add_float_phase1( cbl_arith_format_t ,
for( size_t i=1; i<nA; i++ )
{
- _Float128 temp = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]);
+ GCOB_FP128 temp = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]);
phase1_result_float = addition_helper_float(phase1_result_float,
temp,
compute_error);
@@ -822,7 +814,7 @@ __gg__addf1_float_phase2( cbl_arith_format_t ,
// This is the assignment phase of an ADD Format 2
// We take phase1_result and accumulate it into C
- _Float128 temp = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]);
+ GCOB_FP128 temp = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]);
temp = addition_helper_float(temp, phase1_result_float, compute_error);
*compute_error |= conditional_stash(C[0], C_o[0], C_s[0],
on_size_error,
@@ -883,8 +875,8 @@ __gg__addf3(cbl_arith_format_t ,
{
if( A[i]->type == FldFloat || C[i]->type == FldFloat )
{
- _Float128 value_a = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]);
- _Float128 value_b = __gg__float128_from_qualified_field(C[i], C_o[i], C_s[i]);
+ GCOB_FP128 value_a = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]);
+ GCOB_FP128 value_b = __gg__float128_from_qualified_field(C[i], C_o[i], C_s[i]);
value_a = addition_helper_float(value_a, value_b, compute_error);
@@ -966,11 +958,11 @@ __gg__subtractf1_fixed_phase2(cbl_arith_format_t ,
// proceed accordingly.
// Convert the intermediate
- _Float128 value_a = (_Float128)phase1_result.i128[0];
+ GCOB_FP128 value_a = (GCOB_FP128)phase1_result.i128[0];
value_a /= __gg__power_of_ten(phase1_rdigits);
// Pick up the target
- _Float128 value_b = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]);
+ GCOB_FP128 value_b = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]);
value_b -= value_a;
@@ -1106,7 +1098,7 @@ __gg__subtractf1_float_phase2(cbl_arith_format_t ,
// This is the assignment phase of an ADD Format 2
// We take phase1_result and subtract it from C
- _Float128 temp = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]);
+ GCOB_FP128 temp = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]);
temp = subtraction_helper_float(temp, phase1_result_float, compute_error);
*compute_error |= conditional_stash(C[0], C_o[0], C_s[0],
on_size_error,
@@ -1143,7 +1135,7 @@ __gg__subtractf2_float_phase1(cbl_arith_format_t ,
);
// Subtract that from the B value:
- _Float128 value_b = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]);
+ GCOB_FP128 value_b = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]);
// The two numbers have the same number of rdigits. It's now safe to add
// them.
@@ -1177,8 +1169,8 @@ __gg__subtractf3( cbl_arith_format_t ,
{
if( A[i]->type == FldFloat || C[i]->type == FldFloat)
{
- _Float128 value_a = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]);
- _Float128 value_b = __gg__float128_from_qualified_field(C[i], C_o[i], C_s[i]);
+ GCOB_FP128 value_a = __gg__float128_from_qualified_field(A[i], A_o[i], A_s[i]);
+ GCOB_FP128 value_b = __gg__float128_from_qualified_field(C[i], C_o[i], C_s[i]);
value_b = subtraction_helper_float(value_b, value_a, compute_error);
@@ -1235,7 +1227,7 @@ __gg__subtractf3( cbl_arith_format_t ,
}
static bool multiply_intermediate_is_float;
-static _Float128 multiply_intermediate_float;
+static GCOB_FP128 multiply_intermediate_float;
static __int128 multiply_intermediate_int128;
static int multiply_intermediate_rdigits;
@@ -1351,8 +1343,8 @@ __gg__multiplyf1_phase2(cbl_arith_format_t ,
bool on_size_error = !!(on_error_flag & ON_SIZE_ERROR);
int error_this_time=0;
- _Float128 a_value;
- _Float128 b_value;
+ GCOB_FP128 a_value;
+ GCOB_FP128 b_value;
if( multiply_intermediate_is_float )
{
@@ -1374,10 +1366,10 @@ __gg__multiplyf1_phase2(cbl_arith_format_t ,
if( C[0]->type == FldFloat )
{
// gixed * float
- a_value = (_Float128) multiply_intermediate_int128;
+ a_value = (GCOB_FP128) multiply_intermediate_int128;
if( multiply_intermediate_rdigits )
{
- a_value /= (_Float128)__gg__power_of_ten(multiply_intermediate_rdigits);
+ a_value /= (GCOB_FP128)__gg__power_of_ten(multiply_intermediate_rdigits);
}
b_value = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]);
goto float_float;
@@ -1457,14 +1449,14 @@ __gg__multiplyf2( cbl_arith_format_t ,
bool on_size_error = !!(on_error_flag & ON_SIZE_ERROR);
bool got_float = false;
- _Float128 product_float;
+ GCOB_FP128 product_float;
int256 product_fix;
int product_fix_digits;
if( A[0]->type == FldFloat || B[0]->type == FldFloat )
{
- _Float128 a_value = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]);
- _Float128 b_value = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]);
+ GCOB_FP128 a_value = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]);
+ GCOB_FP128 b_value = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]);
product_float = multiply_helper_float(a_value, b_value, compute_error);
got_float = true;
}
@@ -1834,8 +1826,8 @@ __gg__dividef1_phase2(cbl_arith_format_t ,
bool on_size_error = !!(on_error_flag & ON_SIZE_ERROR);
int error_this_time=0;
- _Float128 a_value;
- _Float128 b_value;
+ GCOB_FP128 a_value;
+ GCOB_FP128 b_value;
if( multiply_intermediate_is_float )
{
@@ -1857,10 +1849,10 @@ __gg__dividef1_phase2(cbl_arith_format_t ,
if( C[0]->type == FldFloat )
{
// gixed * float
- a_value = (_Float128) multiply_intermediate_int128;
+ a_value = (GCOB_FP128) multiply_intermediate_int128;
if( multiply_intermediate_rdigits )
{
- a_value /= (_Float128)__gg__power_of_ten(multiply_intermediate_rdigits);
+ a_value /= (GCOB_FP128)__gg__power_of_ten(multiply_intermediate_rdigits);
}
b_value = __gg__float128_from_qualified_field(C[0], C_o[0], C_s[0]);
goto float_float;
@@ -1948,9 +1940,9 @@ __gg__dividef23(cbl_arith_format_t ,
if( A[0]->type == FldFloat || B[0]->type == FldFloat )
{
- _Float128 a_value;
- _Float128 b_value;
- _Float128 c_value;
+ GCOB_FP128 a_value;
+ GCOB_FP128 b_value;
+ GCOB_FP128 c_value;
a_value = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]);
b_value = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]);
c_value = divide_helper_float(a_value, b_value, &error_this_time);
@@ -2029,9 +2021,9 @@ __gg__dividef45(cbl_arith_format_t ,
if( A[0]->type == FldFloat || B[0]->type == FldFloat )
{
- _Float128 a_value;
- _Float128 b_value;
- _Float128 c_value;
+ GCOB_FP128 a_value;
+ GCOB_FP128 b_value;
+ GCOB_FP128 c_value;
a_value = __gg__float128_from_qualified_field(A[0], A_o[0], A_s[0]);
b_value = __gg__float128_from_qualified_field(B[0], B_o[0], B_s[0]);
c_value = divide_helper_float(a_value, b_value, &error_this_time);
diff --git a/libgcobol/intrinsic.cc b/libgcobol/intrinsic.cc
index e0bd333..181b053 100644
--- a/libgcobol/intrinsic.cc
+++ b/libgcobol/intrinsic.cc
@@ -45,6 +45,7 @@
#include <string.h>
#include "config.h"
+#include "libgcobol-fp.h"
#include "ec.h"
#include "common-defs.h"
@@ -53,11 +54,12 @@
#include "libgcobol.h"
#include "charmaps.h"
+
#pragma GCC diagnostic ignored "-Wformat-truncation"
#define JD_OF_1601_01_02 2305812.5
-#define WEIRD_TRANSCENDENT_RETURN_VALUE (0.0Q)
+#define WEIRD_TRANSCENDENT_RETURN_VALUE GCOB_FP128_LITERAL (0.0)
#define NO_RDIGITS (0)
struct cobol_tm
@@ -406,7 +408,7 @@ get_value_as_double_from_qualified_field( cblc_field_t *input,
}
static
-_Float128 kahan_summation(size_t ncount,
+GCOB_FP128 kahan_summation(size_t ncount,
cblc_field_t **source,
size_t *source_o,
size_t *source_s,
@@ -420,11 +422,11 @@ _Float128 kahan_summation(size_t ncount,
// an aggressive optimizing compiler from just making it go away.
*k_count = 0;
- _Float128 sum = 0;
- volatile _Float128 kahan_c = 0;
- _Float128 input;
- _Float128 y;
- _Float128 t;
+ GCOB_FP128 sum = 0;
+ volatile GCOB_FP128 kahan_c = 0;
+ GCOB_FP128 input;
+ GCOB_FP128 y;
+ GCOB_FP128 t;
for(size_t i=0; i<ncount; i++)
{
@@ -452,7 +454,7 @@ _Float128 kahan_summation(size_t ncount,
}
static
-_Float128
+GCOB_FP128
variance( size_t ncount,
cblc_field_t **source,
size_t *source_o,
@@ -463,13 +465,13 @@ variance( size_t ncount,
// algorithm that is a bit wasteful of time, but is described as particularly
// robust.
- _Float128 retval = 0;
+ GCOB_FP128 retval = 0;
if( ncount )
{
// First, we calculate the mean of the input variables, which we will use
// as an offset in the second stage:
size_t k_count;
- _Float128 offset = kahan_summation( ncount,
+ GCOB_FP128 offset = kahan_summation( ncount,
source,
source_o,
source_s,
@@ -480,11 +482,11 @@ variance( size_t ncount,
// Next, we use Welford's algorithm on the residuals:
size_t count = 0;
- _Float128 mean = 0;
- _Float128 M2 = 0;
- _Float128 delta;
- _Float128 delta2;
- _Float128 newValue;
+ GCOB_FP128 mean = 0;
+ GCOB_FP128 M2 = 0;
+ GCOB_FP128 delta;
+ GCOB_FP128 delta2;
+ GCOB_FP128 newValue;
for(size_t i=0; i<ncount; i++)
{
@@ -958,7 +960,7 @@ __gg__abs(cblc_field_t *dest,
size_t source_size)
{
// FUNCTION ABS
- _Float128 value;
+ GCOB_FP128 value;
value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
@@ -980,17 +982,17 @@ __gg__acos( cblc_field_t *dest,
size_t source_size)
{
// FUNCTION ACOS
- _Float128 value;
+ GCOB_FP128 value;
value = __gg__float128_from_qualified_field(source, source_offset, source_size);
- if( value < -1.00Q || value > +1.00Q )
+ if( value < GCOB_FP128_LITERAL(-1.00) || value > GCOB_FP128_LITERAL(+1.00) )
{
exception_raise(ec_argument_function_e);
value = WEIRD_TRANSCENDENT_RETURN_VALUE;
}
else
{
- value = acosf128(value);
+ value = FP128_FUNC(acos)(value);
}
__gg__float128_to_field( dest,
@@ -1011,12 +1013,12 @@ __gg__annuity(cblc_field_t *dest,
{
// FUNCTION ANNUITY
- _Float128 retval = 0;
+ GCOB_FP128 retval = 0;
- _Float128 val1 = fabsf128(__gg__float128_from_qualified_field(arg1,
+ GCOB_FP128 val1 = FP128_FUNC(fabs)(__gg__float128_from_qualified_field(arg1,
arg1_offset,
arg1_size));
- _Float128 val2 = fabsf128(__gg__float128_from_qualified_field(arg2,
+ GCOB_FP128 val2 = FP128_FUNC(fabs)(__gg__float128_from_qualified_field(arg2,
arg2_offset,
arg2_size));
if( val2 > 0)
@@ -1031,7 +1033,7 @@ __gg__annuity(cblc_field_t *dest,
}
else
{
- retval = val1 / (1- powf128( (1+val1), -val2 ));
+ retval = val1 / (1- FP128_FUNC(pow)( (1+val1), -val2 ));
}
}
else
@@ -1053,19 +1055,19 @@ __gg__asin( cblc_field_t *dest,
{
// FUNCTION ASIN
- _Float128 value;
+ GCOB_FP128 value;
value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
- if( value < -1.0Q || value > +1.00Q )
+ if( value < GCOB_FP128_LITERAL(-1.0) || value > GCOB_FP128_LITERAL(+1.00) )
{
exception_raise(ec_argument_function_e);
value = WEIRD_TRANSCENDENT_RETURN_VALUE;
}
else
{
- value = asinf128(value);
+ value = FP128_FUNC(asin)(value);
}
__gg__float128_to_field( dest,
@@ -1083,12 +1085,12 @@ __gg__atan( cblc_field_t *dest,
{
// FUNCTION ATAN
- _Float128 value;
+ GCOB_FP128 value;
value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
- value = atanf128(value);
+ value = FP128_FUNC(atan)(value);
__gg__float128_to_field( dest,
value,
@@ -1195,10 +1197,10 @@ __gg__cos(cblc_field_t *dest,
{
// FUNCTION COS
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
- value = cosf128(value);
+ value = FP128_FUNC(cos)(value);
__gg__float128_to_field(dest,
value,
truncation_e,
@@ -1368,7 +1370,8 @@ void
__gg__e(cblc_field_t *dest)
{
// FUNCTION E
- static _Float128 e = 2.7182818284590452353602874713526624977572Q;
+ static GCOB_FP128 e
+ = GCOB_FP128_LITERAL(2.7182818284590452353602874713526624977572);
__gg__float128_to_field(dest,
e,
truncation_e,
@@ -1384,10 +1387,10 @@ __gg__exp(cblc_field_t *dest,
{
// FUNCTION EXP
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
- value = expf128(value);
+ value = FP128_FUNC(exp)(value);
__gg__float128_to_field(dest,
value,
truncation_e,
@@ -1403,10 +1406,10 @@ __gg__exp10(cblc_field_t *dest,
{
// FUNCTION EXP10
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
- value = powf128(10.0Q, value);
+ value = FP128_FUNC(pow)(GCOB_FP128_LITERAL(10.0), value);
__gg__float128_to_field(dest,
value,
truncation_e,
@@ -1658,10 +1661,10 @@ __gg__integer(cblc_field_t *dest,
size_t source_size)
{
// FUNCTION INTEGER
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
- value = floorf128(value);
+ value = FP128_FUNC(floor)(value);
__gg__float128_to_field(dest,
value,
truncation_e,
@@ -1758,10 +1761,10 @@ __gg__integer_part( cblc_field_t *dest,
size_t source_size)
{
// FUNCTION INTEGER-PART
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
- _Float128 retval = floorf128(fabsf128(value));
+ GCOB_FP128 retval = FP128_FUNC(floor)(FP128_FUNC(fabs)(value));
if( value < 0 )
{
@@ -1781,7 +1784,7 @@ __gg__fraction_part(cblc_field_t *dest,
size_t source_size)
{
// FUNCTION INTEGER-PART
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
bool is_negative = false;
@@ -1791,7 +1794,7 @@ __gg__fraction_part(cblc_field_t *dest,
value = -value;
}
- _Float128 retval = value - floorf128(value);
+ GCOB_FP128 retval = value - FP128_FUNC(floor)(value);
if( is_negative )
{
@@ -1811,7 +1814,7 @@ __gg__log( cblc_field_t *dest,
size_t source_size)
{
// FUNCTION LOG
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
if( value <= 0.00 )
@@ -1820,7 +1823,7 @@ __gg__log( cblc_field_t *dest,
}
else
{
- _Float128 retval = logf128(value);
+ GCOB_FP128 retval = FP128_FUNC(log)(value);
__gg__float128_to_field(dest,
retval,
truncation_e,
@@ -1836,7 +1839,7 @@ __gg__log10( cblc_field_t *dest,
size_t source_size)
{
// FUNCTION LOG10
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
if( value <= 0.00 )
@@ -1845,7 +1848,7 @@ __gg__log10( cblc_field_t *dest,
}
else
{
- _Float128 retval = log10f128(value);
+ GCOB_FP128 retval = FP128_FUNC(log10)(value);
__gg__float128_to_field(dest,
retval,
truncation_e,
@@ -1931,7 +1934,7 @@ __gg__max(cblc_field_t *dest,
}
else
{
- _Float128 retval;
+ GCOB_FP128 retval;
bool first_time = true;
assert(ncount);
for(size_t i=0; i<ncount; i++)
@@ -1948,7 +1951,7 @@ __gg__max(cblc_field_t *dest,
}
else
{
- _Float128 candidate = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], __gg__treeplet_1o[i], __gg__treeplet_1s[i]);
+ GCOB_FP128 candidate = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], __gg__treeplet_1o[i], __gg__treeplet_1s[i]);
if( candidate >= retval )
{
retval = candidate;
@@ -1992,7 +1995,7 @@ __gg__mean( cblc_field_t *dest,
{
// FUNCTION MEAN
size_t k_count;
- _Float128 sum = kahan_summation(ninputs,
+ GCOB_FP128 sum = kahan_summation(ninputs,
__gg__treeplet_1f,
__gg__treeplet_1o,
__gg__treeplet_1s,
@@ -2021,7 +2024,7 @@ __gg__median( cblc_field_t *dest,
size_t list_size = 1;
- _Float128 *the_list = (_Float128 *)malloc(list_size *sizeof(_Float128));
+ GCOB_FP128 *the_list = (GCOB_FP128 *)malloc(list_size *sizeof(GCOB_FP128));
size_t k_count = 0;
assert(ncount);
for(size_t i=0; i<ncount; i++)
@@ -2034,7 +2037,7 @@ __gg__median( cblc_field_t *dest,
if(k_count >= list_size)
{
list_size *= 2;
- the_list = (_Float128 *)realloc(the_list, list_size *sizeof(_Float128));
+ the_list = (GCOB_FP128 *)realloc(the_list, list_size *sizeof(GCOB_FP128));
}
the_list[k_count] = __gg__float128_from_qualified_field(__gg__treeplet_1f[i],
@@ -2050,7 +2053,7 @@ __gg__median( cblc_field_t *dest,
}
std::sort(the_list, the_list+k_count);
- _Float128 retval;
+ GCOB_FP128 retval;
size_t i=k_count/2;
if( k_count & 1 )
{
@@ -2073,9 +2076,9 @@ __gg__midrange( cblc_field_t *dest,
size_t ncount)
{
// FUNCTION MIDRANGE
- _Float128 val;
- _Float128 min=0;
- _Float128 max=0;
+ GCOB_FP128 val;
+ GCOB_FP128 min=0;
+ GCOB_FP128 max=0;
bool first_time = true;
assert(ncount);
for(size_t i=0; i<ncount; i++)
@@ -2102,7 +2105,7 @@ __gg__midrange( cblc_field_t *dest,
}
}
}
- _Float128 retval = (min + max)/2.0;
+ GCOB_FP128 retval = (min + max)/2.0;
__gg__float128_to_field(dest,
retval,
truncation_e,
@@ -2187,7 +2190,7 @@ __gg__min(cblc_field_t *dest,
}
else
{
- _Float128 retval;
+ GCOB_FP128 retval;
bool first_time = true;
assert(ncount);
for(size_t i=0; i<ncount; i++)
@@ -2204,7 +2207,7 @@ __gg__min(cblc_field_t *dest,
}
else
{
- _Float128 candidate = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], __gg__treeplet_1o[i], __gg__treeplet_1s[i]);
+ GCOB_FP128 candidate = __gg__float128_from_qualified_field(__gg__treeplet_1f[i], __gg__treeplet_1o[i], __gg__treeplet_1s[i]);
if( candidate < retval )
{
retval = candidate;
@@ -2576,7 +2579,7 @@ numval_c( cblc_field_t *dest,
char *pend = pstart + src_size;
char *p = pstart;
- _Float128 retval = 0;
+ GCOB_FP128 retval = 0;
int sign = 0;
int rdigits = 0;
int rdigit_bump = 0;
@@ -3146,7 +3149,8 @@ __gg__pi(cblc_field_t *dest)
{
// FUNCTION PI
- static _Float128 pi = 3.141592653589793238462643383279502884Q;
+ static GCOB_FP128 pi
+ = GCOB_FP128_LITERAL(3.141592653589793238462643383279502884);
__gg__float128_to_field(dest,
pi,
truncation_e,
@@ -3158,10 +3162,10 @@ void
__gg__present_value(cblc_field_t *dest,
size_t ncount)
{
- _Float128 discount = 0;;
- _Float128 denom = 1;
+ GCOB_FP128 discount = 0;;
+ GCOB_FP128 denom = 1;
- _Float128 retval = 0;
+ GCOB_FP128 retval = 0;
bool first_time = true;
for(size_t i=0; i<ncount; i++)
{
@@ -3172,19 +3176,19 @@ __gg__present_value(cblc_field_t *dest,
if(first_time)
{
first_time = false;
- _Float128 arg1 = __gg__float128_from_qualified_field(__gg__treeplet_1f[i],
+ GCOB_FP128 arg1 = __gg__float128_from_qualified_field(__gg__treeplet_1f[i],
__gg__treeplet_1o[i],
__gg__treeplet_1s[i]);
- if( arg1 <= -1.0Q )
+ if( arg1 <= GCOB_FP128_LITERAL(-1.0) )
{
exception_raise(ec_argument_function_e);
break;
}
- discount = 1.0Q / (1.0Q + arg1);
+ discount = GCOB_FP128_LITERAL(1.0) / (GCOB_FP128_LITERAL(1.0) + arg1);
}
else
{
- _Float128 arg = __gg__float128_from_qualified_field(__gg__treeplet_1f[i],
+ GCOB_FP128 arg = __gg__float128_from_qualified_field(__gg__treeplet_1f[i],
__gg__treeplet_1o[i],
__gg__treeplet_1s[i]);
denom *= discount;
@@ -3210,9 +3214,9 @@ __gg__range(cblc_field_t *dest,
{
// FUNCTION RANGE
bool first_time = true;
- _Float128 val;
- _Float128 min;
- _Float128 max;
+ GCOB_FP128 val;
+ GCOB_FP128 min;
+ GCOB_FP128 max;
assert(ncount > 0);
for(size_t i=0; i<ncount; i++)
@@ -3240,7 +3244,7 @@ __gg__range(cblc_field_t *dest,
}
}
- _Float128 retval = max - min;
+ GCOB_FP128 retval = max - min;
__gg__float128_to_field(dest,
retval,
truncation_e,
@@ -3264,15 +3268,15 @@ __gg__rem(cblc_field_t *dest,
// The ISO spec says:
// ((argument-1) – ((argument-2) * FUNCTION INTEGER-PART ((argument-1) / (argument-2))))
- _Float128 arg1 = __gg__float128_from_qualified_field( par1,
+ GCOB_FP128 arg1 = __gg__float128_from_qualified_field( par1,
par1_offset,
par1_size);
- _Float128 arg2 = __gg__float128_from_qualified_field( par2,
+ GCOB_FP128 arg2 = __gg__float128_from_qualified_field( par2,
par2_offset,
par2_size);
- _Float128 intpart;
- _Float128 retval;
+ GCOB_FP128 intpart;
+ GCOB_FP128 retval;
if( arg2 == 0 )
{
exception_raise(ec_argument_function_e);
@@ -3280,7 +3284,7 @@ __gg__rem(cblc_field_t *dest,
}
else
{
- modff128(arg1 / arg2, &intpart);
+ FP128_FUNC(modf)(arg1 / arg2, &intpart);
retval = arg1 - arg2 * intpart;
}
@@ -3500,7 +3504,7 @@ __gg__sign( cblc_field_t *dest,
{
// FUNCTION SIGN
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
@@ -3533,11 +3537,11 @@ __gg__sin(cblc_field_t *dest,
{
// FUNCTION SIN
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
- value = sinf128(value);
+ value = FP128_FUNC(sin)(value);
__gg__float128_to_field(dest,
value,
@@ -3554,17 +3558,17 @@ __gg__sqrt( cblc_field_t *dest,
{
// FUNCTION SQRT
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
- if( value <= 0.0Q )
+ if( value <= GCOB_FP128_LITERAL(0.0) )
{
exception_raise(ec_argument_function_e);
}
else
{
- value = sqrtf128(value);
+ value = FP128_FUNC(sqrt)(value);
}
__gg__float128_to_field(dest,
@@ -3579,12 +3583,12 @@ __gg__standard_deviation( cblc_field_t *dest,
size_t ninputs)
{
// FUNCTION STANDARD-DEVIATION
- _Float128 retval = variance(ninputs,
+ GCOB_FP128 retval = variance(ninputs,
__gg__treeplet_1f,
__gg__treeplet_1o,
__gg__treeplet_1s,
__gg__fourplet_flags);
- retval = sqrtf128(retval);
+ retval = FP128_FUNC(sqrt)(retval);
__gg__float128_to_field(dest,
retval,
@@ -3599,7 +3603,7 @@ __gg__sum(cblc_field_t *dest,
{
// FUNCTION SUM
size_t k_count;
- _Float128 sum = kahan_summation(ninputs,
+ GCOB_FP128 sum = kahan_summation(ninputs,
__gg__treeplet_1f,
__gg__treeplet_1o,
__gg__treeplet_1s,
@@ -3620,10 +3624,10 @@ __gg__tan(cblc_field_t *dest,
{
// FUNCTION TAN
- _Float128 value = __gg__float128_from_qualified_field(source,
+ GCOB_FP128 value = __gg__float128_from_qualified_field(source,
source_offset,
source_size);
- value = tanf128(value);
+ value = FP128_FUNC(tan)(value);
__gg__float128_to_field(dest,
value,
truncation_e,
@@ -3743,7 +3747,7 @@ __gg__variance( cblc_field_t *dest,
size_t ncount)
{
// FUNCTION VARIANCE
- _Float128 retval = variance(ncount,
+ GCOB_FP128 retval = variance(ncount,
__gg__treeplet_1f,
__gg__treeplet_1o,
__gg__treeplet_1s,
@@ -4980,7 +4984,7 @@ __gg__numval_f( cblc_field_t *dest,
size_t source_offset,
size_t source_size)
{
- _Float128 value = 0;
+ GCOB_FP128 value = 0;
char *data = (char * )(source->data + source_offset);
char *data_end = data + source_size;
@@ -5004,7 +5008,7 @@ __gg__numval_f( cblc_field_t *dest,
}
}
*p++ = '\0';
- value = strtof128(ach, NULL);
+ value = strtofp128(ach, NULL);
}
__gg__float128_to_field(dest,
value,
diff --git a/libgcobol/libgcobol-fp.h b/libgcobol/libgcobol-fp.h
new file mode 100644
index 0000000..fcfa0a7
--- /dev/null
+++ b/libgcobol/libgcobol-fp.h
@@ -0,0 +1,59 @@
+/* Copyright The GNU Toolchain Authors. */
+
+/* This file is part of the GNU COBOL runtime library (libgcobol).
+
+libgcobol 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 of the License, or (at your option) any later version.
+
+libgcobol 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+/* You must include "config.h" before this file. */
+
+#if __LDBL_MANT_DIG__ == 113 && __LDBL_MIN_EXP__ == -16381
+// Use long double, l suffix on calls, l or L suffix in literals
+# define GCOB_FP128 long double
+# define GCOB_FP128_LITERAL(lit) (lit ## l)
+# define FP128_FUNC(funcname) funcname ## l
+# define FP128_FMT "L"
+# define strtofp128(nptr, endptr) strtold(nptr, endptr)
+# define strfromfp128(str, n, format, fp) snprintf(str, n, format, fp)
+#elif __FLT128_MANT_DIG__ == 113 && __FLT128_MIN_EXP__ == -16381 \
+ && defined(USE_IEC_60559)
+// Use _Float128, f128 suffix on calls, f128 or F128 suffix on literals
+# define GCOB_FP128 _Float128
+# define GCOB_FP128_LITERAL(lit) (lit ## f128)
+# define FP128_FUNC(funcname) funcname ## f128
+# define FP128_FMT ""
+# define strtofp128(nptr, endptr) strtof128(nptr, endptr)
+# define strfromfp128(str, n, format, fp) strfromf128(str, n, format, fp)
+#elif __FLT128_MANT_DIG__ == 113 && __FLT128_MIN_EXP__ == -16381
+// Use __float128, q suffix on calls, q or Q suffix on literals
+# define GCOB_FP128 __float128
+# define GCOB_FP128_LITERAL(lit) (lit ## q)
+# define FP128_FUNC(funcname) funcname ## q
+# define FP128_FMT "Q"
+# define strtofp128(nptr, endptr) strtoflt128(nptr, endptr)
+# define strfromfp128(str, n, format, fp) quadmath_snprintf(str, n, format, fp)
+#else
+# error "libgcobol requires 128b floating point"
+#endif
+
+#if USE_QUADMATH
+/* We will assume that unless we found the 128 to/from string and some
+ representative trig functions, we need libquadmath to support those. */
+# include "quadmath.h"
+#endif
diff --git a/libgcobol/libgcobol.cc b/libgcobol/libgcobol.cc
index f7fa7a7..c438d6b 100644
--- a/libgcobol/libgcobol.cc
+++ b/libgcobol/libgcobol.cc
@@ -50,6 +50,7 @@
#include <sys/resource.h>
#include "config.h"
+#include "libgcobol-fp.h"
#include "ec.h"
#include "common-defs.h"
@@ -216,12 +217,16 @@ local_ec_type_descr( ec_type_t type ) {
return p;
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+// Keep this debugging function around for when it is needed
static const char *
local_ec_type_str( ec_type_t type ) {
if( type == ec_none_e ) return "EC-NONE";
auto p = local_ec_type_descr(type);
return p->name;
}
+#pragma GCC diagnostic pop
ec_status_t& ec_status_t::update() {
handled = ec_type_t(__gg__exception_handled);
@@ -233,13 +238,6 @@ ec_status_t& ec_status_t::update() {
snprintf(statement, sizeof(statement), "%s", __gg__exception_statement);
}
- if( type != ec_none_e && getenv("match_declarative") ) {
- warnx( "ec_status_t::update:%d: EC %s by %s handled %02X " , __LINE__,
- local_ec_type_str(type),
- __gg__exception_statement? statement : "<none>",
- handled ); // might be file-status, not ec_type_t
- }
-
return *this;
}
@@ -881,10 +879,12 @@ int128_to_int128_rounded( cbl_round_t rounded,
int *compute_error)
{
// value is signed, and is scaled to the target
- _Float128 fpart = _Float128(remainder) / _Float128(factor);
+ GCOB_FP128 fpart = ((GCOB_FP128)remainder) / ((GCOB_FP128)factor);
__int128 retval = value;
- if(rounded == nearest_even_e && fpart != -0.5Q && fpart != 0.5Q )
+ if(rounded == nearest_even_e
+ && fpart != GCOB_FP128_LITERAL (-0.5)
+ && fpart != GCOB_FP128_LITERAL (0.5))
{
// "bankers rounding" has been requested.
//
@@ -905,14 +905,14 @@ int128_to_int128_rounded( cbl_round_t rounded,
// 0.5 through 0.9 becomes 1
if( value < 0 )
{
- if( fpart <= -0.5Q )
+ if( fpart <= GCOB_FP128_LITERAL(-0.5) )
{
retval -= 1;
}
}
else
{
- if( fpart >= 0.5Q )
+ if( fpart >= GCOB_FP128_LITERAL(0.5) )
{
retval += 1;
}
@@ -946,14 +946,14 @@ int128_to_int128_rounded( cbl_round_t rounded,
// 0.6 through 0.9 becomes 1
if( value < 0 )
{
- if( fpart < -0.5Q )
+ if( fpart < GCOB_FP128_LITERAL(-0.5) )
{
retval -= 1;
}
}
else
{
- if( fpart > 0.5Q )
+ if( fpart > GCOB_FP128_LITERAL(0.5) )
{
retval += 1;
}
@@ -1035,15 +1035,17 @@ int128_to_int128_rounded( cbl_round_t rounded,
static __int128
f128_to_i128_rounded( cbl_round_t rounded,
- _Float128 value,
+ GCOB_FP128 value,
int *compute_error)
{
// value is signed, and is scaled to the target
- _Float128 ipart;
- _Float128 fpart = modff128(value, &ipart);
+ GCOB_FP128 ipart;
+ GCOB_FP128 fpart = FP128_FUNC(modf)(value, &ipart);
__int128 retval = (__int128)ipart;
- if(rounded == nearest_even_e && fpart != -0.5Q && fpart != 0.5Q )
+ if(rounded == nearest_even_e
+ && fpart != GCOB_FP128_LITERAL (-0.5)
+ && fpart != GCOB_FP128_LITERAL (0.5))
{
// "bankers rounding" has been requested.
//
@@ -1064,14 +1066,14 @@ f128_to_i128_rounded( cbl_round_t rounded,
// 0.5 through 0.9 becomes 1
if( value < 0 )
{
- if( fpart <= -0.5Q )
+ if( fpart <= GCOB_FP128_LITERAL (-0.5) )
{
retval -= 1;
}
}
else
{
- if( fpart >= 0.5Q )
+ if( fpart >= GCOB_FP128_LITERAL (0.5) )
{
retval += 1;
}
@@ -1105,14 +1107,14 @@ f128_to_i128_rounded( cbl_round_t rounded,
// 0.6 through 0.9 becomes 1
if( value < 0 )
{
- if( fpart < -0.5Q )
+ if( fpart < GCOB_FP128_LITERAL (-0.5) )
{
retval -= 1;
}
}
else
{
- if( fpart > 0.5Q )
+ if( fpart > GCOB_FP128_LITERAL (0.5) )
{
retval += 1;
}
@@ -1276,8 +1278,8 @@ int128_to_field(cblc_field_t *var,
{
value = -value;
}
- _Float128 tvalue = (_Float128 )value;
- tvalue /= (_Float128 )__gg__power_of_ten(source_rdigits);
+ GCOB_FP128 tvalue = (GCOB_FP128 )value;
+ tvalue /= (GCOB_FP128 )__gg__power_of_ten(source_rdigits);
// *(_Float128 *)location = tvalue;
// memcpy because *(_Float128 *) requires a 16-byte boundary.
memcpy(location, &tvalue, 16);
@@ -2202,7 +2204,7 @@ extern "C"
void
__gg__clock_gettime(clockid_t clk_id, struct timespec *tp)
{
- const char *p = getenv("COB_CURRENT_DATE");
+ const char *p = getenv("GCOBOL_CURRENT_DATE");
if( p )
{
@@ -2573,7 +2575,7 @@ __gg__dirty_to_binary_internal( const char *dirty,
}
extern "C"
-_Float128
+GCOB_FP128
__gg__dirty_to_float( const char *dirty,
int length)
{
@@ -2589,7 +2591,7 @@ __gg__dirty_to_float( const char *dirty,
// It also can handle 12345E-2 notation.
- _Float128 retval = 0;
+ GCOB_FP128 retval = 0;
int rdigits = 0;
int hyphen = 0;
@@ -3244,9 +3246,9 @@ format_for_display_internal(char **dest,
// We can't use *(_Float64 *)actual_location;
// That uses the SSE registers, which won't work if the source isn't
// on a 16-bit boundary.
- _Float128 floatval;
+ GCOB_FP128 floatval;
memcpy(&floatval, actual_location, 16);
- strfromf128(ach, sizeof(ach), "%.36E", floatval);
+ strfromfp128(ach, sizeof(ach), "%.36" FP128_FMT "E", floatval);
char *p = strchr(ach, 'E');
if( !p )
{
@@ -3268,8 +3270,8 @@ format_for_display_internal(char **dest,
int precision = 36 - exp;
char achFormat[24];
- sprintf(achFormat, "%%.%df", precision);
- strfromf128(ach, sizeof(ach), achFormat, floatval);
+ sprintf(achFormat, "%%.%d" FP128_FMT "f", precision);
+ strfromfp128(ach, sizeof(ach), achFormat, floatval);
}
__gg__remove_trailing_zeroes(ach);
__gg__realloc_if_necessary(dest, dest_size, strlen(ach)+1);
@@ -3481,11 +3483,11 @@ compare_88( const char *list,
return cmpval;
}
-static _Float128
+static GCOB_FP128
get_float128( cblc_field_t *field,
unsigned char *location )
{
- _Float128 retval=0;
+ GCOB_FP128 retval=0;
if(field->type == FldFloat )
{
switch( field->capacity )
@@ -3508,7 +3510,7 @@ get_float128( cblc_field_t *field,
{
if( __gg__decimal_point == '.' )
{
- retval = strtof128(field->initial, NULL);
+ retval = strtofp128(field->initial, NULL);
}
else
{
@@ -3526,7 +3528,7 @@ get_float128( cblc_field_t *field,
{
*p = '.';
}
- retval = strtof128(buffer, NULL);
+ retval = strtofp128(buffer, NULL);
}
}
else
@@ -3710,7 +3712,7 @@ compare_field_class(cblc_field_t *conditional,
case FldFloat:
{
- _Float128 value = get_float128(conditional, conditional_location) ;
+ GCOB_FP128 value = get_float128(conditional, conditional_location) ;
char *walker = list->initial;
while(*walker)
{
@@ -3734,7 +3736,7 @@ compare_field_class(cblc_field_t *conditional,
walker = right + right_len;
- _Float128 left_value;
+ GCOB_FP128 left_value;
if( left_flag == 'F' && left[0] == 'Z' )
{
left_value = 0;
@@ -3745,7 +3747,7 @@ compare_field_class(cblc_field_t *conditional,
left_len);
}
- _Float128 right_value;
+ GCOB_FP128 right_value;
if( right_flag == 'F' && right[0] == 'Z' )
{
right_value = 0;
@@ -4100,7 +4102,7 @@ __gg__compare_2(cblc_field_t *left_side,
case FldFloat:
{
- _Float128 value = __gg__float128_from_location(left_side,
+ GCOB_FP128 value = __gg__float128_from_location(left_side,
left_location);
retval = 0;
retval = value < 0 ? -1 : retval;
@@ -4157,8 +4159,8 @@ __gg__compare_2(cblc_field_t *left_side,
if( left_side->type == FldFloat && right_side->type == FldFloat )
{
// One or the other of the numerics is a FldFloat
- _Float128 left_value = __gg__float128_from_location(left_side, left_location);
- _Float128 right_value = __gg__float128_from_location(right_side, right_location);
+ GCOB_FP128 left_value = __gg__float128_from_location(left_side, left_location);
+ GCOB_FP128 right_value = __gg__float128_from_location(right_side, right_location);
retval = 0;
retval = left_value < right_value ? -1 : retval;
retval = left_value > right_value ? 1 : retval;
@@ -4170,8 +4172,8 @@ __gg__compare_2(cblc_field_t *left_side,
{
// The left side is a FldFloat; the other is another type of numeric:
int rdecimals;
- _Float128 left_value;
- _Float128 right_value;
+ GCOB_FP128 left_value;
+ GCOB_FP128 right_value;
if( right_side->type == FldLiteralN)
{
@@ -4203,7 +4205,7 @@ __gg__compare_2(cblc_field_t *left_side,
case 4:
{
_Float32 left_value = *(_Float32 *)left_location;
- _Float32 right_value = strtof32(buffer, NULL);
+ _Float32 right_value = strtof(buffer, NULL);
retval = 0;
retval = left_value < right_value ? -1 : retval;
retval = left_value > right_value ? 1 : retval;
@@ -4212,7 +4214,7 @@ __gg__compare_2(cblc_field_t *left_side,
case 8:
{
_Float64 left_value = *(_Float64 *)left_location;
- _Float64 right_value = strtof64(buffer, NULL);
+ _Float64 right_value = strtod(buffer, NULL);
retval = 0;
retval = left_value < right_value ? -1 : retval;
retval = left_value > right_value ? 1 : retval;
@@ -4221,9 +4223,9 @@ __gg__compare_2(cblc_field_t *left_side,
case 16:
{
//_Float128 left_value = *(_Float128 *)left_location;
- _Float128 left_value;
+ GCOB_FP128 left_value;
memcpy(&left_value, left_location, 16);
- _Float128 right_value = strtof128(buffer, NULL);
+ GCOB_FP128 right_value = strtofp128(buffer, NULL);
retval = 0;
retval = left_value < right_value ? -1 : retval;
retval = left_value > right_value ? 1 : retval;
@@ -5725,7 +5727,7 @@ __gg__move( cblc_field_t *fdest,
case 16:
{
//_Float128 val = *(_Float128 *)(fsource->data+source_offset);
- _Float128 val;
+ GCOB_FP128 val;
memcpy(&val, fsource->data+source_offset, 16);
if(val < 0)
{
@@ -5813,7 +5815,7 @@ __gg__move( cblc_field_t *fdest,
// We are converted a floating-point value fixed-point
rdigits = get_scaled_rdigits(fdest);
- _Float128 value=0;
+ GCOB_FP128 value=0;
switch(fsource->capacity)
{
case 4:
@@ -5963,18 +5965,18 @@ __gg__move( cblc_field_t *fdest,
{
case 4:
{
- *(float *)(fdest->data+dest_offset) = strtof32(ach, NULL);
+ *(float *)(fdest->data+dest_offset) = strtof(ach, NULL);
break;
}
case 8:
{
- *(double *)(fdest->data+dest_offset) = strtof64(ach, NULL);
+ *(double *)(fdest->data+dest_offset) = strtod(ach, NULL);
break;
}
case 16:
{
- //*(_Float128 *)(fdest->data+dest_offset) = strtof128(ach, NULL);
- _Float128 t = strtof128(ach, NULL);
+ //*(_Float128 *)(fdest->data+dest_offset) = strtofp128(ach, NULL);
+ GCOB_FP128 t = strtofp128(ach, NULL);
memcpy(fdest->data+dest_offset, &t, 16);
break;
}
@@ -6133,17 +6135,17 @@ __gg__move_literala(cblc_field_t *field,
{
case 4:
{
- *(float *)(field->data+field_offset) = strtof32(ach, NULL);
+ *(float *)(field->data+field_offset) = strtof(ach, NULL);
break;
}
case 8:
{
- *(double *)(field->data+field_offset) = strtof64(ach, NULL);
+ *(double *)(field->data+field_offset) = strtod(ach, NULL);
break;
}
case 16:
{
- _Float128 t = strtof128(ach, NULL);
+ GCOB_FP128 t = strtofp128(ach, NULL);
memcpy(field->data+field_offset, &t, 16);
break;
}
@@ -9127,10 +9129,10 @@ __gg__binary_value_from_qualified_field(int *rdigits,
}
extern "C"
-_Float128
+GCOB_FP128
__gg__float128_from_field( cblc_field_t *field )
{
- _Float128 retval=0;
+ GCOB_FP128 retval=0;
if( field->type == FldFloat || field->type == FldLiteralN )
{
retval = get_float128(field, field->data);
@@ -9138,20 +9140,20 @@ __gg__float128_from_field( cblc_field_t *field )
else
{
int rdigits;
- retval = (_Float128)__gg__binary_value_from_field(&rdigits, field);
+ retval = (GCOB_FP128)__gg__binary_value_from_field(&rdigits, field);
if( rdigits )
{
- retval /= (_Float128)__gg__power_of_ten(rdigits);
+ retval /= (GCOB_FP128)__gg__power_of_ten(rdigits);
}
}
return retval;
}
extern "C"
-_Float128
+GCOB_FP128
__gg__float128_from_qualified_field( cblc_field_t *field, size_t offset, size_t size)
{
- _Float128 retval=0;
+ GCOB_FP128 retval=0;
if( field->type == FldFloat || field->type == FldLiteralN )
{
retval = get_float128(field, field->data+offset);
@@ -9159,10 +9161,10 @@ __gg__float128_from_qualified_field( cblc_field_t *field, size_t offset, size_t
else
{
int rdigits;
- retval = (_Float128)__gg__binary_value_from_qualified_field(&rdigits, field, offset, size);
+ retval = (GCOB_FP128)__gg__binary_value_from_qualified_field(&rdigits, field, offset, size);
if( rdigits )
{
- retval /= (_Float128)__gg__power_of_ten(rdigits);
+ retval /= (GCOB_FP128)__gg__power_of_ten(rdigits);
}
}
return retval;
@@ -9228,7 +9230,7 @@ __gg__int128_to_qualified_field(cblc_field_t *tgt,
static __int128
float128_to_int128( int *rdigits,
cblc_field_t *field,
- _Float128 value,
+ GCOB_FP128 value,
cbl_round_t rounded,
int *compute_error)
{
@@ -9253,7 +9255,7 @@ float128_to_int128( int *rdigits,
// get away with.
// Calculate the number of digits to the left of the decimal point:
- int digits = (int)(floorf128(logf128(fabsf128(value)))+1);
+ int digits = (int)(FP128_FUNC(floor)(FP128_FUNC(log)(FP128_FUNC(fabs)(value)))+1);
// Make sure it is not a negative number
digits = std::max(0, digits);
@@ -9270,12 +9272,12 @@ float128_to_int128( int *rdigits,
// We now multiply our value by 10**rdigits, in order to make the
// floating-point value have the same magnitude as our target __int128
- value *= powf128(10.0Q, (_Float128)(*rdigits));
+ value *= FP128_FUNC(pow)(GCOB_FP128_LITERAL (10.0), (GCOB_FP128)(*rdigits));
// We are ready to cast value to an __int128. But this value could be
// too large to fit, which is an error condition we want to flag:
- if( fabsf128(value) >= 1.0E38Q )
+ if( FP128_FUNC(fabs)(value) >= GCOB_FP128_LITERAL (1.0E38) )
{
*compute_error = compute_error_overflow;
}
@@ -9292,7 +9294,7 @@ static void
float128_to_location( cblc_field_t *tgt,
unsigned char *data,
size_t size,
- _Float128 value,
+ GCOB_FP128 value,
enum cbl_round_t rounded,
int *compute_error)
{
@@ -9303,8 +9305,8 @@ float128_to_location( cblc_field_t *tgt,
switch(tgt->capacity)
{
case 4:
- if( fabsf128(value) == (_Float128)INFINITY
- || fabsf128(value) > 3.4028235E38Q )
+ if( FP128_FUNC(fabs)(value) == (GCOB_FP128)INFINITY
+ || FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL (3.4028235E38) )
{
if( compute_error )
{
@@ -9326,8 +9328,8 @@ float128_to_location( cblc_field_t *tgt,
break;
case 8:
- if( fabsf128(value) == (_Float128)INFINITY
- || fabsf128(value) > 1.7976931348623157E308Q )
+ if( FP128_FUNC(fabs)(value) == (GCOB_FP128)INFINITY
+ || FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL (1.7976931348623157E308) )
{
if( compute_error )
{
@@ -9349,7 +9351,7 @@ float128_to_location( cblc_field_t *tgt,
break;
case 16:
- if( fabsf128(value) == (_Float128)INFINITY )
+ if( FP128_FUNC(fabs)(value) == (GCOB_FP128)INFINITY )
{
if( compute_error )
{
@@ -9378,7 +9380,7 @@ float128_to_location( cblc_field_t *tgt,
digits = tgt->digits;
}
- _Float128 maximum;
+ GCOB_FP128 maximum;
if( digits )
{
@@ -9387,7 +9389,7 @@ float128_to_location( cblc_field_t *tgt,
// When digits is zero, this is a binary value without a PICTURE string.
// we don't truncate in that case
- if( digits && fabsf128(value) >= maximum )
+ if( digits && FP128_FUNC(fabs)(value) >= maximum )
{
*compute_error |= compute_error_truncate;
}
@@ -9415,7 +9417,7 @@ float128_to_location( cblc_field_t *tgt,
extern "C"
void
__gg__float128_to_field(cblc_field_t *tgt,
- _Float128 value,
+ GCOB_FP128 value,
enum cbl_round_t rounded,
int *compute_error)
{
@@ -9431,7 +9433,7 @@ extern "C"
void
__gg__float128_to_qualified_field(cblc_field_t *tgt,
size_t tgt_offset,
- _Float128 value,
+ GCOB_FP128 value,
enum cbl_round_t rounded,
int *compute_error)
{
@@ -10409,7 +10411,7 @@ __gg__fetch_call_by_value_value(cblc_field_t *field,
case 16:
// *(_Float128 *)(&retval) = double(*(_Float128 *)data);
- _Float128 t;
+ GCOB_FP128 t;
memcpy(&t, data, 16);
memcpy(&retval, &t, 16);
break;
@@ -10470,7 +10472,7 @@ __gg__assign_value_from_stack(cblc_field_t *dest, __int128 parameter)
case 16:
// *(_Float128 *)(dest->data) = *(_Float128 *)&parameter;
- _Float128 t;
+ GCOB_FP128 t;
memcpy(&t, &parameter, 16);
memcpy(dest->data, &t, 16);
break;
@@ -10983,13 +10985,6 @@ class match_file_declarative {
bool operator()( const cbl_declarative_t& dcl ) {
- if( getenv("match_declarative") && oops.type) {
- warnx("match_file_declarative: checking: oops %s dcl %s (handled %s) ",
- local_ec_type_str(oops.type),
- local_ec_type_str(dcl.type),
- local_ec_type_str(handled_type));
- }
-
// Declarative is for the raised exception and not handled by the statement.
if( handled() ) return false;
bool matches = enabled_ECs.match(dcl.type);
@@ -11003,13 +10998,6 @@ class match_file_declarative {
}
}
- if( matches && getenv("match_declarative") ) {
- warnx(" matches exception %s (file %zu mode %s)",
- local_ec_type_str(oops.type),
- oops.file,
- cbl_file_mode_str(oops.mode));
- }
-
return matches;
}
};
@@ -11209,25 +11197,12 @@ __gg__match_exception( cblc_field_t *index,
p = std::find_if( dcls + 1, eodcls, [ec] (const cbl_declarative_t& dcl) {
if( ! enabled_ECs.match(dcl.type) ) return false;
if( ! ec_cmp(ec, dcl.type) ) return false;
-
- if( getenv("match_declarative") ) {
- warnx("__gg__match_exception:%d: matched "
- "%s against mask %s for section #%zu",
- __LINE__,
- local_ec_type_str(ec), local_ec_type_str(dcl.type),
- dcl.section);
- }
return true;
} );
if( p == eodcls ) {
default_exception_handler(ec);
}
} else { // not enabled
- if( getenv("match_declarative") ) {
- warnx("__gg__match_exception:%d: raised exception "
- "%s is disabled (%zu enabled)", __LINE__,
- local_ec_type_str(ec), enabled_ECs.nec);
- }
}
}
@@ -11306,10 +11281,10 @@ __gg__pseudo_return_flush()
}
extern "C"
-_Float128
+GCOB_FP128
__gg__float128_from_location(cblc_field_t *var, unsigned char *location)
{
- _Float128 retval = 0;
+ GCOB_FP128 retval = 0;
switch( var->capacity )
{
case 4:
@@ -11338,9 +11313,9 @@ extern "C"
__int128
__gg__integer_from_float128(cblc_field_t *field)
{
- _Float128 fvalue = __gg__float128_from_location(field, field->data);
+ GCOB_FP128 fvalue = __gg__float128_from_location(field, field->data);
// we round() to take care of the possible 2.99999999999... problem.
- fvalue = roundf128(fvalue);
+ fvalue = FP128_FUNC(round)(fvalue);
return (__int128)fvalue;
}
@@ -11459,10 +11434,6 @@ extern "C"
void
__gg__set_exception_file(cblc_file_t *file)
{
- if( getenv("match_declarative") )
- {
- warnx("%s: %s", __func__, file->name);
- }
recent_file = file;
ec_type_t ec = local_ec_type_of( file->io_status );
if( ec )
@@ -11519,10 +11490,6 @@ extern "C"
void
__gg__set_exception_code(ec_type_t ec, int from_raise_statement)
{
- if( getenv("match_declarative") )
- {
- warnx("%s: raised %02x", __func__, ec);
- }
sv_from_raise_statement = from_raise_statement;
__gg__exception_code = ec;
@@ -11566,13 +11533,13 @@ __gg__float32_from_int128(cblc_field_t *destination,
int *size_error)
{
int rdigits;
- _Float128 value = get_binary_value_local( &rdigits,
+ GCOB_FP128 value = get_binary_value_local( &rdigits,
source,
source->data + source_offset,
source->capacity);
value /= __gg__power_of_ten(rdigits);
- if( fabsf128(value) > 3.4028235E38Q )
+ if( FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL (3.4028235E38) )
{
if(size_error)
{
@@ -11607,7 +11574,7 @@ __gg__float64_from_int128(cblc_field_t *destination,
*size_error = 0;
}
int rdigits;
- _Float128 value = get_binary_value_local( &rdigits,
+ GCOB_FP128 value = get_binary_value_local( &rdigits,
source,
source->data + source_offset,
source->capacity);
@@ -11630,7 +11597,7 @@ __gg__float128_from_int128(cblc_field_t *destination,
{
if(size_error) *size_error = 0;
int rdigits;
- _Float128 value = get_binary_value_local( &rdigits,
+ GCOB_FP128 value = get_binary_value_local( &rdigits,
source,
source->data + source_offset,
source->capacity);
@@ -11657,7 +11624,7 @@ __gg__is_float_infinite(cblc_field_t *source, size_t offset)
break;
case 16:
// retval = *(_Float128*)(source->data+offset) == INFINITY;
- _Float128 t;
+ GCOB_FP128 t;
memcpy(&t, source->data+offset, 16);
retval = t == INFINITY;
break;
@@ -11674,9 +11641,9 @@ __gg__float32_from_128( cblc_field_t *dest,
{
int retval = 0;
//_Float128 value = *(_Float128*)(source->data+source_offset);
- _Float128 value;
+ GCOB_FP128 value;
memcpy(&value, source->data+source_offset, 16);
- if( fabsf128(value) > 3.4028235E38Q )
+ if( FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL (3.4028235E38) )
{
retval = 1;
}
@@ -11696,7 +11663,7 @@ __gg__float32_from_64( cblc_field_t *dest,
{
int retval = 0;
_Float64 value = *(_Float64*)(source->data+source_offset);
- if( fabsf128(value) > 3.4028235E38Q )
+ if( FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL (3.4028235E38) )
{
retval = 1;
}
@@ -11716,9 +11683,9 @@ __gg__float64_from_128( cblc_field_t *dest,
{
int retval = 0;
// _Float128 value = *(_Float128*)(source->data+source_offset);
- _Float128 value;
+ GCOB_FP128 value;
memcpy(&value, source->data+source_offset, 16);
- if( fabsf128(value) > 1.7976931348623157E308 )
+ if( FP128_FUNC(fabs)(value) > GCOB_FP128_LITERAL(1.7976931348623157E308) )
{
retval = 1;
}
@@ -11970,7 +11937,7 @@ __gg__function_handle_from_cobpath( char *unmangled_name, char *mangled_name)
}
if( !retval )
{
- const char *COBPATH = getenv("COBPATH");
+ const char *COBPATH = getenv("GCOBOL_LIBRARY_PATH");
retval = find_in_dirs(COBPATH, unmangled_name, mangled_name);
}
if( !retval )
diff --git a/libgcobol/libgcobol.h b/libgcobol/libgcobol.h
index 246ef51..f35987d 100644
--- a/libgcobol/libgcobol.h
+++ b/libgcobol/libgcobol.h
@@ -67,7 +67,7 @@ extern "C" void __gg__int128_to_field(cblc_field_t *tgt,
enum cbl_round_t rounded,
int *compute_error);
extern "C" void __gg__float128_to_field(cblc_field_t *tgt,
- _Float128 value,
+ GCOB_FP128 value,
enum cbl_round_t rounded,
int *compute_error);
extern "C" void __gg__int128_to_qualified_field(cblc_field_t *tgt,
@@ -79,10 +79,9 @@ extern "C" void __gg__int128_to_qualified_field(cblc_field_t *tgt,
int *compute_error);
extern "C" void __gg__float128_to_qualified_field(cblc_field_t *tgt,
size_t tgt_offset,
- _Float128 value,
+ GCOB_FP128 value,
enum cbl_round_t rounded,
int *compute_error);
-
extern "C" void __gg__double_to_target( cblc_field_t *tgt,
double tgt_value,
cbl_round_t rounded);
@@ -91,7 +90,8 @@ extern "C" char __gg__get_decimal_point();
extern "C" char * __gg__get_default_currency_string();
extern "C" void __gg__clock_gettime(clockid_t clk_id, struct timespec *tp);
-extern "C" _Float128 __gg__float128_from_location(cblc_field_t *var,
+
+extern "C" GCOB_FP128 __gg__float128_from_location(cblc_field_t *var,
unsigned char *location);
extern "C" void __gg__adjust_dest_size(cblc_field_t *dest, size_t ncount);
@@ -104,7 +104,7 @@ extern "C" __int128 __gg__binary_value_from_qualified_field(int *rdigits,
cblc_field_t *var,
size_t offset,
size_t size);
-extern "C" _Float128 __gg__float128_from_qualified_field(cblc_field_t *field,
+extern "C" GCOB_FP128 __gg__float128_from_qualified_field(cblc_field_t *field,
size_t offset,
size_t size);
extern "C" __int128 __gg__integer_from_qualified_field(cblc_field_t *var,
diff --git a/libgcobol/libgcobol.spec.in b/libgcobol/libgcobol.spec.in
index e8ccc0d..461587d 100644
--- a/libgcobol/libgcobol.spec.in
+++ b/libgcobol/libgcobol.spec.in
@@ -5,4 +5,4 @@
#
%rename lib liborig
-*lib: @LIBM@ %(liborig)
+*lib: @LIBQUADSPEC@ @LIBM@ %(liborig)
diff --git a/libgcobol/valconv.cc b/libgcobol/valconv.cc
index 33d9a0d..7e58301 100644
--- a/libgcobol/valconv.cc
+++ b/libgcobol/valconv.cc
@@ -853,14 +853,14 @@ got_float:
}
else
{
- const char *decimal_location = index(dest, __gg__decimal_point);
+ const char *decimal_location = strchr(dest, __gg__decimal_point);
if( !decimal_location )
{
- decimal_location = index(dest, ascii_v);
+ decimal_location = strchr(dest, ascii_v);
}
if( !decimal_location )
{
- decimal_location = index(dest, ascii_V);
+ decimal_location = strchr(dest, ascii_V);
}
if( !decimal_location )
{
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index a9d8e93..956b43d 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,27 @@
+2025-04-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/119502
+ * io/close.c (st_close): Issue an error and avoid
+ calling close_share when there is no stream assigned.
+ * io/open.c (st_open): If there is no stream assigned
+ to the unit, unlock the unit and issue an error.
+
+2025-04-09 Paul Thomas <pault@gcc.gnu.org>
+ and Harald Anlauf <anlauf@gcc.gnu.org>
+
+ PR libfortran/119460
+ * intrinsics/reduce.c (reduce): Correct error message about
+ mismatch between dim and the rank of array. Output the values
+ of both. Correct the evaluation of the result stride and
+ extent.
+ (reduce_scalar): The front end treats the result as an
+ allocatable so eliminate memcpy and free. Return the base-addr
+ of the local descriptor.
+ (reduce_c): Correct the type of the string lengths.
+ (reduce_scalar_c): Correct the type of the string lengths.Test
+ to see if 'res' is allocated. If not then return the base_addr
+ of the local descriptor.
+
2025-04-07 Lulu Cheng <chenglulu@loongson.cn>
PR target/119408
diff --git a/libgfortran/io/close.c b/libgfortran/io/close.c
index 8122311..41d278c 100644
--- a/libgfortran/io/close.c
+++ b/libgfortran/io/close.c
@@ -84,8 +84,17 @@ st_close (st_parameter_close *clp)
if (u != NULL)
{
- if (close_share (u) < 0)
- generate_error (&clp->common, LIBERROR_OS, "Problem in CLOSE");
+ if (u->s == NULL)
+ {
+ if (u->unit_number < 0)
+ generate_error (&clp->common, LIBERROR_BAD_UNIT,
+ "Unit number is negative with no associated file");
+ library_end ();
+ return;
+ }
+ else
+ if (close_share (u) < 0)
+ generate_error (&clp->common, LIBERROR_OS, "Problem in CLOSE");
if (u->flags.status == STATUS_SCRATCH)
{
if (status == CLOSE_KEEP)
diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c
index 06ddf7f..e9fb0a7 100644
--- a/libgfortran/io/open.c
+++ b/libgfortran/io/open.c
@@ -912,6 +912,16 @@ st_open (st_parameter_open *opp)
library_end ();
return;
}
+
+ if (u->s == NULL)
+ {
+ unlock_unit (u);
+ generate_error (&opp->common, LIBERROR_BAD_OPTION,
+ "Unit number is negative and unit was not already "
+ "opened with OPEN(NEWUNIT=...)");
+ library_end ();
+ return;
+ }
}
if (u == NULL)
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 6592b0b..096e17b 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,169 @@
+2025-04-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR libgomp/119849
+ * testsuite/libgomp.c++/allocator-1.C (test_inequality, main): Guard
+ ompx::allocator::gnu_pinned_mem uses with #ifdef __gnu_linux__.
+ * testsuite/libgomp.c++/allocator-2.C (main): Likewise.
+
+2025-04-17 Tobias Burnus <tburnus@baylibre.com>
+
+ * libgomp.texi (gcn interop, nvptx interop): For HIP with C/C++, add
+ a note about setting a preprocessor define.
+
+2025-04-16 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * testsuite/libgomp.c++/target-exceptions-pr118794-1.C: Remove
+ 'ALWAYS_INLINE' workaround.
+
+2025-04-16 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR target/106445
+ * testsuite/libgomp.c++/pr106445-1.C: New.
+ * testsuite/libgomp.c++/pr106445-1-O0.C: Likewise.
+
+2025-04-16 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR target/97106
+ * testsuite/libgomp.c++/pr96390.C: Un-XFAIL nvptx offloading.
+ * testsuite/libgomp.c-c++-common/pr96390.c: Adjust.
+
+2025-04-15 Tobias Burnus <tburnus@baylibre.com>
+
+ * libgomp.texi (gcn, nvptx): Mention self_maps clause
+ besides unified_shared_memory in the requirements item.
+
+2025-04-15 waffl3x <waffl3x@baylibre.com>
+
+ * omp.h.in: Add omp::allocator::* and ompx::allocator::* allocators.
+ (__detail::__allocator_templ<T, omp_allocator_handle_t>):
+ New struct template.
+ (null_allocator<T>): New struct template.
+ (default_mem<T>): Likewise.
+ (large_cap_mem<T>): Likewise.
+ (const_mem<T>): Likewise.
+ (high_bw_mem<T>): Likewise.
+ (low_lat_mem<T>): Likewise.
+ (cgroup_mem<T>): Likewise.
+ (pteam_mem<T>): Likewise.
+ (thread_mem<T>): Likewise.
+ (ompx::allocator::gnu_pinned_mem<T>): Likewise.
+ * testsuite/libgomp.c++/allocator-1.C: New test.
+ * testsuite/libgomp.c++/allocator-2.C: New test.
+
+2025-04-15 Tobias Burnus <tburnus@baylibre.com>
+
+ * libgomp.texi (5.0 Impl. Status): Mark mapping alloc comps as 'Y'.
+ * testsuite/libgomp.fortran/allocatable-comp.f90: New test.
+ * testsuite/libgomp.fortran/map-alloc-comp-3.f90: New test.
+ * testsuite/libgomp.fortran/map-alloc-comp-4.f90: New test.
+ * testsuite/libgomp.fortran/map-alloc-comp-5.f90: New test.
+ * testsuite/libgomp.fortran/map-alloc-comp-6.f90: New test.
+ * testsuite/libgomp.fortran/map-alloc-comp-7.f90: New test.
+ * testsuite/libgomp.fortran/map-alloc-comp-8.f90: New test.
+ * testsuite/libgomp.fortran/map-alloc-comp-9.f90: New test.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR target/118794
+ * testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-GCN.C:
+ Set '-foffload-options=-mno-fake-exceptions'.
+ * testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-nvptx.C:
+ Likewise.
+ * testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-GCN.C:
+ Likewise.
+ * testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-nvptx.C:
+ Likewise.
+ * testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-GCN.C:
+ Likewise.
+ * testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-nvptx.C:
+ Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-GCN.C:
+ Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-nvptx.C:
+ Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-GCN.C:
+ Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-nvptx.C:
+ Likewise.
+ * testsuite/libgomp.c++/target-exceptions-bad_cast-2.C: Adjust.
+ * testsuite/libgomp.c++/target-exceptions-pr118794-1.C: Likewise.
+ * testsuite/libgomp.c++/target-exceptions-throw-2.C: Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-bad_cast-2.C: Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-throw-2.C: Likewise.
+ * testsuite/libgomp.c++/target-exceptions-throw-2-O0.C: New.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * testsuite/libgomp.c++/target-exceptions-throw-3.C: New.
+ * testsuite/libgomp.oacc-c++/exceptions-throw-3.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * testsuite/libgomp.c++/target-exceptions-throw-2.C: New.
+ * testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-GCN.C: Likewise.
+ * testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-nvptx.C: Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-throw-2.C: Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-GCN.C: Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-nvptx.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * testsuite/libgomp.c++/target-exceptions-throw-1.C: New.
+ * testsuite/libgomp.c++/target-exceptions-throw-1-O0.C: Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-throw-1.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * testsuite/libgomp.c++/target-exceptions-bad_cast-3.C: New.
+ * testsuite/libgomp.oacc-c++/exceptions-bad_cast-3.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * testsuite/libgomp.c++/target-exceptions-bad_cast-2.C: New.
+ * testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-GCN.C: Likewise.
+ * testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-nvptx.C: Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-bad_cast-2.C: Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-GCN.C: Likewise.
+ * testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-nvptx.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * testsuite/libgomp.c++/target-exceptions-bad_cast-1.C: New.
+ * testsuite/libgomp.oacc-c++/exceptions-bad_cast-1.C: Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR target/118794
+ * testsuite/libgomp.c++/target-exceptions-pr118794-1.C: New.
+ * testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-GCN.C:
+ Likewise.
+ * testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-nvptx.C:
+ Likewise.
+
+2025-04-14 Thomas Schwinge <tschwinge@baylibre.com>
+
+ PR c++/119692
+ * testsuite/libgomp.c++/pr119692-1-1.C: New.
+ * testsuite/libgomp.c++/pr119692-1-2.C: Likewise.
+ * testsuite/libgomp.c++/pr119692-1-3.C: Likewise.
+ * testsuite/libgomp.c++/pr119692-1-4.C: Likewise.
+ * testsuite/libgomp.c++/pr119692-1-5.C: Likewise.
+ * testsuite/libgomp.oacc-c++/pr119692-1-1.C: Likewise.
+ * testsuite/libgomp.oacc-c++/pr119692-1-2.C: Likewise.
+ * testsuite/libgomp.oacc-c++/pr119692-1-3.C: Likewise.
+
+2025-04-10 Richard Sandiford <richard.sandiford@arm.com>
+
+ * testsuite/libgomp.c-target/aarch64/firstprivate.c: Add +sve pragma.
+ * testsuite/libgomp.c-target/aarch64/lastprivate.c: Likewise.
+ * testsuite/libgomp.c-target/aarch64/private.c: Likewise.
+ * testsuite/libgomp.c-target/aarch64/shared.c: Likewise.
+ * testsuite/libgomp.c-target/aarch64/simd-aligned.c: Likewise.
+ * testsuite/libgomp.c-target/aarch64/simd-nontemporal.c: Likewise.
+ * testsuite/libgomp.c-target/aarch64/threadprivate.c: Likewise.
+ * testsuite/libgomp.c-target/aarch64/udr-sve.c: Add an -march option.
+ (for_reduction): Use "+=" in the reduction loop.
+
2025-04-08 Tobias Burnus <tburnus@baylibre.com>
PR middle-end/119662
diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi
index fed9d5e..6909c2b 100644
--- a/libgomp/libgomp.texi
+++ b/libgomp/libgomp.texi
@@ -258,7 +258,7 @@ The OpenMP 4.5 specification is fully supported.
device memory mapped by an array section @tab P @tab
@item Mapping of Fortran pointer and allocatable variables, including pointer
and allocatable components of variables
- @tab P @tab Mapping of vars with allocatable components unsupported
+ @tab Y @tab
@item @code{defaultmap} extensions @tab Y @tab
@item @code{declare mapper} directive @tab N @tab
@item @code{omp_get_supported_active_levels} routine @tab Y @tab
@@ -6888,7 +6888,7 @@ The implementation remark:
@code{device(ancestor:1)}) are processed serially per @code{target} region
such that the next reverse offload region is only executed after the previous
one returned.
-@item OpenMP code that has a @code{requires} directive with
+@item OpenMP code that has a @code{requires} directive with @code{self_maps} or
@code{unified_shared_memory} is only supported if all AMD GPUs have the
@code{HSA_AMD_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT} property; for
discrete GPUs, this may require setting the @code{HSA_XNACK} environment
@@ -6945,6 +6945,9 @@ or string (str) data type, call @code{omp_get_interop_int},
Note that @code{device_num} is the OpenMP device number
while @code{device} is the HIP device number or HSA device handle.
+When using HIP with C and C++, the @code{__HIP_PLATFORM_AMD__} preprocessor
+macro must be defined before including the HIP header files.
+
For the API routine call, add the prefix @code{omp_ipr_} to the property name;
for instance:
@smallexample
@@ -7045,7 +7048,7 @@ The implementation remark:
Per device, reverse offload regions are processed serially such that
the next reverse offload region is only executed after the previous
one returned.
-@item OpenMP code that has a @code{requires} directive with
+@item OpenMP code that has a @code{requires} directive with @code{self_maps} or
@code{unified_shared_memory} runs on nvptx devices if and only if
all of those support the @code{pageableMemoryAccess} property;@footnote{
@uref{https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements}}
@@ -7107,6 +7110,9 @@ or string (str) data type, call @code{omp_get_interop_int},
Note that @code{device_num} is the OpenMP device number while @code{device}
is the CUDA, CUDA Driver, or HIP device number.
+When using HIP with C and C++, the @code{__HIP_PLATFORM_NVIDIA__} preprocessor
+macro must be defined before including the HIP header files.
+
For the API routine call, add the prefix @code{omp_ipr_} to the property name;
for instance:
@smallexample
diff --git a/libgomp/omp.h.in b/libgomp/omp.h.in
index d5e8be4..8d17db1 100644
--- a/libgomp/omp.h.in
+++ b/libgomp/omp.h.in
@@ -432,4 +432,136 @@ extern const char *omp_get_uid_from_device (int) __GOMP_NOTHROW;
}
#endif
+#if __cplusplus >= 201103L
+
+/* std::__throw_bad_alloc and std::__throw_bad_array_new_length. */
+#include <bits/functexcept.h>
+
+namespace omp
+{
+namespace allocator
+{
+
+namespace __detail
+{
+
+template<typename __T, omp_allocator_handle_t __Handle>
+struct __allocator_templ
+{
+ using value_type = __T;
+ using pointer = __T*;
+ using const_pointer = const __T*;
+ using size_type = __SIZE_TYPE__;
+ using difference_type = __PTRDIFF_TYPE__;
+
+ __T*
+ allocate (size_type __n)
+ {
+ if (__SIZE_MAX__ / sizeof(__T) < __n)
+ std::__throw_bad_array_new_length ();
+ void *__p = omp_aligned_alloc (alignof(__T), __n * sizeof(__T), __Handle);
+ if (!__p)
+ std::__throw_bad_alloc ();
+ return static_cast<__T*>(__p);
+ }
+
+ void
+ deallocate (__T *__p, size_type) __GOMP_NOTHROW
+ {
+ omp_free (static_cast<void*>(__p), __Handle);
+ }
+};
+
+template<typename __T, typename __U, omp_allocator_handle_t __Handle>
+constexpr bool
+operator== (const __allocator_templ<__T, __Handle>&,
+ const __allocator_templ<__U, __Handle>&) __GOMP_NOTHROW
+{
+ return true;
+}
+
+template<typename __T, omp_allocator_handle_t __Handle,
+ typename __U, omp_allocator_handle_t __UHandle>
+constexpr bool
+operator== (const __allocator_templ<__T, __Handle>&,
+ const __allocator_templ<__U, __UHandle>&) __GOMP_NOTHROW
+{
+ return false;
+}
+
+template<typename __T, typename __U, omp_allocator_handle_t __Handle>
+constexpr bool
+operator!= (const __allocator_templ<__T, __Handle>&,
+ const __allocator_templ<__U, __Handle>&) __GOMP_NOTHROW
+{
+ return false;
+}
+
+template<typename __T, omp_allocator_handle_t __Handle,
+ typename __U, omp_allocator_handle_t __UHandle>
+constexpr bool
+operator!= (const __allocator_templ<__T, __Handle>&,
+ const __allocator_templ<__U, __UHandle>&) __GOMP_NOTHROW
+{
+ return true;
+}
+
+} /* namespace __detail */
+
+template<typename __T>
+struct null_allocator
+ : __detail::__allocator_templ<__T, omp_null_allocator> {};
+
+template<typename __T>
+struct default_mem
+ : __detail::__allocator_templ<__T, omp_default_mem_alloc> {};
+
+template<typename __T>
+struct large_cap_mem
+ : __detail::__allocator_templ<__T, omp_large_cap_mem_alloc> {};
+
+template<typename __T>
+struct const_mem
+ : __detail::__allocator_templ<__T, omp_const_mem_alloc> {};
+
+template<typename __T>
+struct high_bw_mem
+ : __detail::__allocator_templ<__T, omp_high_bw_mem_alloc> {};
+
+template<typename __T>
+struct low_lat_mem
+ : __detail::__allocator_templ<__T, omp_low_lat_mem_alloc> {};
+
+template<typename __T>
+struct cgroup_mem
+ : __detail::__allocator_templ<__T, omp_cgroup_mem_alloc> {};
+
+template<typename __T>
+struct pteam_mem
+ : __detail::__allocator_templ<__T, omp_pteam_mem_alloc> {};
+
+template<typename __T>
+struct thread_mem
+ : __detail::__allocator_templ<__T, omp_thread_mem_alloc> {};
+
+} /* namespace allocator */
+
+} /* namespace omp */
+
+namespace ompx
+{
+
+namespace allocator
+{
+
+template<typename __T>
+struct gnu_pinned_mem
+ : omp::allocator::__detail::__allocator_templ<__T, ompx_gnu_pinned_mem_alloc> {};
+
+} /* namespace allocator */
+
+} /* namespace ompx */
+
+#endif /* __cplusplus */
+
#endif /* _OMP_H */
diff --git a/libgomp/testsuite/libgomp.c++/allocator-1.C b/libgomp/testsuite/libgomp.c++/allocator-1.C
new file mode 100644
index 0000000..49425386
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/allocator-1.C
@@ -0,0 +1,171 @@
+// { dg-do run }
+
+#include <omp.h>
+#include <memory>
+#include <limits>
+
+template<typename T, template<typename> class Alloc>
+void test (T const initial_value = T())
+{
+ using Allocator = Alloc<T>;
+ Allocator a;
+ using Traits = std::allocator_traits<Allocator>;
+ static_assert (__is_same(typename Traits::allocator_type, Allocator ));
+ static_assert (__is_same(typename Traits::value_type, T ));
+ static_assert (__is_same(typename Traits::pointer, T* ));
+ static_assert (__is_same(typename Traits::const_pointer, T const* ));
+ static_assert (__is_same(typename Traits::void_pointer, void* ));
+ static_assert (__is_same(typename Traits::const_void_pointer, void const* ));
+ static_assert (__is_same(typename Traits::difference_type, __PTRDIFF_TYPE__));
+ static_assert (__is_same(typename Traits::size_type, __SIZE_TYPE__ ));
+ static_assert (Traits::propagate_on_container_copy_assignment::value == false);
+ static_assert (Traits::propagate_on_container_move_assignment::value == false);
+ static_assert (Traits::propagate_on_container_swap::value == false);
+ static_assert (Traits::is_always_equal::value == true);
+
+ static constexpr __SIZE_TYPE__ correct_max_size
+ = std::numeric_limits<__SIZE_TYPE__>::max () / sizeof (T);
+ if (Traits::max_size (a) != correct_max_size)
+ __builtin_abort ();
+
+ static constexpr __SIZE_TYPE__ alloc_count = 1;
+ T *p = Traits::allocate (a, alloc_count);
+ if (p == nullptr)
+ __builtin_abort ();
+ Traits::construct (a, p, initial_value);
+ if (*p != initial_value)
+ __builtin_abort ();
+ Traits::destroy (a, p);
+ Traits::deallocate (a, p, alloc_count);
+ /* Not interesting but might as well test it. */
+ static_cast<void>(Traits::select_on_container_copy_construction (a));
+
+ if (!(a == Allocator()))
+ __builtin_abort ();
+ if (a != Allocator())
+ __builtin_abort ();
+ if (!(a == Alloc<void>()))
+ __builtin_abort ();
+ if (a != Alloc<void>())
+ __builtin_abort ();
+}
+
+#define CHECK_INEQUALITY(other_alloc_templ, type) \
+do { \
+ /* Skip tests for itself, those are equal. Intantiate each */ \
+ /* one with void so we can easily tell if they are the same. */ \
+ if (!__is_same (AllocTempl<void>, other_alloc_templ<void>)) \
+ { \
+ other_alloc_templ<type> other; \
+ if (a == other) \
+ __builtin_abort (); \
+ if (!(a != other)) \
+ __builtin_abort (); \
+ } \
+} while (false)
+
+template<typename T, template<typename> class AllocTempl>
+void test_inequality ()
+{
+ using Allocator = AllocTempl<T>;
+ Allocator a;
+ CHECK_INEQUALITY (omp::allocator::null_allocator, void);
+ CHECK_INEQUALITY (omp::allocator::default_mem, void);
+ CHECK_INEQUALITY (omp::allocator::large_cap_mem, void);
+ CHECK_INEQUALITY (omp::allocator::const_mem, void);
+ CHECK_INEQUALITY (omp::allocator::high_bw_mem, void);
+ CHECK_INEQUALITY (omp::allocator::low_lat_mem, void);
+ CHECK_INEQUALITY (omp::allocator::cgroup_mem, void);
+ CHECK_INEQUALITY (omp::allocator::pteam_mem, void);
+ CHECK_INEQUALITY (omp::allocator::thread_mem, void);
+#ifdef __gnu_linux__
+ /* Pinning not implemented on other targets. */
+ CHECK_INEQUALITY (ompx::allocator::gnu_pinned_mem, void);
+#endif
+ /* And again with the same type passed to the allocator. */
+ CHECK_INEQUALITY (omp::allocator::null_allocator, T);
+ CHECK_INEQUALITY (omp::allocator::default_mem, T);
+ CHECK_INEQUALITY (omp::allocator::large_cap_mem, T);
+ CHECK_INEQUALITY (omp::allocator::const_mem, T);
+ CHECK_INEQUALITY (omp::allocator::high_bw_mem, T);
+ CHECK_INEQUALITY (omp::allocator::low_lat_mem, T);
+ CHECK_INEQUALITY (omp::allocator::cgroup_mem, T);
+ CHECK_INEQUALITY (omp::allocator::pteam_mem, T);
+ CHECK_INEQUALITY (omp::allocator::thread_mem, T);
+#ifdef __gnu_linux__
+ CHECK_INEQUALITY (ompx::allocator::gnu_pinned_mem, T);
+#endif
+}
+
+#undef CHECK_INEQUALITY
+
+struct S
+{
+ int _v0;
+ bool _v1;
+ float _v2;
+
+ bool operator== (S const& other) const noexcept {
+ return _v0 == other._v0
+ && _v1 == other._v1
+ && _v2 == other._v2;
+ }
+ bool operator!= (S const& other) const noexcept {
+ return !this->operator==(other);
+ }
+};
+
+int main ()
+{
+ test<int, omp::allocator::null_allocator>(42);
+ test<int, omp::allocator::default_mem>(42);
+ test<int, omp::allocator::large_cap_mem>(42);
+ test<int, omp::allocator::const_mem>(42);
+ test<int, omp::allocator::high_bw_mem>(42);
+ test<int, omp::allocator::low_lat_mem>(42);
+ test<int, omp::allocator::cgroup_mem>(42);
+ test<int, omp::allocator::pteam_mem>(42);
+ test<int, omp::allocator::thread_mem>(42);
+#ifdef __gnu_linux__
+ test<int, ompx::allocator::gnu_pinned_mem>(42);
+#endif
+
+ test<long long, omp::allocator::null_allocator>(42);
+ test<long long, omp::allocator::default_mem>(42);
+ test<long long, omp::allocator::large_cap_mem>(42);
+ test<long long, omp::allocator::const_mem>(42);
+ test<long long, omp::allocator::high_bw_mem>(42);
+ test<long long, omp::allocator::low_lat_mem>(42);
+ test<long long, omp::allocator::cgroup_mem>(42);
+ test<long long, omp::allocator::pteam_mem>(42);
+ test<long long, omp::allocator::thread_mem>(42);
+#ifdef __gnu_linux__
+ test<long long, ompx::allocator::gnu_pinned_mem>(42);
+#endif
+
+ test<S, omp::allocator::null_allocator>( S{42, true, 128.f});
+ test<S, omp::allocator::default_mem>( S{42, true, 128.f});
+ test<S, omp::allocator::large_cap_mem>( S{42, true, 128.f});
+ test<S, omp::allocator::const_mem>( S{42, true, 128.f});
+ test<S, omp::allocator::high_bw_mem>( S{42, true, 128.f});
+ test<S, omp::allocator::low_lat_mem>( S{42, true, 128.f});
+ test<S, omp::allocator::cgroup_mem>( S{42, true, 128.f});
+ test<S, omp::allocator::pteam_mem>( S{42, true, 128.f});
+ test<S, omp::allocator::thread_mem>( S{42, true, 128.f});
+#ifdef __gnu_linux__
+ test<S, ompx::allocator::gnu_pinned_mem>(S{42, true, 128.f});
+#endif
+
+ test_inequality<int, omp::allocator::null_allocator>();
+ test_inequality<int, omp::allocator::default_mem>();
+ test_inequality<int, omp::allocator::large_cap_mem>();
+ test_inequality<int, omp::allocator::const_mem>();
+ test_inequality<int, omp::allocator::high_bw_mem>();
+ test_inequality<int, omp::allocator::low_lat_mem>();
+ test_inequality<int, omp::allocator::cgroup_mem>();
+ test_inequality<int, omp::allocator::pteam_mem>();
+ test_inequality<int, omp::allocator::thread_mem>();
+#ifdef __gnu_linux__
+ test_inequality<int, ompx::allocator::gnu_pinned_mem>();
+#endif
+}
diff --git a/libgomp/testsuite/libgomp.c++/allocator-2.C b/libgomp/testsuite/libgomp.c++/allocator-2.C
new file mode 100644
index 0000000..ca94fc7
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/allocator-2.C
@@ -0,0 +1,141 @@
+// { dg-do run }
+// { dg-additional-options "-Wno-psabi" }
+
+#include <omp.h>
+#include <vector>
+
+template<typename T>
+bool ptr_is_aligned(T *ptr, std::size_t alignment)
+{
+ /* ALIGNMENT must be a power of 2. */
+ if ((alignment & (alignment - 1)) != 0)
+ __builtin_abort ();
+ __UINTPTR_TYPE__ ptr_value
+ = reinterpret_cast<__UINTPTR_TYPE__>(static_cast<void*>(ptr));
+ return (ptr_value % alignment) == 0;
+}
+
+template<typename T, template<typename> class Alloc>
+void f (T v0, T v1, T v2, T v3)
+{
+ std::vector<T, Alloc<T>> vec;
+ vec.push_back (v0);
+ vec.push_back (v1);
+ vec.push_back (v2);
+ vec.push_back (v3);
+ if (vec.at (0) != v0)
+ __builtin_abort ();
+ if (vec.at (1) != v1)
+ __builtin_abort ();
+ if (vec.at (2) != v2)
+ __builtin_abort ();
+ if (vec.at (3) != v3)
+ __builtin_abort ();
+ if (!ptr_is_aligned (&vec.at (0), alignof (T)))
+ __builtin_abort ();
+ if (!ptr_is_aligned (&vec.at (1), alignof (T)))
+ __builtin_abort ();
+ if (!ptr_is_aligned (&vec.at (2), alignof (T)))
+ __builtin_abort ();
+ if (!ptr_is_aligned (&vec.at (3), alignof (T)))
+ __builtin_abort ();
+}
+
+struct S0
+{
+ int _v0;
+ bool _v1;
+ float _v2;
+
+ bool operator== (S0 const& other) const noexcept {
+ return _v0 == other._v0
+ && _v1 == other._v1
+ && _v2 == other._v2;
+ }
+ bool operator!= (S0 const& other) const noexcept {
+ return !this->operator==(other);
+ }
+};
+
+struct alignas(128) S1
+{
+ int _v0;
+ bool _v1;
+ float _v2;
+
+ bool operator== (S1 const& other) const noexcept {
+ return _v0 == other._v0
+ && _v1 == other._v1
+ && _v2 == other._v2;
+ }
+ bool operator!= (S1 const& other) const noexcept {
+ return !this->operator==(other);
+ }
+};
+
+/* Note: the test for const_mem should be disabled in the future. */
+
+int main ()
+{
+ f<int, omp::allocator::null_allocator >(0, 1, 2, 3);
+ f<int, omp::allocator::default_mem >(0, 1, 2, 3);
+ f<int, omp::allocator::large_cap_mem >(0, 1, 2, 3);
+ f<int, omp::allocator::const_mem >(0, 1, 2, 3);
+ f<int, omp::allocator::high_bw_mem >(0, 1, 2, 3);
+ f<int, omp::allocator::low_lat_mem >(0, 1, 2, 3);
+ f<int, omp::allocator::cgroup_mem >(0, 1, 2, 3);
+ f<int, omp::allocator::pteam_mem >(0, 1, 2, 3);
+ f<int, omp::allocator::thread_mem >(0, 1, 2, 3);
+#ifdef __gnu_linux__
+ /* Pinning not implemented on other targets. */
+ f<int, ompx::allocator::gnu_pinned_mem>(0, 1, 2, 3);
+#endif
+
+ f<long long, omp::allocator::null_allocator >(0, 1, 2, 3);
+ f<long long, omp::allocator::default_mem >(0, 1, 2, 3);
+ f<long long, omp::allocator::large_cap_mem >(0, 1, 2, 3);
+ f<long long, omp::allocator::const_mem >(0, 1, 2, 3);
+ f<long long, omp::allocator::high_bw_mem >(0, 1, 2, 3);
+ f<long long, omp::allocator::low_lat_mem >(0, 1, 2, 3);
+ f<long long, omp::allocator::cgroup_mem >(0, 1, 2, 3);
+ f<long long, omp::allocator::pteam_mem >(0, 1, 2, 3);
+ f<long long, omp::allocator::thread_mem >(0, 1, 2, 3);
+#ifdef __gnu_linux__
+ f<long long, ompx::allocator::gnu_pinned_mem>(0, 1, 2, 3);
+#endif
+
+ S0 s0_0{ 42, true, 111128.f};
+ S0 s0_1{ 142, false, 11128.f};
+ S0 s0_2{ 1142, true, 1128.f};
+ S0 s0_3{11142, false, 128.f};
+ f<S0, omp::allocator::null_allocator >(s0_0, s0_1, s0_2, s0_3);
+ f<S0, omp::allocator::default_mem >(s0_0, s0_1, s0_2, s0_3);
+ f<S0, omp::allocator::large_cap_mem >(s0_0, s0_1, s0_2, s0_3);
+ f<S0, omp::allocator::const_mem >(s0_0, s0_1, s0_2, s0_3);
+ f<S0, omp::allocator::high_bw_mem >(s0_0, s0_1, s0_2, s0_3);
+ f<S0, omp::allocator::low_lat_mem >(s0_0, s0_1, s0_2, s0_3);
+ f<S0, omp::allocator::cgroup_mem >(s0_0, s0_1, s0_2, s0_3);
+ f<S0, omp::allocator::pteam_mem >(s0_0, s0_1, s0_2, s0_3);
+ f<S0, omp::allocator::thread_mem >(s0_0, s0_1, s0_2, s0_3);
+#ifdef __gnu_linux__
+ f<S0, ompx::allocator::gnu_pinned_mem>(s0_0, s0_1, s0_2, s0_3);
+#endif
+
+ S1 s1_0{ 42, true, 111128.f};
+ S1 s1_1{ 142, false, 11128.f};
+ S1 s1_2{ 1142, true, 1128.f};
+ S1 s1_3{11142, false, 128.f};
+
+ f<S1, omp::allocator::null_allocator >(s1_0, s1_1, s1_2, s1_3);
+ f<S1, omp::allocator::default_mem >(s1_0, s1_1, s1_2, s1_3);
+ f<S1, omp::allocator::large_cap_mem >(s1_0, s1_1, s1_2, s1_3);
+ f<S1, omp::allocator::const_mem >(s1_0, s1_1, s1_2, s1_3);
+ f<S1, omp::allocator::high_bw_mem >(s1_0, s1_1, s1_2, s1_3);
+ f<S1, omp::allocator::low_lat_mem >(s1_0, s1_1, s1_2, s1_3);
+ f<S1, omp::allocator::cgroup_mem >(s1_0, s1_1, s1_2, s1_3);
+ f<S1, omp::allocator::pteam_mem >(s1_0, s1_1, s1_2, s1_3);
+ f<S1, omp::allocator::thread_mem >(s1_0, s1_1, s1_2, s1_3);
+#ifdef __gnu_linux__
+ f<S1, ompx::allocator::gnu_pinned_mem>(s1_0, s1_1, s1_2, s1_3);
+#endif
+}
diff --git a/libgomp/testsuite/libgomp.c++/pr106445-1-O0.C b/libgomp/testsuite/libgomp.c++/pr106445-1-O0.C
new file mode 100644
index 0000000..bcd499c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr106445-1-O0.C
@@ -0,0 +1,3 @@
+// { dg-additional-options -O0 }
+
+#include "pr106445-1.C"
diff --git a/libgomp/testsuite/libgomp.c++/pr106445-1.C b/libgomp/testsuite/libgomp.c++/pr106445-1.C
new file mode 100644
index 0000000..329ce62
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr106445-1.C
@@ -0,0 +1,18 @@
+#include <vector>
+
+int main()
+{
+#pragma omp target
+ {
+ {
+ std::vector<int> v;
+ if (!v.empty())
+ __builtin_abort();
+ }
+ {
+ std::vector<int> v(100);
+ if (v.capacity() < 100)
+ __builtin_abort();
+ }
+ }
+}
diff --git a/libgomp/testsuite/libgomp.c++/pr119692-1-1.C b/libgomp/testsuite/libgomp.c++/pr119692-1-1.C
new file mode 100644
index 0000000..1f59b15
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr119692-1-1.C
@@ -0,0 +1,10 @@
+/* PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" */
+
+/* { dg-additional-options -UDEFAULT }
+ Wrong code for offloading execution.
+ { dg-additional-options -foffload=disable } */
+/* { dg-additional-options -fdump-tree-gimple } */
+
+#include "../libgomp.oacc-c++/pr119692-1-1.C"
+
+/* { dg-final { scan-tree-dump-not {(?n)#pragma omp target .* map\(tofrom:_ZTI2C2 \[len: [0-9]+\] \[runtime_implicit\]\) map\(tofrom:_ZTI2C1 \[len: [0-9]+\] \[runtime_implicit\]\) map\(tofrom:_ZTV2C1 \[len: [0-9]+\] \[runtime_implicit\]\)$} gimple { xfail *-*-* } } } */
diff --git a/libgomp/testsuite/libgomp.c++/pr119692-1-2.C b/libgomp/testsuite/libgomp.c++/pr119692-1-2.C
new file mode 100644
index 0000000..e7ac818
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr119692-1-2.C
@@ -0,0 +1,11 @@
+/* PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" */
+
+/* { dg-additional-options -DDEFAULT=defaultmap(none) }
+ Fails to compile.
+ { dg-do compile } */
+
+#include "pr119692-1-1.C"
+
+/* { dg-bogus {error: '_ZTV2C1' not specified in enclosing 'target'} PR119692 { xfail *-*-* } 0 }
+ { dg-bogus {error: '_ZTI2C2' not specified in enclosing 'target'} PR119692 { xfail *-*-* } 0 }
+ { dg-bogus {error: '_ZTI2C1' not specified in enclosing 'target'} PR119692 { xfail *-*-* } 0 } */
diff --git a/libgomp/testsuite/libgomp.c++/pr119692-1-3.C b/libgomp/testsuite/libgomp.c++/pr119692-1-3.C
new file mode 100644
index 0000000..733feb8
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr119692-1-3.C
@@ -0,0 +1,10 @@
+/* PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" */
+
+/* { dg-additional-options -DDEFAULT=defaultmap(present) }
+ Wrong code for offloading execution.
+ { dg-xfail-run-if PR119692 { offload_device } } */
+/* { dg-additional-options -fdump-tree-gimple } */
+
+#include "pr119692-1-1.C"
+
+/* { dg-final { scan-tree-dump-not {(?n)#pragma omp target .* defaultmap\(present\) map\(force_present:_ZTI2C2 \[len: [0-9]+\] \[runtime_implicit\]\) map\(force_present:_ZTI2C1 \[len: [0-9]+\] \[runtime_implicit\]\) map\(force_present:_ZTV2C1 \[len: [0-9]+\] \[runtime_implicit\]\)$} gimple { xfail *-*-* } } } */
diff --git a/libgomp/testsuite/libgomp.c++/pr119692-1-4.C b/libgomp/testsuite/libgomp.c++/pr119692-1-4.C
new file mode 100644
index 0000000..6995f26
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr119692-1-4.C
@@ -0,0 +1,10 @@
+/* PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" */
+
+/* { dg-additional-options -DDEFAULT=defaultmap(firstprivate) }
+ Wrong code for offloading execution.
+ { dg-xfail-run-if PR119692 { offload_device } } */
+/* { dg-additional-options -fdump-tree-gimple } */
+
+#include "pr119692-1-1.C"
+
+/* { dg-final { scan-tree-dump-not {(?n)#pragma omp target .* defaultmap\(firstprivate\) firstprivate\(_ZTI2C2\) firstprivate\(_ZTI2C1\) firstprivate\(_ZTV2C1\)$} gimple { xfail *-*-* } } } */
diff --git a/libgomp/testsuite/libgomp.c++/pr119692-1-5.C b/libgomp/testsuite/libgomp.c++/pr119692-1-5.C
new file mode 100644
index 0000000..02121b6
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr119692-1-5.C
@@ -0,0 +1,10 @@
+/* PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" */
+
+/* { dg-additional-options -DDEFAULT=defaultmap(to) }
+ Wrong code for offloading execution.
+ { dg-xfail-run-if PR119692 { offload_device } } */
+/* { dg-additional-options -fdump-tree-gimple } */
+
+#include "pr119692-1-1.C"
+
+/* { dg-final { scan-tree-dump-not {(?n)#pragma omp target .* defaultmap\(to\) map\(to:_ZTI2C2 \[len: [0-9]+\] \[runtime_implicit\]\) map\(to:_ZTI2C1 \[len: [0-9]+\] \[runtime_implicit\]\) map\(to:_ZTV2C1 \[len: [0-9]+\] \[runtime_implicit\]\)$} gimple { xfail *-*-* } } } */
diff --git a/libgomp/testsuite/libgomp.c++/pr96390.C b/libgomp/testsuite/libgomp.c++/pr96390.C
index 1f3c3e0..be19601 100644
--- a/libgomp/testsuite/libgomp.c++/pr96390.C
+++ b/libgomp/testsuite/libgomp.c++/pr96390.C
@@ -1,6 +1,4 @@
/* { dg-additional-options "-O0 -fdump-tree-omplower" } */
-/* { dg-additional-options "-foffload=-Wa,--verify" { target offload_target_nvptx } } */
-/* { dg-xfail-if "PR 97106/PR 97102 - .alias not (yet) supported for nvptx" { offload_target_nvptx } } */
#include <cstdlib>
#include <type_traits>
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-1.C b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-1.C
new file mode 100644
index 0000000..3848295
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-1.C
@@ -0,0 +1,25 @@
+/* 'std::bad_cast' exception in OpenMP 'target' region. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "../libgomp.oacc-c++/exceptions-bad_cast-1.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ For host execution, we print something like:
+ terminate called after throwing an instance of 'std::bad_cast'
+ what(): std::bad_cast
+ Aborted (core dumped)
+ { dg-output {.*std::bad_cast} { target { ! offload_device } } }
+ For GCN, nvptx offload execution, we don't print anything, but just 'abort'.
+
+ TODO For GCN, nvptx offload execution, this currently doesn't 'abort' due to
+ the 'std::bad_cast' exception, but rather due to SIGSEGV in 'dynamic_cast';
+ PR119692.
+
+ { dg-shouldfail {'std::bad_cast' exception} } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-GCN.C b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-GCN.C
new file mode 100644
index 0000000..93884df
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-GCN.C
@@ -0,0 +1,19 @@
+/* 'std::bad_cast' exception in OpenMP 'target' region, caught, '-foffload-options=-mno-fake-exceptions'. */
+
+/* As this test case involves an expected offload compilation failure, we have to handle each offload target individually.
+ { dg-do link { target offload_target_amdgcn } }
+ { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -foffload-options=-mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "target-exceptions-bad_cast-2.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ Given '-foffload-options=-mno-fake-exceptions', offload compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'main[^']+':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.)
+ { dg-excess-errors {'mkoffload' failure etc.} } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-nvptx.C b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-nvptx.C
new file mode 100644
index 0000000..83ec89b
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sorry-nvptx.C
@@ -0,0 +1,19 @@
+/* 'std::bad_cast' exception in OpenMP 'target' region, caught, '-foffload-options=-mno-fake-exceptions'. */
+
+/* As this test case involves an expected offload compilation failure, we have to handle each offload target individually.
+ { dg-do link { target offload_target_nvptx } }
+ { dg-additional-options -foffload=nvptx-none } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -foffload-options=-mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "target-exceptions-bad_cast-2.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ Given '-foffload-options=-mno-fake-exceptions', offload compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'main[^']+':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.)
+ { dg-excess-errors {'mkoffload' failure etc.} } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2.C b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2.C
new file mode 100644
index 0000000..8861740
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-2.C
@@ -0,0 +1,24 @@
+/* 'std::bad_cast' exception in OpenMP 'target' region, caught. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+/* { dg-bogus {_ZTISt8bad_cast} PR119734 { target offload_target_nvptx xfail *-*-* } 0 }
+ { dg-excess-errors {'mkoffload' failure etc.} { xfail offload_target_nvptx } } */
+
+#include "../libgomp.oacc-c++/exceptions-bad_cast-2.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-output {.*caught 'std::bad_cast'[\r\n]+} { target { ! offload_device } } }
+ For GCN, nvptx offload execution, we don't print anything, but just 'abort'.
+
+ TODO For GCN, nvptx offload execution, this currently doesn't 'abort' due to
+ the 'std::bad_cast' exception, but rather due to SIGSEGV in 'dynamic_cast';
+ PR119692.
+
+ For GCN, nvptx offload execution, there is no 'catch'ing; any exception is fatal.
+ { dg-shouldfail {'MyException' exception} { offload_device } } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-3.C b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-3.C
new file mode 100644
index 0000000..efed64f
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-bad_cast-3.C
@@ -0,0 +1,17 @@
+/* 'std::bad_cast' exception in OpenMP 'target' region, dead code. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -DDEFAULT=defaultmap(to) }
+ ... to avoid wrong code for offloading execution; PR119692.
+ With this, the device code still isn't correct, but the defects are in dead code.
+ { dg-additional-options -fdump-tree-gimple } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "../libgomp.oacc-c++/exceptions-bad_cast-3.C"
+
+/* { dg-final { scan-tree-dump-not {(?n)#pragma omp target .* defaultmap\(to\) map\(to:_ZTI2C2 \[len: [0-9]+\] \[runtime_implicit\]\) map\(to:_ZTI2C1 \[len: [0-9]+\] \[runtime_implicit\]\) map\(to:_ZTV2C1 \[len: [0-9]+\] \[runtime_implicit\]\)$} gimple { xfail *-*-* } } } */
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-GCN.C b/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-GCN.C
new file mode 100644
index 0000000..3cdedf4
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-GCN.C
@@ -0,0 +1,24 @@
+/* Exception handling constructs in dead code, '-foffload-options=-mno-fake-exceptions'. */
+
+/* As this test case involves an expected offload compilation failure, we have to handle each offload target individually.
+ { dg-do link { target offload_target_amdgcn } }
+ { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -foffload-options=-mno-fake-exceptions } */
+/* { dg-additional-options -O0 } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "target-exceptions-pr118794-1.C"
+
+/* In this specific C++ arrangement, distilled from PR118794, GCC synthesizes
+ '__builtin_eh_pointer', '__builtin_unwind_resume' calls as dead code in 'f':
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized } }
+ { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized } }
+ { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized } }
+ Given '-O0' and '-foffload-options=-mno-fake-exceptions', offload compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'f':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.)
+ { dg-excess-errors {'mkoffload' failure etc.} } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-nvptx.C b/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-nvptx.C
new file mode 100644
index 0000000..ef996cf
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1-offload-sorry-nvptx.C
@@ -0,0 +1,24 @@
+/* Exception handling constructs in dead code, '-foffload-options=-mno-fake-exceptions'. */
+
+/* As this test case involves an expected offload compilation failure, we have to handle each offload target individually.
+ { dg-do link { target offload_target_nvptx } }
+ { dg-additional-options -foffload=nvptx-none } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -foffload-options=-mno-fake-exceptions } */
+/* { dg-additional-options -O0 } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "target-exceptions-pr118794-1.C"
+
+/* In this specific C++ arrangement, distilled from PR118794, GCC synthesizes
+ '__builtin_eh_pointer', '__builtin_unwind_resume' calls as dead code in 'f':
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized } }
+ { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized } }
+ { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized } }
+ Given '-O0' and '-foffload-options=-mno-fake-exceptions', offload compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'f':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.)
+ { dg-excess-errors {'mkoffload' failure etc.} } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1.C b/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1.C
new file mode 100644
index 0000000..24e3d07
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-pr118794-1.C
@@ -0,0 +1,57 @@
+/* Exception handling constructs in dead code. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -O0 } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+/* See also '../../../gcc/testsuite/g++.target/gcn/exceptions-pr118794-1.C',
+ '../../../gcc/testsuite/g++.target/nvptx/exceptions-pr118794-1.C'. */
+
+#pragma omp begin declare target
+
+bool ok = false;
+
+template <typename T>
+struct C
+{
+ C()
+ {
+ ok = true;
+ }
+ C(int) {};
+ ~C() {};
+
+ __attribute__((noipa))
+ void m()
+ {
+ C c;
+ }
+};
+
+inline void f()
+{
+ C<double> c(1);
+ c.m();
+}
+
+#pragma omp end declare target
+
+int main()
+{
+#pragma omp target
+ {
+ f();
+ }
+#pragma omp target update from(ok)
+ if (!ok)
+ __builtin_abort();
+}
+
+/* In this specific C++ arrangement, distilled from PR118794, GCC synthesizes
+ '__builtin_eh_pointer', '__builtin_unwind_resume' calls as dead code in 'f':
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__builtin_eh_pointer, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__builtin_unwind_resume, } 1 optimized } } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-throw-1-O0.C b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-1-O0.C
new file mode 100644
index 0000000..00d7c13
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-1-O0.C
@@ -0,0 +1,23 @@
+/* 'throw' in OpenMP 'target' region. */
+
+/* { dg-additional-options -O0 } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "target-exceptions-throw-1.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ For host execution, we print something like:
+ terminate called after throwing an instance of 'MyException'
+ Aborted (core dumped)
+ { dg-output {.*MyException} { target { ! offload_device } } }
+ For GCN, nvptx offload execution, we don't print anything, but just 'abort'.
+
+ { dg-shouldfail {'MyException' exception} } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-throw-1.C b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-1.C
new file mode 100644
index 0000000..2467061
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-1.C
@@ -0,0 +1,25 @@
+/* 'throw' in OpenMP 'target' region. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+/* { dg-bogus {Size expression must be absolute\.} PR119737 { target offload_target_amdgcn xfail *-*-* } 0 }
+ { dg-ice PR119737 { offload_target_amdgcn } }
+ { dg-excess-errors {'mkoffload' failures etc.} { xfail offload_target_amdgcn } } */
+
+#include "../libgomp.oacc-c++/exceptions-throw-1.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ For host execution, we print something like:
+ terminate called after throwing an instance of 'MyException'
+ Aborted (core dumped)
+ { dg-output {.*MyException} { target { ! offload_device } } }
+ For GCN, nvptx offload execution, we don't print anything, but just 'abort'.
+
+ { dg-shouldfail {'MyException' exception} } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-O0.C b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-O0.C
new file mode 100644
index 0000000..b7a311d
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-O0.C
@@ -0,0 +1,25 @@
+/* 'throw' in OpenMP 'target' region, caught. */
+
+/* { dg-additional-options -O0 } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+/* { dg-bogus {undefined symbol: typeinfo name for MyException} PR119806 { target offload_target_amdgcn xfail *-*-* } 0 }
+ { dg-excess-errors {'mkoffload' failure etc.} { xfail offload_target_amdgcn } } */
+/* { dg-bogus {Initial value type mismatch} PR119806 { target offload_target_nvptx xfail *-*-* } 0 }
+ { dg-excess-errors {'mkoffload' failure etc.} { xfail offload_target_nvptx } } */
+
+#include "target-exceptions-throw-2.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-output {.*caught 'MyException'[\r\n]+} { target { ! offload_device } } }
+ For GCN, nvptx offload execution, we don't print anything, but just 'abort'.
+
+ For GCN, nvptx offload execution, there is no 'catch'ing; any exception is fatal.
+ { dg-shouldfail {'MyException' exception} { offload_device } } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-GCN.C b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-GCN.C
new file mode 100644
index 0000000..9905b1f
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-GCN.C
@@ -0,0 +1,21 @@
+/* 'throw' in OpenMP 'target' region, caught, -foffload-options=-mno-fake-exceptions. */
+
+/* As this test case involves an expected offload compilation failure, we have to handle each offload target individually.
+ { dg-do link { target offload_target_amdgcn } }
+ { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -foffload-options=-mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "target-exceptions-throw-2.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ Given '-foffload-options=-mno-fake-exceptions', offload compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'main[^']+':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.)
+ { dg-excess-errors {'mkoffload' failure etc.} } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-nvptx.C b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-nvptx.C
new file mode 100644
index 0000000..da267d6
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-nvptx.C
@@ -0,0 +1,21 @@
+/* 'throw' in OpenMP 'target' region, caught, '-foffload-options=-mno-fake-exceptions'. */
+
+/* As this test case involves an expected offload compilation failure, we have to handle each offload target individually.
+ { dg-do link { target offload_target_nvptx } }
+ { dg-additional-options -foffload=nvptx-none } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -foffload-options=-mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "target-exceptions-throw-2.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ Given '-foffload-options=-mno-fake-exceptions', offload compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'main[^']+':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.)
+ { dg-excess-errors {'mkoffload' failure etc.} } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2.C b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2.C
new file mode 100644
index 0000000..e85e6c3
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-2.C
@@ -0,0 +1,23 @@
+/* 'throw' in OpenMP 'target' region, caught. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+/* { dg-bogus {Size expression must be absolute\.} PR119737 { target offload_target_amdgcn xfail *-*-* } 0 }
+ { dg-ice PR119737 { offload_target_amdgcn } }
+ { dg-excess-errors {'mkoffload' failures etc.} { xfail offload_target_amdgcn } } */
+
+#include "../libgomp.oacc-c++/exceptions-throw-2.C"
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-output {.*caught 'MyException'[\r\n]+} { target { ! offload_device } } }
+ For GCN, nvptx offload execution, we don't print anything, but just 'abort'.
+
+ For GCN, nvptx offload execution, there is no 'catch'ing; any exception is fatal.
+ { dg-shouldfail {'MyException' exception} { offload_device } } */
diff --git a/libgomp/testsuite/libgomp.c++/target-exceptions-throw-3.C b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-3.C
new file mode 100644
index 0000000..c35180d
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/target-exceptions-throw-3.C
@@ -0,0 +1,19 @@
+/* 'throw' in OpenMP 'target' region, dead code. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -DDEFAULT=defaultmap(to) }
+ ... to avoid wrong code for offloading execution; PR119692.
+ With this, the device code still isn't correct, but the defects are in dead code.
+ { dg-additional-options -fdump-tree-gimple } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "../libgomp.oacc-c++/exceptions-throw-3.C"
+
+/* { dg-final { scan-tree-dump-not {(?n)#pragma omp target .* defaultmap\(to\) map\(to:_ZTI11MyException \[len: [0-9]+\] \[runtime_implicit\]\)$} gimple { xfail *-*-* } } } */
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } } */
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr96390.c b/libgomp/testsuite/libgomp.c-c++-common/pr96390.c
index b89f934..ca7865d 100644
--- a/libgomp/testsuite/libgomp.c-c++-common/pr96390.c
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr96390.c
@@ -1,7 +1,7 @@
/* { dg-additional-options "-O0 -fdump-tree-omplower" } */
/* { dg-additional-options "-foffload=-Wa,--verify" { target offload_target_nvptx } } */
/* { dg-require-alias "" } */
-/* { dg-xfail-if "PR 97102/PR 97106 - .alias not (yet) supported for nvptx" { offload_target_nvptx } } */
+/* { dg-xfail-if PR105018 { offload_target_nvptx } } */
#ifdef __cplusplus
extern "C" {
diff --git a/libgomp/testsuite/libgomp.c-target/aarch64/firstprivate.c b/libgomp/testsuite/libgomp.c-target/aarch64/firstprivate.c
index 930ca62..58674e2 100644
--- a/libgomp/testsuite/libgomp.c-target/aarch64/firstprivate.c
+++ b/libgomp/testsuite/libgomp.c-target/aarch64/firstprivate.c
@@ -1,6 +1,8 @@
/* { dg-do run { target aarch64_sve256_hw } } */
/* { dg-options "-msve-vector-bits=256 -fopenmp -O2" } */
+#pragma GCC target "+sve"
+
#include <arm_sve.h>
#include <omp.h>
diff --git a/libgomp/testsuite/libgomp.c-target/aarch64/lastprivate.c b/libgomp/testsuite/libgomp.c-target/aarch64/lastprivate.c
index be5a618..2f93d7b 100644
--- a/libgomp/testsuite/libgomp.c-target/aarch64/lastprivate.c
+++ b/libgomp/testsuite/libgomp.c-target/aarch64/lastprivate.c
@@ -1,6 +1,8 @@
/* { dg-do run { target aarch64_sve256_hw } } */
/* { dg-options "-msve-vector-bits=256 -fopenmp -O2" } */
+#pragma GCC target "+sve"
+
#include <arm_sve.h>
#include <omp.h>
diff --git a/libgomp/testsuite/libgomp.c-target/aarch64/private.c b/libgomp/testsuite/libgomp.c-target/aarch64/private.c
index 0ca74fe..fed5370 100644
--- a/libgomp/testsuite/libgomp.c-target/aarch64/private.c
+++ b/libgomp/testsuite/libgomp.c-target/aarch64/private.c
@@ -1,6 +1,8 @@
/* { dg-do run { target aarch64_sve256_hw } } */
/* { dg-options "-msve-vector-bits=256 -fopenmp -O2" } */
+#pragma GCC target "+sve"
+
#include <arm_sve.h>
#include <omp.h>
diff --git a/libgomp/testsuite/libgomp.c-target/aarch64/shared.c b/libgomp/testsuite/libgomp.c-target/aarch64/shared.c
index dec41b8..340a668 100644
--- a/libgomp/testsuite/libgomp.c-target/aarch64/shared.c
+++ b/libgomp/testsuite/libgomp.c-target/aarch64/shared.c
@@ -1,6 +1,8 @@
/* { dg-do run { target aarch64_sve256_hw } } */
/* { dg-options "-msve-vector-bits=256 -fopenmp -O2" } */
+#pragma GCC target "+sve"
+
#include <arm_sve.h>
#include <stdlib.h>
#include <omp.h>
diff --git a/libgomp/testsuite/libgomp.c-target/aarch64/simd-aligned.c b/libgomp/testsuite/libgomp.c-target/aarch64/simd-aligned.c
index cc41139..14642c9 100644
--- a/libgomp/testsuite/libgomp.c-target/aarch64/simd-aligned.c
+++ b/libgomp/testsuite/libgomp.c-target/aarch64/simd-aligned.c
@@ -1,6 +1,8 @@
/* { dg-do run { target aarch64_sve256_hw } } */
/* { dg-options "-msve-vector-bits=256 -fopenmp -O2" } */
+#pragma GCC target "+sve"
+
#include <arm_sve.h>
#include <stdint.h>
diff --git a/libgomp/testsuite/libgomp.c-target/aarch64/simd-nontemporal.c b/libgomp/testsuite/libgomp.c-target/aarch64/simd-nontemporal.c
index 3385427..6fe4616 100644
--- a/libgomp/testsuite/libgomp.c-target/aarch64/simd-nontemporal.c
+++ b/libgomp/testsuite/libgomp.c-target/aarch64/simd-nontemporal.c
@@ -1,6 +1,8 @@
/* { dg-do run { target aarch64_sve256_hw } } */
/* { dg-options "-msve-vector-bits=256 -fopenmp -O2" } */
+#pragma GCC target "+sve"
+
#include <arm_sve.h>
#include <stdint.h>
diff --git a/libgomp/testsuite/libgomp.c-target/aarch64/threadprivate.c b/libgomp/testsuite/libgomp.c-target/aarch64/threadprivate.c
index 4a39312..aa7d2f9 100644
--- a/libgomp/testsuite/libgomp.c-target/aarch64/threadprivate.c
+++ b/libgomp/testsuite/libgomp.c-target/aarch64/threadprivate.c
@@ -1,6 +1,8 @@
/* { dg-do run { target aarch64_sve256_hw } } */
/* { dg-options "-msve-vector-bits=256 -fopenmp -O2" } */
+#pragma GCC target "+sve"
+
#include <arm_sve.h>
#include <stdint.h>
diff --git a/libgomp/testsuite/libgomp.c-target/aarch64/udr-sve.c b/libgomp/testsuite/libgomp.c-target/aarch64/udr-sve.c
index c79f4a9..03d93cc 100644
--- a/libgomp/testsuite/libgomp.c-target/aarch64/udr-sve.c
+++ b/libgomp/testsuite/libgomp.c-target/aarch64/udr-sve.c
@@ -1,5 +1,5 @@
/* { dg-do run { target aarch64_sve256_hw } } */
-/* { dg-options "-msve-vector-bits=256 -fopenmp -O2" } */
+/* { dg-options "-march=armv8-a+sve -msve-vector-bits=256 -fopenmp -O2" } */
#include <arm_sve.h>
@@ -38,7 +38,7 @@ for_reduction ()
#pragma omp parallel for reduction (+:va)
for (j = 0; j < 8; j++)
- va = svld1_s32 (svptrue_b32 (), a);
+ va += svld1_s32 (svptrue_b32 (), a);
res = svaddv_s32 (svptrue_b32 (), va);
diff --git a/libgomp/testsuite/libgomp.fortran/allocatable-comp.f90 b/libgomp/testsuite/libgomp.fortran/allocatable-comp.f90
new file mode 100644
index 0000000..383ecba
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/allocatable-comp.f90
@@ -0,0 +1,53 @@
+implicit none
+type t
+ integer, allocatable :: a, b(:)
+end type t
+type(t) :: x, y, z
+integer :: i
+
+!$omp target map(to: x)
+ if (allocated(x%a)) stop 1
+ if (allocated(x%b)) stop 2
+!$omp end target
+
+allocate(x%a, x%b(-4:6))
+x%b(:) = [(i, i=-4,6)]
+
+!$omp target map(to: x)
+ if (.not. allocated(x%a)) stop 3
+ if (.not. allocated(x%b)) stop 4
+ if (lbound(x%b,1) /= -4) stop 5
+ if (ubound(x%b,1) /= 6) stop 6
+ if (any (x%b /= [(i, i=-4,6)])) stop 7
+!$omp end target
+
+
+! The following only works with arrays due to
+! PR fortran/96668
+
+!$omp target enter data map(to: y, z)
+
+!$omp target map(to: y, z)
+ if (allocated(y%b)) stop 8
+ if (allocated(z%b)) stop 9
+!$omp end target
+
+allocate(y%b(5), z%b(3))
+y%b = 42
+z%b = 99
+
+! (implicitly) 'tofrom' mapped
+! Planned for OpenMP 6.0 (but common extension)
+! OpenMP <= 5.0 unclear
+!$omp target map(to: y)
+ if (.not.allocated(y%b)) stop 10
+ if (any (y%b /= 42)) stop 11
+!$omp end target
+
+! always map: OpenMP 5.1 (clarified)
+!$omp target map(always, tofrom: z)
+ if (.not.allocated(z%b)) stop 12
+ if (any (z%b /= 99)) stop 13
+!$omp end target
+
+end
diff --git a/libgomp/testsuite/libgomp.fortran/map-alloc-comp-3.f90 b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-3.f90
new file mode 100644
index 0000000..9d48c7c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-3.f90
@@ -0,0 +1,121 @@
+type t2
+ integer x, y, z
+end type t2
+type t
+ integer, allocatable :: A
+ integer, allocatable :: B(:)
+ type(t2), allocatable :: C
+ type(t2), allocatable :: D(:,:)
+end type t
+
+type t3
+ type(t) :: Q
+ type(t) :: R(5)
+end type
+
+type(t) :: var, var2
+type(t3) :: var3, var4
+
+! --------------------------------------
+! Assign + allocate
+var%A = 45
+var%B = [1,2,3]
+var%C = t2(6,5,4)
+var%D = reshape([t2(1,2,3), t2(4,5,6), t2(11,12,13), t2(14,15,16)], [2,2])
+
+! Assign + allocate
+var2%A = 145
+var2%B = [991,992,993]
+var2%C = t2(996,995,994)
+var2%D = reshape([t2(199,299,399), t2(499,599,699), t2(1199,1299,1399), t2(1499,1599,1699)], [2,2])
+
+
+!$omp target map(to: var) map(tofrom: var2)
+ call foo(var, var2)
+!$omp end target
+
+if (var2%A /= 45) stop 9
+if (any (var2%B /= [1,2,3])) stop 10
+if (var2%C%x /= 6) stop 11
+if (var2%C%y /= 5) stop 11
+if (var2%C%z /= 4) stop 11
+if (any (var2%D(:,:)%x /= reshape([1, 4, 11, 14], [2,2]))) stop 12
+if (any (var2%D(:,:)%y /= reshape([2, 5, 12, 15], [2,2]))) stop 12
+if (any (var2%D(:,:)%z /= reshape([3, 6, 13, 16], [2,2]))) stop 12
+
+! --------------------------------------
+! Assign + allocate
+var3%Q%A = 45
+var3%Q%B = [1,2,3]
+var3%Q%C = t2(6,5,4)
+var3%Q%D = reshape([t2(1,2,3), t2(4,5,6), t2(11,12,13), t2(14,15,16)], [2,2])
+
+var3%R(2)%A = 45
+var3%R(2)%B = [1,2,3]
+var3%R(2)%C = t2(6,5,4)
+var3%R(2)%D = reshape([t2(1,2,3), t2(4,5,6), t2(11,12,13), t2(14,15,16)], [2,2])
+
+! Assign + allocate
+var4%Q%A = 145
+var4%Q%B = [991,992,993]
+var4%Q%C = t2(996,995,994)
+var4%Q%D = reshape([t2(199,299,399), t2(499,599,699), t2(1199,1299,1399), t2(1499,1599,1699)], [2,2])
+
+var4%R(3)%A = 145
+var4%R(3)%B = [991,992,993]
+var4%R(3)%C = t2(996,995,994)
+var4%R(3)%D = reshape([t2(199,299,399), t2(499,599,699), t2(1199,1299,1399), t2(1499,1599,1699)], [2,2])
+
+!$omp target map(to: var3%Q) map(tofrom: var4%Q)
+ call foo(var3%Q, var4%Q)
+!$omp end target
+
+!$omp target map(to: var3%R(2)) map(tofrom: var4%R(3))
+ call foo(var3%R(2), var4%R(3))
+!$omp end target
+
+if (var4%Q%A /= 45) stop 13
+if (any (var4%Q%B /= [1,2,3])) stop 14
+if (var4%Q%C%x /= 6) stop 15
+if (var4%Q%C%y /= 5) stop 15
+if (var4%Q%C%z /= 4) stop 15
+if (any (var4%Q%D(:,:)%x /= reshape([1, 4, 11, 14], [2,2]))) stop 16
+if (any (var4%Q%D(:,:)%y /= reshape([2, 5, 12, 15], [2,2]))) stop 16
+if (any (var4%Q%D(:,:)%z /= reshape([3, 6, 13, 16], [2,2]))) stop 16
+
+if (var4%R(3)%A /= 45) stop 17
+if (any (var4%R(3)%B /= [1,2,3])) stop 18
+if (var4%R(3)%C%x /= 6) stop 19
+if (var4%R(3)%C%y /= 5) stop 19
+if (var4%R(3)%C%z /= 4) stop 19
+if (any (var4%R(3)%D(:,:)%x /= reshape([1, 4, 11, 14], [2,2]))) stop 20
+if (any (var4%R(3)%D(:,:)%y /= reshape([2, 5, 12, 15], [2,2]))) stop 20
+if (any (var4%R(3)%D(:,:)%z /= reshape([3, 6, 13, 16], [2,2]))) stop 20
+
+contains
+ subroutine foo(x, y)
+ type(t) :: x, y
+ if (x%A /= 45) stop 1
+ if (any (x%B /= [1,2,3])) stop 2
+ if (x%C%x /= 6) stop 3
+ if (x%C%y /= 5) stop 3
+ if (x%C%z /= 4) stop 3
+ if (any (x%D(:,:)%x /= reshape([1, 4, 11, 14], [2,2]))) stop 4
+ if (any (x%D(:,:)%y /= reshape([2, 5, 12, 15], [2,2]))) stop 4
+ if (any (x%D(:,:)%z /= reshape([3, 6, 13, 16], [2,2]))) stop 4
+
+ if (y%A /= 145) stop 5
+ if (any (y%B /= [991,992,993])) stop 6
+ if (y%C%x /= 996) stop 7
+ if (y%C%y /= 995) stop 7
+ if (y%C%z /= 994) stop 7
+ if (any (y%D(:,:)%x /= reshape([199, 499, 1199, 1499], [2,2]))) stop 8
+ if (any (y%D(:,:)%y /= reshape([299, 599, 1299, 1599], [2,2]))) stop 8
+ if (any (y%D(:,:)%z /= reshape([399, 699, 1399, 1699], [2,2]))) stop 8
+
+ y%A = x%A
+ y%B(:) = x%B
+ y%C = x%C
+ y%D(:,:) = x%D(:,:)
+ end
+end
diff --git a/libgomp/testsuite/libgomp.fortran/map-alloc-comp-4.f90 b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-4.f90
new file mode 100644
index 0000000..fb9859d
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-4.f90
@@ -0,0 +1,124 @@
+type t2
+ integer x, y, z
+end type t2
+type t
+ integer, allocatable :: A
+ integer, allocatable :: B(:)
+ type(t2), allocatable :: C
+ type(t2), allocatable :: D(:,:)
+end type t
+
+type t3
+ type(t) :: Q
+ type(t) :: R(5)
+end type
+
+type(t) :: var, var2
+type(t3) :: var3, var4
+
+! --------------------------------------
+! Assign + allocate
+var%A = 45
+var%B = [1,2,3]
+var%C = t2(6,5,4)
+var%D = reshape([t2(1,2,3), t2(4,5,6), t2(11,12,13), t2(14,15,16)], [2,2])
+
+! Assign + allocate
+var2%A = 145
+var2%B = [991,992,993]
+var2%C = t2(996,995,994)
+var2%D = reshape([t2(199,299,399), t2(499,599,699), t2(1199,1299,1399), t2(1499,1599,1699)], [2,2])
+
+
+!$omp target map(to: var%A, var%B, var%C, var%D) &
+!$omp& map(tofrom: var2%A, var2%B, var2%C, var2%D)
+ call foo(var, var2)
+!$omp end target
+
+if (var2%A /= 45) stop 9
+if (any (var2%B /= [1,2,3])) stop 10
+if (var2%C%x /= 6) stop 11
+if (var2%C%y /= 5) stop 11
+if (var2%C%z /= 4) stop 11
+if (any (var2%D(:,:)%x /= reshape([1, 4, 11, 14], [2,2]))) stop 12
+if (any (var2%D(:,:)%y /= reshape([2, 5, 12, 15], [2,2]))) stop 12
+if (any (var2%D(:,:)%z /= reshape([3, 6, 13, 16], [2,2]))) stop 12
+
+! --------------------------------------
+! Assign + allocate
+var3%Q%A = 45
+var3%Q%B = [1,2,3]
+var3%Q%C = t2(6,5,4)
+var3%Q%D = reshape([t2(1,2,3), t2(4,5,6), t2(11,12,13), t2(14,15,16)], [2,2])
+
+var3%R(2)%A = 45
+var3%R(2)%B = [1,2,3]
+var3%R(2)%C = t2(6,5,4)
+var3%R(2)%D = reshape([t2(1,2,3), t2(4,5,6), t2(11,12,13), t2(14,15,16)], [2,2])
+
+! Assign + allocate
+var4%Q%A = 145
+var4%Q%B = [991,992,993]
+var4%Q%C = t2(996,995,994)
+var4%Q%D = reshape([t2(199,299,399), t2(499,599,699), t2(1199,1299,1399), t2(1499,1599,1699)], [2,2])
+
+var4%R(3)%A = 145
+var4%R(3)%B = [991,992,993]
+var4%R(3)%C = t2(996,995,994)
+var4%R(3)%D = reshape([t2(199,299,399), t2(499,599,699), t2(1199,1299,1399), t2(1499,1599,1699)], [2,2])
+
+!$omp target map(to: var3%Q%A, var3%Q%B, var3%Q%C, var3%Q%D) &
+!$omp& map(tofrom: var4%Q%A, var4%Q%B, var4%Q%C, var4%Q%D)
+ call foo(var3%Q, var4%Q)
+!$omp end target
+
+if (var4%Q%A /= 45) stop 13
+if (any (var4%Q%B /= [1,2,3])) stop 14
+if (var4%Q%C%x /= 6) stop 15
+if (var4%Q%C%y /= 5) stop 15
+if (var4%Q%C%z /= 4) stop 15
+if (any (var4%Q%D(:,:)%x /= reshape([1, 4, 11, 14], [2,2]))) stop 16
+if (any (var4%Q%D(:,:)%y /= reshape([2, 5, 12, 15], [2,2]))) stop 16
+if (any (var4%Q%D(:,:)%z /= reshape([3, 6, 13, 16], [2,2]))) stop 16
+
+!$omp target map(to: var3%R(2)%A, var3%R(2)%B, var3%R(2)%C, var3%R(2)%D) &
+!$omp& map(tofrom: var4%R(3)%A, var4%R(3)%B, var4%R(3)%C, var4%R(3)%D)
+ call foo(var3%R(2), var4%R(3))
+!$omp end target
+
+if (var4%R(3)%A /= 45) stop 17
+if (any (var4%R(3)%B /= [1,2,3])) stop 18
+if (var4%R(3)%C%x /= 6) stop 19
+if (var4%R(3)%C%y /= 5) stop 19
+if (var4%R(3)%C%z /= 4) stop 19
+if (any (var4%R(3)%D(:,:)%x /= reshape([1, 4, 11, 14], [2,2]))) stop 20
+if (any (var4%R(3)%D(:,:)%y /= reshape([2, 5, 12, 15], [2,2]))) stop 20
+if (any (var4%R(3)%D(:,:)%z /= reshape([3, 6, 13, 16], [2,2]))) stop 20
+
+contains
+ subroutine foo(x, y)
+ type(t) :: x, y
+ if (x%A /= 45) stop 1
+ if (any (x%B /= [1,2,3])) stop 2
+ if (x%C%x /= 6) stop 3
+ if (x%C%y /= 5) stop 3
+ if (x%C%z /= 4) stop 3
+ if (any (x%D(:,:)%x /= reshape([1, 4, 11, 14], [2,2]))) stop 4
+ if (any (x%D(:,:)%y /= reshape([2, 5, 12, 15], [2,2]))) stop 4
+ if (any (x%D(:,:)%z /= reshape([3, 6, 13, 16], [2,2]))) stop 4
+
+ if (y%A /= 145) stop 5
+ if (any (y%B /= [991,992,993])) stop 6
+ if (y%C%x /= 996) stop 7
+ if (y%C%y /= 995) stop 7
+ if (y%C%z /= 994) stop 7
+ if (any (y%D(:,:)%x /= reshape([199, 499, 1199, 1499], [2,2]))) stop 8
+ if (any (y%D(:,:)%y /= reshape([299, 599, 1299, 1599], [2,2]))) stop 8
+ if (any (y%D(:,:)%z /= reshape([399, 699, 1399, 1699], [2,2]))) stop 8
+
+ y%A = x%A
+ y%B(:) = x%B
+ y%C = x%C
+ y%D(:,:) = x%D(:,:)
+ end
+end
diff --git a/libgomp/testsuite/libgomp.fortran/map-alloc-comp-5.f90 b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-5.f90
new file mode 100644
index 0000000..b2e36b2
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-5.f90
@@ -0,0 +1,53 @@
+implicit none
+type t
+ integer, allocatable :: a, b(:)
+end type t
+type(t) :: x, y, z
+integer :: i
+
+!$omp target
+ if (allocated(x%a)) stop 1
+ if (allocated(x%b)) stop 2
+!$omp end target
+
+allocate(x%a, x%b(-4:6))
+x%b(:) = [(i, i=-4,6)]
+
+!$omp target
+ if (.not. allocated(x%a)) stop 3
+ if (.not. allocated(x%b)) stop 4
+ if (lbound(x%b,1) /= -4) stop 5
+ if (ubound(x%b,1) /= 6) stop 6
+ if (any (x%b /= [(i, i=-4,6)])) stop 7
+!$omp end target
+
+
+! The following only works with arrays due to
+! PR fortran/96668
+
+!$omp target enter data map(to: y, z)
+
+!$omp target
+ if (allocated(y%b)) stop 8
+ if (allocated(z%b)) stop 9
+!$omp end target
+
+allocate(y%b(5), z%b(3))
+y%b = 42
+z%b = 99
+
+! (implicitly) 'tofrom' mapped
+! Planned for OpenMP 6.0 (but common extension)
+! OpenMP <= 5.0 unclear
+!$omp target
+ if (.not.allocated(y%b)) stop 10
+ if (any (y%b /= 42)) stop 11
+!$omp end target
+
+! always map: OpenMP 5.1 (clarified)
+!$omp target map(always, tofrom: z)
+ if (.not.allocated(z%b)) stop 12
+ if (any (z%b /= 99)) stop 13
+!$omp end target
+
+end
diff --git a/libgomp/testsuite/libgomp.fortran/map-alloc-comp-6.f90 b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-6.f90
new file mode 100644
index 0000000..48d4aea
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-6.f90
@@ -0,0 +1,308 @@
+! NOTE: This code uses POINTER.
+! While map(p, var%p) etc. maps the ptr/ptr comp p / var%p (incl. allocatable comps),
+! map(var) does not map var%p.
+
+use iso_c_binding
+implicit none
+type t2
+ integer, allocatable :: x, y, z
+end type t2
+type t
+ integer, pointer :: A => null()
+ integer, pointer :: B(:) => null()
+ type(t2), pointer :: C => null()
+ type(t2), pointer :: D(:,:) => null()
+end type t
+
+type t3
+ type(t) :: Q
+ type(t) :: R(5)
+end type
+
+type(t) :: var, var2
+type(t3) :: var3, var4
+integer(c_intptr_t) :: iptr
+
+! --------------------------------------
+! Assign + allocate
+allocate (var%A, source=45)
+allocate (var%B(3), source=[1,2,3])
+allocate (var%C)
+var%C%x = 6; var%C%y = 5; var%C%z = 4
+allocate (var%D(2,2))
+var%D(1,1)%x = 1
+var%D(1,1)%y = 2
+var%D(1,1)%z = 3
+var%D(2,1)%x = 4
+var%D(2,1)%y = 5
+var%D(2,1)%z = 6
+var%D(1,2)%x = 11
+var%D(1,2)%y = 12
+var%D(1,2)%z = 13
+var%D(2,2)%x = 14
+var%D(2,2)%y = 15
+var%D(2,2)%z = 16
+
+! Assign + allocate
+allocate (var2%A, source=145)
+allocate (var2%B, source=[991,992,993])
+allocate (var2%C)
+var2%C%x = 996; var2%C%y = 995; var2%C%z = 994
+allocate (var2%D(2,2))
+var2%D(1,1)%x = 199
+var2%D(1,1)%y = 299
+var2%D(1,1)%z = 399
+var2%D(2,1)%x = 499
+var2%D(2,1)%y = 599
+var2%D(2,1)%z = 699
+var2%D(1,2)%x = 1199
+var2%D(1,2)%y = 1299
+var2%D(1,2)%z = 1399
+var2%D(2,2)%x = 1499
+var2%D(2,2)%y = 1599
+var2%D(2,2)%z = 1699
+
+block
+ integer(c_intptr_t) :: loc_a, loc_b, loc_c, loc_d, loc2_a, loc2_b, loc2_c, loc2_d
+ loc_a = loc (var%a)
+ loc_b = loc (var%b)
+ loc_c = loc (var%d)
+ loc_d = loc (var%d)
+ loc2_a = loc (var2%a)
+ loc2_b = loc (var2%b)
+ loc2_c = loc (var2%c)
+ loc2_d = loc (var2%d)
+ ! var/var2 are mapped, but the pointer components aren't
+ !$omp target map(to: var) map(tofrom: var2)
+ if (loc_a /= loc (var%a)) stop 31
+ if (loc_b /= loc (var%b)) stop 32
+ if (loc_c /= loc (var%d)) stop 33
+ if (loc_d /= loc (var%d)) stop 34
+ if (loc2_a /= loc (var2%a)) stop 35
+ if (loc2_b /= loc (var2%b)) stop 36
+ if (loc2_c /= loc (var2%c)) stop 37
+ if (loc2_d /= loc (var2%d)) stop 38
+ !$omp end target
+ if (loc_a /= loc (var%a)) stop 41
+ if (loc_b /= loc (var%b)) stop 42
+ if (loc_c /= loc (var%d)) stop 43
+ if (loc_d /= loc (var%d)) stop 44
+ if (loc2_a /= loc (var2%a)) stop 45
+ if (loc2_b /= loc (var2%b)) stop 46
+ if (loc2_c /= loc (var2%c)) stop 47
+ if (loc2_d /= loc (var2%d)) stop 48
+end block
+
+block
+ ! Map only (all) components, but this maps also the alloc comps
+ !$omp target map(to: var%a, var%b, var%c, var%d) map(tofrom: var2%a, var2%b, var2%c, var2%d)
+ call foo (var,var2)
+ !$omp end target
+end block
+
+if (var2%A /= 45) stop 9
+if (any (var2%B /= [1,2,3])) stop 10
+if (var2%C%x /= 6) stop 11
+if (var2%C%y /= 5) stop 11
+if (var2%C%z /= 4) stop 11
+block
+ integer :: tmp_x(2,2), tmp_y(2,2), tmp_z(2,2), i, j
+ tmp_x = reshape([1, 4, 11, 14], [2,2])
+ tmp_y = reshape([2, 5, 12, 15], [2,2])
+ tmp_z = reshape([3, 6, 13, 16], [2,2])
+ do j = 1, 2
+ do i = 1, 2
+ if (var2%D(i,j)%x /= tmp_x(i,j)) stop 12
+ if (var2%D(i,j)%y /= tmp_y(i,j)) stop 12
+ if (var2%D(i,j)%z /= tmp_z(i,j)) stop 12
+ end do
+ end do
+end block
+
+! Extra deallocates due to PR fortran/104697
+deallocate(var%C%x, var%C%y, var%C%z)
+deallocate(var%D(1,1)%x, var%D(1,1)%y, var%D(1,1)%z)
+deallocate(var%D(2,1)%x, var%D(2,1)%y, var%D(2,1)%z)
+deallocate(var%D(1,2)%x, var%D(1,2)%y, var%D(1,2)%z)
+deallocate(var%D(2,2)%x, var%D(2,2)%y, var%D(2,2)%z)
+deallocate(var%A, var%B, var%C, var%D)
+
+deallocate(var2%C%x, var2%C%y, var2%C%z)
+deallocate(var2%D(1,1)%x, var2%D(1,1)%y, var2%D(1,1)%z)
+deallocate(var2%D(2,1)%x, var2%D(2,1)%y, var2%D(2,1)%z)
+deallocate(var2%D(1,2)%x, var2%D(1,2)%y, var2%D(1,2)%z)
+deallocate(var2%D(2,2)%x, var2%D(2,2)%y, var2%D(2,2)%z)
+deallocate(var2%A, var2%B, var2%C, var2%D)
+
+! --------------------------------------
+! Assign + allocate
+allocate (var3%Q%A, source=45)
+allocate (var3%Q%B, source=[1,2,3])
+allocate (var3%Q%C, source=t2(6,5,4))
+allocate (var3%Q%D(2,2))
+var3%Q%D(1,1) = t2(1,2,3)
+var3%Q%D(2,1) = t2(4,5,6)
+var3%Q%D(1,2) = t2(11,12,13)
+var3%Q%D(2,2) = t2(14,15,16)
+
+allocate (var3%R(2)%A, source=45)
+allocate (var3%R(2)%B, source=[1,2,3])
+allocate (var3%R(2)%C, source=t2(6,5,4))
+allocate (var3%R(2)%D(2,2))
+var3%R(2)%D(1,1) = t2(1,2,3)
+var3%R(2)%D(2,1) = t2(4,5,6)
+var3%R(2)%D(1,2) = t2(11,12,13)
+var3%R(2)%D(2,2) = t2(14,15,16)
+
+! Assign + allocate
+allocate (var4%Q%A, source=145)
+allocate (var4%Q%B, source=[991,992,993])
+allocate (var4%Q%C, source=t2(996,995,994))
+allocate (var4%Q%D(2,2))
+var4%Q%D(1,1) = t2(199,299,399)
+var4%Q%D(2,1) = t2(499,599,699)
+var4%Q%D(1,2) = t2(1199,1299,1399)
+var4%Q%D(2,2) = t2(1499,1599,1699)
+
+allocate (var4%R(3)%A, source=145)
+allocate (var4%R(3)%B, source=[991,992,993])
+allocate (var4%R(3)%C, source=t2(996,995,994))
+allocate (var4%R(3)%D(2,2))
+var4%R(3)%D(1,1) = t2(199,299,399)
+var4%R(3)%D(2,1) = t2(499,599,699)
+var4%R(3)%D(1,2) = t2(1199,1299,1399)
+var4%R(3)%D(2,2) = t2(1499,1599,1699)
+
+!$omp target map(to: var3%Q%A, var3%Q%B, var3%Q%C, var3%Q%D) &
+!$omp& map(tofrom: var4%Q%A, var4%Q%B, var4%Q%C, var4%Q%D)
+ call foo(var3%Q, var4%Q)
+!$omp end target
+
+iptr = loc(var3%R(2)%A)
+
+!$omp target map(to: var3%R(2)%A, var3%R(2)%B, var3%R(2)%C, var3%R(2)%D) &
+!$omp& map(tofrom: var4%R(3)%A, var4%R(3)%B, var4%R(3)%C, var4%R(3)%D)
+ call foo(var3%R(2), var4%R(3))
+!$omp end target
+
+if (var4%Q%A /= 45) stop 13
+if (any (var4%Q%B /= [1,2,3])) stop 14
+if (var4%Q%C%x /= 6) stop 15
+if (var4%Q%C%y /= 5) stop 15
+if (var4%Q%C%z /= 4) stop 15
+block
+ integer :: tmp_x(2,2), tmp_y(2,2), tmp_z(2,2), i, j
+ tmp_x = reshape([1, 4, 11, 14], [2,2])
+ tmp_y = reshape([2, 5, 12, 15], [2,2])
+ tmp_z = reshape([3, 6, 13, 16], [2,2])
+ do j = 1, 2
+ do i = 1, 2
+ if (var4%Q%D(i,j)%x /= tmp_x(i,j)) stop 16
+ if (var4%Q%D(i,j)%y /= tmp_y(i,j)) stop 16
+ if (var4%Q%D(i,j)%z /= tmp_z(i,j)) stop 16
+ end do
+ end do
+end block
+
+! Cf. PR fortran/104696
+! { dg-output "valid mapping, OK" { xfail { offload_device_nonshared_as } } }
+if (iptr /= loc(var3%R(2)%A)) then
+ print *, "invalid mapping, cf. PR fortran/104696"
+else
+
+if (var4%R(3)%A /= 45) stop 17
+if (any (var4%R(3)%B /= [1,2,3])) stop 18
+if (var4%R(3)%C%x /= 6) stop 19
+if (var4%R(3)%C%y /= 5) stop 19
+if (var4%R(3)%C%z /= 4) stop 19
+block
+ integer :: tmp_x(2,2), tmp_y(2,2), tmp_z(2,2), i, j
+ tmp_x = reshape([1, 4, 11, 14], [2,2])
+ tmp_y = reshape([2, 5, 12, 15], [2,2])
+ tmp_z = reshape([3, 6, 13, 16], [2,2])
+ do j = 1, 2
+ do i = 1, 2
+ if (var4%R(3)%D(i,j)%x /= tmp_x(i,j)) stop 20
+ if (var4%R(3)%D(i,j)%y /= tmp_y(i,j)) stop 20
+ if (var4%R(3)%D(i,j)%z /= tmp_z(i,j)) stop 20
+ end do
+ end do
+end block
+
+! Extra deallocates due to PR fortran/104697
+deallocate(var3%Q%C%x, var3%Q%D(1,1)%x, var3%Q%D(2,1)%x, var3%Q%D(1,2)%x, var3%Q%D(2,2)%x)
+deallocate(var3%Q%C%y, var3%Q%D(1,1)%y, var3%Q%D(2,1)%y, var3%Q%D(1,2)%y, var3%Q%D(2,2)%y)
+deallocate(var3%Q%C%z, var3%Q%D(1,1)%z, var3%Q%D(2,1)%z, var3%Q%D(1,2)%z, var3%Q%D(2,2)%z)
+deallocate(var3%Q%A, var3%Q%B, var3%Q%C, var3%Q%D)
+
+deallocate(var4%Q%C%x, var4%Q%D(1,1)%x, var4%Q%D(2,1)%x, var4%Q%D(1,2)%x, var4%Q%D(2,2)%x)
+deallocate(var4%Q%C%y, var4%Q%D(1,1)%y, var4%Q%D(2,1)%y, var4%Q%D(1,2)%y, var4%Q%D(2,2)%y)
+deallocate(var4%Q%C%z, var4%Q%D(1,1)%z, var4%Q%D(2,1)%z, var4%Q%D(1,2)%z, var4%Q%D(2,2)%z)
+deallocate(var4%Q%A, var4%Q%B, var4%Q%C, var4%Q%D)
+
+deallocate(var3%R(2)%C%x, var3%R(2)%D(1,1)%x, var3%R(2)%D(2,1)%x, var3%R(2)%D(1,2)%x, var3%R(2)%D(2,2)%x)
+deallocate(var3%R(2)%C%y, var3%R(2)%D(1,1)%y, var3%R(2)%D(2,1)%y, var3%R(2)%D(1,2)%y, var3%R(2)%D(2,2)%y)
+deallocate(var3%R(2)%C%z, var3%R(2)%D(1,1)%z, var3%R(2)%D(2,1)%z, var3%R(2)%D(1,2)%z, var3%R(2)%D(2,2)%z)
+deallocate(var3%R(2)%A, var3%R(2)%B, var3%R(2)%C, var3%R(2)%D)
+
+deallocate(var4%R(3)%C%x, var4%R(3)%D(1,1)%x, var4%R(3)%D(2,1)%x, var4%R(3)%D(1,2)%x, var4%R(3)%D(2,2)%x)
+deallocate(var4%R(3)%C%y, var4%R(3)%D(1,1)%y, var4%R(3)%D(2,1)%y, var4%R(3)%D(1,2)%y, var4%R(3)%D(2,2)%y)
+deallocate(var4%R(3)%C%z, var4%R(3)%D(1,1)%z, var4%R(3)%D(2,1)%z, var4%R(3)%D(1,2)%z, var4%R(3)%D(2,2)%z)
+deallocate(var4%R(3)%A, var4%R(3)%B, var4%R(3)%C, var4%R(3)%D)
+
+ print *, "valid mapping, OK"
+endif
+
+contains
+ subroutine foo(x, y)
+ type(t) :: x, y
+ intent(in) :: x
+ intent(inout) :: y
+ integer :: tmp_x(2,2), tmp_y(2,2), tmp_z(2,2), i, j
+ if (x%A /= 45) stop 1
+ if (any (x%B /= [1,2,3])) stop 2
+ if (x%C%x /= 6) stop 3
+ if (x%C%y /= 5) stop 3
+ if (x%C%z /= 4) stop 3
+
+ tmp_x = reshape([1, 4, 11, 14], [2,2])
+ tmp_y = reshape([2, 5, 12, 15], [2,2])
+ tmp_z = reshape([3, 6, 13, 16], [2,2])
+ do j = 1, 2
+ do i = 1, 2
+ if (x%D(i,j)%x /= tmp_x(i,j)) stop 4
+ if (x%D(i,j)%y /= tmp_y(i,j)) stop 4
+ if (x%D(i,j)%z /= tmp_z(i,j)) stop 4
+ end do
+ end do
+
+ if (y%A /= 145) stop 5
+ if (any (y%B /= [991,992,993])) stop 6
+ if (y%C%x /= 996) stop 7
+ if (y%C%y /= 995) stop 7
+ if (y%C%z /= 994) stop 7
+ tmp_x = reshape([199, 499, 1199, 1499], [2,2])
+ tmp_y = reshape([299, 599, 1299, 1599], [2,2])
+ tmp_z = reshape([399, 699, 1399, 1699], [2,2])
+ do j = 1, 2
+ do i = 1, 2
+ if (y%D(i,j)%x /= tmp_x(i,j)) stop 8
+ if (y%D(i,j)%y /= tmp_y(i,j)) stop 8
+ if (y%D(i,j)%z /= tmp_z(i,j)) stop 8
+ end do
+ end do
+
+ y%A = x%A
+ y%B(:) = x%B
+ y%C%x = x%C%x
+ y%C%y = x%C%y
+ y%C%z = x%C%z
+ do j = 1, 2
+ do i = 1, 2
+ y%D(i,j)%x = x%D(i,j)%x
+ y%D(i,j)%y = x%D(i,j)%y
+ y%D(i,j)%z = x%D(i,j)%z
+ end do
+ end do
+ end
+end
diff --git a/libgomp/testsuite/libgomp.fortran/map-alloc-comp-7.f90 b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-7.f90
new file mode 100644
index 0000000..1493c5f
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-7.f90
@@ -0,0 +1,672 @@
+module m
+ implicit none (type, external)
+ type t
+ integer, allocatable :: arr(:,:)
+ integer :: var
+ integer, allocatable :: slr
+ end type t
+
+contains
+
+ subroutine check_it (is_present, dummy_alloced, inner_alloc, &
+ scalar, array, a_scalar, a_array, &
+ l_scalar, l_array, la_scalar, la_array, &
+ opt_scalar, opt_array, a_opt_scalar, a_opt_array)
+ type(t), intent(inout) :: &
+ scalar, array(:,:), opt_scalar, opt_array(:,:), a_scalar, a_array(:,:), &
+ a_opt_scalar, a_opt_array(:,:), &
+ l_scalar, l_array(:,:), la_scalar, la_array(:,:)
+ optional :: opt_scalar, opt_array, a_opt_scalar, a_opt_array
+ allocatable :: a_scalar, a_array, a_opt_scalar, a_opt_array, la_scalar, la_array
+ logical, value :: is_present, dummy_alloced, inner_alloc
+ integer :: i, j, k, l
+
+ ! CHECK VALUE
+ if (scalar%var /= 42) stop 1
+ if (l_scalar%var /= 42) stop 1
+ if (is_present) then
+ if (opt_scalar%var /= 42) stop 2
+ end if
+ if (any (shape(array) /= [3,2])) stop 1
+ if (any (shape(l_array) /= [3,2])) stop 1
+ if (is_present) then
+ if (any (shape(opt_array) /= [3,2])) stop 1
+ end if
+ do j = 1, 2
+ do i = 1, 3
+ if (array(i,j)%var /= i*97 + 100*41*j) stop 3
+ if (l_array(i,j)%var /= i*97 + 100*41*j) stop 3
+ if (is_present) then
+ if (opt_array(i,j)%var /= i*97 + 100*41*j) stop 4
+ end if
+ end do
+ end do
+
+ if (dummy_alloced) then
+ if (a_scalar%var /= 42) stop 1
+ if (la_scalar%var /= 42) stop 1
+ if (is_present) then
+ if (a_opt_scalar%var /= 42) stop 1
+ end if
+ if (any (shape(a_array) /= [3,2])) stop 1
+ if (any (shape(la_array) /= [3,2])) stop 1
+ if (is_present) then
+ if (any (shape(a_opt_array) /= [3,2])) stop 1
+ end if
+ do j = 1, 2
+ do i = 1, 3
+ if (a_array(i,j)%var /= i*97 + 100*41*j) stop 1
+ if (la_array(i,j)%var /= i*97 + 100*41*j) stop 1
+ if (is_present) then
+ if (a_opt_array(i,j)%var /= i*97 + 100*41*j) stop 1
+ end if
+ end do
+ end do
+ else
+ if (allocated (a_scalar)) stop 1
+ if (allocated (la_scalar)) stop 1
+ if (allocated (a_array)) stop 1
+ if (allocated (la_array)) stop 1
+ if (is_present) then
+ if (allocated (a_opt_scalar)) stop 1
+ if (allocated (a_opt_array)) stop 1
+ end if
+ end if
+
+ if (inner_alloc) then
+ if (scalar%slr /= 467) stop 5
+ if (l_scalar%slr /= 467) stop 5
+ if (a_scalar%slr /= 467) stop 6
+ if (la_scalar%slr /= 467) stop 6
+ if (is_present) then
+ if (opt_scalar%slr /= 467) stop 7
+ if (a_opt_scalar%slr /= 467) stop 8
+ end if
+ do j = 1, 2
+ do i = 1, 3
+ if (array(i,j)%slr /= (i*97 + 100*41*j) + 467) stop 9
+ if (l_array(i,j)%slr /= (i*97 + 100*41*j) + 467) stop 9
+ if (a_array(i,j)%slr /= (i*97 + 100*41*j) + 467) stop 10
+ if (la_array(i,j)%slr /= (i*97 + 100*41*j) + 467) stop 10
+ if (is_present) then
+ if (opt_array(i,j)%slr /= (i*97 + 100*41*j) + 467) stop 11
+ if (a_opt_array(i,j)%slr /= (i*97 + 100*41*j) + 467) stop 12
+ end if
+ end do
+ end do
+
+ do l = 1, 5
+ do k = 1, 4
+ if (any (shape(scalar%arr) /= [4,5])) stop 1
+ if (any (shape(l_scalar%arr) /= [4,5])) stop 1
+ if (any (shape(a_scalar%arr) /= [4,5])) stop 1
+ if (any (shape(la_scalar%arr) /= [4,5])) stop 1
+ if (scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467) stop 13
+ if (l_scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467) stop 13
+ if (a_scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467) stop 14
+ if (la_scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467) stop 14
+ if (is_present) then
+ if (any (shape(opt_scalar%arr) /= [4,5])) stop 1
+ if (any (shape(a_opt_scalar%arr) /= [4,5])) stop 1
+ if (opt_scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467) stop 15
+ if (a_opt_scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467) stop 16
+ end if
+ end do
+ end do
+ do j = 1, 2
+ do i = 1, 3
+ if (any (shape(array(i,j)%arr) /= [i,j])) stop 1
+ if (any (shape(l_array(i,j)%arr) /= [i,j])) stop 1
+ if (any (shape(a_array(i,j)%arr) /= [i,j])) stop 1
+ if (any (shape(la_array(i,j)%arr) /= [i,j])) stop 1
+ if (is_present) then
+ if (any (shape(opt_array(i,j)%arr) /= [i,j])) stop 1
+ if (any (shape(a_opt_array(i,j)%arr) /= [i,j])) stop 1
+ endif
+ do l = 1, j
+ do k = 1, i
+ if (array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l) stop 17
+ if (l_array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l) stop 17
+ if (a_array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l) stop 18
+ if (la_array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l) stop 18
+ if (is_present) then
+ if (opt_array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l) stop 19
+ if (a_opt_array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l) stop 20
+ end if
+ end do
+ end do
+ end do
+ end do
+ else if (dummy_alloced) then
+ if (allocated (scalar%slr)) stop 1
+ if (allocated (l_scalar%slr)) stop 1
+ if (allocated (a_scalar%slr)) stop 1
+ if (allocated (la_scalar%slr)) stop 1
+ if (is_present) then
+ if (allocated (opt_scalar%slr)) stop 1
+ if (allocated (a_opt_scalar%slr)) stop 1
+ endif
+ if (allocated (scalar%arr)) stop 1
+ if (allocated (l_scalar%arr)) stop 1
+ if (allocated (a_scalar%arr)) stop 1
+ if (allocated (la_scalar%arr)) stop 1
+ if (is_present) then
+ if (allocated (opt_scalar%arr)) stop 1
+ if (allocated (a_opt_scalar%arr)) stop 1
+ endif
+ end if
+
+ ! SET VALUE
+ scalar%var = 42 + 13
+ l_scalar%var = 42 + 13
+ if (is_present) then
+ opt_scalar%var = 42 + 13
+ endif
+ do j = 1, 2
+ do i = 1, 3
+ array(i,j)%var = i*97 + 100*41*j + 13
+ l_array(i,j)%var = i*97 + 100*41*j + 13
+ if (is_present) then
+ opt_array(i,j)%var = i*97 + 100*41*j + 13
+ end if
+ end do
+ end do
+
+ if (dummy_alloced) then
+ a_scalar%var = 42 + 13
+ la_scalar%var = 42 + 13
+ if (is_present) then
+ a_opt_scalar%var = 42 + 13
+ endif
+ do j = 1, 2
+ do i = 1, 3
+ a_array(i,j)%var = i*97 + 100*41*j + 13
+ la_array(i,j)%var = i*97 + 100*41*j + 13
+ if (is_present) then
+ a_opt_array(i,j)%var = i*97 + 100*41*j + 13
+ endif
+ end do
+ end do
+ end if
+
+ if (inner_alloc) then
+ scalar%slr = 467 + 13
+ l_scalar%slr = 467 + 13
+ a_scalar%slr = 467 + 13
+ la_scalar%slr = 467 + 13
+ if (is_present) then
+ opt_scalar%slr = 467 + 13
+ a_opt_scalar%slr = 467 + 13
+ end if
+ do j = 1, 2
+ do i = 1, 3
+ array(i,j)%slr = (i*97 + 100*41*j) + 467 + 13
+ l_array(i,j)%slr = (i*97 + 100*41*j) + 467 + 13
+ a_array(i,j)%slr = (i*97 + 100*41*j) + 467 + 13
+ la_array(i,j)%slr = (i*97 + 100*41*j) + 467 + 13
+ if (is_present) then
+ opt_array(i,j)%slr = (i*97 + 100*41*j) + 467 + 13
+ a_opt_array(i,j)%slr = (i*97 + 100*41*j) + 467 + 13
+ end if
+ end do
+ end do
+
+ do l = 1, 5
+ do k = 1, 4
+ scalar%arr(k,l) = (i*27 + 1000*11*j) + 467 + 13
+ l_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467 + 13
+ a_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467 + 13
+ la_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467 + 13
+ if (is_present) then
+ opt_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467 + 13
+ a_opt_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467 + 13
+ end if
+ end do
+ end do
+ do j = 1, 2
+ do i = 1, 3
+ do l = 1, j
+ do k = 1, i
+ array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l + 13
+ l_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l + 13
+ a_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l + 13
+ la_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l + 13
+ if (is_present) then
+ opt_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l + 13
+ a_opt_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l + 13
+ end if
+ end do
+ end do
+ end do
+ end do
+ end if
+
+ end subroutine
+ subroutine check_reset (is_present, dummy_alloced, inner_alloc, &
+ scalar, array, a_scalar, a_array, &
+ l_scalar, l_array, la_scalar, la_array, &
+ opt_scalar, opt_array, a_opt_scalar, a_opt_array)
+ type(t), intent(inout) :: &
+ scalar, array(:,:), opt_scalar, opt_array(:,:), a_scalar, a_array(:,:), &
+ a_opt_scalar, a_opt_array(:,:), &
+ l_scalar, l_array(:,:), la_scalar, la_array(:,:)
+ optional :: opt_scalar, opt_array, a_opt_scalar, a_opt_array
+ allocatable :: a_scalar, a_array, a_opt_scalar, a_opt_array, la_scalar, la_array
+ logical, value :: is_present, dummy_alloced, inner_alloc
+ integer :: i, j, k, l
+
+ ! CHECK VALUE
+ if (scalar%var /= 42 + 13) stop 1
+ if (l_scalar%var /= 42 + 13) stop 1
+ if (is_present) then
+ if (opt_scalar%var /= 42 + 13) stop 2
+ end if
+ if (any (shape(array) /= [3,2])) stop 1
+ if (any (shape(l_array) /= [3,2])) stop 1
+ if (is_present) then
+ if (any (shape(opt_array) /= [3,2])) stop 1
+ end if
+ do j = 1, 2
+ do i = 1, 3
+ if (array(i,j)%var /= i*97 + 100*41*j + 13) stop 3
+ if (l_array(i,j)%var /= i*97 + 100*41*j + 13) stop 3
+ if (is_present) then
+ if (opt_array(i,j)%var /= i*97 + 100*41*j + 13) stop 4
+ end if
+ end do
+ end do
+
+ if (dummy_alloced) then
+ if (a_scalar%var /= 42 + 13) stop 1
+ if (la_scalar%var /= 42 + 13) stop 1
+ if (is_present) then
+ if (a_opt_scalar%var /= 42 + 13) stop 1
+ end if
+ if (any (shape(a_array) /= [3,2])) stop 1
+ if (any (shape(la_array) /= [3,2])) stop 1
+ if (is_present) then
+ if (any (shape(a_opt_array) /= [3,2])) stop 1
+ end if
+ do j = 1, 2
+ do i = 1, 3
+ if (a_array(i,j)%var /= i*97 + 100*41*j + 13) stop 1
+ if (la_array(i,j)%var /= i*97 + 100*41*j + 13) stop 1
+ if (is_present) then
+ if (a_opt_array(i,j)%var /= i*97 + 100*41*j + 13) stop 1
+ end if
+ end do
+ end do
+ else
+ if (allocated (a_scalar)) stop 1
+ if (allocated (la_scalar)) stop 1
+ if (allocated (a_array)) stop 1
+ if (allocated (la_array)) stop 1
+ if (is_present) then
+ if (allocated (a_opt_scalar)) stop 1
+ if (allocated (a_opt_array)) stop 1
+ end if
+ end if
+
+ if (inner_alloc) then
+ if (scalar%slr /= 467 + 13) stop 5
+ if (l_scalar%slr /= 467 + 13) stop 5
+ if (a_scalar%slr /= 467 + 13) stop 6
+ if (la_scalar%slr /= 467 + 13) stop 6
+ if (is_present) then
+ if (opt_scalar%slr /= 467 + 13) stop 7
+ if (a_opt_scalar%slr /= 467 + 13) stop 8
+ end if
+ do j = 1, 2
+ do i = 1, 3
+ if (array(i,j)%slr /= (i*97 + 100*41*j) + 467 + 13) stop 9
+ if (l_array(i,j)%slr /= (i*97 + 100*41*j) + 467 + 13) stop 9
+ if (a_array(i,j)%slr /= (i*97 + 100*41*j) + 467 + 13) stop 10
+ if (la_array(i,j)%slr /= (i*97 + 100*41*j) + 467 + 13) stop 10
+ if (is_present) then
+ if (opt_array(i,j)%slr /= (i*97 + 100*41*j) + 467 + 13) stop 11
+ if (a_opt_array(i,j)%slr /= (i*97 + 100*41*j) + 467 + 13) stop 12
+ end if
+ end do
+ end do
+
+ do l = 1, 5
+ do k = 1, 4
+ if (any (shape(scalar%arr) /= [4,5])) stop 1
+ if (any (shape(l_scalar%arr) /= [4,5])) stop 1
+ if (any (shape(a_scalar%arr) /= [4,5])) stop 1
+ if (any (shape(la_scalar%arr) /= [4,5])) stop 1
+ if (scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467 + 13) stop 13
+ if (l_scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467 + 13) stop 13
+ if (a_scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467 + 13) stop 14
+ if (la_scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467 + 13) stop 14
+ if (is_present) then
+ if (any (shape(opt_scalar%arr) /= [4,5])) stop 1
+ if (any (shape(a_opt_scalar%arr) /= [4,5])) stop 1
+ if (opt_scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467 + 13) stop 15
+ if (a_opt_scalar%arr(k,l) /= (i*27 + 1000*11*j) + 467 + 13) stop 16
+ end if
+ end do
+ end do
+ do j = 1, 2
+ do i = 1, 3
+ if (any (shape(array(i,j)%arr) /= [i,j])) stop 1
+ if (any (shape(l_array(i,j)%arr) /= [i,j])) stop 1
+ if (any (shape(a_array(i,j)%arr) /= [i,j])) stop 1
+ if (any (shape(la_array(i,j)%arr) /= [i,j])) stop 1
+ if (is_present) then
+ if (any (shape(opt_array(i,j)%arr) /= [i,j])) stop 1
+ if (any (shape(a_opt_array(i,j)%arr) /= [i,j])) stop 1
+ endif
+ do l = 1, j
+ do k = 1, i
+ if (array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l + 13) stop 17
+ if (l_array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l + 13) stop 17
+ if (a_array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l + 13) stop 18
+ if (la_array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l + 13) stop 18
+ if (is_present) then
+ if (opt_array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l + 13) stop 19
+ if (a_opt_array(i,j)%arr(k,l) /= i*27 + 1000*11*j + 467 + 3*k +53*l + 13) stop 20
+ end if
+ end do
+ end do
+ end do
+ end do
+ else if (dummy_alloced) then
+ if (allocated (scalar%slr)) stop 1
+ if (allocated (l_scalar%slr)) stop 1
+ if (allocated (a_scalar%slr)) stop 1
+ if (allocated (la_scalar%slr)) stop 1
+ if (is_present) then
+ if (allocated (opt_scalar%slr)) stop 1
+ if (allocated (a_opt_scalar%slr)) stop 1
+ endif
+ if (allocated (scalar%arr)) stop 1
+ if (allocated (l_scalar%arr)) stop 1
+ if (allocated (a_scalar%arr)) stop 1
+ if (allocated (la_scalar%arr)) stop 1
+ if (is_present) then
+ if (allocated (opt_scalar%arr)) stop 1
+ if (allocated (a_opt_scalar%arr)) stop 1
+ endif
+ end if
+
+ ! (RE)SET VALUE
+ scalar%var = 42
+ l_scalar%var = 42
+ if (is_present) then
+ opt_scalar%var = 42
+ endif
+ do j = 1, 2
+ do i = 1, 3
+ array(i,j)%var = i*97 + 100*41*j
+ l_array(i,j)%var = i*97 + 100*41*j
+ if (is_present) then
+ opt_array(i,j)%var = i*97 + 100*41*j
+ end if
+ end do
+ end do
+
+ if (dummy_alloced) then
+ a_scalar%var = 42
+ la_scalar%var = 42
+ if (is_present) then
+ a_opt_scalar%var = 42
+ endif
+ do j = 1, 2
+ do i = 1, 3
+ a_array(i,j)%var = i*97 + 100*41*j
+ la_array(i,j)%var = i*97 + 100*41*j
+ if (is_present) then
+ a_opt_array(i,j)%var = i*97 + 100*41*j
+ endif
+ end do
+ end do
+ end if
+
+ if (inner_alloc) then
+ scalar%slr = 467
+ l_scalar%slr = 467
+ a_scalar%slr = 467
+ la_scalar%slr = 467
+ if (is_present) then
+ opt_scalar%slr = 467
+ a_opt_scalar%slr = 467
+ end if
+ do j = 1, 2
+ do i = 1, 3
+ array(i,j)%slr = (i*97 + 100*41*j) + 467
+ l_array(i,j)%slr = (i*97 + 100*41*j) + 467
+ a_array(i,j)%slr = (i*97 + 100*41*j) + 467
+ la_array(i,j)%slr = (i*97 + 100*41*j) + 467
+ if (is_present) then
+ opt_array(i,j)%slr = (i*97 + 100*41*j) + 467
+ a_opt_array(i,j)%slr = (i*97 + 100*41*j) + 467
+ end if
+ end do
+ end do
+
+ do l = 1, 5
+ do k = 1, 4
+ scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ l_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ a_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ la_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ if (is_present) then
+ opt_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ a_opt_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ end if
+ end do
+ end do
+ do j = 1, 2
+ do i = 1, 3
+ do l = 1, j
+ do k = 1, i
+ array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ l_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ a_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ la_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ if (is_present) then
+ opt_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ a_opt_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ end if
+ end do
+ end do
+ end do
+ end do
+ end if
+ end subroutine
+
+ subroutine test(scalar, array, a_scalar, a_array, opt_scalar, opt_array, &
+ a_opt_scalar, a_opt_array)
+ type(t) :: scalar, array(:,:), opt_scalar, opt_array(:,:), a_scalar, a_array(:,:)
+ type(t) :: a_opt_scalar, a_opt_array(:,:)
+ type(t) :: l_scalar, l_array(3,2), la_scalar, la_array(:,:)
+ allocatable :: a_scalar, a_array, a_opt_scalar, a_opt_array, la_scalar, la_array
+ optional :: opt_scalar, opt_array, a_opt_scalar, a_opt_array
+
+ integer :: i, j, k, l
+ logical :: is_present, dummy_alloced, local_alloced, inner_alloc
+ is_present = present(opt_scalar)
+ dummy_alloced = allocated(a_scalar)
+ inner_alloc = allocated(scalar%slr)
+
+ l_scalar%var = 42
+ do j = 1, 2
+ do i = 1, 3
+ l_array(i,j)%var = i*97 + 100*41*j
+ end do
+ end do
+
+ if (dummy_alloced) then
+ allocate(la_scalar, la_array(3,2))
+ a_scalar%var = 42
+ la_scalar%var = 42
+ do j = 1, 2
+ do i = 1, 3
+ l_array(i,j)%var = i*97 + 100*41*j
+ la_array(i,j)%var = i*97 + 100*41*j
+ end do
+ end do
+ end if
+
+ if (inner_alloc) then
+ l_scalar%slr = 467
+ la_scalar%slr = 467
+ do j = 1, 2
+ do i = 1, 3
+ l_array(i,j)%slr = (i*97 + 100*41*j) + 467
+ la_array(i,j)%slr = (i*97 + 100*41*j) + 467
+ end do
+ end do
+
+ allocate(l_scalar%arr(4,5), la_scalar%arr(4,5))
+ do l = 1, 5
+ do k = 1, 4
+ l_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ la_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ end do
+ end do
+ do j = 1, 2
+ do i = 1, 3
+ allocate(l_array(i,j)%arr(i,j), la_array(i,j)%arr(i,j))
+ do l = 1, j
+ do k = 1, i
+ l_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ la_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ end do
+ end do
+ end do
+ end do
+ end if
+
+ ! implicit mapping
+ !$omp target
+ if (is_present) then
+ call check_it (is_present, dummy_alloced, inner_alloc, &
+ scalar, array, a_scalar, a_array, &
+ l_scalar, l_array, la_scalar, la_array, &
+ opt_scalar, opt_array, a_opt_scalar, a_opt_array)
+ else
+ call check_it (is_present, dummy_alloced, inner_alloc, &
+ scalar, array, a_scalar, a_array, &
+ l_scalar, l_array, la_scalar, la_array)
+ end if
+ !$omp end target
+
+ if (is_present) then
+ call check_reset (is_present, dummy_alloced, inner_alloc, &
+ scalar, array, a_scalar, a_array, &
+ l_scalar, l_array, la_scalar, la_array, &
+ opt_scalar, opt_array, a_opt_scalar, a_opt_array)
+ else
+ call check_reset (is_present, dummy_alloced, inner_alloc, &
+ scalar, array, a_scalar, a_array, &
+ l_scalar, l_array, la_scalar, la_array)
+ endif
+
+ ! explicit mapping
+ !$omp target map(scalar, array, opt_scalar, opt_array, a_scalar, a_array) &
+ !$omp& map(a_opt_scalar, a_opt_array) &
+ !$omp& map(l_scalar, l_array, la_scalar, la_array)
+ if (is_present) then
+ call check_it (is_present, dummy_alloced, inner_alloc, &
+ scalar, array, a_scalar, a_array, &
+ l_scalar, l_array, la_scalar, la_array, &
+ opt_scalar, opt_array, a_opt_scalar, a_opt_array)
+ else
+ call check_it (is_present, dummy_alloced, inner_alloc, &
+ scalar, array, a_scalar, a_array, &
+ l_scalar, l_array, la_scalar, la_array)
+ endif
+ !$omp end target
+
+ if (is_present) then
+ call check_reset (is_present, dummy_alloced, inner_alloc, &
+ scalar, array, a_scalar, a_array, &
+ l_scalar, l_array, la_scalar, la_array, &
+ opt_scalar, opt_array, a_opt_scalar, a_opt_array)
+ else
+ call check_reset (is_present, dummy_alloced, inner_alloc, &
+ scalar, array, a_scalar, a_array, &
+ l_scalar, l_array, la_scalar, la_array)
+ endif
+ end subroutine
+end module
+
+program main
+ use m
+ implicit none (type, external)
+ type(t) :: scalar, array(3,2), opt_scalar, opt_array(3,2), a_scalar, a_array(:,:)
+ type(t) :: a_opt_scalar, a_opt_array(:,:)
+ allocatable :: a_scalar, a_array, a_opt_scalar, a_opt_array
+ integer :: i, j, k, l, n
+
+ scalar%var = 42
+ opt_scalar%var = 42
+ do j = 1, 2
+ do i = 1, 3
+ array(i,j)%var = i*97 + 100*41*j
+ opt_array(i,j)%var = i*97 + 100*41*j
+ end do
+ end do
+
+ ! unallocated
+ call test (scalar, array, a_scalar, a_array)
+ call test (scalar, array, a_scalar, a_array, opt_scalar, opt_array, a_opt_scalar, a_opt_array)
+
+ ! allocated
+ allocate(a_scalar, a_opt_scalar, a_array(3,2), a_opt_array(3,2))
+ a_scalar%var = 42
+ a_opt_scalar%var = 42
+ do j = 1, 2
+ do i = 1, 3
+ a_array(i,j)%var = i*97 + 100*41*j
+ a_opt_array(i,j)%var = i*97 + 100*41*j
+ end do
+ end do
+
+ call test (scalar, array, a_scalar, a_array)
+ call test (scalar, array, a_scalar, a_array, opt_scalar, opt_array, a_opt_scalar, a_opt_array)
+
+ ! comps allocated
+ scalar%slr = 467
+ a_scalar%slr = 467
+ opt_scalar%slr = 467
+ a_opt_scalar%slr = 467
+ do j = 1, 2
+ do i = 1, 3
+ array(i,j)%slr = (i*97 + 100*41*j) + 467
+ a_array(i,j)%slr = (i*97 + 100*41*j) + 467
+ opt_array(i,j)%slr = (i*97 + 100*41*j) + 467
+ a_opt_array(i,j)%slr = (i*97 + 100*41*j) + 467
+ end do
+ end do
+
+ allocate(scalar%arr(4,5), a_scalar%arr(4,5), opt_scalar%arr(4,5), a_opt_scalar%arr(4,5))
+ do l = 1, 5
+ do k = 1, 4
+ scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ a_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ opt_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ a_opt_scalar%arr(k,l) = (i*27 + 1000*11*j) + 467
+ end do
+ end do
+ do j = 1, 2
+ do i = 1, 3
+ allocate(array(i,j)%arr(i,j), a_array(i,j)%arr(i,j), opt_array(i,j)%arr(i,j), a_opt_array(i,j)%arr(i,j))
+ do l = 1, j
+ do k = 1, i
+ array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ a_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ opt_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ a_opt_array(i,j)%arr(k,l) = i*27 + 1000*11*j + 467 + 3*k +53*l
+ end do
+ end do
+ end do
+ end do
+
+ call test (scalar, array, a_scalar, a_array)
+ call test (scalar, array, a_scalar, a_array, opt_scalar, opt_array, a_opt_scalar, a_opt_array)
+
+ deallocate(a_scalar, a_opt_scalar, a_array, a_opt_array)
+end
diff --git a/libgomp/testsuite/libgomp.fortran/map-alloc-comp-8.f90 b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-8.f90
new file mode 100644
index 0000000..f5a286e
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-8.f90
@@ -0,0 +1,268 @@
+module m
+ implicit none (type, external)
+ type t
+ integer, allocatable :: A(:)
+ end type t
+ type t2
+ type(t), allocatable :: vT
+ integer, allocatable :: x
+ end type t2
+
+contains
+
+ subroutine test_alloc()
+ type(t) :: var
+ type(t), allocatable :: var2
+
+ allocate(var2)
+ allocate(var%A(4), var2%A(5))
+
+ !$omp target enter data map(alloc: var, var2)
+ !$omp target
+ if (.not. allocated(Var2)) stop 1
+ if (.not. allocated(Var%A)) stop 2
+ if (.not. allocated(Var2%A)) stop 3
+ if (lbound(var%A, 1) /= 1 .or. ubound(var%A, 1) /= 4) stop 4
+ if (lbound(var2%A, 1) /= 1 .or. ubound(var2%A, 1) /= 5) stop 5
+ var%A = [1,2,3,4]
+ var2%A = [11,22,33,44,55]
+ !$omp end target
+ !$omp target exit data map(from: var, var2)
+
+ if (.not. allocated(Var2)) error stop
+ if (.not. allocated(Var%A)) error stop
+ if (.not. allocated(Var2%A)) error stop
+ if (lbound(var%A, 1) /= 1 .or. ubound(var%A, 1) /= 4) error stop
+ if (lbound(var2%A, 1) /= 1 .or. ubound(var2%A, 1) /= 5) error stop
+ if (any(var%A /= [1,2,3,4])) error stop
+ if (any(var2%A /= [11,22,33,44,55])) error stop
+ end subroutine test_alloc
+
+ subroutine test2_alloc()
+ type(t2) :: var
+ type(t2), allocatable :: var2
+
+ allocate(var2)
+ allocate(var%x, var2%x)
+
+ !$omp target enter data map(alloc: var, var2)
+ !$omp target
+ if (.not. allocated(Var2)) stop 6
+ if (.not. allocated(Var%x)) stop 7
+ if (.not. allocated(Var2%x)) stop 8
+ var%x = 42
+ var2%x = 43
+ !$omp end target
+ !$omp target exit data map(from: var, var2)
+
+ if (.not. allocated(Var2)) error stop
+ if (.not. allocated(Var%x)) error stop
+ if (.not. allocated(Var2%x)) error stop
+ if (var%x /= 42) error stop
+ if (var2%x /= 43) error stop
+
+ allocate(var%vt, var2%vt)
+ allocate(var%vt%A(-1:3), var2%vt%A(0:4))
+
+ !$omp target enter data map(alloc: var, var2)
+ !$omp target
+ if (.not. allocated(Var2)) stop 11
+ if (.not. allocated(Var%x)) stop 12
+ if (.not. allocated(Var2%x)) stop 13
+ if (.not. allocated(Var%vt)) stop 14
+ if (.not. allocated(Var2%vt)) stop 15
+ if (.not. allocated(Var%vt%a)) stop 16
+ if (.not. allocated(Var2%vt%a)) stop 17
+ var%x = 42
+ var2%x = 43
+ if (lbound(var%vt%A, 1) /= -1 .or. ubound(var%vt%A, 1) /= 3) stop 4
+ if (lbound(var2%vt%A, 1) /= 0 .or. ubound(var2%vt%A, 1) /= 4) stop 5
+ var%vt%A = [1,2,3,4,5]
+ var2%vt%A = [11,22,33,44,55]
+ !$omp end target
+ !$omp target exit data map(from: var, var2)
+
+ if (.not. allocated(Var2)) error stop
+ if (.not. allocated(Var%x)) error stop
+ if (.not. allocated(Var2%x)) error stop
+ if (.not. allocated(Var%vt)) error stop
+ if (.not. allocated(Var2%vt)) error stop
+ if (.not. allocated(Var%vt%a)) error stop
+ if (.not. allocated(Var2%vt%a)) error stop
+ if (var%x /= 42) error stop
+ if (var2%x /= 43) error stop
+ if (lbound(var%vt%A, 1) /= -1 .or. ubound(var%vt%A, 1) /= 3) error stop
+ if (lbound(var2%vt%A, 1) /= 0 .or. ubound(var2%vt%A, 1) /= 4) error stop
+ if (any(var%vt%A /= [1,2,3,4,5])) error stop
+ if (any(var2%vt%A /= [11,22,33,44,55])) error stop
+ end subroutine test2_alloc
+
+
+ subroutine test_alloc_target()
+ type(t) :: var
+ type(t), allocatable :: var2
+
+ allocate(var2)
+ allocate(var%A(4), var2%A(5))
+
+ !$omp target map(alloc: var, var2)
+ if (.not. allocated(Var2)) stop 1
+ if (.not. allocated(Var%A)) stop 2
+ if (.not. allocated(Var2%A)) stop 3
+ if (lbound(var%A, 1) /= 1 .or. ubound(var%A, 1) /= 4) stop 4
+ if (lbound(var2%A, 1) /= 1 .or. ubound(var2%A, 1) /= 5) stop 5
+ var%A = [1,2,3,4]
+ var2%A = [11,22,33,44,55]
+ !$omp end target
+
+ if (.not. allocated(Var2)) error stop
+ if (.not. allocated(Var%A)) error stop
+ if (.not. allocated(Var2%A)) error stop
+ if (lbound(var%A, 1) /= 1 .or. ubound(var%A, 1) /= 4) error stop
+ if (lbound(var2%A, 1) /= 1 .or. ubound(var2%A, 1) /= 5) error stop
+ end subroutine test_alloc_target
+
+ subroutine test2_alloc_target()
+ type(t2) :: var
+ type(t2), allocatable :: var2
+
+ allocate(var2)
+ allocate(var%x, var2%x)
+
+ !$omp target map(alloc: var, var2)
+ if (.not. allocated(Var2)) stop 6
+ if (.not. allocated(Var%x)) stop 7
+ if (.not. allocated(Var2%x)) stop 8
+ var%x = 42
+ var2%x = 43
+ !$omp end target
+
+ if (.not. allocated(Var2)) error stop
+ if (.not. allocated(Var%x)) error stop
+ if (.not. allocated(Var2%x)) error stop
+
+ allocate(var%vt, var2%vt)
+ allocate(var%vt%A(-1:3), var2%vt%A(0:4))
+
+ !$omp target map(alloc: var, var2)
+ if (.not. allocated(Var2)) stop 11
+ if (.not. allocated(Var%x)) stop 12
+ if (.not. allocated(Var2%x)) stop 13
+ if (.not. allocated(Var%vt)) stop 14
+ if (.not. allocated(Var2%vt)) stop 15
+ if (.not. allocated(Var%vt%a)) stop 16
+ if (.not. allocated(Var2%vt%a)) stop 17
+ var%x = 42
+ var2%x = 43
+ if (lbound(var%vt%A, 1) /= -1 .or. ubound(var%vt%A, 1) /= 3) stop 4
+ if (lbound(var2%vt%A, 1) /= 0 .or. ubound(var2%vt%A, 1) /= 4) stop 5
+ var%vt%A = [1,2,3,4,5]
+ var2%vt%A = [11,22,33,44,55]
+ !$omp end target
+
+ if (.not. allocated(Var2)) error stop
+ if (.not. allocated(Var%x)) error stop
+ if (.not. allocated(Var2%x)) error stop
+ if (.not. allocated(Var%vt)) error stop
+ if (.not. allocated(Var2%vt)) error stop
+ if (.not. allocated(Var%vt%a)) error stop
+ if (.not. allocated(Var2%vt%a)) error stop
+ if (lbound(var%vt%A, 1) /= -1 .or. ubound(var%vt%A, 1) /= 3) error stop
+ if (lbound(var2%vt%A, 1) /= 0 .or. ubound(var2%vt%A, 1) /= 4) error stop
+ end subroutine test2_alloc_target
+
+
+
+ subroutine test_from()
+ type(t) :: var
+ type(t), allocatable :: var2
+
+ allocate(var2)
+ allocate(var%A(4), var2%A(5))
+
+ !$omp target map(from: var, var2)
+ if (.not. allocated(Var2)) stop 1
+ if (.not. allocated(Var%A)) stop 2
+ if (.not. allocated(Var2%A)) stop 3
+ if (lbound(var%A, 1) /= 1 .or. ubound(var%A, 1) /= 4) stop 4
+ if (lbound(var2%A, 1) /= 1 .or. ubound(var2%A, 1) /= 5) stop 5
+ var%A = [1,2,3,4]
+ var2%A = [11,22,33,44,55]
+ !$omp end target
+
+ if (.not. allocated(Var2)) error stop
+ if (.not. allocated(Var%A)) error stop
+ if (.not. allocated(Var2%A)) error stop
+ if (lbound(var%A, 1) /= 1 .or. ubound(var%A, 1) /= 4) error stop
+ if (lbound(var2%A, 1) /= 1 .or. ubound(var2%A, 1) /= 5) error stop
+ if (any(var%A /= [1,2,3,4])) error stop
+ if (any(var2%A /= [11,22,33,44,55])) error stop
+ end subroutine test_from
+
+ subroutine test2_from()
+ type(t2) :: var
+ type(t2), allocatable :: var2
+
+ allocate(var2)
+ allocate(var%x, var2%x)
+
+ !$omp target map(from: var, var2)
+ if (.not. allocated(Var2)) stop 6
+ if (.not. allocated(Var%x)) stop 7
+ if (.not. allocated(Var2%x)) stop 8
+ var%x = 42
+ var2%x = 43
+ !$omp end target
+
+ if (.not. allocated(Var2)) error stop
+ if (.not. allocated(Var%x)) error stop
+ if (.not. allocated(Var2%x)) error stop
+ if (var%x /= 42) error stop
+ if (var2%x /= 43) error stop
+
+ allocate(var%vt, var2%vt)
+ allocate(var%vt%A(-1:3), var2%vt%A(0:4))
+
+ !$omp target map(from: var, var2)
+ if (.not. allocated(Var2)) stop 11
+ if (.not. allocated(Var%x)) stop 12
+ if (.not. allocated(Var2%x)) stop 13
+ if (.not. allocated(Var%vt)) stop 14
+ if (.not. allocated(Var2%vt)) stop 15
+ if (.not. allocated(Var%vt%a)) stop 16
+ if (.not. allocated(Var2%vt%a)) stop 17
+ var%x = 42
+ var2%x = 43
+ if (lbound(var%vt%A, 1) /= -1 .or. ubound(var%vt%A, 1) /= 3) stop 4
+ if (lbound(var2%vt%A, 1) /= 0 .or. ubound(var2%vt%A, 1) /= 4) stop 5
+ var%vt%A = [1,2,3,4,5]
+ var2%vt%A = [11,22,33,44,55]
+ !$omp end target
+
+ if (.not. allocated(Var2)) error stop
+ if (.not. allocated(Var%x)) error stop
+ if (.not. allocated(Var2%x)) error stop
+ if (.not. allocated(Var%vt)) error stop
+ if (.not. allocated(Var2%vt)) error stop
+ if (.not. allocated(Var%vt%a)) error stop
+ if (.not. allocated(Var2%vt%a)) error stop
+ if (var%x /= 42) error stop
+ if (var2%x /= 43) error stop
+ if (lbound(var%vt%A, 1) /= -1 .or. ubound(var%vt%A, 1) /= 3) error stop
+ if (lbound(var2%vt%A, 1) /= 0 .or. ubound(var2%vt%A, 1) /= 4) error stop
+ if (any(var%vt%A /= [1,2,3,4,5])) error stop
+ if (any(var2%vt%A /= [11,22,33,44,55])) error stop
+ end subroutine test2_from
+
+end module m
+
+use m
+ implicit none (type, external)
+ call test_alloc
+ call test2_alloc
+ call test_alloc_target
+ call test2_alloc_target
+
+ call test_from
+ call test2_from
+end
diff --git a/libgomp/testsuite/libgomp.fortran/map-alloc-comp-9.f90 b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-9.f90
new file mode 100644
index 0000000..3cec392
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/map-alloc-comp-9.f90
@@ -0,0 +1,559 @@
+! Ensure that polymorphic mapping is diagnosed as undefined behavior
+! Ensure that static access to polymorphic variables works
+
+subroutine test(case)
+implicit none(type, external)
+type t
+ integer :: x(4)
+end type t
+
+type ta
+ integer, allocatable :: x(:)
+end type ta
+
+type t2
+ class(t), allocatable :: x
+ class(t), allocatable :: x2(:)
+end type t2
+
+type t3
+ type(t2) :: y
+ type(t2) :: y2(2)
+end type t3
+
+type t4
+ type(t3), allocatable :: y
+ type(t3), allocatable :: y2(:)
+end type t4
+
+integer, value :: case
+
+logical :: is_shared_mem
+
+! Mangle stack addresses
+integer, volatile :: case_var(100*case)
+
+type(t), allocatable :: var1
+type(ta), allocatable :: var1a
+class(t), allocatable :: var2
+type(t2), allocatable :: var3
+type(t4), allocatable :: var4
+
+case_var(100) = 0
+!print *, 'case', case
+
+var1 = t([1,2,3,4])
+var1a = ta([-1,-2,-3,-4,-5])
+
+var2 = t([11,22,33,44])
+
+allocate(t2 :: var3)
+allocate(t :: var3%x)
+allocate(t :: var3%x2(2))
+var3%x%x = [111,222,333,444]
+var3%x2(1)%x = 2*[111,222,333,444]
+var3%x2(2)%x = 3*[111,222,333,444]
+
+allocate(t4 :: var4)
+allocate(t3 :: var4%y)
+allocate(t3 :: var4%y2(2))
+allocate(t :: var4%y%y%x)
+allocate(t :: var4%y%y%x2(2))
+allocate(t :: var4%y2(1)%y%x)
+allocate(t :: var4%y2(1)%y%x2(2))
+allocate(t :: var4%y2(2)%y%x)
+allocate(t :: var4%y2(2)%y%x2(2))
+var4%y%y%x%x = -1 * [1111,2222,3333,4444]
+var4%y%y%x2(1)%x = -2 * [1111,2222,3333,4444]
+var4%y%y%x2(2)%x = -3 * [1111,2222,3333,4444]
+var4%y2(1)%y%x%x = -4 * [1111,2222,3333,4444]
+var4%y2(1)%y%x2(1)%x = -5 * [1111,2222,3333,4444]
+var4%y2(1)%y%x2(2)%x = -6 * [1111,2222,3333,4444]
+var4%y2(2)%y%x%x = -7 * [1111,2222,3333,4444]
+var4%y2(2)%y%x2(1)%x = -8 * [1111,2222,3333,4444]
+var4%y2(2)%y%x2(2)%x = -9 * [1111,2222,3333,4444]
+
+is_shared_mem = .false.
+!$omp target map(to: is_shared_mem)
+ is_shared_mem = .true.
+!$omp end target
+
+if (case == 1) then
+ ! implicit mapping
+ !$omp target
+ if (any (var1%x /= [1,2,3,4])) stop 1
+ var1%x = 2 * var1%x
+ !$omp end target
+
+ !$omp target
+ if (any (var1a%x /= [-1,-2,-3,-4])) stop 2
+ var1a%x = 3 * var1a%x
+ !$omp end target
+
+ !$omp target ! { dg-warning "Mapping of polymorphic list item 'var2' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var2%x /= [11,22,33,44])) stop 3
+ var2%x = 4 * var2%x
+ !$omp end target
+
+ !$omp target ! { dg-warning "Mapping of polymorphic list item 'var3->x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var3%x%x /= [111,222,333,444])) stop 4
+ var3%x%x = 5 * var3%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var3%x2(1)%x /= 2*[111,222,333,444])) stop 4
+ if (any (var3%x2(2)%x /= 3*[111,222,333,444])) stop 4
+ var3%x2(1)%x = 5 * var3%x2(1)%x
+ var3%x2(2)%x = 5 * var3%x2(2)%x
+ end if
+ !$omp end target
+
+ !$omp target ! { dg-warning "Mapping of polymorphic list item 'var4\.\[0-9\]+->y->y\.x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var4%y%y%x%x /= -1 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y%y%x2(1)%x /= -2 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y%y%x2(2)%x /= -3 * [1111,2222,3333,4444])) stop 5
+ endif
+ if (any (var4%y2(1)%y%x%x /= -4 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(1)%y%x2(1)%x /= -5 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(1)%y%x2(2)%x /= -6 * [1111,2222,3333,4444])) stop 5
+ endif
+ if (any (var4%y2(2)%y%x%x /= -7 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(2)%y%x2(1)%x /= -8 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(2)%y%x2(2)%x /= -9 * [1111,2222,3333,4444])) stop 5
+ end if
+ var4%y%y%x%x = 6 * var4%y%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y%y%x2(1)%x = 6 * var4%y%y%x2(1)%x
+ var4%y%y%x2(2)%x = 6 * var4%y%y%x2(2)%x
+ endif
+ var4%y2(1)%y%x%x = 6 * var4%y2(1)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(1)%y%x2(1)%x = 6 * var4%y2(1)%y%x2(1)%x
+ var4%y2(1)%y%x2(2)%x = 6 * var4%y2(1)%y%x2(2)%x
+ endif
+ var4%y2(2)%y%x%x = 6 * var4%y2(2)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(2)%y%x2(1)%x = 6 * var4%y2(2)%y%x2(1)%x
+ var4%y2(2)%y%x2(2)%x = 6 * var4%y2(2)%y%x2(2)%x
+ endif
+ !$omp end target
+
+else if (case == 2) then
+ ! Use target with defaultmap(TO)
+
+ !$omp target defaultmap(to : all)
+ if (any (var1%x /= [1,2,3,4])) stop 1
+ var1%x = 2 * var1%x
+ !$omp end target
+
+ !$omp target defaultmap(to : all)
+ if (any (var1a%x /= [-1,-2,-3,-4])) stop 2
+ var1a%x = 3 * var1a%x
+ !$omp end target
+
+ !$omp target defaultmap(to : all) ! { dg-warning "Mapping of polymorphic list item 'var2' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var2%x /= [11,22,33,44])) stop 3
+ var2%x = 4 * var2%x
+ !$omp end target
+
+ !$omp target defaultmap(to : all) ! { dg-warning "Mapping of polymorphic list item 'var3->x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var3%x%x /= [111,222,333,444])) stop 4
+ var3%x%x = 5 * var3%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var3%x2(1)%x /= 2*[111,222,333,444])) stop 4
+ if (any (var3%x2(2)%x /= 3*[111,222,333,444])) stop 4
+ var3%x2(1)%x = 5 * var3%x2(1)%x
+ var3%x2(2)%x = 5 * var3%x2(2)%x
+ endif
+ !$omp end target
+
+ !$omp target defaultmap(to : all) firstprivate(is_shared_mem) ! { dg-warning "Mapping of polymorphic list item 'var4\.\[0-9\]+->y->y\.x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var4%y%y%x%x /= -1 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y%y%x2(1)%x /= -2 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y%y%x2(2)%x /= -3 * [1111,2222,3333,4444])) stop 5
+ endif
+ if (any (var4%y2(1)%y%x%x /= -4 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(1)%y%x2(1)%x /= -5 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(1)%y%x2(2)%x /= -6 * [1111,2222,3333,4444])) stop 5
+ endif
+ if (any (var4%y2(2)%y%x%x /= -7 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(2)%y%x2(1)%x /= -8 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(2)%y%x2(2)%x /= -9 * [1111,2222,3333,4444])) stop 5
+ endif
+ var4%y%y%x%x = 6 * var4%y%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y%y%x2(1)%x = 6 * var4%y%y%x2(1)%x
+ var4%y%y%x2(2)%x = 6 * var4%y%y%x2(2)%x
+ endif
+ var4%y2(1)%y%x%x = 6 * var4%y2(1)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(1)%y%x2(1)%x = 6 * var4%y2(1)%y%x2(1)%x
+ var4%y2(1)%y%x2(2)%x = 6 * var4%y2(1)%y%x2(2)%x
+ endif
+ var4%y2(2)%y%x%x = 6 * var4%y2(2)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(2)%y%x2(1)%x = 6 * var4%y2(2)%y%x2(1)%x
+ var4%y2(2)%y%x2(2)%x = 6 * var4%y2(2)%y%x2(2)%x
+ endif
+ !$omp end target
+
+else if (case == 3) then
+ ! Use target with map clause
+
+ !$omp target map(tofrom: var1)
+ if (any (var1%x /= [1,2,3,4])) stop 1
+ var1%x = 2 * var1%x
+ !$omp end target
+
+ !$omp target map(tofrom: var1a)
+ if (any (var1a%x /= [-1,-2,-3,-4])) stop 2
+ var1a%x = 3 * var1a%x
+ !$omp end target
+
+ !$omp target map(tofrom: var2) ! { dg-warning "28: Mapping of polymorphic list item 'var2' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var2%x /= [11,22,33,44])) stop 3
+ var2%x = 4 * var2%x
+ !$omp end target
+
+ !$omp target map(tofrom: var3) ! { dg-warning "28: Mapping of polymorphic list item 'var3->x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var3%x%x /= [111,222,333,444])) stop 4
+ var3%x%x = 5 * var3%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var3%x2(1)%x /= 2*[111,222,333,444])) stop 4
+ if (any (var3%x2(2)%x /= 3*[111,222,333,444])) stop 4
+ var3%x2(1)%x = 5 * var3%x2(1)%x
+ var3%x2(2)%x = 5 * var3%x2(2)%x
+ endif
+ !$omp end target
+
+ !$omp target map(tofrom: var4) ! { dg-warning "28: Mapping of polymorphic list item 'var4\.\[0-9\]+->y->y\.x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var4%y%y%x%x /= -1 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y%y%x2(1)%x /= -2 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y%y%x2(2)%x /= -3 * [1111,2222,3333,4444])) stop 5
+ end if
+ if (any (var4%y2(1)%y%x%x /= -4 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(1)%y%x2(1)%x /= -5 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(1)%y%x2(2)%x /= -6 * [1111,2222,3333,4444])) stop 5
+ endif
+ if (any (var4%y2(2)%y%x%x /= -7 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(2)%y%x2(1)%x /= -8 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(2)%y%x2(2)%x /= -9 * [1111,2222,3333,4444])) stop 5
+ endif
+ var4%y%y%x%x = 6 * var4%y%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y%y%x2(1)%x = 6 * var4%y%y%x2(1)%x
+ var4%y%y%x2(2)%x = 6 * var4%y%y%x2(2)%x
+ endif
+ var4%y2(1)%y%x%x = 6 * var4%y2(1)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(1)%y%x2(1)%x = 6 * var4%y2(1)%y%x2(1)%x
+ var4%y2(1)%y%x2(2)%x = 6 * var4%y2(1)%y%x2(2)%x
+ endif
+ var4%y2(2)%y%x%x = 6 * var4%y2(2)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(2)%y%x2(1)%x = 6 * var4%y2(2)%y%x2(1)%x
+ var4%y2(2)%y%x2(2)%x = 6 * var4%y2(2)%y%x2(2)%x
+ endif
+ !$omp end target
+
+else if (case == 4) then
+ ! Use target with map clause -- NOTE: This uses TO not TOFROM
+
+ !$omp target map(to: var1)
+ if (any (var1%x /= [1,2,3,4])) stop 1
+ var1%x = 2 * var1%x
+ !$omp end target
+
+ !$omp target map(to: var1a)
+ if (any (var1a%x /= [-1,-2,-3,-4])) stop 2
+ var1a%x = 3 * var1a%x
+ !$omp end target
+
+ !$omp target map(to: var2) ! { dg-warning "24: Mapping of polymorphic list item 'var2' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var2%x /= [11,22,33,44])) stop 3
+ var2%x = 4 * var2%x
+ !$omp end target
+
+ !$omp target map(to: var3) ! { dg-warning "24: Mapping of polymorphic list item 'var3->x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var3%x%x /= [111,222,333,444])) stop 4
+ var3%x%x = 5 * var3%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var3%x2(1)%x /= 2*[111,222,333,444])) stop 4
+ if (any (var3%x2(2)%x /= 3*[111,222,333,444])) stop 4
+ var3%x2(1)%x = 5 * var3%x2(1)%x
+ var3%x2(2)%x = 5 * var3%x2(2)%x
+ endif
+ !$omp end target
+
+ !$omp target map(to: var4) ! { dg-warning "24: Mapping of polymorphic list item 'var4\.\[0-9\]+->y->y\.x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var4%y%y%x%x /= -1 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y%y%x2(1)%x /= -2 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y%y%x2(2)%x /= -3 * [1111,2222,3333,4444])) stop 5
+ endif
+ if (any (var4%y2(1)%y%x%x /= -4 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(1)%y%x2(1)%x /= -5 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(1)%y%x2(2)%x /= -6 * [1111,2222,3333,4444])) stop 5
+ endif
+ if (any (var4%y2(2)%y%x%x /= -7 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(2)%y%x2(1)%x /= -8 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(2)%y%x2(2)%x /= -9 * [1111,2222,3333,4444])) stop 5
+ endif
+ var4%y%y%x%x = 6 * var4%y%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y%y%x2(1)%x = 6 * var4%y%y%x2(1)%x
+ var4%y%y%x2(2)%x = 6 * var4%y%y%x2(2)%x
+ endif
+ var4%y2(1)%y%x%x = 6 * var4%y2(1)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(1)%y%x2(1)%x = 6 * var4%y2(1)%y%x2(1)%x
+ var4%y2(1)%y%x2(2)%x = 6 * var4%y2(1)%y%x2(2)%x
+ endif
+ var4%y2(2)%y%x%x = 6 * var4%y2(2)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(2)%y%x2(1)%x = 6 * var4%y2(2)%y%x2(1)%x
+ var4%y2(2)%y%x2(2)%x = 6 * var4%y2(2)%y%x2(2)%x
+ endif
+ !$omp end target
+
+else if (case == 5) then
+ ! Use target enter/exit data + target with explicit map
+ !$omp target enter data map(to: var1)
+ !$omp target enter data map(to: var1a)
+ !$omp target enter data map(to: var2) ! { dg-warning "35: Mapping of polymorphic list item 'var2' is unspecified behavior \\\[-Wopenmp\\\]" }
+ !$omp target enter data map(to: var3) ! { dg-warning "35: Mapping of polymorphic list item 'var3->x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ !$omp target enter data map(to: var4) ! { dg-warning "35: Mapping of polymorphic list item 'var4\.\[0-9\]+->y->y\.x' is unspecified behavior \\\[-Wopenmp\\\]" }
+
+ !$omp target map(to: var1)
+ if (any (var1%x /= [1,2,3,4])) stop 1
+ var1%x = 2 * var1%x
+ !$omp end target
+
+ !$omp target map(to: var1a)
+ if (any (var1a%x /= [-1,-2,-3,-4])) stop 2
+ var1a%x = 3 * var1a%x
+ !$omp end target
+
+ !$omp target map(to: var2) ! { dg-warning "24: Mapping of polymorphic list item 'var2' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var2%x /= [11,22,33,44])) stop 3
+ var2%x = 4 * var2%x
+ !$omp end target
+
+ !$omp target map(to: var3) ! { dg-warning "24: Mapping of polymorphic list item 'var3->x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var3%x%x /= [111,222,333,444])) stop 4
+ var3%x%x = 5 * var3%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var3%x2(1)%x /= 2*[111,222,333,444])) stop 4
+ if (any (var3%x2(2)%x /= 3*[111,222,333,444])) stop 4
+ var3%x2(1)%x = 5 * var3%x2(1)%x
+ var3%x2(2)%x = 5 * var3%x2(2)%x
+ endif
+ !$omp end target
+
+ !$omp target map(to: var4) ! { dg-warning "24: Mapping of polymorphic list item 'var4\.\[0-9\]+->y->y\.x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var4%y%y%x%x /= -1 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y%y%x2(1)%x /= -2 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y%y%x2(2)%x /= -3 * [1111,2222,3333,4444])) stop 5
+ endif
+ if (any (var4%y2(1)%y%x%x /= -4 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(1)%y%x2(1)%x /= -5 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(1)%y%x2(2)%x /= -6 * [1111,2222,3333,4444])) stop 5
+ endif
+ if (any (var4%y2(2)%y%x%x /= -7 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(2)%y%x2(1)%x /= -8 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(2)%y%x2(2)%x /= -9 * [1111,2222,3333,4444])) stop 5
+ endif
+ var4%y%y%x%x = 6 * var4%y%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y%y%x2(1)%x = 6 * var4%y%y%x2(1)%x
+ var4%y%y%x2(2)%x = 6 * var4%y%y%x2(2)%x
+ endif
+ var4%y2(1)%y%x%x = 6 * var4%y2(1)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(1)%y%x2(1)%x = 6 * var4%y2(1)%y%x2(1)%x
+ var4%y2(1)%y%x2(2)%x = 6 * var4%y2(1)%y%x2(2)%x
+ endif
+ var4%y2(2)%y%x%x = 6 * var4%y2(2)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(2)%y%x2(1)%x = 6 * var4%y2(2)%y%x2(1)%x
+ var4%y2(2)%y%x2(2)%x = 6 * var4%y2(2)%y%x2(2)%x
+ endif
+ !$omp end target
+
+ !$omp target exit data map(from: var1)
+ !$omp target exit data map(from: var1a)
+ !$omp target exit data map(from: var2) ! { dg-warning "36: Mapping of polymorphic list item 'var2' is unspecified behavior \\\[-Wopenmp\\\]" }
+ !$omp target exit data map(from: var3) ! { dg-warning "36: Mapping of polymorphic list item 'var3->x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ !$omp target exit data map(from: var4) ! { dg-warning "36: Mapping of polymorphic list item 'var4\.\[0-9\]+->y->y\.x' is unspecified behavior \\\[-Wopenmp\\\]" }
+
+else if (case == 6) then
+ ! Use target enter/exit data + target with implicit map
+
+ !$omp target enter data map(to: var1)
+ !$omp target enter data map(to: var1a)
+ !$omp target enter data map(to: var2) ! { dg-warning "35: Mapping of polymorphic list item 'var2' is unspecified behavior \\\[-Wopenmp\\\]" }
+ !$omp target enter data map(to: var3) ! { dg-warning "35: Mapping of polymorphic list item 'var3->x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ !$omp target enter data map(to: var4) ! { dg-warning "35: Mapping of polymorphic list item 'var4\.\[0-9\]+->y->y\.x' is unspecified behavior \\\[-Wopenmp\\\]" }
+
+ !$omp target
+ if (any (var1%x /= [1,2,3,4])) stop 1
+ var1%x = 2 * var1%x
+ !$omp end target
+
+ !$omp target
+ if (any (var1a%x /= [-1,-2,-3,-4])) stop 2
+ var1a%x = 3 * var1a%x
+ !$omp end target
+
+ !$omp target ! { dg-warning "Mapping of polymorphic list item 'var2' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var2%x /= [11,22,33,44])) stop 3
+ var2%x = 4 * var2%x
+ !$omp end target
+
+ !$omp target ! { dg-warning "Mapping of polymorphic list item 'var3->x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var3%x%x /= [111,222,333,444])) stop 4
+ var3%x%x = 5 * var3%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var3%x2(1)%x /= 2*[111,222,333,444])) stop 4
+ if (any (var3%x2(2)%x /= 3*[111,222,333,444])) stop 4
+ var3%x2(1)%x = 5 * var3%x2(1)%x
+ var3%x2(2)%x = 5 * var3%x2(2)%x
+ endif
+ !$omp end target
+
+ !$omp target ! { dg-warning "Mapping of polymorphic list item 'var4\.\[0-9\]+->y->y\.x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ if (any (var4%y%y%x%x /= -1 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y%y%x2(1)%x /= -2 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y%y%x2(2)%x /= -3 * [1111,2222,3333,4444])) stop 5
+ endif
+ if (any (var4%y2(1)%y%x%x /= -4 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(1)%y%x2(1)%x /= -5 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(1)%y%x2(2)%x /= -6 * [1111,2222,3333,4444])) stop 5
+ endif
+ if (any (var4%y2(2)%y%x%x /= -7 * [1111,2222,3333,4444])) stop 5
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(2)%y%x2(1)%x /= -8 * [1111,2222,3333,4444])) stop 5
+ if (any (var4%y2(2)%y%x2(2)%x /= -9 * [1111,2222,3333,4444])) stop 5
+ endif
+ var4%y%y%x%x = 6 * var4%y%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y%y%x2(1)%x = 6 * var4%y%y%x2(1)%x
+ var4%y%y%x2(2)%x = 6 * var4%y%y%x2(2)%x
+ endif
+ var4%y2(1)%y%x%x = 6 * var4%y2(1)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(1)%y%x2(1)%x = 6 * var4%y2(1)%y%x2(1)%x
+ var4%y2(1)%y%x2(2)%x = 6 * var4%y2(1)%y%x2(2)%x
+ endif
+ var4%y2(2)%y%x%x = 6 * var4%y2(2)%y%x%x
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ var4%y2(2)%y%x2(1)%x = 6 * var4%y2(2)%y%x2(1)%x
+ var4%y2(2)%y%x2(2)%x = 6 * var4%y2(2)%y%x2(2)%x
+ endif
+ !$omp end target
+
+ !$omp target exit data map(from: var1)
+ !$omp target exit data map(from: var1a)
+ !$omp target exit data map(from: var2) ! { dg-warning "36: Mapping of polymorphic list item 'var2' is unspecified behavior \\\[-Wopenmp\\\]" }
+ !$omp target exit data map(from: var3) ! { dg-warning "36: Mapping of polymorphic list item 'var3->x' is unspecified behavior \\\[-Wopenmp\\\]" }
+ !$omp target exit data map(from: var4) ! { dg-warning "36: Mapping of polymorphic list item 'var4\.\[0-9\]+->y->y\.x' is unspecified behavior \\\[-Wopenmp\\\]" }
+
+else
+ error stop
+end if
+
+if ((case /= 2 .and. case /= 4) .or. is_shared_mem) then
+ ! The target update should have been active, check for the updated values
+ if (any (var1%x /= 2 * [1,2,3,4])) stop 11
+ if (any (var1a%x /= 3 * [-1,-2,-3,-4])) stop 22
+ if (any (var2%x /= 4 * [11,22,33,44])) stop 33
+
+ if (any (var3%x%x /= 5 * [111,222,333,444])) stop 44
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var3%x2(1)%x /= 2 * 5 * [111,222,333,444])) stop 44
+ if (any (var3%x2(2)%x /= 3 * 5 * [111,222,333,444])) stop 44
+ endif
+
+ if (any (var4%y%y%x%x /= -1 * 6 * [1111,2222,3333,4444])) stop 55
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y%y%x2(1)%x /= -2 * 6 * [1111,2222,3333,4444])) stop 55
+ if (any (var4%y%y%x2(2)%x /= -3 * 6 * [1111,2222,3333,4444])) stop 55
+ endif
+ if (any (var4%y2(1)%y%x%x /= -4 * 6 * [1111,2222,3333,4444])) stop 55
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(1)%y%x2(1)%x /= -5 * 6 * [1111,2222,3333,4444])) stop 55
+ if (any (var4%y2(1)%y%x2(2)%x /= -6 * 6 * [1111,2222,3333,4444])) stop 55
+ endif
+ if (any (var4%y2(2)%y%x%x /= -7 * 6 * [1111,2222,3333,4444])) stop 55
+ if (is_shared_mem) then ! For stride data, this accesses the host's _vtab
+ if (any (var4%y2(2)%y%x2(1)%x /= -8 * 6 * [1111,2222,3333,4444])) stop 55
+ if (any (var4%y2(2)%y%x2(2)%x /= -9 * 6 * [1111,2222,3333,4444])) stop 55
+ endif
+else
+ ! The old host values should still be there as 'to:' created a device copy
+ if (any (var1%x /= [1,2,3,4])) stop 12
+ if (any (var1a%x /= [-1,-2,-3,-4])) stop 22
+ if (any (var2%x /= [11,22,33,44])) stop 33
+
+ if (any (var3%x%x /= [111,222,333,444])) stop 44
+ ! .not. is_shared_mem:
+ ! if (any (var3%x2(1)%x /= 2*[111,222,333,444])) stop 44
+ ! if (any (var3%x2(2)%x /= 3*[111,222,333,444])) stop 44
+
+ if (any (var4%y%y%x%x /= -1 * [1111,2222,3333,4444])) stop 55
+ if (any (var4%y%y%x2(1)%x /= -2 * [1111,2222,3333,4444])) stop 55
+ if (any (var4%y%y%x2(2)%x /= -3 * [1111,2222,3333,4444])) stop 55
+ if (any (var4%y2(1)%y%x%x /= -4 * [1111,2222,3333,4444])) stop 55
+ ! .not. is_shared_mem:
+ !if (any (var4%y2(1)%y%x2(1)%x /= -5 * [1111,2222,3333,4444])) stop 55
+ !if (any (var4%y2(1)%y%x2(2)%x /= -6 * [1111,2222,3333,4444])) stop 55
+ if (any (var4%y2(2)%y%x%x /= -7 * [1111,2222,3333,4444])) stop 55
+ ! .not. is_shared_mem:
+ !if (any (var4%y2(2)%y%x2(1)%x /= -8 * [1111,2222,3333,4444])) stop 55
+ !if (any (var4%y2(2)%y%x2(2)%x /= -9 * [1111,2222,3333,4444])) stop 55
+end if
+if (case_var(100) /= 0) stop 123
+end subroutine test
+
+program main
+ use omp_lib
+ implicit none(type, external)
+ interface
+ subroutine test(case)
+ integer, value :: case
+ end
+ end interface
+ integer :: dev
+ call run_it(omp_get_default_device())
+ do dev = 0, omp_get_num_devices()
+ call run_it(dev)
+ end do
+ call run_it(omp_initial_device)
+! print *, 'all done'
+contains
+subroutine run_it(dev)
+ integer, value :: dev
+! print *, 'DEVICE', dev
+ call omp_set_default_device(dev)
+ call test(1)
+ call test(2)
+ call test(3)
+ call test(4)
+ call test(5)
+ call test(6)
+end
+end
diff --git a/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-1.C b/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-1.C
new file mode 100644
index 0000000..0545601
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-1.C
@@ -0,0 +1,54 @@
+/* 'std::bad_cast' exception in OpenACC compute region. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+/* See also '../libgomp.c++/target-exceptions-bad_cast-1.C'. */
+
+/* See also '../../../gcc/testsuite/g++.target/gcn/exceptions-bad_cast-1.C',
+ '../../../gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-1.C'. */
+
+#include <iostream>
+
+struct C1
+{
+ virtual void f()
+ {}
+};
+
+struct C2 : C1
+{
+};
+
+int main()
+{
+ std::cerr << "CheCKpOInT\n";
+#pragma omp target
+#pragma acc serial
+ /* { dg-bogus {using 'vector_length \(32\)', ignoring 1} {} { target openacc_nvidia_accel_selected xfail *-*-* } .-1 } */
+ {
+ C1 c1;
+ [[maybe_unused]]
+ C2 &c2 = dynamic_cast<C2 &>(c1);
+ /* 'std::bad_cast' is thrown. */
+ }
+}
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ For host execution, we print something like:
+ terminate called after throwing an instance of 'std::bad_cast'
+ what(): std::bad_cast
+ Aborted (core dumped)
+ { dg-output {.*std::bad_cast} { target openacc_host_selected } }
+ For GCN, nvptx offload execution, we don't print anything, but just 'abort'.
+
+ TODO For GCN, nvptx offload execution, this currently doesn't 'abort' due to
+ the 'std::bad_cast' exception, but rather due to SIGSEGV in 'dynamic_cast';
+ PR119692.
+
+ { dg-shouldfail {'std::bad_cast' exception} } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-GCN.C b/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-GCN.C
new file mode 100644
index 0000000..8260966
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-GCN.C
@@ -0,0 +1,18 @@
+/* 'std::bad_cast' exception in OpenACC compute region, caught, '-foffload-options=-mno-fake-exceptions'. */
+
+/* As this test case involves an expected offload compilation failure, we have to handle each offload target individually.
+ { dg-do link { target openacc_radeon_accel_selected } } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -foffload-options=-mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "exceptions-bad_cast-2.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ Given '-foffload-options=-mno-fake-exceptions', offload compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'main[^']+':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.)
+ { dg-excess-errors {'mkoffload' failure etc.} } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-nvptx.C b/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-nvptx.C
new file mode 100644
index 0000000..86d3f6c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2-offload-sorry-nvptx.C
@@ -0,0 +1,20 @@
+/* 'std::bad_cast' exception in OpenACC compute region, caught, '-foffload-options=-mno-fake-exceptions'. */
+
+/* As this test case involves an expected offload compilation failure, we have to handle each offload target individually.
+ { dg-do link { target openacc_nvidia_accel_selected } } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -foffload-options=-mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "exceptions-bad_cast-2.C"
+
+/* { dg-bogus {using 'vector_length \(32\)', ignoring 1} {} { target openacc_nvidia_accel_selected xfail *-*-* } 0 } */
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ Given '-foffload-options=-mno-fake-exceptions', offload compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'main[^']+':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.)
+ { dg-excess-errors {'mkoffload' failure etc.} } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2.C b/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2.C
new file mode 100644
index 0000000..24399ef
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-2.C
@@ -0,0 +1,60 @@
+/* 'std::bad_cast' exception in OpenACC compute region, caught. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+/* { dg-bogus {_ZTISt8bad_cast} PR119734 { target openacc_nvidia_accel_selected xfail *-*-* } 0 }
+ { dg-excess-errors {'mkoffload' failure etc.} { xfail openacc_nvidia_accel_selected } } */
+
+/* See also '../libgomp.c++/target-exceptions-bad_cast-2.C'. */
+
+/* See also '../../../gcc/testsuite/g++.target/gcn/exceptions-bad_cast-2.C',
+ '../../../gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-2.C'. */
+
+#include <iostream>
+#include <typeinfo>
+
+struct C1
+{
+ virtual void f()
+ {}
+};
+
+struct C2 : C1
+{
+};
+
+int main()
+{
+ std::cerr << "CheCKpOInT\n";
+#pragma omp target
+#pragma acc serial
+ {
+ C1 c1;
+ try
+ {
+ [[maybe_unused]]
+ C2 &c2 = dynamic_cast<C2 &>(c1);
+ /* 'std::bad_cast' is thrown. */
+ }
+ catch (const std::bad_cast &e)
+ {
+ __builtin_printf("caught '%s'\n", e.what());
+ }
+ }
+}
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } }
+ { dg-output {.*caught 'std::bad_cast'[\r\n]+} { target openacc_host_selected } }
+ For GCN, nvptx offload execution, we don't print anything, but just 'abort'.
+
+ TODO For GCN, nvptx offload execution, this currently doesn't 'abort' due to
+ the 'std::bad_cast' exception, but rather due to SIGSEGV in 'dynamic_cast';
+ PR119692.
+
+ For GCN, nvptx offload execution, there is no 'catch'ing; any exception is fatal.
+ { dg-shouldfail {'std::bad_cast' exception} { ! openacc_host_selected } } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-3.C b/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-3.C
new file mode 100644
index 0000000..4fa419f
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/exceptions-bad_cast-3.C
@@ -0,0 +1,49 @@
+/* 'std::bad_cast' exception in OpenACC compute region, dead code. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* Wrong code for offloading execution.
+ { dg-skip-if PR119692 { ! openacc_host_selected } }
+ { dg-additional-options -fdump-tree-gimple } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+/* See also '../libgomp.c++/target-exceptions-bad_cast-3.C'. */
+
+/* See also '../../../gcc/testsuite/g++.target/gcn/exceptions-bad_cast-3.C',
+ '../../../gcc/testsuite/g++.target/nvptx/exceptions-bad_cast-3.C'. */
+
+/* For PR119692 workarounds. */
+#ifndef DEFAULT
+# define DEFAULT
+#endif
+
+struct C1
+{
+ virtual void f()
+ {}
+};
+
+struct C2 : C1
+{
+};
+
+int main()
+{
+#pragma omp target DEFAULT
+#pragma acc serial DEFAULT
+ {
+ C1 c1;
+ bool a = false;
+ asm volatile ("" : : "r" (&a) : "memory");
+ if (a)
+ {
+ [[maybe_unused]]
+ C2 &c2 = dynamic_cast<C2 &>(c1);
+ /* 'std::bad_cast' is thrown. */
+ }
+ }
+}
+
+/* { dg-final { scan-tree-dump-not {(?n)#pragma omp target oacc_serial map\(tofrom:_ZTI2C2 \[len: [0-9]+\]\) map\(tofrom:_ZTI2C1 \[len: [0-9]+\]\) map\(tofrom:_ZTV2C1 \[len: [0-9]+\]\)$} gimple { xfail *-*-* } } } */
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_bad_cast, } 1 optimized } } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-1.C b/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-1.C
new file mode 100644
index 0000000..f2ef751
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-1.C
@@ -0,0 +1,46 @@
+/* 'throw' in OpenACC compute region. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+/* { dg-bogus {Size expression must be absolute\.} PR119737 { target { openacc_radeon_accel_selected && __OPTIMIZE__ } xfail *-*-* } 0 }
+ { dg-ice PR119737 { openacc_radeon_accel_selected && __OPTIMIZE__ } }
+ { dg-excess-errors {'mkoffload' failure etc.} { xfail { openacc_radeon_accel_selected && __OPTIMIZE__ } } } */
+
+/* See also '../libgomp.c++/target-exceptions-throw-1.C'. */
+
+/* See also '../../../gcc/testsuite/g++.target/gcn/exceptions-throw-1.C',
+ '../../../gcc/testsuite/g++.target/nvptx/exceptions-throw-1.C'. */
+
+#include <iostream>
+
+class MyException
+{
+};
+
+int main()
+{
+ std::cerr << "CheCKpOInT\n";
+#pragma omp target
+#pragma acc serial
+ /* { dg-bogus {using 'vector_length \(32\)', ignoring 1} {} { target openacc_nvidia_accel_selected xfail *-*-* } .-1 } */
+ {
+ MyException e1;
+ throw e1;
+ }
+}
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ For host execution, we print something like:
+ terminate called after throwing an instance of 'MyException'
+ Aborted (core dumped)
+ { dg-output {.*MyException} { target openacc_host_selected } }
+ For GCN, nvptx offload execution, we don't print anything, but just 'abort'.
+
+ { dg-shouldfail {'MyException' exception} } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-GCN.C b/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-GCN.C
new file mode 100644
index 0000000..40be837
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-GCN.C
@@ -0,0 +1,20 @@
+/* 'throw' in OpenACC compute region, caught, '-foffload-options=-mno-fake-exceptions'. */
+
+/* As this test case involves an expected offload compilation failure, we have to handle each offload target individually.
+ { dg-do link { target openacc_radeon_accel_selected } } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -foffload-options=-mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "exceptions-throw-2.C"
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ Given '-foffload-options=-mno-fake-exceptions', offload compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'main[^']+':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.)
+ { dg-excess-errors {'mkoffload' failure etc.} } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-nvptx.C b/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-nvptx.C
new file mode 100644
index 0000000..9461455
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2-offload-sorry-nvptx.C
@@ -0,0 +1,22 @@
+/* 'throw' in OpenACC compute region, caught, '-foffload-options=-mno-fake-exceptions'. */
+
+/* As this test case involves an expected offload compilation failure, we have to handle each offload target individually.
+ { dg-do link { target openacc_nvidia_accel_selected } } */
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -foffload-options=-mno-fake-exceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+
+#include "exceptions-throw-2.C"
+
+/* { dg-bogus {using 'vector_length \(32\)', ignoring 1} {} { target openacc_nvidia_accel_selected xfail *-*-* } 0 } */
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ Given '-foffload-options=-mno-fake-exceptions', offload compilation fails:
+ { dg-regexp {[^\r\n]+: In function 'main[^']+':[\r\n]+(?:[^\r\n]+: sorry, unimplemented: exception handling not supported[\r\n]+)+} }
+ (Note, using 'dg-regexp' instead of 'dg-message', as the former runs before the auto-mark-UNSUPPORTED.)
+ { dg-excess-errors {'mkoffload' failure etc.} } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2.C b/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2.C
new file mode 100644
index 0000000..f6dc970
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-2.C
@@ -0,0 +1,55 @@
+/* 'throw' in OpenACC compute region, caught. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* { dg-additional-options -fdump-tree-optimized-raw }
+ { dg-additional-options -foffload-options=-fdump-tree-optimized-raw } */
+/* { dg-bogus {undefined symbol: typeinfo name for MyException} PR119806 { target { openacc_radeon_accel_selected && { ! __OPTIMIZE__ } } xfail *-*-* } 0 }
+ { dg-excess-errors {'mkoffload' failure etc.} { xfail { openacc_radeon_accel_selected && { ! __OPTIMIZE__ } } } } */
+/* { dg-bogus {Size expression must be absolute\.} PR119737 { target { openacc_radeon_accel_selected && __OPTIMIZE__ } xfail *-*-* } 0 }
+ { dg-ice PR119737 { openacc_radeon_accel_selected && __OPTIMIZE__ } }
+ { dg-excess-errors {'mkoffload' failures etc.} { xfail { openacc_radeon_accel_selected && __OPTIMIZE__ } } } */
+/* { dg-bogus {Initial value type mismatch} PR119806 { target { openacc_nvidia_accel_selected && { ! __OPTIMIZE__ } } xfail *-*-* } 0 }
+ { dg-excess-errors {'mkoffload' failure etc.} { xfail { openacc_nvidia_accel_selected && { ! __OPTIMIZE__ } } } } */
+
+/* See also '../libgomp.c++/target-exceptions-throw-2.C'. */
+
+/* See also '../../../gcc/testsuite/g++.target/gcn/exceptions-throw-2.C',
+ '../../../gcc/testsuite/g++.target/nvptx/exceptions-throw-2.C'. */
+
+#include <iostream>
+
+class MyException
+{
+};
+
+int main()
+{
+ std::cerr << "CheCKpOInT\n";
+#pragma omp target
+#pragma acc serial
+ /* { dg-bogus {using 'vector_length \(32\)', ignoring 1} {} { target openacc_nvidia_accel_selected xfail *-*-* } .-1 } */
+ {
+ try
+ {
+ MyException e1;
+ throw e1;
+ }
+ catch (const MyException &e)
+ {
+ __builtin_printf("caught '%s'\n", "MyException");
+ }
+ }
+}
+
+/* { dg-output {CheCKpOInT[\r\n]+} }
+
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-offload-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } }
+ { dg-output {.*caught 'MyException'[\r\n]+} { target openacc_host_selected } }
+ For GCN, nvptx offload execution, we don't print anything, but just 'abort'.
+
+ For GCN, nvptx offload execution, there is no 'catch'ing; any exception is fatal.
+ { dg-shouldfail {'MyException' exception} { ! openacc_host_selected } } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-3.C b/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-3.C
new file mode 100644
index 0000000..74a62b3
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/exceptions-throw-3.C
@@ -0,0 +1,43 @@
+/* 'throw' in OpenACC compute region, dead code. */
+
+/* { dg-require-effective-target exceptions }
+ { dg-additional-options -fexceptions } */
+/* Wrong code for offloading execution.
+ { dg-skip-if PR119692 { ! openacc_host_selected } }
+ { dg-additional-options -fdump-tree-gimple } */
+/* { dg-additional-options -fdump-tree-optimized-raw } */
+
+/* See also '../libgomp.c++/target-exceptions-throw-3.C'. */
+
+/* See also '../../../gcc/testsuite/g++.target/gcn/exceptions-throw-3.C',
+ '../../../gcc/testsuite/g++.target/nvptx/exceptions-throw-3.C'. */
+
+/* For PR119692 workarounds. */
+#ifndef DEFAULT
+# define DEFAULT
+#endif
+
+class MyException
+{
+};
+
+int main()
+{
+#pragma omp target DEFAULT
+#pragma acc serial DEFAULT
+ /* { dg-bogus {using 'vector_length \(32\)', ignoring 1} {} { target openacc_nvidia_accel_selected xfail *-*-* } .-1 } */
+ {
+ bool a = false;
+ asm volatile ("" : : "r" (&a) : "memory");
+ if (a)
+ {
+ MyException e1;
+ throw e1;
+ }
+ }
+}
+
+/* { dg-final { scan-tree-dump-not {(?n)#pragma omp target oacc_serial map\(tofrom:_ZTI11MyException \[len: [0-9]+\]\)$} gimple { xfail *-*-* } } } */
+
+/* { dg-final { scan-tree-dump-times {gimple_call <__cxa_allocate_exception, } 1 optimized } }
+ { dg-final { scan-tree-dump-times {gimple_call <__cxa_throw, } 1 optimized } } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/pr119692-1-1.C b/libgomp/testsuite/libgomp.oacc-c++/pr119692-1-1.C
new file mode 100644
index 0000000..5c3e037
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/pr119692-1-1.C
@@ -0,0 +1,42 @@
+/* PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" */
+
+/* { dg-additional-options -UDEFAULT }
+ Wrong code for offloading execution.
+ { dg-skip-if PR119692 { ! openacc_host_selected } } */
+/* { dg-additional-options -fdump-tree-gimple } */
+
+/* See also '../libgomp.c++/pr119692-1-1.C'. */
+
+/* See also '../../../gcc/testsuite/g++.target/gcn/pr119692-1-1.C',
+ '../../../gcc/testsuite/g++.target/nvptx/pr119692-1-1.C'. */
+
+#ifndef DEFAULT
+# define DEFAULT
+#endif
+
+struct C1
+{
+ virtual void f()
+ {}
+};
+
+struct C2 : C1
+{
+};
+
+int main()
+{
+#pragma omp target DEFAULT
+#pragma acc serial DEFAULT
+ /* { dg-bogus {using 'vector_length \(32\)', ignoring 1} {} { target openacc_nvidia_accel_selected xfail *-*-* } .-1 } */
+ {
+ C1 c1;
+ C1 *c1p = &c1;
+ asm volatile ("" : : "r" (&c1p) : "memory");
+ C2 *c2 = dynamic_cast<C2 *>(c1p);
+ if (c2)
+ __builtin_abort();
+ }
+}
+
+/* { dg-final { scan-tree-dump-not {(?n)#pragma omp target oacc_serial map\(tofrom:_ZTI2C2 \[len: [0-9]+\]\) map\(tofrom:_ZTI2C1 \[len: [0-9]+\]\) map\(tofrom:_ZTV2C1 \[len: [0-9]+\]\)$} gimple { xfail *-*-* } } } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/pr119692-1-2.C b/libgomp/testsuite/libgomp.oacc-c++/pr119692-1-2.C
new file mode 100644
index 0000000..207b183
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/pr119692-1-2.C
@@ -0,0 +1,12 @@
+/* PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" */
+
+/* { dg-additional-options -DDEFAULT=default(none) }
+ Wrong code for offloading execution.
+ { dg-skip-if PR119692 { ! openacc_host_selected } } */
+/* { dg-additional-options -fdump-tree-gimple } */
+
+#include "pr119692-1-1.C"
+
+/* { dg-bogus {using 'vector_length \(32\)', ignoring 1} {} { target openacc_nvidia_accel_selected xfail *-*-* } 0 } */
+
+/* { dg-final { scan-tree-dump-not {(?n)#pragma omp target oacc_serial default\(none\) map\(tofrom:_ZTI2C2 \[len: [0-9]+\]\) map\(tofrom:_ZTI2C1 \[len: [0-9]+\]\) map\(tofrom:_ZTV2C1 \[len: [0-9]+\]\)$} gimple { xfail *-*-* } } } */
diff --git a/libgomp/testsuite/libgomp.oacc-c++/pr119692-1-3.C b/libgomp/testsuite/libgomp.oacc-c++/pr119692-1-3.C
new file mode 100644
index 0000000..e9b44de
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c++/pr119692-1-3.C
@@ -0,0 +1,12 @@
+/* PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" */
+
+/* { dg-additional-options -DDEFAULT=default(present) }
+ Wrong code for offloading execution.
+ { dg-xfail-run-if PR119692 { ! openacc_host_selected } } */
+/* { dg-additional-options -fdump-tree-gimple } */
+
+#include "pr119692-1-1.C"
+
+/* { dg-bogus {using 'vector_length \(32\)', ignoring 1} {} { target openacc_nvidia_accel_selected xfail *-*-* } 0 } */
+
+/* { dg-final { scan-tree-dump-not {(?n)#pragma omp target oacc_serial default\(present\) map\(force_present:_ZTI2C2 \[len: [0-9]+\]\) map\(force_present:_ZTI2C1 \[len: [0-9]+\]\) map\(force_present:_ZTV2C1 \[len: [0-9]+\]\)$} gimple { xfail *-*-* } } } */
diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog
index 6022d65..e97b427 100644
--- a/libphobos/ChangeLog
+++ b/libphobos/ChangeLog
@@ -1,3 +1,27 @@
+2025-04-12 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ PR d/119761
+ * libdruntime/MERGE: Merge upstream druntime 09ed02ce56.
+ * libdruntime/Makefile.am (DRUNTIME_DISOURCES): Rename __builtins.di
+ to __importc_builtins.di.
+ * libdruntime/Makefile.in: Regenerate.
+ * libdruntime/__builtins.di: Move to...
+ * libdruntime/__importc_builtins.di: ...here.
+
+2025-04-11 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * src/MERGE: Merge upstream phobos 40ffbb364.
+ * Makefile.in: Regenerate.
+ * configure: Regenerate.
+ * configure.ac: Call DRUNTIME_OS_FEATURES.
+ * libdruntime/Makefile.am (AM_DFLAGS): Add OS_DFLAGS.
+ * libdruntime/Makefile.in: Regenerate.
+ * m4/druntime/os.m4 (DRUNTIME_OS_FEATURES): Define.
+ * src/Makefile.am: Add OS_DFLAGS.
+ * src/Makefile.in: Regenerate.
+ * testsuite/Makefile.in: Regenerate.
+ * testsuite/testsuite_flags.in: Add OS_DFLAGS.
+
2025-04-08 Iain Buclaw <ibuclaw@gdcproject.org>
* src/MERGE: Merge upstream phobos 35977c802.
diff --git a/libphobos/Makefile.in b/libphobos/Makefile.in
index 162e83b..cd64fd5 100644
--- a/libphobos/Makefile.in
+++ b/libphobos/Makefile.in
@@ -258,6 +258,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OS_DFLAGS = @OS_DFLAGS@
OS_LINK_SPEC = @OS_LINK_SPEC@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
diff --git a/libphobos/configure b/libphobos/configure
index df48a6b..4f5be7d 100755
--- a/libphobos/configure
+++ b/libphobos/configure
@@ -655,6 +655,7 @@ DCFG_HAVE_LIBATOMIC
DCFG_HAVE_64BIT_ATOMICS
DCFG_HAVE_ATOMIC_BUILTINS
DCFG_HAVE_QSORT_R
+OS_DFLAGS
OS_LINK_SPEC
DCFG_DLPI_TLS_MODID
DRUNTIME_OS_MINFO_BRACKETING_FALSE
@@ -11863,7 +11864,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11866 "configure"
+#line 11867 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11969,7 +11970,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11972 "configure"
+#line 11973 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14717,6 +14718,54 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ OS_DFLAGS=
+
+ case "$druntime_cv_target_os" in
+ linux*) druntime_target_os_parsed="linux"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getrandom" >&5
+$as_echo_n "checking for getrandom... " >&6; }
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/syscall.h>
+#include <unistd.h>
+int
+main ()
+{
+
+ syscall (__NR_getrandom);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ OS_DFLAGS=-fversion=linux_legacy_emulate_getrandom
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ ;;
+ esac
+
+
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
diff --git a/libphobos/configure.ac b/libphobos/configure.ac
index 3b2ec2c..406373b 100644
--- a/libphobos/configure.ac
+++ b/libphobos/configure.ac
@@ -143,6 +143,7 @@ DRUNTIME_OS_ARM_EABI_UNWINDER
DRUNTIME_OS_MINFO_BRACKETING
DRUNTIME_OS_DLPI_TLS_MODID
DRUNTIME_OS_LINK_SPEC
+DRUNTIME_OS_FEATURES
DRUNTIME_LIBRARIES_CLIB
WITH_LOCAL_DRUNTIME([
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
index 00c8518..840f8dd 100644
--- a/libphobos/libdruntime/MERGE
+++ b/libphobos/libdruntime/MERGE
@@ -1,4 +1,4 @@
-c6863be7206eef3c393726363a480baf0a0c6530
+09ed02ce56ea5bf3e59f21ee0390cd85eb8bfaa7
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am
index 252c6a3..4098310 100644
--- a/libphobos/libdruntime/Makefile.am
+++ b/libphobos/libdruntime/Makefile.am
@@ -25,7 +25,8 @@ D_EXTRA_DFLAGS=-fpreview=dip1000 -fpreview=fieldwise -fpreview=dtorfields \
# D flags for compilation
AM_DFLAGS= \
$(phobos_lt_pic_flag) $(phobos_compiler_shared_flag) \
- $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_FLAGS)
+ $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_FLAGS) \
+ $(OS_DFLAGS)
# Flags for other kinds of sources
AM_CFLAGS=$(CET_FLAGS)
@@ -444,4 +445,4 @@ DRUNTIME_DSOURCES_WINDOWS = core/sys/windows/accctrl.d \
core/sys/windows/winuser.d core/sys/windows/winver.d \
core/sys/windows/wtsapi32.d core/sys/windows/wtypes.d
-DRUNTIME_DISOURCES = __builtins.di __main.di
+DRUNTIME_DISOURCES = __importc_builtins.di __main.di
diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in
index 52b0c37..1c0fa54 100644
--- a/libphobos/libdruntime/Makefile.in
+++ b/libphobos/libdruntime/Makefile.in
@@ -676,6 +676,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OS_DFLAGS = @OS_DFLAGS@
OS_LINK_SPEC = @OS_LINK_SPEC@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
@@ -783,7 +784,8 @@ D_EXTRA_DFLAGS = -fpreview=dip1000 -fpreview=fieldwise -fpreview=dtorfields \
# D flags for compilation
AM_DFLAGS = \
$(phobos_lt_pic_flag) $(phobos_compiler_shared_flag) \
- $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_FLAGS)
+ $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_FLAGS) \
+ $(OS_DFLAGS)
# Flags for other kinds of sources
@@ -1124,7 +1126,7 @@ DRUNTIME_DSOURCES_WINDOWS = core/sys/windows/accctrl.d \
core/sys/windows/winuser.d core/sys/windows/winver.d \
core/sys/windows/wtsapi32.d core/sys/windows/wtypes.d
-DRUNTIME_DISOURCES = __builtins.di __main.di
+DRUNTIME_DISOURCES = __importc_builtins.di __main.di
all: all-am
.SUFFIXES:
diff --git a/libphobos/libdruntime/__builtins.di b/libphobos/libdruntime/__importc_builtins.di
index b4fef09..9493962 100644
--- a/libphobos/libdruntime/__builtins.di
+++ b/libphobos/libdruntime/__importc_builtins.di
@@ -3,10 +3,10 @@
* The purpose is to make it unnecessary to hardwire them into the compiler.
* As the leading double underscore suggests, this is for internal use only.
*
- * Copyright: Copyright Digital Mars 2022
+ * Copyright: Copyright D Language Foundation 2022-2025
* License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Walter Bright
- * Source: $(DRUNTIMESRC __builtins.d)
+ * Source: $(DRUNTIMESRC __importc_builtins.di)
*/
@@ -86,6 +86,12 @@ version (DigitalMars)
return core.bitop.bswap(value);
}
+ uint __builtin__popcount()(ulong value)
+ {
+ import core.bitop;
+ return core.bitop._popcnt(value);
+ }
+
// Lazily imported on first use
private alias c_long = imported!"core.stdc.config".c_long;
diff --git a/libphobos/m4/druntime/os.m4 b/libphobos/m4/druntime/os.m4
index 15cde3b..ef8ca43 100644
--- a/libphobos/m4/druntime/os.m4
+++ b/libphobos/m4/druntime/os.m4
@@ -121,6 +121,33 @@ AC_DEFUN([DRUNTIME_OS_SOURCES],
])
+# DRUNTIME_OS_FEATURES
+# -----------------------
+# Perform various feature checks on the target platform.
+AC_DEFUN([DRUNTIME_OS_FEATURES],
+[
+ AC_REQUIRE([DRUNTIME_OS_DETECT])
+ OS_DFLAGS=
+
+ case "$druntime_cv_target_os" in
+ linux*) druntime_target_os_parsed="linux"
+ AC_MSG_CHECKING([for getrandom])
+ AC_LANG_PUSH([C])
+ AC_TRY_COMPILE([#include <sys/syscall.h>
+#include <unistd.h>],[
+ syscall (__NR_getrandom);
+ ],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ OS_DFLAGS=-fversion=linux_legacy_emulate_getrandom])
+ AC_LANG_POP([C])
+ ;;
+ esac
+
+ AC_SUBST(OS_DFLAGS)
+])
+
+
# DRUNTIME_OS_ARM_EABI_UNWINDER
# ------------------------
# Check if using ARM unwinder and substitute DCFG_ARM_EABI_UNWINDER
diff --git a/libphobos/src/MERGE b/libphobos/src/MERGE
index d870a91..a28116a 100644
--- a/libphobos/src/MERGE
+++ b/libphobos/src/MERGE
@@ -1,4 +1,4 @@
-35977c8029e7bb4dbe1b887688dabebe04ebea02
+40ffbb3641495b02815891ee004d4c6e173b1089
The first line of this file holds the git revision number of the last
merge done from the dlang/phobos repository.
diff --git a/libphobos/src/Makefile.am b/libphobos/src/Makefile.am
index 5d690dd..a84fc4d 100644
--- a/libphobos/src/Makefile.am
+++ b/libphobos/src/Makefile.am
@@ -26,7 +26,8 @@ D_EXTRA_DFLAGS=-fpreview=dip1000 -fpreview=dtorfields -fpreview=fieldwise \
# D flags for compilation
AM_DFLAGS= \
$(phobos_lt_pic_flag) $(phobos_compiler_shared_flag) \
- $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_FLAGS)
+ $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_FLAGS) \
+ $(OS_DFLAGS)
# Flags for other kinds of sources
AM_CFLAGS=$(CET_FLAGS)
diff --git a/libphobos/src/Makefile.in b/libphobos/src/Makefile.in
index 2bf7e3f..64cc9c3 100644
--- a/libphobos/src/Makefile.in
+++ b/libphobos/src/Makefile.in
@@ -411,6 +411,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OS_DFLAGS = @OS_DFLAGS@
OS_LINK_SPEC = @OS_LINK_SPEC@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
@@ -519,7 +520,8 @@ D_EXTRA_DFLAGS = -fpreview=dip1000 -fpreview=dtorfields -fpreview=fieldwise \
# D flags for compilation
AM_DFLAGS = \
$(phobos_lt_pic_flag) $(phobos_compiler_shared_flag) \
- $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_FLAGS)
+ $(WARN_DFLAGS) $(CHECKING_DFLAGS) $(SECTION_FLAGS) $(CET_FLAGS) \
+ $(OS_DFLAGS)
# Flags for other kinds of sources
diff --git a/libphobos/src/std/format/write.d b/libphobos/src/std/format/write.d
index d704c14..68a96d4 100644
--- a/libphobos/src/std/format/write.d
+++ b/libphobos/src/std/format/write.d
@@ -534,6 +534,8 @@ uint formattedWrite(Writer, Char, Args...)(auto ref Writer w, const scope Char[]
// Are we already done with formats? Then just dump each parameter in turn
uint currentArg = 0;
+ bool lastWasConsumeAll;
+
while (spec.writeUpToNextSpec(w))
{
if (currentArg == Args.length && !spec.indexStart)
@@ -649,7 +651,10 @@ uint formattedWrite(Writer, Char, Args...)(auto ref Writer w, const scope Char[]
}
default:
if (spec.indexEnd == spec.indexEnd.max)
+ {
+ lastWasConsumeAll = true;
break;
+ }
else if (spec.indexEnd == spec.indexStart)
throw new FormatException(
text("Positional specifier %", spec.indexStart, '$', spec.spec,
@@ -660,7 +665,8 @@ uint formattedWrite(Writer, Char, Args...)(auto ref Writer w, const scope Char[]
" index exceeds ", Args.length));
}
}
- return currentArg;
+
+ return lastWasConsumeAll ? Args.length : currentArg;
}
///
@@ -1212,7 +1218,8 @@ if (isSomeString!(typeof(fmt)))
import std.array : appender;
auto w = appender!(char[])();
- formattedWrite(w, "%1:$d", 1, 2, 3);
+ uint count = formattedWrite(w, "%1:$d", 1, 2, 3);
+ assert(count == 3);
assert(w.data == "123");
}
diff --git a/libphobos/src/std/random.d b/libphobos/src/std/random.d
index dc1763c..edb8902c 100644
--- a/libphobos/src/std/random.d
+++ b/libphobos/src/std/random.d
@@ -1774,19 +1774,65 @@ else
version (linux)
{
- // `getrandom()` was introduced in Linux 3.17.
+ version (linux_legacy_emulate_getrandom)
+ {
+ /+
+ Emulates `getrandom()` for backwards compatibility
+ with outdated kernels and legacy libc versions.
+
+ `getrandom()` was added to the GNU C Library in v2.25.
+ +/
+ pragma(msg, "`getrandom()` emulation for legacy Linux targets is enabled.");
+
+ /+
+ On modern kernels (5.6+), `/dev/random` would behave more similar
+ to `getrandom()`.
+ However, this emulator was specifically written for systems older
+ than that. Hence, `/dev/urandom` is the CSPRNG of choice.
+
+ <https://web.archive.org/web/20200914181930/https://www.2uo.de/myths-about-urandom/>
+ +/
+ private static immutable _pathLinuxSystemCSPRNG = "/dev/urandom";
+
+ import core.sys.posix.sys.types : ssize_t;
+
+ /+
+ Linux `getrandom()` emulation built upon `/dev/urandom`.
+ The fourth parameter (`uint flags`) is happily ignored.
+ +/
+ private ssize_t getrandom(
+ void* buf,
+ size_t buflen,
+ uint,
+ ) @system nothrow @nogc
+ {
+ import core.stdc.stdio : fclose, fopen, fread;
- // Shim for missing bindings in druntime
- version (none)
- import core.sys.linux.sys.random : getrandom;
+ auto blockDev = fopen(_pathLinuxSystemCSPRNG.ptr, "r");
+ if (blockDev is null)
+ assert(false, "System CSPRNG unavailable: `fopen(\"" ~ _pathLinuxSystemCSPRNG ~ "\")` failed.");
+ scope (exit) fclose(blockDev);
+
+ const bytesRead = fread(buf, 1, buflen, blockDev);
+ return bytesRead;
+ }
+ }
else
{
- import core.sys.posix.sys.types : ssize_t;
- extern extern(C) ssize_t getrandom(
- void* buf,
- size_t buflen,
- uint flags,
- ) @system nothrow @nogc;
+ // `getrandom()` was introduced in Linux 3.17.
+
+ // Shim for missing bindings in druntime
+ version (none)
+ import core.sys.linux.sys.random : getrandom;
+ else
+ {
+ import core.sys.posix.sys.types : ssize_t;
+ private extern extern(C) ssize_t getrandom(
+ void* buf,
+ size_t buflen,
+ uint flags,
+ ) @system nothrow @nogc;
+ }
}
}
diff --git a/libphobos/testsuite/Makefile.in b/libphobos/testsuite/Makefile.in
index b410f17..3df0815 100644
--- a/libphobos/testsuite/Makefile.in
+++ b/libphobos/testsuite/Makefile.in
@@ -202,6 +202,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
+OS_DFLAGS = @OS_DFLAGS@
OS_LINK_SPEC = @OS_LINK_SPEC@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
diff --git a/libphobos/testsuite/testsuite_flags.in b/libphobos/testsuite/testsuite_flags.in
index 9933667..d691272 100755
--- a/libphobos/testsuite/testsuite_flags.in
+++ b/libphobos/testsuite/testsuite_flags.in
@@ -28,7 +28,7 @@ case ${query} in
;;
--gdcflags)
GDCFLAGS_default="-fmessage-length=0 -fno-show-column"
- GDCFLAGS_config="@WARN_DFLAGS@ @GDCFLAGS@ @CET_FLAGS@
+ GDCFLAGS_config="@WARN_DFLAGS@ @GDCFLAGS@ @CET_FLAGS@ @OS_DFLAGS@
@phobos_compiler_shared_flag@
-fall-instantiations -fpreview=dip1000
-fno-release -funittest"
diff --git a/libquadmath/ChangeLog b/libquadmath/ChangeLog
index 5052fdc..00af008 100644
--- a/libquadmath/ChangeLog
+++ b/libquadmath/ChangeLog
@@ -1,3 +1,7 @@
+2025-04-09 Jakub Jelinek <jakub@redhat.com>
+
+ * math/expq.c (C): Fix up THREEp96 constant.
+
2025-04-07 Lulu Cheng <chenglulu@loongson.cn>
PR target/119408
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index c26a5b9..107b275 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,374 @@
+2025-04-18 François Dumont <frs.dumont@gmail.com>
+
+ * testsuite/util/debug/unordered_checks.h (fill_container): New helper method.
+ (use_erased_local_iterator, invalid_local_iterator_pre_increment)
+ (invalid_local_iterator_post_increment, invalid_local_iterator_compare)
+ (invalid_local_iterator_range): Use latter.
+ (fill_and_get_local_iterator): New, use fill_container.
+ (use_invalid_local_iterator): Use latter.
+ (invalid_local_iterator_arrow_operator): New test function.
+ (invalid_local_iterator_copy_instantiation): New test function.
+ (invalid_local_iterator_move_instantiation): New test function.
+ (invalid_local_iterator_copy_assignment): New test function.
+ (invalid_local_iterator_move_assignment): New test function.
+ (invalid_local_iterator_const_conversion): New test function.
+ * testsuite/23_containers/unordered_map/debug/invalid_local_iterator_arrow_operator_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_map/debug/invalid_local_iterator_const_conversion_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_map/debug/invalid_local_iterator_copy_assignment_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_map/debug/invalid_local_iterator_copy_construction_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_map/debug/invalid_local_iterator_move_assignment_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_map/debug/invalid_local_iterator_move_construction_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_map/debug/max_load_factor_neg.cc: Test unordered_map.
+ * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: Test unordered_multimap.
+ * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc: Likewise.
+ * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: Likewise.
+ * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: Likewise.
+ * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: Likewise.
+ * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: Likewise.
+ * testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_arrow_operator_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_const_conversion_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_copy_assignment_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_copy_construction_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_move_assignment_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_move_construction_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_multimap/debug/max_load_factor_neg.cc:
+ Test unordered_multimap.
+ * testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_arrow_operator_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_const_conversion_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_copy_assignment_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_copy_construction_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_move_assignment_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_move_construction_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_set/debug/invalid_local_iterator_arrow_operator_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_set/debug/invalid_local_iterator_const_conversion_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_set/debug/invalid_local_iterator_copy_assignment_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_set/debug/invalid_local_iterator_copy_construction_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_set/debug/invalid_local_iterator_move_assignment_neg.cc:
+ New test case.
+ * testsuite/23_containers/unordered_set/debug/invalid_local_iterator_move_construction_neg.cc:
+ New test case.
+
+2025-04-18 Tomasz Kamiński <tkaminsk@redhat.com>
+
+ * doc/xml/manual/appendix_contributing.xml: Add 'and functions'.
+
+2025-04-17 Jason Merrill <jason@redhat.com>
+
+ * testsuite/20_util/tuple/element_access/get_neg.cc: Adjust
+ diagnostic.
+
+2025-04-17 Tomasz Kamiński <tkaminsk@redhat.com>
+
+ PR libstdc++/119840
+ * include/std/format (_M_parse_fill_and_align): Cast elements of
+ __not_fill to _CharT.
+
+2025-04-17 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/std/format (format_kind): Do not use 'not'
+ alternative token to make the primary template ill-formed. Use
+ the undeclared identifier __primary_template_not_defined and a
+ comment that will appear in diagnostics.
+ * testsuite/std/format/ranges/format_kind_neg.cc: New test.
+
+2025-04-17 Tomasz Kamiński <tkaminsk@redhat.com>
+
+ PR libstdc++/109162
+ * include/std/format (__format::__simply_formattable_range): Define.
+ (range_formatter::format): Do not instantiate _M_format for mutable
+ _Rg if const _Rg can be used.
+
+2025-04-16 Tomasz Kamiński <tkaminsk@redhat.com>
+
+ PR libstdc++/109162
+ * include/std/format (range_formatter::format): Format const range,
+ only if reference type is not changed.
+ * testsuite/std/format/ranges/formatter.cc: New tests.
+
+2025-04-16 Tomasz Kamiński <tkaminsk@redhat.com>
+
+ PR libstdc++/109162
+ * include/std/format (__formatter_int::_M_format_character_escaped)
+ (__formatter_str::format): Use __sink.out() to produce _Sink_iter.
+ (__format::__const_formattable_range): Moved closer to range_formatter.
+ (__format::__maybe_const_range): Use `__conditional_t` and moved closer
+ to range_formatter.
+ (__format::__format_padded, __format::maybe_const)
+ (__format::__indexed_formatter_storage, __format::__tuple_formatter)
+ (std::formatter<pair<_Fp, _Sp>, _CharT>>)
+ (std::formatter<tuple<_Tps...>, _CharT): Define.
+ (std::formatter<_Rg, _CharT>::format): Cast incoming range to
+ __format::__maybe_const_range<_Rg, _CharT>&.
+ (std::formatter<_Rg, _CharT>::_M_format): Extracted from format,
+ and use __format_padded.
+ (std::formatter<_Rg, _CharT>::_M_format_no_padding): Rename...
+ (std::formatter<_Rg, _CharT>::_M_format_elems): ...to this.
+ (std::formatter<_Rg, _CharT>::_M_format_with_padding): Extracted as
+ __format_padded.
+ * testsuite/util/testsuite_iterators.h (test_input_range_nocopy):
+ Define.
+ * testsuite/std/format/ranges/formatter.cc: Tests for `m` specifier.
+ * testsuite/std/format/ranges/sequence.cc: Tests for array and subrange.
+ * testsuite/std/format/ranges/map.cc: New test.
+ * testsuite/std/format/tuple.cc: New test.
+
+2025-04-15 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/std/ranges (__glibcxx_want_ranges_iota): Do not
+ define.
+
+2025-04-15 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/std/numeric (ranges): Only declare namespace for C++23
+ and later.
+ (ranges::iota_result): Fix indentation.
+ * testsuite/17_intro/names.cc: Check ranges is not used as an
+ identifier before C++20.
+
+2025-04-15 Tomasz Kamiński <tkaminsk@redhat.com>
+
+ PR libstdc++/109162
+ * include/std/format (__format::__has_debug_format, _Pres_type::_Pres_seq)
+ (_Pres_type::_Pres_str, __format::__Stackbuf_size): Define.
+ (_Separators::_S_squares, _Separators::_S_parens, _Separators::_S_comma)
+ (_Separators::_S_colon): Define additional constants.
+ (_Spec::_M_parse_fill_and_align): Define overload accepting
+ list of excluded characters for fill, and forward existing overload.
+ (__formatter_str::_M_format_range): Define.
+ (__format::_Buf_sink) Use __Stackbuf_size for size of array.
+ (__format::__is_map_formattable, std::range_formatter)
+ (std::formatter<_Rg, _CharT>): Define.
+ * src/c++23/std.cc.in (std::format_kind, std::range_format)
+ (std::range_formatter): Export.
+ * testsuite/std/format/formatter/lwg3944.cc: Guarded tests with
+ __glibcxx_format_ranges.
+ * testsuite/std/format/formatter/requirements.cc: Adjusted for standard
+ behavior.
+ * testsuite/23_containers/vector/bool/format.cc: Test vector<bool> formatting.
+ * testsuite/std/format/ranges/format_kind.cc: New test.
+ * testsuite/std/format/ranges/formatter.cc: New test.
+ * testsuite/std/format/ranges/sequence.cc: New test.
+ * testsuite/std/format/ranges/string.cc: New test.
+
+2025-04-15 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/119748
+ * include/bits/basic_string.h (_S_copy_chars): Only optimize for
+ contiguous iterators that are convertible to const charT*. Use
+ explicit conversion to charT after dereferencing iterator.
+ (_S_copy_range): Likewise for contiguous ranges.
+ * include/bits/basic_string.tcc (_M_construct): Use explicit
+ conversion to charT after dereferencing iterator.
+ * include/bits/cow_string.h (_S_copy_chars): Likewise.
+ (basic_string(from_range_t, R&&, const Allocator&)): Likewise.
+ Only optimize for contiguous iterators that are convertible to
+ const charT*.
+ * testsuite/21_strings/basic_string/cons/char/119748.cc: New
+ test.
+ * testsuite/21_strings/basic_string/cons/wchar_t/119748.cc:
+ New test.
+
+2025-04-15 Jonathan Wakely <jwakely@redhat.com>
+
+ * testsuite/util/testsuite_iterators.h (test_container): Define
+ array constructor for C++98 as well.
+
+2025-04-14 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/21334
+ * doc/xml/manual/using.xml: Document that container data race
+ avoidance rules do not apply to COW std::string.
+ * doc/html/*: Regenerate.
+
+2025-04-14 Tomasz Kamiński <tkaminsk@redhat.com>
+
+ PR libstdc++/119725
+ * testsuite/std/format/debug.cc: Updated dg-options.
+ * testsuite/std/format/debug_nonunicode.cc: Updated dg-options.
+
+2025-04-11 Jonathan Wakely <jwakely@redhat.com>
+
+ * src/c++17/fast_float/LOCAL_PATCHES: Update.
+
+2025-04-11 Evgeny Karpov <Evgeny.Karpov@microsoft.com>
+
+ * src/c++17/fast_float/fast_float.h (full_multiplication):
+ Support aarch64-w64-mingw32 target.
+
+2025-04-11 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/basic_string.h (_S_copy_chars): Replace overloads
+ with constexpr-if and extend optimization to all contiguous
+ iterators.
+ * src/c++11/string-inst.cc: Extend comment.
+
+2025-04-11 Tomasz Kamiński <tkaminsk@redhat.com>
+
+ PR libstdc++/111055
+ * include/bits/version.def (containers_ranges): Define.
+ * include/bits/version.h: Regenerate.
+ * include/bits/ranges_base.h (__detail::__container_compatible_range)
+ (__detail::__range_to_alloc_type, __detail::__range_mapped_type)
+ (__detail::__range_key_type): Depend on __glibcxx_containers_ranges
+ instead of __glibcxx_ranges_to_container.
+ * include/bits/basic_string.h: Replace __glibcxx_ranges_to_container with
+ __glibcxx_containers_ranges.
+ * include/bits/cow_string.h: Likewise.
+ * include/bits/deque.tcc: Likewise.
+ * include/bits/forward_list.h: Likewise.
+ * include/bits/stl_bvector.h: Likewise.
+ * include/bits/stl_deque.h: Likewise.
+ * include/bits/stl_list.h: Likewise.
+ * include/bits/stl_map.h: Likewise.
+ * include/bits/stl_multimap.h: Likewise.
+ * include/bits/stl_multiset.h: Likewise.
+ * include/bits/stl_queue.h: Likewise.
+ * include/bits/stl_set.h: Likewise.
+ * include/bits/stl_stack.h: Likewise.
+ * include/bits/stl_vector.h: Likewise.
+ * include/bits/unordered_map.h: Likewise.
+ * include/bits/unordered_set.h: Likewise.
+ * include/bits/vector.tcc: Likewise.
+ * include/debug/deque: Likewise.
+ * include/debug/forward_list: Likewise.
+ * include/debug/list: Likewise.
+ * include/debug/map.h: Likewise.
+ * include/debug/multimap.h: Likewise.
+ * include/debug/multiset.h: Likewise.
+ * include/debug/set.h: Likewise.
+ * include/debug/unordered_map: Likewise.
+ * include/debug/unordered_set: Likewise.
+ * include/debug/vector: Likewise.
+ * include/std/deque: Provide __cpp_lib_containers_ranges.
+ * include/std/forward_list: Likewise.
+ * include/std/list: Likewise.
+ * include/std/map: Likewise.
+ * include/std/queue: Likewise.
+ * include/std/set: Likewise.
+ * include/std/stack: Likewise.
+ * include/std/string: Likewise.
+ * include/std/unordered_map: Likewise.
+ * include/std/unordered_set: Likewise.
+ * include/std/vector: Likewise.
+ * testsuite/21_strings/basic_string/cons/from_range.cc: Test for value
+ __cpp_lib_containers_ranges.
+ * testsuite/23_containers/deque/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/forward_list/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/list/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/map/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/multimap/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/multiset/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/priority_queue/cons_from_range.cc: Likewise.
+ * testsuite/23_containers/queue/cons_from_range.cc: Likewise.
+ * testsuite/23_containers/set/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/stack/cons_from_range.cc: Likewise.
+ * testsuite/23_containers/unordered_map/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/unordered_multimap/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/unordered_multiset/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/unordered_set/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/vector/bool/cons/from_range.cc: Likewise.
+ * testsuite/23_containers/vector/cons/from_range.cc: Likewise.
+
+2025-04-11 Jonathan Wakely <jwakely@redhat.com>
+ Tomasz Kamiński <tkaminsk@redhat.com>
+
+ PR libstdc++/111055
+ * include/bits/basic_string.h (_S_copy_range): New function.
+ (basic_string(from_range_t, R%%, const Alloc&)): New
+ constructor.
+ (append_range, assign_range, insert_range, replace_with_range):
+ New functions.
+ * include/bits/cow_string.h: Likewise.
+ * testsuite/21_strings/basic_string/cons/from_range.cc: New
+ test.
+ * testsuite/21_strings/basic_string/modifiers/append/append_range.cc:
+ New test.
+ * testsuite/21_strings/basic_string/modifiers/assign/assign_range.cc:
+ New test.
+ * testsuite/21_strings/basic_string/modifiers/insert/insert_range.cc:
+ New test.
+ * testsuite/21_strings/basic_string/modifiers/replace/replace_with_range.cc:
+ New test.
+
+2025-04-11 Tomasz Kamiński <tkaminsk@redhat.com>
+
+ PR libstdc++/109162
+ * include/bits/chrono_io.h (__detail::_Widen): Moved to std/format file.
+ * include/bits/unicode-data.h: Regnerate.
+ * include/bits/unicode.h (__unicode::_Utf_iterator::_M_units)
+ (__unicode::__should_escape_category): Define.
+ * include/std/format (_GLIBCXX_WIDEN_, _GLIBCXX_WIDEN): Copied from
+ include/bits/chrono_io.h.
+ (__format::_Widen): Moved from include/bits/chrono_io.h.
+ (__format::_Term_char, __format::_Escapes, __format::_Separators)
+ (__format::__should_escape_ascii, __format::__should_escape_unicode)
+ (__format::__write_escape_seq, __format::__write_escaped_char)
+ (__format::__write_escaped_acii, __format::__write_escaped_unicode)
+ (__format::__write_escaped): Define.
+ (__formatter_str::_S_trunc): Extracted truncation of character
+ sequences.
+ (__formatter_str::format): Handle _Pres_esc.
+ (__formatter_int::_M_do_parse) [__glibcxx_format_ranges]: Parse '?'.
+ (__formatter_int::_M_format_character_escaped): Define.
+ (formatter<_CharT, _CharT>::format, formatter<char, wchar_t>::format):
+ Handle _Pres_esc.
+ (__formatter_str::set_debug_format, formatter<...>::set_debug_format)
+ Guard with __glibcxx_format_ranges.
+ (__format::_Fixedbuf_sink): Define.
+ * testsuite/23_containers/vector/bool/format.cc: Use __format::_Widen
+ and remove unnecessary <chrono> include.
+ * testsuite/std/format/debug.cc: New test.
+ * testsuite/std/format/debug_nonunicode.cc: New test.
+ * testsuite/std/format/parse_ctx.cc (escaped_strings_supported): Define
+ to true if __glibcxx_format_ranges is defined.
+ * testsuite/std/format/string.cc (escaped_strings_supported): Define to
+ true if __glibcxx_format_ranges is defined.
+
+2025-04-10 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/version.def (constrained_equality): Only define
+ as 202411 for C++23 and later, use 202403 for C++20.
+ * include/bits/version.h: Regenerate.
+ * testsuite/20_util/expected/equality_constrained.cc: Remove
+ TODO comment.
+
+2025-04-10 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/os/hpux/os_defines.h: Remove _GLIBCXX_USE_LONG_LONG
+ define.
+
+2025-04-09 Patrick Palka <ppalka@redhat.com>
+
+ PR libstdc++/115046
+ PR libstdc++/112490
+ * include/bits/stl_iterator.h (basic_const_iterator::operator-):
+ Replace non-dependent basic_const_iterator function parameter with
+ a dependent one of type basic_const_iterator<_It2> where _It2
+ matches _It.
+ * testsuite/std/ranges/adaptors/as_const/1.cc (test04): New test.
+
2025-04-08 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/119671
diff --git a/libstdc++-v3/config/os/hpux/os_defines.h b/libstdc++-v3/config/os/hpux/os_defines.h
index d3a6c5a..acc1a02 100644
--- a/libstdc++-v3/config/os/hpux/os_defines.h
+++ b/libstdc++-v3/config/os/hpux/os_defines.h
@@ -52,10 +52,7 @@
Also note that the compiler defines _INCLUDE_LONGLONG for C++
unconditionally, which makes intmax_t and uintmax_t long long
- types.
-
- We also force _GLIBCXX_USE_LONG_LONG here so that we don't have
- to bastardize configure to deal with this sillyness. */
+ types. */
#if __cplusplus >= 201103L
namespace std
@@ -77,8 +74,6 @@ namespace std
} // namespace std
#endif // __cplusplus
-#define _GLIBCXX_USE_LONG_LONG 1
-
// HPUX on IA64 requires vtable to be 64 bit aligned even at 32 bit
// mode. We need to pad the vtable structure to achieve this.
#if !defined(_LP64) && defined (__ia64__)
diff --git a/libstdc++-v3/doc/html/manual/using_concurrency.html b/libstdc++-v3/doc/html/manual/using_concurrency.html
index d21f158..d570d3a 100644
--- a/libstdc++-v3/doc/html/manual/using_concurrency.html
+++ b/libstdc++-v3/doc/html/manual/using_concurrency.html
@@ -126,6 +126,16 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
the container the iterator refers to (for example incrementing a
list iterator must access the pointers between nodes, which are part
of the container and so conflict with other accesses to the container).
+ </p><p>
+ The Copy-On-Write <code class="classname">std::string</code> implementation
+ used before GCC 5 (and with
+ <a class="link" href="using_dual_abi.html" title="Dual ABI">_GLIBCXX_USE_CXX11_ABI=0</a>)
+ is not a standard container and does not conform to the data race
+ avoidance rules described above. For the Copy-On-Write
+ <code class="classname">std::string</code>, non-const member functions such as
+ <code class="function">begin()</code> are considered to be modifying accesses
+ and so must not be used concurrently with any other accesses to the
+ same object.
</p><p>Programs which follow the rules above will not encounter data
races in library code, even when using library types which share
state between distinct objects. In the example below the
diff --git a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
index ac607fc..b924545 100644
--- a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
+++ b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
@@ -895,7 +895,7 @@ indicate a place that may require attention for multi-thread safety.
Examples: <code>_M_num_elements _M_initialize ()</code>
- Static data members, constants, and enumerations: <literal>_S_.*</literal>
+ Static data and function members, constants, and enumerations: <literal>_S_.*</literal>
Examples: <code>_S_max_elements _S_default_value</code>
diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml
index 7ca3a3f..bf92c49 100644
--- a/libstdc++-v3/doc/xml/manual/using.xml
+++ b/libstdc++-v3/doc/xml/manual/using.xml
@@ -2069,6 +2069,18 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
of the container and so conflict with other accesses to the container).
</para>
+ <para>
+ The Copy-On-Write <classname>std::string</classname> implementation
+ used before GCC 5 (and with
+ <link linkend="manual.intro.using.abi">_GLIBCXX_USE_CXX11_ABI=0</link>)
+ is not a standard container and does not conform to the data race
+ avoidance rules described above. For the Copy-On-Write
+ <classname>std::string</classname>, non-const member functions such as
+ <function>begin()</function> are considered to be modifying accesses
+ and so must not be used concurrently with any other accesses to the
+ same object.
+ </para>
+
<para>Programs which follow the rules above will not encounter data
races in library code, even when using library types which share
state between distinct objects. In the example below the
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 886e7e6..c90bd09 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -51,6 +51,11 @@
# include <string_view>
#endif
+#if __glibcxx_containers_ranges // C++ >= 23
+# include <bits/ranges_algobase.h> // ranges::copy
+# include <bits/ranges_util.h> // ranges::subrange
+#endif
+
#if __cplusplus > 202302L
# include <charconv>
#endif
@@ -468,6 +473,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
traits_type::assign(__d, __n, __c);
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++17-extensions"
// _S_copy_chars is a separate template to permit specialization
// to optimize for the common case of pointers as iterators.
template<class _Iterator>
@@ -475,31 +482,69 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
static void
_S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
{
+#if __cplusplus >= 201103L
+ using _IterBase = decltype(std::__niter_base(__k1));
+ if constexpr (__or_<is_same<_IterBase, _CharT*>,
+ is_same<_IterBase, const _CharT*>>::value)
+ _S_copy(__p, std::__niter_base(__k1), __k2 - __k1);
+#if __cpp_lib_concepts
+ else if constexpr (requires {
+ requires contiguous_iterator<_Iterator>;
+ { std::to_address(__k1) }
+ -> convertible_to<const _CharT*>;
+ })
+ {
+ const auto __d = __k2 - __k1;
+ (void) (__k1 + __d); // See P3349R1
+ _S_copy(__p, std::to_address(__k1), static_cast<size_type>(__d));
+ }
+#endif
+ else
+#endif
for (; __k1 != __k2; ++__k1, (void)++__p)
- traits_type::assign(*__p, *__k1); // These types are off.
+ traits_type::assign(*__p, static_cast<_CharT>(*__k1));
}
+#pragma GCC diagnostic pop
- _GLIBCXX20_CONSTEXPR
+#if __cplusplus < 201103L || defined _GLIBCXX_DEFINING_STRING_INSTANTIATIONS
static void
- _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2) _GLIBCXX_NOEXCEPT
+ _S_copy_chars(_CharT* __p, iterator __k1, iterator __k2)
{ _S_copy_chars(__p, __k1.base(), __k2.base()); }
- _GLIBCXX20_CONSTEXPR
static void
_S_copy_chars(_CharT* __p, const_iterator __k1, const_iterator __k2)
- _GLIBCXX_NOEXCEPT
{ _S_copy_chars(__p, __k1.base(), __k2.base()); }
- _GLIBCXX20_CONSTEXPR
static void
- _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2) _GLIBCXX_NOEXCEPT
+ _S_copy_chars(_CharT* __p, _CharT* __k1, _CharT* __k2)
{ _S_copy(__p, __k1, __k2 - __k1); }
- _GLIBCXX20_CONSTEXPR
static void
_S_copy_chars(_CharT* __p, const _CharT* __k1, const _CharT* __k2)
- _GLIBCXX_NOEXCEPT
{ _S_copy(__p, __k1, __k2 - __k1); }
+#endif
+
+#if __glibcxx_containers_ranges // C++ >= 23
+ // pre: __n == ranges::distance(__rg). __p+[0,__n) is a valid range.
+ template<typename _Rg>
+ static constexpr void
+ _S_copy_range(pointer __p, _Rg&& __rg, size_type __n)
+ {
+ if constexpr (requires {
+ requires ranges::contiguous_range<_Rg>;
+ { ranges::data(std::forward<_Rg>(__rg)) }
+ -> convertible_to<const _CharT*>;
+ })
+ _S_copy(__p, ranges::data(std::forward<_Rg>(__rg)), __n);
+ else
+ {
+ auto __first = ranges::begin(__rg);
+ const auto __last = ranges::end(__rg);
+ for (; __first != __last; ++__first)
+ traits_type::assign(*__p++, static_cast<_CharT>(*__first));
+ }
+ }
+#endif
_GLIBCXX20_CONSTEXPR
static int
@@ -717,6 +762,33 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
__str._M_set_length(0);
}
+#if __glibcxx_containers_ranges // C++ >= 23
+ /**
+ * @brief Construct a string from a range.
+ * @since C++23
+ */
+ template<__detail::__container_compatible_range<_CharT> _Rg>
+ constexpr
+ basic_string(from_range_t, _Rg&& __rg, const _Alloc& __a = _Alloc())
+ : basic_string(__a)
+ {
+ if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
+ {
+ const auto __n = static_cast<size_type>(ranges::distance(__rg));
+ reserve(__n);
+ _S_copy_range(_M_data(), std::forward<_Rg>(__rg), __n);
+ _M_set_length(__n);
+ }
+ else
+ {
+ auto __first = ranges::begin(__rg);
+ const auto __last = ranges::end(__rg);
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+ }
+#endif
+
/**
* @brief Construct string from an initializer %list.
* @param __l std::initializer_list of characters.
@@ -1526,6 +1598,58 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
append(size_type __n, _CharT __c)
{ return _M_replace_aux(this->size(), size_type(0), __n, __c); }
+#if __glibcxx_containers_ranges // C++ >= 23
+ /**
+ * @brief Append a range to the string.
+ * @param __rg A range of values that are convertible to `value_type`.
+ * @since C++23
+ *
+ * The range `__rg` is allowed to overlap with `*this`.
+ */
+ template<__detail::__container_compatible_range<_CharT> _Rg>
+ constexpr basic_string&
+ append_range(_Rg&& __rg)
+ {
+ // N.B. __rg may overlap with *this, so we must copy from __rg before
+ // existing elements or iterators referring to *this are invalidated.
+ // e.g. in s.append_range(views::concat(s, str)), rg overlaps s.
+ if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
+ {
+ const auto __len = size_type(ranges::distance(__rg));
+
+ // Don't care if this addition wraps around, we check it below:
+ const size_type __newlen = size() + __len;
+
+ if ((capacity() - size()) >= __len)
+ _S_copy_range(_M_data() + size(), std::forward<_Rg>(__rg),
+ __len);
+ else
+ {
+ _M_check_length(0, __len, "basic_string::append_range");
+ basic_string __s(_M_get_allocator());
+ __s.reserve(__newlen);
+ _S_copy_range(__s._M_data() + size(), std::forward<_Rg>(__rg),
+ __len);
+ _S_copy(__s._M_data(), _M_data(), size());
+ if (!_M_is_local())
+ _M_destroy(_M_allocated_capacity);
+ _M_data(__s._M_data());
+ _M_capacity(__s._M_allocated_capacity);
+ __s._M_data(__s._M_local_data());
+ __s._M_length(0);
+ }
+ _M_set_length(__newlen); // adds null-terminator
+ }
+ else
+ {
+ basic_string __s(from_range, std::forward<_Rg>(__rg),
+ _M_get_allocator());
+ append(__s);
+ }
+ return *this;
+ }
+#endif
+
#if __cplusplus >= 201103L
/**
* @brief Append an initializer_list of characters.
@@ -1785,6 +1909,25 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
{ return this->replace(begin(), end(), __first, __last); }
#endif
+#if __glibcxx_containers_ranges // C++ >= 23
+ /**
+ * @brief Assign a range to the string.
+ * @param __rg A range of values that are convertible to `value_type`.
+ * @since C++23
+ *
+ * The range `__rg` is allowed to overlap with `*this`.
+ */
+ template<__detail::__container_compatible_range<_CharT> _Rg>
+ constexpr basic_string&
+ assign_range(_Rg&& __rg)
+ {
+ basic_string __s(from_range, std::forward<_Rg>(__rg),
+ _M_get_allocator());
+ assign(std::move(__s));
+ return *this;
+ }
+#endif
+
#if __cplusplus >= 201103L
/**
* @brief Set value to an initializer_list of characters.
@@ -1934,6 +2077,37 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
{ this->replace(__p, __p, __beg, __end); }
#endif
+#if __glibcxx_containers_ranges // C++ >= 23
+ /**
+ * @brief Insert a range into the string.
+ * @param __rg A range of values that are convertible to `value_type`.
+ * @since C++23
+ *
+ * The range `__rg` is allowed to overlap with `*this`.
+ */
+ template<__detail::__container_compatible_range<_CharT> _Rg>
+ constexpr iterator
+ insert_range(const_iterator __p, _Rg&& __rg)
+ {
+ auto __pos = __p - cbegin();
+
+ if constexpr (ranges::forward_range<_Rg>)
+ if (ranges::empty(__rg))
+ return begin() + __pos;
+
+
+ if (__p == cend())
+ append_range(std::forward<_Rg>(__rg));
+ else
+ {
+ basic_string __s(from_range, std::forward<_Rg>(__rg),
+ _M_get_allocator());
+ insert(__pos, __s);
+ }
+ return begin() + __pos;
+ }
+#endif
+
#if __cplusplus >= 201103L
/**
* @brief Insert an initializer_list of characters.
@@ -2522,6 +2696,30 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
__k1.base(), __k2 - __k1);
}
+#if __glibcxx_containers_ranges // C++ >= 23
+ /**
+ * @brief Replace part of the string with a range.
+ * @param __rg A range of values that are convertible to `value_type`.
+ * @since C++23
+ *
+ * The range `__rg` is allowed to overlap with `*this`.
+ */
+ template<__detail::__container_compatible_range<_CharT> _Rg>
+ constexpr basic_string&
+ replace_with_range(const_iterator __i1, const_iterator __i2, _Rg&& __rg)
+ {
+ if (__i1 == cend())
+ append_range(std::forward<_Rg>(__rg));
+ else
+ {
+ basic_string __s(from_range, std::forward<_Rg>(__rg),
+ _M_get_allocator());
+ replace(__i1, __i2, __s);
+ }
+ return *this;
+ }
+#endif
+
#if __cplusplus >= 201103L
/**
* @brief Replace range of characters with initializer_list.
@@ -3599,6 +3797,15 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
typename basic_string<_CharT, _Traits, _Allocator>::size_type,
const _Allocator& = _Allocator())
-> basic_string<_CharT, _Traits, _Allocator>;
+
+#if __glibcxx_containers_ranges // C++ >= 23
+ template<ranges::input_range _Rg,
+ typename _Allocator = allocator<ranges::range_value_t<_Rg>>>
+ basic_string(from_range_t, _Rg&&, _Allocator = _Allocator())
+ -> basic_string<ranges::range_value_t<_Rg>,
+ char_traits<ranges::range_value_t<_Rg>>,
+ _Allocator>;
+#endif
_GLIBCXX_END_NAMESPACE_CXX11
#endif
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index 02230ac..bca55bc 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -210,7 +210,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_data(__another);
_M_capacity(__capacity);
}
- traits_type::assign(_M_data()[__len++], *__beg);
+ traits_type::assign(_M_data()[__len++],
+ static_cast<_CharT>(*__beg));
++__beg;
}
diff --git a/libstdc++-v3/include/bits/chrono_io.h b/libstdc++-v3/include/bits/chrono_io.h
index d872109..b7f6f5f 100644
--- a/libstdc++-v3/include/bits/chrono_io.h
+++ b/libstdc++-v3/include/bits/chrono_io.h
@@ -57,21 +57,7 @@ namespace chrono
/// @cond undocumented
namespace __detail
{
- // STATICALLY-WIDEN, see C++20 [time.general]
- // It doesn't matter for format strings (which can only be char or wchar_t)
- // but this returns the narrow string for anything that isn't wchar_t. This
- // is done because const char* can be inserted into any ostream type, and
- // will be widened at runtime if necessary.
- template<typename _CharT>
- consteval auto
- _Widen(const char* __narrow, const wchar_t* __wide)
- {
- if constexpr (is_same_v<_CharT, wchar_t>)
- return __wide;
- else
- return __narrow;
- }
-#define _GLIBCXX_WIDEN_(C, S) ::std::chrono::__detail::_Widen<C>(S, L##S)
+#define _GLIBCXX_WIDEN_(C, S) ::std::__format::_Widen<C>(S, L##S)
#define _GLIBCXX_WIDEN(S) _GLIBCXX_WIDEN_(_CharT, S)
template<typename _Period, typename _CharT>
diff --git a/libstdc++-v3/include/bits/cow_string.h b/libstdc++-v3/include/bits/cow_string.h
index d5b3979..f9df2be 100644
--- a/libstdc++-v3/include/bits/cow_string.h
+++ b/libstdc++-v3/include/bits/cow_string.h
@@ -423,7 +423,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
{
for (; __k1 != __k2; ++__k1, (void)++__p)
- traits_type::assign(*__p, *__k1); // These types are off.
+ traits_type::assign(*__p, static_cast<_CharT>(*__k1));
}
static void
@@ -639,6 +639,48 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
}
+#if __glibcxx_containers_ranges // C++ >= 23
+ /**
+ * @brief Construct a string from a range.
+ * @since C++23
+ */
+ template<__detail::__container_compatible_range<_CharT> _Rg>
+ basic_string(from_range_t, _Rg&& __rg, const _Alloc& __a = _Alloc())
+ : basic_string(__a)
+ {
+ if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
+ {
+ const auto __n = static_cast<size_type>(ranges::distance(__rg));
+ if (__n == 0)
+ return;
+
+ reserve(__n);
+ pointer __p = _M_data();
+ if constexpr (requires {
+ requires ranges::contiguous_range<_Rg>;
+ { ranges::data(std::forward<_Rg>(__rg)) }
+ -> convertible_to<const _CharT*>;
+ })
+ _M_copy(__p, ranges::data(std::forward<_Rg>(__rg)), __n);
+ else
+ {
+ auto __first = ranges::begin(__rg);
+ const auto __last = ranges::end(__rg);
+ for (; __first != __last; ++__first)
+ traits_type::assign(*__p++, static_cast<_CharT>(*__first));
+ }
+ _M_rep()->_M_set_length_and_sharable(__n);
+ }
+ else
+ {
+ auto __first = ranges::begin(__rg);
+ const auto __last = ranges::end(__rg);
+ for (; __first != __last; ++__first)
+ push_back(*__first);
+ }
+ }
+#endif
+
/**
* @brief Construct string from an initializer %list.
* @param __l std::initializer_list of characters.
@@ -1314,6 +1356,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
basic_string&
append(size_type __n, _CharT __c);
+#if __glibcxx_containers_ranges // C++ >= 23
+ /**
+ * @brief Append a range to the string.
+ * @since C++23
+ */
+ template<__detail::__container_compatible_range<_CharT> _Rg>
+ basic_string&
+ append_range(_Rg&& __rg)
+ {
+ basic_string __s(from_range, std::forward<_Rg>(__rg),
+ get_allocator());
+ append(__s);
+ return *this;
+ }
+#endif
+
#if __cplusplus >= 201103L
/**
* @brief Append an initializer_list of characters.
@@ -1485,6 +1543,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
assign(_InputIterator __first, _InputIterator __last)
{ return this->replace(_M_ibegin(), _M_iend(), __first, __last); }
+#if __glibcxx_containers_ranges // C++ >= 23
+ /**
+ * @brief Set value to a range of characters.
+ * @since C++23
+ */
+ template<__detail::__container_compatible_range<_CharT> _Rg>
+ basic_string&
+ assign_range(_Rg&& __rg)
+ {
+ basic_string __s(from_range, std::forward<_Rg>(__rg),
+ get_allocator());
+ assign(std::move(__s));
+ return *this;
+ }
+#endif
+
#if __cplusplus >= 201103L
/**
* @brief Set value to an initializer_list of characters.
@@ -1562,6 +1636,33 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
insert(iterator __p, _InputIterator __beg, _InputIterator __end)
{ this->replace(__p, __p, __beg, __end); }
+#if __glibcxx_containers_ranges // C++ >= 23
+ /**
+ * @brief Insert a range into the string.
+ * @since C++23
+ */
+ template<__detail::__container_compatible_range<_CharT> _Rg>
+ iterator
+ insert_range(const_iterator __p, _Rg&& __rg)
+ {
+ auto __pos = __p - cbegin();
+
+ if constexpr (ranges::forward_range<_Rg>)
+ if (ranges::empty(__rg))
+ return begin() + __pos;
+
+ if (__p == cend())
+ append_range(std::forward<_Rg>(__rg));
+ else
+ {
+ basic_string __s(from_range, std::forward<_Rg>(__rg),
+ get_allocator());
+ insert(__pos, __s);
+ }
+ return begin() + __pos;
+ }
+#endif
+
#if __cplusplus >= 201103L
/**
* @brief Insert an initializer_list of characters.
@@ -2072,6 +2173,27 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__k1.base(), __k2 - __k1);
}
+#if __glibcxx_containers_ranges // C++ >= 23
+ /**
+ * @brief Replace part of the string with a range.
+ * @since C++23
+ */
+ template<__detail::__container_compatible_range<_CharT> _Rg>
+ basic_string&
+ replace_with_range(const_iterator __i1, const_iterator __i2, _Rg&& __rg)
+ {
+ if (__i1 == cend())
+ append_range(std::forward<_Rg>(__rg));
+ else
+ {
+ basic_string __s(from_range, std::forward<_Rg>(__rg),
+ get_allocator());
+ replace(__i1 - cbegin(), __i2 - __i1, __s);
+ }
+ return *this;
+ }
+#endif
+
#if __cplusplus >= 201103L
/**
* @brief Replace range of characters with initializer_list.
diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc
index 87ea1ce..dabb6ec 100644
--- a/libstdc++-v3/include/bits/deque.tcc
+++ b/libstdc++-v3/include/bits/deque.tcc
@@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
}
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::forward_range _Rg>
auto __advance_dist(_Rg& __rg)
{
@@ -1022,7 +1022,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
__guard.__n = size();
}
}
-#endif // ranges_to_container
+#endif // containers_ranges
template<typename _Tp, typename _Alloc>
void
diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h
index 84882a5..8bcfb80 100644
--- a/libstdc++-v3/include/bits/forward_list.h
+++ b/libstdc++-v3/include/bits/forward_list.h
@@ -46,7 +46,7 @@
#include <ext/alloc_traits.h>
#include <ext/aligned_buffer.h>
#include <debug/assertions.h>
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <bits/ranges_base.h> // ranges::begin, ranges::distance etc.
# include <bits/ranges_util.h> // ranges::subrange
#endif
@@ -896,7 +896,7 @@ namespace __fwdlist
: _Base(_Node_alloc_type(__al))
{ _M_range_initialize(__first, __last); }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a forward_list from a range.
* @param __rg An input range with elements that are convertible to
@@ -918,7 +918,7 @@ namespace __fwdlist
__to = __to->_M_next;
}
}
-#endif // ranges_to_container
+#endif // containers_ranges
/**
* @brief The %forward_list copy constructor.
@@ -1071,7 +1071,7 @@ namespace __fwdlist
}
#pragma GCC diagnostic pop
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Assign a range to a forward_list.
* @since C++23
@@ -1102,7 +1102,7 @@ namespace __fwdlist
insert_range_after(__prev,
ranges::subrange(std::move(__first), __last));
}
-#endif // ranges_to_container
+#endif // containers_ranges
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr
@@ -1345,7 +1345,7 @@ namespace __fwdlist
push_front(_Tp&& __val)
{ this->_M_insert_after(cbefore_begin(), std::move(__val)); }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Insert a range at the beginning of a forward_list.
* @param __rg An input range with elements that are convertible to
@@ -1370,7 +1370,7 @@ namespace __fwdlist
if (!__tmp.empty())
splice_after(before_begin(), __tmp);
}
-#endif // ranges_to_container
+#endif // containers_ranges
/**
* @brief Removes first element.
@@ -1491,7 +1491,7 @@ namespace __fwdlist
insert_after(const_iterator __pos, std::initializer_list<_Tp> __il)
{ return insert_after(__pos, __il.begin(), __il.end()); }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Insert a rangeinto a forward_list.
* @param __position An iterator.
@@ -1515,7 +1515,7 @@ namespace __fwdlist
get_allocator());
return _M_splice_after(__position, __tmp.before_begin(), __tmp.end());
}
-#endif // ranges_to_container
+#endif // containers_ranges
/**
* @brief Removes the element pointed to by the iterator following
@@ -1953,7 +1953,7 @@ namespace __fwdlist
forward_list(_InputIterator, _InputIterator, _Allocator = _Allocator())
-> forward_list<_ValT, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
typename _Allocator = allocator<ranges::range_value_t<_Rg>>>
forward_list(from_range_t, _Rg&&, _Allocator = _Allocator())
diff --git a/libstdc++-v3/include/bits/ranges_base.h b/libstdc++-v3/include/bits/ranges_base.h
index 13bfbb3..488907d 100644
--- a/libstdc++-v3/include/bits/ranges_base.h
+++ b/libstdc++-v3/include/bits/ranges_base.h
@@ -41,7 +41,7 @@
#include <bits/max_size_type.h>
#include <bits/version.h>
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <bits/utility.h> // for tuple_element_t
#endif
@@ -1085,7 +1085,9 @@ namespace ranges
#if __glibcxx_ranges_to_container // C++ >= 23
struct from_range_t { explicit from_range_t() = default; };
inline constexpr from_range_t from_range{};
+#endif
+#if __glibcxx_containers_ranges // C++ >= 23
/// @cond undocumented
template<typename _T1, typename _T2>
struct pair;
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 03f6434..8cc2920 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -896,7 +896,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a vector from a range.
* @param __rg A range of values that are convertible to `value_type`.
@@ -1026,7 +1026,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ _M_assign_aux(__l.begin(), __l.end(), random_access_iterator_tag()); }
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Assign a range to the vector.
* @param __rg A range of values that are convertible to `value_type`.
@@ -1347,7 +1347,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ return this->insert(__p, __l.begin(), __l.end()); }
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Insert a range into the vector.
* @param __rg A range of values that are convertible to `bool`.
@@ -1458,7 +1458,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
insert(end(), __tmp.begin(), __tmp.end());
}
}
-#endif // ranges_to_container
+#endif // containers_ranges
_GLIBCXX20_CONSTEXPR
void
diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h
index 94e0886..8d8ee57 100644
--- a/libstdc++-v3/include/bits/stl_deque.h
+++ b/libstdc++-v3/include/bits/stl_deque.h
@@ -1022,7 +1022,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a deque from a range.
* @param __rg A range of values that are convertible to `value_type`.
@@ -1150,7 +1150,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ _M_assign_aux(__l.begin(), __l.end(), random_access_iterator_tag()); }
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Assign a range to the deque.
* @param __rg A range of values that are convertible to `value_type`.
@@ -1194,7 +1194,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
emplace_back(*__first);
}
}
-#endif // ranges_to_container
+#endif // containers_ranges
/// Get a copy of the memory allocation object.
@@ -1824,7 +1824,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Insert a range into the deque.
* @param __rg A range of values that are convertible to `value_type`.
@@ -1854,7 +1854,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<__detail::__container_compatible_range<_Tp> _Rg>
void
append_range(_Rg&& __rg);
-#endif // ranges_to_container
+#endif // containers_ranges
/**
* @brief Remove element at given position.
@@ -2386,7 +2386,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
deque(_InputIterator, _InputIterator, _Allocator = _Allocator())
-> deque<_ValT, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
typename _Alloc = allocator<ranges::range_value_t<_Rg>>>
deque(from_range_t, _Rg&&, _Alloc = _Alloc())
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index 82ccb50..d27824c 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -66,7 +66,7 @@
#include <bits/ptr_traits.h>
#include <ext/aligned_buffer.h>
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <bits/ranges_base.h> // ranges::begin, ranges::distance etc.
# include <bits/ranges_util.h> // ranges::subrange
#endif
@@ -1263,7 +1263,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a list from a range.
* @since C++23
@@ -1360,7 +1360,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Assign a range to a list.
* @since C++23
@@ -1726,7 +1726,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Insert a range at the beginning of a list.
* @param __rg An input range of elements that can be converted to
@@ -1964,7 +1964,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Insert a range into a list.
* @param __position An iterator.
@@ -2594,7 +2594,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
list(_InputIterator, _InputIterator, _Allocator = _Allocator())
-> list<_ValT, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
typename _Allocator = allocator<ranges::range_value_t<_Rg>>>
list(from_range_t, _Rg&&, _Allocator = _Allocator())
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h
index 9381a79..006ff46 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -62,7 +62,7 @@
#include <initializer_list>
#include <tuple>
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <bits/ranges_base.h> // ranges::begin, ranges::distance etc.
#endif
@@ -308,7 +308,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_t(__comp, _Pair_alloc_type(__a))
{ _M_t._M_insert_range_unique(__first, __last); }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Builds a %map from a range.
* @since C++23
@@ -903,7 +903,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ insert(__list.begin(), __list.end()); }
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Inserts a range of elements.
* @since C++23
@@ -1536,7 +1536,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
map(initializer_list<pair<_Key, _Tp>>, _Allocator)
-> map<_Key, _Tp, less<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Compare = less<__detail::__range_key_type<_Rg>>,
__allocator_like _Alloc =
diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h
index 8fca3a4..4ee4a84 100644
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -60,7 +60,7 @@
#if __cplusplus >= 201103L
#include <initializer_list>
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <bits/ranges_base.h> // ranges::begin, ranges::distance etc.
#endif
@@ -297,7 +297,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_t(__comp, _Pair_alloc_type(__a))
{ _M_t._M_insert_range_equal(__first, __last); }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Builds a %multimap from a range.
* @since C++23
@@ -655,7 +655,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ this->insert(__l.begin(), __l.end()); }
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Inserts a range of elements.
* @since C++23
@@ -1159,7 +1159,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
-> multimap<_Key, _Tp, less<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Compare = less<__detail::__range_key_type<_Rg>>,
__allocator_like _Alloc =
diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h
index 7030f28..31451ab 100644
--- a/libstdc++-v3/include/bits/stl_multiset.h
+++ b/libstdc++-v3/include/bits/stl_multiset.h
@@ -60,7 +60,7 @@
#if __cplusplus >= 201103L
#include <initializer_list>
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <bits/ranges_base.h> // ranges::begin, ranges::distance etc.
#endif
@@ -274,7 +274,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_t(_Key_alloc_type(__a))
{ _M_t._M_insert_range_equal(__first, __last); }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Builds a %multiset from a range.
* @since C++23
@@ -588,7 +588,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ this->insert(__l.begin(), __l.end()); }
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Inserts a range of elements.
* @since C++23
@@ -996,7 +996,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
multiset(initializer_list<_Key>, _Allocator)
-> multiset<_Key, less<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Compare = less<ranges::range_value_t<_Rg>>,
__allocator_like _Alloc = std::allocator<ranges::range_value_t<_Rg>>>
diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h
index 2a4b629..554e076 100644
--- a/libstdc++-v3/include/bits/stl_queue.h
+++ b/libstdc++-v3/include/bits/stl_queue.h
@@ -61,7 +61,7 @@
#if __cplusplus >= 201103L
# include <bits/uses_allocator.h>
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <ranges> // ranges::to
# include <bits/ranges_algobase.h> // ranges::copy
#endif
@@ -213,7 +213,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: c(__first, __last, __a) { }
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a queue from a range.
* @since C++23
@@ -326,7 +326,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<_Tp> _Rg>
void
push_range(_Rg&& __rg)
@@ -397,7 +397,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-> queue<_ValT, deque<_ValT, _Allocator>>;
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg>
queue(from_range_t, _Rg&&) -> queue<ranges::range_value_t<_Rg>>;
@@ -766,7 +766,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a priority_queue from a range.
* @since C++23
@@ -849,7 +849,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<_Tp> _Rg>
void
push_range(_Rg&& __rg)
@@ -924,7 +924,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
priority_queue(_Compare, _Container, _Allocator)
-> priority_queue<typename _Container::value_type, _Container, _Compare>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Compare = less<ranges::range_value_t<_Rg>>,
__allocator_like _Alloc = std::allocator<ranges::range_value_t<_Rg>>>
diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h
index 124237e..0799fd0 100644
--- a/libstdc++-v3/include/bits/stl_set.h
+++ b/libstdc++-v3/include/bits/stl_set.h
@@ -60,7 +60,7 @@
#if __cplusplus >= 201103L
#include <initializer_list>
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <bits/ranges_base.h> // ranges::begin, ranges::distance etc.
#endif
@@ -278,7 +278,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_t(_Key_alloc_type(__a))
{ _M_t._M_insert_range_unique(__first, __last); }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Builds a %set from a range.
* @since C++23
@@ -603,7 +603,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ this->insert(__l.begin(), __l.end()); }
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Inserts a range of elements.
* @since C++23
@@ -1014,7 +1014,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
set(initializer_list<_Key>, _Allocator)
-> set<_Key, less<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Compare = less<ranges::range_value_t<_Rg>>,
__allocator_like _Alloc = std::allocator<ranges::range_value_t<_Rg>>>
diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h
index 2a274bf..7b32464 100644
--- a/libstdc++-v3/include/bits/stl_stack.h
+++ b/libstdc++-v3/include/bits/stl_stack.h
@@ -61,7 +61,7 @@
#if __cplusplus >= 201103L
# include <bits/uses_allocator.h>
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <ranges> // ranges::to
# include <bits/ranges_algobase.h> // ranges::copy
#endif
@@ -181,7 +181,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: c(__first, __last) { }
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a stack from a range.
* @since C++23
@@ -300,7 +300,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<_Tp> _Rg>
void
push_range(_Rg&& __rg)
@@ -371,7 +371,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-> stack<_ValT, deque<_ValT, _Allocator>>;
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg>
stack(from_range_t, _Rg&&) -> stack<ranges::range_value_t<_Rg>>;
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 458adc9..aff9d5d 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -68,7 +68,7 @@
#if __glibcxx_concepts // C++ >= C++20
# include <bits/ranges_base.h> // ranges::distance
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <bits/ranges_algobase.h> // ranges::copy
# include <bits/ranges_util.h> // ranges::subrange
#endif
@@ -407,7 +407,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
}
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
// Called by insert_range, and indirectly by assign_range, append_range.
// Initializes new elements in storage at __ptr and updates __ptr to
// point after the last new element.
@@ -763,7 +763,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a vector from a range.
* @param __rg A range of values that are convertible to `bool`.
@@ -926,7 +926,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Assign a range to the vector.
* @param __rg A range of values that are convertible to `value_type`.
@@ -982,7 +982,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
}
}
-#endif // ranges_to_container
+#endif // containers_ranges
/// Get a copy of the memory allocation object.
using _Base::get_allocator;
@@ -1648,7 +1648,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Insert a range into the vector.
* @param __rg A range of values that are convertible to `value_type`.
@@ -1769,7 +1769,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
append_range(__r); // This will take the fast path above.
}
}
-#endif // ranges_to_container
+#endif // containers_ranges
/**
* @brief Remove element at given position.
@@ -2313,7 +2313,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
vector(_InputIterator, _InputIterator, _Allocator = _Allocator())
-> vector<_ValT, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
typename _Alloc = allocator<ranges::range_value_t<_Rg>>>
vector(from_range_t, _Rg&&, _Alloc = _Alloc())
diff --git a/libstdc++-v3/include/bits/unicode-data.h b/libstdc++-v3/include/bits/unicode-data.h
index fc0a4b3..0ab5ecb 100644
--- a/libstdc++-v3/include/bits/unicode-data.h
+++ b/libstdc++-v3/include/bits/unicode-data.h
@@ -33,7 +33,7 @@
# error "Version mismatch for Unicode static data"
#endif
- // Table generated by contrib/unicode/gen_std_format_width.py,
+ // Table generated by contrib/unicode/gen_libstdcxx_unicode_data.py,
// from EastAsianWidth.txt from the Unicode standard.
inline constexpr char32_t __width_edges[] = {
0x1100, 0x1160, 0x231a, 0x231c, 0x2329, 0x232b, 0x23e9, 0x23ed,
@@ -64,6 +64,258 @@
0x1faf0, 0x1faf9, 0x20000, 0x2fffe, 0x30000, 0x3fffe,
};
+ // Values generated by contrib/unicode/gen_libstdcxx_unicode_data.py,
+ // from DerivedGeneralCategory.txt from the Unicode standard.
+ // Entries are (code_point << 1) + escape.
+ inline constexpr uint32_t __escape_edges[] = {
+ 0x1, 0x42, 0xff, 0x142, 0x15b, 0x15c,
+ 0x6f1, 0x6f4, 0x701, 0x708, 0x717, 0x718,
+ 0x71b, 0x71c, 0x745, 0x746, 0xa61, 0xa62,
+ 0xaaf, 0xab2, 0xb17, 0xb1a, 0xb21, 0xb22,
+ 0xb91, 0xba0, 0xbd7, 0xbde, 0xbeb, 0xc0c,
+ 0xc39, 0xc3a, 0xdbb, 0xdbc, 0xe1d, 0xe20,
+ 0xe97, 0xe9a, 0xf65, 0xf80, 0xff7, 0xffa,
+ 0x105d, 0x1060, 0x107f, 0x1080, 0x10b9, 0x10bc,
+ 0x10bf, 0x10c0, 0x10d7, 0x10e0, 0x111f, 0x112e,
+ 0x11c5, 0x11c6, 0x1309, 0x130a, 0x131b, 0x131e,
+ 0x1323, 0x1326, 0x1353, 0x1354, 0x1363, 0x1364,
+ 0x1367, 0x136c, 0x1375, 0x1378, 0x138b, 0x138e,
+ 0x1393, 0x1396, 0x139f, 0x13ae, 0x13b1, 0x13b8,
+ 0x13bd, 0x13be, 0x13c9, 0x13cc, 0x13ff, 0x1402,
+ 0x1409, 0x140a, 0x1417, 0x141e, 0x1423, 0x1426,
+ 0x1453, 0x1454, 0x1463, 0x1464, 0x1469, 0x146a,
+ 0x146f, 0x1470, 0x1475, 0x1478, 0x147b, 0x147c,
+ 0x1487, 0x148e, 0x1493, 0x1496, 0x149d, 0x14a2,
+ 0x14a5, 0x14b2, 0x14bb, 0x14bc, 0x14bf, 0x14cc,
+ 0x14ef, 0x1502, 0x1509, 0x150a, 0x151d, 0x151e,
+ 0x1525, 0x1526, 0x1553, 0x1554, 0x1563, 0x1564,
+ 0x1569, 0x156a, 0x1575, 0x1578, 0x158d, 0x158e,
+ 0x1595, 0x1596, 0x159d, 0x15a0, 0x15a3, 0x15c0,
+ 0x15c9, 0x15cc, 0x15e5, 0x15f2, 0x1601, 0x1602,
+ 0x1609, 0x160a, 0x161b, 0x161e, 0x1623, 0x1626,
+ 0x1653, 0x1654, 0x1663, 0x1664, 0x1669, 0x166a,
+ 0x1675, 0x1678, 0x168b, 0x168e, 0x1693, 0x1696,
+ 0x169d, 0x16aa, 0x16b1, 0x16b8, 0x16bd, 0x16be,
+ 0x16c9, 0x16cc, 0x16f1, 0x1704, 0x1709, 0x170a,
+ 0x1717, 0x171c, 0x1723, 0x1724, 0x172d, 0x1732,
+ 0x1737, 0x1738, 0x173b, 0x173c, 0x1741, 0x1746,
+ 0x174b, 0x1750, 0x1757, 0x175c, 0x1775, 0x177c,
+ 0x1787, 0x178c, 0x1793, 0x1794, 0x179d, 0x17a0,
+ 0x17a3, 0x17ae, 0x17b1, 0x17cc, 0x17f7, 0x1800,
+ 0x181b, 0x181c, 0x1823, 0x1824, 0x1853, 0x1854,
+ 0x1875, 0x1878, 0x188b, 0x188c, 0x1893, 0x1894,
+ 0x189d, 0x18aa, 0x18af, 0x18b0, 0x18b7, 0x18ba,
+ 0x18bd, 0x18c0, 0x18c9, 0x18cc, 0x18e1, 0x18ee,
+ 0x191b, 0x191c, 0x1923, 0x1924, 0x1953, 0x1954,
+ 0x1969, 0x196a, 0x1975, 0x1978, 0x198b, 0x198c,
+ 0x1993, 0x1994, 0x199d, 0x19aa, 0x19af, 0x19ba,
+ 0x19bf, 0x19c0, 0x19c9, 0x19cc, 0x19e1, 0x19e2,
+ 0x19e9, 0x1a00, 0x1a1b, 0x1a1c, 0x1a23, 0x1a24,
+ 0x1a8b, 0x1a8c, 0x1a93, 0x1a94, 0x1aa1, 0x1aa8,
+ 0x1ac9, 0x1acc, 0x1b01, 0x1b02, 0x1b09, 0x1b0a,
+ 0x1b2f, 0x1b34, 0x1b65, 0x1b66, 0x1b79, 0x1b7a,
+ 0x1b7d, 0x1b80, 0x1b8f, 0x1b94, 0x1b97, 0x1b9e,
+ 0x1bab, 0x1bac, 0x1baf, 0x1bb0, 0x1bc1, 0x1bcc,
+ 0x1be1, 0x1be4, 0x1beb, 0x1c02, 0x1c77, 0x1c7e,
+ 0x1cb9, 0x1d02, 0x1d07, 0x1d08, 0x1d0b, 0x1d0c,
+ 0x1d17, 0x1d18, 0x1d49, 0x1d4a, 0x1d4d, 0x1d4e,
+ 0x1d7d, 0x1d80, 0x1d8b, 0x1d8c, 0x1d8f, 0x1d90,
+ 0x1d9f, 0x1da0, 0x1db5, 0x1db8, 0x1dc1, 0x1e00,
+ 0x1e91, 0x1e92, 0x1edb, 0x1ee2, 0x1f31, 0x1f32,
+ 0x1f7b, 0x1f7c, 0x1f9b, 0x1f9c, 0x1fb7, 0x2000,
+ 0x218d, 0x218e, 0x2191, 0x219a, 0x219d, 0x21a0,
+ 0x2493, 0x2494, 0x249d, 0x24a0, 0x24af, 0x24b0,
+ 0x24b3, 0x24b4, 0x24bd, 0x24c0, 0x2513, 0x2514,
+ 0x251d, 0x2520, 0x2563, 0x2564, 0x256d, 0x2570,
+ 0x257f, 0x2580, 0x2583, 0x2584, 0x258d, 0x2590,
+ 0x25af, 0x25b0, 0x2623, 0x2624, 0x262d, 0x2630,
+ 0x26b7, 0x26ba, 0x26fb, 0x2700, 0x2735, 0x2740,
+ 0x27ed, 0x27f0, 0x27fd, 0x2800, 0x2d01, 0x2d02,
+ 0x2d3b, 0x2d40, 0x2df3, 0x2e00, 0x2e2d, 0x2e3e,
+ 0x2e6f, 0x2e80, 0x2ea9, 0x2ec0, 0x2edb, 0x2edc,
+ 0x2ee3, 0x2ee4, 0x2ee9, 0x2f00, 0x2fbd, 0x2fc0,
+ 0x2fd5, 0x2fe0, 0x2ff5, 0x3000, 0x301d, 0x301e,
+ 0x3035, 0x3040, 0x30f3, 0x3100, 0x3157, 0x3160,
+ 0x31ed, 0x3200, 0x323f, 0x3240, 0x3259, 0x3260,
+ 0x3279, 0x3280, 0x3283, 0x3288, 0x32dd, 0x32e0,
+ 0x32eb, 0x3300, 0x3359, 0x3360, 0x3395, 0x33a0,
+ 0x33b7, 0x33bc, 0x3439, 0x343c, 0x34bf, 0x34c0,
+ 0x34fb, 0x34fe, 0x3515, 0x3520, 0x3535, 0x3540,
+ 0x355d, 0x3560, 0x359f, 0x3600, 0x369b, 0x369c,
+ 0x37e9, 0x37f8, 0x3871, 0x3876, 0x3895, 0x389a,
+ 0x3917, 0x3920, 0x3977, 0x397a, 0x3991, 0x39a0,
+ 0x39f7, 0x3a00, 0x3e2d, 0x3e30, 0x3e3d, 0x3e40,
+ 0x3e8d, 0x3e90, 0x3e9d, 0x3ea0, 0x3eb1, 0x3eb2,
+ 0x3eb5, 0x3eb6, 0x3eb9, 0x3eba, 0x3ebd, 0x3ebe,
+ 0x3efd, 0x3f00, 0x3f6b, 0x3f6c, 0x3f8b, 0x3f8c,
+ 0x3fa9, 0x3fac, 0x3fb9, 0x3fba, 0x3fe1, 0x3fe4,
+ 0x3feb, 0x3fec, 0x3fff, 0x4020, 0x4051, 0x4060,
+ 0x40bf, 0x40e0, 0x40e5, 0x40e8, 0x411f, 0x4120,
+ 0x413b, 0x4140, 0x4183, 0x41a0, 0x41e3, 0x4200,
+ 0x4319, 0x4320, 0x4855, 0x4880, 0x4897, 0x48c0,
+ 0x56e9, 0x56ec, 0x572d, 0x572e, 0x59e9, 0x59f2,
+ 0x5a4d, 0x5a4e, 0x5a51, 0x5a5a, 0x5a5d, 0x5a60,
+ 0x5ad1, 0x5ade, 0x5ae3, 0x5afe, 0x5b2f, 0x5b40,
+ 0x5b4f, 0x5b50, 0x5b5f, 0x5b60, 0x5b6f, 0x5b70,
+ 0x5b7f, 0x5b80, 0x5b8f, 0x5b90, 0x5b9f, 0x5ba0,
+ 0x5baf, 0x5bb0, 0x5bbf, 0x5bc0, 0x5cbd, 0x5d00,
+ 0x5d35, 0x5d36, 0x5de9, 0x5e00, 0x5fad, 0x5fe0,
+ 0x6001, 0x6002, 0x6081, 0x6082, 0x612f, 0x6132,
+ 0x6201, 0x620a, 0x6261, 0x6262, 0x631f, 0x6320,
+ 0x63cd, 0x63de, 0x643f, 0x6440, 0x1491b, 0x14920,
+ 0x1498f, 0x149a0, 0x14c59, 0x14c80, 0x14df1, 0x14e00,
+ 0x14f9d, 0x14fa0, 0x14fa5, 0x14fa6, 0x14fa9, 0x14faa,
+ 0x14fbb, 0x14fe4, 0x1505b, 0x15060, 0x15075, 0x15080,
+ 0x150f1, 0x15100, 0x1518d, 0x1519c, 0x151b5, 0x151c0,
+ 0x152a9, 0x152be, 0x152fb, 0x15300, 0x1539d, 0x1539e,
+ 0x153b5, 0x153bc, 0x153ff, 0x15400, 0x1546f, 0x15480,
+ 0x1549d, 0x154a0, 0x154b5, 0x154b8, 0x15587, 0x155b6,
+ 0x155ef, 0x15602, 0x1560f, 0x15612, 0x1561f, 0x15622,
+ 0x1562f, 0x15640, 0x1564f, 0x15650, 0x1565f, 0x15660,
+ 0x156d9, 0x156e0, 0x157dd, 0x157e0, 0x157f5, 0x15800,
+ 0x1af49, 0x1af60, 0x1af8f, 0x1af96, 0x1aff9, 0x1f200,
+ 0x1f4dd, 0x1f4e0, 0x1f5b5, 0x1f600, 0x1f60f, 0x1f626,
+ 0x1f631, 0x1f63a, 0x1f66f, 0x1f670, 0x1f67b, 0x1f67c,
+ 0x1f67f, 0x1f680, 0x1f685, 0x1f686, 0x1f68b, 0x1f68c,
+ 0x1f787, 0x1f7a6, 0x1fb21, 0x1fb24, 0x1fb91, 0x1fb9e,
+ 0x1fba1, 0x1fbe0, 0x1fc35, 0x1fc40, 0x1fca7, 0x1fca8,
+ 0x1fccf, 0x1fcd0, 0x1fcd9, 0x1fce0, 0x1fceb, 0x1fcec,
+ 0x1fdfb, 0x1fe02, 0x1ff7f, 0x1ff84, 0x1ff91, 0x1ff94,
+ 0x1ffa1, 0x1ffa4, 0x1ffb1, 0x1ffb4, 0x1ffbb, 0x1ffc0,
+ 0x1ffcf, 0x1ffd0, 0x1ffdf, 0x1fff8, 0x1fffd, 0x20000,
+ 0x20019, 0x2001a, 0x2004f, 0x20050, 0x20077, 0x20078,
+ 0x2007d, 0x2007e, 0x2009d, 0x200a0, 0x200bd, 0x20100,
+ 0x201f7, 0x20200, 0x20207, 0x2020e, 0x20269, 0x2026e,
+ 0x2031f, 0x20320, 0x2033b, 0x20340, 0x20343, 0x203a0,
+ 0x203fd, 0x20500, 0x2053b, 0x20540, 0x205a3, 0x205c0,
+ 0x205f9, 0x20600, 0x20649, 0x2065a, 0x20697, 0x206a0,
+ 0x206f7, 0x20700, 0x2073d, 0x2073e, 0x20789, 0x20790,
+ 0x207ad, 0x20800, 0x2093d, 0x20940, 0x20955, 0x20960,
+ 0x209a9, 0x209b0, 0x209f9, 0x20a00, 0x20a51, 0x20a60,
+ 0x20ac9, 0x20ade, 0x20af7, 0x20af8, 0x20b17, 0x20b18,
+ 0x20b27, 0x20b28, 0x20b2d, 0x20b2e, 0x20b45, 0x20b46,
+ 0x20b65, 0x20b66, 0x20b75, 0x20b76, 0x20b7b, 0x20b80,
+ 0x20be9, 0x20c00, 0x20e6f, 0x20e80, 0x20ead, 0x20ec0,
+ 0x20ed1, 0x20f00, 0x20f0d, 0x20f0e, 0x20f63, 0x20f64,
+ 0x20f77, 0x21000, 0x2100d, 0x21010, 0x21013, 0x21014,
+ 0x2106d, 0x2106e, 0x21073, 0x21078, 0x2107b, 0x2107e,
+ 0x210ad, 0x210ae, 0x2113f, 0x2114e, 0x21161, 0x211c0,
+ 0x211e7, 0x211e8, 0x211ed, 0x211f6, 0x21239, 0x2123e,
+ 0x21275, 0x2127e, 0x21281, 0x21300, 0x21371, 0x21378,
+ 0x213a1, 0x213a4, 0x21409, 0x2140a, 0x2140f, 0x21418,
+ 0x21429, 0x2142a, 0x21431, 0x21432, 0x2146d, 0x21470,
+ 0x21477, 0x2147e, 0x21493, 0x214a0, 0x214b3, 0x214c0,
+ 0x21541, 0x21580, 0x215cf, 0x215d6, 0x215ef, 0x21600,
+ 0x2166d, 0x21672, 0x216ad, 0x216b0, 0x216e7, 0x216f0,
+ 0x21725, 0x21732, 0x2173b, 0x21752, 0x21761, 0x21800,
+ 0x21893, 0x21900, 0x21967, 0x21980, 0x219e7, 0x219f4,
+ 0x21a51, 0x21a60, 0x21a75, 0x21a80, 0x21acd, 0x21ad2,
+ 0x21b0d, 0x21b1c, 0x21b21, 0x21cc0, 0x21cff, 0x21d00,
+ 0x21d55, 0x21d56, 0x21d5d, 0x21d60, 0x21d65, 0x21d84,
+ 0x21d8b, 0x21df8, 0x21e51, 0x21e60, 0x21eb5, 0x21ee0,
+ 0x21f15, 0x21f60, 0x21f99, 0x21fc0, 0x21fef, 0x22000,
+ 0x2209d, 0x220a4, 0x220ed, 0x220fe, 0x2217b, 0x2217c,
+ 0x22187, 0x221a0, 0x221d3, 0x221e0, 0x221f5, 0x22200,
+ 0x2226b, 0x2226c, 0x22291, 0x222a0, 0x222ef, 0x22300,
+ 0x223c1, 0x223c2, 0x223eb, 0x22400, 0x22425, 0x22426,
+ 0x22485, 0x22500, 0x2250f, 0x22510, 0x22513, 0x22514,
+ 0x2251d, 0x2251e, 0x2253d, 0x2253e, 0x22555, 0x22560,
+ 0x225d7, 0x225e0, 0x225f5, 0x22600, 0x22609, 0x2260a,
+ 0x2261b, 0x2261e, 0x22623, 0x22626, 0x22653, 0x22654,
+ 0x22663, 0x22664, 0x22669, 0x2266a, 0x22675, 0x22676,
+ 0x2268b, 0x2268e, 0x22693, 0x22696, 0x2269d, 0x226a0,
+ 0x226a3, 0x226ae, 0x226b1, 0x226ba, 0x226c9, 0x226cc,
+ 0x226db, 0x226e0, 0x226eb, 0x22700, 0x22715, 0x22716,
+ 0x22719, 0x2271c, 0x2271f, 0x22720, 0x2276d, 0x2276e,
+ 0x22783, 0x22784, 0x22787, 0x2278a, 0x2278d, 0x2278e,
+ 0x22797, 0x22798, 0x227ad, 0x227ae, 0x227b3, 0x227c2,
+ 0x227c7, 0x22800, 0x228b9, 0x228ba, 0x228c5, 0x22900,
+ 0x22991, 0x229a0, 0x229b5, 0x22b00, 0x22b6d, 0x22b70,
+ 0x22bbd, 0x22c00, 0x22c8b, 0x22ca0, 0x22cb5, 0x22cc0,
+ 0x22cdb, 0x22d00, 0x22d75, 0x22d80, 0x22d95, 0x22da0,
+ 0x22dc9, 0x22e00, 0x22e37, 0x22e3a, 0x22e59, 0x22e60,
+ 0x22e8f, 0x23000, 0x23079, 0x23140, 0x231e7, 0x231fe,
+ 0x2320f, 0x23212, 0x23215, 0x23218, 0x23229, 0x2322a,
+ 0x2322f, 0x23230, 0x2326d, 0x2326e, 0x23273, 0x23276,
+ 0x2328f, 0x232a0, 0x232b5, 0x23340, 0x23351, 0x23354,
+ 0x233b1, 0x233b4, 0x233cb, 0x23400, 0x23491, 0x234a0,
+ 0x23547, 0x23560, 0x235f3, 0x23600, 0x23615, 0x23780,
+ 0x237c5, 0x237e0, 0x237f5, 0x23800, 0x23813, 0x23814,
+ 0x2386f, 0x23870, 0x2388d, 0x238a0, 0x238db, 0x238e0,
+ 0x23921, 0x23924, 0x23951, 0x23952, 0x2396f, 0x23a00,
+ 0x23a0f, 0x23a10, 0x23a15, 0x23a16, 0x23a6f, 0x23a74,
+ 0x23a77, 0x23a78, 0x23a7d, 0x23a7e, 0x23a91, 0x23aa0,
+ 0x23ab5, 0x23ac0, 0x23acd, 0x23ace, 0x23ad3, 0x23ad4,
+ 0x23b1f, 0x23b20, 0x23b25, 0x23b26, 0x23b33, 0x23b40,
+ 0x23b55, 0x23dc0, 0x23df3, 0x23e00, 0x23e23, 0x23e24,
+ 0x23e77, 0x23e7c, 0x23eb7, 0x23f60, 0x23f63, 0x23f80,
+ 0x23fe5, 0x23ffe, 0x24735, 0x24800, 0x248df, 0x248e0,
+ 0x248eb, 0x24900, 0x24a89, 0x25f20, 0x25fe7, 0x26000,
+ 0x26861, 0x26880, 0x268ad, 0x268c0, 0x287f7, 0x28800,
+ 0x28c8f, 0x2c200, 0x2c275, 0x2d000, 0x2d473, 0x2d480,
+ 0x2d4bf, 0x2d4c0, 0x2d4d5, 0x2d4dc, 0x2d57f, 0x2d580,
+ 0x2d595, 0x2d5a0, 0x2d5dd, 0x2d5e0, 0x2d5ed, 0x2d600,
+ 0x2d68d, 0x2d6a0, 0x2d6b5, 0x2d6b6, 0x2d6c5, 0x2d6c6,
+ 0x2d6f1, 0x2d6fa, 0x2d721, 0x2da80, 0x2daf5, 0x2dc80,
+ 0x2dd37, 0x2de00, 0x2de97, 0x2de9e, 0x2df11, 0x2df1e,
+ 0x2df41, 0x2dfc0, 0x2dfcb, 0x2dfe0, 0x2dfe5, 0x2e000,
+ 0x30ff1, 0x31000, 0x319ad, 0x319fe, 0x31a13, 0x35fe0,
+ 0x35fe9, 0x35fea, 0x35ff9, 0x35ffa, 0x35fff, 0x36000,
+ 0x36247, 0x36264, 0x36267, 0x362a0, 0x362a7, 0x362aa,
+ 0x362ad, 0x362c8, 0x362d1, 0x362e0, 0x365f9, 0x37800,
+ 0x378d7, 0x378e0, 0x378fb, 0x37900, 0x37913, 0x37920,
+ 0x37935, 0x37938, 0x37941, 0x39800, 0x399f5, 0x39a00,
+ 0x39d69, 0x39e00, 0x39e5d, 0x39e60, 0x39e8f, 0x39ea0,
+ 0x39f89, 0x3a000, 0x3a1ed, 0x3a200, 0x3a24f, 0x3a252,
+ 0x3a2e7, 0x3a2f6, 0x3a3d7, 0x3a400, 0x3a48d, 0x3a580,
+ 0x3a5a9, 0x3a5c0, 0x3a5e9, 0x3a600, 0x3a6af, 0x3a6c0,
+ 0x3a6f3, 0x3a800, 0x3a8ab, 0x3a8ac, 0x3a93b, 0x3a93c,
+ 0x3a941, 0x3a944, 0x3a947, 0x3a94a, 0x3a94f, 0x3a952,
+ 0x3a95b, 0x3a95c, 0x3a975, 0x3a976, 0x3a979, 0x3a97a,
+ 0x3a989, 0x3a98a, 0x3aa0d, 0x3aa0e, 0x3aa17, 0x3aa1a,
+ 0x3aa2b, 0x3aa2c, 0x3aa3b, 0x3aa3c, 0x3aa75, 0x3aa76,
+ 0x3aa7f, 0x3aa80, 0x3aa8b, 0x3aa8c, 0x3aa8f, 0x3aa94,
+ 0x3aaa3, 0x3aaa4, 0x3ad4d, 0x3ad50, 0x3af99, 0x3af9c,
+ 0x3b519, 0x3b536, 0x3b541, 0x3b542, 0x3b561, 0x3be00,
+ 0x3be3f, 0x3be4a, 0x3be57, 0x3c000, 0x3c00f, 0x3c010,
+ 0x3c033, 0x3c036, 0x3c045, 0x3c046, 0x3c04b, 0x3c04c,
+ 0x3c057, 0x3c060, 0x3c0dd, 0x3c11e, 0x3c121, 0x3c200,
+ 0x3c25b, 0x3c260, 0x3c27d, 0x3c280, 0x3c295, 0x3c29c,
+ 0x3c2a1, 0x3c520, 0x3c55f, 0x3c580, 0x3c5f5, 0x3c5fe,
+ 0x3c601, 0x3c9a0, 0x3c9f5, 0x3cba0, 0x3cbf7, 0x3cbfe,
+ 0x3cc01, 0x3cfc0, 0x3cfcf, 0x3cfd0, 0x3cfd9, 0x3cfda,
+ 0x3cfdf, 0x3cfe0, 0x3cfff, 0x3d000, 0x3d18b, 0x3d18e,
+ 0x3d1af, 0x3d200, 0x3d299, 0x3d2a0, 0x3d2b5, 0x3d2bc,
+ 0x3d2c1, 0x3d8e2, 0x3d96b, 0x3da02, 0x3da7d, 0x3dc00,
+ 0x3dc09, 0x3dc0a, 0x3dc41, 0x3dc42, 0x3dc47, 0x3dc48,
+ 0x3dc4b, 0x3dc4e, 0x3dc51, 0x3dc52, 0x3dc67, 0x3dc68,
+ 0x3dc71, 0x3dc72, 0x3dc75, 0x3dc76, 0x3dc79, 0x3dc84,
+ 0x3dc87, 0x3dc8e, 0x3dc91, 0x3dc92, 0x3dc95, 0x3dc96,
+ 0x3dc99, 0x3dc9a, 0x3dca1, 0x3dca2, 0x3dca7, 0x3dca8,
+ 0x3dcab, 0x3dcae, 0x3dcb1, 0x3dcb2, 0x3dcb5, 0x3dcb6,
+ 0x3dcb9, 0x3dcba, 0x3dcbd, 0x3dcbe, 0x3dcc1, 0x3dcc2,
+ 0x3dcc7, 0x3dcc8, 0x3dccb, 0x3dcce, 0x3dcd7, 0x3dcd8,
+ 0x3dce7, 0x3dce8, 0x3dcf1, 0x3dcf2, 0x3dcfb, 0x3dcfc,
+ 0x3dcff, 0x3dd00, 0x3dd15, 0x3dd16, 0x3dd39, 0x3dd42,
+ 0x3dd49, 0x3dd4a, 0x3dd55, 0x3dd56, 0x3dd79, 0x3dde0,
+ 0x3dde5, 0x3e000, 0x3e059, 0x3e060, 0x3e129, 0x3e140,
+ 0x3e15f, 0x3e162, 0x3e181, 0x3e182, 0x3e1a1, 0x3e1a2,
+ 0x3e1ed, 0x3e200, 0x3e35d, 0x3e3cc, 0x3e407, 0x3e420,
+ 0x3e479, 0x3e480, 0x3e493, 0x3e4a0, 0x3e4a5, 0x3e4c0,
+ 0x3e4cd, 0x3e600, 0x3edb1, 0x3edb8, 0x3eddb, 0x3ede0,
+ 0x3edfb, 0x3ee00, 0x3eeef, 0x3eef6, 0x3efb5, 0x3efc0,
+ 0x3efd9, 0x3efe0, 0x3efe3, 0x3f000, 0x3f019, 0x3f020,
+ 0x3f091, 0x3f0a0, 0x3f0b5, 0x3f0c0, 0x3f111, 0x3f120,
+ 0x3f15d, 0x3f160, 0x3f179, 0x3f180, 0x3f185, 0x3f200,
+ 0x3f4a9, 0x3f4c0, 0x3f4dd, 0x3f4e0, 0x3f4fb, 0x3f500,
+ 0x3f515, 0x3f51e, 0x3f58f, 0x3f59c, 0x3f5bb, 0x3f5be,
+ 0x3f5d5, 0x3f5e0, 0x3f5f3, 0x3f600, 0x3f727, 0x3f728,
+ 0x3f7f5, 0x40000, 0x54dc1, 0x54e00, 0x56e75, 0x56e80,
+ 0x5703d, 0x57040, 0x59d45, 0x59d60, 0x5d7c3, 0x5d7e0,
+ 0x5dcbd, 0x5f000, 0x5f43d, 0x60000, 0x62697, 0x626a0,
+ 0x64761, 0x1c0200, 0x1c03e1,
+ };
+
enum class _Gcb_property {
_Gcb_Other = 0,
_Gcb_Control = 1,
@@ -81,7 +333,7 @@
_Gcb_Regional_Indicator = 13,
};
- // Values generated by contrib/unicode/gen_std_format_width.py,
+ // Values generated by contrib/unicode/gen_libstdcxx_unicode_data.py,
// from GraphemeBreakProperty.txt from the Unicode standard.
// Entries are (code_point << shift_bits) + property.
inline constexpr int __gcb_shift_bits = 0x4;
@@ -381,7 +633,7 @@
enum class _InCB { _Consonant = 1, _Extend = 2 };
- // Values generated by contrib/unicode/gen_std_format_width.py,
+ // Values generated by contrib/unicode/gen_libstdcxx_unicode_data.py,
// from DerivedCoreProperties.txt from the Unicode standard.
// Entries are (code_point << 2) + property.
inline constexpr uint32_t __incb_edges[] = {
@@ -519,7 +771,7 @@
0x380082, 0x380200, 0x380402, 0x3807c0,
};
- // Table generated by contrib/unicode/gen_std_format_width.py,
+ // Table generated by contrib/unicode/gen_libstdcxx_unicode_data.py,
// from emoji-data.txt from the Unicode standard.
inline constexpr char32_t __xpicto_edges[] = {
0xa9, 0xaa, 0xae, 0xaf, 0x203c, 0x203d, 0x2049, 0x204a,
diff --git a/libstdc++-v3/include/bits/unicode.h b/libstdc++-v3/include/bits/unicode.h
index 99d972e..f1b6bf4 100644
--- a/libstdc++-v3/include/bits/unicode.h
+++ b/libstdc++-v3/include/bits/unicode.h
@@ -151,6 +151,11 @@ namespace __unicode
{ return _M_curr(); }
[[nodiscard]]
+ constexpr iter_difference_t<_Iter>
+ _M_units() const requires forward_iterator<_Iter>
+ { return _M_to_increment; }
+
+ [[nodiscard]]
constexpr value_type
operator*() const { return _M_buf[_M_buf_index]; }
@@ -610,6 +615,18 @@ inline namespace __v16_0_0
}
// @pre c <= 0x10FFFF
+ constexpr bool
+ __should_escape_category(char32_t __c) noexcept
+ {
+ constexpr uint32_t __mask = 0x01;
+ auto* __end = std::end(__escape_edges);
+ auto* __p = std::lower_bound(__escape_edges, __end,
+ (__c << 1u) + 2);
+ return __p[-1] & __mask;
+ }
+
+
+ // @pre c <= 0x10FFFF
constexpr _Gcb_property
__grapheme_cluster_break_property(char32_t __c) noexcept
{
diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h
index 49e97e2..5bc58e8 100644
--- a/libstdc++-v3/include/bits/unordered_map.h
+++ b/libstdc++-v3/include/bits/unordered_map.h
@@ -34,7 +34,7 @@
#include <bits/allocator.h>
#include <bits/functional_hash.h> // hash
#include <bits/stl_function.h> // equal_to
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <bits/ranges_base.h> // ranges::begin, ranges::distance etc.
#endif
@@ -277,7 +277,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: unordered_map(__l, __n, __hf, key_equal(), __a)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Builds an %unordered_map from a range.
* @since C++23
@@ -681,7 +681,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
insert(initializer_list<value_type> __l)
{ _M_h.insert(__l); }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Inserts a range of elements.
* @since C++23
@@ -1291,7 +1291,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_Hash, _Allocator)
-> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Hash = hash<__detail::__range_key_type<_Rg>>,
__not_allocator_like _Pred = equal_to<__detail::__range_key_type<_Rg>>,
@@ -1530,7 +1530,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: unordered_multimap(__l, __n, __hf, key_equal(), __a)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Builds an %unordered_multimap from a range.
* @since C++23
@@ -1802,7 +1802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
insert(initializer_list<value_type> __l)
{ _M_h.insert(__l); }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Inserts a range of elements.
* @since C++23
@@ -2311,7 +2311,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_Hash, _Allocator)
-> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Hash = hash<__detail::__range_key_type<_Rg>>,
__not_allocator_like _Pred = equal_to<__detail::__range_key_type<_Rg>>,
diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h
index 4bc256c..091bae6 100644
--- a/libstdc++-v3/include/bits/unordered_set.h
+++ b/libstdc++-v3/include/bits/unordered_set.h
@@ -34,7 +34,7 @@
#include <bits/allocator.h>
#include <bits/functional_hash.h> // hash
#include <bits/stl_function.h> // equal_to
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
# include <bits/ranges_base.h> // ranges::begin, ranges::distance etc.
#endif
@@ -271,7 +271,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: unordered_set(__l, __n, __hf, key_equal(), __a)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Builds an %unordered_set from a range.
* @since C++23
@@ -533,7 +533,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
insert(initializer_list<value_type> __l)
{ _M_h.insert(__l); }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Inserts a range of elements.
* @since C++23
@@ -1013,7 +1013,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
unordered_set<int>::size_type, _Hash, _Allocator)
-> unordered_set<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Hash = hash<ranges::range_value_t<_Rg>>,
__not_allocator_like _Pred = equal_to<ranges::range_value_t<_Rg>>,
@@ -1249,7 +1249,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: unordered_multiset(__l, __n, __hf, key_equal(), __a)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Builds an %unordered_multiset from a range.
* @since C++23
@@ -1483,7 +1483,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
insert(initializer_list<value_type> __l)
{ _M_h.insert(__l); }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Inserts a range of elements.
* @since C++23
@@ -1977,7 +1977,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
unordered_multiset<int>::size_type, _Hash, _Allocator)
-> unordered_multiset<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Hash = hash<ranges::range_value_t<_Rg>>,
__not_allocator_like _Pred = equal_to<ranges::range_value_t<_Rg>>,
diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc
index 66d73b4..b21e1d3 100644
--- a/libstdc++-v3/include/bits/vector.tcc
+++ b/libstdc++-v3/include/bits/vector.tcc
@@ -977,7 +977,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
}
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<typename _Tp, typename _Alloc>
template<__detail::__container_compatible_range<_Tp> _Rg>
constexpr auto
@@ -1100,7 +1100,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
return insert_range(__pos, vector(from_range, std::forward<_Rg>(__rg),
_M_get_Tp_allocator()));
}
-#endif // ranges_to_container
+#endif // containers_ranges
// vector<bool>
template<typename _Alloc>
diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def
index 8f609b4..0afaf0d 100644
--- a/libstdc++-v3/include/bits/version.def
+++ b/libstdc++-v3/include/bits/version.def
@@ -1273,7 +1273,12 @@ ftms = {
ftms = {
name = constrained_equality;
values = {
- v = 202411; // FIXME: 202403 for P2944R3, ??? for P3379R0
+ v = 202411;
+ cxxmin = 23;
+ extra_cond = "__glibcxx_three_way_comparison";
+ };
+ values = {
+ v = 202403;
cxxmin = 20;
extra_cond = "__glibcxx_three_way_comparison";
};
@@ -1510,14 +1515,14 @@ ftms = {
};
};
-//ftms = {
-// name = containers_ranges;
-// values = {
-// v = 202202;
-// cxxmin = 23;
-// hosted = yes;
-// };
-//};
+ftms = {
+ name = containers_ranges;
+ values = {
+ v = 202202;
+ cxxmin = 23;
+ hosted = yes;
+ };
+};
ftms = {
name = ranges_to_container;
diff --git a/libstdc++-v3/include/bits/version.h b/libstdc++-v3/include/bits/version.h
index f05c3fd..980fee6 100644
--- a/libstdc++-v3/include/bits/version.h
+++ b/libstdc++-v3/include/bits/version.h
@@ -1406,11 +1406,16 @@
#undef __glibcxx_want_constexpr_vector
#if !defined(__cpp_lib_constrained_equality)
-# if (__cplusplus >= 202002L) && (__glibcxx_three_way_comparison)
+# if (__cplusplus >= 202100L) && (__glibcxx_three_way_comparison)
# define __glibcxx_constrained_equality 202411L
# if defined(__glibcxx_want_all) || defined(__glibcxx_want_constrained_equality)
# define __cpp_lib_constrained_equality 202411L
# endif
+# elif (__cplusplus >= 202002L) && (__glibcxx_three_way_comparison)
+# define __glibcxx_constrained_equality 202403L
+# if defined(__glibcxx_want_all) || defined(__glibcxx_want_constrained_equality)
+# define __cpp_lib_constrained_equality 202403L
+# endif
# endif
#endif /* !defined(__cpp_lib_constrained_equality) && defined(__glibcxx_want_constrained_equality) */
#undef __glibcxx_want_constrained_equality
@@ -1664,6 +1669,16 @@
#endif /* !defined(__cpp_lib_reference_from_temporary) && defined(__glibcxx_want_reference_from_temporary) */
#undef __glibcxx_want_reference_from_temporary
+#if !defined(__cpp_lib_containers_ranges)
+# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED
+# define __glibcxx_containers_ranges 202202L
+# if defined(__glibcxx_want_all) || defined(__glibcxx_want_containers_ranges)
+# define __cpp_lib_containers_ranges 202202L
+# endif
+# endif
+#endif /* !defined(__cpp_lib_containers_ranges) && defined(__glibcxx_want_containers_ranges) */
+#undef __glibcxx_want_containers_ranges
+
#if !defined(__cpp_lib_ranges_to_container)
# if (__cplusplus >= 202100L) && _GLIBCXX_HOSTED
# define __glibcxx_ranges_to_container 202202L
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque
index 9715721..59d60b2 100644
--- a/libstdc++-v3/include/debug/deque
+++ b/libstdc++-v3/include/debug/deque
@@ -155,7 +155,7 @@ namespace __debug
__gnu_debug::__base(__last), __a)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<_Tp> _Rg>
deque(from_range_t, _Rg&& __rg, const _Allocator& __a = _Allocator())
: _Base(from_range, std::forward<_Rg>(__rg), __a)
@@ -217,7 +217,7 @@ namespace __debug
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<std::__detail::__container_compatible_range<_Tp> _Rg>
void
assign_range(_Rg&& __rg)
@@ -561,7 +561,7 @@ namespace __debug
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<_Tp> _Rg>
iterator
insert_range(const_iterator __pos, _Rg&& __rg)
@@ -712,7 +712,7 @@ namespace __debug
deque(size_t, _Tp, _Allocator = _Allocator())
-> deque<_Tp, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
typename _Alloc = allocator<ranges::range_value_t<_Rg>>>
deque(from_range_t, _Rg&&, _Alloc = _Alloc())
diff --git a/libstdc++-v3/include/debug/forward_list b/libstdc++-v3/include/debug/forward_list
index 00b96d6..60a2542 100644
--- a/libstdc++-v3/include/debug/forward_list
+++ b/libstdc++-v3/include/debug/forward_list
@@ -267,7 +267,7 @@ namespace __debug
__gnu_debug::__base(__last), __al)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<_Tp> _Rg>
forward_list(from_range_t, _Rg&& __rg, const _Alloc& __a = _Alloc())
: _Base(std::from_range, std::forward<_Rg>(__rg), __a)
@@ -318,7 +318,7 @@ namespace __debug
this->_M_invalidate_all();
}
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<_Tp> _Rg>
void
assign_range(_Rg&& __rg)
@@ -440,7 +440,7 @@ namespace __debug
using _Base::emplace_front;
using _Base::push_front;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
using _Base::prepend_range;
#endif
@@ -512,7 +512,7 @@ namespace __debug
return { _Base::insert_after(__pos.base(), __il), this };
}
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<_Tp> _Rg>
iterator
insert_range_after(const_iterator __position, _Rg&& __rg)
@@ -917,7 +917,7 @@ namespace __debug
forward_list(size_t, _Tp, _Allocator = _Allocator())
-> forward_list<_Tp, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
typename _Allocator = allocator<ranges::range_value_t<_Rg>>>
forward_list(from_range_t, _Rg&&, _Allocator = _Allocator())
diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list
index 344fc98..a9d974c 100644
--- a/libstdc++-v3/include/debug/list
+++ b/libstdc++-v3/include/debug/list
@@ -160,7 +160,7 @@ namespace __debug
__gnu_debug::__base(__last), __a)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<_Tp> _Rg>
list(from_range_t, _Rg&& __rg, const _Allocator& __a = _Allocator())
: _Base(std::from_range, std::forward<_Rg>(__rg), __a)
@@ -214,7 +214,7 @@ namespace __debug
this->_M_invalidate_all();
}
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<_Tp> _Rg>
void
assign_range(_Rg&& __rg)
@@ -434,7 +434,7 @@ namespace __debug
using _Base::emplace_front;
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
using _Base::prepend_range;
using _Base::append_range;
#endif
@@ -549,7 +549,7 @@ namespace __debug
}
#endif
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<_Tp> _Rg>
iterator
insert_range(const_iterator __position, _Rg&& __rg)
@@ -970,7 +970,7 @@ namespace __debug
list(size_t, _Tp, _Allocator = _Allocator())
-> list<_Tp, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
typename _Allocator = allocator<ranges::range_value_t<_Rg>>>
list(from_range_t, _Rg&&, _Allocator = _Allocator())
diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h
index aa1c1db..985a7ac 100644
--- a/libstdc++-v3/include/debug/map.h
+++ b/libstdc++-v3/include/debug/map.h
@@ -133,7 +133,7 @@ namespace __debug
__gnu_debug::__base(__last), __a)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a map from a range.
* @since C++23
@@ -759,7 +759,7 @@ namespace __debug
map(initializer_list<pair<_Key, _Tp>>, _Allocator)
-> map<_Key, _Tp, less<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Compare = less<__detail::__range_key_type<_Rg>>,
__allocator_like _Alloc =
diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h
index bef1f17..c187e51 100644
--- a/libstdc++-v3/include/debug/multimap.h
+++ b/libstdc++-v3/include/debug/multimap.h
@@ -133,7 +133,7 @@ namespace __debug
__glibcxx_check_valid_constructor_range(__first, __last)),
__gnu_debug::__base(__last), __a) { }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a multimap from a range.
* @since C++23
@@ -641,7 +641,7 @@ namespace __debug
multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
-> multimap<_Key, _Tp, less<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Compare = less<__detail::__range_key_type<_Rg>>,
__allocator_like _Alloc =
diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h
index bddcd28..41bf78d 100644
--- a/libstdc++-v3/include/debug/multiset.h
+++ b/libstdc++-v3/include/debug/multiset.h
@@ -133,7 +133,7 @@ namespace __debug
__glibcxx_check_valid_constructor_range(__first, __last)),
__gnu_debug::__base(__last), __a) { }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a multiset from a range.
* @since C++23
@@ -613,7 +613,7 @@ namespace __debug
multiset(initializer_list<_Key>, _Allocator)
-> multiset<_Key, less<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Compare = less<ranges::range_value_t<_Rg>>,
__allocator_like _Alloc = std::allocator<ranges::range_value_t<_Rg>>>
diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h
index 9555555..6ec8338 100644
--- a/libstdc++-v3/include/debug/set.h
+++ b/libstdc++-v3/include/debug/set.h
@@ -131,7 +131,7 @@ namespace __debug
__glibcxx_check_valid_constructor_range(__first, __last)),
__gnu_debug::__base(__last), __a) { }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a set from a range.
* @since C++23
@@ -623,7 +623,7 @@ namespace __debug
set(initializer_list<_Key>, _Allocator)
-> set<_Key, less<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Compare = less<ranges::range_value_t<_Rg>>,
__allocator_like _Alloc = std::allocator<ranges::range_value_t<_Rg>>>
diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map
index 16d4a4a..448f681 100644
--- a/libstdc++-v3/include/debug/unordered_map
+++ b/libstdc++-v3/include/debug/unordered_map
@@ -201,7 +201,7 @@ namespace __debug
: unordered_map(__l, __n, __hf, key_equal(), __a)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<value_type> _Rg>
unordered_map(from_range_t, _Rg&& __rg,
size_type __n = 0,
@@ -869,7 +869,7 @@ namespace __debug
_Hash, _Allocator)
-> unordered_map<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Hash = hash<__detail::__range_key_type<_Rg>>,
__not_allocator_like _Pred = equal_to<__detail::__range_key_type<_Rg>>,
@@ -1077,7 +1077,7 @@ namespace __debug
: unordered_multimap(__l, __n, __hf, key_equal(), __a)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<value_type> _Rg>
unordered_multimap(from_range_t, _Rg&& __rg,
size_type __n = 0,
@@ -1655,7 +1655,7 @@ namespace __debug
_Hash, _Allocator)
-> unordered_multimap<_Key, _Tp, _Hash, equal_to<_Key>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Hash = hash<__detail::__range_key_type<_Rg>>,
__not_allocator_like _Pred = equal_to<__detail::__range_key_type<_Rg>>,
diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set
index 2e342cc..4255f6e 100644
--- a/libstdc++-v3/include/debug/unordered_set
+++ b/libstdc++-v3/include/debug/unordered_set
@@ -194,7 +194,7 @@ namespace __debug
: unordered_set(__l, __n, __hf, key_equal(), __a)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<value_type> _Rg>
unordered_set(from_range_t, _Rg&& __rg,
size_type __n = 0,
@@ -902,7 +902,7 @@ namespace __debug
: unordered_multiset(__l, __n, __hf, key_equal(), __a)
{ }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<__detail::__container_compatible_range<value_type> _Rg>
unordered_multiset(from_range_t, _Rg&& __rg,
size_type __n = 0,
@@ -1444,7 +1444,7 @@ namespace __debug
unordered_multiset<int>::size_type, _Hash, _Allocator)
-> unordered_multiset<_Tp, _Hash, equal_to<_Tp>, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Hash = hash<ranges::range_value_t<_Rg>>,
__not_allocator_like _Pred = equal_to<ranges::range_value_t<_Rg>>,
@@ -1479,7 +1479,7 @@ namespace __debug
equal_to<ranges::range_value_t<_Rg>>,
_Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
__not_allocator_like _Hash = hash<ranges::range_value_t<_Rg>>,
__not_allocator_like _Pred = equal_to<ranges::range_value_t<_Rg>>,
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector
index b49766c..1b3486b 100644
--- a/libstdc++-v3/include/debug/vector
+++ b/libstdc++-v3/include/debug/vector
@@ -244,7 +244,7 @@ namespace __debug
const allocator_type& __a = allocator_type())
: _Base(__l, __a) { }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
/**
* @brief Construct a vector from a range.
* @since C++23
@@ -871,7 +871,7 @@ namespace __debug
const _Base&
_M_base() const _GLIBCXX_NOEXCEPT { return *this; }
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<std::__detail::__container_compatible_range<_Tp> _Rg>
constexpr void
assign_range(_Rg&& __rg)
@@ -999,7 +999,7 @@ namespace __debug
vector(size_t, _Tp, _Allocator = _Allocator())
-> vector<_Tp, _Allocator>;
-#if __glibcxx_ranges_to_container // C++ >= 23
+#if __glibcxx_containers_ranges // C++ >= 23
template<ranges::input_range _Rg,
typename _Alloc = allocator<ranges::range_value_t<_Rg>>>
vector(from_range_t, _Rg&&, _Alloc = _Alloc())
diff --git a/libstdc++-v3/include/std/deque b/libstdc++-v3/include/std/deque
index 8fd7300..2badab8 100644
--- a/libstdc++-v3/include/std/deque
+++ b/libstdc++-v3/include/std/deque
@@ -72,6 +72,7 @@
#define __glibcxx_want_algorithm_default_value_type
#define __glibcxx_want_allocator_traits_is_always_equal
+#define __glibcxx_want_containers_ranges
#define __glibcxx_want_erase_if
#define __glibcxx_want_nonmember_container_access
#include <bits/version.h>
diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format
index 2e9319c..e557e10 100644
--- a/libstdc++-v3/include/std/format
+++ b/libstdc++-v3/include/std/format
@@ -80,8 +80,39 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// @cond undocumented
namespace __format
{
- // Type-erased character sink.
+ // STATICALLY-WIDEN, see C++20 [time.general]
+ // It doesn't matter for format strings (which can only be char or wchar_t)
+ // but this returns the narrow string for anything that isn't wchar_t. This
+ // is done because const char* can be inserted into any ostream type, and
+ // will be widened at runtime if necessary.
+ template<typename _CharT>
+ consteval auto
+ _Widen(const char* __narrow, const wchar_t* __wide)
+ {
+ if constexpr (is_same_v<_CharT, wchar_t>)
+ return __wide;
+ else
+ return __narrow;
+ }
+#define _GLIBCXX_WIDEN_(C, S) ::std::__format::_Widen<C>(S, L##S)
+#define _GLIBCXX_WIDEN(S) _GLIBCXX_WIDEN_(_CharT, S)
+
+ // Size for stack located buffer
+ template<typename _CharT>
+ constexpr size_t __stackbuf_size = 32 * sizeof(void*) / sizeof(_CharT);
+
+ // Type-erased character sinks.
template<typename _CharT> class _Sink;
+ template<typename _CharT> class _Fixedbuf_sink;
+ template<typename _Seq> class _Seq_sink;
+
+ template<typename _CharT, typename _Alloc = allocator<_CharT>>
+ using _Str_sink
+ = _Seq_sink<basic_string<_CharT, char_traits<_CharT>, _Alloc>>;
+
+ // template<typename _CharT, typename _Alloc = allocator<_CharT>>
+ // using _Vec_sink = _Seq_sink<vector<_CharT, _Alloc>>;
+
// Output iterator that writes to a type-erase character sink.
template<typename _CharT>
class _Sink_iter;
@@ -448,9 +479,10 @@ namespace __format
_Pres_d = 1, _Pres_b, _Pres_B, _Pres_o, _Pres_x, _Pres_X, _Pres_c,
// Presentation types for floating-point types.
_Pres_a = 1, _Pres_A, _Pres_e, _Pres_E, _Pres_f, _Pres_F, _Pres_g, _Pres_G,
- _Pres_p = 0, _Pres_P, // For pointers.
- _Pres_s = 0, // For strings and bool.
- _Pres_esc = 0xf, // For strings and charT.
+ _Pres_p = 0, _Pres_P, // For pointers.
+ _Pres_s = 0, // For strings, bool
+ _Pres_seq = 0, _Pres_str, // For ranges
+ _Pres_esc = 0xf, // For strings, charT and ranges
};
enum _Align {
@@ -517,42 +549,48 @@ namespace __format
// pre: __first != __last
constexpr iterator
_M_parse_fill_and_align(iterator __first, iterator __last) noexcept
+ { return _M_parse_fill_and_align(__first, __last, "{"); }
+
+ // pre: __first != __last
+ constexpr iterator
+ _M_parse_fill_and_align(iterator __first, iterator __last, string_view __not_fill) noexcept
{
- if (*__first != '{')
+ for (char __c : __not_fill)
+ if (*__first == static_cast<_CharT>(__c))
+ return __first;
+
+ using namespace __unicode;
+ if constexpr (__literal_encoding_is_unicode<_CharT>())
{
- using namespace __unicode;
- if constexpr (__literal_encoding_is_unicode<_CharT>())
- {
- // Accept any UCS scalar value as fill character.
- _Utf32_view<ranges::subrange<iterator>> __uv({__first, __last});
- if (!__uv.empty())
- {
- auto __beg = __uv.begin();
- char32_t __c = *__beg++;
- if (__is_scalar_value(__c))
- if (auto __next = __beg.base(); __next != __last)
- if (_Align __align = _S_align(*__next))
- {
- _M_fill = __c;
- _M_align = __align;
- return ++__next;
- }
- }
- }
- else if (__last - __first >= 2)
- if (_Align __align = _S_align(__first[1]))
- {
- _M_fill = *__first;
- _M_align = __align;
- return __first + 2;
- }
+ // Accept any UCS scalar value as fill character.
+ _Utf32_view<ranges::subrange<iterator>> __uv({__first, __last});
+ if (!__uv.empty())
+ {
+ auto __beg = __uv.begin();
+ char32_t __c = *__beg++;
+ if (__is_scalar_value(__c))
+ if (auto __next = __beg.base(); __next != __last)
+ if (_Align __align = _S_align(*__next))
+ {
+ _M_fill = __c;
+ _M_align = __align;
+ return ++__next;
+ }
+ }
+ }
+ else if (__last - __first >= 2)
+ if (_Align __align = _S_align(__first[1]))
+ {
+ _M_fill = *__first;
+ _M_align = __align;
+ return __first + 2;
+ }
- if (_Align __align = _S_align(__first[0]))
- {
- _M_fill = ' ';
- _M_align = __align;
- return __first + 1;
- }
+ if (_Align __align = _S_align(__first[0]))
+ {
+ _M_fill = ' ';
+ _M_align = __align;
+ return __first + 1;
}
return __first;
}
@@ -848,6 +886,302 @@ namespace __format
__spec._M_fill);
}
+ // Values are indices into _Escapes::all.
+ enum class _Term_char : unsigned char {
+ _Tc_quote = 12,
+ _Tc_apos = 15
+ };
+
+ template<typename _CharT>
+ struct _Escapes
+ {
+ using _Str_view = basic_string_view<_CharT>;
+
+ static consteval
+ _Str_view _S_all()
+ { return _GLIBCXX_WIDEN("\t\\t\n\\n\r\\r\\\\\\\"\\\"'\\'\\u\\x"); }
+
+ static constexpr
+ _CharT _S_term(_Term_char __term)
+ { return _S_all()[static_cast<unsigned char>(__term)]; }
+
+ static consteval
+ _Str_view _S_tab()
+ { return _S_all().substr(0, 3); }
+
+ static consteval
+ _Str_view _S_newline()
+ { return _S_all().substr(3, 3); }
+
+ static consteval
+ _Str_view _S_return()
+ { return _S_all().substr(6, 3); }
+
+ static consteval
+ _Str_view _S_bslash()
+ { return _S_all().substr(9, 3); }
+
+ static consteval
+ _Str_view _S_quote()
+ { return _S_all().substr(12, 3); }
+
+ static consteval
+ _Str_view _S_apos()
+ { return _S_all().substr(15, 3); }
+
+ static consteval
+ _Str_view _S_u()
+ { return _S_all().substr(18, 2); }
+
+ static consteval
+ _Str_view _S_x()
+ { return _S_all().substr(20, 2); }
+ };
+
+ template<typename _CharT>
+ struct _Separators
+ {
+ using _Str_view = basic_string_view<_CharT>;
+
+ static consteval
+ _Str_view _S_all()
+ { return _GLIBCXX_WIDEN("[]{}(), : "); }
+
+ static consteval
+ _Str_view _S_squares()
+ { return _S_all().substr(0, 2); }
+
+ static consteval
+ _Str_view _S_braces()
+ { return _S_all().substr(2, 2); }
+
+ static consteval
+ _Str_view _S_parens()
+ { return _S_all().substr(4, 2); }
+
+ static consteval
+ _Str_view _S_comma()
+ { return _S_all().substr(6, 2); }
+
+ static consteval
+ _Str_view _S_colon()
+ { return _S_all().substr(8, 2); }
+ };
+
+ template<typename _CharT>
+ constexpr bool __should_escape_ascii(_CharT __c, _Term_char __term)
+ {
+ using _Esc = _Escapes<_CharT>;
+ switch (__c)
+ {
+ case _Esc::_S_tab()[0]:
+ case _Esc::_S_newline()[0]:
+ case _Esc::_S_return()[0]:
+ case _Esc::_S_bslash()[0]:
+ return true;
+ case _Esc::_S_quote()[0]:
+ return __term == _Term_char::_Tc_quote;
+ case _Esc::_S_apos()[0]:
+ return __term == _Term_char::_Tc_apos;
+ default:
+ return (__c >= 0 && __c < 0x20) || __c == 0x7f;
+ };
+ }
+
+ // @pre __c <= 0x10FFFF
+ constexpr bool __should_escape_unicode(char32_t __c, bool __prev_esc)
+ {
+ if (__unicode::__should_escape_category(__c))
+ return __c != U' ';
+ if (!__prev_esc)
+ return false;
+ return __unicode::__grapheme_cluster_break_property(__c)
+ == __unicode::_Gcb_property::_Gcb_Extend;
+ }
+
+ using uint_least32_t = __UINT_LEAST32_TYPE__;
+ template<typename _Out, typename _CharT>
+ _Out
+ __write_escape_seq(_Out __out, uint_least32_t __val,
+ basic_string_view<_CharT> __prefix)
+ {
+ using _Str_view = basic_string_view<_CharT>;
+ constexpr size_t __max = 8;
+ char __buf[__max];
+ const string_view __narrow(
+ __buf,
+ std::__to_chars_i<uint_least32_t>(__buf, __buf + __max, __val, 16).ptr);
+
+ __out = __format::__write(__out, __prefix);
+ *__out = _Separators<_CharT>::_S_braces()[0];
+ ++__out;
+ if constexpr (is_same_v<char, _CharT>)
+ __out = __format::__write(__out, __narrow);
+#ifdef _GLIBCXX_USE_WCHAR_T
+ else
+ {
+ _CharT __wbuf[__max];
+ const size_t __n = __narrow.size();
+ std::__to_wstring_numeric(__narrow.data(), __n, __wbuf);
+ __out = __format::__write(__out, _Str_view(__wbuf, __n));
+ }
+#endif
+ *__out = _Separators<_CharT>::_S_braces()[1];
+ return ++__out;
+ }
+
+ template<typename _Out, typename _CharT>
+ _Out
+ __write_escaped_char(_Out __out, _CharT __c)
+ {
+ using _UChar = make_unsigned_t<_CharT>;
+ using _Esc = _Escapes<_CharT>;
+ switch (__c)
+ {
+ case _Esc::_S_tab()[0]:
+ return __format::__write(__out, _Esc::_S_tab().substr(1, 2));
+ case _Esc::_S_newline()[0]:
+ return __format::__write(__out, _Esc::_S_newline().substr(1, 2));
+ case _Esc::_S_return()[0]:
+ return __format::__write(__out, _Esc::_S_return().substr(1, 2));
+ case _Esc::_S_bslash()[0]:
+ return __format::__write(__out, _Esc::_S_bslash().substr(1, 2));
+ case _Esc::_S_quote()[0]:
+ return __format::__write(__out, _Esc::_S_quote().substr(1, 2));
+ case _Esc::_S_apos()[0]:
+ return __format::__write(__out, _Esc::_S_apos().substr(1, 2));
+ default:
+ return __format::__write_escape_seq(__out,
+ static_cast<_UChar>(__c),
+ _Esc::_S_u());
+ }
+ }
+
+ template<typename _CharT, typename _Out>
+ _Out
+ __write_escaped_ascii(_Out __out,
+ basic_string_view<_CharT> __str,
+ _Term_char __term)
+ {
+ using _Str_view = basic_string_view<_CharT>;
+ auto __first = __str.begin();
+ auto const __last = __str.end();
+ while (__first != __last)
+ {
+ auto __print = __first;
+ // assume anything outside ASCII is printable
+ while (__print != __last
+ && !__format::__should_escape_ascii(*__print, __term))
+ ++__print;
+
+ if (__print != __first)
+ __out = __format::__write(__out, _Str_view(__first, __print));
+
+ if (__print == __last)
+ return __out;
+
+ __first = __print;
+ __out = __format::__write_escaped_char(__out, *__first);
+ ++__first;
+ }
+ return __out;
+ }
+
+ template<typename _CharT, typename _Out>
+ _Out
+ __write_escaped_unicode(_Out __out,
+ basic_string_view<_CharT> __str,
+ _Term_char __term)
+ {
+ using _Str_view = basic_string_view<_CharT>;
+ using _UChar = make_unsigned_t<_CharT>;
+ using _Esc = _Escapes<_CharT>;
+
+ static constexpr char32_t __replace = U'\uFFFD';
+ static constexpr _Str_view __replace_rep = []
+ {
+ // N.B. "\uFFFD" is ill-formed if encoding is not unicode.
+ if constexpr (is_same_v<char, _CharT>)
+ return "\xEF\xBF\xBD";
+ else
+ return L"\xFFFD";
+ }();
+
+ __unicode::_Utf_view<char32_t, _Str_view> __v(std::move(__str));
+ auto __first = __v.begin();
+ auto const __last = __v.end();
+
+ bool __prev_esc = true;
+ while (__first != __last)
+ {
+ bool __esc_ascii = false;
+ bool __esc_unicode = false;
+ bool __esc_replace = false;
+ auto __should_escape = [&](auto const& __it)
+ {
+ if (*__it <= 0x7f)
+ return __esc_ascii
+ = __format::__should_escape_ascii(*__it.base(), __term);
+ if (__format::__should_escape_unicode(*__it, __prev_esc))
+ return __esc_unicode = true;
+ if (*__it == __replace)
+ {
+ _Str_view __units(__it.base(), __it._M_units());
+ return __esc_replace = (__units != __replace_rep);
+ }
+ return false;
+ };
+
+ auto __print = __first;
+ while (__print != __last && !__should_escape(__print))
+ {
+ __prev_esc = false;
+ ++__print;
+ }
+
+ if (__print != __first)
+ __out = __format::__write(__out, _Str_view(__first.base(), __print.base()));
+
+ if (__print == __last)
+ return __out;
+
+ __first = __print;
+ if (__esc_ascii)
+ __out = __format::__write_escaped_char(__out, *__first.base());
+ else if (__esc_unicode)
+ __out = __format::__write_escape_seq(__out, *__first, _Esc::_S_u());
+ else // __esc_replace
+ for (_CharT __c : _Str_view(__first.base(), __first._M_units()))
+ __out = __format::__write_escape_seq(__out,
+ static_cast<_UChar>(__c),
+ _Esc::_S_x());
+ __prev_esc = true;
+ ++__first;
+
+ }
+ return __out;
+ }
+
+ template<typename _CharT, typename _Out>
+ _Out
+ __write_escaped(_Out __out, basic_string_view<_CharT> __str, _Term_char __term)
+ {
+ *__out = _Escapes<_CharT>::_S_term(__term);
+ ++__out;
+
+ if constexpr (__unicode::__literal_encoding_is_unicode<_CharT>())
+ __out = __format::__write_escaped_unicode(__out, __str, __term);
+ else if constexpr (is_same_v<char, _CharT>
+ && __unicode::__literal_encoding_is_extended_ascii())
+ __out = __format::__write_escaped_ascii(__out, __str, __term);
+ else
+ // TODO Handle non-ascii extended encoding
+ __out = __format::__write_escaped_ascii(__out, __str, __term);
+
+ *__out = _Escapes<_CharT>::_S_term(__term);
+ return ++__out;
+ }
+
// A lightweight optional<locale>.
struct _Optional_locale
{
@@ -924,6 +1258,13 @@ namespace __format
template<__char _CharT>
struct __formatter_str
{
+ __formatter_str() = default;
+
+ constexpr
+ __formatter_str(_Spec<_CharT> __spec) noexcept
+ : _M_spec(__spec)
+ { }
+
constexpr typename basic_format_parse_context<_CharT>::iterator
parse(basic_format_parse_context<_CharT>& __pc)
{
@@ -961,7 +1302,7 @@ namespace __format
if (*__first == 's')
++__first;
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
else if (*__first == '?')
{
__spec._M_type = _Pres_esc;
@@ -980,43 +1321,107 @@ namespace __format
format(basic_string_view<_CharT> __s,
basic_format_context<_Out, _CharT>& __fc) const
{
- if (_M_spec._M_type == _Pres_esc)
+ constexpr auto __term = __format::_Term_char::_Tc_quote;
+ const auto __write_direct = [&]
{
- // TODO: C++23 escaped string presentation
- }
+ if (_M_spec._M_type == _Pres_esc)
+ return __format::__write_escaped(__fc.out(), __s, __term);
+ else
+ return __format::__write(__fc.out(), __s);
+ };
if (_M_spec._M_width_kind == _WP_none
&& _M_spec._M_prec_kind == _WP_none)
- return __format::__write(__fc.out(), __s);
+ return __write_direct();
- size_t __estimated_width;
- if constexpr (__unicode::__literal_encoding_is_unicode<_CharT>())
+ const size_t __prec =
+ _M_spec._M_prec_kind != _WP_none
+ ? _M_spec._M_get_precision(__fc)
+ : basic_string_view<_CharT>::npos;
+
+ const size_t __estimated_width = _S_trunc(__s, __prec);
+ // N.B. Escaping only increases width
+ if (_M_spec._M_get_width(__fc) <= __estimated_width
+ && _M_spec._M_prec_kind == _WP_none)
+ return __write_direct();
+
+ if (_M_spec._M_type != _Pres_esc)
+ return __format::__write_padded_as_spec(__s, __estimated_width,
+ __fc, _M_spec);
+
+ __format::_Str_sink<_CharT> __sink;
+ __format::__write_escaped(__sink.out(), __s, __term);
+ basic_string_view<_CharT> __escaped(__sink.view().data(),
+ __sink.view().size());
+ const size_t __escaped_width = _S_trunc(__escaped, __prec);
+ // N.B. [tab:format.type.string] defines '?' as
+ // Copies the escaped string ([format.string.escaped]) to the output,
+ // so precision seem to appy to escaped string.
+ return __format::__write_padded_as_spec(__escaped, __escaped_width,
+ __fc, _M_spec);
+ }
+
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
+ template<ranges::input_range _Rg, typename _Out>
+ requires same_as<remove_cvref_t<ranges::range_reference_t<_Rg>>, _CharT>
+ typename basic_format_context<_Out, _CharT>::iterator
+ _M_format_range(_Rg&& __rg, basic_format_context<_Out, _CharT>& __fc) const
+ {
+ using _String = basic_string<_CharT>;
+ using _String_view = basic_string_view<_CharT>;
+ if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
{
- if (_M_spec._M_prec_kind != _WP_none)
+ const size_t __n(ranges::distance(__rg));
+ if constexpr (ranges::contiguous_range<_Rg>)
+ return format(_String_view(ranges::data(__rg), __n), __fc);
+ else if (__n <= __format::__stackbuf_size<_CharT>)
{
- size_t __prec = _M_spec._M_get_precision(__fc);
- __estimated_width = __unicode::__truncate(__s, __prec);
+ _CharT __buf[__format::__stackbuf_size<_CharT>];
+ ranges::copy(__rg, __buf);
+ return format(_String_view(__buf, __n), __fc);
+ }
+ else if constexpr (ranges::sized_range<_Rg>)
+ return format(_String(from_range, __rg), __fc);
+ else if constexpr (ranges::random_access_range<_Rg>)
+ {
+ ranges::iterator_t<_Rg> __first = ranges::begin(__rg);
+ ranges::subrange __sub(__first, __first + __n);
+ return format(_String(from_range, __sub), __fc);
}
else
- __estimated_width = __unicode::__field_width(__s);
+ {
+ // N.B. preserve the computed size
+ ranges::subrange __sub(__rg, __n);
+ return format(_String(from_range, __sub), __fc);
+ }
}
else
- {
- __s = __s.substr(0, _M_spec._M_get_precision(__fc));
- __estimated_width = __s.size();
- }
-
- return __format::__write_padded_as_spec(__s, __estimated_width,
- __fc, _M_spec);
+ return format(_String(from_range, __rg), __fc);
}
-#if __cpp_lib_format_ranges
constexpr void
set_debug_format() noexcept
{ _M_spec._M_type = _Pres_esc; }
#endif
private:
+ static size_t
+ _S_trunc(basic_string_view<_CharT>& __s, size_t __prec)
+ {
+ if constexpr (__unicode::__literal_encoding_is_unicode<_CharT>())
+ {
+ if (__prec != basic_string_view<_CharT>::npos)
+ return __unicode::__truncate(__s, __prec);
+ else
+ return __unicode::__field_width(__s);
+ }
+ else
+ {
+ __s = __s.substr(0, __prec);
+ return __s.size();
+ }
+ }
+
_Spec<_CharT> _M_spec{};
};
@@ -1120,7 +1525,7 @@ namespace __format
++__first;
}
break;
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
case '?':
if (__type == _AsChar)
{
@@ -1272,7 +1677,7 @@ namespace __format
_S_character_width(_CharT __c)
{
// N.B. single byte cannot encode charcter of width greater than 1
- if constexpr (sizeof(_CharT) > 1u &&
+ if constexpr (sizeof(_CharT) > 1u &&
__unicode::__literal_encoding_is_unicode<_CharT>())
return __unicode::__field_width(__c);
else
@@ -1286,7 +1691,33 @@ namespace __format
{
return __format::__write_padded_as_spec({&__c, 1u},
_S_character_width(__c),
- __fc, _M_spec);
+ __fc, _M_spec);
+ }
+
+ template<typename _Out>
+ typename basic_format_context<_Out, _CharT>::iterator
+ _M_format_character_escaped(_CharT __c,
+ basic_format_context<_Out, _CharT>& __fc) const
+ {
+ using _Esc = _Escapes<_CharT>;
+ constexpr auto __term = __format::_Term_char::_Tc_apos;
+ const basic_string_view<_CharT> __in(&__c, 1u);
+ if (_M_spec._M_get_width(__fc) <= 3u)
+ return __format::__write_escaped(__fc.out(), __in, __term);
+
+ _CharT __buf[12];
+ __format::_Fixedbuf_sink<_CharT> __sink(__buf);
+ __format::__write_escaped(__sink.out(), __in, __term);
+
+ const basic_string_view<_CharT> __escaped = __sink.view();
+ size_t __estimated_width;
+ if (__escaped[1] == _Esc::_S_bslash()[0]) // escape sequence
+ __estimated_width = __escaped.size();
+ else
+ __estimated_width = 2 + _S_character_width(__c);
+ return __format::__write_padded_as_spec(__escaped,
+ __estimated_width,
+ __fc, _M_spec);
}
template<typename _Int>
@@ -1973,15 +2404,12 @@ namespace __format
|| _M_f._M_spec._M_type == __format::_Pres_c)
return _M_f._M_format_character(__u, __fc);
else if (_M_f._M_spec._M_type == __format::_Pres_esc)
- {
- // TODO
- return __fc.out();
- }
+ return _M_f._M_format_character_escaped(__u, __fc);
else
return _M_f.format(static_cast<make_unsigned_t<_CharT>>(__u), __fc);
}
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
constexpr void
set_debug_format() noexcept
{ _M_f._M_spec._M_type = __format::_Pres_esc; }
@@ -2012,15 +2440,12 @@ namespace __format
|| _M_f._M_spec._M_type == __format::_Pres_c)
return _M_f._M_format_character(__u, __fc);
else if (_M_f._M_spec._M_type == __format::_Pres_esc)
- {
- // TODO
- return __fc.out();
- }
+ return _M_f._M_format_character_escaped(__u, __fc);
else
return _M_f.format(static_cast<unsigned char>(__u), __fc);
}
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
constexpr void
set_debug_format() noexcept
{ _M_f._M_spec._M_type = __format::_Pres_esc; }
@@ -2050,7 +2475,7 @@ namespace __format
format(_CharT* __u, basic_format_context<_Out, _CharT>& __fc) const
{ return _M_f.format(__u, __fc); }
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
constexpr void set_debug_format() noexcept { _M_f.set_debug_format(); }
#endif
@@ -2075,7 +2500,7 @@ namespace __format
basic_format_context<_Out, _CharT>& __fc) const
{ return _M_f.format(__u, __fc); }
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
constexpr void set_debug_format() noexcept { _M_f.set_debug_format(); }
#endif
@@ -2099,7 +2524,7 @@ namespace __format
basic_format_context<_Out, _CharT>& __fc) const
{ return _M_f.format({__u, _Nm}, __fc); }
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
constexpr void set_debug_format() noexcept { _M_f.set_debug_format(); }
#endif
@@ -2123,7 +2548,7 @@ namespace __format
basic_format_context<_Out, char>& __fc) const
{ return _M_f.format(__u, __fc); }
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
constexpr void set_debug_format() noexcept { _M_f.set_debug_format(); }
#endif
@@ -2148,7 +2573,7 @@ namespace __format
basic_format_context<_Out, wchar_t>& __fc) const
{ return _M_f.format(__u, __fc); }
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
constexpr void set_debug_format() noexcept { _M_f.set_debug_format(); }
#endif
@@ -2173,7 +2598,7 @@ namespace __format
basic_format_context<_Out, char>& __fc) const
{ return _M_f.format(__u, __fc); }
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
constexpr void set_debug_format() noexcept { _M_f.set_debug_format(); }
#endif
@@ -2198,7 +2623,7 @@ namespace __format
basic_format_context<_Out, wchar_t>& __fc) const
{ return _M_f.format(__u, __fc); }
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
constexpr void set_debug_format() noexcept { _M_f.set_debug_format(); }
#endif
@@ -2575,7 +3000,7 @@ namespace __format
};
/// @}
-#if defined _GLIBCXX_USE_WCHAR_T && __cpp_lib_format_ranges
+#if defined _GLIBCXX_USE_WCHAR_T && __glibcxx_format_ranges
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 3944. Formatters converting sequences of char to sequences of wchar_t
@@ -2635,32 +3060,21 @@ namespace __format
concept __formattable_impl
= __parsable_with<_Tp, _Context> && __formattable_with<_Tp, _Context>;
+ template<typename _Formatter>
+ concept __has_debug_format = requires(_Formatter __f)
+ {
+ __f.set_debug_format();
+ };
+
} // namespace __format
/// @endcond
-// Concept std::formattable was introduced by P2286R8 "Formatting Ranges",
-// but we can't guard it with __cpp_lib_format_ranges until we define that!
-#if __cplusplus > 202002L
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
// [format.formattable], concept formattable
template<typename _Tp, typename _CharT>
concept formattable
= __format::__formattable_impl<remove_reference_t<_Tp>, _CharT>;
-#endif
-#if __cpp_lib_format_ranges
- /// @cond undocumented
-namespace __format
-{
- template<typename _Rg, typename _CharT>
- concept __const_formattable_range
- = ranges::input_range<const _Rg>
- && formattable<ranges::range_reference_t<const _Rg>, _CharT>;
-
- template<typename _Rg, typename _CharT>
- using __maybe_const_range
- = conditional_t<__const_formattable_range<_Rg, _CharT>, const _Rg, _Rg>;
-} // namespace __format
- /// @endcond
#endif // format_ranges
/// An iterator after the last character written, and the number of
@@ -2859,12 +3273,38 @@ namespace __format
{ return _Sink_iter<_CharT>(*this); }
};
+
+ template<typename _CharT>
+ class _Fixedbuf_sink final : public _Sink<_CharT>
+ {
+ void
+ _M_overflow() override
+ {
+ __glibcxx_assert(false);
+ this->_M_rewind();
+ }
+
+ public:
+ [[__gnu__::__always_inline__]]
+ constexpr explicit
+ _Fixedbuf_sink(span<_CharT> __buf)
+ : _Sink<_CharT>(__buf)
+ { }
+
+ constexpr basic_string_view<_CharT>
+ view() const
+ {
+ auto __s = this->_M_used();
+ return basic_string_view<_CharT>(__s.data(), __s.size());
+ }
+ };
+
// A sink with an internal buffer. This is used to implement concrete sinks.
template<typename _CharT>
class _Buf_sink : public _Sink<_CharT>
{
protected:
- _CharT _M_buf[32 * sizeof(void*) / sizeof(_CharT)];
+ _CharT _M_buf[__stackbuf_size<_CharT>];
[[__gnu__::__always_inline__]]
constexpr
@@ -2993,13 +3433,6 @@ namespace __format
}
};
- template<typename _CharT, typename _Alloc = allocator<_CharT>>
- using _Str_sink
- = _Seq_sink<basic_string<_CharT, char_traits<_CharT>, _Alloc>>;
-
- // template<typename _CharT, typename _Alloc = allocator<_CharT>>
- // using _Vec_sink = _Seq_sink<vector<_CharT, _Alloc>>;
-
// A sink that writes to an output iterator.
// Writes to a fixed-size buffer and then flushes to the output iterator
// when the buffer fills up.
@@ -3675,17 +4108,17 @@ namespace __format
return _M_visit([&__vis]<typename _Tp>(_Tp& __val) -> decltype(auto)
{
constexpr bool __user_facing = __is_one_of<_Tp,
- monostate, bool, _CharT,
- int, unsigned int, long long int, unsigned long long int,
- float, double, long double,
- const _CharT*, basic_string_view<_CharT>,
- const void*, handle>::value;
+ monostate, bool, _CharT,
+ int, unsigned int, long long int, unsigned long long int,
+ float, double, long double,
+ const _CharT*, basic_string_view<_CharT>,
+ const void*, handle>::value;
if constexpr (__user_facing)
return std::forward<_Visitor>(__vis)(__val);
else
{
- handle __h(__val);
- return std::forward<_Visitor>(__vis)(__h);
+ handle __h(__val);
+ return std::forward<_Visitor>(__vis)(__h);
}
}, __type);
}
@@ -4713,7 +5146,7 @@ namespace __format
}
#endif
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges // C++ >= 23 && HOSTED
// [format.range], formatting of ranges
// [format.range.fmtkind], variable template format_kind
enum class range_format {
@@ -4727,7 +5160,10 @@ namespace __format
/// @cond undocumented
template<typename _Rg>
- constexpr auto format_kind = not defined(format_kind<_Rg>);
+ constexpr auto format_kind =
+ __primary_template_not_defined(
+ format_kind<_Rg> // you can specialize this for non-const input ranges
+ );
template<typename _Tp>
consteval range_format
@@ -4758,29 +5194,602 @@ namespace __format
template<ranges::input_range _Rg> requires same_as<_Rg, remove_cvref_t<_Rg>>
constexpr range_format format_kind<_Rg> = __fmt_kind<_Rg>();
- // [format.range.formatter], class template range_formatter
- template<typename _Tp, typename _CharT = char>
- requires same_as<remove_cvref_t<_Tp>, _Tp> && formattable<_Tp, _CharT>
- class range_formatter; // TODO
-
/// @cond undocumented
namespace __format
{
- // [format.range.fmtdef], class template range-default-formatter
- template<range_format _Kind, ranges::input_range _Rg, typename _CharT>
- struct __range_default_formatter; // TODO
+ template<typename _CharT, typename _Out, typename _Callback>
+ typename basic_format_context<_Out, _CharT>::iterator
+ __format_padded(basic_format_context<_Out, _CharT>& __fc,
+ const _Spec<_CharT>& __spec,
+ _Callback&& __call)
+ {
+ // This is required to implement formatting with padding,
+ // as we need to format to temporary buffer, using the same iterator.
+ static_assert(is_same_v<_Out, __format::_Sink_iter<_CharT>>);
+
+ if (__spec._M_get_width(__fc) == 0)
+ return __call(__fc);
+
+ struct _Restore_out
+ {
+ _Restore_out(basic_format_context<_Sink_iter<_CharT>, _CharT>& __fc)
+ : _M_ctx(std::addressof(__fc)), _M_out(__fc.out())
+ { }
+
+ void _M_trigger()
+ {
+ if (_M_ctx)
+ _M_ctx->advance_to(_M_out);
+ _M_ctx = nullptr;
+ }
+
+ ~_Restore_out()
+ { _M_trigger(); }
+
+ private:
+ basic_format_context<_Sink_iter<_CharT>, _CharT>* _M_ctx;
+ _Sink_iter<_CharT> _M_out;
+ };
+
+ _Restore_out __restore(__fc);
+ // TODO Consider double sinking, first buffer of width
+ // size and then original sink, if first buffer is overun
+ // we do not need to align
+ _Str_sink<_CharT> __buf;
+ __fc.advance_to(__buf.out());
+ __call(__fc);
+ __restore._M_trigger();
+
+ basic_string_view<_CharT> __str(__buf.view());
+ size_t __width;
+ if constexpr (__unicode::__literal_encoding_is_unicode<_CharT>())
+ __width = __unicode::__field_width(__str);
+ else
+ __width = __str.size();
+
+ return __format::__write_padded_as_spec(__str, __width, __fc, __spec);
+ }
+
+ template<typename _Rg, typename _CharT>
+ concept __const_formattable_range
+ = ranges::input_range<const _Rg>
+ && formattable<ranges::range_reference_t<const _Rg>, _CharT>;
+
+ // _Rg& and const _Rg& are both formattable and use same formatter
+ // specialization for their references.
+ template<typename _Rg, typename _CharT>
+ concept __simply_formattable_range
+ = __const_formattable_range<_Rg, _CharT>
+ && same_as<remove_cvref_t<ranges::range_reference_t<_Rg>>,
+ remove_cvref_t<ranges::range_reference_t<const _Rg>>>;
+
+ template<typename _Rg, typename _CharT>
+ using __maybe_const_range
+ = __conditional_t<__const_formattable_range<_Rg, _CharT>, const _Rg, _Rg>;
+
+ template<typename _Tp, typename _CharT>
+ using __maybe_const
+ = __conditional_t<formattable<const _Tp, _CharT>, const _Tp, _Tp>;
+
+ template<size_t _Pos, typename _Tp, typename _CharT>
+ struct __indexed_formatter_storage
+ {
+ constexpr void
+ _M_parse()
+ {
+ basic_format_parse_context<_CharT> __pc({});
+ if (_M_formatter.parse(__pc) != __pc.end())
+ __format::__failed_to_parse_format_spec();
+ }
+
+ template<typename _Out>
+ void
+ _M_format(__maybe_const<_Tp, _CharT>& __elem,
+ basic_format_context<_Out, _CharT>& __fc,
+ basic_string_view<_CharT> __sep) const
+ {
+ if constexpr (_Pos != 0)
+ __fc.advance_to(__format::__write(__fc.out(), __sep));
+ __fc.advance_to(_M_formatter.format(__elem, __fc));
+ }
+
+ [[__gnu__::__always_inline__]]
+ constexpr void
+ set_debug_format()
+ {
+ if constexpr (__has_debug_format<formatter<_Tp, _CharT>>)
+ _M_formatter.set_debug_format();
+ }
+
+ private:
+ formatter<_Tp, _CharT> _M_formatter;
+ };
+
+ template<typename _CharT, typename... _Tps>
+ class __tuple_formatter
+ {
+ using _String_view = basic_string_view<_CharT>;
+ using _Seps = __format::_Separators<_CharT>;
+
+ public:
+ constexpr void
+ set_separator(basic_string_view<_CharT> __sep) noexcept
+ { _M_sep = __sep; }
+
+ constexpr void
+ set_brackets(basic_string_view<_CharT> __open,
+ basic_string_view<_CharT> __close) noexcept
+ {
+ _M_open = __open;
+ _M_close = __close;
+ }
+
+ // We deviate from standard, that declares this as template accepting
+ // unconstrained ParseContext type, which seems unimplementable.
+ constexpr typename basic_format_parse_context<_CharT>::iterator
+ parse(basic_format_parse_context<_CharT>& __pc)
+ {
+ auto __first = __pc.begin();
+ const auto __last = __pc.end();
+ __format::_Spec<_CharT> __spec{};
+
+ auto __finished = [&]
+ {
+ if (__first != __last && *__first != '}')
+ return false;
+
+ _M_spec = __spec;
+ _M_felems._M_parse();
+ _M_felems.set_debug_format();
+ return true;
+ };
+
+ if (__finished())
+ return __first;
+
+ __first = __spec._M_parse_fill_and_align(__first, __last, "{:");
+ if (__finished())
+ return __first;
+
+ __first = __spec._M_parse_width(__first, __last, __pc);
+ if (__finished())
+ return __first;
+
+ if (*__first == 'n')
+ {
+ ++__first;
+ _M_open = _M_close = _String_view();
+ }
+ else if (*__first == 'm')
+ {
+ ++__first;
+ if constexpr (sizeof...(_Tps) == 2)
+ {
+ _M_sep = _Seps::_S_colon();
+ _M_open = _M_close = _String_view();
+ }
+ else
+ __throw_format_error("format error: 'm' specifier requires range"
+ " of pair or tuple of two elements");
+ }
+
+ if (__finished())
+ return __first;
+
+ __format::__failed_to_parse_format_spec();
+ }
+
+ protected:
+ template<typename _Tuple, typename _Out, size_t... _Ids>
+ typename basic_format_context<_Out, _CharT>::iterator
+ _M_format(_Tuple& __tuple, index_sequence<_Ids...>,
+ basic_format_context<_Out, _CharT>& __fc) const
+ { return _M_format_elems(std::get<_Ids>(__tuple)..., __fc); }
+
+ template<typename _Out>
+ typename basic_format_context<_Out, _CharT>::iterator
+ _M_format_elems(__maybe_const<_Tps, _CharT>&... __elems,
+ basic_format_context<_Out, _CharT>& __fc) const
+ {
+ return __format::__format_padded(
+ __fc, _M_spec,
+ [this, &__elems...](basic_format_context<_Out, _CharT>& __nfc)
+ {
+ __nfc.advance_to(__format::__write(__nfc.out(), _M_open));
+ _M_felems._M_format(__elems..., __nfc, _M_sep);
+ return __format::__write(__nfc.out(), _M_close);
+ });
+ }
+
+ private:
+ template<size_t... _Ids>
+ struct __formatters_storage
+ : __indexed_formatter_storage<_Ids, _Tps, _CharT>...
+ {
+ template<size_t _Id, typename _Up>
+ using _Base = __indexed_formatter_storage<_Id, _Up, _CharT>;
+
+ constexpr void
+ _M_parse()
+ {
+ (_Base<_Ids, _Tps>::_M_parse(), ...);
+ }
+
+ template<typename _Out>
+ void
+ _M_format(__maybe_const<_Tps, _CharT>&... __elems,
+ basic_format_context<_Out, _CharT>& __fc,
+ _String_view __sep) const
+ {
+ (_Base<_Ids, _Tps>::_M_format(__elems, __fc, __sep), ...);
+ }
+
+ constexpr void
+ set_debug_format()
+ {
+ (_Base<_Ids, _Tps>::set_debug_format(), ...);
+ }
+ };
+
+ template<size_t... _Ids>
+ static auto
+ _S_create_storage(index_sequence<_Ids...>)
+ -> __formatters_storage<_Ids...>;
+ using _Formatters
+ = decltype(_S_create_storage(index_sequence_for<_Tps...>()));
+
+ _Spec<_CharT> _M_spec{};
+ _String_view _M_open = _Seps::_S_parens().substr(0, 1);
+ _String_view _M_close = _Seps::_S_parens().substr(1, 1);
+ _String_view _M_sep = _Seps::_S_comma();
+ _Formatters _M_felems;
+ };
+
+ template<typename _Tp>
+ concept __is_map_formattable
+ = __is_pair<_Tp> || (__is_tuple_v<_Tp> && tuple_size_v<_Tp> == 2);
+
} // namespace __format
/// @endcond
+ // [format.tuple] Tuple formatter
+ template<__format::__char _CharT, formattable<_CharT> _Fp,
+ formattable<_CharT> _Sp>
+ struct formatter<pair<_Fp, _Sp>, _CharT>
+ : __format::__tuple_formatter<_CharT, remove_cvref_t<_Fp>,
+ remove_cvref_t<_Sp>>
+ {
+ private:
+ using __maybe_const_pair
+ = __conditional_t<formattable<const _Fp, _CharT>
+ && formattable<const _Sp, _CharT>,
+ const pair<_Fp, _Sp>, pair<_Fp, _Sp>>;
+ public:
+ // We deviate from standard, that declares this as template accepting
+ // unconstrained FormatContext type, which seems unimplementable.
+ template<typename _Out>
+ typename basic_format_context<_Out, _CharT>::iterator
+ format(__maybe_const_pair& __p,
+ basic_format_context<_Out, _CharT>& __fc) const
+ { return this->_M_format_elems(__p.first, __p.second, __fc); }
+ };
+
+ template<__format::__char _CharT, formattable<_CharT>... _Tps>
+ struct formatter<tuple<_Tps...>, _CharT>
+ : __format::__tuple_formatter<_CharT, remove_cvref_t<_Tps>...>
+ {
+ private:
+ using __maybe_const_tuple
+ = __conditional_t<(formattable<const _Tps, _CharT> && ...),
+ const tuple<_Tps...>, tuple<_Tps...>>;
+ public:
+ // We deviate from standard, that declares this as template accepting
+ // unconstrained FormatContext type, which seems unimplementable.
+ template<typename _Out>
+ typename basic_format_context<_Out, _CharT>::iterator
+ format(__maybe_const_tuple& __t,
+ basic_format_context<_Out, _CharT>& __fc) const
+ { return this->_M_format(__t, index_sequence_for<_Tps...>(), __fc); }
+ };
+
+ // [format.range.formatter], class template range_formatter
+ template<typename _Tp, __format::__char _CharT = char>
+ requires same_as<remove_cvref_t<_Tp>, _Tp> && formattable<_Tp, _CharT>
+ class range_formatter
+ {
+ using _String_view = basic_string_view<_CharT>;
+ using _Seps = __format::_Separators<_CharT>;
+
+ public:
+ constexpr void
+ set_separator(basic_string_view<_CharT> __sep) noexcept
+ { _M_sep = __sep; }
+
+ constexpr void
+ set_brackets(basic_string_view<_CharT> __open,
+ basic_string_view<_CharT> __close) noexcept
+ {
+ _M_open = __open;
+ _M_close = __close;
+ }
+
+ constexpr formatter<_Tp, _CharT>&
+ underlying() noexcept
+ { return _M_fval; }
+
+ constexpr const formatter<_Tp, _CharT>&
+ underlying() const noexcept
+ { return _M_fval; }
+
+ // We deviate from standard, that declares this as template accepting
+ // unconstrained ParseContext type, which seems unimplementable.
+ constexpr typename basic_format_parse_context<_CharT>::iterator
+ parse(basic_format_parse_context<_CharT>& __pc)
+ {
+ auto __first = __pc.begin();
+ const auto __last = __pc.end();
+ __format::_Spec<_CharT> __spec{};
+ bool __no_brace = false;
+
+ auto __finished = [&]
+ { return __first == __last || *__first == '}'; };
+
+ auto __finalize = [&]
+ {
+ _M_spec = __spec;
+ return __first;
+ };
+
+ auto __parse_val = [&](_String_view __nfs = _String_view())
+ {
+ basic_format_parse_context<_CharT> __npc(__nfs);
+ if (_M_fval.parse(__npc) != __npc.end())
+ __format::__failed_to_parse_format_spec();
+ if constexpr (__format::__has_debug_format<formatter<_Tp, _CharT>>)
+ _M_fval.set_debug_format();
+ return __finalize();
+ };
+
+ if (__finished())
+ return __parse_val();
+
+ __first = __spec._M_parse_fill_and_align(__first, __last, "{:");
+ if (__finished())
+ return __parse_val();
+
+ __first = __spec._M_parse_width(__first, __last, __pc);
+ if (__finished())
+ return __parse_val();
+
+ if (*__first == '?')
+ {
+ ++__first;
+ __spec._M_type = __format::_Pres_esc;
+ if (__finished() || *__first != 's')
+ __throw_format_error("format error: '?' is allowed only in"
+ " combination with 's'");
+ }
+
+ if (*__first == 's')
+ {
+ ++__first;
+ if constexpr (same_as<_Tp, _CharT>)
+ {
+ if (__spec._M_type != __format::_Pres_esc)
+ __spec._M_type = __format::_Pres_str;
+ if (__finished())
+ return __finalize();
+ __throw_format_error("format error: element format specifier"
+ " cannot be provided when 's' specifier is used");
+ }
+ else
+ __throw_format_error("format error: 's' specifier requires"
+ " range of character types");
+ }
+
+ if (__finished())
+ return __parse_val();
+
+ if (*__first == 'n')
+ {
+ ++__first;
+ _M_open = _M_close = _String_view();
+ __no_brace = true;
+ }
+
+ if (__finished())
+ return __parse_val();
+
+ if (*__first == 'm')
+ {
+ _String_view __m(__first, 1);
+ ++__first;
+ if constexpr (__format::__is_map_formattable<_Tp>)
+ {
+ _M_sep = _Seps::_S_comma();
+ if (!__no_brace)
+ {
+ _M_open = _Seps::_S_braces().substr(0, 1);
+ _M_close = _Seps::_S_braces().substr(1, 1);
+ }
+ if (__finished())
+ return __parse_val(__m);
+ __throw_format_error("format error: element format specifier"
+ " cannot be provided when 'm' specifier is used");
+ }
+ else
+ __throw_format_error("format error: 'm' specifier requires"
+ " range of pairs or tuples of two elements");
+ }
+
+ if (__finished())
+ return __parse_val();
+
+ if (*__first == ':')
+ {
+ __pc.advance_to(++__first);
+ __first = _M_fval.parse(__pc);
+ }
+
+ if (__finished())
+ return __finalize();
+
+ __format::__failed_to_parse_format_spec();
+ }
+
+ // We deviate from standard, that declares this as template accepting
+ // unconstrained FormatContext type, which seems unimplementable.
+ template<ranges::input_range _Rg, typename _Out>
+ requires formattable<ranges::range_reference_t<_Rg>, _CharT> &&
+ same_as<remove_cvref_t<ranges::range_reference_t<_Rg>>, _Tp>
+ typename basic_format_context<_Out, _CharT>::iterator
+ format(_Rg&& __rg, basic_format_context<_Out, _CharT>& __fc) const
+ {
+ using _Range = remove_reference_t<_Rg>;
+ if constexpr (__format::__simply_formattable_range<_Range, _CharT>)
+ return _M_format<const _Range>(__rg, __fc);
+ else
+ return _M_format(__rg, __fc);
+ }
+
+ private:
+ template<ranges::input_range _Rg, typename _Out>
+ typename basic_format_context<_Out, _CharT>::iterator
+ _M_format(_Rg& __rg, basic_format_context<_Out, _CharT>& __fc) const
+ {
+ if constexpr (same_as<_Tp, _CharT>)
+ if (_M_spec._M_type == __format::_Pres_str
+ || _M_spec._M_type == __format::_Pres_esc)
+ {
+ __format::__formatter_str __fstr(_M_spec);
+ return __fstr._M_format_range(__rg, __fc);
+ }
+ return __format::__format_padded(
+ __fc, _M_spec,
+ [this, &__rg](basic_format_context<_Out, _CharT>& __nfc)
+ { return _M_format_elems(__rg, __nfc); });
+ }
+
+
+ template<ranges::input_range _Rg, typename _Out>
+ typename basic_format_context<_Out, _CharT>::iterator
+ _M_format_elems(_Rg& __rg,
+ basic_format_context<_Out, _CharT>& __fc) const
+ {
+ auto __out = __format::__write(__fc.out(), _M_open);
+
+ auto __first = ranges::begin(__rg);
+ auto const __last = ranges::end(__rg);
+ if (__first == __last)
+ return __format::__write(__out, _M_close);
+
+ __fc.advance_to(__out);
+ __out = _M_fval.format(*__first, __fc);
+ for (++__first; __first != __last; ++__first)
+ {
+ __out = __format::__write(__out, _M_sep);
+ __fc.advance_to(__out);
+ __out = _M_fval.format(*__first, __fc);
+ }
+
+ return __format::__write(__out, _M_close);
+ }
+
+ __format::_Spec<_CharT> _M_spec{};
+ _String_view _M_open = _Seps::_S_squares().substr(0, 1);
+ _String_view _M_close = _Seps::_S_squares().substr(1, 1);
+ _String_view _M_sep = _Seps::_S_comma();
+ formatter<_Tp, _CharT> _M_fval;
+ };
+
+ // In standard this is shown as inheriting from specialization of
+ // exposition only specialization for range-default-formatter for
+ // each range_format. We opt for simpler implementation.
// [format.range.fmtmap], [format.range.fmtset], [format.range.fmtstr],
// specializations for maps, sets, and strings
- template<ranges::input_range _Rg, typename _CharT>
+ template<ranges::input_range _Rg, __format::__char _CharT>
requires (format_kind<_Rg> != range_format::disabled)
&& formattable<ranges::range_reference_t<_Rg>, _CharT>
struct formatter<_Rg, _CharT>
- : __format::__range_default_formatter<format_kind<_Rg>, _Rg, _CharT>
- { };
+ {
+ private:
+ static const bool _S_range_format_is_string =
+ (format_kind<_Rg> == range_format::string)
+ || (format_kind<_Rg> == range_format::debug_string);
+ using _Vt = remove_cvref_t<
+ ranges::range_reference_t<
+ __format::__maybe_const_range<_Rg, _CharT>>>;
+
+ static consteval bool _S_is_correct()
+ {
+ if constexpr (_S_range_format_is_string)
+ static_assert(same_as<_Vt, _CharT>);
+ return true;
+ }
+
+ static_assert(_S_is_correct());
+
+ public:
+ constexpr formatter() noexcept
+ {
+ using _Seps = __format::_Separators<_CharT>;
+ if constexpr (format_kind<_Rg> == range_format::map)
+ {
+ static_assert(__format::__is_map_formattable<_Vt>);
+ _M_under.set_brackets(_Seps::_S_braces().substr(0, 1),
+ _Seps::_S_braces().substr(1, 1));
+ _M_under.underlying().set_brackets({}, {});
+ _M_under.underlying().set_separator(_Seps::_S_colon());
+ }
+ else if constexpr (format_kind<_Rg> == range_format::set)
+ _M_under.set_brackets(_Seps::_S_braces().substr(0, 1),
+ _Seps::_S_braces().substr(1, 1));
+ }
+
+ constexpr void
+ set_separator(basic_string_view<_CharT> __sep) noexcept
+ requires (!_S_range_format_is_string)
+ { _M_under.set_separator(__sep); }
+
+ constexpr void
+ set_brackets(basic_string_view<_CharT> __open,
+ basic_string_view<_CharT> __close) noexcept
+ requires (!_S_range_format_is_string)
+ { _M_under.set_brackets(__open, __close); }
+
+ // We deviate from standard, that declares this as template accepting
+ // unconstrained ParseContext type, which seems unimplementable.
+ constexpr typename basic_format_parse_context<_CharT>::iterator
+ parse(basic_format_parse_context<_CharT>& __pc)
+ {
+ auto __res = _M_under.parse(__pc);
+ if constexpr (format_kind<_Rg> == range_format::debug_string)
+ _M_under.set_debug_format();
+ return __res;
+ }
+
+ // We deviate from standard, that declares this as template accepting
+ // unconstrained FormatContext type, which seems unimplementable.
+ template<typename _Out>
+ typename basic_format_context<_Out, _CharT>::iterator
+ format(__format::__maybe_const_range<_Rg, _CharT>& __rg,
+ basic_format_context<_Out, _CharT>& __fc) const
+ {
+ if constexpr (_S_range_format_is_string)
+ return _M_under._M_format_range(__rg, __fc);
+ else
+ return _M_under.format(__rg, __fc);
+ }
+
+ private:
+ using _Formatter_under
+ = __conditional_t<_S_range_format_is_string,
+ __format::__formatter_str<_CharT>,
+ range_formatter<_Vt, _CharT>>;
+ _Formatter_under _M_under;
+ };
#endif // C++23 formatting ranges
+#undef _GLIBCXX_WIDEN
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
diff --git a/libstdc++-v3/include/std/forward_list b/libstdc++-v3/include/std/forward_list
index 166fdb0..d478851 100644
--- a/libstdc++-v3/include/std/forward_list
+++ b/libstdc++-v3/include/std/forward_list
@@ -49,6 +49,7 @@
#define __glibcxx_want_algorithm_default_value_type
#define __glibcxx_want_allocator_traits_is_always_equal
+#define __glibcxx_want_containers_ranges
#define __glibcxx_want_erase_if
#define __glibcxx_want_incomplete_container_elements
#define __glibcxx_want_list_remove_return_type
diff --git a/libstdc++-v3/include/std/list b/libstdc++-v3/include/std/list
index 170499d..2ba0599 100644
--- a/libstdc++-v3/include/std/list
+++ b/libstdc++-v3/include/std/list
@@ -73,6 +73,7 @@
#define __glibcxx_want_algorithm_default_value_type
#define __glibcxx_want_allocator_traits_is_always_equal
+#define __glibcxx_want_containers_ranges
#define __glibcxx_want_erase_if
#define __glibcxx_want_incomplete_container_elements
#define __glibcxx_want_list_remove_return_type
diff --git a/libstdc++-v3/include/std/map b/libstdc++-v3/include/std/map
index 16a397f..6bfb538 100644
--- a/libstdc++-v3/include/std/map
+++ b/libstdc++-v3/include/std/map
@@ -72,6 +72,7 @@
#endif
#define __glibcxx_want_allocator_traits_is_always_equal
+#define __glibcxx_want_containers_ranges
#define __glibcxx_want_erase_if
#define __glibcxx_want_generic_associative_lookup
#define __glibcxx_want_map_try_emplace
diff --git a/libstdc++-v3/include/std/numeric b/libstdc++-v3/include/std/numeric
index 4d36fcd..490963e 100644
--- a/libstdc++-v3/include/std/numeric
+++ b/libstdc++-v3/include/std/numeric
@@ -732,12 +732,11 @@ namespace __detail
/// @} group numeric_ops
#endif // C++17
+#if __glibcxx_ranges_iota >= 202202L // C++ >= 23
namespace ranges
{
-#if __glibcxx_ranges_iota >= 202202L // C++ >= 23
-
template<typename _Out, typename _Tp>
- using iota_result = out_value_result<_Out, _Tp>;
+ using iota_result = out_value_result<_Out, _Tp>;
struct __iota_fn
{
@@ -762,9 +761,8 @@ namespace ranges
};
inline constexpr __iota_fn iota{};
-
-#endif // __glibcxx_ranges_iota
} // namespace ranges
+#endif // __glibcxx_ranges_iota
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
diff --git a/libstdc++-v3/include/std/queue b/libstdc++-v3/include/std/queue
index c06a4c3..74b6c07 100644
--- a/libstdc++-v3/include/std/queue
+++ b/libstdc++-v3/include/std/queue
@@ -68,6 +68,7 @@
#include <bits/stl_queue.h>
#define __glibcxx_want_adaptor_iterator_pair_constructor
+#define __glibcxx_want_containers_ranges
#include <bits/version.h>
#endif /* _GLIBCXX_QUEUE */
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index 7a339c5..9300c36 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -64,7 +64,6 @@
#define __glibcxx_want_ranges_chunk
#define __glibcxx_want_ranges_chunk_by
#define __glibcxx_want_ranges_enumerate
-#define __glibcxx_want_ranges_iota
#define __glibcxx_want_ranges_join_with
#define __glibcxx_want_ranges_repeat
#define __glibcxx_want_ranges_slide
diff --git a/libstdc++-v3/include/std/set b/libstdc++-v3/include/std/set
index 2ebf485..cf7057a 100644
--- a/libstdc++-v3/include/std/set
+++ b/libstdc++-v3/include/std/set
@@ -72,6 +72,7 @@
#endif
#define __glibcxx_want_allocator_traits_is_always_equal
+#define __glibcxx_want_containers_ranges
#define __glibcxx_want_erase_if
#define __glibcxx_want_generic_associative_lookup
#define __glibcxx_want_node_extract
diff --git a/libstdc++-v3/include/std/stack b/libstdc++-v3/include/std/stack
index 2f7951a..5cea476 100644
--- a/libstdc++-v3/include/std/stack
+++ b/libstdc++-v3/include/std/stack
@@ -65,6 +65,7 @@
#include <bits/stl_stack.h>
#define __glibcxx_want_adaptor_iterator_pair_constructor
+#define __glibcxx_want_containers_ranges
#include <bits/version.h>
#endif /* _GLIBCXX_STACK */
diff --git a/libstdc++-v3/include/std/string b/libstdc++-v3/include/std/string
index 6211da9..7186471 100644
--- a/libstdc++-v3/include/std/string
+++ b/libstdc++-v3/include/std/string
@@ -60,6 +60,7 @@
#define __glibcxx_want_allocator_traits_is_always_equal
#define __glibcxx_want_constexpr_char_traits
#define __glibcxx_want_constexpr_string
+#define __glibcxx_want_containers_ranges
#define __glibcxx_want_erase_if
#define __glibcxx_want_nonmember_container_access
#define __glibcxx_want_string_resize_and_overwrite
diff --git a/libstdc++-v3/include/std/unordered_map b/libstdc++-v3/include/std/unordered_map
index 37f2273..3ae25d7 100644
--- a/libstdc++-v3/include/std/unordered_map
+++ b/libstdc++-v3/include/std/unordered_map
@@ -49,6 +49,7 @@
#endif
#define __glibcxx_want_allocator_traits_is_always_equal
+#define __glibcxx_want_containers_ranges
#define __glibcxx_want_erase_if
#define __glibcxx_want_generic_unordered_lookup
#define __glibcxx_want_node_extract
diff --git a/libstdc++-v3/include/std/unordered_set b/libstdc++-v3/include/std/unordered_set
index 4c73e5d..b561163 100644
--- a/libstdc++-v3/include/std/unordered_set
+++ b/libstdc++-v3/include/std/unordered_set
@@ -49,6 +49,7 @@
#endif
#define __glibcxx_want_allocator_traits_is_always_equal
+#define __glibcxx_want_containers_ranges
#define __glibcxx_want_erase_if
#define __glibcxx_want_generic_unordered_lookup
#define __glibcxx_want_node_extract
diff --git a/libstdc++-v3/include/std/vector b/libstdc++-v3/include/std/vector
index 8bb2543..a98ffb1 100644
--- a/libstdc++-v3/include/std/vector
+++ b/libstdc++-v3/include/std/vector
@@ -81,6 +81,7 @@
#define __glibcxx_want_algorithm_default_value_type
#define __glibcxx_want_allocator_traits_is_always_equal
#define __glibcxx_want_constexpr_vector
+#define __glibcxx_want_containers_ranges
#define __glibcxx_want_erase_if
#define __glibcxx_want_incomplete_container_elements
#define __glibcxx_want_nonmember_container_access
diff --git a/libstdc++-v3/src/c++11/string-inst.cc b/libstdc++-v3/src/c++11/string-inst.cc
index c486479..34df909 100644
--- a/libstdc++-v3/src/c++11/string-inst.cc
+++ b/libstdc++-v3/src/c++11/string-inst.cc
@@ -40,7 +40,8 @@
// replaced by constrained function templates, so that we instantiate the
// pre-C++17 definitions.
// This also causes the instantiation of the non-standard C++0x-era
-// insert(iterator, initializer_list<C>) overload, see PR libstdc++/83328
+// insert(iterator, initializer_list<C>) overload, see PR libstdc++/83328,
+// and overloads of _S_copy_chars for string iterators and pointers.
#define _GLIBCXX_DEFINING_STRING_INSTANTIATIONS 1
#include <string>
diff --git a/libstdc++-v3/src/c++17/fast_float/LOCAL_PATCHES b/libstdc++-v3/src/c++17/fast_float/LOCAL_PATCHES
index 71495d6..28d86fd 100644
--- a/libstdc++-v3/src/c++17/fast_float/LOCAL_PATCHES
+++ b/libstdc++-v3/src/c++17/fast_float/LOCAL_PATCHES
@@ -1,2 +1,3 @@
r12-6647
r12-6648
+r15-9382
diff --git a/libstdc++-v3/src/c++17/fast_float/fast_float.h b/libstdc++-v3/src/c++17/fast_float/fast_float.h
index 7551c4f..3da58f2 100644
--- a/libstdc++-v3/src/c++17/fast_float/fast_float.h
+++ b/libstdc++-v3/src/c++17/fast_float/fast_float.h
@@ -275,7 +275,8 @@ fastfloat_really_inline value128 full_multiplication(uint64_t a,
// But MinGW on ARM64 doesn't have native support for 64-bit multiplications
answer.high = __umulh(a, b);
answer.low = a * b;
-#elif defined(FASTFLOAT_32BIT) || (defined(_WIN64) && !defined(__clang__))
+#elif defined(FASTFLOAT_32BIT) || \
+ (defined(_WIN64) && !defined(__clang__) && !defined(_M_ARM64))
answer.low = _umul128(a, b, &answer.high); // _umul128 not available on ARM64
#elif defined(FASTFLOAT_64BIT)
__uint128_t r = ((__uint128_t)a) * b;
diff --git a/libstdc++-v3/src/c++23/std.cc.in b/libstdc++-v3/src/c++23/std.cc.in
index 12253b9..5e18ad7 100644
--- a/libstdc++-v3/src/c++23/std.cc.in
+++ b/libstdc++-v3/src/c++23/std.cc.in
@@ -1332,6 +1332,12 @@ export namespace std
using std::wformat_context;
using std::wformat_parse_context;
using std::wformat_string;
+// FIXME __cpp_lib_format_ranges
+#ifdef __glibcxx_format_ranges
+ using std::format_kind;
+ using std::range_format;
+ using std::range_formatter;
+#endif
}
// <forward_list>
diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc
index 4458325..f67818d 100644
--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -142,6 +142,10 @@
#define try_emplace (
#endif
+#if __cplusplus < 202002L
+#define ranges (
+#endif
+
// These clash with newlib so don't use them.
# define __lockable cannot be used as an identifier
# define __null_sentinel cannot be used as an identifier
diff --git a/libstdc++-v3/testsuite/20_util/expected/equality_constrained.cc b/libstdc++-v3/testsuite/20_util/expected/equality_constrained.cc
index 7f6cefa..a079d98 100644
--- a/libstdc++-v3/testsuite/20_util/expected/equality_constrained.cc
+++ b/libstdc++-v3/testsuite/20_util/expected/equality_constrained.cc
@@ -4,7 +4,7 @@
#ifndef __cpp_lib_constrained_equality
# error "Feature-test macro for constrained_equality missing in <expected>"
-#elif __cpp_lib_constrained_equality < 202411L // TODO: use final value
+#elif __cpp_lib_constrained_equality < 202411L
# error "Feature-test macro for constrained_equality has wrong value"
#endif
diff --git a/libstdc++-v3/testsuite/20_util/tuple/element_access/get_neg.cc b/libstdc++-v3/testsuite/20_util/tuple/element_access/get_neg.cc
index 48628a9..18d47d2 100644
--- a/libstdc++-v3/testsuite/20_util/tuple/element_access/get_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/tuple/element_access/get_neg.cc
@@ -61,4 +61,4 @@ test03()
// { dg-error "tuple index must be in range" "" { target *-*-* } 0 }
// { dg-prune-output "no type named 'type' in .*_Nth_type" }
-// { dg-prune-output "pack index is out of range" }
+// { dg-prune-output "pack index '.' is out of range" }
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/119748.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/119748.cc
new file mode 100644
index 0000000..301ca5d
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/119748.cc
@@ -0,0 +1,35 @@
+// { dg-do compile }
+
+// Bug 119748
+// string(InputIterator, InputIterator) rejects volatile charT* as iterator
+
+#ifndef TEST_CHAR_TYPE
+#define TEST_CHAR_TYPE char
+#endif
+
+#include <string>
+#include <testsuite_iterators.h>
+
+typedef TEST_CHAR_TYPE C;
+
+volatile C vs[42] = {};
+std::basic_string<C> s(vs+0, vs+42);
+#ifdef __cpp_lib_containers_ranges
+std::basic_string<C> s2(std::from_range, vs);
+#endif
+
+using namespace __gnu_test;
+
+test_container<volatile C, input_iterator_wrapper> input_cont(vs);
+std::basic_string<C> s3(input_cont.begin(), input_cont.end());
+
+test_container<volatile C, forward_iterator_wrapper> fwd_cont(vs);
+std::basic_string<C> s4(fwd_cont.begin(), fwd_cont.end());
+
+#ifdef __cpp_lib_containers_ranges
+test_input_range<volatile C> input_range(vs);
+std::basic_string<C> s5(std::from_range, input_range);
+
+test_forward_range<volatile C> fwd_range(vs);
+std::basic_string<C> s6(std::from_range, fwd_range);
+#endif
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/from_range.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/from_range.cc
new file mode 100644
index 0000000..6331050
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/from_range.cc
@@ -0,0 +1,129 @@
+// { dg-do run { target c++23 } }
+
+#include <string>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <string>"
+#endif
+
+#include <span>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+#include <testsuite_allocator.h>
+
+void
+test_deduction_guide(char* p)
+{
+ __gnu_test::test_input_range<char> r(nullptr, nullptr);
+ std::basic_string v(std::from_range, r);
+ static_assert(std::is_same_v<decltype(v), std::string>);
+
+ using Alloc = __gnu_test::SimpleAllocator<char>;
+ Alloc alloc;
+ std::basic_string v2(std::from_range, r, alloc);
+ static_assert(std::is_same_v<decltype(v2), std::basic_string<char, std::char_traits<char>, Alloc>>);
+
+ __gnu_test::test_input_range<wchar_t> wr(nullptr, nullptr);
+ std::basic_string w(std::from_range, wr);
+ static_assert(std::is_same_v<decltype(w), std::wstring>);
+
+ using WAlloc = __gnu_test::SimpleAllocator<wchar_t>;
+ WAlloc walloc;
+ std::basic_string w2(std::from_range, wr, walloc);
+ static_assert(std::is_same_v<decltype(w2), std::basic_string<wchar_t, std::char_traits<wchar_t>, WAlloc>>);
+}
+
+template<typename Range, typename Alloc>
+constexpr void
+do_test(Alloc alloc)
+{
+ // The basic_string's value_type.
+ using V = typename std::allocator_traits<Alloc>::value_type;
+ using CT = std::char_traits<V>;
+
+ // The range's value_type.
+ using T = std::ranges::range_value_t<Range>;
+ T a[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
+
+ auto eq = [](const std::basic_string<V, CT, Alloc>& l, std::span<T> r) {
+ if (l.size() != r.size())
+ return false;
+ for (auto i = 0u; i < l.size(); ++i)
+ if (l[i] != r[i])
+ return false;
+ return true;
+ };
+
+ std::basic_string<V, CT, Alloc> v0(std::from_range, Range(a, a+0));
+ VERIFY( v0.empty() );
+ VERIFY( v0.get_allocator() == Alloc() );
+
+ std::basic_string<V, CT, Alloc> v4(std::from_range, Range(a, a+4));
+ VERIFY( eq(v4, {a, 4}) );
+ VERIFY( v4.get_allocator() == Alloc() );
+
+ std::basic_string<V, CT, Alloc> v9(std::from_range, Range(a, a+9), alloc);
+ VERIFY( eq(v9, {a, 9}) );
+ VERIFY( v9.get_allocator() == alloc );
+
+ std::basic_string<V, CT, Alloc> v20(std::from_range, Range(a, a+20), alloc);
+ VERIFY( eq(v20, {a, 20}) );
+ VERIFY( v20.get_allocator() == alloc );
+}
+
+template<typename Range>
+void
+do_test_a()
+{
+ do_test<Range>(std::allocator<char>());
+ do_test<Range>(__gnu_test::uneq_allocator<char>(42));
+ do_test<Range>(std::allocator<wchar_t>());
+ do_test<Range>(__gnu_test::uneq_allocator<wchar_t>(42));
+}
+
+bool
+test_ranges()
+{
+ using namespace __gnu_test;
+
+ do_test_a<test_forward_range<char>>();
+ do_test_a<test_forward_sized_range<char>>();
+ do_test_a<test_sized_range_sized_sent<char, forward_iterator_wrapper>>();
+
+ do_test_a<test_input_range<char>>();
+ do_test_a<test_input_sized_range<char>>();
+ do_test_a<test_sized_range_sized_sent<char, input_iterator_wrapper>>();
+
+ do_test_a<test_range<char, input_iterator_wrapper_nocopy>>();
+ do_test_a<test_sized_range<char, input_iterator_wrapper_nocopy>>();
+ do_test_a<test_sized_range_sized_sent<char, input_iterator_wrapper_nocopy>>();
+
+ // Not lvalue-convertible to char
+ struct C {
+ C(char v) : val(v) { }
+ operator char() && { return val; }
+ bool operator==(char b) const { return b == val; }
+ char val;
+ };
+ using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
+ do_test<rvalue_input_range>(std::allocator<char>());
+
+ return true;
+}
+
+constexpr bool
+test_constexpr()
+{
+#if _GLIBCXX_USE_CXX11_ABI
+ // XXX: this doesn't test the non-forward_range code paths are constexpr.
+ do_test<std::string_view>(std::allocator<char>());
+#endif // _GLIBCXX_USE_CXX11_ABI
+ return true;
+}
+
+int main()
+{
+ test_ranges();
+ static_assert( test_constexpr() );
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/119748.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/119748.cc
new file mode 100644
index 0000000..7d3ba10
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/119748.cc
@@ -0,0 +1,7 @@
+// { dg-do compile }
+
+// Bug 119748
+// string(InputIterator, InputIterator) rejects volatile charT* as iterator
+
+#define TEST_CHAR_TYPE wchar_t
+#include "../char/119748.cc"
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/append_range.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/append_range.cc
new file mode 100644
index 0000000..6c0bc0c
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/append_range.cc
@@ -0,0 +1,125 @@
+// { dg-do run { target c++23 } }
+
+#include <span>
+#include <string>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
+template<typename Range, typename Alloc>
+constexpr void
+do_test()
+{
+ // The vector's value_type.
+ using V = typename std::allocator_traits<Alloc>::value_type;
+ using CT = std::char_traits<V>;
+
+ // The range's value_type.
+ using T = std::ranges::range_value_t<Range>;
+ T a[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
+
+ auto eq = [](const std::basic_string<V, CT, Alloc>& l, std::span<T> r) {
+ if (l.size() != r.size())
+ return false;
+ for (auto i = 0u; i < l.size(); ++i)
+ if (l[i] != r[i])
+ return false;
+ return true;
+ };
+
+ Range r4(a, a+4);
+ Range r5(a+4, a+9);
+ Range r11(a+9, a+20);
+
+ std::basic_string<V, CT, Alloc> v;
+ v.append_range(r4);
+ VERIFY( eq(v, {a, 4}) );
+ v.append_range(r5);
+ VERIFY( eq(v, {a, 9}) );
+
+ std::basic_string<V, CT, Alloc> const s = v;
+ v.append_range(r11);
+ VERIFY( eq(v, a) );
+ v.append_range(Range(a, a));
+ VERIFY( eq(v, a) );
+ v.clear();
+ v.append_range(Range(a, a));
+ VERIFY( v.empty() );
+}
+
+template<typename Range>
+void
+do_test_a()
+{
+ do_test<Range, std::allocator<char>>();
+ do_test<Range, __gnu_test::SimpleAllocator<char>>();
+ do_test<Range, std::allocator<wchar_t>>();
+ do_test<Range, __gnu_test::SimpleAllocator<wchar_t>>();
+}
+
+bool
+test_ranges()
+{
+ using namespace __gnu_test;
+
+ do_test_a<test_forward_range<char>>();
+ do_test_a<test_forward_sized_range<char>>();
+ do_test_a<test_sized_range_sized_sent<char, forward_iterator_wrapper>>();
+
+ do_test_a<test_input_range<char>>();
+ do_test_a<test_input_sized_range<char>>();
+ do_test_a<test_sized_range_sized_sent<char, input_iterator_wrapper>>();
+
+ do_test_a<test_range<char, input_iterator_wrapper_nocopy>>();
+ do_test_a<test_sized_range<char, input_iterator_wrapper_nocopy>>();
+ do_test_a<test_sized_range_sized_sent<char, input_iterator_wrapper_nocopy>>();
+
+ // Not lvalue-convertible to char
+ struct C {
+ C(char v) : val(v) { }
+ operator char() && { return val; }
+ bool operator==(char b) const { return b == val; }
+ char val;
+ };
+ using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
+ do_test<rvalue_input_range, std::allocator<char>>();
+
+ return true;
+}
+
+void
+test_overlapping()
+{
+ std::string const s = "1234abcd";
+
+ std::string c = s;
+ c.append_range(std::string_view(c));
+ VERIFY( c == "1234abcd1234abcd" );
+
+ c = s;
+ c.append_range(std::string_view(c).substr(4, 4));
+ VERIFY( c == "1234abcdabcd" );
+
+ c = s;
+ c.reserve(12);
+ c.append_range(std::string_view(c).substr(0, 4));
+ VERIFY( c == "1234abcd1234" );
+}
+
+constexpr bool
+test_constexpr()
+{
+#if _GLIBCXX_USE_CXX11_ABI
+ // XXX: this doesn't test the non-forward_range code paths are constexpr.
+ do_test<std::string_view, std::allocator<char>>();
+#endif // _GLIBCXX_USE_CXX11_ABI
+ return true;
+}
+
+int main()
+{
+ test_ranges();
+ test_overlapping();
+ static_assert( test_constexpr() );
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/assign_range.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/assign_range.cc
new file mode 100644
index 0000000..310c8bc
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/assign_range.cc
@@ -0,0 +1,116 @@
+// { dg-do run { target c++23 } }
+
+#include <vector>
+#include <span>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+#include <testsuite_allocator.h>
+
+template<typename Range, typename Alloc>
+constexpr void
+do_test()
+{
+ // The vector's value_type.
+ using V = typename std::allocator_traits<Alloc>::value_type;
+ using CT = std::char_traits<V>;
+
+ // The range's value_type.
+ using T = std::ranges::range_value_t<Range>;
+ T a[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
+
+ auto eq = [](const std::basic_string<V, CT, Alloc>& l, std::span<T> r) {
+ if (l.size() != r.size())
+ return false;
+ for (auto i = 0u; i < l.size(); ++i)
+ if (l[i] != r[i])
+ return false;
+ return true;
+ };
+
+ std::basic_string<V, CT, Alloc> v;
+ v.assign_range(Range(a, a));
+ VERIFY( v.empty() );
+ v.assign_range(Range(a, a+4));
+ VERIFY( eq(v, {a, 4}) );
+ v.assign_range(Range(a, a+9));
+ VERIFY( eq(v, {a, 9}) );
+ std::basic_string<V, CT, Alloc> const s = v;
+ v.assign_range(Range(a, a+20));
+ VERIFY( eq(v, {a, 20}) );
+}
+
+template<typename Range>
+void
+do_test_a()
+{
+ do_test<Range, std::allocator<char>>();
+ do_test<Range, __gnu_test::SimpleAllocator<char>>();
+ do_test<Range, std::allocator<wchar_t>>();
+ do_test<Range, __gnu_test::SimpleAllocator<wchar_t>>();
+}
+
+bool
+test_ranges()
+{
+ using namespace __gnu_test;
+
+ do_test_a<test_forward_range<char>>();
+ do_test_a<test_forward_sized_range<char>>();
+ do_test_a<test_sized_range_sized_sent<char, forward_iterator_wrapper>>();
+
+ do_test_a<test_input_range<char>>();
+ do_test_a<test_input_sized_range<char>>();
+ do_test_a<test_sized_range_sized_sent<char, input_iterator_wrapper>>();
+
+ do_test_a<test_range<char, input_iterator_wrapper_nocopy>>();
+ do_test_a<test_sized_range<char, input_iterator_wrapper_nocopy>>();
+ do_test_a<test_sized_range_sized_sent<char, input_iterator_wrapper_nocopy>>();
+
+ // Not lvalue-convertible to char
+ struct C {
+ C(char v) : val(v) { }
+ operator char() && { return val; }
+ bool operator==(char b) const { return b == val; }
+ char val;
+ };
+ using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
+ do_test<rvalue_input_range, std::allocator<char>>();
+
+ return true;
+}
+
+void
+test_overlapping()
+{
+ std::string const s = "1234abcd";
+
+ std::string c = s;
+ c.assign_range(std::string_view(c));
+ VERIFY( c == "1234abcd" );
+
+ c = s;
+ c.assign_range(std::string_view(c).substr(4, 4));
+ VERIFY( c == "abcd" );
+
+ c = s;
+ c.assign_range(std::string_view(c).substr(0, 4));
+ VERIFY( c == "1234" );
+}
+
+constexpr bool
+test_constexpr()
+{
+#if _GLIBCXX_USE_CXX11_ABI
+ // XXX: this doesn't test the non-forward_range code paths are constexpr.
+ do_test<std::string_view, std::allocator<char>>();
+#endif // _GLIBCXX_USE_CXX11_ABI
+ return true;
+}
+
+int main()
+{
+ test_ranges();
+ test_overlapping();
+ static_assert( test_constexpr() );
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/insert_range.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/insert_range.cc
new file mode 100644
index 0000000..4fead32
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/insert_range.cc
@@ -0,0 +1,130 @@
+// { dg-do run { target c++23 } }
+
+#include <span>
+#include <string>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
+template<typename Range, typename Alloc>
+constexpr void
+do_test()
+{
+ // The vector's value_type.
+ using V = typename std::allocator_traits<Alloc>::value_type;
+ using CT = std::char_traits<V>;
+
+ // The range's value_type.
+ using T = std::ranges::range_value_t<Range>;
+ T a[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
+
+ auto eq = [](const std::basic_string<V, CT, Alloc>& l, std::span<T> r) {
+ if (l.size() != r.size())
+ return false;
+ for (auto i = 0u; i < l.size(); ++i)
+ if (l[i] != r[i])
+ return false;
+ return true;
+ };
+
+ std::basic_string<V, CT, Alloc> v;
+ auto it = v.insert_range(v.end(), Range(a, a));
+ VERIFY( v.empty() );
+ VERIFY( it == v.begin() );
+ it = v.insert_range(v.end(), Range(a, a+4));
+ VERIFY( eq(v, {a, 4}) );
+ VERIFY( it == v.begin() );
+ it = v.insert_range(v.end(), Range(a+4, a+9));
+ VERIFY( eq(v, {a, 9}) );
+ VERIFY( it == v.begin()+4 );
+
+ std::basic_string<V, CT, Alloc> s = v;
+ it = v.insert_range(v.end(), Range(a+9, a+20));
+ VERIFY( eq(v, {a, 20}) );
+ VERIFY( it == v.begin()+9 );
+
+ v = std::basic_string<V, CT, Alloc>();
+ it = v.insert_range(v.begin(), Range(a, a+5));
+ VERIFY( it == v.begin() );
+ s = v;
+ it = v.insert_range(v.begin() + 5, Range(a+5, a+20));
+ VERIFY( eq(v, {a, 20}) );
+ VERIFY( it == v.begin()+5 );
+}
+
+template<typename Range>
+void
+do_test_a()
+{
+ do_test<Range, std::allocator<char>>();
+ do_test<Range, __gnu_test::SimpleAllocator<char>>();
+ do_test<Range, std::allocator<wchar_t>>();
+ do_test<Range, __gnu_test::SimpleAllocator<wchar_t>>();
+}
+
+bool
+test_ranges()
+{
+ using namespace __gnu_test;
+
+ do_test_a<test_forward_range<char>>();
+ do_test_a<test_forward_sized_range<char>>();
+ do_test_a<test_sized_range_sized_sent<char, forward_iterator_wrapper>>();
+
+ do_test_a<test_input_range<char>>();
+ do_test_a<test_input_sized_range<char>>();
+ do_test_a<test_sized_range_sized_sent<char, input_iterator_wrapper>>();
+
+ do_test_a<test_range<char, input_iterator_wrapper_nocopy>>();
+ do_test_a<test_sized_range<char, input_iterator_wrapper_nocopy>>();
+ do_test_a<test_sized_range_sized_sent<char, input_iterator_wrapper_nocopy>>();
+
+ // Not lvalue-convertible to char
+ struct C {
+ C(char v) : val(v) { }
+ operator char() && { return val; }
+ bool operator==(char b) const { return b == val; }
+ char val;
+ };
+ using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
+ do_test<rvalue_input_range, std::allocator<char>>();
+
+ return true;
+}
+
+void
+test_overlapping()
+{
+ std::string const s = "1234abcd";
+
+ std::string c = s;
+ c.insert_range(c.end(), std::string_view(c));
+ VERIFY( c == "1234abcd1234abcd" );
+
+ c = s;
+ c.insert_range(c.begin()+4, std::string_view(c).substr(4, 4));
+ VERIFY( c == "1234abcdabcd" );
+
+ c = s;
+ c.reserve(12);
+ c.insert_range(c.begin()+2, std::string_view(c).substr(0, 4));
+ VERIFY( c == "12123434abcd" );
+}
+
+constexpr bool
+test_constexpr()
+{
+#if _GLIBCXX_USE_CXX11_ABI
+ // XXX: this doesn't test the non-forward_range code paths are constexpr.
+ do_test<std::string_view, std::allocator<char>>();
+#endif // _GLIBCXX_USE_CXX11_ABI
+ return true;
+}
+
+int main()
+{
+ test_ranges();
+ test_overlapping();
+ static_assert( test_constexpr() );
+}
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/replace_with_range.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/replace_with_range.cc
new file mode 100644
index 0000000..9acf11a
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/replace_with_range.cc
@@ -0,0 +1,133 @@
+// { dg-do run { target c++23 } }
+
+#include <span>
+#include <string>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+
+template<typename Range, typename Alloc>
+constexpr void
+do_test()
+{
+ // The vector's value_type.
+ using V = typename std::allocator_traits<Alloc>::value_type;
+ using CT = std::char_traits<V>;
+
+ // The range's value_type.
+ using T = std::ranges::range_value_t<Range>;
+ T a[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
+
+ auto eq = [](const std::basic_string<V, CT, Alloc>& l, std::span<T> r) {
+ if (l.size() != r.size())
+ return false;
+ for (auto i = 0u; i < l.size(); ++i)
+ if (l[i] != r[i])
+ return false;
+ return true;
+ };
+
+ std::basic_string<V, CT, Alloc> v;
+ v.replace_with_range(v.end(), v.end(), Range(a, a));
+ VERIFY( v.empty() );
+ v.replace_with_range(v.end(), v.end(), Range(a, a+4));
+ VERIFY( eq(v, {a, 4}) );
+ v.replace_with_range(v.end(), v.end(), Range(a+4, a+9));
+ VERIFY( eq(v, {a, 9}) );
+ std::basic_string<V, CT, Alloc> s = v;
+ v.replace_with_range(v.end(), v.end(), Range(a+9, a+20));
+ VERIFY( eq(v, {a, 20}) );
+
+ v.replace_with_range(v.begin()+10, v.begin()+20, Range(a+5, a+10));
+ VERIFY( v.size() == 15 );
+ v.replace_with_range(v.begin(), v.begin()+10, Range(a, a+5));
+ VERIFY( eq(v, {a, 10}) );
+
+ s = v;
+ v.replace_with_range(v.begin(), v.begin()+4, Range(a, a+8));
+ VERIFY( v.size() == 14 );
+ v.replace_with_range(v.begin()+8, v.begin()+12, Range(a+8, a+16));
+ VERIFY( v.size() == 18 );
+ v.replace_with_range(v.begin()+16, v.begin()+18, Range(a+16, a+20));
+ VERIFY( eq(v, {a, 20}) );
+}
+
+template<typename Range>
+void
+do_test_a()
+{
+ do_test<Range, std::allocator<char>>();
+ do_test<Range, __gnu_test::SimpleAllocator<char>>();
+ do_test<Range, std::allocator<wchar_t>>();
+ do_test<Range, __gnu_test::SimpleAllocator<wchar_t>>();
+}
+
+bool
+test_ranges()
+{
+ using namespace __gnu_test;
+
+ do_test_a<test_forward_range<char>>();
+ do_test_a<test_forward_sized_range<char>>();
+ do_test_a<test_sized_range_sized_sent<char, forward_iterator_wrapper>>();
+
+ do_test_a<test_input_range<char>>();
+ do_test_a<test_input_sized_range<char>>();
+ do_test_a<test_sized_range_sized_sent<char, input_iterator_wrapper>>();
+
+ do_test_a<test_range<char, input_iterator_wrapper_nocopy>>();
+ do_test_a<test_sized_range<char, input_iterator_wrapper_nocopy>>();
+ do_test_a<test_sized_range_sized_sent<char, input_iterator_wrapper_nocopy>>();
+
+ // Not lvalue-convertible to char
+ struct C {
+ C(char v) : val(v) { }
+ operator char() && { return val; }
+ bool operator==(char b) const { return b == val; }
+ char val;
+ };
+ using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
+ do_test<rvalue_input_range, std::allocator<char>>();
+
+ return true;
+}
+
+void
+test_overlapping()
+{
+ std::string const s = "1234abcd";
+
+ std::string c = s;
+ c.replace_with_range(c.end(), c.end(), std::string_view(c));
+ VERIFY( c == "1234abcd1234abcd" );
+
+ c = s;
+ c.replace_with_range(c.begin(), c.begin()+4, std::string_view(c).substr(4, 4));
+ VERIFY( c == "abcdabcd" );
+
+ c = s;
+ c.replace_with_range(c.begin()+2, c.begin()+4, std::string_view(c).substr(0, 4));
+ VERIFY( c == "121234abcd" );
+
+ c = s;
+ c.replace_with_range(c.begin()+2, c.begin()+2, std::string_view(c).substr(0, 4));
+ VERIFY( c == "12123434abcd" );
+}
+
+constexpr bool
+test_constexpr()
+{
+#if _GLIBCXX_USE_CXX11_ABI
+ // XXX: this doesn't test the non-forward_range code paths are constexpr.
+ do_test<std::string_view, std::allocator<char>>();
+#endif // _GLIBCXX_USE_CXX11_ABI
+ return true;
+}
+
+int main()
+{
+ test_ranges();
+ test_overlapping();
+ static_assert( test_constexpr() );
+}
diff --git a/libstdc++-v3/testsuite/23_containers/deque/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/deque/cons/from_range.cc
index 96e994d..48fd196 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/cons/from_range.cc
@@ -1,6 +1,11 @@
// { dg-do run { target c++23 } }
#include <deque>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <deque>"
+#endif
+
#include <span>
#include <testsuite_hooks.h>
#include <testsuite_iterators.h>
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/forward_list/cons/from_range.cc
index 65b378e..aa70105 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/cons/from_range.cc
@@ -1,11 +1,15 @@
// { dg-do run { target c++23 } }
#include <forward_list>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <forward_list>"
+#endif
+
#include <span>
#include <testsuite_hooks.h>
#include <testsuite_iterators.h>
#include <testsuite_allocator.h>
-
void
test_deduction_guide(long* p)
{
diff --git a/libstdc++-v3/testsuite/23_containers/list/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/list/cons/from_range.cc
index 31448b9..107ad74 100644
--- a/libstdc++-v3/testsuite/23_containers/list/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/cons/from_range.cc
@@ -1,6 +1,11 @@
// { dg-do run { target c++23 } }
#include <list>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <list>"
+#endif
+
#include <span>
#include <testsuite_hooks.h>
#include <testsuite_iterators.h>
diff --git a/libstdc++-v3/testsuite/23_containers/map/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/map/cons/from_range.cc
index c740471..9935f44 100644
--- a/libstdc++-v3/testsuite/23_containers/map/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/map/cons/from_range.cc
@@ -1,7 +1,12 @@
// { dg-do run { target c++23 } }
-#include <algorithm>
#include <map>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <map>"
+#endif
+
+#include <algorithm>
#include <ranges>
#include <span>
#include <testsuite_allocator.h>
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/multimap/cons/from_range.cc
index 3e456f5..4a8ea9f 100644
--- a/libstdc++-v3/testsuite/23_containers/multimap/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/multimap/cons/from_range.cc
@@ -1,7 +1,12 @@
// { dg-do run { target c++23 } }
-#include <algorithm>
#include <map>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <map>"
+#endif
+
+#include <algorithm>
#include <ranges>
#include <span>
#include <testsuite_allocator.h>
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/multiset/cons/from_range.cc
index 43821ca..cdba7eb 100644
--- a/libstdc++-v3/testsuite/23_containers/multiset/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/multiset/cons/from_range.cc
@@ -1,8 +1,13 @@
// { dg-do run { target c++23 } }
+#include <set>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <set>"
+#endif
+
#include <algorithm>
#include <ranges>
-#include <set>
#include <span>
#include <testsuite_allocator.h>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/priority_queue/cons_from_range.cc b/libstdc++-v3/testsuite/23_containers/priority_queue/cons_from_range.cc
index 977ef98..87e404b 100644
--- a/libstdc++-v3/testsuite/23_containers/priority_queue/cons_from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/priority_queue/cons_from_range.cc
@@ -1,7 +1,12 @@
// { dg-do run { target c++23 } }
-#include <algorithm>
#include <queue>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <queue>"
+#endif
+
+#include <algorithm>
#include <ranges>
#include <span>
#include <testsuite_allocator.h>
diff --git a/libstdc++-v3/testsuite/23_containers/queue/cons_from_range.cc b/libstdc++-v3/testsuite/23_containers/queue/cons_from_range.cc
index c21f52c..039d084 100644
--- a/libstdc++-v3/testsuite/23_containers/queue/cons_from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/queue/cons_from_range.cc
@@ -1,7 +1,12 @@
// { dg-do run { target c++23 } }
-#include <list>
#include <queue>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <queue>"
+#endif
+
+#include <list>
#include <span>
#include <testsuite_allocator.h>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/set/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/set/cons/from_range.cc
index 869326f..efde05d 100644
--- a/libstdc++-v3/testsuite/23_containers/set/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/set/cons/from_range.cc
@@ -1,8 +1,13 @@
// { dg-do run { target c++23 } }
+#include <set>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <set>"
+#endif
+
#include <algorithm>
#include <ranges>
-#include <set>
#include <span>
#include <testsuite_allocator.h>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/stack/cons_from_range.cc b/libstdc++-v3/testsuite/23_containers/stack/cons_from_range.cc
index e957d0c..2ee52e1 100644
--- a/libstdc++-v3/testsuite/23_containers/stack/cons_from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/stack/cons_from_range.cc
@@ -1,8 +1,13 @@
// { dg-do run { target c++23 } }
+#include <stack>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <span>"
+#endif
+
#include <ranges>
#include <span>
-#include <stack>
#include <testsuite_allocator.h>
#include <testsuite_hooks.h>
#include <testsuite_iterators.h>
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/from_range.cc
index 6d1da5b..36efc2d 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/from_range.cc
@@ -1,7 +1,12 @@
// { dg-do run { target c++23 } }
-#include <algorithm>
#include <unordered_map>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <unordered_map>"
+#endif
+
+#include <algorithm>
#include <span>
#include <testsuite_allocator.h>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_arrow_operator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_arrow_operator_neg.cc
new file mode 100644
index 0000000..09870a7
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_arrow_operator_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_arrow_operator
+ <std::unordered_map<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_const_conversion_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_const_conversion_neg.cc
new file mode 100644
index 0000000..7bfe3a8
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_const_conversion_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_const_conversion
+ <std::unordered_map<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_copy_assignment_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_copy_assignment_neg.cc
new file mode 100644
index 0000000..d3b671b
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_copy_assignment_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_copy_assignment
+ <std::unordered_map<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_copy_construction_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_copy_construction_neg.cc
new file mode 100644
index 0000000..d609671
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_copy_construction_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_copy_construction
+ <std::unordered_map<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_move_assignment_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_move_assignment_neg.cc
new file mode 100644
index 0000000..8d2ed6b
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_move_assignment_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_move_assignment
+ <std::unordered_map<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_move_construction_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_move_construction_neg.cc
new file mode 100644
index 0000000..dd9b7dc
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/invalid_local_iterator_move_construction_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_move_construction
+ <std::unordered_map<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/max_load_factor_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/max_load_factor_neg.cc
index 7fbc453..2596798 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/max_load_factor_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/max_load_factor_neg.cc
@@ -22,7 +22,7 @@
void test01()
{
- std::unordered_multimap<int, int> um;
+ std::unordered_map<int, int> um;
um.max_load_factor(-1.0f);
}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/from_range.cc
index 2ca93d3..b551df4 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/from_range.cc
@@ -1,7 +1,12 @@
// { dg-do run { target c++23 } }
-#include <algorithm>
#include <unordered_map>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <unordered_map>"
+#endif
+
+#include <algorithm>
#include <ranges>
#include <span>
#include <testsuite_allocator.h>
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc
index ff787cf..b2d67fb 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc
@@ -22,8 +22,8 @@
void test01()
{
- std::unordered_map<int, int> um;
- const std::unordered_map<int, int>& cum = um;
+ std::unordered_multimap<int, int> um;
+ const std::unordered_multimap<int, int>& cum = um;
cum.begin(um.bucket_count());
}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc
index b5ddb18..4d5cb84 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc
@@ -22,7 +22,7 @@
void test01()
{
- std::unordered_map<int, int> um;
+ std::unordered_multimap<int, int> um;
um.bucket_size(um.bucket_count());
}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc
index 5ba1da5..654d409 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc
@@ -22,7 +22,7 @@
void test01()
{
- std::unordered_map<int, int> um;
+ std::unordered_multimap<int, int> um;
um.cbegin(um.bucket_count());
}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cend_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cend_neg.cc
index 031be37..f7149d4 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cend_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cend_neg.cc
@@ -22,7 +22,7 @@
void test01()
{
- std::unordered_map<int, int> um;
+ std::unordered_multimap<int, int> um;
um.cend(um.bucket_count());
}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/end1_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/end1_neg.cc
index d412fcf..fd0f981 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/end1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/end1_neg.cc
@@ -22,7 +22,7 @@
void test01()
{
- std::unordered_map<int, int> um;
+ std::unordered_multimap<int, int> um;
um.end(um.bucket_count());
}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/end2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/end2_neg.cc
index 0115351..0c3f86c 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/end2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/end2_neg.cc
@@ -22,8 +22,8 @@
void test01()
{
- std::unordered_map<int, int> um;
- const std::unordered_map<int, int>& cum = um;
+ std::unordered_multimap<int, int> um;
+ const std::unordered_multimap<int, int>& cum = um;
cum.end(um.bucket_count());
}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_arrow_operator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_arrow_operator_neg.cc
new file mode 100644
index 0000000..8b23020
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_arrow_operator_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_arrow_operator
+ <std::unordered_multimap<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_const_conversion_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_const_conversion_neg.cc
new file mode 100644
index 0000000..62c0280
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_const_conversion_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_const_conversion
+ <std::unordered_multimap<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_copy_assignment_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_copy_assignment_neg.cc
new file mode 100644
index 0000000..9ac5b35
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_copy_assignment_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_copy_assignment
+ <std::unordered_multimap<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_copy_construction_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_copy_construction_neg.cc
new file mode 100644
index 0000000..4140272
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_copy_construction_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_copy_construction
+ <std::unordered_multimap<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_move_assignment_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_move_assignment_neg.cc
new file mode 100644
index 0000000..32c847c
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_move_assignment_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_move_assignment
+ <std::unordered_multimap<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_move_construction_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_move_construction_neg.cc
new file mode 100644
index 0000000..124b9ec
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/invalid_local_iterator_move_construction_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_map>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_move_construction
+ <std::unordered_multimap<int, int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/max_load_factor_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/max_load_factor_neg.cc
index 2596798..7fbc453 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/max_load_factor_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/max_load_factor_neg.cc
@@ -22,7 +22,7 @@
void test01()
{
- std::unordered_map<int, int> um;
+ std::unordered_multimap<int, int> um;
um.max_load_factor(-1.0f);
}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/from_range.cc
index 45c3848..d44598d 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/from_range.cc
@@ -1,7 +1,12 @@
// { dg-do run { target c++23 } }
-#include <algorithm>
#include <unordered_set>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <unordered_set>"
+#endif
+
+#include <algorithm>
#include <ranges>
#include <span>
#include <testsuite_allocator.h>
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_arrow_operator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_arrow_operator_neg.cc
new file mode 100644
index 0000000..1677b20
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_arrow_operator_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_arrow_operator
+ <std::unordered_multiset<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_const_conversion_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_const_conversion_neg.cc
new file mode 100644
index 0000000..0d64a41
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_const_conversion_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_const_conversion
+ <std::unordered_multiset<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_copy_assignment_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_copy_assignment_neg.cc
new file mode 100644
index 0000000..b0d7b9f
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_copy_assignment_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_copy_assignment
+ <std::unordered_multiset<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_copy_construction_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_copy_construction_neg.cc
new file mode 100644
index 0000000..fa9c5ee
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_copy_construction_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_copy_construction
+ <std::unordered_multiset<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_move_assignment_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_move_assignment_neg.cc
new file mode 100644
index 0000000..b25fedc
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_move_assignment_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_move_assignment
+ <std::unordered_multiset<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_move_construction_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_move_construction_neg.cc
new file mode 100644
index 0000000..8b855b2
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/invalid_local_iterator_move_construction_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_move_construction
+ <std::unordered_multiset<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/cons/from_range.cc
index 0806045..8259be8 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/cons/from_range.cc
@@ -1,7 +1,12 @@
// { dg-do run { target c++23 } }
-#include <algorithm>
#include <unordered_set>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <unordered_set>"
+#endif
+
+#include <algorithm>
#include <span>
#include <testsuite_allocator.h>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_arrow_operator_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_arrow_operator_neg.cc
new file mode 100644
index 0000000..f62ed6b
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_arrow_operator_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_arrow_operator
+ <std::unordered_set<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_const_conversion_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_const_conversion_neg.cc
new file mode 100644
index 0000000..839f9ae
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_const_conversion_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_const_conversion
+ <std::unordered_set<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_copy_assignment_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_copy_assignment_neg.cc
new file mode 100644
index 0000000..377019f
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_copy_assignment_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_copy_assignment
+ <std::unordered_set<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_copy_construction_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_copy_construction_neg.cc
new file mode 100644
index 0000000..1f7e6dd
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_copy_construction_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_copy_construction
+ <std::unordered_set<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_move_assignment_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_move_assignment_neg.cc
new file mode 100644
index 0000000..d16a154
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_move_assignment_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_move_assignment
+ <std::unordered_set<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_move_construction_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_move_construction_neg.cc
new file mode 100644
index 0000000..d878abf
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/invalid_local_iterator_move_construction_neg.cc
@@ -0,0 +1,17 @@
+// { dg-do run { target c++11 xfail *-*-* } }
+// { dg-require-debug-mode "" }
+
+#include <unordered_set>
+#include <debug/unordered_checks.h>
+
+void test01()
+{
+ __gnu_test::invalid_local_iterator_move_construction
+ <std::unordered_set<int>>();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/bool/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/cons/from_range.cc
index 37f0ecf..339c06bd 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/bool/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/bool/cons/from_range.cc
@@ -1,5 +1,11 @@
// { dg-do run { target c++23 } }
+#include <unordered_set>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <unordered_set>"
+#endif
+
#include <vector>
#include <span>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/bool/format.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/format.cc
index 16f6e86..eb24b66 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/bool/format.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/bool/format.cc
@@ -3,7 +3,6 @@
#include <format>
#include <vector>
-#include <chrono> // For _Widen
#include <testsuite_hooks.h>
static_assert(!std::formattable<std::vector<bool>::reference, int>);
@@ -21,7 +20,7 @@ is_format_string_for(const char* str, Args&&... args)
}
}
-#define WIDEN_(C, S) ::std::chrono::__detail::_Widen<C>(S, L##S)
+#define WIDEN_(C, S) ::std::__format::_Widen<C>(S, L##S)
#define WIDEN(S) WIDEN_(_CharT, S)
void
@@ -57,6 +56,12 @@ test_output()
res = std::format(WIDEN("{:=^#7X}"), v[1]);
VERIFY( res == WIDEN("==0X0==") );
+
+ res = std::format(WIDEN("{}"), v);
+ VERIFY( res == WIDEN("[true, false]") );
+
+ res = std::format(WIDEN("{::d}"), v);
+ VERIFY( res == WIDEN("[1, 0]") );
}
int main()
diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/from_range.cc b/libstdc++-v3/testsuite/23_containers/vector/cons/from_range.cc
index ed2e3ca..7a62645 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/cons/from_range.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/cons/from_range.cc
@@ -1,6 +1,11 @@
// { dg-do run { target c++23 } }
#include <vector>
+
+#if __cpp_lib_containers_ranges != 202202L
+# error "Feature-test macro __cpp_lib_containers_ranges has wrong value in <vector>"
+#endif
+
#include <span>
#include <testsuite_hooks.h>
#include <testsuite_iterators.h>
diff --git a/libstdc++-v3/testsuite/std/format/debug.cc b/libstdc++-v3/testsuite/std/format/debug.cc
new file mode 100644
index 0000000..71bb7f4
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/format/debug.cc
@@ -0,0 +1,455 @@
+// { dg-options "-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32LE -DUNICODE_ENC" { target le } }
+// { dg-options "-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32BE -DUNICODE_ENC" { target be } }
+// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
+
+#include <format>
+#include <testsuite_hooks.h>
+
+std::string
+fdebug(char t)
+{ return std::format("{:?}", t); }
+
+std::wstring
+fdebug(wchar_t t)
+{ return std::format(L"{:?}", t); }
+
+std::string
+fdebug(std::string_view t)
+{ return std::format("{:?}", t); }
+
+std::wstring
+fdebug(std::wstring_view t)
+{ return std::format(L"{:?}", t); }
+
+
+#define WIDEN_(C, S) ::std::__format::_Widen<C>(S, L##S)
+#define WIDEN(S) WIDEN_(_CharT, S)
+
+template<typename _CharT>
+void
+test_basic_escapes()
+{
+ std::basic_string<_CharT> res;
+
+ const auto tab = WIDEN("\t");
+ res = fdebug(tab);
+ VERIFY( res == WIDEN(R"("\t")") );
+ res = fdebug(tab[0]);
+ VERIFY( res == WIDEN(R"('\t')") );
+
+ const auto nline = WIDEN("\n");
+ res = fdebug(nline);
+ VERIFY( res == WIDEN(R"("\n")") );
+ res = fdebug(nline[0]);
+ VERIFY( res == WIDEN(R"('\n')") );
+
+ const auto carret = WIDEN("\r");
+ res = fdebug(carret);
+ VERIFY( res == WIDEN(R"("\r")") );
+ res = fdebug(carret[0]);
+ VERIFY( res == WIDEN(R"('\r')") );
+
+ const auto bslash = WIDEN("\\");
+ res = fdebug(bslash);
+ VERIFY( res == WIDEN(R"("\\")") );
+ res = fdebug(bslash[0]);
+ VERIFY( res == WIDEN(R"('\\')") );
+
+ const auto quote = WIDEN("\"");
+ res = fdebug(quote);
+ VERIFY( res == WIDEN(R"("\"")") );
+ res = fdebug(quote[0]);
+ VERIFY( res == WIDEN(R"('"')") );
+
+ const auto apos = WIDEN("\'");
+ res = fdebug(apos);
+ VERIFY( res == WIDEN(R"("'")") );
+ res = fdebug(apos[0]);
+ VERIFY( res == WIDEN(R"('\'')") );
+}
+
+template<typename _CharT>
+void
+test_ascii_escapes()
+{
+ std::basic_string<_CharT> res;
+
+ const auto in = WIDEN("\x10 abcde\x7f\t0123");
+ res = fdebug(in);
+ VERIFY( res == WIDEN(R"("\u{10} abcde\u{7f}\t0123")") );
+ res = fdebug(in[0]);
+ VERIFY( res == WIDEN(R"('\u{10}')") );
+ res = fdebug(in[1]);
+ VERIFY( res == WIDEN(R"(' ')") );
+ res = fdebug(in[2]);
+ VERIFY( res == WIDEN(R"('a')") );
+}
+
+template<typename _CharT>
+void
+test_extended_ascii()
+{
+ std::basic_string<_CharT> res;
+
+ const auto in = WIDEN("Åëÿ");
+ res = fdebug(in);
+ VERIFY( res == WIDEN(R"("Åëÿ")") );
+
+ static constexpr bool __test_characters
+#if UNICODE_ENC
+ = sizeof(_CharT) >= 2;
+#else // ISO8859-1
+ = true;
+#endif // UNICODE_ENC
+
+ if constexpr (__test_characters)
+ {
+ res = fdebug(in[0]);
+ VERIFY( res == WIDEN(R"('Å')") );
+ res = fdebug(in[1]);
+ VERIFY( res == WIDEN(R"('ë')") );
+ res = fdebug(in[2]);
+ VERIFY( res == WIDEN(R"('ÿ')") );
+ }
+}
+
+#if UNICODE_ENC
+template<typename _CharT>
+void
+test_unicode_escapes()
+{
+ std::basic_string<_CharT> res;
+
+ const auto in = WIDEN(
+ "\u008a" // Cc, Control, Line Tabulation Set,
+ "\u00ad" // Cf, Format, Soft Hyphen
+ "\u1d3d" // Lm, Modifier letter, Modifier Letter Capital Ou
+ "\u00a0" // Zs, Space Separator, No-Break Space (NBSP)
+ "\u2029" // Zp, Paragraph Separator, Paragraph Separator
+ "\U0001f984" // So, Other Symbol, Unicorn Face
+ );
+ const auto out = WIDEN("\""
+ R"(\u{8a})"
+ R"(\u{ad})"
+ "\u1d3d"
+ R"(\u{a0})"
+ R"(\u{2029})"
+ "\U0001f984"
+ "\"");
+
+ res = fdebug(in);
+ VERIFY( res == out );
+
+ if constexpr (sizeof(_CharT) >= 2)
+ {
+ res = fdebug(in[0]);
+ VERIFY( res == WIDEN(R"('\u{8a}')") );
+ res = fdebug(in[1]);
+ VERIFY( res == WIDEN(R"('\u{ad}')") );
+ res = fdebug(in[2]);
+ VERIFY( res == WIDEN("'\u1d3d'") );
+ res = fdebug(in[3]);
+ VERIFY( res == WIDEN(R"('\u{a0}')") );
+ res = fdebug(in[4]);
+ VERIFY( res == WIDEN(R"('\u{2029}')") );
+ }
+
+ if constexpr (sizeof(_CharT) >= 4)
+ {
+ res = fdebug(in[5]);
+ VERIFY( res == WIDEN("'\U0001f984'") );
+ }
+}
+
+template<typename _CharT>
+void
+test_grapheme_extend()
+{
+ std::basic_string<_CharT> res;
+
+ const auto vin = WIDEN("o\u0302\u0323");
+ res = fdebug(vin);
+ VERIFY( res == WIDEN("\"o\u0302\u0323\"") );
+
+ std::basic_string_view<_CharT> in = WIDEN("\t\u0302\u0323");
+ res = fdebug(in);
+ VERIFY( res == WIDEN(R"("\t\u{302}\u{323}")") );
+
+ res = fdebug(in.substr(1));
+ VERIFY( res == WIDEN(R"("\u{302}\u{323}")") );
+
+ if constexpr (sizeof(_CharT) >= 2)
+ {
+ res = fdebug(in[1]);
+ VERIFY( res == WIDEN(R"('\u{302}')") );
+ }
+}
+
+template<typename _CharT>
+void
+test_replacement_char()
+{
+ std::basic_string<_CharT> repl = WIDEN("\uFFFD");
+ std::basic_string<_CharT> res = fdebug(repl);
+ VERIFY( res == WIDEN("\"\uFFFD\"") );
+
+ repl = WIDEN("\uFFFD\uFFFD");
+ res = fdebug(repl);
+ VERIFY( res == WIDEN("\"\uFFFD\uFFFD\"") );
+}
+
+void
+test_ill_formed_utf8_seq()
+{
+ std::string_view seq = "\xf0\x9f\xa6\x84"; // \U0001F984
+ std::string res;
+
+ res = fdebug(seq);
+ VERIFY( res == "\"\U0001F984\"" );
+
+ res = fdebug(seq.substr(1));
+ VERIFY( res == R"("\x{9f}\x{a6}\x{84}")" );
+
+ res = fdebug(seq.substr(2));
+ VERIFY( res == R"("\x{a6}\x{84}")" );
+
+ res = fdebug(seq[0]);
+ VERIFY( res == R"('\x{f0}')" );
+ res = fdebug(seq.substr(0, 1));
+ VERIFY( res == R"("\x{f0}")" );
+
+ res = fdebug(seq[1]);
+ VERIFY( res == R"('\x{9f}')" );
+ res = fdebug(seq.substr(1, 1));
+ VERIFY( res == R"("\x{9f}")" );
+
+ res = fdebug(seq[2]);
+ VERIFY( res == R"('\x{a6}')" );
+ res = fdebug(seq.substr(2, 1));
+ VERIFY( res == R"("\x{a6}")" );
+
+ res = fdebug(seq[3]);
+ VERIFY( res == R"('\x{84}')" );
+ res = fdebug(seq.substr(3, 1));
+ VERIFY( res == R"("\x{84}")" );
+}
+
+void
+test_ill_formed_utf32()
+{
+ std::wstring res;
+
+ wchar_t ic1 = static_cast<wchar_t>(0xff'ffff);
+ res = fdebug(ic1);
+ VERIFY( res == LR"('\x{ffffff}')" );
+
+ std::wstring is1(1, ic1);
+ res = fdebug(is1);
+ VERIFY( res == LR"("\x{ffffff}")" );
+
+ wchar_t ic2 = static_cast<wchar_t>(0xffff'ffff);
+ res = fdebug(ic2);
+ VERIFY( res == LR"('\x{ffffffff}')" );
+
+ std::wstring is2(1, ic2);
+ res = fdebug(is2);
+ VERIFY( res == LR"("\x{ffffffff}")" );
+}
+#endif // UNICODE_ENC
+
+template<typename _CharT>
+void
+test_fill()
+{
+ std::basic_string<_CharT> res;
+
+ std::basic_string_view<_CharT> in = WIDEN("a\t\x10\u00ad");
+ res = std::format(WIDEN("{:10?}"), in.substr(0, 1));
+ VERIFY( res == WIDEN(R"("a" )") );
+
+ res = std::format(WIDEN("{:->10?}"), in.substr(1, 1));
+ VERIFY( res == WIDEN(R"(------"\t")") );
+
+ res = std::format(WIDEN("{:+<10?}"), in.substr(2, 1));
+ VERIFY( res == WIDEN(R"("\u{10}"++)") );
+
+
+ res = std::format(WIDEN("{:10?}"), in[0]);
+ VERIFY( res == WIDEN(R"('a' )") );
+
+ res = std::format(WIDEN("{:->10?}"), in[1]);
+ VERIFY( res == WIDEN(R"(------'\t')") );
+
+ res = std::format(WIDEN("{:+<10?}"), in[2]);
+ VERIFY( res == WIDEN(R"('\u{10}'++)") );
+
+#if UNICODE_ENC
+ res = std::format(WIDEN("{:=^10?}"), in.substr(3));
+ VERIFY( res == WIDEN(R"(="\u{ad}"=)") );
+
+ // width is 2
+ std::basic_string_view<_CharT> in2 = WIDEN("\u1100");
+ res = std::format(WIDEN("{:*^10?}"), in2);
+ VERIFY( res == WIDEN("***\"\u1100\"***") );
+
+ if constexpr (sizeof(_CharT) >= 2)
+ {
+ res = std::format(WIDEN("{:=^10?}"), in[3]);
+ VERIFY( res == WIDEN(R"(='\u{ad}'=)") );
+
+ res = std::format(WIDEN("{:*^10?}"), in2[0]);
+ VERIFY( res == WIDEN("***'\u1100'***") );
+ }
+#endif // UNICODE_ENC
+}
+
+template<typename _CharT>
+void
+test_prec()
+{
+ std::basic_string<_CharT> res;
+ // with ? escpaed presentation is copied to ouput, same as source
+
+ std::basic_string_view<_CharT> in = WIDEN("a\t\x10\u00ad");
+ res = std::format(WIDEN("{:.2?}"), in.substr(0, 1));
+ VERIFY( res == WIDEN(R"("a)") );
+
+ res = std::format(WIDEN("{:.4?}"), in.substr(1, 1));
+ VERIFY( res == WIDEN(R"("\t")") );
+
+ res = std::format(WIDEN("{:.5?}"), in.substr(2, 1));
+ VERIFY( res == WIDEN(R"("\u{1)") );
+
+#if UNICODE_ENC
+ res = std::format(WIDEN("{:.10?}"), in.substr(3));
+ VERIFY( res == WIDEN(R"("\u{ad}")") );
+
+ std::basic_string_view<_CharT> in2 = WIDEN("\u1100");
+ res = std::format(WIDEN("{:.3?}"), in2);
+ VERIFY( res == WIDEN("\"\u1100") );
+#endif // UNICODE_ENC
+}
+
+void test_char_as_wchar()
+{
+ std::wstring res;
+
+ res = std::format(L"{:?}", 'a');
+ VERIFY( res == LR"('a')" );
+
+ res = std::format(L"{:?}", '\t');
+ VERIFY( res == LR"('\t')" );
+
+ res = std::format(L"{:+<10?}", '\x10');
+ VERIFY( res == LR"('\u{10}'++)" );
+}
+
+template<typename T>
+struct DebugWrapper
+{
+ T val;
+};
+
+template<typename T, typename CharT>
+struct std::formatter<DebugWrapper<T>, CharT>
+{
+ constexpr std::basic_format_parse_context<CharT>::iterator
+ parse(std::basic_format_parse_context<CharT>& pc)
+ {
+ auto out = under.parse(pc);
+ under.set_debug_format();
+ return out;
+ }
+
+ template<typename Out>
+ Out format(DebugWrapper<T> const& t,
+ std::basic_format_context<Out, CharT>& fc) const
+ { return under.format(t.val, fc); }
+
+private:
+ std::formatter<T, CharT> under;
+};
+
+template<typename _CharT, typename StrT>
+void
+test_formatter_str()
+{
+ _CharT buf[]{ 'a', 'b', 'c', 0 };
+ DebugWrapper<StrT> in{ buf };
+ std::basic_string<_CharT> res = std::format(WIDEN("{:?}"), in );
+ VERIFY( res == WIDEN(R"("abc")") );
+}
+
+template<typename _CharT>
+void
+test_formatter_arr()
+{
+ std::basic_string<_CharT> res;
+
+ DebugWrapper<_CharT[3]> in3{ 'a', 'b', 'c' };
+ res = std::format(WIDEN("{:?}"), in3 );
+ VERIFY( res == WIDEN(R"("abc")") );
+
+ // We print all characters, including null-terminator
+ DebugWrapper<_CharT[4]> in4{ 'a', 'b', 'c', 0 };
+ res = std::format(WIDEN("{:?}"), in4 );
+ VERIFY( res == WIDEN(R"("abc\u{0}")") );
+}
+
+template<typename _CharT, typename SrcT>
+void
+test_formatter_char()
+{
+ DebugWrapper<SrcT> in{ 'a' };
+ std::basic_string<_CharT> res = std::format(WIDEN("{:?}"), in);
+ VERIFY( res == WIDEN(R"('a')") );
+}
+
+template<typename CharT>
+void
+test_formatters()
+{
+ test_formatter_char<CharT, CharT>();
+ test_formatter_str<CharT, CharT*>();
+ test_formatter_str<CharT, const CharT*>();
+ test_formatter_str<CharT, std::basic_string<CharT>>();
+ test_formatter_str<CharT, std::basic_string_view<CharT>>();
+ test_formatter_arr<CharT>();
+}
+
+void
+test_formatters_c()
+{
+ test_formatters<char>();
+ test_formatters<wchar_t>();
+ test_formatter_char<wchar_t, char>();
+}
+
+int main()
+{
+ test_basic_escapes<char>();
+ test_basic_escapes<wchar_t>();
+ test_ascii_escapes<char>();
+ test_ascii_escapes<wchar_t>();
+ test_extended_ascii<char>();
+ test_extended_ascii<wchar_t>();
+
+#if UNICODE_ENC
+ test_unicode_escapes<char>();
+ test_unicode_escapes<wchar_t>();
+ test_grapheme_extend<char>();
+ test_grapheme_extend<wchar_t>();
+ test_replacement_char<char>();
+ test_replacement_char<wchar_t>();
+ test_ill_formed_utf8_seq();
+ test_ill_formed_utf32();
+#endif // UNICODE_ENC
+
+ test_fill<char>();
+ test_fill<wchar_t>();
+ test_prec<char>();
+ test_prec<wchar_t>();
+
+ test_formatters_c();
+}
diff --git a/libstdc++-v3/testsuite/std/format/debug_nonunicode.cc b/libstdc++-v3/testsuite/std/format/debug_nonunicode.cc
new file mode 100644
index 0000000..2ac7e75
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/format/debug_nonunicode.cc
@@ -0,0 +1,5 @@
+// { dg-options "-fexec-charset=ISO8859-1" }
+// { dg-do run { target c++23 } }
+// { dg-add-options no_pch }
+
+#include "debug.cc"
diff --git a/libstdc++-v3/testsuite/std/format/formatter/lwg3944.cc b/libstdc++-v3/testsuite/std/format/formatter/lwg3944.cc
index ff5f075..1f3edc9 100644
--- a/libstdc++-v3/testsuite/std/format/formatter/lwg3944.cc
+++ b/libstdc++-v3/testsuite/std/format/formatter/lwg3944.cc
@@ -4,6 +4,7 @@
// LWG 3944. Formatters converting sequences of char to sequences of wchar_t
#include <format>
+#include <vector>
void test_lwg3944()
{
@@ -14,11 +15,10 @@ void test_lwg3944()
std::format(L"{}",cstr); // { dg-error "here" }
// Ill-formed in C++20
- // In C++23 they give L"['h', 'e', 'l', 'l', 'o']"
std::format(L"{}", "hello"); // { dg-error "here" }
std::format(L"{}", std::string_view("hello")); // { dg-error "here" }
std::format(L"{}", std::string("hello")); // { dg-error "here" }
-#ifdef __cpp_lib_format_ranges
+#ifdef __glibcxx_format_ranges
// LWG 3944 does not change this, it's still valid.
std::format(L"{}", std::vector{'h', 'e', 'l', 'l', 'o'});
#endif
diff --git a/libstdc++-v3/testsuite/std/format/formatter/requirements.cc b/libstdc++-v3/testsuite/std/format/formatter/requirements.cc
index 416b9a8..1c9a0a5 100644
--- a/libstdc++-v3/testsuite/std/format/formatter/requirements.cc
+++ b/libstdc++-v3/testsuite/std/format/formatter/requirements.cc
@@ -70,12 +70,14 @@ test_specializations() // [format.formatter.spec]
// LWG 3833. Remove specialization
// template<size_t N> struct formatter<const charT[N], charT>
- using Farr = std::format_context::formatter_type<const char[1]>;
- static_assert( ! std::is_default_constructible_v<Farr> );
- static_assert( ! std::is_copy_constructible_v<Farr> );
- static_assert( ! std::is_move_constructible_v<Farr> );
- static_assert( ! std::is_copy_assignable_v<Farr> );
- static_assert( ! std::is_move_assignable_v<Farr> );
+ // Formatter is only expected to be instantiated with only cv-unqual types
+ // and attempting to instantiate this specialization is ill-formed
+ // using Farr = std::format_context::formatter_type<const char[1]>;
+ // static_assert( ! std::is_default_constructible_v<Farr> );
+ // static_assert( ! std::is_copy_constructible_v<Farr> );
+ // static_assert( ! std::is_move_constructible_v<Farr> );
+ // static_assert( ! std::is_copy_assignable_v<Farr> );
+ // static_assert( ! std::is_move_assignable_v<Farr> );
}
int main()
diff --git a/libstdc++-v3/testsuite/std/format/parse_ctx.cc b/libstdc++-v3/testsuite/std/format/parse_ctx.cc
index b5dd7cd..b338ac7 100644
--- a/libstdc++-v3/testsuite/std/format/parse_ctx.cc
+++ b/libstdc++-v3/testsuite/std/format/parse_ctx.cc
@@ -108,7 +108,7 @@ is_std_format_spec_for(std::string_view spec)
}
}
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges
constexpr bool escaped_strings_supported = true;
#else
constexpr bool escaped_strings_supported = false;
diff --git a/libstdc++-v3/testsuite/std/format/ranges/format_kind.cc b/libstdc++-v3/testsuite/std/format/ranges/format_kind.cc
new file mode 100644
index 0000000..14b9ff2
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/format/ranges/format_kind.cc
@@ -0,0 +1,94 @@
+// { dg-do run { target c++23 } }
+
+#include <deque>
+#include <flat_map>
+#include <flat_set>
+#include <format>
+#include <list>
+#include <map>
+#include <set>
+#include <testsuite_hooks.h>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+static_assert( std::format_kind<std::vector<int>> == std::range_format::sequence );
+static_assert( std::format_kind<std::deque<int>> == std::range_format::sequence );
+static_assert( std::format_kind<std::list<int>> == std::range_format::sequence );
+
+static_assert( std::format_kind<std::set<int>> == std::range_format::set );
+static_assert( std::format_kind<std::multiset<int>> == std::range_format::set );
+static_assert( std::format_kind<std::unordered_set<int>> == std::range_format::set );
+static_assert( std::format_kind<std::unordered_multiset<int>> == std::range_format::set );
+static_assert( std::format_kind<std::flat_set<int>> == std::range_format::set );
+static_assert( std::format_kind<std::flat_multiset<int>> == std::range_format::set );
+
+static_assert( std::format_kind<std::map<int, int>> == std::range_format::map );
+static_assert( std::format_kind<std::multimap<int, int>> == std::range_format::map );
+static_assert( std::format_kind<std::unordered_map<int, int>> == std::range_format::map );
+static_assert( std::format_kind<std::unordered_multimap<int, int>> == std::range_format::map );
+static_assert( std::format_kind<std::flat_map<int, int>> == std::range_format::map );
+static_assert( std::format_kind<std::flat_multimap<int, int>> == std::range_format::map );
+
+template<typename T>
+struct MyVec : std::vector<T>
+{};
+
+static_assert( std::format_kind<MyVec<int>> == std::range_format::sequence );
+
+template<typename T>
+struct MySet : std::vector<T>
+{
+ using key_type = T;
+};
+
+static_assert( std::format_kind<MySet<int>> == std::range_format::set );
+
+template<typename T>
+struct MyMap : std::vector<T>
+{
+ using key_type = T;
+ using mapped_type = int;
+};
+
+static_assert( std::format_kind<MyMap<std::pair<int, int>>> == std::range_format::map );
+static_assert( std::format_kind<MyMap<std::tuple<int, int>>> == std::range_format::map );
+static_assert( std::format_kind<MyMap<int>> == std::range_format::set );
+
+template<typename T, std::range_format rf>
+struct CustFormat : std::vector<T>
+{
+ using std::vector<T>::vector;
+};
+
+template<typename T, std::range_format rf>
+constexpr auto std::format_kind<CustFormat<T, rf>> = rf;
+
+void test_override()
+{
+ CustFormat<int, std::range_format::disabled> disabledf;
+ static_assert( !std::formattable<decltype(disabledf), char> );
+
+ CustFormat<int, std::range_format::sequence> seqf{1, 2, 3};
+ VERIFY( std::format("{}", seqf) == "[1, 2, 3]" );
+
+ CustFormat<int, std::range_format::set> setf{1, 2, 3};
+ VERIFY( std::format("{}", setf) == "{1, 2, 3}" );
+
+ // TODO test map once formatter for pair is implenented
+
+ CustFormat<char, std::range_format::string> stringf{'a', 'b', 'c', 'd'};
+ VERIFY( std::format("{}", stringf) == "abcd" );
+ // Support precision as string do
+ VERIFY( std::format("{:.2}", stringf) == "ab" );
+
+ CustFormat<char, std::range_format::debug_string> debugf{'a', 'b', 'c', 'd'};
+ VERIFY( std::format("{}", debugf) == R"("abcd")" );
+ // Support precision as string do
+ VERIFY( std::format("{:.3}", debugf) == R"("ab)" );
+}
+
+int main()
+{
+ test_override();
+}
diff --git a/libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc b/libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc
new file mode 100644
index 0000000..bf8619d
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/format/ranges/format_kind_neg.cc
@@ -0,0 +1,13 @@
+// { dg-do compile { target c++23 } }
+
+// C++23 22.14.7.1 [format.range.fmtkind] p1: A program that instantiates
+// the primary template of format_kind is ill-formed.
+
+#include <format>
+
+template<auto> struct Tester { };
+
+Tester<std::format_kind<const int(&)[1]>> t; // { dg-error "here" }
+
+// { dg-error "use of 'std::format_kind" "" { target *-*-* } 0 }
+// { dg-error "primary_template_not_defined" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/std/format/ranges/formatter.cc b/libstdc++-v3/testsuite/std/format/ranges/formatter.cc
new file mode 100644
index 0000000..00ce9f6
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/format/ranges/formatter.cc
@@ -0,0 +1,171 @@
+// { dg-do run { target c++23 } }
+
+#include <flat_map>
+#include <format>
+#include <testsuite_hooks.h>
+#include <vector>
+
+#define WIDEN_(C, S) ::std::__format::_Widen<C>(S, L##S)
+#define WIDEN(S) WIDEN_(_CharT, S)
+
+template<typename T,
+ template<typename, typename> class Formatter = std::range_formatter>
+struct MyVector : std::vector<T>
+{
+ using std::vector<T>::vector;
+};
+
+template<typename T,
+ template<typename, typename> class Formatter,
+ typename CharT>
+struct std::formatter<MyVector<T, Formatter>, CharT>
+{
+ constexpr formatter() noexcept
+ {
+ using _CharT = CharT;
+ _formatter.set_brackets(WIDEN("<"), WIDEN(">"));
+ _formatter.set_separator(WIDEN("; "));
+ }
+
+ constexpr std::basic_format_parse_context<CharT>::iterator
+ parse(std::basic_format_parse_context<CharT>& pc)
+ { return _formatter.parse(pc); }
+
+ template<typename Out>
+ typename std::basic_format_context<Out, CharT>::iterator
+ format(const MyVector<T, Formatter>& mv,
+ std::basic_format_context<Out, CharT>& fc) const
+ { return _formatter.format(mv, fc); }
+
+private:
+ Formatter<T, CharT> _formatter;
+};
+
+template<typename _CharT, template<typename, typename> class Formatter>
+void
+test_default()
+{
+ MyVector<int, Formatter> vec{1, 2, 3};
+ std::basic_string<_CharT> res;
+
+ res = std::format(WIDEN("{}"), vec);
+ VERIFY( res == WIDEN("<1; 2; 3>") );
+ res = std::format(WIDEN("{:}"), vec);
+ VERIFY( res == WIDEN("<1; 2; 3>") );
+ res = std::format(WIDEN("{:n}"), vec);
+ VERIFY( res == WIDEN("1; 2; 3") );
+
+ res = std::format(WIDEN("{:3}"), vec);
+ VERIFY( res == WIDEN("<1; 2; 3>") );
+
+ res = std::format(WIDEN("{:10}"), vec);
+ VERIFY( res == WIDEN("<1; 2; 3> ") );
+
+ res = std::format(WIDEN("{:{}}"), vec, 10);
+ VERIFY( res == WIDEN("<1; 2; 3> ") );
+
+ res = std::format(WIDEN("{1:{0}}"), 10, vec);
+ VERIFY( res == WIDEN("<1; 2; 3> ") );
+
+ res = std::format(WIDEN("{:10n}"), vec);
+ VERIFY( res == WIDEN("1; 2; 3 ") );
+
+ res = std::format(WIDEN("{:*<11}"), vec);
+ VERIFY( res == WIDEN("<1; 2; 3>**") );
+
+ res = std::format(WIDEN("{:->12}"), vec);
+ VERIFY( res == WIDEN("---<1; 2; 3>") );
+
+ res = std::format(WIDEN("{:=^13}"), vec);
+ VERIFY( res == WIDEN("==<1; 2; 3>==") );
+
+ res = std::format(WIDEN("{:=^13n}"), vec);
+ VERIFY( res == WIDEN("===1; 2; 3===") );
+
+ res = std::format(WIDEN("{::#x}"), vec);
+ VERIFY( res == WIDEN("<0x1; 0x2; 0x3>") );
+
+ res = std::format(WIDEN("{:|^25n:#05x}"), vec);
+ VERIFY( res == WIDEN("|||0x001; 0x002; 0x003|||") );
+
+ // ':' is start of the format string for element
+ res = std::format(WIDEN("{::^+4}"), vec);
+ VERIFY( res == WIDEN("< +1 ; +2 ; +3 >") );
+}
+
+template<typename _CharT, template<typename, typename> class Formatter>
+void
+test_override()
+{
+ MyVector<_CharT, Formatter> vc{'a', 'b', 'c', 'd'};
+ MyVector<std::pair<int, int>, Formatter> vp{{1, 11}, {2, 21}};
+ std::basic_string<_CharT> res;
+
+ res = std::format(WIDEN("{:s}"), vc);
+ VERIFY( res == WIDEN("abcd") );
+ res = std::format(WIDEN("{:?s}"), vc);
+ VERIFY( res == WIDEN("\"abcd\"") );
+ res = std::format(WIDEN("{:+^6s}"), vc);
+ VERIFY( res == WIDEN("+abcd+") );
+
+ res = std::format(WIDEN("{:m}"), vp);
+ VERIFY( res == WIDEN("{1: 11, 2: 21}") );
+ res = std::format(WIDEN("{:=^20m}"), vp);
+ VERIFY( res == WIDEN("==={1: 11, 2: 21}===") );
+}
+
+template<template<typename, typename> class Formatter>
+void test_outputs()
+{
+ test_default<char, Formatter>();
+ test_default<wchar_t, Formatter>();
+ test_override<char, Formatter>();
+ test_override<wchar_t, Formatter>();
+}
+
+void
+test_nested()
+{
+ MyVector<MyVector<int>> v
+ {
+ {1, 2},
+ {11, 12}
+ };
+
+ std::string res = std::format("{}", v);
+ VERIFY( res == "<<1; 2>; <11; 12>>" );
+
+ res = std::format("{:+^18:n:02}", v);
+ VERIFY( res == "+<01; 02; 11; 12>+" );
+}
+
+struct MyFlatMap : std::flat_map<int, int>
+{
+ using std::flat_map<int, int>::flat_map;
+};
+
+template<typename CharT>
+struct std::formatter<MyFlatMap, CharT>
+ // This cannot apply format BitVector const&, because formatted type would
+ // be std::pair<int const&, int const&>, and formatter for
+ // pair<int const&, int> cannot format it.
+ : std::range_formatter<MyFlatMap::reference>
+{};
+
+void test_const_ref_type_mismatch()
+{
+ MyFlatMap m{{1, 11}, {2, 22}};
+ std::string res = std::format("{:m}", m);
+ VERIFY( res == "{1: 11, 2: 22}" );
+}
+
+template<typename T, typename CharT>
+using VectorFormatter = std::formatter<std::vector<T>, CharT>;
+
+int main()
+{
+ test_outputs<std::range_formatter>();
+ test_outputs<VectorFormatter>();
+ test_nested();
+ test_const_ref_type_mismatch();
+}
diff --git a/libstdc++-v3/testsuite/std/format/ranges/map.cc b/libstdc++-v3/testsuite/std/format/ranges/map.cc
new file mode 100644
index 0000000..34c5ed5
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/format/ranges/map.cc
@@ -0,0 +1,209 @@
+// { dg-do run { target c++23 } }
+
+#include <flat_map>
+#include <format>
+#include <list>
+#include <map>
+#include <span>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+#include <vector>
+
+struct NotFormattable
+{
+ friend auto operator<=>(NotFormattable, NotFormattable) = default;
+};
+
+static_assert( !std::formattable<std::map<int, NotFormattable>, char> );
+static_assert( !std::formattable<std::map<NotFormattable, int>, wchar_t> );
+
+template<typename... Args>
+bool
+is_format_string_for(const char* str, Args&&... args)
+{
+ try {
+ (void) std::vformat(str, std::make_format_args(args...));
+ return true;
+ } catch (const std::format_error&) {
+ return false;
+ }
+}
+
+template<typename... Args>
+bool
+is_format_string_for(const wchar_t* str, Args&&... args)
+{
+ try {
+ (void) std::vformat(str, std::make_wformat_args(args...));
+ return true;
+ } catch (const std::format_error&) {
+ return false;
+ }
+}
+
+template<typename Rg, typename CharT>
+bool is_range_formatter_spec_for(CharT const* spec, Rg&& rg)
+{
+ using V = std::remove_cvref_t<std::ranges::range_reference_t<Rg>>;
+ std::range_formatter<V, CharT> fmt;
+ std::basic_format_parse_context<CharT> pc(spec);
+ try {
+ (void)fmt.parse(pc);
+ return true;
+ } catch (const std::format_error&) {
+ return false;
+ }
+}
+
+#define WIDEN_(C, S) ::std::__format::_Widen<C>(S, L##S)
+#define WIDEN(S) WIDEN_(_CharT, S)
+
+void
+test_format_string()
+{
+ // only pair<T, U> amd tuple<T, U> value types are supported
+ VERIFY( !is_range_formatter_spec_for("m", std::vector<int>()) );
+ VERIFY( !is_format_string_for("{:m}", std::vector<int>()) );
+ VERIFY( !is_range_formatter_spec_for("m", std::vector<std::tuple<int, int, int>>()) );
+ VERIFY( !is_format_string_for("{:m}", std::vector<std::tuple<int, int, int>>()) );
+
+ // invalid format stringss
+ VERIFY( !is_range_formatter_spec_for("?m", std::vector<std::pair<int, int>>()) );
+ VERIFY( !is_format_string_for("{:?m}", std::vector<std::pair<int, int>>()) );
+ VERIFY( !is_range_formatter_spec_for("m:", std::vector<std::pair<int, int>>()) );
+ VERIFY( !is_format_string_for("{:m:}", std::vector<std::pair<int, int>>()) );
+
+ // precision is not supported
+ VERIFY( !is_range_formatter_spec_for(".10m", std::vector<std::pair<int, int>>()) );
+ VERIFY( !is_format_string_for("{:.10m}", std::vector<std::pair<int, int>>()) );
+ VERIFY( !is_format_string_for("{:.{}m}", std::vector<std::pair<int, int>>(), 10) );
+
+ // width needs to be integer type
+ VERIFY( !is_format_string_for("{:{}m}", std::vector<std::pair<int, int>>(), 1.0f) );
+}
+
+template<typename _CharT, typename Range>
+void test_output(bool mapIsDefault)
+{
+ using Sv = std::basic_string_view<_CharT>;
+ using Pt = std::ranges::range_value_t<Range>;
+ using Ft = std::remove_cvref_t<std::tuple_element_t<0, Pt>>;
+ using St = std::remove_cvref_t<std::tuple_element_t<1, Pt>>;
+ auto makeRange = [](std::span<Pt> s) {
+ return Range(s.data(), s.data() + s.size());
+ };
+
+ std::basic_string<_CharT> res;
+ size_t size = 0;
+
+ Ft f1[]{1, 2, 3};
+ St s1[]{11, 22, 33};
+ Pt v1[]{{f1[0], s1[0]}, {f1[1], s1[1]}, {f1[2], s1[2]}};
+
+ res = std::format(WIDEN("{}"), makeRange(v1));
+ if (mapIsDefault)
+ VERIFY( res == WIDEN("{1: 11, 2: 22, 3: 33}") );
+ else
+ VERIFY( res == WIDEN("[(1, 11), (2, 22), (3, 33)]") );
+
+ res = std::format(WIDEN("{:m}"), makeRange(v1));
+ VERIFY( res == WIDEN("{1: 11, 2: 22, 3: 33}") );
+ res = std::format(WIDEN("{:nm}"), makeRange(v1));
+ VERIFY( res == WIDEN("1: 11, 2: 22, 3: 33") );
+
+ res = std::format(WIDEN("{:3m}"), makeRange(v1));
+ VERIFY( res == WIDEN("{1: 11, 2: 22, 3: 33}") );
+
+ res = std::format(WIDEN("{:25m}"), makeRange(v1));
+ VERIFY( res == WIDEN("{1: 11, 2: 22, 3: 33} ") );
+
+ res = std::format(WIDEN("{:{}m}"), makeRange(v1), 25);
+ VERIFY( res == WIDEN("{1: 11, 2: 22, 3: 33} ") );
+
+ res = std::format(WIDEN("{1:{0}m}"), 25, makeRange(v1));
+ VERIFY( res == WIDEN("{1: 11, 2: 22, 3: 33} ") );
+
+ res = std::format(WIDEN("{:25nm}"), makeRange(v1));
+ VERIFY( res == WIDEN("1: 11, 2: 22, 3: 33 ") );
+
+ res = std::format(WIDEN("{:*<23m}"), makeRange(v1));
+ VERIFY( res == WIDEN("{1: 11, 2: 22, 3: 33}**") );
+
+ res = std::format(WIDEN("{:->24m}"), makeRange(v1));
+ VERIFY( res == WIDEN("---{1: 11, 2: 22, 3: 33}") );
+
+ res = std::format(WIDEN("{:=^25m}"), makeRange(v1));
+ VERIFY( res == WIDEN("=={1: 11, 2: 22, 3: 33}==") );
+
+ res = std::format(WIDEN("{:=^25nm}"), makeRange(v1));
+ VERIFY( res == WIDEN("===1: 11, 2: 22, 3: 33===") );
+
+ size = std::formatted_size(WIDEN("{:m}"), makeRange(v1));
+ VERIFY( size == Sv(WIDEN("{1: 11, 2: 22, 3: 33}")).size() );
+
+ size = std::formatted_size(WIDEN("{:3m}"), makeRange(v1));
+ VERIFY( size == Sv(WIDEN("{1: 11, 2: 22, 3: 33}")).size() );
+
+ size = std::formatted_size(WIDEN("{:25m}"), makeRange(v1));
+ VERIFY( size == 25 );
+}
+
+template<class Range>
+void test_output_c(bool mapIsDefault = false)
+{
+ test_output<char, Range>(mapIsDefault);
+ test_output<wchar_t, Range>(mapIsDefault);
+}
+
+template<template<typename> class RangeT>
+void test_output_pc()
+{
+ test_output_c<RangeT<std::pair<int, int>>>();
+ test_output_c<RangeT<std::pair<const int, int>>>();
+ test_output_c<RangeT<std::tuple<const int&, int&>>>();
+}
+
+void
+test_outputs()
+{
+ using namespace __gnu_test;
+ test_output_c<std::map<int, int>>(true);
+ test_output_c<std::flat_map<int, int>>(true);
+
+ test_output_pc<std::vector>();
+ test_output_pc<std::list>();
+ test_output_pc<std::span>();
+
+ test_output_pc<test_forward_range>();
+ test_output_pc<test_input_range>();
+ test_output_pc<test_input_range_nocopy>();
+}
+
+void
+test_nested()
+{
+ std::vector<std::map<int, std::string>> vm{
+ {{1, "one"}, {2, "two"}},
+ {{1, "jeden"}, {2, "dwa"}},
+ };
+ std::string res;
+
+ res = std::format("{}", vm);
+ VERIFY( res == R"([{1: "one", 2: "two"}, {1: "jeden", 2: "dwa"}])" );
+ res = std::format("{:n:n}", vm);
+ VERIFY( res == R"(1: "one", 2: "two", 1: "jeden", 2: "dwa")" );
+
+ std::map<std::string, std::vector<std::string>> mv{
+ {"english", {"zero", "one", "two"}},
+ {"polish", {"zero", "jeden", "dwa"}},
+ };
+ res = std::format("{}", mv);
+ VERIFY( res == R"({"english": ["zero", "one", "two"], "polish": ["zero", "jeden", "dwa"]})" );
+}
+
+int main()
+{
+ test_format_string();
+ test_outputs();
+ test_nested();
+}
diff --git a/libstdc++-v3/testsuite/std/format/ranges/sequence.cc b/libstdc++-v3/testsuite/std/format/ranges/sequence.cc
new file mode 100644
index 0000000..61fc68e
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/format/ranges/sequence.cc
@@ -0,0 +1,206 @@
+// { dg-do run { target c++23 } }
+
+#include <array>
+#include <format>
+#include <list>
+#include <ranges>
+#include <span>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+#include <vector>
+
+struct NotFormattable
+{};
+
+static_assert(!std::formattable<std::vector<NotFormattable>, char>);
+static_assert(!std::formattable<std::span<NotFormattable>, wchar_t>);
+
+template<typename... Args>
+bool
+is_format_string_for(const char* str, Args&&... args)
+{
+ try {
+ (void) std::vformat(str, std::make_format_args(args...));
+ return true;
+ } catch (const std::format_error&) {
+ return false;
+ }
+}
+
+template<typename... Args>
+bool
+is_format_string_for(const wchar_t* str, Args&&... args)
+{
+ try {
+ (void) std::vformat(str, std::make_wformat_args(args...));
+ return true;
+ } catch (const std::format_error&) {
+ return false;
+ }
+}
+
+template<typename Rg, typename CharT>
+bool is_range_formatter_spec_for(CharT const* spec, Rg&& rg)
+{
+ using V = std::remove_cvref_t<std::ranges::range_reference_t<Rg>>;
+ std::range_formatter<V, CharT> fmt;
+ std::basic_format_parse_context<CharT> pc(spec);
+ try {
+ (void)fmt.parse(pc);
+ return true;
+ } catch (const std::format_error&) {
+ return false;
+ }
+}
+
+void
+test_format_string()
+{
+ // invalid format spec 'p'
+ VERIFY( !is_range_formatter_spec_for("p", std::vector<int>()) );
+ VERIFY( !is_format_string_for("{:p}", std::vector<int>()) );
+ VERIFY( !is_range_formatter_spec_for("np", std::vector<int>()) );
+ VERIFY( !is_format_string_for("{:np}", std::vector<int>()) );
+
+ // width needs to be integer type
+ VERIFY( !is_format_string_for("{:{}}", std::vector<int>(), 1.0f) );
+
+ // element format needs to be valid
+ VERIFY( !is_range_formatter_spec_for(":p", std::vector<int>()) );
+ VERIFY( !is_format_string_for("{::p}", std::vector<int>()) );
+ VERIFY( !is_range_formatter_spec_for("n:p", std::vector<int>()) );
+ VERIFY( !is_format_string_for("{:n:p}", std::vector<int>()) );
+}
+
+#define WIDEN_(C, S) ::std::__format::_Widen<C>(S, L##S)
+#define WIDEN(S) WIDEN_(_CharT, S)
+
+template<typename _CharT, typename Range, typename Storage>
+void test_output()
+{
+ using Sv = std::basic_string_view<_CharT>;
+ using T = std::ranges::range_value_t<Range>;
+ auto makeRange = [](Storage& s) -> Range {
+ if constexpr (std::is_same_v<std::remove_cvref_t<Range>, Storage>)
+ return s;
+ else
+ return Range(std::ranges::data(s),
+ std::ranges::data(s) + std::ranges::size(s));
+ };
+
+ std::basic_string<_CharT> res;
+ size_t size = 0;
+
+ Storage v1{1, 2, 3};
+ res = std::format(WIDEN("{}"), makeRange(v1));
+ VERIFY( res == WIDEN("[1, 2, 3]") );
+ res = std::format(WIDEN("{:}"), makeRange(v1));
+ VERIFY( res == WIDEN("[1, 2, 3]") );
+ res = std::format(WIDEN("{:n}"), makeRange(v1));
+ VERIFY( res == WIDEN("1, 2, 3") );
+
+ res = std::format(WIDEN("{:3}"), makeRange(v1));
+ VERIFY( res == WIDEN("[1, 2, 3]") );
+
+ res = std::format(WIDEN("{:10}"), makeRange(v1));
+ VERIFY( res == WIDEN("[1, 2, 3] ") );
+
+ res = std::format(WIDEN("{:{}}"), makeRange(v1), 10);
+ VERIFY( res == WIDEN("[1, 2, 3] ") );
+
+ res = std::format(WIDEN("{1:{0}}"), 10, makeRange(v1));
+ VERIFY( res == WIDEN("[1, 2, 3] ") );
+
+ res = std::format(WIDEN("{:10n}"), makeRange(v1));
+ VERIFY( res == WIDEN("1, 2, 3 ") );
+
+ res = std::format(WIDEN("{:*<11}"), makeRange(v1));
+ VERIFY( res == WIDEN("[1, 2, 3]**") );
+
+ res = std::format(WIDEN("{:->12}"), makeRange(v1));
+ VERIFY( res == WIDEN("---[1, 2, 3]") );
+
+ res = std::format(WIDEN("{:=^13}"), makeRange(v1));
+ VERIFY( res == WIDEN("==[1, 2, 3]==") );
+
+ res = std::format(WIDEN("{:=^13n}"), makeRange(v1));
+ VERIFY( res == WIDEN("===1, 2, 3===") );
+
+ res = std::format(WIDEN("{::#x}"), makeRange(v1));
+ VERIFY( res == WIDEN("[0x1, 0x2, 0x3]") );
+
+ res = std::format(WIDEN("{:|^25n:#05x}"), makeRange(v1));
+ VERIFY( res == WIDEN("|||0x001, 0x002, 0x003|||") );
+
+ // ':' is start of the format string for element
+ res = std::format(WIDEN("{::^+04}"), makeRange(v1));
+ VERIFY( res == WIDEN("[ +1 , +2 , +3 ]") );
+
+ size = std::formatted_size(WIDEN("{:}"), makeRange(v1));
+ VERIFY( size == Sv(WIDEN("[1, 2, 3]")).size() );
+
+ size = std::formatted_size(WIDEN("{:3}"), makeRange(v1));
+ VERIFY( size == Sv(WIDEN("[1, 2, 3]")).size() );
+
+ size = std::formatted_size(WIDEN("{:10}"), makeRange(v1));
+ VERIFY( size == 10 );
+
+ size = std::formatted_size(WIDEN("{:|^25n:#05x}"), makeRange(v1));
+ VERIFY( size == 25 );
+}
+
+template<typename Cont>
+void test_output_cont()
+{
+ test_output<char, Cont&, Cont>();
+ test_output<wchar_t, Cont const&, Cont>();
+}
+
+template<typename View>
+void test_output_view()
+{
+ test_output<char, View, int[3]>();
+ test_output<wchar_t, View, int[3]>();
+}
+
+void
+test_outputs()
+{
+ using namespace __gnu_test;
+ test_output_cont<std::vector<int>>();
+ test_output_cont<std::list<int>>();
+ test_output_cont<std::array<int, 3>>();
+
+ test_output_view<std::span<int>>();
+ test_output_view<std::ranges::subrange<int*>>();
+ test_output_view<test_forward_range<int>>();
+ test_output_view<test_input_range<int>>();
+ test_output_view<test_input_range_nocopy<int>>();
+
+ test_output_view<std::span<const int>>();
+ test_output_view<std::ranges::subrange<const int*>>();
+ test_output_view<test_forward_range<const int>>();
+}
+
+void
+test_nested()
+{
+ std::vector<std::vector<int>> v
+ {
+ {1, 2},
+ {11, 12}
+ };
+
+ std::string res = std::format("{}", v);
+ VERIFY( res == "[[1, 2], [11, 12]]" );
+
+ res = std::format("{:+^18:n:02}", v);
+ VERIFY( res == "+[01, 02, 11, 12]+" );
+}
+
+int main()
+{
+ test_format_string();
+ test_outputs();
+ test_nested();
+}
diff --git a/libstdc++-v3/testsuite/std/format/ranges/string.cc b/libstdc++-v3/testsuite/std/format/ranges/string.cc
new file mode 100644
index 0000000..7f59f59
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/format/ranges/string.cc
@@ -0,0 +1,226 @@
+// { dg-do run { target c++23 } }
+
+#include <format>
+#include <span>
+#include <testsuite_hooks.h>
+#include <testsuite_iterators.h>
+#include <vector>
+
+template<typename... Args>
+bool
+is_format_string_for(const char* str, Args&&... args)
+{
+ try {
+ (void) std::vformat(str, std::make_format_args(args...));
+ return true;
+ } catch (const std::format_error&) {
+ return false;
+ }
+}
+
+template<typename... Args>
+bool
+is_format_string_for(const wchar_t* str, Args&&... args)
+{
+ try {
+ (void) std::vformat(str, std::make_wformat_args(args...));
+ return true;
+ } catch (const std::format_error&) {
+ return false;
+ }
+}
+
+template<typename Rg, typename CharT>
+bool is_range_formatter_spec_for(CharT const* spec, Rg&& rg)
+{
+ using V = std::remove_cvref_t<std::ranges::range_reference_t<Rg>>;
+ std::range_formatter<V, CharT> fmt;
+ std::basic_format_parse_context<CharT> pc(spec);
+ try {
+ (void)fmt.parse(pc);
+ return true;
+ } catch (const std::format_error&) {
+ return false;
+ }
+}
+
+#define WIDEN_(C, S) ::std::__format::_Widen<C>(S, L##S)
+#define WIDEN(S) WIDEN_(_CharT, S)
+
+void
+test_format_string()
+{
+ // only CharT value types are supported
+ VERIFY( !is_range_formatter_spec_for(L"s", std::vector<char>()) );
+ VERIFY( !is_format_string_for(L"{:s}", std::vector<char>()) );
+ VERIFY( !is_range_formatter_spec_for(L"s", std::vector<char>()) );
+ VERIFY( !is_format_string_for(L"{:s}", std::vector<char>()) );
+ VERIFY( !is_range_formatter_spec_for("s", std::vector<int>()) );
+ VERIFY( !is_format_string_for("{:s}", std::vector<int>()) );
+
+ // invalid format stringss
+ VERIFY( !is_range_formatter_spec_for("?", std::vector<char>()) );
+ VERIFY( !is_format_string_for("{:?}", std::vector<char>()) );
+ VERIFY( !is_range_formatter_spec_for("ns", std::vector<char>()) );
+ VERIFY( !is_format_string_for("{:ns}", std::vector<char>()) );
+ VERIFY( !is_range_formatter_spec_for("s:", std::vector<char>()) );
+ VERIFY( !is_format_string_for("{:s:}", std::vector<char>()) );
+
+ // precision is not supported, even for s
+ VERIFY( !is_range_formatter_spec_for(".10s", std::vector<char>()) );
+ VERIFY( !is_format_string_for("{:.10s}", std::vector<char>()) );
+ VERIFY( !is_format_string_for("{:.{}s}", std::vector<char>(), 10) );
+
+ // width needs to be integer type
+ VERIFY( !is_format_string_for("{:{}s}", std::vector<char>(), 1.0f) );
+}
+
+template<typename Range>
+void test_output()
+{
+ using _CharT = std::ranges::range_value_t<Range>;
+ auto makeRange = [](std::basic_string<_CharT>& s) {
+ return Range(s.data(), s.data() + s.size());
+ };
+ std::basic_string<_CharT> res;
+ size_t size = 0;
+
+ std::basic_string<_CharT> s1 = WIDEN("abcd");
+ res = std::format(WIDEN("{}"), makeRange(s1));
+ VERIFY( res == WIDEN("['a', 'b', 'c', 'd']") );
+
+ res = std::format(WIDEN("{::}"), makeRange(s1));
+ VERIFY( res == WIDEN("[a, b, c, d]") );
+
+ res = std::format(WIDEN("{:s}"), makeRange(s1));
+ VERIFY( res == WIDEN("abcd") );
+
+ res = std::format(WIDEN("{:?s}"), makeRange(s1));
+ VERIFY( res == WIDEN(R"("abcd")") );
+
+ res = std::format(WIDEN("{:3s}"), makeRange(s1));
+ VERIFY( res == WIDEN("abcd") );
+
+ res = std::format(WIDEN("{:7s}"), makeRange(s1));
+ VERIFY( res == WIDEN("abcd ") );
+
+ res = std::format(WIDEN("{:{}s}"), makeRange(s1), 7);
+ VERIFY( res == WIDEN("abcd ") );
+
+ res = std::format(WIDEN("{1:{0}s}"), 7, makeRange(s1));
+ VERIFY( res == WIDEN("abcd ") );
+
+ res = std::format(WIDEN("{:*>6s}"), makeRange(s1));
+ VERIFY( res == WIDEN("**abcd") );
+
+ res = std::format(WIDEN("{:-<5s}"), makeRange(s1));
+ VERIFY( res == WIDEN("abcd-") );
+
+ res = std::format(WIDEN("{:=^8s}"), makeRange(s1));
+ VERIFY( res == WIDEN("==abcd==") );
+
+ std::basic_string<_CharT> s2(512, static_cast<_CharT>('a'));
+ res = std::format(WIDEN("{:=^8s}"), makeRange(s2));
+ VERIFY( res == s2 );
+
+ size = std::formatted_size(WIDEN("{:s}"), makeRange(s1));
+ VERIFY( size == 4 );
+
+ size = std::formatted_size(WIDEN("{:3s}"), makeRange(s1));
+ VERIFY( size == 4 );
+
+ size = std::formatted_size(WIDEN("{:7s}"), makeRange(s1));
+ VERIFY( size == 7 );
+
+ size = std::formatted_size(WIDEN("{:s}"), makeRange(s2));
+ VERIFY( size == 512 );
+}
+
+template<typename CharT>
+struct cstr_view
+{
+ cstr_view() = default;
+ explicit cstr_view(CharT* f, CharT* l)
+ : ptr(f)
+ { VERIFY(!*l); }
+
+ struct sentinel
+ {
+ friend constexpr
+ bool operator==(CharT const* ptr, sentinel) noexcept
+ { return !*ptr; }
+ };
+
+ constexpr
+ CharT* begin() const noexcept
+ { return ptr; };
+ static constexpr
+ sentinel end() noexcept
+ { return {}; }
+
+private:
+ CharT* ptr = "";
+};
+
+template<typename CharT>
+void
+test_outputs()
+{
+ using namespace __gnu_test;
+ test_output<std::vector<CharT>>();
+ test_output<std::span<CharT>>();
+ test_output<cstr_view<CharT>>();
+
+ test_output<test_forward_range<CharT>>();
+ test_output<test_forward_sized_range<CharT>>();
+
+ test_output<test_input_range<CharT>>();
+ test_output<test_input_sized_range<CharT>>();
+
+ test_output<test_range_nocopy<CharT, input_iterator_wrapper_nocopy>>();
+ test_output<test_sized_range<CharT, input_iterator_wrapper_nocopy>>();
+
+ test_output<std::span<const CharT>>();
+ test_output<cstr_view<const CharT>>();
+ test_output<test_forward_range<const CharT>>();
+
+ static_assert(!std::formattable<std::span<volatile CharT>, CharT>);
+ static_assert(!std::formattable<std::span<const volatile CharT>, CharT>);
+}
+
+void
+test_nested()
+{
+ std::string_view s1 = "str1";
+ std::string_view s2 = "str2";
+
+ std::vector<std::string> vs;
+ vs.emplace_back(s1);
+ vs.emplace_back(s2);
+
+ VERIFY( std::format("{}", vs) == R"(["str1", "str2"])" );
+ VERIFY( std::format("{:}", vs) == R"(["str1", "str2"])" );
+ VERIFY( std::format("{::?}", vs) == R"(["str1", "str2"])" );
+ VERIFY( std::format("{::}", vs) == R"([str1, str2])" );
+
+ std::vector<std::vector<char>> vv;
+ vv.emplace_back(s1.begin(), s1.end());
+ vv.emplace_back(s2.begin(), s2.end());
+ std::string_view escaped = R"([['s', 't', 'r', '1'], ['s', 't', 'r', '2']])";
+
+ VERIFY( std::format("{}", vv) == escaped );
+ VERIFY( std::format("{:}", vv) == escaped );
+ VERIFY( std::format("{::}", vv) == escaped );
+ VERIFY( std::format("{:::?}", vv) == escaped );
+ VERIFY( std::format("{:::}", vv) == R"([[s, t, r, 1], [s, t, r, 2]])" );
+ VERIFY( std::format("{::s}", vv) == R"([str1, str2])" );
+ VERIFY( std::format("{::?s}", vv) == R"(["str1", "str2"])" );
+}
+
+int main()
+{
+ test_format_string();
+ test_outputs<char>();
+ test_outputs<wchar_t>();
+ test_nested();
+}
diff --git a/libstdc++-v3/testsuite/std/format/string.cc b/libstdc++-v3/testsuite/std/format/string.cc
index ee987a1..76614d4 100644
--- a/libstdc++-v3/testsuite/std/format/string.cc
+++ b/libstdc++-v3/testsuite/std/format/string.cc
@@ -62,7 +62,7 @@ test_indexing()
VERIFY( ! is_format_string_for("{} {0}", 1) );
}
-#if __cpp_lib_format_ranges
+#if __glibcxx_format_ranges
constexpr bool escaped_strings_supported = true;
#else
constexpr bool escaped_strings_supported = false;
diff --git a/libstdc++-v3/testsuite/std/format/tuple.cc b/libstdc++-v3/testsuite/std/format/tuple.cc
new file mode 100644
index 0000000..62f9d29
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/format/tuple.cc
@@ -0,0 +1,259 @@
+// { dg-do run { target c++23 } }
+
+#include <format>
+#include <string>
+#include <testsuite_hooks.h>
+#include <tuple>
+#include <utility>
+
+struct NotFormattable
+{};
+
+static_assert( !std::formattable<std::pair<int, NotFormattable>, char> );
+static_assert( !std::formattable<std::tuple<int, NotFormattable, int>, wchar_t> );
+
+template<typename... Args>
+bool
+is_format_string_for(const char* str, Args&&... args)
+{
+ try {
+ (void) std::vformat(str, std::make_format_args(args...));
+ return true;
+ } catch (const std::format_error&) {
+ return false;
+ }
+}
+
+template<typename... Args>
+bool
+is_format_string_for(const wchar_t* str, Args&&... args)
+{
+ try {
+ (void) std::vformat(str, std::make_wformat_args(args...));
+ return true;
+ } catch (const std::format_error&) {
+ return false;
+ }
+}
+
+#define WIDEN_(C, S) ::std::__format::_Widen<C>(S, L##S)
+#define WIDEN(S) WIDEN_(_CharT, S)
+
+void
+test_format_string()
+{
+ // invalid format stringss
+ VERIFY( !is_format_string_for("{:p}", std::tuple<>()) );
+ VERIFY( !is_format_string_for("{:nm}", std::tuple<>()) );
+
+ // 'm' is only valid for 2 elemenst
+ VERIFY( !is_format_string_for("{:m}", std::tuple<>()) );
+ VERIFY( !is_format_string_for("{:m}", std::tuple<int, int, int>()) );
+
+ // element specifier is not supported
+ VERIFY( !is_format_string_for("{::}", std::tuple<>()) );
+
+ // precision is not supported
+ VERIFY( !is_format_string_for("{:.10}", std::tuple<>()) );
+
+ // width needs to be integer type
+ VERIFY( !is_format_string_for("{:{}}", std::tuple<>(), 1.0f) );
+}
+
+template<typename _CharT>
+void test_multi()
+{
+ using Sv = std::basic_string_view<_CharT>;
+ using Str = std::basic_string<_CharT>;
+
+ std::basic_string<_CharT> res;
+ std::size_t size = 0;
+ std::tuple<int, Str, float> t1(1, WIDEN("test"), 2.1);
+
+ res = std::format(WIDEN("{}"), t1);
+ VERIFY( res == WIDEN(R"((1, "test", 2.1))") );
+ res = std::format(WIDEN("{:}"), t1);
+ VERIFY( res == WIDEN(R"((1, "test", 2.1))") );
+ res = std::format(WIDEN("{:n}"), t1);
+ VERIFY( res == WIDEN(R"(1, "test", 2.1)") );
+
+ res = std::format(WIDEN("{:3}"), t1);
+ VERIFY( res == WIDEN(R"((1, "test", 2.1))") );
+
+ res = std::format(WIDEN("{:20}"), t1);
+ VERIFY( res == WIDEN(R"((1, "test", 2.1) )") );
+
+ res = std::format(WIDEN("{:{}}"), t1, 20);
+ VERIFY( res == WIDEN(R"((1, "test", 2.1) )") );
+
+ res = std::format(WIDEN("{1:{0}}"), 20, t1);
+ VERIFY( res == WIDEN(R"((1, "test", 2.1) )") );
+
+ res = std::format(WIDEN("{:^>17}"), t1);
+ VERIFY( res == WIDEN(R"(^(1, "test", 2.1))") );
+
+ res = std::format(WIDEN("{:$<18}"), t1);
+ VERIFY( res == WIDEN(R"((1, "test", 2.1)$$)") );
+
+ res = std::format(WIDEN("{:+^19}"), t1);
+ VERIFY( res == WIDEN(R"(+(1, "test", 2.1)++)") );
+
+ res = std::format(WIDEN("{:|^19n}"), t1);
+ VERIFY( res == WIDEN(R"(||1, "test", 2.1|||)") );
+
+ size = std::formatted_size(WIDEN("{}"), t1);
+ VERIFY( size == Sv(WIDEN(R"((1, "test", 2.1))")).size() );
+
+ size = std::formatted_size(WIDEN("{:3}"), t1);
+ VERIFY( size == Sv(WIDEN(R"((1, "test", 2.1))")).size() );
+
+ size = std::formatted_size(WIDEN("{:20}"), t1);
+ VERIFY( size == 20 );
+
+ std::tuple<int&, Str&, float&> t2 = t1;
+ res = std::format(WIDEN("{}"), t2);
+ VERIFY( res == WIDEN(R"((1, "test", 2.1))") );
+
+ std::tuple<int, int, int, int> t3(1, 2, 3, 4);
+ res = std::format(WIDEN("{}"), t3);
+ VERIFY( res == WIDEN(R"((1, 2, 3, 4))") );
+
+}
+
+template<typename _CharT, typename Tuple>
+void test_empty()
+{
+ std::basic_string<_CharT> res;
+
+ Tuple e1;
+ res = std::format(WIDEN("{}"), e1);
+ VERIFY( res == WIDEN(R"(())") );
+
+ res = std::format(WIDEN("{:}"), e1);
+ VERIFY( res == WIDEN(R"(())") );
+
+ res = std::format(WIDEN("{:n}"), e1);
+ VERIFY( res == WIDEN(R"()") );
+
+ res = std::format(WIDEN("{:^>6}"), e1);
+ VERIFY( res == WIDEN(R"(^^^^())") );
+}
+
+template<typename _CharT, typename Pair>
+void test_pair()
+{
+ using Ft = std::remove_cvref_t<std::tuple_element_t<0, Pair>>;
+ using St = std::remove_cvref_t<std::tuple_element_t<1, Pair>>;
+
+ std::basic_string<_CharT> res;
+
+ Ft f1 = 1;
+ St s1 = WIDEN("abc");
+ Pair p1(f1, s1);
+
+ res = std::format(WIDEN("{}"), p1);
+ VERIFY( res == WIDEN(R"((1, "abc"))") );
+
+ res = std::format(WIDEN("{:}"), p1);
+ VERIFY( res == WIDEN(R"((1, "abc"))") );
+
+ res = std::format(WIDEN("{:m}"), p1);
+ VERIFY( res == WIDEN(R"(1: "abc")") );
+
+ res = std::format(WIDEN("{:|^12m}"), p1);
+ VERIFY( res == WIDEN(R"(||1: "abc"||)") );
+}
+
+template<typename CharT, template<typename, typename> class PairT>
+void test_pair_e()
+{
+ test_pair<CharT, PairT<int, std::basic_string<CharT>>>();
+ test_pair<CharT, PairT<int, const CharT*>>();
+ test_pair<CharT, PairT<const int, std::basic_string<CharT>>>();
+ test_pair<CharT, PairT<int&, std::basic_string<CharT>&>>();
+ test_pair<CharT, PairT<const int&, const std::basic_string<CharT>&>>();
+}
+
+template<typename Pair>
+struct MyPair : Pair
+{
+ using Pair::Pair;
+};
+
+template<typename Pair, typename CharT>
+struct std::formatter<MyPair<Pair>, CharT>
+{
+ constexpr formatter() noexcept
+ {
+ using _CharT = CharT;
+ _formatter.set_brackets(WIDEN("<"), WIDEN(">"));
+ _formatter.set_separator(WIDEN("; "));
+ }
+
+ constexpr std::basic_format_parse_context<CharT>::iterator
+ parse(std::basic_format_parse_context<CharT>& pc)
+ { return _formatter.parse(pc); }
+
+ template<typename Out>
+ typename std::basic_format_context<Out, CharT>::iterator
+ format(const MyPair<Pair>& mp,
+ std::basic_format_context<Out, CharT>& fc) const
+ { return _formatter.format(mp, fc); }
+
+private:
+ std::formatter<Pair, CharT> _formatter;
+};
+
+template<typename _CharT, template<typename, typename> class PairT>
+void test_custom()
+{
+ std::basic_string<_CharT> res;
+ MyPair<PairT<int, const _CharT*>> c1(1, WIDEN("abc"));
+
+ res = std::format(WIDEN("{}"), c1);
+ VERIFY( res == WIDEN(R"(<1; "abc">)") );
+
+ res = std::format(WIDEN("{:}"), c1);
+ VERIFY( res == WIDEN(R"(<1; "abc">)") );
+
+ res = std::format(WIDEN("{:n}"), c1);
+ VERIFY( res == WIDEN(R"(1; "abc")") );
+
+ res = std::format(WIDEN("{:m}"), c1);
+ VERIFY( res == WIDEN(R"(1: "abc")") );
+
+ res = std::format(WIDEN("{:|^14}"), c1);
+ VERIFY( res == WIDEN(R"(||<1; "abc">||)") );
+}
+
+template<typename CharT>
+void test_outputs()
+{
+ test_multi<CharT>();
+ test_empty<CharT, std::tuple<>>();
+ test_pair_e<CharT, std::pair>();
+ test_pair_e<CharT, std::tuple>();
+ test_custom<CharT, std::pair>();
+ test_custom<CharT, std::tuple>();
+}
+
+void test_nested()
+{
+ std::string res;
+ std::tuple<std::tuple<>, std::pair<int, std::string>> tt{{}, {1, "abc"}};
+
+ res = std::format("{}", tt);
+ VERIFY( res == R"(((), (1, "abc")))" );
+ res = std::format("{:n}", tt);
+ VERIFY( res == R"((), (1, "abc"))" );
+ res = std::format("{:m}", tt);
+ VERIFY( res == R"((): (1, "abc"))" );
+}
+
+int main()
+{
+ test_format_string();
+ test_outputs<char>();
+ test_outputs<wchar_t>();
+ test_nested();
+}
diff --git a/libstdc++-v3/testsuite/util/debug/unordered_checks.h b/libstdc++-v3/testsuite/util/debug/unordered_checks.h
index d01ee82..785aeb4 100644
--- a/libstdc++-v3/testsuite/util/debug/unordered_checks.h
+++ b/libstdc++-v3/testsuite/util/debug/unordered_checks.h
@@ -65,28 +65,36 @@ namespace __gnu_test
template<typename _Tp>
struct KeyExtractor
{
- static _Tp get_key(const _Tp& val)
+ static const _Tp& get_key(const _Tp& val)
{ return val; }
};
template<typename _Tp1, typename _Tp2>
- struct KeyExtractor<std::pair<const _Tp1, _Tp2>>
+ struct KeyExtractor<std::pair<_Tp1, _Tp2>>
{
- static _Tp1 get_key(const std::pair<const _Tp1, _Tp2>& val)
+ static const _Tp1& get_key(const std::pair<_Tp1, _Tp2>& val)
{ return val.first; }
};
template<typename _Tp>
- void use_erased_local_iterator()
+ void fill_container(_Tp& c)
{
typedef _Tp cont_type;
typedef typename cont_type::value_type cont_val_type;
typedef typename CopyableValueType<cont_val_type>::value_type val_type;
generate_unique<val_type> gu;
- cont_type c;
for (size_t i = 0; i != 5; ++i)
c.insert(gu.build());
+ }
+
+ template<typename _Tp>
+ void use_erased_local_iterator()
+ {
+ typedef _Tp cont_type;
+ typedef typename cont_type::value_type cont_val_type;
+ cont_type c;
+ fill_container(c);
typename cont_type::local_iterator it, end;
for (size_t i = 0; i != c.bucket_count(); ++i)
@@ -96,22 +104,18 @@ namespace __gnu_test
if (it != end)
break;
}
- typename cont_type::key_type key = KeyExtractor<cont_val_type>::get_key(*it);
+
+ const auto& key = KeyExtractor<cont_val_type>::get_key(*it);
c.erase(key);
VERIFY( it != end );
}
template<typename _Tp>
- void use_invalid_local_iterator()
+ typename _Tp::local_iterator
+ fill_and_get_local_iterator(_Tp& c)
{
typedef _Tp cont_type;
- typedef typename cont_type::value_type cont_val_type;
- typedef typename CopyableValueType<cont_val_type>::value_type val_type;
- generate_unique<val_type> gu;
-
- cont_type c;
- for (size_t i = 0; i != 5; ++i)
- c.insert(gu.build());
+ fill_container(c);
typename cont_type::local_iterator it;
for (size_t i = 0; i != c.bucket_count(); ++i)
@@ -120,22 +124,107 @@ namespace __gnu_test
if (it != c.end(i))
break;
}
- cont_val_type val = *it;
+
+ return it;
+ }
+
+ template<typename _Tp>
+ void use_invalid_local_iterator()
+ {
+ typedef _Tp cont_type;
+ cont_type c;
+ auto it = fill_and_get_local_iterator(c);
+
+ const auto& val = *it;
c.clear();
VERIFY( *it == val );
}
template<typename _Tp>
- void invalid_local_iterator_pre_increment()
+ void invalid_local_iterator_arrow_operator()
{
typedef _Tp cont_type;
- typedef typename cont_type::value_type cont_val_type;
- typedef typename CopyableValueType<cont_val_type>::value_type val_type;
- generate_unique<val_type> gu;
+ cont_type c;
+ auto it = fill_and_get_local_iterator(c);
+
+ const auto& val = *it;
+ c.clear();
+ VERIFY( *it.operator->() == val );
+ }
+ template<typename _Tp>
+ void invalid_local_iterator_copy_construction()
+ {
+ typedef _Tp cont_type;
cont_type c;
- for (size_t i = 0; i != 5; ++i)
- c.insert(gu.build());
+ auto it = fill_and_get_local_iterator(c);
+
+ const auto& val = *it;
+ c.clear();
+ typename cont_type::local_iterator lit(it);
+ VERIFY( *lit == val );
+ }
+
+ template<typename _Tp>
+ void invalid_local_iterator_move_construction()
+ {
+ typedef _Tp cont_type;
+ cont_type c;
+ auto it = fill_and_get_local_iterator(c);
+
+ const auto& val = *it;
+ c.clear();
+ typename cont_type::local_iterator lit(std::move(it));
+ VERIFY( *lit == val );
+ }
+
+ template<typename _Tp>
+ void invalid_local_iterator_copy_assignment()
+ {
+ typedef _Tp cont_type;
+ cont_type c;
+ auto it = fill_and_get_local_iterator(c);
+
+ const auto& val = *it;
+ c.clear();
+ typename cont_type::local_iterator lit;
+ lit = it;
+ VERIFY( *lit == val );
+ }
+
+ template<typename _Tp>
+ void invalid_local_iterator_move_assignment()
+ {
+ typedef _Tp cont_type;
+ cont_type c;
+ auto it = fill_and_get_local_iterator(c);
+
+ const auto& val = *it;
+ c.clear();
+ typename cont_type::local_iterator lit;
+ lit = std::move(it);
+ VERIFY( *lit == val );
+ }
+
+ template<typename _Tp>
+ void invalid_local_iterator_const_conversion()
+ {
+ typedef _Tp cont_type;
+ cont_type c;
+ auto it = fill_and_get_local_iterator(c);
+
+ const auto& val = *it;
+ c.clear();
+ typename cont_type::const_local_iterator clit(it);
+ VERIFY( *clit == val );
+ }
+
+ template<typename _Tp>
+ void invalid_local_iterator_pre_increment()
+ {
+ typedef _Tp cont_type;
+ cont_type c;
+ fill_container(c);
auto lit = c.begin(0);
for (size_t i = 0; i != 6; ++i)
@@ -146,13 +235,8 @@ namespace __gnu_test
void invalid_local_iterator_post_increment()
{
typedef _Tp cont_type;
- typedef typename cont_type::value_type cont_val_type;
- typedef typename CopyableValueType<cont_val_type>::value_type val_type;
- generate_unique<val_type> gu;
-
cont_type c;
- for (size_t i = 0; i != 5; ++i)
- c.insert(gu.build());
+ fill_container(c);
auto lit = c.begin(0);
for (size_t i = 0; i != 6; ++i)
@@ -163,13 +247,8 @@ namespace __gnu_test
void invalid_local_iterator_compare()
{
typedef _Tp cont_type;
- typedef typename cont_type::value_type cont_val_type;
- typedef typename CopyableValueType<cont_val_type>::value_type val_type;
- generate_unique<val_type> gu;
-
cont_type c;
- for (size_t i = 0; i != 5; ++i)
- c.insert(gu.build());
+ fill_container(c);
typename cont_type::local_iterator it1, it2;
size_t i;
@@ -194,13 +273,8 @@ namespace __gnu_test
void invalid_local_iterator_range()
{
typedef _Tp cont_type;
- typedef typename cont_type::value_type cont_val_type;
- typedef typename CopyableValueType<cont_val_type>::value_type val_type;
- generate_unique<val_type> gu;
-
cont_type c;
- for (size_t i = 0; i != 5; ++i)
- c.insert(gu.build());
+ fill_container(c);
typename cont_type::local_iterator it, end;
for (size_t i = 0; i != c.bucket_count(); ++i)
diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h
index 0df6dcc..74a8739 100644
--- a/libstdc++-v3/testsuite/util/testsuite_iterators.h
+++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h
@@ -610,12 +610,10 @@ namespace __gnu_test
test_container(T* _first, T* _last) : bounds(_first, _last)
{ }
-#if __cplusplus >= 201103L
template<std::size_t N>
explicit
- test_container(T (&arr)[N]) : test_container(arr, arr+N)
+ test_container(T (&arr)[N]) : bounds(arr, arr+N)
{ }
-#endif
ItType<T>
it(int pos)
@@ -894,6 +892,9 @@ namespace __gnu_test
using test_input_range
= test_range<T, input_iterator_wrapper>;
template<typename T>
+ using test_input_range_nocopy
+ = test_range_nocopy<T, input_iterator_wrapper_nocopy>;
+ template<typename T>
using test_output_range
= test_range<T, output_iterator_wrapper>;
diff --git a/maintainer-scripts/ChangeLog b/maintainer-scripts/ChangeLog
index d08a03b..3c33199 100644
--- a/maintainer-scripts/ChangeLog
+++ b/maintainer-scripts/ChangeLog
@@ -1,3 +1,8 @@
+2025-04-17 Jakub Jelinek <jakub@redhat.com>
+
+ * crontab: Snapshots from trunk are now GCC 16 related.
+ Add GCC 15 snapshots from the respective branch.
+
2025-04-07 Jakub Jelinek <jakub@redhat.com>
PR web/119227
diff --git a/maintainer-scripts/crontab b/maintainer-scripts/crontab
index 7bb7362..c880d7d 100644
--- a/maintainer-scripts/crontab
+++ b/maintainer-scripts/crontab
@@ -1,7 +1,8 @@
16 0 * * * sh /home/gccadmin/scripts/update_version_git
50 0 * * * sh /home/gccadmin/scripts/update_web_docs_git
55 0 * * * sh /home/gccadmin/scripts/update_web_docs_libstdcxx_git
-32 22 * * 4 sh /home/gccadmin/scripts/gcc_release -s 12:releases/gcc-12 -l -d /sourceware/snapshot-tmp/gcc all
-32 22 * * 5 sh /home/gccadmin/scripts/gcc_release -s 13:releases/gcc-13 -l -d /sourceware/snapshot-tmp/gcc all
-32 22 * * 6 sh /home/gccadmin/scripts/gcc_release -s 14:releases/gcc-14 -l -d /sourceware/snapshot-tmp/gcc all
-32 22 * * 7 sh /home/gccadmin/scripts/gcc_release -s 15:master -l -d /sourceware/snapshot-tmp/gcc all
+32 22 * * 3 sh /home/gccadmin/scripts/gcc_release -s 12:releases/gcc-12 -l -d /sourceware/snapshot-tmp/gcc all
+32 22 * * 4 sh /home/gccadmin/scripts/gcc_release -s 13:releases/gcc-13 -l -d /sourceware/snapshot-tmp/gcc all
+32 22 * * 5 sh /home/gccadmin/scripts/gcc_release -s 14:releases/gcc-14 -l -d /sourceware/snapshot-tmp/gcc all
+32 22 * * 6 sh /home/gccadmin/scripts/gcc_release -s 15:releases/gcc-15 -l -d /sourceware/snapshot-tmp/gcc all
+32 22 * * 7 sh /home/gccadmin/scripts/gcc_release -s 16:master -l -d /sourceware/snapshot-tmp/gcc all