aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-09-06 06:52:14 +0200
committerMartin Liska <mliska@suse.cz>2022-09-06 06:52:14 +0200
commit918bc838c2803f08e4d7ccd179396d48cb8ec804 (patch)
tree2496c039b51fd33ee4309d910f0f6ce44cd5f749
parent8de5354e2cf4e6ea750ea92c7162d61b1b796f76 (diff)
parent47d2dcd1397bf02b79515c39438e0ea9898f9056 (diff)
downloadgcc-918bc838c2803f08e4d7ccd179396d48cb8ec804.zip
gcc-918bc838c2803f08e4d7ccd179396d48cb8ec804.tar.gz
gcc-918bc838c2803f08e4d7ccd179396d48cb8ec804.tar.bz2
Merge branch 'master' into devel/sphinx
-rw-r--r--gcc/ChangeLog305
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/ada/ChangeLog239
-rw-r--r--gcc/analyzer/ChangeLog14
-rw-r--r--gcc/analyzer/region-model-impl-calls.cc16
-rw-r--r--gcc/analyzer/region-model.cc29
-rw-r--r--gcc/analyzer/region-model.h3
-rw-r--r--gcc/analyzer/region.cc10
-rw-r--r--gcc/analyzer/region.h2
-rw-r--r--gcc/common/config/riscv/riscv-common.cc4
-rw-r--r--gcc/config/aarch64/aarch64-builtins.cc9
-rw-r--r--gcc/config/aarch64/aarch64-c.cc13
-rw-r--r--gcc/config/aarch64/aarch64-protos.h1
-rw-r--r--gcc/config/aarch64/aarch64.cc17
-rw-r--r--gcc/config/i386/i386.md9
-rw-r--r--gcc/config/loongarch/genopts/loongarch.opt.in4
-rw-r--r--gcc/config/loongarch/loongarch.cc6
-rw-r--r--gcc/config/loongarch/loongarch.opt4
-rw-r--r--gcc/config/riscv/riscv-opts.h3
-rw-r--r--gcc/config/riscv/riscv.md28
-rw-r--r--gcc/config/riscv/riscv.opt3
-rw-r--r--gcc/doc/invoke.texi15
-rw-r--r--gcc/fortran/ChangeLog26
-rw-r--r--gcc/fortran/dump-parse-tree.cc38
-rw-r--r--gcc/fortran/gfortran.h13
-rw-r--r--gcc/fortran/openmp.cc218
-rw-r--r--gcc/fortran/parse.cc3
-rw-r--r--gcc/fortran/trans-openmp.cc35
-rw-r--r--gcc/gimple-predicate-analysis.cc135
-rw-r--r--gcc/gimple-predicate-analysis.h4
-rw-r--r--gcc/gimple-range-fold.cc9
-rw-r--r--gcc/range-op-float.cc10
-rw-r--r--gcc/testsuite/ChangeLog54
-rw-r--r--gcc/testsuite/g++.dg/pr106824.C76
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/fold-string-to-char.c8
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/out-of-bounds-4.c65
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/strcpy-3.c23
-rw-r--r--gcc/testsuite/gcc.dg/cpp/c11-trigraphs-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/c2x-trigraphs-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/cpp/c2x-trigraphs-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp-float-signbit-2.c24
-rw-r--r--gcc/testsuite/gcc.target/aarch64/spellcheck_10.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/pr106453.c13
-rw-r--r--gcc/testsuite/gcc.target/loongarch/direct-extern-1.c6
-rw-r--r--gcc/testsuite/gcc.target/loongarch/direct-extern-2.c6
-rw-r--r--gcc/testsuite/gcc.target/riscv/zmmul-1.c20
-rw-r--r--gcc/testsuite/gcc.target/riscv/zmmul-2.c20
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/all-memory-1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/depend-iterator-2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/depobj-2.f906
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/doacross-5.f9088
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/doacross-6.f9077
-rw-r--r--gcc/tree-cfg.cc2
-rw-r--r--gcc/tree-cfg.h1
-rw-r--r--gcc/tree-ssa-uninit.cc4
-rw-r--r--gcc/value-range.cc12
-rw-r--r--gcc/value-range.h5
-rw-r--r--libcpp/ChangeLog4
-rw-r--r--libcpp/init.cc2
-rw-r--r--libgomp/ChangeLog4
-rw-r--r--libgomp/libgomp.texi5
-rw-r--r--libstdc++-v3/ChangeLog12
-rw-r--r--libstdc++-v3/include/std/type_traits51
63 files changed, 1562 insertions, 290 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 77208a9..958ccc6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,308 @@
+2022-09-05 Aldy Hernandez <aldyh@redhat.com>
+
+ * gimple-range-fold.cc
+ (fold_using_range::range_of_builtin_int_call): Ignore sign bit
+ when there's the possibility of a NAN.
+
+2022-09-05 Aldy Hernandez <aldyh@redhat.com>
+
+ * gimple-range-fold.cc
+ (fold_using_range::range_of_builtin_int_call): Fold a set signbit
+ in __builtin_signbit to nonzero.
+
+2022-09-05 Alexander Monakov <amonakov@ispras.ru>
+
+ PR target/106453
+ * config/i386/i386.md (sse4_2_crc32di): Model that only low 32
+ bits of operand 0 are consumed, and the result is zero-extended
+ to 64 bits.
+
+2022-09-05 Aldy Hernandez <aldyh@redhat.com>
+
+ PR middle-end/106831
+ * value-range.h (frange::supports_p): Disable decimal floats.
+ * range-op-float.cc (frange_drop_inf): Remove DECIMAL_FLOAT_MODE_P
+ check.
+ (frange_drop_ninf): Same.
+
+2022-09-05 Aldy Hernandez <aldyh@redhat.com>
+
+ PR middle-end/106824
+ * value-range.cc (frange::set_nan): Set undefined when updating a
+ NAN to a non-NAN.
+
+2022-09-05 Kito Cheng <kito.cheng@sifive.com>
+
+ * config/riscv/riscv.cc (riscv_option_override): Fix wrong
+ condition for MASK_DIV and simplify incompatible checking.
+ * config/riscv/riscv.md (muldi3): Adding parentheses.
+
+2022-09-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/aarch64/aarch64.cc (aarch64_validate_march): Check if invalid arch
+ string is a valid -mcpu string and emit hint.
+
+2022-09-05 LiaoShihua <shihua@iscas.ac.cn>
+
+ * common/config/riscv/riscv-common.cc: Add Zmmul.
+ * config/riscv/riscv-opts.h (MASK_ZMMUL): New.
+ (TARGET_ZMMUL): Ditto.
+ * config/riscv/riscv.cc (riscv_option_override):Ditto.
+ * config/riscv/riscv.md: Add Zmmul
+ * config/riscv/riscv.opt: Ditto.
+
+2022-09-05 Richard Biener <rguenther@suse.de>
+
+ * tree-cfg.h (get_cases_for_edge): Declare.
+ * tree-cfg.cc (get_cases_for_edge): Export.
+ * tree-ssa-uninit.cc (execute_late_warn_uninitialized):
+ Start and end recording case labels.
+ * gimple-predicate-analysis.cc (MAX_SWITCH_CASES): Remove.
+ (predicate::init_from_control_deps): Use get_cases_for_edge.
+
+2022-09-05 Richard Biener <rguenther@suse.de>
+
+ * gimple-predicate-analysis.cc (MAX_POSTDOM_CHECK): Remove.
+ (compute_control_dep_chain): Move uninit-control-dep-attempts
+ checking where it also counts the post-dominator check
+ invocations.
+
+2022-09-05 Richard Biener <rguenther@suse.de>
+
+ * gimple-predicate-analysis.h (predicate::debug): New.
+ (predicate::dump): Add FILE * argument, add base overload.
+ * gimple-predicate-analysis.cc (debug): New.
+ (dump_pred_info): Add FILE * argument.
+ (dump_pred_chain): Likewise.
+ (predicate::dump): Split out preamble into overload. Add
+ FILE * argument.
+ (predicate::debug): New.
+ (predicate::simplify): Adjust.
+ (predicate::normalize): Likewise.
+ (predicate::init_from_control_deps): Likewise.
+
+2022-09-05 Richard Sandiford <richard.sandiford@arm.com>
+
+ * config/aarch64/aarch64-protos.h
+ (aarch64_init_simd_builtins): Remove prototype.
+ * config/aarch64/aarch64-builtins.cc
+ (aarch64_simd_builtins_initialized_p): Delete.
+ (aarch64_init_simd_builtins): Make static. Remove protection
+ against multiple calls.
+ * config/aarch64/aarch64-c.cc (aarch64_pragma_target_parse): Remove
+ lazy SIMD builtin initialization.
+ * config/aarch64/aarch64.cc
+ (aarch64_option_valid_attribute_p): Likewise.
+
+2022-09-05 Xi Ruoyao <xry111@xry111.site>
+
+ * config/loongarch/genopts/loongarch.opt.in: Add
+ -mdirect-extern-access option.
+ * config/loongarch/loongarch.opt: Regenerate.
+ * config/loongarch/loongarch.cc
+ (loongarch_symbol_binds_local_p): Return true if
+ TARGET_DIRECT_EXTERN_ACCESS.
+ (loongarch_option_override_internal): Complain if
+ -mdirect-extern-access is used with -fPIC or -fpic.
+ * doc/invoke.texi: Document -mdirect-extern-access for
+ LoongArch.
+
+2022-09-05 Martin Liska <mliska@suse.cz>
+
+ * doc/tm.texi.in: Rename DEBUGGER_REGISTER_NUMBER to
+ DEBUGGER_REGNO.
+ * doc/tm.texi: Regenerate.
+
+2022-09-05 Martin Liska <mliska@suse.cz>
+
+ * config/aarch64/aarch64-protos.h (aarch64_dbx_regno):
+ Rename DBX_REGISTER_NUMBER to DEBUGGER_REGNO.
+ (aarch64_debugger_regno): Likewise.
+ * config/aarch64/aarch64.cc (aarch64_dbx_regno): Likewise.
+ (aarch64_debugger_regno): Likewise.
+ * config/aarch64/aarch64.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ (DWARF_FRAME_REGNUM): Likewise.
+ * config/alpha/alpha.h (DWARF_FRAME_REGNUM): Likewise.
+ * config/arc/arc.cc (arc_init_reg_tables): Likewise.
+ * config/arc/arc.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/arm/arm-protos.h (arm_dbx_regno): Likewise.
+ (arm_debugger_regno): Likewise.
+ * config/arm/arm.cc (arm_dbx_regno): Likewise.
+ (arm_debugger_regno): Likewise.
+ * config/arm/arm.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/bfin/bfin.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/c6x/c6x.cc: Likewise.
+ * config/c6x/c6x.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/cris/cris.h (enum reg_class): Likewise.
+ (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/csky/csky.cc (enum reg_class): Likewise.
+ * config/csky/csky.h (DWARF_FRAME_REGNUM): Likewise.
+ (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/frv/frv.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/gcn/gcn-hsa.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/gcn/gcn.cc (print_operand): Likewise.
+ * config/i386/bsd.h (ASM_QUAD): Likewise.
+ * config/i386/cygming.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ (DWARF_FRAME_REGNUM): Likewise.
+ * config/i386/darwin.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/djgpp.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/dragonfly.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/freebsd.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/gas.h: Likewise.
+ * config/i386/gnu-user.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/i386.cc (enum reg_class): Likewise.
+ * config/i386/i386.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/i386elf.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/iamcu.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/lynx.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/netbsd-elf.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/nto.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/openbsdelf.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/sysv4.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/vxworks.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/i386/x86-64.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/ia64/ia64-protos.h (ia64_dbx_regno): Likewise.
+ (ia64_debugger_regno): Likewise.
+ * config/ia64/ia64.cc (ia64_output_function_prologue): Likewise.
+ (ia64_dbx_regno): Likewise.
+ (ia64_debugger_regno): Likewise.
+ (process_cfa_adjust_cfa): Likewise.
+ (process_cfa_register): Likewise.
+ (ia64_asm_unwind_emit): Likewise.
+ * config/ia64/ia64.h: Likewise.
+ * config/ia64/sysv4.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/lm32/lm32.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/m32c/m32c.cc (m32c_eh_return_stackadj_rtx): Likewise.
+ * config/m32c/m32c.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/m68k/linux.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/m68k/m68k.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ (__transfer_from_trampoline): Likewise.
+ * config/m68k/m68kelf.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/m68k/netbsd-elf.h (M68K_STATIC_CHAIN_REG_NAME): Likewise.
+ (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/microblaze/microblaze.cc (microblaze_option_override): Likewise.
+ * config/microblaze/microblaze.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ (GP_DBX_FIRST): Likewise.
+ (GP_DEBUGGER_FIRST): Likewise.
+ * config/mips/vxworks.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/mmix/mmix-protos.h (mmix_dbx_regno): Likewise.
+ (mmix_debugger_regno): Likewise.
+ * config/mmix/mmix.cc (mmix_dbx_regno): Likewise.
+ (mmix_debugger_regno): Likewise.
+ * config/mmix/mmix.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/nds32/nds32-protos.h (nds32_dbx_regno): Likewise.
+ (nds32_debugger_regno): Likewise.
+ * config/nds32/nds32.cc (nds32_dbx_regno): Likewise.
+ (nds32_debugger_regno): Likewise.
+ (nds32_use_blocks_for_constant_p): Likewise.
+ * config/nds32/nds32.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/nvptx/nvptx.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/or1k/or1k.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/pa/pa32-regs.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/pa/pa64-regs.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/rs6000/rs6000-protos.h (rs6000_dbx_regno): Likewise.
+ (rs6000_debugger_regno): Likewise.
+ * config/rs6000/rs6000.cc (rs6000_dbx_regno): Likewise.
+ (rs6000_debugger_regno): Likewise.
+ * config/rs6000/rs6000.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ (DWARF2_FRAME_REG_OUT): Likewise.
+ * config/s390/s390.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/sh/elf.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/sh/linux.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/sh/sh.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ (SH_DBX_REGISTER_NUMBER): Likewise.
+ (SH_DEBUGGER_REGNO): Likewise.
+ * config/visium/visium.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/xtensa/elf.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/xtensa/linux.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/xtensa/uclinux.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * config/xtensa/xtensa-protos.h (xtensa_dbx_regno): Likewise.
+ (xtensa_debugger_regno): Likewise.
+ * config/xtensa/xtensa.cc (xtensa_dbx_regno): Likewise.
+ (xtensa_debugger_regno): Likewise.
+ * config/xtensa/xtensa.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ * defaults.h (DBX_REGISTER_NUMBER): Likewise.
+ (DEBUGGER_REGNO): Likewise.
+ (DWARF_FRAME_REGNUM): Likewise.
+ * doc/tm.texi: Likewise.
+ * doc/tm.texi.in: Likewise.
+ * dwarf2out.cc (dbx_reg_number): Likewise.
+ (debugger_reg_number): Likewise.
+ (reg_loc_descriptor): Likewise.
+ (multiple_reg_loc_descriptor): Likewise.
+ (mem_loc_descriptor): Likewise.
+ * except.cc: Likewise.
+
+2022-09-05 konglin1 <lingling.kong@intel.com>
+
+ PR target/106742
+ * config/i386/i386-expand.cc (ix86_expand_vector_init_duplicate):
+ Handle V8BF mode.
+ (expand_vec_perm_broadcast_1): Ditto.
+ * config/i386/sse.md (avx512fmaskhalfmode): Add BF vector mode.
+ (vec_set<mode>_0): Add @ to it.
+ (@vec_set<mode>_0): Ditto.
+ (vec_interleave_high<mode><mask_name>): Ditto.
+ (@vec_interleave_high<mode><mask_name>): Ditto.
+ (vec_interleave_low<mode><mask_name>): Ditto.
+ (@vec_interleave_low<mode><mask_name>): Ditto.
+ * config/i386/subst.md (SUBST_V): Add BF vector mode.
+
+2022-09-05 Aldy Hernandez <aldyh@redhat.com>
+
+ * value-range.cc (early_nan_resolve): Remove.
+ (frange::intersect): Handle NANs.
+
2022-09-04 Aldy Hernandez <aldyh@redhat.com>
* value-range.cc (frange::union_): Do not drop properties when
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 6f5f711..80e4d81 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20220905
+20220906
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 7bad8a6..80e856d 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,242 @@
+2022-09-05 Martin Liska <mliska@suse.cz>
+
+ * sigtramp-vxworks-target.h: Rename DBX_REGISTER_NUMBER to
+ DEBUGGER_REGNO.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * exp_aggr.adb (Check_Bounds): Move code and comment related to
+ check for null array aggregate from Resolve_Null_Array_Aggregate.
+ * sem_aggr.ads (Is_Null_Aggregate): Move spec from unit body.
+ * sem_aggr.adb (Resolve_Null_Array_Aggregate): Move check to
+ expansion.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_aggr.adb
+ (Array_Aggr_Subtype): Bypass call to Collect_Aggr_Bound with
+ dedicated code for null array aggregates.
+ (Resolve_Array_Aggregate): Remove special handling of null array
+ aggregates.
+ (Resolve_Array_Aggregate): Create bounds, but let
+ Array_Aggr_Subtype create itype entities.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_aggr.adb (Resolve_Null_Array_Aggregate): Insert check as a
+ Raise_Constraint_Error node and not an If_Statement.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_aggr.adb
+ (Resolve_Container_Aggregate): Style cleanup.
+ (Resolve_Record_Aggregate): Remove redundant guard.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * exp_util.ads (Entry_Names_OK): Remove spec.
+ * exp_util.adb (Entry_Names_OK): Remove body.
+
+2022-09-05 Steve Baird <baird@adacore.com>
+
+ * libgnat/a-coinve.adb, libgnat/a-convec.adb
+ (Append): If the Append that takes an Element and a Count is
+ called with Count = 1, then call the Append that does not take a
+ Count parameter; otherwise call the code that handles the general
+ case. Move the special case detection/handling code that was
+ formerly in that version of Append into the version that does not
+ take a Count parameter, so that now both versions get the
+ performance benefit.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_aggr.adb (Resolve_Null_Array_Aggregate): Create internal
+ type for the aggregate as an itype.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_util.ads (Itype_Has_Declaration): Remove spec.
+ * sem_util.adb (Itype_Has_Declaration): Remove body.
+
+2022-09-05 Steve Baird <baird@adacore.com>
+
+ * exp_ch3.adb
+ (Expand_N_Object_Declaration): In deciding whether to emit a DIC
+ check, we were previously testing the Has_Init_Expression flag.
+ Continue to test that flag as before, but add a test for the
+ syntactic presence of an initial value in the object declaration.
+ This new test would not supersede the old test in the case where
+ an explicit initial value has been eliminated as part of some tree
+ transformation.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_ch13.adb (Validate_Unchecked_Conversions): Use
+ Has_Warnings_Off.
+ * sem_elab.adb (Check_Internal_Call_Continue): Likewise.
+
+2022-09-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * libgnat/s-valuer.adb (Scan_Decimal_Digits): Consistently avoid
+ initializing local variables.
+ (Scan_Integral_Digits): Likewise.
+ (Scan_Raw_Real): Likewise and add a couple of comments.
+
+2022-09-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sem_ch13.adb (Freeze_Entity_Checks): Build predicate functions
+ only after checking the variant part of a record type, if any.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * exp_aggr.adb
+ (Two_Pass_Aggregate_Expansion): Expand into implicit rather than
+ ordinary loops, to detect violations of restriction
+ No_Implicit_Loops.
+ (Generate_Loop): Likewise for delta array aggregates.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * exp_aggr.adb (Two_Pass_Aggregate_Expansion): Expand iterated
+ component association with an unanalyzed copy of iterated
+ expression. The previous code worked only because the expanded
+ loop used both an analyzed copy of the iterator_specification and
+ an analyzed copy of the iterated expression. Now the iterated
+ expression is reanalyzed in the context of the expanded loop.
+ * par-ch4.adb (Build_Iterated_Component_Association): Don't set
+ defining identifier when iterator specification is present.
+ * sem_aggr.adb (Resolve_Iterated_Association): Pick index name
+ from the iterator specification.
+ * sem_elab.adb (Traverse_Potential_Scenario): Handle iterated
+ element association just like iterated component association. Not
+ strictly part of this fix, but still worth for the completeness.
+ * sem_res.adb (Resolve): Pick index name from the iterator
+ specification, when present.
+ * sem_util.adb (Traverse_More): For completeness, just like the
+ change in Traverse_Potential_Scenario.
+ * sinfo.ads
+ (ITERATED_COMPONENT_ASSOCIATION): Fix and complete description.
+ (ITERATED_ELEMENT_ASSOCIATION): Likewise.
+
+2022-09-05 Bob Duff <duff@adacore.com>
+
+ * sem_ch6.adb
+ (Analyze_Subprogram_Body_Helper): Use First_Real_Statement to deal
+ with this case. Note that First_Real_Statement is likely to be
+ removed as part of this ticket, so this is a temporary fix.
+
+2022-09-05 Arnaud Charlet <charlet@adacore.com>
+
+ * ali.adb (Scan_ALI): Special case i-c*.ali when setting
+ Sec_Stack_Used.
+
+2022-09-05 Bob Duff <duff@adacore.com>
+
+ * par-ch5.adb
+ (P_Sequence_Of_Statements): Call Error_Msg_GNAT_Extension to give
+ the error message.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_aggr.adb (Resolve_Iterated_Component_Association): Split
+ processing of cases with and without iterator specification; reuse
+ analysis of iterator specification; improve diagnostics for
+ premature usage of iterator index in discrete choices.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_ch5.adb (Check_Subtype_Definition): Remove redundant call to
+ Present; style cleanup.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_aggr.adb (Resolve_Array_Aggregate): Change an inconsistent
+ use of False into its local equivalent Failure.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_aggr.adb (Resolve_Iterated_Component_Association): Change
+ generic name Ent to a more intuitive Scop; rename Remove_Ref to
+ Remove_Reference, so it can be instantiated as a traversal routine
+ with plural name.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sem_ch4.adb
+ (Is_Empty_Range): Move error reporting to the caller.
+ (Analyze_Qualified_Expression): Move error reporting from Is_Empty_Range;
+ add matching call to End_Scope before rewriting and returning.
+
+2022-09-05 Arnaud Charlet <charlet@adacore.com>
+
+ * bindgen.adb (Gen_Elab_Calls): Check for Check_Elaboration_Flags.
+ * bindusg.adb (Display): Add -k.
+ * opt.ads (Check_Elaboration_Flags): New.
+ * switch-b.adb (Scan_Binder_Switches): Add processing of -k.
+ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add
+ documentation for -k and -K.
+ * gnat_ugn.texi: Regenerate.
+
+2022-09-05 Arnaud Charlet <charlet@adacore.com>
+
+ * treepr.adb: Remove local To_Lower and use the procedure
+ version instead.
+
+2022-09-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * aspects.ads (Delaying Evaluation of Aspect): Fix typos.
+ * exp_ch3.adb (Freeze_Type): Do not generate Invariant and DIC
+ procedures for internal types.
+ * exp_util.adb (Build_DIC_Procedure_Body): Adjust comment.
+ * freeze.adb (Freeze_Entity): Call Inherit_Delayed_Rep_Aspects for
+ subtypes and derived types only after the base or parent type has
+ been frozen. Remove useless freezing for first subtype.
+ (Freeze_Fixed_Point_Type): Call Inherit_Delayed_Rep_Aspects too.
+ * layout.adb (Set_Elem_Alignment): Deal with private types.
+ * sem_ch3.adb (Build_Derived_Enumeration_Type): Build the implicit
+ base as an itype and do not insert its declaration in the tree.
+ (Build_Derived_Numeric_Type): Do not freeze the implicit base.
+ (Derived_Standard_Character): Likewise.
+ (Constrain_Enumeration): Inherit the chain of representation items
+ instead of replacing it.
+ * sem_ch13.ads (Inherit_Aspects_At_Freeze_Point): Add ??? comment.
+ (Inherit_Delayed_Rep_Aspects): Declare.
+ * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Do not invoke
+ Inherit_Delayed_Rep_Aspects.
+ (Inherit_Aspects_At_Freeze_Point): Deal with private types.
+ (Inherit_Delayed_Rep_Aspects): Move to library level.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * einfo-utils.adb (Number_Entries): Refine type of a local variable.
+ * exp_attr.adb (Expand_N_Attribute_Reference): Rename Conctyp to
+ Prottyp; refactor repeated calls to New_Occurrence_Of; replace
+ Number_Entries with Has_Entries.
+ * exp_ch5.adb (Expand_N_Assignment_Statement): Likewise; remove Subprg
+ variable (apparently copy-pasted from expansion of the attribute).
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * exp_attr.adb (Expand_N_Attribute_Reference): Fix detection of the
+ enclosing protected type and of the enclosing protected subprogram.
+ * exp_ch5.adb (Expand_N_Assignment_Statement): Likewise.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * freeze.adb (Freeze_Itype): Remove excessive guard.
+ * sem_ch5.adb (Analyze_Loop_Parameter_Specification): Likewise.
+
+2022-09-05 Piotr Trojanek <trojanek@adacore.com>
+
+ * sprint.adb (Sprint_Node_Actual): Handle iterator_specification within
+ iterated_component_association and iterator_filter within
+ iterator_specification.
+
+2022-09-05 Arnaud Charlet <charlet@adacore.com>
+
+ * doc/gnat_ugn/gnat_and_program_execution.rst: Fix rest syntax
+ * gnat_ugn.texi: Regenerate.
+
2022-09-02 Eric Botcazou <ebotcazou@adacore.com>
* exp_util.adb (Expand_Subtype_From_Expr): Be prepared for
diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog
index 01cf9d8..3ad3096 100644
--- a/gcc/analyzer/ChangeLog
+++ b/gcc/analyzer/ChangeLog
@@ -1,3 +1,17 @@
+2022-09-05 Tim Lange <mail@tim-lange.me>
+
+ * region-model-impl-calls.cc (region_model::impl_call_strcpy):
+ Handle the constant string case.
+ * region-model.cc (region_model::get_string_size):
+ New function to get the string size from a region or svalue.
+ * region-model.h (class region_model): Add get_string_size.
+
+2022-09-05 Tim Lange <mail@tim-lange.me>
+
+ * region.cc (cast_region::get_relative_concrete_offset):
+ New overloaded method.
+ * region.h: Add cast_region::get_relative_concrete_offset.
+
2022-08-22 Martin Liska <mliska@suse.cz>
* region-model.cc: Add missing final keyword.
diff --git a/gcc/analyzer/region-model-impl-calls.cc b/gcc/analyzer/region-model-impl-calls.cc
index 8eebd12..3790eaf 100644
--- a/gcc/analyzer/region-model-impl-calls.cc
+++ b/gcc/analyzer/region-model-impl-calls.cc
@@ -1019,13 +1019,23 @@ region_model::impl_call_strcpy (const call_details &cd)
const svalue *dest_sval = cd.get_arg_svalue (0);
const region *dest_reg = deref_rvalue (dest_sval, cd.get_arg_tree (0),
cd.get_ctxt ());
+ const svalue *src_sval = cd.get_arg_svalue (1);
+ const region *src_reg = deref_rvalue (src_sval, cd.get_arg_tree (1),
+ cd.get_ctxt ());
+ const svalue *src_contents_sval = get_store_value (src_reg,
+ cd.get_ctxt ());
cd.maybe_set_lhs (dest_sval);
- check_region_for_write (dest_reg, cd.get_ctxt ());
+ /* Try to get the string size if SRC_REG is a string_region. */
+ const svalue *copied_bytes_sval = get_string_size (src_reg);
+ /* Otherwise, check if the contents of SRC_REG is a string. */
+ if (copied_bytes_sval->get_kind () == SK_UNKNOWN)
+ copied_bytes_sval = get_string_size (src_contents_sval);
- /* For now, just mark region's contents as unknown. */
- mark_region_as_unknown (dest_reg, cd.get_uncertainty ());
+ const region *sized_dest_reg
+ = m_mgr->get_sized_region (dest_reg, NULL_TREE, copied_bytes_sval);
+ set_value (sized_dest_reg, src_contents_sval, cd.get_ctxt ());
}
/* Handle the on_call_pre part of "strlen". */
diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc
index 5a64c00..e84087a 100644
--- a/gcc/analyzer/region-model.cc
+++ b/gcc/analyzer/region-model.cc
@@ -3218,6 +3218,35 @@ region_model::get_capacity (const region *reg) const
return m_mgr->get_or_create_unknown_svalue (sizetype);
}
+/* Return the string size, including the 0-terminator, if SVAL is a
+ constant_svalue holding a string. Otherwise, return an unknown_svalue. */
+
+const svalue *
+region_model::get_string_size (const svalue *sval) const
+{
+ tree cst = sval->maybe_get_constant ();
+ if (!cst || TREE_CODE (cst) != STRING_CST)
+ return m_mgr->get_or_create_unknown_svalue (size_type_node);
+
+ tree out = build_int_cst (size_type_node, TREE_STRING_LENGTH (cst));
+ return m_mgr->get_or_create_constant_svalue (out);
+}
+
+/* Return the string size, including the 0-terminator, if REG is a
+ string_region. Otherwise, return an unknown_svalue. */
+
+const svalue *
+region_model::get_string_size (const region *reg) const
+{
+ const string_region *str_reg = dyn_cast <const string_region *> (reg);
+ if (!str_reg)
+ return m_mgr->get_or_create_unknown_svalue (size_type_node);
+
+ tree cst = str_reg->get_string_cst ();
+ tree out = build_int_cst (size_type_node, TREE_STRING_LENGTH (cst));
+ return m_mgr->get_or_create_constant_svalue (out);
+}
+
/* If CTXT is non-NULL, use it to warn about any problems accessing REG,
using DIR to determine if this access is a read or write. */
diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h
index 7ce832f..a1f2165 100644
--- a/gcc/analyzer/region-model.h
+++ b/gcc/analyzer/region-model.h
@@ -793,6 +793,9 @@ class region_model
const svalue *get_capacity (const region *reg) const;
+ const svalue *get_string_size (const svalue *sval) const;
+ const svalue *get_string_size (const region *reg) const;
+
/* Implemented in sm-malloc.cc */
void on_realloc_with_move (const call_details &cd,
const svalue *old_ptr_sval,
diff --git a/gcc/analyzer/region.cc b/gcc/analyzer/region.cc
index f4aba6b..9c8279b 100644
--- a/gcc/analyzer/region.cc
+++ b/gcc/analyzer/region.cc
@@ -1556,6 +1556,16 @@ cast_region::dump_to_pp (pretty_printer *pp, bool simple) const
}
}
+/* Implementation of region::get_relative_concrete_offset vfunc
+ for cast_region. */
+
+bool
+cast_region::get_relative_concrete_offset (bit_offset_t *out) const
+{
+ *out = (int) 0;
+ return true;
+}
+
/* class heap_allocated_region : public region. */
/* Implementation of region::dump_to_pp vfunc for heap_allocated_region. */
diff --git a/gcc/analyzer/region.h b/gcc/analyzer/region.h
index d37584b..34ce1fa 100644
--- a/gcc/analyzer/region.h
+++ b/gcc/analyzer/region.h
@@ -1087,6 +1087,8 @@ public:
void accept (visitor *v) const final override;
void dump_to_pp (pretty_printer *pp, bool simple) const final override;
+ bool get_relative_concrete_offset (bit_offset_t *out) const final override;
+
const region *get_original_region () const { return m_original_region; }
private:
diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc
index cb3a5d2..120a038 100644
--- a/gcc/common/config/riscv/riscv-common.cc
+++ b/gcc/common/config/riscv/riscv-common.cc
@@ -200,6 +200,8 @@ static const struct riscv_ext_version riscv_ext_version_table[] =
{"zfh", ISA_SPEC_CLASS_NONE, 1, 0},
{"zfhmin", ISA_SPEC_CLASS_NONE, 1, 0},
+ {"zmmul", ISA_SPEC_CLASS_NONE, 1, 0},
+
/* Terminate the list. */
{NULL, ISA_SPEC_CLASS_NONE, 0, 0}
};
@@ -1214,6 +1216,8 @@ static const riscv_ext_flag_table_t riscv_ext_flag_table[] =
{"zfhmin", &gcc_options::x_riscv_zf_subext, MASK_ZFHMIN},
{"zfh", &gcc_options::x_riscv_zf_subext, MASK_ZFH},
+ {"zmmul", &gcc_options::x_riscv_zm_subext, MASK_ZMMUL},
+
{NULL, NULL, 0}
};
diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc
index f90fda4..5eef5aa 100644
--- a/gcc/config/aarch64/aarch64-builtins.cc
+++ b/gcc/config/aarch64/aarch64-builtins.cc
@@ -1300,8 +1300,6 @@ aarch64_get_attributes (unsigned int f, machine_mode mode)
return aarch64_add_attribute ("leaf", attrs);
}
-static bool aarch64_simd_builtins_initialized_p = false;
-
/* Due to the architecture not providing lane variant of the lane instructions
for fcmla we can't use the standard simd builtin expansion code, but we
still want the majority of the validation that would normally be done. */
@@ -1586,14 +1584,9 @@ handle_arm_neon_h (void)
aarch64_init_simd_intrinsics ();
}
-void
+static void
aarch64_init_simd_builtins (void)
{
- if (aarch64_simd_builtins_initialized_p)
- return;
-
- aarch64_simd_builtins_initialized_p = true;
-
aarch64_init_simd_builtin_types ();
/* Strong-typing hasn't been implemented for all AdvSIMD builtin intrinsics.
diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc
index 3d2fb5e..52ed4a2 100644
--- a/gcc/config/aarch64/aarch64-c.cc
+++ b/gcc/config/aarch64/aarch64-c.cc
@@ -270,19 +270,6 @@ aarch64_pragma_target_parse (tree args, tree pop_target)
if (pop_target)
aarch64_save_restore_target_globals (pop_target);
- /* Initialize SIMD builtins if we haven't already.
- Set current_target_pragma to NULL for the duration so that
- the builtin initialization code doesn't try to tag the functions
- being built with the attributes specified by any current pragma, thus
- going into an infinite recursion. */
- if (TARGET_SIMD)
- {
- tree saved_current_target_pragma = current_target_pragma;
- current_target_pragma = NULL;
- aarch64_init_simd_builtins ();
- current_target_pragma = saved_current_target_pragma;
- }
-
return true;
}
diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index 99af10a..5ecdb8a 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -907,7 +907,6 @@ void aarch64_sve_expand_vector_init (rtx, rtx);
void aarch64_init_cumulative_args (CUMULATIVE_ARGS *, const_tree, rtx,
const_tree, unsigned, bool = false);
void aarch64_init_expanders (void);
-void aarch64_init_simd_builtins (void);
void aarch64_emit_call_insn (rtx);
void aarch64_register_pragmas (void);
void aarch64_relayout_simd_types (void);
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index b12f13f..566763c 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -18019,6 +18019,11 @@ aarch64_validate_march (const char *str, const struct processor **res,
case AARCH64_PARSE_INVALID_ARG:
error ("unknown value %qs for %<-march%>", str);
aarch64_print_hint_for_arch (str);
+ /* A common user error is confusing -march and -mcpu.
+ If the -march string matches a known CPU suggest -mcpu. */
+ parse_res = aarch64_parse_cpu (str, res, isa_flags, &invalid_extension);
+ if (parse_res == AARCH64_PARSE_OK)
+ inform (input_location, "did you mean %<-mcpu=%s%>?", str);
break;
case AARCH64_PARSE_INVALID_FEATURE:
error ("invalid feature modifier %qs in %<-march=%s%>",
@@ -18898,18 +18903,6 @@ aarch64_option_valid_attribute_p (tree fndecl, tree, tree args, int)
if (ret)
{
aarch64_override_options_internal (&global_options);
- /* Initialize SIMD builtins if we haven't already.
- Set current_target_pragma to NULL for the duration so that
- the builtin initialization code doesn't try to tag the functions
- being built with the attributes specified by any current pragma, thus
- going into an infinite recursion. */
- if (TARGET_SIMD)
- {
- tree saved_current_target_pragma = current_target_pragma;
- current_target_pragma = NULL;
- aarch64_init_simd_builtins ();
- current_target_pragma = saved_current_target_pragma;
- }
new_target = build_target_option_node (&global_options,
&global_options_set);
}
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 1aef1af..1be9b66 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -23823,10 +23823,11 @@
(define_insn "sse4_2_crc32di"
[(set (match_operand:DI 0 "register_operand" "=r")
- (unspec:DI
- [(match_operand:DI 1 "register_operand" "0")
- (match_operand:DI 2 "nonimmediate_operand" "rm")]
- UNSPEC_CRC32))]
+ (zero_extend:DI
+ (unspec:SI
+ [(match_operand:SI 1 "register_operand" "0")
+ (match_operand:DI 2 "nonimmediate_operand" "rm")]
+ UNSPEC_CRC32)))]
"TARGET_64BIT && TARGET_CRC32"
"crc32{q}\t{%2, %0|%0, %2}"
[(set_attr "type" "sselog1")
diff --git a/gcc/config/loongarch/genopts/loongarch.opt.in b/gcc/config/loongarch/genopts/loongarch.opt.in
index ebdd953..e106187 100644
--- a/gcc/config/loongarch/genopts/loongarch.opt.in
+++ b/gcc/config/loongarch/genopts/loongarch.opt.in
@@ -184,3 +184,7 @@ Enum(cmodel) String(@@STR_CMODEL_EXTREME@@) Value(CMODEL_EXTREME)
mcmodel=
Target RejectNegative Joined Enum(cmodel) Var(la_opt_cmodel) Init(CMODEL_NORMAL)
Specify the code model.
+
+mdirect-extern-access
+Target Var(TARGET_DIRECT_EXTERN_ACCESS) Init(0)
+Avoid using the GOT to access external symbols.
diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc
index 77e3a10..c9187bf 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -1610,6 +1610,9 @@ loongarch_weak_symbol_p (const_rtx x)
bool
loongarch_symbol_binds_local_p (const_rtx x)
{
+ if (TARGET_DIRECT_EXTERN_ACCESS)
+ return true;
+
if (SYMBOL_REF_P (x))
return (SYMBOL_REF_DECL (x)
? targetm.binds_local_p (SYMBOL_REF_DECL (x))
@@ -6093,6 +6096,9 @@ loongarch_option_override_internal (struct gcc_options *opts)
if (loongarch_branch_cost == 0)
loongarch_branch_cost = loongarch_cost->branch_cost;
+ if (TARGET_DIRECT_EXTERN_ACCESS && flag_shlib)
+ error ("%qs cannot be used for compiling a shared library",
+ "-mdirect-extern-access");
switch (la_target.cmodel)
{
diff --git a/gcc/config/loongarch/loongarch.opt b/gcc/config/loongarch/loongarch.opt
index 6395234..96c811c 100644
--- a/gcc/config/loongarch/loongarch.opt
+++ b/gcc/config/loongarch/loongarch.opt
@@ -191,3 +191,7 @@ Enum(cmodel) String(extreme) Value(CMODEL_EXTREME)
mcmodel=
Target RejectNegative Joined Enum(cmodel) Var(la_opt_cmodel) Init(CMODEL_NORMAL)
Specify the code model.
+
+mdirect-extern-access
+Target Var(TARGET_DIRECT_EXTERN_ACCESS) Init(0)
+Avoid using the GOT to access external symbols.
diff --git a/gcc/config/riscv/riscv-opts.h b/gcc/config/riscv/riscv-opts.h
index 85e869e..55e0bc0 100644
--- a/gcc/config/riscv/riscv-opts.h
+++ b/gcc/config/riscv/riscv-opts.h
@@ -159,6 +159,9 @@ enum stack_protector_guard {
#define TARGET_ZFHMIN ((riscv_zf_subext & MASK_ZFHMIN) != 0)
#define TARGET_ZFH ((riscv_zf_subext & MASK_ZFH) != 0)
+#define MASK_ZMMUL (1 << 0)
+#define TARGET_ZMMUL ((riscv_zm_subext & MASK_ZMMUL) != 0)
+
/* Bit of riscv_zvl_flags will set contintuly, N-1 bit will set if N-bit is
set, e.g. MASK_ZVL64B has set then MASK_ZVL32B is set, so we can use
popcount to caclulate the minimal VLEN. */
diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md
index 2bfab19..014206f 100644
--- a/gcc/config/riscv/riscv.md
+++ b/gcc/config/riscv/riscv.md
@@ -743,7 +743,7 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(mult:SI (match_operand:SI 1 "register_operand" " r")
(match_operand:SI 2 "register_operand" " r")))]
- "TARGET_MUL"
+ "TARGET_ZMMUL || TARGET_MUL"
"mul%~\t%0,%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -752,7 +752,7 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(mult:DI (match_operand:DI 1 "register_operand" " r")
(match_operand:DI 2 "register_operand" " r")))]
- "TARGET_MUL && TARGET_64BIT"
+ "(TARGET_ZMMUL || TARGET_MUL) && TARGET_64BIT"
"mul\t%0,%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "DI")])
@@ -762,7 +762,7 @@
(mult:GPR (match_operand:GPR 1 "register_operand" " r")
(match_operand:GPR 2 "register_operand" " r")))
(label_ref (match_operand 3 "" ""))]
- "TARGET_MUL"
+ "TARGET_ZMMUL || TARGET_MUL"
{
if (TARGET_64BIT && <MODE>mode == SImode)
{
@@ -807,7 +807,7 @@
(mult:GPR (match_operand:GPR 1 "register_operand" " r")
(match_operand:GPR 2 "register_operand" " r")))
(label_ref (match_operand 3 "" ""))]
- "TARGET_MUL"
+ "TARGET_ZMMUL || TARGET_MUL"
{
if (TARGET_64BIT && <MODE>mode == SImode)
{
@@ -853,7 +853,7 @@
(sign_extend:DI
(mult:SI (match_operand:SI 1 "register_operand" " r")
(match_operand:SI 2 "register_operand" " r"))))]
- "TARGET_MUL && TARGET_64BIT"
+ "(TARGET_ZMMUL || TARGET_MUL) && TARGET_64BIT"
"mulw\t%0,%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -864,7 +864,7 @@
(match_operator:SI 3 "subreg_lowpart_operator"
[(mult:DI (match_operand:DI 1 "register_operand" " r")
(match_operand:DI 2 "register_operand" " r"))])))]
- "TARGET_MUL && TARGET_64BIT"
+ "(TARGET_ZMMUL || TARGET_MUL) && TARGET_64BIT"
"mulw\t%0,%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -882,7 +882,7 @@
[(set (match_operand:TI 0 "register_operand")
(mult:TI (any_extend:TI (match_operand:DI 1 "register_operand"))
(any_extend:TI (match_operand:DI 2 "register_operand"))))]
- "TARGET_MUL && TARGET_64BIT"
+ "(TARGET_ZMMUL || TARGET_MUL) && TARGET_64BIT"
{
rtx low = gen_reg_rtx (DImode);
emit_insn (gen_muldi3 (low, operands[1], operands[2]));
@@ -904,7 +904,7 @@
(any_extend:TI
(match_operand:DI 2 "register_operand" " r")))
(const_int 64))))]
- "TARGET_MUL && TARGET_64BIT"
+ "(TARGET_ZMMUL || TARGET_MUL) && TARGET_64BIT"
"mulh<u>\t%0,%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "DI")])
@@ -913,7 +913,7 @@
[(set (match_operand:TI 0 "register_operand")
(mult:TI (zero_extend:TI (match_operand:DI 1 "register_operand"))
(sign_extend:TI (match_operand:DI 2 "register_operand"))))]
- "TARGET_MUL && TARGET_64BIT"
+ "(TARGET_ZMMUL || TARGET_MUL) && TARGET_64BIT"
{
rtx low = gen_reg_rtx (DImode);
emit_insn (gen_muldi3 (low, operands[1], operands[2]));
@@ -935,7 +935,7 @@
(sign_extend:TI
(match_operand:DI 2 "register_operand" " r")))
(const_int 64))))]
- "TARGET_MUL && TARGET_64BIT"
+ "(TARGET_ZMMUL || TARGET_MUL) && TARGET_64BIT"
"mulhsu\t%0,%2,%1"
[(set_attr "type" "imul")
(set_attr "mode" "DI")])
@@ -946,7 +946,7 @@
(match_operand:SI 1 "register_operand" " r"))
(any_extend:DI
(match_operand:SI 2 "register_operand" " r"))))]
- "TARGET_MUL && !TARGET_64BIT"
+ "(TARGET_ZMMUL || TARGET_MUL) && !TARGET_64BIT"
{
rtx temp = gen_reg_rtx (SImode);
emit_insn (gen_mulsi3 (temp, operands[1], operands[2]));
@@ -965,7 +965,7 @@
(any_extend:DI
(match_operand:SI 2 "register_operand" " r")))
(const_int 32))))]
- "TARGET_MUL && !TARGET_64BIT"
+ "(TARGET_ZMMUL || TARGET_MUL) && !TARGET_64BIT"
"mulh<u>\t%0,%1,%2"
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
@@ -977,7 +977,7 @@
(match_operand:SI 1 "register_operand" " r"))
(sign_extend:DI
(match_operand:SI 2 "register_operand" " r"))))]
- "TARGET_MUL && !TARGET_64BIT"
+ "(TARGET_ZMMUL || TARGET_MUL) && !TARGET_64BIT"
{
rtx temp = gen_reg_rtx (SImode);
emit_insn (gen_mulsi3 (temp, operands[1], operands[2]));
@@ -996,7 +996,7 @@
(sign_extend:DI
(match_operand:SI 2 "register_operand" " r")))
(const_int 32))))]
- "TARGET_MUL && !TARGET_64BIT"
+ "(TARGET_ZMMUL || TARGET_MUL) && !TARGET_64BIT"
"mulhsu\t%0,%2,%1"
[(set_attr "type" "imul")
(set_attr "mode" "SI")])
diff --git a/gcc/config/riscv/riscv.opt b/gcc/config/riscv/riscv.opt
index fbca91b..e3af561 100644
--- a/gcc/config/riscv/riscv.opt
+++ b/gcc/config/riscv/riscv.opt
@@ -215,6 +215,9 @@ int riscv_zicmo_subext
TargetVariable
int riscv_zf_subext
+TargetVariable
+int riscv_zm_subext
+
Enum
Name(isa_spec_class) Type(enum riscv_isa_spec_class)
Supported ISA specs (for use with the -misa-spec= option):
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 9124794..9197964 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -979,6 +979,7 @@ Objective-C and Objective-C++ Dialects}.
-memcpy -mno-memcpy -mstrict-align -mno-strict-align @gol
-mmax-inline-memcpy-size=@var{n} @gol
-mexplicit-relocs -mno-explicit-relocs @gol
+-mdirect-extern-access -mno-direct-extern-access @gol
-mcmodel=@var{code-model}}
@emph{M32R/D Options}
@@ -25048,6 +25049,20 @@ GCC build-time by detecting corresponding assembler support:
@code{-mno-explicit-relocs} otherwise. This option is mostly useful for
debugging, or interoperation with assemblers different from the build-time
one.
+
+@item -mdirect-extern-access
+@itemx -mno-direct-extern-access
+@opindex mdirect-extern-access
+Do not use or use GOT to access external symbols. The default is
+@option{-mno-direct-extern-access}: GOT is used for external symbols with
+default visibility, but not used for other external symbols.
+
+With @option{-mdirect-extern-access}, GOT is not used and all external
+symbols are PC-relatively addressed. It is @strong{only} suitable for
+environments where no dynamic link is performed, like firmwares, OS
+kernels, executables linked with @option{-static} or @option{-static-pie}.
+@option{-mdirect-extern-access} is not compatible with @option{-fPIC} or
+@option{-fpic}.
@end table
@node M32C Options
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index e90248d..e20d569 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,29 @@
+2022-09-05 Tobias Burnus <tobias@codesourcery.com>
+
+ * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Handle
+ omp_cur_iteration and distinguish doacross/depend.
+ * gfortran.h (enum gfc_omp_depend_doacross_op): Renamed from
+ gfc_omp_depend_op.
+ (enum gfc_omp_depend_doacross_op): Add OMP_DOACROSS_SINK_FIRST,
+ Rename OMP_DEPEND_SINK to OMP_DOACROSS_SINK.
+ (gfc_omp_namelist) Handle renaming, rename depend_op to
+ depend_doacross_op.
+ (struct gfc_omp_clauses): Add doacross_source.
+ * openmp.cc (gfc_match_omp_depend_sink): Renamed to ...
+ (gfc_match_omp_doacross_sink): ... this; handle omp_all_memory.
+ (enum omp_mask2): Add OMP_CLAUSE_DOACROSS.
+ (gfc_match_omp_clauses): Handle 'doacross' and syntax changes to
+ depend.
+ (gfc_match_omp_depobj): Simplify as sink/source are now impossible.
+ (gfc_match_omp_ordered_depend): Request OMP_CLAUSE_DOACROSS.
+ (resolve_omp_clauses): Update sink/source checks.
+ (gfc_resolve_omp_directive): Resolve EXEC_OMP_ORDERED clauses.
+ * parse.cc (decode_omp_directive): Handle 'ordered doacross'.
+ * trans-openmp.cc (gfc_trans_omp_clauses): Handle doacross.
+ (gfc_trans_omp_do): Fix OMP_FOR_ORIG_DECLS handling if 'ordered'
+ clause is present.
+ (gfc_trans_omp_depobj): Update for member name change.
+
2022-09-04 José Rui Faustino de Sousa <jrfsousa@gmail.com>
PR fortran/100136
diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc
index 5352008..40c690c 100644
--- a/gcc/fortran/dump-parse-tree.cc
+++ b/gcc/fortran/dump-parse-tree.cc
@@ -1337,8 +1337,15 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n)
if (n->u2.ns != ns_iter)
{
if (n != n2)
- fputs (list_type == OMP_LIST_AFFINITY
- ? ") AFFINITY(" : ") DEPEND(", dumpfile);
+ {
+ fputs (") ", dumpfile);
+ if (list_type == OMP_LIST_AFFINITY)
+ fputs ("AFFINITY (", dumpfile);
+ else if (n->u.depend_doacross_op == OMP_DOACROSS_SINK_FIRST)
+ fputs ("DOACROSS (", dumpfile);
+ else
+ fputs ("DEPEND (", dumpfile);
+ }
if (n->u2.ns)
{
fputs ("ITERATOR(", dumpfile);
@@ -1374,7 +1381,7 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n)
default: break;
}
else if (list_type == OMP_LIST_DEPEND)
- switch (n->u.depend_op)
+ switch (n->u.depend_doacross_op)
{
case OMP_DEPEND_IN: fputs ("in:", dumpfile); break;
case OMP_DEPEND_OUT: fputs ("out:", dumpfile); break;
@@ -1385,10 +1392,14 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n)
fputs ("mutexinoutset:", dumpfile);
break;
case OMP_DEPEND_SINK_FIRST:
+ case OMP_DOACROSS_SINK_FIRST:
fputs ("sink:", dumpfile);
while (1)
{
- fprintf (dumpfile, "%s", n->sym->name);
+ if (!n->sym)
+ fputs ("omp_cur_iteration", dumpfile);
+ else
+ fprintf (dumpfile, "%s", n->sym->name);
if (n->expr)
{
fputc ('+', dumpfile);
@@ -1396,9 +1407,13 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n)
}
if (n->next == NULL)
break;
- else if (n->next->u.depend_op != OMP_DEPEND_SINK)
+ else if (n->next->u.depend_doacross_op != OMP_DOACROSS_SINK)
{
- fputs (") DEPEND(", dumpfile);
+ if (n->next->u.depend_doacross_op
+ == OMP_DOACROSS_SINK_FIRST)
+ fputs (") DOACROSS(", dumpfile);
+ else
+ fputs (") DEPEND(", dumpfile);
break;
}
fputc (',', dumpfile);
@@ -1674,7 +1689,14 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses)
case OMP_LIST_AFFINITY: type = "AFFINITY"; break;
case OMP_LIST_ALIGNED: type = "ALIGNED"; break;
case OMP_LIST_LINEAR: type = "LINEAR"; break;
- case OMP_LIST_DEPEND: type = "DEPEND"; break;
+ case OMP_LIST_DEPEND:
+ if (omp_clauses->lists[list_type]
+ && (omp_clauses->lists[list_type]->u.depend_doacross_op
+ == OMP_DOACROSS_SINK_FIRST))
+ type = "DOACROSS";
+ else
+ type = "DEPEND";
+ break;
case OMP_LIST_MAP: type = "MAP"; break;
case OMP_LIST_TO: type = "TO"; break;
case OMP_LIST_FROM: type = "FROM"; break;
@@ -1894,6 +1916,8 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses)
fputs (" DESTROY", dumpfile);
if (omp_clauses->depend_source)
fputs (" DEPEND(source)", dumpfile);
+ if (omp_clauses->doacross_source)
+ fputs (" DOACROSS(source:)", dumpfile);
if (omp_clauses->capture)
fputs (" CAPTURE", dumpfile);
if (omp_clauses->depobj_update != OMP_DEPEND_UNSET)
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 696aadd..4babd77 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -1265,7 +1265,7 @@ enum gfc_omp_reduction_op
OMP_REDUCTION_USER
};
-enum gfc_omp_depend_op
+enum gfc_omp_depend_doacross_op
{
OMP_DEPEND_UNSET,
OMP_DEPEND_IN,
@@ -1275,7 +1275,8 @@ enum gfc_omp_depend_op
OMP_DEPEND_MUTEXINOUTSET,
OMP_DEPEND_DEPOBJ,
OMP_DEPEND_SINK_FIRST,
- OMP_DEPEND_SINK
+ OMP_DOACROSS_SINK_FIRST,
+ OMP_DOACROSS_SINK
};
enum gfc_omp_map_op
@@ -1343,7 +1344,7 @@ typedef struct gfc_omp_namelist
union
{
gfc_omp_reduction_op reduction_op;
- gfc_omp_depend_op depend_op;
+ gfc_omp_depend_doacross_op depend_doacross_op;
gfc_omp_map_op map_op;
struct
{
@@ -1536,17 +1537,17 @@ typedef struct gfc_omp_clauses
unsigned nowait:1, ordered:1, untied:1, mergeable:1, ancestor:1;
unsigned inbranch:1, notinbranch:1, nogroup:1;
unsigned sched_simd:1, sched_monotonic:1, sched_nonmonotonic:1;
- unsigned simd:1, threads:1, depend_source:1, destroy:1, order_concurrent:1;
+ unsigned simd:1, threads:1, doacross_source:1, depend_source:1, destroy:1;
unsigned order_unconstrained:1, order_reproducible:1, capture:1;
unsigned grainsize_strict:1, num_tasks_strict:1, compare:1, weak:1;
- unsigned non_rectangular:1;
+ unsigned non_rectangular:1, order_concurrent:1;
ENUM_BITFIELD (gfc_omp_sched_kind) sched_kind:3;
ENUM_BITFIELD (gfc_omp_device_type) device_type:2;
ENUM_BITFIELD (gfc_omp_memorder) memorder:3;
ENUM_BITFIELD (gfc_omp_memorder) fail:3;
ENUM_BITFIELD (gfc_omp_cancel_kind) cancel:3;
ENUM_BITFIELD (gfc_omp_proc_bind_kind) proc_bind:3;
- ENUM_BITFIELD (gfc_omp_depend_op) depobj_update:4;
+ ENUM_BITFIELD (gfc_omp_depend_doacross_op) depobj_update:4;
ENUM_BITFIELD (gfc_omp_bind_type) bind:2;
ENUM_BITFIELD (gfc_omp_at_type) at:2;
ENUM_BITFIELD (gfc_omp_severity_type) severity:2;
diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc
index 5949077..5142fd7 100644
--- a/gcc/fortran/openmp.cc
+++ b/gcc/fortran/openmp.cc
@@ -575,11 +575,13 @@ syntax_error:
}
-/* Match depend(sink : ...) construct a namelist from it. */
+/* Match doacross(sink : ...) construct a namelist from it;
+ if depend is true, match legacy 'depend(sink : ...)'. */
static match
-gfc_match_omp_depend_sink (gfc_omp_namelist **list)
+gfc_match_omp_doacross_sink (gfc_omp_namelist **list, bool depend)
{
+ char n[GFC_MAX_SYMBOL_LEN+1];
gfc_omp_namelist *head, *tail, *p;
locus old_loc, cur_loc;
gfc_symbol *sym;
@@ -591,49 +593,51 @@ gfc_match_omp_depend_sink (gfc_omp_namelist **list)
for (;;)
{
cur_loc = gfc_current_locus;
- switch (gfc_match_symbol (&sym, 1))
+
+ if (gfc_match_name (n) != MATCH_YES)
+ goto syntax;
+ if (UNLIKELY (strcmp (n, "omp_all_memory") == 0))
{
- case MATCH_YES:
- gfc_set_sym_referenced (sym);
- p = gfc_get_omp_namelist ();
- if (head == NULL)
- {
- head = tail = p;
- head->u.depend_op = OMP_DEPEND_SINK_FIRST;
- }
- else
- {
- tail->next = p;
- tail = tail->next;
- tail->u.depend_op = OMP_DEPEND_SINK;
- }
- tail->sym = sym;
- tail->expr = NULL;
- tail->where = cur_loc;
- if (UNLIKELY (strcmp (sym->name, "omp_all_memory") == 0))
- {
- gfc_error ("%<omp_all_memory%> used with DEPEND kind "
- "other than OUT or INOUT at %C");
- goto cleanup;
- }
- if (gfc_match_char ('+') == MATCH_YES)
- {
- if (gfc_match_literal_constant (&tail->expr, 0) != MATCH_YES)
- goto syntax;
- }
- else if (gfc_match_char ('-') == MATCH_YES)
- {
- if (gfc_match_literal_constant (&tail->expr, 0) != MATCH_YES)
- goto syntax;
- tail->expr = gfc_uminus (tail->expr);
- }
- break;
- case MATCH_NO:
- goto syntax;
- case MATCH_ERROR:
+ gfc_error ("%<omp_all_memory%> used with dependence-type "
+ "other than OUT or INOUT at %C");
goto cleanup;
}
-
+ sym = NULL;
+ if (!(strcmp (n, "omp_cur_iteration") == 0))
+ {
+ gfc_symtree *st;
+ if (gfc_get_ha_sym_tree (n, &st))
+ goto syntax;
+ sym = st->n.sym;
+ gfc_set_sym_referenced (sym);
+ }
+ p = gfc_get_omp_namelist ();
+ if (head == NULL)
+ {
+ head = tail = p;
+ head->u.depend_doacross_op = (depend ? OMP_DEPEND_SINK_FIRST
+ : OMP_DOACROSS_SINK_FIRST);
+ }
+ else
+ {
+ tail->next = p;
+ tail = tail->next;
+ tail->u.depend_doacross_op = OMP_DOACROSS_SINK;
+ }
+ tail->sym = sym;
+ tail->expr = NULL;
+ tail->where = cur_loc;
+ if (gfc_match_char ('+') == MATCH_YES)
+ {
+ if (gfc_match_literal_constant (&tail->expr, 0) != MATCH_YES)
+ goto syntax;
+ }
+ else if (gfc_match_char ('-') == MATCH_YES)
+ {
+ if (gfc_match_literal_constant (&tail->expr, 0) != MATCH_YES)
+ goto syntax;
+ tail->expr = gfc_uminus (tail->expr);
+ }
if (gfc_match_char (')') == MATCH_YES)
break;
if (gfc_match_char (',') != MATCH_YES)
@@ -647,7 +651,7 @@ gfc_match_omp_depend_sink (gfc_omp_namelist **list)
return MATCH_YES;
syntax:
- gfc_error ("Syntax error in OpenMP DEPEND SINK list at %C");
+ gfc_error ("Syntax error in OpenMP SINK dependence-type list at %C");
cleanup:
gfc_free_omp_namelist (head, false);
@@ -987,6 +991,7 @@ enum omp_mask2
OMP_CLAUSE_NOHOST,
OMP_CLAUSE_HAS_DEVICE_ADDR, /* OpenMP 5.1 */
OMP_CLAUSE_ENTER, /* OpenMP 5.2 */
+ OMP_CLAUSE_DOACROSS, /* OpenMP 5.2 */
/* This must come last. */
OMP_MASK2_LAST
};
@@ -1903,18 +1908,26 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
OMP_MAP_RELEASE, true,
allow_derived))
continue;
- if ((mask & OMP_CLAUSE_DEPEND)
- && gfc_match ("depend ( ") == MATCH_YES)
+ /* DOACROSS: match 'doacross' and 'depend' with sink/source.
+ DEPEND: match 'depend' but not sink/source. */
+ m = MATCH_NO;
+ if (((mask & OMP_CLAUSE_DOACROSS)
+ && gfc_match ("doacross ( ") == MATCH_YES)
+ || (((mask & OMP_CLAUSE_DEPEND) || (mask & OMP_CLAUSE_DOACROSS))
+ && (m = gfc_match ("depend ( ")) == MATCH_YES))
{
bool has_omp_all_memory;
+ bool is_depend = m == MATCH_YES;
gfc_namespace *ns_iter = NULL, *ns_curr = gfc_current_ns;
- match m_it = gfc_match_iterator (&ns_iter, false);
+ match m_it = MATCH_NO;
+ if (is_depend)
+ m_it = gfc_match_iterator (&ns_iter, false);
if (m_it == MATCH_ERROR)
break;
if (m_it == MATCH_YES && gfc_match (" , ") != MATCH_YES)
break;
m = MATCH_YES;
- gfc_omp_depend_op depend_op = OMP_DEPEND_OUT;
+ gfc_omp_depend_doacross_op depend_op = OMP_DEPEND_OUT;
if (gfc_match ("inoutset") == MATCH_YES)
depend_op = OMP_DEPEND_INOUTSET;
else if (gfc_match ("inout") == MATCH_YES)
@@ -1927,34 +1940,77 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
depend_op = OMP_DEPEND_MUTEXINOUTSET;
else if (gfc_match ("depobj") == MATCH_YES)
depend_op = OMP_DEPEND_DEPOBJ;
- else if (!c->depend_source
- && gfc_match ("source )") == MATCH_YES)
+ else if (gfc_match ("source") == MATCH_YES)
{
if (m_it == MATCH_YES)
{
gfc_error ("ITERATOR may not be combined with SOURCE "
"at %C");
- gfc_free_omp_clauses (c);
- return MATCH_ERROR;
+ goto error;
+ }
+ if (!(mask & OMP_CLAUSE_DOACROSS))
+ {
+ gfc_error ("SOURCE at %C not permitted as dependence-type"
+ " for this directive");
+ goto error;
+ }
+ if (c->doacross_source)
+ {
+ gfc_error ("Duplicated clause with SOURCE dependence-type"
+ " at %C");
+ goto error;
+ }
+ gfc_gobble_whitespace ();
+ m = gfc_match (": ");
+ if (m != MATCH_YES && !is_depend)
+ {
+ gfc_error ("Expected %<:%> at %C");
+ goto error;
}
- c->depend_source = true;
+ if (gfc_match (")") != MATCH_YES
+ && !(m == MATCH_YES
+ && gfc_match ("omp_cur_iteration )") == MATCH_YES))
+ {
+ gfc_error ("Expected %<)%> or %<omp_cur_iteration)%> "
+ "at %C");
+ goto error;
+ }
+ c->doacross_source = true;
+ c->depend_source = is_depend;
continue;
}
- else if (gfc_match ("sink : ") == MATCH_YES)
+ else if (gfc_match ("sink ") == MATCH_YES)
{
+ if (!(mask & OMP_CLAUSE_DOACROSS))
+ {
+ gfc_error ("SINK at %C not permitted as dependence-type "
+ "for this directive");
+ goto error;
+ }
+ if (gfc_match (": ") != MATCH_YES)
+ {
+ gfc_error ("Expected %<:%> at %C");
+ goto error;
+ }
if (m_it == MATCH_YES)
{
gfc_error ("ITERATOR may not be combined with SINK "
"at %C");
- break;
+ goto error;
}
- if (gfc_match_omp_depend_sink (&c->lists[OMP_LIST_DEPEND])
- == MATCH_YES)
+ m = gfc_match_omp_doacross_sink (&c->lists[OMP_LIST_DEPEND],
+ is_depend);
+ if (m == MATCH_YES)
continue;
- m = MATCH_NO;
+ goto error;
}
else
m = MATCH_NO;
+ if (!(mask & OMP_CLAUSE_DEPEND))
+ {
+ gfc_error ("Expected dependence-type SINK or SOURCE at %C");
+ goto error;
+ }
head = NULL;
if (ns_iter)
gfc_current_ns = ns_iter;
@@ -1976,7 +2032,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
gfc_omp_namelist *n;
for (n = *head; n; n = n->next)
{
- n->u.depend_op = depend_op;
+ n->u.depend_doacross_op = depend_op;
n->u2.ns = ns_iter;
if (ns_iter)
ns_iter->refs++;
@@ -3971,18 +4027,15 @@ gfc_match_omp_depobj (void)
if (c->depobj_update == OMP_DEPEND_UNSET && !c->destroy)
{
- if (!c->depend_source && !c->lists[OMP_LIST_DEPEND])
+ if (!c->doacross_source && !c->lists[OMP_LIST_DEPEND])
{
gfc_error ("Expected DEPEND, UPDATE, or DESTROY clause at %C");
goto error;
}
- if (c->depend_source
- || c->lists[OMP_LIST_DEPEND]->u.depend_op == OMP_DEPEND_SINK_FIRST
- || c->lists[OMP_LIST_DEPEND]->u.depend_op == OMP_DEPEND_SINK
- || c->lists[OMP_LIST_DEPEND]->u.depend_op == OMP_DEPEND_DEPOBJ)
+ if (c->lists[OMP_LIST_DEPEND]->u.depend_doacross_op == OMP_DEPEND_DEPOBJ)
{
gfc_error ("DEPEND clause at %L of OMP DEPOBJ construct shall not "
- "have dependence-type SOURCE, SINK or DEPOBJ",
+ "have dependence-type DEPOBJ",
c->lists[OMP_LIST_DEPEND]
? &c->lists[OMP_LIST_DEPEND]->where : &gfc_current_locus);
goto error;
@@ -5988,7 +6041,7 @@ gfc_match_omp_nothing (void)
match
gfc_match_omp_ordered_depend (void)
{
- return match_omp (EXEC_OMP_ORDERED, omp_mask (OMP_CLAUSE_DEPEND));
+ return match_omp (EXEC_OMP_ORDERED, omp_mask (OMP_CLAUSE_DOACROSS));
}
@@ -7057,18 +7110,16 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
if (list == OMP_LIST_DEPEND)
{
- if (n->u.depend_op == OMP_DEPEND_SINK_FIRST
- || n->u.depend_op == OMP_DEPEND_SINK)
+ if (n->u.depend_doacross_op == OMP_DEPEND_SINK_FIRST
+ || n->u.depend_doacross_op == OMP_DOACROSS_SINK_FIRST
+ || n->u.depend_doacross_op == OMP_DOACROSS_SINK)
{
- if (code->op != EXEC_OMP_ORDERED)
- gfc_error ("SINK dependence type only allowed "
- "on ORDERED directive at %L", &n->where);
- else if (omp_clauses->depend_source)
+ if (omp_clauses->doacross_source)
{
- gfc_error ("DEPEND SINK used together with "
- "DEPEND SOURCE on the same construct "
- "at %L", &n->where);
- omp_clauses->depend_source = false;
+ gfc_error ("Dependence-type SINK used together with"
+ " SOURCE on the same construct at %L",
+ &n->where);
+ omp_clauses->doacross_source = false;
}
else if (n->expr)
{
@@ -7078,13 +7129,14 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
gfc_error ("SINK addend not a constant integer "
"at %L", &n->where);
}
+ if (n->sym == NULL
+ && (n->expr == NULL
+ || mpz_cmp_si (n->expr->value.integer, -1) != 0))
+ gfc_error ("omp_cur_iteration at %L requires %<-1%> "
+ "as logical offset", &n->where);
continue;
}
- else if (code->op == EXEC_OMP_ORDERED)
- gfc_error ("Only SOURCE or SINK dependence types "
- "are allowed on ORDERED directive at %L",
- &n->where);
- else if (n->u.depend_op == OMP_DEPEND_DEPOBJ
+ else if (n->u.depend_doacross_op == OMP_DEPEND_DEPOBJ
&& !n->expr
&& (n->sym->ts.type != BT_INTEGER
|| n->sym->ts.kind
@@ -7094,7 +7146,7 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
"type shall be a scalar integer of "
"OMP_DEPEND_KIND kind", n->sym->name,
&n->where);
- else if (n->u.depend_op == OMP_DEPEND_DEPOBJ
+ else if (n->u.depend_doacross_op == OMP_DEPEND_DEPOBJ
&& n->expr
&& (!gfc_resolve_expr (n->expr)
|| n->expr->ts.type != BT_INTEGER
@@ -7760,9 +7812,6 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
resolve_scalar_int_expr (el->expr, "WAIT");
if (omp_clauses->collapse && omp_clauses->tile_list)
gfc_error ("Incompatible use of TILE and COLLAPSE at %L", &code->loc);
- if (omp_clauses->depend_source && code->op != EXEC_OMP_ORDERED)
- gfc_error ("SOURCE dependence type only allowed "
- "on ORDERED directive at %L", &code->loc);
if (omp_clauses->message)
{
gfc_expr *expr = omp_clauses->message;
@@ -9565,6 +9614,7 @@ gfc_resolve_omp_directive (gfc_code *code, gfc_namespace *ns)
case EXEC_OMP_CANCEL:
case EXEC_OMP_ERROR:
case EXEC_OMP_MASKED:
+ case EXEC_OMP_ORDERED:
case EXEC_OMP_PARALLEL_WORKSHARE:
case EXEC_OMP_PARALLEL:
case EXEC_OMP_PARALLEL_MASKED:
diff --git a/gcc/fortran/parse.cc b/gcc/fortran/parse.cc
index 80492c9..5b13441 100644
--- a/gcc/fortran/parse.cc
+++ b/gcc/fortran/parse.cc
@@ -1026,7 +1026,8 @@ decode_omp_directive (void)
matcho ("loop", gfc_match_omp_loop, ST_OMP_LOOP);
break;
case 'o':
- if (gfc_match ("ordered depend (") == MATCH_YES)
+ if (gfc_match ("ordered depend (") == MATCH_YES
+ || gfc_match ("ordered doacross (") == MATCH_YES)
{
gfc_current_locus = old_locus;
if (!flag_openmp)
diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc
index 82c1079..1be7d23 100644
--- a/gcc/fortran/trans-openmp.cc
+++ b/gcc/fortran/trans-openmp.cc
@@ -2864,15 +2864,18 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
gfc_init_block (&iter_block);
prev = n;
if (list == OMP_LIST_DEPEND
- && n->u.depend_op == OMP_DEPEND_SINK_FIRST)
+ && (n->u.depend_doacross_op == OMP_DOACROSS_SINK_FIRST
+ || n->u.depend_doacross_op == OMP_DEPEND_SINK_FIRST))
{
tree vec = NULL_TREE;
unsigned int i;
+ bool is_depend
+ = n->u.depend_doacross_op == OMP_DEPEND_SINK_FIRST;
for (i = 0; ; i++)
{
tree addend = integer_zero_node, t;
bool neg = false;
- if (n->expr)
+ if (n->sym && n->expr)
{
addend = gfc_conv_constant_to_tree (n->expr);
if (TREE_CODE (addend) == INTEGER_CST
@@ -2883,7 +2886,11 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
TREE_TYPE (addend), addend);
}
}
- t = gfc_trans_omp_variable (n->sym, false);
+
+ if (n->sym == NULL)
+ t = null_pointer_node; /* "omp_cur_iteration - 1". */
+ else
+ t = gfc_trans_omp_variable (n->sym, false);
if (t != error_mark_node)
{
if (i < vec_safe_length (doacross_steps)
@@ -2900,7 +2907,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
OMP_CLAUSE_DOACROSS_SINK_NEGATIVE (vec) = 1;
}
if (n->next == NULL
- || n->next->u.depend_op != OMP_DEPEND_SINK)
+ || n->next->u.depend_doacross_op != OMP_DOACROSS_SINK)
break;
n = n->next;
}
@@ -2910,7 +2917,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
tree node = build_omp_clause (input_location,
OMP_CLAUSE_DOACROSS);
OMP_CLAUSE_DOACROSS_KIND (node) = OMP_CLAUSE_DOACROSS_SINK;
- OMP_CLAUSE_DOACROSS_DEPEND (node) = 1;
+ OMP_CLAUSE_DOACROSS_DEPEND (node) = is_depend;
OMP_CLAUSE_DECL (node) = nreverse (vec);
omp_clauses = gfc_trans_add_clause (node, omp_clauses);
continue;
@@ -2962,7 +2969,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
OMP_CLAUSE_DECL (node) = build_fold_indirect_ref (ptr);
}
if (list == OMP_LIST_DEPEND)
- switch (n->u.depend_op)
+ switch (n->u.depend_doacross_op)
{
case OMP_DEPEND_IN:
OMP_CLAUSE_DEPEND_KIND (node) = OMP_CLAUSE_DEPEND_IN;
@@ -4253,11 +4260,11 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
omp_clauses = gfc_trans_add_clause (c, omp_clauses);
}
- if (clauses->depend_source)
+ if (clauses->doacross_source)
{
c = build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_DOACROSS);
OMP_CLAUSE_DOACROSS_KIND (c) = OMP_CLAUSE_DOACROSS_SOURCE;
- OMP_CLAUSE_DOACROSS_DEPEND (c) = 1;
+ OMP_CLAUSE_DOACROSS_DEPEND (c) = clauses->depend_source;
omp_clauses = gfc_trans_add_clause (c, omp_clauses);
}
@@ -5119,7 +5126,7 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
init = make_tree_vec (collapse);
cond = make_tree_vec (collapse);
incr = make_tree_vec (collapse);
- orig_decls = clauses->orderedc ? make_tree_vec (collapse) : NULL_TREE;
+ orig_decls = clauses->ordered ? make_tree_vec (collapse) : NULL_TREE;
if (pblock == NULL)
{
@@ -5219,6 +5226,10 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
MODIFY_EXPR,
type, dovar,
TREE_VEC_ELT (incr, i));
+ if (orig_decls && !clauses->orderedc)
+ orig_decls = NULL;
+ else if (orig_decls)
+ TREE_VEC_ELT (orig_decls, i) = dovar_decl;
}
else
{
@@ -5259,9 +5270,9 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
vec_safe_grow_cleared (doacross_steps, clauses->orderedc, true);
(*doacross_steps)[i] = step;
}
+ if (orig_decls)
+ TREE_VEC_ELT (orig_decls, i) = dovar_decl;
}
- if (orig_decls)
- TREE_VEC_ELT (orig_decls, i) = dovar_decl;
if (dovar_found == 3
&& op == EXEC_OMP_SIMD
@@ -5628,7 +5639,7 @@ gfc_trans_omp_depobj (gfc_code *code)
int k = -1; /* omp_clauses->destroy */
if (!code->ext.omp_clauses->destroy)
switch (code->ext.omp_clauses->depobj_update != OMP_DEPEND_UNSET
- ? code->ext.omp_clauses->depobj_update : n->u.depend_op)
+ ? code->ext.omp_clauses->depobj_update : n->u.depend_doacross_op)
{
case OMP_DEPEND_IN: k = GOMP_DEPEND_IN; break;
case OMP_DEPEND_OUT: k = GOMP_DEPEND_OUT; break;
diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc
index a754ff0..681047d 100644
--- a/gcc/gimple-predicate-analysis.cc
+++ b/gcc/gimple-predicate-analysis.cc
@@ -52,14 +52,6 @@
#define MAX_NUM_CHAINS 8
#define MAX_CHAIN_LEN 5
-/* When enumerating paths between two blocks this limits the number of
- post-dominator skips between two edges possibly defining a predicate. */
-#define MAX_POSTDOM_CHECK 8
-
-/* The limit for the number of switch cases when we do the linear search
- for the case corresponding to an edge. */
-#define MAX_SWITCH_CASES 40
-
/* Return true if X1 is the negation of X2. */
static inline bool
@@ -150,34 +142,34 @@ format_edge_vecs (const vec<edge> eva[], unsigned n)
return str;
}
-/* Dump a single pred_info to DUMP_FILE. */
+/* Dump a single pred_info to F. */
static void
-dump_pred_info (const pred_info &pred)
+dump_pred_info (FILE *f, const pred_info &pred)
{
if (pred.invert)
- fprintf (dump_file, "NOT (");
- print_generic_expr (dump_file, pred.pred_lhs);
- fprintf (dump_file, " %s ", op_symbol_code (pred.cond_code));
- print_generic_expr (dump_file, pred.pred_rhs);
+ fprintf (f, "NOT (");
+ print_generic_expr (f, pred.pred_lhs);
+ fprintf (f, " %s ", op_symbol_code (pred.cond_code));
+ print_generic_expr (f, pred.pred_rhs);
if (pred.invert)
- fputc (')', dump_file);
+ fputc (')', f);
}
-/* Dump a pred_chain to DUMP_FILE. */
+/* Dump a pred_chain to F. */
static void
-dump_pred_chain (const pred_chain &chain)
+dump_pred_chain (FILE *f, const pred_chain &chain)
{
unsigned np = chain.length ();
for (unsigned j = 0; j < np; j++)
{
if (j > 0)
- fprintf (dump_file, " AND (");
+ fprintf (f, " AND (");
else
- fputc ('(', dump_file);
- dump_pred_info (chain[j]);
- fputc (')', dump_file);
+ fputc ('(', f);
+ dump_pred_info (f, chain[j]);
+ fputc (')', f);
}
}
@@ -1010,15 +1002,6 @@ compute_control_dep_chain (basic_block dom_bb, const_basic_block dep_bb,
if (single_succ_p (dom_bb))
return false;
- if (*num_calls > (unsigned)param_uninit_control_dep_attempts)
- {
- if (dump_file)
- fprintf (dump_file, "param_uninit_control_dep_attempts exceeded: %u\n",
- *num_calls);
- return false;
- }
- ++*num_calls;
-
/* FIXME: Use a set instead. */
unsigned cur_chain_len = cur_cd_chain.length ();
if (cur_chain_len > MAX_CHAIN_LEN)
@@ -1048,7 +1031,6 @@ compute_control_dep_chain (basic_block dom_bb, const_basic_block dep_bb,
edge_iterator ei;
FOR_EACH_EDGE (e, ei, dom_bb->succs)
{
- int post_dom_check = 0;
if (e->flags & (EDGE_FAKE | EDGE_ABNORMAL | EDGE_DFS_BACK))
continue;
@@ -1088,6 +1070,17 @@ compute_control_dep_chain (basic_block dom_bb, const_basic_block dep_bb,
if (in_region != 0 && !(cd_bb->flags & in_region))
break;
+ /* Count the number of steps we perform to limit compile-time.
+ This should cover both recursion and the post-dominator walk. */
+ if (*num_calls > (unsigned)param_uninit_control_dep_attempts)
+ {
+ if (dump_file)
+ fprintf (dump_file, "param_uninit_control_dep_attempts "
+ "exceeded: %u\n", *num_calls);
+ return false;
+ }
+ ++*num_calls;
+
/* Check if DEP_BB is indirectly control-dependent on DOM_BB. */
if (!single_succ_p (cd_bb)
&& compute_control_dep_chain (cd_bb, dep_bb, cd_chains,
@@ -1105,9 +1098,7 @@ compute_control_dep_chain (basic_block dom_bb, const_basic_block dep_bb,
&& single_succ_edge (cd_bb)->flags & EDGE_DFS_BACK)
break;
cd_bb = get_immediate_dominator (CDI_POST_DOMINATORS, cd_bb);
- post_dom_check++;
- if (cd_bb == EXIT_BLOCK_PTR_FOR_FN (cfun)
- || post_dom_check > MAX_POSTDOM_CHECK)
+ if (cd_bb == EXIT_BLOCK_PTR_FOR_FN (cfun))
break;
}
cur_cd_chain.pop ();
@@ -1405,7 +1396,7 @@ predicate::simplify (gimple *use_or_def, bool is_use)
if (dump_file && dump_flags & TDF_DETAILS)
{
fprintf (dump_file, "Before simplication ");
- dump (use_or_def, is_use ? "[USE]:\n" : "[DEF]:\n");
+ dump (dump_file, use_or_def, is_use ? "[USE]:\n" : "[DEF]:\n");
}
unsigned n = m_preds.length ();
@@ -1641,7 +1632,7 @@ predicate::normalize (gimple *use_or_def, bool is_use)
if (dump_file && dump_flags & TDF_DETAILS)
{
fprintf (dump_file, "Before normalization ");
- dump (use_or_def, is_use ? "[USE]:\n" : "[DEF]:\n");
+ dump (dump_file, use_or_def, is_use ? "[USE]:\n" : "[DEF]:\n");
}
predicate norm_preds;
@@ -1658,7 +1649,7 @@ predicate::normalize (gimple *use_or_def, bool is_use)
if (dump_file)
{
fprintf (dump_file, "After normalization ");
- dump (use_or_def, is_use ? "[USE]:\n" : "[DEF]:\n");
+ dump (dump_file, use_or_def, is_use ? "[USE]:\n" : "[DEF]:\n");
}
}
@@ -1748,7 +1739,7 @@ predicate::init_from_control_deps (const vec<edge> *dep_chains,
{
fprintf (dump_file, "%d -> %d: one_pred = ",
e->src->index, e->dest->index);
- dump_pred_info (one_pred);
+ dump_pred_info (dump_file, one_pred);
fputc ('\n', dump_file);
}
@@ -1756,28 +1747,12 @@ predicate::init_from_control_deps (const vec<edge> *dep_chains,
}
else if (gswitch *gs = dyn_cast<gswitch *> (cond_stmt))
{
- tree l = NULL_TREE;
/* Find the case label, but avoid quadratic behavior. */
- if (gimple_switch_num_labels (gs) <= MAX_SWITCH_CASES)
- for (unsigned idx = 0;
- idx < gimple_switch_num_labels (gs); ++idx)
- {
- tree tl = gimple_switch_label (gs, idx);
- if (e->dest == label_to_block (cfun, CASE_LABEL (tl)))
- {
- if (!l)
- l = tl;
- else
- {
- l = NULL_TREE;
- break;
- }
- }
- }
+ tree l = get_cases_for_edge (e, gs);
/* If more than one label reaches this block or the case
label doesn't have a contiguous range of values (like the
default one) fail. */
- if (!l || !CASE_LOW (l))
+ if (!l || CASE_CHAIN (l) || !CASE_LOW (l))
has_valid_pred = false;
else if (!CASE_HIGH (l)
|| operand_equal_p (CASE_LOW (l), CASE_HIGH (l)))
@@ -1845,7 +1820,7 @@ predicate::init_from_control_deps (const vec<edge> *dep_chains,
}
if (DEBUG_PREDICATE_ANALYZER && dump_file)
- dump (NULL, "");
+ dump (dump_file);
}
/* Store a PRED in *THIS. */
@@ -1858,37 +1833,53 @@ predicate::push_pred (const pred_info &pred)
m_preds.safe_push (chain);
}
-/* Dump predicates in *THIS for STMT prepended by MSG. */
+/* Dump predicates in *THIS to F. */
void
-predicate::dump (gimple *stmt, const char *msg) const
+predicate::dump (FILE *f) const
{
- fprintf (dump_file, "%s", msg);
- if (stmt)
- {
- fputc ('\t', dump_file);
- print_gimple_stmt (dump_file, stmt, 0);
- fprintf (dump_file, " is conditional on:\n");
- }
-
unsigned np = m_preds.length ();
if (np == 0)
{
- fprintf (dump_file, "\tTRUE (empty)\n");
+ fprintf (f, "\tTRUE (empty)\n");
return;
}
for (unsigned i = 0; i < np; i++)
{
if (i > 0)
- fprintf (dump_file, "\tOR (");
+ fprintf (f, "\tOR (");
else
- fprintf (dump_file, "\t(");
- dump_pred_chain (m_preds[i]);
- fprintf (dump_file, ")\n");
+ fprintf (f, "\t(");
+ dump_pred_chain (f, m_preds[i]);
+ fprintf (f, ")\n");
}
}
+/* Dump predicates in *THIS to stderr. */
+
+void
+predicate::debug () const
+{
+ dump (stderr);
+}
+
+/* Dump predicates in *THIS for STMT prepended by MSG to F. */
+
+void
+predicate::dump (FILE *f, gimple *stmt, const char *msg) const
+{
+ fprintf (f, "%s", msg);
+ if (stmt)
+ {
+ fputc ('\t', f);
+ print_gimple_stmt (f, stmt, 0);
+ fprintf (f, " is conditional on:\n");
+ }
+
+ dump (f);
+}
+
/* Initialize USE_PREDS with the predicates of the control dependence chains
between the basic block DEF_BB that defines a variable of interst and
USE_BB that uses the variable, respectively. */
diff --git a/gcc/gimple-predicate-analysis.h b/gcc/gimple-predicate-analysis.h
index bc0248d..972af5e 100644
--- a/gcc/gimple-predicate-analysis.h
+++ b/gcc/gimple-predicate-analysis.h
@@ -67,7 +67,9 @@ class predicate
void init_from_control_deps (const vec<edge> *, unsigned, bool);
- void dump (gimple *, const char *) const;
+ void dump (FILE *) const;
+ void dump (FILE *, gimple *, const char *) const;
+ void debug () const;
void normalize (gimple * = NULL, bool = false);
void simplify (gimple * = NULL, bool = false);
diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc
index d8497fc..c9c7a2c 100644
--- a/gcc/gimple-range-fold.cc
+++ b/gcc/gimple-range-fold.cc
@@ -1029,13 +1029,12 @@ fold_using_range::range_of_builtin_int_call (irange &r, gcall *call,
frange tmp;
if (src.get_operand (tmp, arg))
{
- if (tmp.get_signbit ().varying_p ())
+ if (tmp.get_signbit ().varying_p ()
+ // FIXME: We don't support signed NANs yet.
+ || !tmp.get_nan ().no_p ())
return false;
if (tmp.get_signbit ().yes_p ())
- {
- tree one = build_one_cst (type);
- r.set (one, one);
- }
+ r.set_nonzero (type);
else
r.set_zero (type);
return true;
diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc
index 7301e5a..050f07a 100644
--- a/gcc/range-op-float.cc
+++ b/gcc/range-op-float.cc
@@ -204,11 +204,6 @@ frelop_early_resolve (irange &r, tree type,
static inline void
frange_drop_inf (frange &r, tree type)
{
- // FIXME: build_real() bails on decimal float modes when called with
- // a max representable endpoint.
- if (DECIMAL_FLOAT_MODE_P (TYPE_MODE (type)))
- return;
-
REAL_VALUE_TYPE max;
real_max_representable (&max, type);
frange tmp (type, r.lower_bound (), max);
@@ -221,11 +216,6 @@ frange_drop_inf (frange &r, tree type)
static inline void
frange_drop_ninf (frange &r, tree type)
{
- // FIXME: build_real() bails on decimal float modes when called with
- // a max representable endpoint.
- if (DECIMAL_FLOAT_MODE_P (TYPE_MODE (type)))
- return;
-
REAL_VALUE_TYPE min;
real_min_representable (&min, type);
frange tmp (type, min, r.upper_bound ());
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3c5a254..e5f2849 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,57 @@
+2022-09-05 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc.dg/cpp/c11-trigraphs-1.c, gcc.dg/cpp/c2x-trigraphs-1.c,
+ gcc.dg/cpp/c2x-trigraphs-2.c: New tests.
+
+2022-09-05 Aldy Hernandez <aldyh@redhat.com>
+
+ * gcc.dg/tree-ssa/vrp-float-signbit-2.c: New test.
+
+2022-09-05 Alexander Monakov <amonakov@ispras.ru>
+
+ PR target/106453
+ * gcc.target/i386/pr106453.c: New test.
+
+2022-09-05 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/all-memory-1.f90: Update dg-error.
+ * gfortran.dg/gomp/depend-iterator-2.f90: Likewise.
+ * gfortran.dg/gomp/depobj-2.f90: Likewise.
+ * gfortran.dg/gomp/doacross-5.f90: New test.
+ * gfortran.dg/gomp/doacross-6.f90: New test.
+
+2022-09-05 Aldy Hernandez <aldyh@redhat.com>
+
+ PR middle-end/106824
+ * g++.dg/pr106824.C: New test.
+
+2022-09-05 Tim Lange <mail@tim-lange.me>
+
+ * gcc.dg/analyzer/out-of-bounds-4.c: New test.
+ * gcc.dg/analyzer/strcpy-3.c: New test.
+
+2022-09-05 Tim Lange <mail@tim-lange.me>
+
+ * gcc.dg/analyzer/fold-string-to-char.c: New test.
+
+2022-09-05 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/aarch64/spellcheck_10.c: New test.
+
+2022-09-05 LiaoShihua <shihua@iscas.ac.cn>
+
+ * gcc.target/riscv/zmmul-1.c: New test.
+ * gcc.target/riscv/zmmul-2.c: New test.
+
+2022-09-05 Xi Ruoyao <xry111@xry111.site>
+
+ * gcc.target/loongarch/direct-extern-1.c: New test.
+ * gcc.target/loongarch/direct-extern-2.c: New test.
+
+2022-09-05 konglin1 <lingling.kong@intel.com>
+
+ * gcc.target/i386/pr106742.c: New test.
+
2022-09-04 José Rui Faustino de Sousa <jrfsousa@gmail.com>
PR fortran/100136
diff --git a/gcc/testsuite/g++.dg/pr106824.C b/gcc/testsuite/g++.dg/pr106824.C
new file mode 100644
index 0000000..bd80be0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr106824.C
@@ -0,0 +1,76 @@
+// { dg-do compile }
+// { dg-options "-O2 -w -std=c++11" }
+
+using int32 = int;
+int ShortestPath_distance;
+struct FloatWeightTpl {
+ FloatWeightTpl(float f) : value_(f) {}
+ float Value() { return value_; }
+ float value_;
+};
+template <class T> bool operator!=(FloatWeightTpl w1, T w2) {
+ bool __trans_tmp_2;
+ FloatWeightTpl __trans_tmp_3 = w1;
+ __trans_tmp_2 = __trans_tmp_3.Value() == w2.Value();
+ return __trans_tmp_2;
+}
+struct TropicalWeightTpl : FloatWeightTpl {
+ TropicalWeightTpl(float f) : FloatWeightTpl(f) {}
+ static TropicalWeightTpl Zero();
+ static TropicalWeightTpl NoWeight() {
+ float __trans_tmp_5 = __builtin_nanf("");
+ return __trans_tmp_5;
+ }
+ bool Member() { return value_; }
+};
+TropicalWeightTpl Plus(TropicalWeightTpl w1, TropicalWeightTpl &w2) {
+ return w1.Member() || w2.Member() ? TropicalWeightTpl::NoWeight() : w2.Value() ? : w2;
+}
+TropicalWeightTpl Times();
+struct ArcTpl {
+ using Weight = TropicalWeightTpl;
+};
+template <class, class, class> struct ShortestPathOptions {
+ ShortestPathOptions(int, int, int32, bool, bool);
+};
+template <class Arc, class Queue, class ArcFilter>
+void SingleShortestPath(ShortestPathOptions<Arc, Queue, ArcFilter>) {
+ using Weight = typename Arc::Weight;
+ auto f_distance = Weight::Zero();
+ while (!0) {
+ TropicalWeightTpl __trans_tmp_1 = Times(),
+ plus = Plus(f_distance, __trans_tmp_1);
+ if (f_distance != plus)
+ f_distance = plus;
+ }
+}
+template <class Arc, class Queue, class ArcFilter>
+void ShortestPath(int, int *, int *,
+ ShortestPathOptions<Arc, Queue, ArcFilter> opts) {
+ SingleShortestPath(opts);
+}
+struct ShortestDistanceOptions {
+ float delta;
+};
+struct Trans_NS_script_ShortestPathOptions : ShortestDistanceOptions {
+ int32 nshortest;
+ bool unique;
+};
+namespace internal {
+template <class, class>
+void ShortestPath(int ifst, int *ofst, int *distance,
+ Trans_NS_script_ShortestPathOptions opts) {
+ using ArcFilter = int;
+ ShortestPathOptions<ArcTpl, int, ArcFilter> sopts(opts.nshortest, opts.unique,
+ false, opts.delta, 0);
+ ShortestPath(ifst, ofst, distance, sopts);
+}
+int ShortestPath_ifst;
+int ShortestPath_ofst;
+Trans_NS_script_ShortestPathOptions ShortestPath_opts;
+void ShortestPath() {
+ using StateId = int;
+ ShortestPath<ArcTpl, StateId>(ShortestPath_ifst, &ShortestPath_ofst,
+ &ShortestPath_distance, ShortestPath_opts);
+}
+} // namespace internal
diff --git a/gcc/testsuite/gcc.dg/analyzer/fold-string-to-char.c b/gcc/testsuite/gcc.dg/analyzer/fold-string-to-char.c
new file mode 100644
index 0000000..4613921
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/fold-string-to-char.c
@@ -0,0 +1,8 @@
+#include "analyzer-decls.h"
+
+void test_1 (void)
+{
+ char str[] = "Hello";
+ char *ptr = str;
+ __analyzer_eval (ptr[0] == 'H'); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/out-of-bounds-4.c b/gcc/testsuite/gcc.dg/analyzer/out-of-bounds-4.c
new file mode 100644
index 0000000..46f600d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/out-of-bounds-4.c
@@ -0,0 +1,65 @@
+/* { dg-additional-options "-Wno-stringop-overflow -Wno-stringop-truncation" } */
+#include <string.h>
+
+/* Wanalyzer-out-of-bounds tests for strpy-related overflows.
+
+ The intra-procedural tests are all caught by Wstringop-overflow.
+ The inter-procedural out-of-bounds are only found by the analyzer. */
+
+void test1 (void)
+{
+ char dst[5];
+ strcpy (dst, "Hello"); /* { dg-line test1 } */
+
+ /* { dg-warning "overflow" "warning" { target *-*-* } test1 } */
+ /* { dg-message "dst" "note" { target *-*-* } test1 } */
+}
+
+void test2 (void)
+{
+ char dst[6];
+ strcpy (dst, "Hello");
+}
+
+void test3 (void)
+{
+ char *src = "Hello";
+ char dst[5];
+ strcpy (dst, src); /* { dg-line test3 } */
+
+ /* { dg-warning "overflow" "warning" { target *-*-* } test3 } */
+ /* { dg-message "dst" "note" { target *-*-* } test3 } */
+}
+
+void test4 (void)
+{
+ char *src = "Hello";
+ char dst[6];
+ strcpy (dst, src);
+}
+
+const char *return_hello (void)
+{
+ return "hello";
+}
+
+void test5 (void)
+{
+ const char *str = return_hello ();
+ if (!str)
+ return;
+ char dst[5];
+ strcpy (dst, str); /* { dg-line test5 } */
+
+ /* { dg-warning "overflow" "warning" { target *-*-* } test5 } */
+ /* { dg-message "dst" "note" { target *-*-* } test5 } */
+}
+
+void test6 (void)
+{
+ const char *str = return_hello ();
+ if (!str)
+ return;
+ char dst[6];
+ strcpy (dst, str);
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/strcpy-3.c b/gcc/testsuite/gcc.dg/analyzer/strcpy-3.c
new file mode 100644
index 0000000..a38f9a7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/strcpy-3.c
@@ -0,0 +1,23 @@
+#include <string.h>
+#include "analyzer-decls.h"
+
+void test_1 (void)
+{
+ char str[] = "Hello";
+ char buf[6];
+ char *result = strcpy (buf, str);
+ __analyzer_describe (1, result); /* { dg-warning "region_svalue.*?'buf'" } */
+ __analyzer_eval (result == buf); /* { dg-warning "TRUE" } */
+ __analyzer_eval (buf[0] == 'H'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (buf[1] == 'e'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (buf[2] == 'l'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (buf[3] == 'l'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (buf[4] == 'o'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (buf[5] == 0); /* { dg-warning "TRUE" } */
+ __analyzer_eval (result[0] == 'H'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (result[1] == 'e'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (result[2] == 'l'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (result[3] == 'l'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (result[4] == 'o'); /* { dg-warning "TRUE" } */
+ __analyzer_eval (result[5] == 0); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/cpp/c11-trigraphs-1.c b/gcc/testsuite/gcc.dg/cpp/c11-trigraphs-1.c
new file mode 100644
index 0000000..efd011a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/c11-trigraphs-1.c
@@ -0,0 +1,5 @@
+/* Test trigraphs supported in C11. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -pedantic-errors" } */
+
+#include "trigraphs.c"
diff --git a/gcc/testsuite/gcc.dg/cpp/c2x-trigraphs-1.c b/gcc/testsuite/gcc.dg/cpp/c2x-trigraphs-1.c
new file mode 100644
index 0000000..bbc2152
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/c2x-trigraphs-1.c
@@ -0,0 +1,10 @@
+/* Test trigraphs not supported in C2x. */
+/* { dg-do compile } */
+/* { dg-options "-std=c2x -pedantic-errors" } */
+
+const char a[] = "??=??(??/??/??)??'??<??!??>??-";
+const char b[] = "?""?=?""?(?""?/?""?/?""?)?""?'?""?<?""?!?""?>?""?-";
+
+_Static_assert (sizeof a == sizeof b, "checking trigraph conversions");
+
+/* { dg-prune-output "\\\[-Wtrigraphs" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/c2x-trigraphs-2.c b/gcc/testsuite/gcc.dg/cpp/c2x-trigraphs-2.c
new file mode 100644
index 0000000..38ee489
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/c2x-trigraphs-2.c
@@ -0,0 +1,5 @@
+/* Test trigraphs supported in C2x with -trigraphs used. */
+/* { dg-do run } */
+/* { dg-options "-std=c2x -pedantic-errors -trigraphs" } */
+
+#include "trigraphs.c"
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp-float-signbit-2.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp-float-signbit-2.c
new file mode 100644
index 0000000..954c7eb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp-float-signbit-2.c
@@ -0,0 +1,24 @@
+// { dg-do compile }
+// { dg-options "-O2 -fdump-tree-evrp" }
+
+// Test that the only thing we know about the signbit about negative number is
+// that it's not 0.
+
+void link_error ();
+
+int num;
+
+void func(float x)
+{
+ if (x < -5.0)
+ {
+ num = __builtin_signbit (x);
+
+ // We may not know the exact signbit, but we know it's not 0.
+ if (!__builtin_signbit (x))
+ link_error ();
+ }
+}
+
+// { dg-final { scan-tree-dump-not "num = \[-0-9\];" "evrp" } }
+// { dg-final { scan-tree-dump-not "link_error" "evrp" } }
diff --git a/gcc/testsuite/gcc.target/aarch64/spellcheck_10.c b/gcc/testsuite/gcc.target/aarch64/spellcheck_10.c
new file mode 100644
index 0000000..08540c9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/spellcheck_10.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-march=*" } { "" } } */
+/* { dg-skip-if "" { *-*-* } { "-mcpu=*" } { "" } } */
+/* { dg-options "-march=neoverse-n1" } */
+
+void
+foo ()
+{
+}
+
+/* { dg-error "unknown value .neoverse-n1. for .-march." "" { target *-*-* } 0 } */
+/* { dg-message "valid arguments are: \[^\n\r]*" "" { target *-*-* } 0 } */
+/* { dg-message "did you mean .-mcpu=neoverse-n1.?" "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.target/i386/pr106453.c b/gcc/testsuite/gcc.target/i386/pr106453.c
new file mode 100644
index 0000000..bd2e728
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr106453.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -mcrc32 -dp" } */
+/* { dg-final { scan-assembler-not "zero_extendsidi" } } */
+
+#include <immintrin.h>
+#include <stdint.h>
+
+uint32_t f(uint32_t c, uint64_t *p, size_t n)
+{
+ for (size_t i = 0; i < n; i++)
+ c = _mm_crc32_u64(c, p[i]);
+ return c;
+}
diff --git a/gcc/testsuite/gcc.target/loongarch/direct-extern-1.c b/gcc/testsuite/gcc.target/loongarch/direct-extern-1.c
new file mode 100644
index 0000000..85c6c1e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/direct-extern-1.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-mexplicit-relocs -mdirect-extern-access" } */
+/* { dg-final { scan-assembler-not "got" } } */
+
+extern int x;
+int f() { return x; }
diff --git a/gcc/testsuite/gcc.target/loongarch/direct-extern-2.c b/gcc/testsuite/gcc.target/loongarch/direct-extern-2.c
new file mode 100644
index 0000000..58d8bd6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/direct-extern-2.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-mno-explicit-relocs -mdirect-extern-access" } */
+/* { dg-final { scan-assembler-not "la.global" } } */
+
+extern int x;
+int f() { return x; }
diff --git a/gcc/testsuite/gcc.target/riscv/zmmul-1.c b/gcc/testsuite/gcc.target/riscv/zmmul-1.c
new file mode 100644
index 0000000..cdae2cb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/zmmul-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64iafdc_zmmul -mabi=lp64" } */
+int foo1(int a, int b)
+{
+ return a*b;
+}
+
+int foo2(int a, int b)
+{
+ return a/b;
+}
+
+int foo3(int a, int b)
+{
+ return a%b;
+}
+
+/* { dg-final { scan-assembler-times "mulw\t" 1 } } */
+/* { dg-final { scan-assembler-not "div\t" } } */
+/* { dg-final { scan-assembler-not "rem\t" } } */ \ No newline at end of file
diff --git a/gcc/testsuite/gcc.target/riscv/zmmul-2.c b/gcc/testsuite/gcc.target/riscv/zmmul-2.c
new file mode 100644
index 0000000..dc6829d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/zmmul-2.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv32iafdc_zmmul -mabi=ilp32" } */
+int foo1(int a, int b)
+{
+ return a*b;
+}
+
+int foo2(int a, int b)
+{
+ return a/b;
+}
+
+int foo3(int a, int b)
+{
+ return a%b;
+}
+
+/* { dg-final { scan-assembler-times "mul\t" 1 } } */
+/* { dg-final { scan-assembler-not "div\t" } } */
+/* { dg-final { scan-assembler-not "rem\t" } } */ \ No newline at end of file
diff --git a/gcc/testsuite/gfortran.dg/gomp/all-memory-1.f90 b/gcc/testsuite/gfortran.dg/gomp/all-memory-1.f90
index f8f34f0..51b5633 100644
--- a/gcc/testsuite/gfortran.dg/gomp/all-memory-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/all-memory-1.f90
@@ -50,5 +50,5 @@ subroutine f6
!$omp target depend ( depobj : omp_all_memory) ! { dg-error "'omp_all_memory' used with DEPEND kind other than OUT or INOUT" }
!!$omp end target
- !$omp ordered depend ( sink : omp_all_memory) ! { dg-error "'omp_all_memory' used with DEPEND kind other than OUT or INOUT" }
+ !$omp ordered depend ( sink : omp_all_memory) ! { dg-error "used with dependence-type other than OUT or INOUT" }
end
diff --git a/gcc/testsuite/gfortran.dg/gomp/depend-iterator-2.f90 b/gcc/testsuite/gfortran.dg/gomp/depend-iterator-2.f90
index 21fc327..cadd9a0 100644
--- a/gcc/testsuite/gfortran.dg/gomp/depend-iterator-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/depend-iterator-2.f90
@@ -34,7 +34,7 @@ program main
!!$omp end task
!$omp task depend(iterator(i=1:5), source ) ! { dg-error "ITERATOR may not be combined with SOURCE" }
!!$omp end task
- !$omp task affinity (iterator(i=1:5): a) depend(iterator(i=1:5), sink : x) ! { dg-error "ITERATOR may not be combined with SINK" }
+ !$omp task affinity (iterator(i=1:5): a) depend(iterator(i=1:5), sink : x) ! { dg-error "SINK at .1. not permitted as dependence-type for this directive" }
!!$omp end task
end do
diff --git a/gcc/testsuite/gfortran.dg/gomp/depobj-2.f90 b/gcc/testsuite/gfortran.dg/gomp/depobj-2.f90
index cb67c3c..6e7441d 100644
--- a/gcc/testsuite/gfortran.dg/gomp/depobj-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/depobj-2.f90
@@ -21,13 +21,13 @@ subroutine f1
!$omp depobj(d) depend( inout : a) ! { dg-error "DEPOBJ in DEPOBJ construct at .1. shall be a scalar integer of OMP_DEPEND_KIND kind" }
!$omp depobj(depobj) depend( inout : a, b) ! { dg-error "DEPEND clause at .1. of OMP DEPOBJ construct shall have only a single locator" }
!$omp depobj(depobj) depend(mutexinoutset : a) ! OK
- !$omp depobj(depobj) depend(source) ! { dg-error "DEPEND clause at .1. of OMP DEPOBJ construct shall not have dependence-type SOURCE, SINK or DEPOBJ" }
- !$omp depobj(depobj) depend(sink : i + 1) ! { dg-error "DEPEND clause at .1. of OMP DEPOBJ construct shall not have dependence-type SOURCE, SINK or DEPOBJ" }
+ !$omp depobj(depobj) depend(source) ! { dg-error "SOURCE at .1. not permitted as dependence-type for this directive" }
+ !$omp depobj(depobj) depend(sink : i + 1) ! { dg-error "SINK at .1. not permitted as dependence-type for this directive" }
!$omp depobj(depobj) update(source) ! { dg-error "Expected IN, OUT, INOUT, INOUTSET or MUTEXINOUTSET followed by '\\)'" }
!$omp depobj(depobj) update(sink) ! { dg-error "Expected IN, OUT, INOUT, INOUTSET or MUTEXINOUTSET followed by '\\)'" }
!$omp depobj(depobj) update(depobj) ! { dg-error "Expected IN, OUT, INOUT, INOUTSET or MUTEXINOUTSET followed by '\\)'" }
! Valid in OpenMP 5.1:
- !$omp depobj(depobj5) depend(depobj: depobj3) ! { dg-error "DEPEND clause at .1. of OMP DEPOBJ construct shall not have dependence-type SOURCE, SINK or DEPOBJ" }
+ !$omp depobj(depobj5) depend(depobj: depobj3) ! { dg-error "DEPEND clause at .1. of OMP DEPOBJ construct shall not have dependence-type DEPOBJ" }
end subroutine f1
diff --git a/gcc/testsuite/gfortran.dg/gomp/doacross-5.f90 b/gcc/testsuite/gfortran.dg/gomp/doacross-5.f90
new file mode 100644
index 0000000..3a1679a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/doacross-5.f90
@@ -0,0 +1,88 @@
+subroutine foo (n)
+ integer i, n
+
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(source:)
+ !$omp ordered doacross(sink: i - 2)
+ end do
+end
+
+subroutine bar (n)
+ integer :: i, j, n
+
+ !$omp do collapse(2) ordered(2)
+ do i = 1, 8, n
+ do j = 1, 8, n
+ !$omp ordered doacross(source:omp_cur_iteration)
+ !$omp ordered doacross(sink: i - 2, j + 2)
+ end do
+ end do
+end
+
+subroutine baz ()
+ integer :: i, j
+
+ !$omp do ordered(1)
+ do i = 1, 64
+ !$omp ordered ! { dg-error "'ordered' construct without 'doacross' or 'depend' clauses must not have the same binding region as 'ordered' construct with those clauses" }
+ !$omp end ordered
+
+ !$omp ordered doacross(source:)
+
+ !$omp ordered doacross(sink: i - 1)
+ end do
+
+ !$omp do ordered
+ do i = 1, 64
+ !$omp ordered doacross(source: omp_cur_iteration )
+
+ !$omp ordered doacross(sink: i - 1)
+
+ !$omp ordered threads ! { dg-error "'ordered' construct without 'doacross' or 'depend' clauses must not have the same binding region as 'ordered' construct with those clauses" }
+ !$omp end ordered
+ end do
+ !$omp do ordered(2)
+ do i = 1, 64
+ do j = 1, 64
+ !$omp ordered ! { dg-error "'ordered' construct without 'doacross' or 'depend' clauses binds to loop where 'collapse' argument 1 is different from 'ordered' argument 2" }
+ !$omp end ordered
+ end do
+ end do
+ !$omp do ordered(2) collapse(1)
+ do i = 1, 8
+ do j = 1, 8
+ !$omp ordered threads ! { dg-error "'ordered' construct without 'doacross' or 'depend' clauses binds to loop where 'collapse' argument 1 is different from 'ordered' argument 2" }
+ !$omp end ordered
+ end do
+ end do
+end
+
+subroutine qux ()
+ integer :: i, j
+ j = 0
+ !$omp do ordered linear(j)
+ do i = 1, 64
+ j = j + 1
+ !$omp ordered
+ !$omp end ordered
+ end do
+ !$omp do ordered linear(j) ! { dg-error "'linear' clause may not be specified together with 'ordered' clause if stand-alone 'ordered' construct is nested in it" }
+ do i = 1, 64
+ j = j + 1
+ !$omp ordered doacross(source:)
+ !$omp ordered doacross(sink:i-1)
+ end do
+ !$omp do ordered(1) linear(j)
+ do i = 1, 64
+ j = j + 1
+ !$omp ordered
+ !$omp end ordered
+ end do
+ !$omp do ordered(1) linear(j) ! { dg-error "'linear' clause may not be specified together with 'ordered' clause if stand-alone 'ordered' construct is nested in it" }
+ do i = 1, 64
+ j = j + 1
+ !$omp ordered doacross(source:)
+ !$omp ordered doacross(sink:i-1)
+ end do
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/doacross-6.f90 b/gcc/testsuite/gfortran.dg/gomp/doacross-6.f90
new file mode 100644
index 0000000..a45e1c9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/doacross-6.f90
@@ -0,0 +1,77 @@
+subroutine foo (n)
+ integer :: i, n
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(source) ! { dg-error "Expected ':'" }
+ end do
+
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(source:omp_current_iteration) ! { dg-error "Expected '\\\)' or 'omp_cur_iteration\\\)'" }
+ end do
+
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(source:i - 2) ! { dg-error "Expected '\\\)' or 'omp_cur_iteration\\\)'" }
+ end do
+
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(sink) ! { dg-error "Expected ':'" }
+ end do
+
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(sink:) ! { dg-error "Syntax error in OpenMP SINK dependence-type list" }
+ end do
+end
+
+subroutine bar (n)
+ implicit none
+ integer i, n
+
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(sink:omp_current_iteration - 1) ! { dg-error "Symbol 'omp_current_iteration' at .1. has no IMPLICIT type" }
+ end do
+
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(sink:omp_cur_iteration) ! { dg-error "omp_cur_iteration at .1. requires '-1' as logical offset" }
+ end do
+end
+
+subroutine baz (n)
+ implicit none
+ integer i, n
+
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(sink:omp_cur_iteration + 1) ! { dg-error "omp_cur_iteration at .1. requires '-1' as logical offset" }
+ end do
+end
+
+subroutine qux (n)
+ implicit none
+ integer i, n
+
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(sink:omp_cur_iteration - (2 - 1)) ! { dg-error "Syntax error in OpenMP SINK dependence-type list" }
+ end do
+end
+
+subroutine corge (n)
+ implicit none
+ integer i, n
+
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(sink:omp_cur_iteration - 1)
+ end do
+
+ !$omp do ordered
+ do i = 1, 8, n
+ !$omp ordered doacross(sink:omp_cur_iteration - 1_8)
+ end do
+end
diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc
index 91ec33c..bbe0835 100644
--- a/gcc/tree-cfg.cc
+++ b/gcc/tree-cfg.cc
@@ -1305,7 +1305,7 @@ end_recording_case_labels (void)
Otherwise return NULL. */
-static tree
+tree
get_cases_for_edge (edge e, gswitch *t)
{
tree *slot;
diff --git a/gcc/tree-cfg.h b/gcc/tree-cfg.h
index cb67cdf..95ec93e 100644
--- a/gcc/tree-cfg.h
+++ b/gcc/tree-cfg.h
@@ -33,6 +33,7 @@ extern void init_empty_tree_cfg_for_function (struct function *);
extern void init_empty_tree_cfg (void);
extern void start_recording_case_labels (void);
extern void end_recording_case_labels (void);
+extern tree get_cases_for_edge (edge, gswitch *);
extern basic_block label_to_block (struct function *, tree);
extern void cleanup_dead_labels (void);
extern bool group_case_labels_stmt (gswitch *);
diff --git a/gcc/tree-ssa-uninit.cc b/gcc/tree-ssa-uninit.cc
index 29dc48c..4a1c333 100644
--- a/gcc/tree-ssa-uninit.cc
+++ b/gcc/tree-ssa-uninit.cc
@@ -1402,6 +1402,9 @@ execute_late_warn_uninitialized (function *fun)
timevar_push (TV_TREE_UNINIT);
+ /* Avoid quadratic beahvior when looking up case labels for edges. */
+ start_recording_case_labels ();
+
possibly_undefined_names = new hash_set<tree>;
defined_args = new hash_map<gphi *, uninit_analysis::func_t::phi_arg_set_t>;
@@ -1432,6 +1435,7 @@ execute_late_warn_uninitialized (function *fun)
possibly_undefined_names = NULL;
delete defined_args;
defined_args = NULL;
+ end_recording_case_labels ();
free_dominance_info (CDI_POST_DOMINATORS);
timevar_pop (TV_TREE_UNINIT);
}
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 9c56141..c3f668a 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -274,13 +274,21 @@ frange::set_nan (fp_prop::kind k)
{
if (k == fp_prop::YES)
{
+ if (get_nan ().no_p ())
+ {
+ set_undefined ();
+ return;
+ }
gcc_checking_assert (!undefined_p ());
*this = frange_nan (m_type);
return;
}
- // Setting NO on an obviously NAN range is nonsensical.
- gcc_checking_assert (k != fp_prop::NO || !real_isnan (&m_min));
+ if (k == fp_prop::NO && get_nan ().yes_p ())
+ {
+ set_undefined ();
+ return;
+ }
// Setting VARYING on an obviously NAN range is a no-op.
if (k == fp_prop::VARYING && real_isnan (&m_min))
diff --git a/gcc/value-range.h b/gcc/value-range.h
index bc00f3d..645dc76 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -338,7 +338,10 @@ public:
value_range_kind = VR_RANGE);
static bool supports_p (const_tree type)
{
- return SCALAR_FLOAT_TYPE_P (type);
+ // ?? Decimal floats can have multiple representations for the
+ // same number. Supporting them may be as simple as just
+ // disabling them in singleton_p. No clue.
+ return SCALAR_FLOAT_TYPE_P (type) && !DECIMAL_FLOAT_TYPE_P (type);
}
virtual tree type () const override;
virtual void set (tree, tree, value_range_kind = VR_RANGE) override;
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index c9f2f6b..7aba4f5 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,7 @@
+2022-09-05 Joseph Myers <joseph@codesourcery.com>
+
+ * init.cc (lang_defaults): Disable trigraphs for C2x.
+
2022-09-02 David Malcolm <dmalcolm@redhat.com>
PR c/90885
diff --git a/libcpp/init.cc b/libcpp/init.cc
index 41b10b3..3e5601a 100644
--- a/libcpp/init.cc
+++ b/libcpp/init.cc
@@ -112,7 +112,7 @@ static const struct lang_flags lang_defaults[] =
/* STDC99 */ { 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
/* STDC11 */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
/* STDC17 */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
- /* STDC2X */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0 },
+ /* STDC2X */ { 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0 },
/* GNUCXX */ { 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
/* CXX98 */ { 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0 },
/* GNUCXX11 */ { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 47b541c..ddf0729 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,7 @@
+2022-09-05 Tobias Burnus <tobias@codesourcery.com>
+
+ * libgomp.texi (OpenMP 5.2): Update doacross/omp_cur_iteration status.
+
2022-08-26 Tobias Burnus <tobias@codesourcery.com>
* libgomp.texi (OpenMP 5.0): Mark 'ancestor' as implemented but
diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi
index 019651b..2879608 100644
--- a/libgomp/libgomp.texi
+++ b/libgomp/libgomp.texi
@@ -394,10 +394,11 @@ to address of matching mapped list item per 5.1, Sect. 2.21.7.2 @tab N @tab
@item Default map-type for @code{map} clause in @code{target enter/exit data}
@tab Y @tab
@item New @code{doacross} clause as alias for @code{depend} with
- @code{source}/@code{sink} modifier @tab N @tab
+ @code{source}/@code{sink} modifier @tab Y @tab
@item Deprecation of @code{depend} with @code{source}/@code{sink} modifier
@tab N @tab
-@item @code{omp_cur_iteration} keyword @tab N @tab
+@item @code{omp_cur_iteration} keyword @tab P
+ @tab @code{sink: omp_cur_iteration - 1} unsupported
@end multitable
@unnumberedsubsec Other new OpenMP 5.2 features
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index d905767..c9a7f35 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,15 @@
+2022-09-05 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/std/type_traits (__success_type, __failure_type): Move
+ definitions later in the file.
+
+2022-09-05 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/std/type_traits (is_trivial_v, is_trivially_copyable_v)
+ (is_standard_layout_v, is_pod_v, is_literal_type_v): Use
+ built-in instead of class template.
+ (is_same_v): Add partial specialization for true case.
+
2022-09-02 Patrick Palka <ppalka@redhat.com>
* include/std/tuple (tuple::_UseOtherCtor): Use ::type when
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index c7a9607..e4d1679 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -286,18 +286,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>::type __is_complete_or_unbounded(_TypeIdentity)
{ return {}; }
- // For several sfinae-friendly trait implementations we transport both the
- // result information (as the member type) and the failure information (no
- // member type). This is very similar to std::enable_if, but we cannot use
- // them, because we need to derive from them as an implementation detail.
-
- template<typename _Tp>
- struct __success_type
- { typedef _Tp type; };
-
- struct __failure_type
- { };
-
// __remove_cv_t (std::remove_cv_t for C++11).
template<typename _Tp>
using __remove_cv_t = typename remove_cv<_Tp>::type;
@@ -2162,6 +2150,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Sfinae-friendly common_type implementation:
/// @cond undocumented
+
+ // For several sfinae-friendly trait implementations we transport both the
+ // result information (as the member type) and the failure information (no
+ // member type). This is very similar to std::enable_if, but we cannot use
+ // that, because we need to derive from them as an implementation detail.
+
+ template<typename _Tp>
+ struct __success_type
+ { typedef _Tp type; };
+
+ struct __failure_type
+ { };
+
struct __do_common_type_impl
{
template<typename _Tp, typename _Up>
@@ -3077,22 +3078,19 @@ template <typename _Tp>
inline constexpr bool is_volatile_v = false;
template <typename _Tp>
inline constexpr bool is_volatile_v<volatile _Tp> = true;
+
template <typename _Tp>
- inline constexpr bool is_trivial_v = is_trivial<_Tp>::value;
+ inline constexpr bool is_trivial_v = __is_trivial(_Tp);
template <typename _Tp>
- inline constexpr bool is_trivially_copyable_v =
- is_trivially_copyable<_Tp>::value;
+ inline constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
template <typename _Tp>
- inline constexpr bool is_standard_layout_v = is_standard_layout<_Tp>::value;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp);
template <typename _Tp>
_GLIBCXX20_DEPRECATED("use is_standard_layout_v && is_trivial_v instead")
- inline constexpr bool is_pod_v = is_pod<_Tp>::value;
+ inline constexpr bool is_pod_v = __is_pod(_Tp);
template <typename _Tp>
_GLIBCXX17_DEPRECATED
- inline constexpr bool is_literal_type_v = is_literal_type<_Tp>::value;
-#pragma GCC diagnostic pop
+ inline constexpr bool is_literal_type_v = __is_literal_type(_Tp);
template <typename _Tp>
inline constexpr bool is_empty_v = __is_empty(_Tp);
template <typename _Tp>
@@ -3101,6 +3099,7 @@ template <typename _Tp>
inline constexpr bool is_abstract_v = __is_abstract(_Tp);
template <typename _Tp>
inline constexpr bool is_final_v = __is_final(_Tp);
+
template <typename _Tp>
inline constexpr bool is_signed_v = is_signed<_Tp>::value;
template <typename _Tp>
@@ -3183,9 +3182,11 @@ template <typename _Tp>
template <typename _Tp>
inline constexpr bool is_nothrow_destructible_v =
is_nothrow_destructible<_Tp>::value;
+
template <typename _Tp>
- inline constexpr bool has_virtual_destructor_v =
- has_virtual_destructor<_Tp>::value;
+ inline constexpr bool has_virtual_destructor_v
+ = __has_virtual_destructor(_Tp);
+
template <typename _Tp>
inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value;
@@ -3212,7 +3213,9 @@ template <typename _Tp, typename _Up>
inline constexpr bool is_same_v = __is_same(_Tp, _Up);
#else
template <typename _Tp, typename _Up>
- inline constexpr bool is_same_v = std::is_same<_Tp, _Up>::value;
+ inline constexpr bool is_same_v = false;
+template <typename _Tp>
+ inline constexpr bool is_same_v<_Tp, _Tp> = true;
#endif
template <typename _Base, typename _Derived>
inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived);