aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-08-23 12:35:00 +0200
committerMartin Liska <mliska@suse.cz>2021-08-23 12:35:00 +0200
commite8d1043fc00aefe55ecc9de5fe36f10e11b47d1a (patch)
tree9d554bca0f1fb0528d5f23cc990ff9c2aad8391a /gcc
parent0b6c24dd10ff426108f737551067085d0af42ca8 (diff)
parentb320edc0c29c838b0090c3c9be14187d132f73f2 (diff)
downloadgcc-e8d1043fc00aefe55ecc9de5fe36f10e11b47d1a.zip
gcc-e8d1043fc00aefe55ecc9de5fe36f10e11b47d1a.tar.gz
gcc-e8d1043fc00aefe55ecc9de5fe36f10e11b47d1a.tar.bz2
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog176
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/acinclude.m482
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in4
-rw-r--r--gcc/analyzer/ChangeLog21
-rw-r--r--gcc/analyzer/diagnostic-manager.cc40
-rw-r--r--gcc/analyzer/engine.cc49
-rw-r--r--gcc/analyzer/exploded-graph.h14
-rw-r--r--gcc/analyzer/region-model.cc17
-rw-r--r--gcc/analyzer/region-model.h3
-rw-r--r--gcc/c-family/ChangeLog16
-rw-r--r--gcc/c-family/c-format.c142
-rw-r--r--gcc/c-family/c-omp.c4
-rw-r--r--gcc/c-family/c-pragma.c1
-rw-r--r--gcc/c-family/c-pragma.h1
-rw-r--r--gcc/c/ChangeLog27
-rw-r--r--gcc/c/c-parser.c213
-rw-r--r--gcc/c/c-typeck.c188
-rw-r--r--gcc/config.gcc12
-rw-r--r--gcc/config/arm/arm.opt2
-rw-r--r--gcc/config/arm/arm_mve.h2
-rw-r--r--gcc/config/arm/t-rmprofile2
-rw-r--r--gcc/config/h8300/h8300.c38
-rw-r--r--gcc/config/i386/sse.md2
-rw-r--r--gcc/config/mips/mips-msa.md27
-rw-r--r--gcc/config/mips/mips-protos.h1
-rw-r--r--gcc/config/mips/mips.c59
-rw-r--r--gcc/config/pa/pa.c4
-rw-r--r--gcc/config/rs6000/altivec.md197
-rw-r--r--gcc/config/rs6000/rs6000-call.c6
-rw-r--r--gcc/config/rs6000/vsx.md206
-rw-r--r--gcc/config/v850/v850.h3
-rwxr-xr-xgcc/configure472
-rw-r--r--gcc/configure.ac335
-rw-r--r--gcc/cp/ChangeLog31
-rw-r--r--gcc/cp/cp-tree.h4
-rw-r--r--gcc/cp/parser.c258
-rw-r--r--gcc/dbgcnt.def1
-rw-r--r--gcc/dwarf2out.c21
-rw-r--r--gcc/fortran/ChangeLog55
-rw-r--r--gcc/fortran/dump-parse-tree.c27
-rw-r--r--gcc/fortran/error.c106
-rw-r--r--gcc/fortran/f95-lang.c5
-rw-r--r--gcc/fortran/gfortran.h58
-rw-r--r--gcc/fortran/match.h1
-rw-r--r--gcc/fortran/openmp.c124
-rw-r--r--gcc/fortran/parse.c10
-rw-r--r--gcc/fortran/resolve.c2
-rw-r--r--gcc/fortran/simplify.c73
-rw-r--r--gcc/fortran/st.c1
-rw-r--r--gcc/fortran/trans-openmp.c34
-rw-r--r--gcc/fortran/trans.c1
-rw-r--r--gcc/fortran/types.def1
-rw-r--r--gcc/gcov.c158
-rw-r--r--gcc/gimple-range.cc7
-rw-r--r--gcc/gimple-range.h3
-rw-r--r--gcc/gimple-ssa-store-merging.c100
-rw-r--r--gcc/gimple-ssa-warn-access.cc4
-rw-r--r--gcc/gimple.c5
-rw-r--r--gcc/ipa-modref.c32
-rw-r--r--gcc/jit/ChangeLog7
-rw-r--r--gcc/objc/ChangeLog5
-rw-r--r--gcc/objc/objc-next-runtime-abi-02.c4
-rw-r--r--gcc/omp-builtins.def4
-rw-r--r--gcc/omp-expand.c8
-rw-r--r--gcc/testsuite/ChangeLog109
-rw-r--r--gcc/testsuite/c-c++-common/Wunused-var-16.c4
-rw-r--r--gcc/testsuite/c-c++-common/gomp/error-1.c45
-rw-r--r--gcc/testsuite/c-c++-common/gomp/error-2.c24
-rw-r--r--gcc/testsuite/c-c++-common/gomp/error-3.c70
-rw-r--r--gcc/testsuite/c-c++-common/gomp/requires-3.c1
-rw-r--r--gcc/testsuite/c-c++-common/gomp/sink-5.c16
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr12.C2
-rw-r--r--gcc/testsuite/g++.dg/gomp/attrs-1.C4
-rw-r--r--gcc/testsuite/g++.dg/gomp/attrs-13.C34
-rw-r--r--gcc/testsuite/g++.dg/gomp/attrs-2.C4
-rw-r--r--gcc/testsuite/g++.dg/gomp/error-1.C42
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/modref-1.C32
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/fprintf-2.c3
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/gcc_tmpnam.h13
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/printf-2.c3
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/user-printf.c3
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/function-ptr-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/malloc-callbacks.c2
-rw-r--r--gcc/testsuite/gcc.dg/c11-qual-1.c11
-rw-r--r--gcc/testsuite/gcc.dg/c2x-qual-1.c30
-rw-r--r--gcc/testsuite/gcc.dg/c2x-qual-2.c30
-rw-r--r--gcc/testsuite/gcc.dg/c2x-qual-3.c30
-rw-r--r--gcc/testsuite/gcc.dg/c2x-qual-4.c105
-rw-r--r--gcc/testsuite/gcc.dg/c2x-qual-5.c101
-rw-r--r--gcc/testsuite/gcc.dg/c2x-qual-6.c114
-rw-r--r--gcc/testsuite/gcc.dg/c2x-qual-7.c16
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr101905.c15
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr101949_0.c20
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr101949_1.c4
-rw-r--r--gcc/testsuite/gcc.dg/optimize-bswapdi-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/optimize-bswapdi-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/optimize-bswapsi-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/optimize-bswapsi-3.c4
-rw-r--r--gcc/testsuite/gcc.dg/optimize-bswapsi-5.c4
-rw-r--r--gcc/testsuite/gcc.dg/pointer-array-quals-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/pointer-array-quals-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr86723.c63
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr79334-0.c23
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr79334-1.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/acle/pr100856.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/pr102016.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/pr86723.c52
-rw-r--r--gcc/testsuite/gcc.target/mips/pr101922.c19
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr101849.c22
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/error-1.f9051
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/error-2.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/error-3.f9088
-rw-r--r--gcc/testsuite/gfortran.dg/pr100950.f9053
-rw-r--r--gcc/testsuite/lib/target-supports.exp18
-rw-r--r--gcc/tree-pretty-print.c4
-rw-r--r--gcc/tree-ssa-sccvn.c30
-rw-r--r--gcc/tree-vect-data-refs.c21
-rw-r--r--gcc/tree-vect-generic.c7
-rw-r--r--gcc/tree-vect-slp.c2
-rw-r--r--gcc/tree.h5
122 files changed, 3544 insertions, 1383 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4fd8ff7..b7a23d3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,179 @@
+2021-08-22 Jan Hubicka <hubicka@ucw.cz>
+ Martin Liska <mliska@suse.cz>
+
+ PR middle-end/101949
+ * ipa-modref.c (analyze_ssa_name_flags): Indirect call implies
+ ~EAF_NOCLOBBER.
+
+2021-08-21 Dragan Mladjenovic <OT_Dragan.Mladjenovic@mediatek.com>
+
+ * config/mips/mips.c (mips_function_rodata_section,
+ TARGET_ASM_FUNCTION_RODATA_SECTION): Removed.
+
+2021-08-21 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/pa.c (pa_asm_output_aligned_common): Remove warning.
+
+2021-08-20 Serge Belyshev <belyshev@depni.sinp.msu.ru>
+
+ * configure.ac (thread-local storage support): Remove tls_first_major
+ and tls_first_minor. Use "$conftest_s" to check support.
+ * configure: Regenerate.
+
+2021-08-20 Serge Belyshev <belyshev@depni.sinp.msu.ru>
+
+ * configure.ac: Fixup formatting.
+
+2021-08-20 Serge Belyshev <belyshev@depni.sinp.msu.ru>
+
+ * acinclude.m4 (gcc_GAS_CHECK_FEATURE): Remove third argument and ...
+ * configure.ac: ... update all callers.
+
+2021-08-20 Serge Belyshev <belyshev@depni.sinp.msu.ru>
+
+ PR target/91602
+ * acinclude.m4 (_gcc_COMPUTE_GAS_VERSION, _gcc_GAS_VERSION_GTE_IFELSE)
+ (gcc_GAS_VERSION_GTE_IFELSE): Remove.
+ (gcc_GAS_CHECK_FEATURE): Do not handle in-tree case specially.
+ * configure.ac: Remove gcc_cv_gas_major_version, gcc_cv_gas_minor_version.
+ Remove remaining checks for in-tree assembler.
+ * configure: Regenerate.
+
+2021-08-20 Jeff Law <jlaw@localhost.localdomain>
+
+ * config/h8300/h8300.c (shift_alg_hi): Improve arithmetic shift right
+ by 15 bits for H8/300H and H8/S. Improve logical shifts by 12
+ bits for H8/S.
+ (shift_alg_si): Improve arithmetic right shift by 28-30 bits for
+ H8/300H. Improve arithmetic shift right by 15 bits for H8/S.
+ Improve logical shifts by 27 bits for H8/S.
+ (get_shift_alg): Corresponding changes.
+ (h8300_option_override): Revert to loops for -Os when profitable.
+
+2021-08-20 Richard Biener <rguenther@suse.de>
+
+ * tree-vect-data-refs.c (dr_group_sort_cmp): Do not compare
+ BBs.
+ (vect_analyze_data_ref_accesses): Likewise. Assign the BB
+ index as group_id when dataref_groups were not computed.
+ * tree-vect-slp.c (vect_slp_bbs): Bump current_group when
+ we advace to the next BB.
+
+2021-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ * omp-builtins.def (BUILT_IN_GOMP_WARNING, BUILT_IN_GOMP_ERROR): New
+ builtins.
+
+2021-08-20 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/89961
+ * gcov.c (make_gcov_file_name): Rewrite using std::string.
+ (mangle_name): Simplify, do not used the second argument.
+ (strip_extention): New function.
+ (get_md5sum): Likewise.
+ (get_gcov_intermediate_filename): Handle properly -p and -x
+ options.
+ (output_gcov_file): Use string type.
+ (generate_results): Likewise.
+ (md5sum_to_hex): Remove.
+
+2021-08-20 Michael Meissner <meissner@linux.ibm.com>
+
+ * config/rs6000/altivec.md (UNSPEC_XXEVAL): Move to vsx.md.
+ (UNSPEC_XXSPLTIW): Move to vsx.md.
+ (UNSPEC_XXSPLTID): Move to vsx.md.
+ (UNSPEC_XXSPLTI32DX): Move to vsx.md.
+ (UNSPEC_XXBLEND): Move to vsx.md.
+ (UNSPEC_XXPERMX): Move to vsx.md.
+ (VM3): Move to vsx.md.
+ (VM3_char): Move to vsx.md.
+ (xxspltiw_v4si): Move to vsx.md.
+ (xxspltiw_v4sf): Move to vsx.md.
+ (xxspltiw_v4sf_inst): Move to vsx.md.
+ (xxspltidp_v2df): Move to vsx.md.
+ (xxspltidp_v2df_inst): Move to vsx.md.
+ (xxsplti32dx_v4si_inst): Move to vsx.md.
+ (xxsplti32dx_v4sf): Move to vsx.md.
+ (xxsplti32dx_v4sf_inst): Move to vsx.md.
+ (xxblend_<mode>): Move to vsx.md.
+ (xxpermx): Move to vsx.md.
+ (xxpermx_inst): Move to vsx.md.
+ * config/rs6000/vsx.md (UNSPEC_XXEVAL): Move from altivec.md.
+ (UNSPEC_XXSPLTIW): Move from altivec.md.
+ (UNSPEC_XXSPLTID): Move from altivec.md.
+ (UNSPEC_XXSPLTI32DX): Move from altivec.md.
+ (UNSPEC_XXBLEND): Move from altivec.md.
+ (UNSPEC_XXPERMX): Move from altivec.md.
+ (VM3): Move from altivec.md.
+ (VM3_char): Move from altivec.md.
+ (xxspltiw_v4si): Move from altivec.md.
+ (xxspltiw_v4sf): Move from altivec.md.
+ (xxspltiw_v4sf_inst): Move from altivec.md.
+ (xxspltidp_v2df): Move from altivec.md.
+ (xxspltidp_v2df_inst): Move from altivec.md.
+ (xxsplti32dx_v4si_inst): Move from altivec.md.
+ (xxsplti32dx_v4sf): Move from altivec.md.
+ (xxsplti32dx_v4sf_inst): Move from altivec.md.
+ (xxblend_<mode>): Move from altivec.md.
+ (xxpermx): Move from altivec.md.
+ (xxpermx_inst): Move from altivec.md.
+
+2021-08-19 Roger Sayle <roger@nextmovesoftware.com>
+
+ * tree-vect-generic.c (expand_vector_operations_1): Use either
+ gimplify_build1 or gimplify_build2 instead of gimple_build_assign
+ when constructing scalar splat expressions.
+
+2021-08-19 Peter Bergner <bergner@linux.ibm.com>
+
+ PR target/101849
+ * config/rs6000/rs6000-call.c (rs6000_gimple_fold_mma_builtin): Cast
+ pointer to __vector_pair *.
+
+2021-08-19 Martin Sebor <msebor@redhat.com>
+
+ * gimple-range.cc: Add comments.
+ * gimple-range.h: Same.
+
+2021-08-19 Martin Sebor <msebor@redhat.com>
+
+ PR middle-end/101984
+ * gimple-ssa-warn-access.cc (pass_waccess::execute): Also call
+ disable_ranger.
+
+2021-08-19 Jeff Law <jlaw@localhost.localdomain>
+
+ * config.gcc (h8300-*-elf*): Do not include dbxelf.h.
+ (h8300-*-linux*, v850-*-rtems*, v850*-elf*): Likewise.
+ * config/v850/v850.h (DEFAULT_GDB_EXTENSIONS): Remove.
+
+2021-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/101950
+ * optabs.c (expand_clrsb_using_clz): New function.
+ (expand_unop): Use it as another clrsb expansion fallback.
+
+2021-08-19 liuhongt <hongtao.liu@intel.com>
+
+ Revert:
+ 2021-07-28 liuhongt <hongtao.liu@intel.com>
+
+ PR target/99881
+ * config/i386/i386.h (processor_costs): Add new member
+ integer_to_sse.
+ * config/i386/x86-tune-costs.h (ix86_size_cost, i386_cost,
+ i486_cost, pentium_cost, lakemont_cost, pentiumpro_cost,
+ geode_cost, k6_cost, athlon_cost, k8_cost, amdfam10_cost,
+ bdver_cost, znver1_cost, znver2_cost, znver3_cost,
+ btver1_cost, btver2_cost, btver3_cost, pentium4_cost,
+ nocona_cost, atom_cost, atom_cost, slm_cost, intel_cost,
+ generic_cost, core_cost): Initialize integer_to_sse same value
+ as sse_op.
+ (skylake_cost): Initialize integer_to_sse twice as much as sse_op.
+ * config/i386/i386.c (ix86_builtin_vectorization_cost):
+ Use integer_to_sse instead of sse_op to calculate the cost of
+ vec_construct.
+
2021-08-18 Iain Sandoe <iain@sandoe.co.uk>
* config.gcc: Include rpath.opt for Darwin.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 30a51b9..d2e7bda 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20210819
+20210823
diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4
index f9f6a07..082fa16 100644
--- a/gcc/acinclude.m4
+++ b/gcc/acinclude.m4
@@ -442,63 +442,6 @@ AC_DEFINE_UNQUOTED(HAVE_INITFINI_ARRAY_SUPPORT,
[Define 0/1 if .init_array/.fini_array sections are available and working.])
])
-dnl # _gcc_COMPUTE_GAS_VERSION
-dnl # Used by gcc_GAS_VERSION_GTE_IFELSE
-dnl #
-dnl # WARNING:
-dnl # gcc_cv_as_gas_srcdir must be defined before this.
-dnl # This gross requirement will go away eventually.
-AC_DEFUN([_gcc_COMPUTE_GAS_VERSION],
-[gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
-for f in $gcc_cv_as_bfd_srcdir/configure \
- $gcc_cv_as_gas_srcdir/configure \
- $gcc_cv_as_gas_srcdir/configure.ac \
- $gcc_cv_as_gas_srcdir/Makefile.in ; do
- gcc_cv_gas_version=`sed -n -e 's/^[[ ]]*VERSION=[[^0-9A-Za-z_]]*\([[0-9]]*\.[[0-9]]*.*\)/VERSION=\1/p' < $f`
- if test x$gcc_cv_gas_version != x; then
- break
- fi
-done
-case $gcc_cv_gas_version in
- VERSION=[[0-9]]*) ;;
- *) AC_MSG_ERROR([[cannot find version of in-tree assembler]]);;
-esac
-gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([[0-9]]*\)"`
-gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.\([[0-9]]*\)"`
-gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)"`
-case $gcc_cv_gas_patch_version in
- "") gcc_cv_gas_patch_version="0" ;;
-esac
-gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \
- + $gcc_cv_gas_minor_version \) \* 1000 \
- + $gcc_cv_gas_patch_version`
-]) []dnl # _gcc_COMPUTE_GAS_VERSION
-
-dnl # gcc_GAS_VERSION_GTE_IFELSE([elf,] major, minor, patchlevel,
-dnl # [command_if_true = :], [command_if_false = :])
-dnl # Check to see if the version of GAS is greater than or
-dnl # equal to the specified version.
-dnl #
-dnl # The first ifelse() shortens the shell code if the patchlevel
-dnl # is unimportant (the usual case). The others handle missing
-dnl # commands. Note that the tests are structured so that the most
-dnl # common version number cases are tested first.
-AC_DEFUN([_gcc_GAS_VERSION_GTE_IFELSE],
-[ifelse([$1], elf,
- [if test $in_tree_gas_is_elf = yes \
- &&],
- [if]) test $gcc_cv_gas_vers -ge `expr \( \( $2 \* 1000 \) + $3 \) \* 1000 + $4`
- then dnl
-ifelse([$5],,:,[$5])[]dnl
-ifelse([$6],,,[
- else $6])
-fi])
-
-AC_DEFUN([gcc_GAS_VERSION_GTE_IFELSE],
-[AC_REQUIRE([_gcc_COMPUTE_GAS_VERSION])dnl
-ifelse([$1], elf, [_gcc_GAS_VERSION_GTE_IFELSE($@)],
- [_gcc_GAS_VERSION_GTE_IFELSE(,$@)])])
-
dnl # gcc_GAS_FLAGS
dnl # Used by gcc_GAS_CHECK_FEATURE
dnl #
@@ -527,13 +470,11 @@ AC_DEFUN([gcc_GAS_FLAGS],
esac])
])
-dnl gcc_GAS_CHECK_FEATURE(description, cv, [[elf,]major,minor,patchlevel],
+dnl gcc_GAS_CHECK_FEATURE(description, cv,
dnl [extra switches to as], [assembler input],
dnl [extra testing logic], [command if feature available])
dnl
-dnl Checks for an assembler feature. If we are building an in-tree
-dnl gas, the feature is available if the associated assembler version
-dnl is greater than or equal to major.minor.patchlevel. If not, then
+dnl Checks for an assembler feature.
dnl ASSEMBLER INPUT is fed to the assembler and the feature is available
dnl if assembly succeeds. If EXTRA TESTING LOGIC is not the empty string,
dnl then it is run instead of simply setting CV to "yes" - it is responsible
@@ -542,27 +483,24 @@ AC_DEFUN([gcc_GAS_CHECK_FEATURE],
[AC_REQUIRE([gcc_GAS_FLAGS])dnl
AC_CACHE_CHECK([assembler for $1], [$2],
[[$2]=no
- ifelse([$3],,,[dnl
- if test $in_tree_gas = yes; then
- gcc_GAS_VERSION_GTE_IFELSE($3, [[$2]=yes])
- el])if test x$gcc_cv_as != x; then
- AS_ECHO([ifelse(m4_substr([$5],0,1),[$], "[$5]", '[$5]')]) > conftest.s
- if AC_TRY_COMMAND([$gcc_cv_as $gcc_cv_as_flags $4 -o conftest.o conftest.s >&AS_MESSAGE_LOG_FD])
+ if test x$gcc_cv_as != x; then
+ AS_ECHO([ifelse(m4_substr([$4],0,1),[$], "[$4]", '[$4]')]) > conftest.s
+ if AC_TRY_COMMAND([$gcc_cv_as $gcc_cv_as_flags $3 -o conftest.o conftest.s >&AS_MESSAGE_LOG_FD])
then
- ifelse([$6],, [$2]=yes, [$6])
+ ifelse([$5],, [$2]=yes, [$5])
else
echo "configure: failed program was" >&AS_MESSAGE_LOG_FD
cat conftest.s >&AS_MESSAGE_LOG_FD
fi
rm -f conftest.o conftest.s
fi])
-ifelse([$7],,,[dnl
+ifelse([$6],,,[dnl
if test $[$2] = yes; then
- $7
+ $6
fi])
-ifelse([$8],,,[dnl
+ifelse([$7],,,[dnl
if test $[$2] != yes; then
- $8
+ $7
fi])])
dnl GCC_TARGET_TEMPLATE(KEY)
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 63a04b1..dddb90f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2021-08-19 Arnaud Charlet <charlet@adacore.com>
+
+ PR ada/101924
+ * gcc-interface/Make-lang.in (STAGE1_LIBS): Define on hpux.
+
2021-08-18 Eric Botcazou <ebotcazou@gcc.gnu.org>
* gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Fix
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index b68081e..765654f 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -85,6 +85,10 @@ ifeq ($(strip $(filter-out linux%,$(host_os))),)
STAGE1_LIBS=-ldl
endif
+ifeq ($(strip $(filter-out hpux%,$(host_os))),)
+ STAGE1_LIBS=/usr/lib/libcl.a
+endif
+
ifeq ($(STAGE1),True)
ADA_INCLUDES=$(COMMON_ADA_INCLUDES)
adalib=$(dir $(shell $(CC) -print-libgcc-file-name))adalib
diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog
index 0b483cc..da90011 100644
--- a/gcc/analyzer/ChangeLog
+++ b/gcc/analyzer/ChangeLog
@@ -1,3 +1,24 @@
+2021-08-21 Ankur Saini <arsenic@sourceware.org>
+
+ PR analyzer/101980
+ * diagnostic-manager.cc
+ (diagnostic_manager::prune_for_sm_diagnostic)<case EK_CALL_EDGE>: Use
+ caller_model only when the supergraph_edge doesn't exixt.
+ (diagnostic_manager::prune_for_sm_diagnostic)<case EK_RETURN_EDGE>:
+ Likewise.
+ * engine.cc (exploded_graph::create_dynamic_call): Rename to...
+ (exploded_graph::maybe_create_dynamic_call): ...this, return call
+ creation status.
+ (exploded_graph::process_node): Handle calls which were not dynamically
+ discovered.
+ * exploded-graph.h (exploded_graph::create_dynamic_call): Rename to...
+ (exploded_graph::maybe_create_dynamic_call): ...this.
+ * region-model.cc (region_model::update_for_gcall): New param, use it
+ to push call to frame.
+ (region_model::update_for_call_superedge): Pass callee function to
+ update_for_gcall.
+ * region-model.h (region_model::update_for_gcall): New param.
+
2021-08-18 Ankur Saini <arsenic@sourceware.org>
PR analyzer/97114
diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc
index 06e7510..89b5d1e 100644
--- a/gcc/analyzer/diagnostic-manager.cc
+++ b/gcc/analyzer/diagnostic-manager.cc
@@ -2099,7 +2099,22 @@ diagnostic_manager::prune_for_sm_diagnostic (checker_path *path,
= event->m_eedge.m_src->get_state ().m_region_model;
tree callee_var = callee_model->get_representative_tree (sval);
callsite_expr expr;
- tree caller_var = caller_model->get_representative_tree (sval);
+
+ tree caller_var;
+ if(event->m_sedge)
+ {
+ const callgraph_superedge& cg_superedge
+ = event->get_callgraph_superedge ();
+ if (cg_superedge.m_cedge)
+ caller_var
+ = cg_superedge.map_expr_from_callee_to_caller (callee_var,
+ &expr);
+ else
+ callee_var = callee_model->get_representative_tree (sval);
+ }
+ else
+ caller_var = caller_model->get_representative_tree (sval);
+
if (caller_var)
{
if (get_logger ())
@@ -2121,11 +2136,28 @@ diagnostic_manager::prune_for_sm_diagnostic (checker_path *path,
if (sval)
{
return_event *event = (return_event *)base_event;
+ const region_model *caller_model
+ = event->m_eedge.m_dest->get_state ().m_region_model;
+ tree caller_var = caller_model->get_representative_tree (sval);
+ const region_model *callee_model
+ = event->m_eedge.m_src->get_state ().m_region_model;
callsite_expr expr;
- const region_model *callee_model
- = event->m_eedge.m_src->get_state ().m_region_model;
- tree callee_var = callee_model->get_representative_tree (sval);
+ tree callee_var;
+ if (event->m_sedge)
+ {
+ const callgraph_superedge& cg_superedge
+ = event->get_callgraph_superedge ();
+ if (cg_superedge.m_cedge)
+ callee_var
+ = cg_superedge.map_expr_from_caller_to_callee (caller_var,
+ &expr);
+ else
+ callee_var = callee_model->get_representative_tree (sval);
+ }
+ else
+ callee_var = callee_model->get_representative_tree (sval);
+
if (callee_var)
{
if (get_logger ())
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 461de9c..e66ca4e 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -3033,14 +3033,14 @@ state_change_requires_new_enode_p (const program_state &old_state,
Some example such calls are dynamically dispatched calls to virtual
functions or calls that happen via function pointer. */
-void
-exploded_graph::create_dynamic_call (const gcall *call,
- tree fn_decl,
- exploded_node *node,
- program_state next_state,
- program_point &next_point,
- uncertainty_t *uncertainty,
- logger *logger)
+bool
+exploded_graph::maybe_create_dynamic_call (const gcall *call,
+ tree fn_decl,
+ exploded_node *node,
+ program_state next_state,
+ program_point &next_point,
+ uncertainty_t *uncertainty,
+ logger *logger)
{
LOG_FUNC (logger);
@@ -3049,8 +3049,8 @@ exploded_graph::create_dynamic_call (const gcall *call,
if (fun)
{
const supergraph &sg = this->get_supergraph ();
- supernode * sn_entry = sg.get_node_for_function_entry (fun);
- supernode * sn_exit = sg.get_node_for_function_exit (fun);
+ supernode *sn_entry = sg.get_node_for_function_entry (fun);
+ supernode *sn_exit = sg.get_node_for_function_exit (fun);
program_point new_point
= program_point::before_supernode (sn_entry,
@@ -3075,8 +3075,10 @@ exploded_graph::create_dynamic_call (const gcall *call,
if (enode)
add_edge (node,enode, NULL,
new dynamic_call_info_t (call));
+ return true;
}
- }
+ }
+ return false;
}
/* The core of exploded_graph::process_worklist (the main analysis loop),
@@ -3338,22 +3340,23 @@ exploded_graph::process_node (exploded_node *node)
point.get_stmt());
region_model *model = state.m_region_model;
+ bool call_discovered = false;
if (tree fn_decl = model->get_fndecl_for_call(call,&ctxt))
- create_dynamic_call (call,
- fn_decl,
- node,
- next_state,
- next_point,
- &uncertainty,
- logger);
- else
+ call_discovered = maybe_create_dynamic_call (call,
+ fn_decl,
+ node,
+ next_state,
+ next_point,
+ &uncertainty,
+ logger);
+ if (!call_discovered)
{
- /* An unknown function was called at this point, in such
- case, don't terminate the analysis of the current
- function.
+ /* An unknown function or a special function was called
+ at this point, in such case, don't terminate the
+ analysis of the current function.
- The analyzer handles calls to unknown functions while
+ The analyzer handles calls to such functions while
analysing the stmt itself, so the the function call
must have been handled by the anlyzer till now. */
exploded_node *next
diff --git a/gcc/analyzer/exploded-graph.h b/gcc/analyzer/exploded-graph.h
index 192a4b3..6890e84 100644
--- a/gcc/analyzer/exploded-graph.h
+++ b/gcc/analyzer/exploded-graph.h
@@ -816,13 +816,13 @@ public:
bool maybe_process_run_of_before_supernode_enodes (exploded_node *node);
void process_node (exploded_node *node);
- void create_dynamic_call (const gcall *call,
- tree fn_decl,
- exploded_node *node,
- program_state next_state,
- program_point &next_point,
- uncertainty_t *uncertainty,
- logger *logger);
+ bool maybe_create_dynamic_call (const gcall *call,
+ tree fn_decl,
+ exploded_node *node,
+ program_state next_state,
+ program_point &next_point,
+ uncertainty_t *uncertainty,
+ logger *logger);
exploded_node *get_or_create_node (const program_point &point,
const program_state &state,
diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc
index 822e893..9870007 100644
--- a/gcc/analyzer/region-model.cc
+++ b/gcc/analyzer/region-model.cc
@@ -3178,7 +3178,8 @@ region_model::maybe_update_for_edge (const superedge &edge,
void
region_model::update_for_gcall (const gcall *call_stmt,
- region_model_context *ctxt)
+ region_model_context *ctxt,
+ function *callee)
{
/* Build a vec of argument svalues, using the current top
frame for resolving tree expressions. */
@@ -3190,10 +3191,14 @@ region_model::update_for_gcall (const gcall *call_stmt,
arg_svals.quick_push (get_rvalue (arg, ctxt));
}
- /* Get the function * from the call. */
- tree fn_decl = get_fndecl_for_call (call_stmt,ctxt);
- function *fun = DECL_STRUCT_FUNCTION (fn_decl);
- push_frame (fun, &arg_svals, ctxt);
+ if(!callee)
+ {
+ /* Get the function * from the gcall. */
+ tree fn_decl = get_fndecl_for_call (call_stmt,ctxt);
+ callee = DECL_STRUCT_FUNCTION (fn_decl);
+ }
+
+ push_frame (callee, &arg_svals, ctxt);
}
/* Pop the top-most frame_region from the stack, and copy the return
@@ -3228,7 +3233,7 @@ region_model::update_for_call_superedge (const call_superedge &call_edge,
region_model_context *ctxt)
{
const gcall *call_stmt = call_edge.get_call_stmt ();
- update_for_gcall (call_stmt,ctxt);
+ update_for_gcall (call_stmt, ctxt, call_edge.get_callee_function ());
}
/* Extract calling information from the return superedge and update the model
diff --git a/gcc/analyzer/region-model.h b/gcc/analyzer/region-model.h
index e40264e..a734f9f 100644
--- a/gcc/analyzer/region-model.h
+++ b/gcc/analyzer/region-model.h
@@ -609,7 +609,8 @@ class region_model
rejected_constraint **out);
void update_for_gcall (const gcall *call_stmt,
- region_model_context *ctxt);
+ region_model_context *ctxt,
+ function *callee = NULL);
void update_for_return_gcall (const gcall *call_stmt,
region_model_context *ctxt);
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index ab566ba..873d7ab 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,19 @@
+2021-08-20 Tobias Burnus <tobias@codesourcery.com>
+
+ * c-format.c (gcc_gfc_length_specs): Add 'll' and 'w'.
+ (gcc_gfc_char_table): Add T9L_LL and T9L_ULL to
+ "di" and "u", respecitively; fill with BADLEN to match
+ size of 'types'.
+ (get_init_dynamic_hwi): Split off from ...
+ (init_dynamic_diag_info): ... here. Call it.
+ (init_dynamic_gfc_info): Call it.
+
+2021-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ERROR.
+ * c-pragma.c (omp_pragmas): Add error directive.
+ * c-omp.c (omp_directives): Uncomment error directive entry.
+
2021-08-18 Jakub Jelinek <jakub@redhat.com>
* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_NOTHING.
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c
index 6fd0bb3..b4cb765a 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -546,10 +546,11 @@ static const format_length_info strfmon_length_specs[] =
};
-/* For now, the Fortran front-end routines only use l as length modifier. */
+/* Length modifiers used by the fortran/error.c routines. */
static const format_length_info gcc_gfc_length_specs[] =
{
- { "l", FMT_LEN_l, STD_C89, NO_FMT, 0 },
+ { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C89, 0 },
+ { "w", FMT_LEN_w, STD_C89, NO_FMT, 0 },
{ NO_FMT, NO_FMT, 0 }
};
@@ -821,10 +822,10 @@ static const format_char_info gcc_cxxdiag_char_table[] =
static const format_char_info gcc_gfc_char_table[] =
{
/* C89 conversion specifiers. */
- { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL },
- { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL },
- { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL },
- { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "cR", NULL },
+ { "di", 0, STD_C89, { T89_I, BADLEN, BADLEN, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL },
+ { "u", 0, STD_C89, { T89_UI, BADLEN, BADLEN, T89_UL, T9L_ULL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL },
+ { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL },
+ { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "cR", NULL },
/* gfc conversion specifiers. */
@@ -4843,12 +4844,73 @@ init_dynamic_asm_fprintf_info (void)
}
}
+static const format_length_info*
+get_init_dynamic_hwi (void)
+{
+ static tree hwi;
+ static format_length_info *diag_ls;
+
+ if (!hwi)
+ {
+ unsigned int i;
+
+ /* Find the underlying type for HOST_WIDE_INT. For the 'w'
+ length modifier to work, one must have issued: "typedef
+ HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code
+ prior to using that modifier. */
+ if ((hwi = maybe_get_identifier ("__gcc_host_wide_int__")))
+ {
+ hwi = identifier_global_value (hwi);
+ if (hwi)
+ {
+ if (TREE_CODE (hwi) != TYPE_DECL)
+ {
+ error ("%<__gcc_host_wide_int__%> is not defined as a type");
+ hwi = 0;
+ }
+ else
+ {
+ hwi = DECL_ORIGINAL_TYPE (hwi);
+ gcc_assert (hwi);
+ if (hwi != long_integer_type_node
+ && hwi != long_long_integer_type_node)
+ {
+ error ("%<__gcc_host_wide_int__%> is not defined"
+ " as %<long%> or %<long long%>");
+ hwi = 0;
+ }
+ }
+ }
+ }
+ if (!diag_ls)
+ diag_ls = (format_length_info *)
+ xmemdup (gcc_diag_length_specs,
+ sizeof (gcc_diag_length_specs),
+ sizeof (gcc_diag_length_specs));
+ if (hwi)
+ {
+ /* HOST_WIDE_INT must be one of 'long' or 'long long'. */
+ i = find_length_info_modifier_index (diag_ls, 'w');
+ if (hwi == long_integer_type_node)
+ diag_ls[i].index = FMT_LEN_l;
+ else if (hwi == long_long_integer_type_node)
+ diag_ls[i].index = FMT_LEN_ll;
+ else
+ gcc_unreachable ();
+ }
+ }
+ return diag_ls;
+}
+
/* Determine the type of a "locus" in the code being compiled for use
in GCC's __gcc_gfc__ custom format attribute. You must have set
dynamic_format_types before calling this function. */
static void
init_dynamic_gfc_info (void)
{
+ dynamic_format_types[gcc_gfc_format_type].length_char_specs
+ = get_init_dynamic_hwi ();
+
if (!locus)
{
static format_char_info *gfc_fci;
@@ -4985,67 +5047,13 @@ init_dynamic_diag_info (void)
|| local_event_ptr_node == void_type_node)
local_event_ptr_node = get_named_type ("diagnostic_event_id_t");
- static tree hwi;
-
- if (!hwi)
- {
- static format_length_info *diag_ls;
- unsigned int i;
-
- /* Find the underlying type for HOST_WIDE_INT. For the 'w'
- length modifier to work, one must have issued: "typedef
- HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code
- prior to using that modifier. */
- if ((hwi = maybe_get_identifier ("__gcc_host_wide_int__")))
- {
- hwi = identifier_global_value (hwi);
- if (hwi)
- {
- if (TREE_CODE (hwi) != TYPE_DECL)
- {
- error ("%<__gcc_host_wide_int__%> is not defined as a type");
- hwi = 0;
- }
- else
- {
- hwi = DECL_ORIGINAL_TYPE (hwi);
- gcc_assert (hwi);
- if (hwi != long_integer_type_node
- && hwi != long_long_integer_type_node)
- {
- error ("%<__gcc_host_wide_int__%> is not defined"
- " as %<long%> or %<long long%>");
- hwi = 0;
- }
- }
- }
- }
-
- /* Assign the new data for use. */
-
- /* All the GCC diag formats use the same length specs. */
- if (!diag_ls)
- dynamic_format_types[gcc_diag_format_type].length_char_specs =
- dynamic_format_types[gcc_tdiag_format_type].length_char_specs =
- dynamic_format_types[gcc_cdiag_format_type].length_char_specs =
- dynamic_format_types[gcc_cxxdiag_format_type].length_char_specs =
- dynamic_format_types[gcc_dump_printf_format_type].length_char_specs =
- diag_ls = (format_length_info *)
- xmemdup (gcc_diag_length_specs,
- sizeof (gcc_diag_length_specs),
- sizeof (gcc_diag_length_specs));
- if (hwi)
- {
- /* HOST_WIDE_INT must be one of 'long' or 'long long'. */
- i = find_length_info_modifier_index (diag_ls, 'w');
- if (hwi == long_integer_type_node)
- diag_ls[i].index = FMT_LEN_l;
- else if (hwi == long_long_integer_type_node)
- diag_ls[i].index = FMT_LEN_ll;
- else
- gcc_unreachable ();
- }
- }
+ /* All the GCC diag formats use the same length specs. */
+ dynamic_format_types[gcc_diag_format_type].length_char_specs =
+ dynamic_format_types[gcc_tdiag_format_type].length_char_specs =
+ dynamic_format_types[gcc_cdiag_format_type].length_char_specs =
+ dynamic_format_types[gcc_cxxdiag_format_type].length_char_specs =
+ dynamic_format_types[gcc_dump_printf_format_type].length_char_specs
+ = get_init_dynamic_hwi ();
/* It's safe to "re-initialize these to the same values. */
dynamic_format_types[gcc_diag_format_type].conversion_specs =
diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c
index d4e98bf..18de7e4 100644
--- a/gcc/c-family/c-omp.c
+++ b/gcc/c-family/c-omp.c
@@ -2991,8 +2991,8 @@ static const struct c_omp_directive omp_directives[] = {
/* { "end", "metadirective", nullptr, PRAGMA_OMP_END,
C_OMP_DIR_???, ??? }, */
/* error with at(execution) is C_OMP_DIR_STANDALONE. */
- /* { "error", nullptr, nullptr, PRAGMA_OMP_ERROR,
- C_OMP_DIR_UTILITY, false }, */
+ { "error", nullptr, nullptr, PRAGMA_OMP_ERROR,
+ C_OMP_DIR_UTILITY, false },
{ "flush", nullptr, nullptr, PRAGMA_OMP_FLUSH,
C_OMP_DIR_STANDALONE, false },
{ "for", nullptr, nullptr, PRAGMA_OMP_FOR,
diff --git a/gcc/c-family/c-pragma.c b/gcc/c-family/c-pragma.c
index 238309d..a9be8df 100644
--- a/gcc/c-family/c-pragma.c
+++ b/gcc/c-family/c-pragma.c
@@ -1326,6 +1326,7 @@ static const struct omp_pragma_def omp_pragmas[] = {
{ "cancellation", PRAGMA_OMP_CANCELLATION_POINT },
{ "critical", PRAGMA_OMP_CRITICAL },
{ "depobj", PRAGMA_OMP_DEPOBJ },
+ { "error", PRAGMA_OMP_ERROR },
{ "end", PRAGMA_OMP_END_DECLARE_TARGET },
{ "flush", PRAGMA_OMP_FLUSH },
{ "nothing", PRAGMA_OMP_NOTHING },
diff --git a/gcc/c-family/c-pragma.h b/gcc/c-family/c-pragma.h
index dc9e8a6..0c5b07a 100644
--- a/gcc/c-family/c-pragma.h
+++ b/gcc/c-family/c-pragma.h
@@ -53,6 +53,7 @@ enum pragma_kind {
PRAGMA_OMP_DECLARE,
PRAGMA_OMP_DEPOBJ,
PRAGMA_OMP_DISTRIBUTE,
+ PRAGMA_OMP_ERROR,
PRAGMA_OMP_END_DECLARE_TARGET,
PRAGMA_OMP_FLUSH,
PRAGMA_OMP_FOR,
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 53abd1a..6ca524b 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,30 @@
+2021-08-22 Martin Uecker <muecker@gwdg.de>
+
+ PR c/98397
+ * c-typeck.c (comp_target_types): Change pedwarn to pedwarn_c11
+ for pointers to arrays with qualifiers.
+ (build_conditional_expr): For C23 don't lose qualifiers for pointers
+ to arrays when the other pointer is a void pointer. Update warnings.
+ (convert_for_assignment): Update warnings for C2X when converting from
+ void* with qualifiers to a pointer to array with the same qualifiers.
+
+2021-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ * c-parser.c (c_parser_omp_error): New function.
+ (c_parser_pragma): Handle PRAGMA_OMP_ERROR.
+
+2021-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ * c-parser.c (c_parser_omp_clause_depend_sink): Reject spurious
+ comma at the end of list.
+ (c_parser_omp_requires): Likewise.
+
+2021-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ * c-parser.c (c_parser_omp_requires): Don't call
+ c_parser_peek_2nd_token and optionally consume token if current
+ token is CPP_EOF, CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
+
2021-08-18 Jakub Jelinek <jakub@redhat.com>
* c-parser.c (c_parser_omp_nothing): New function.
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 407f279..356cf25 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -1588,6 +1588,7 @@ static bool c_parser_omp_target (c_parser *, enum pragma_context, bool *);
static void c_parser_omp_end_declare_target (c_parser *);
static bool c_parser_omp_declare (c_parser *, enum pragma_context);
static void c_parser_omp_requires (c_parser *);
+static bool c_parser_omp_error (c_parser *, enum pragma_context);
static bool c_parser_omp_ordered (c_parser *, enum pragma_context, bool *);
static void c_parser_oacc_routine (c_parser *, enum pragma_context);
@@ -12485,6 +12486,9 @@ c_parser_pragma (c_parser *parser, enum pragma_context context, bool *if_p)
c_parser_omp_nothing (parser);
return false;
+ case PRAGMA_OMP_ERROR:
+ return c_parser_omp_error (parser, context);
+
case PRAGMA_OMP_ORDERED:
return c_parser_omp_ordered (parser, context, if_p);
@@ -13782,7 +13786,10 @@ c_parser_omp_clause_num_threads (c_parser *parser, tree list)
}
/* OpenMP 4.5:
- num_tasks ( expression ) */
+ num_tasks ( expression )
+
+ OpenMP 5.1:
+ num_tasks ( strict : expression ) */
static tree
c_parser_omp_clause_num_tasks (c_parser *parser, tree list)
@@ -13791,6 +13798,17 @@ c_parser_omp_clause_num_tasks (c_parser *parser, tree list)
matching_parens parens;
if (parens.require_open (parser))
{
+ bool strict = false;
+ if (c_parser_next_token_is (parser, CPP_NAME)
+ && c_parser_peek_2nd_token (parser)->type == CPP_COLON
+ && strcmp (IDENTIFIER_POINTER (c_parser_peek_token (parser)->value),
+ "strict") == 0)
+ {
+ strict = true;
+ c_parser_consume_token (parser);
+ c_parser_consume_token (parser);
+ }
+
location_t expr_loc = c_parser_peek_token (parser)->location;
c_expr expr = c_parser_expr_no_commas (parser, NULL);
expr = convert_lvalue_to_rvalue (expr_loc, expr, false, true);
@@ -13820,6 +13838,7 @@ c_parser_omp_clause_num_tasks (c_parser *parser, tree list)
c = build_omp_clause (num_tasks_loc, OMP_CLAUSE_NUM_TASKS);
OMP_CLAUSE_NUM_TASKS_EXPR (c) = t;
+ OMP_CLAUSE_NUM_TASKS_STRICT (c) = strict;
OMP_CLAUSE_CHAIN (c) = list;
list = c;
}
@@ -13828,7 +13847,10 @@ c_parser_omp_clause_num_tasks (c_parser *parser, tree list)
}
/* OpenMP 4.5:
- grainsize ( expression ) */
+ grainsize ( expression )
+
+ OpenMP 5.1:
+ grainsize ( strict : expression ) */
static tree
c_parser_omp_clause_grainsize (c_parser *parser, tree list)
@@ -13837,6 +13859,17 @@ c_parser_omp_clause_grainsize (c_parser *parser, tree list)
matching_parens parens;
if (parens.require_open (parser))
{
+ bool strict = false;
+ if (c_parser_next_token_is (parser, CPP_NAME)
+ && c_parser_peek_2nd_token (parser)->type == CPP_COLON
+ && strcmp (IDENTIFIER_POINTER (c_parser_peek_token (parser)->value),
+ "strict") == 0)
+ {
+ strict = true;
+ c_parser_consume_token (parser);
+ c_parser_consume_token (parser);
+ }
+
location_t expr_loc = c_parser_peek_token (parser)->location;
c_expr expr = c_parser_expr_no_commas (parser, NULL);
expr = convert_lvalue_to_rvalue (expr_loc, expr, false, true);
@@ -13866,6 +13899,7 @@ c_parser_omp_clause_grainsize (c_parser *parser, tree list)
c = build_omp_clause (grainsize_loc, OMP_CLAUSE_GRAINSIZE);
OMP_CLAUSE_GRAINSIZE_EXPR (c) = t;
+ OMP_CLAUSE_GRAINSIZE_STRICT (c) = strict;
OMP_CLAUSE_CHAIN (c) = list;
list = c;
}
@@ -15481,7 +15515,9 @@ c_parser_omp_clause_depend_sink (c_parser *parser, location_t clause_loc,
OMP_CLAUSE_DEPEND_SINK_NEGATIVE (vec) = 1;
}
- if (c_parser_next_token_is_not (parser, CPP_COMMA))
+ if (c_parser_next_token_is_not (parser, CPP_COMMA)
+ || c_parser_peek_2nd_token (parser)->type != CPP_NAME
+ || c_parser_peek_2nd_token (parser)->id_kind != C_ID_ID)
break;
c_parser_consume_token (parser);
@@ -21663,7 +21699,9 @@ c_parser_omp_requires (c_parser *parser)
location_t loc = c_parser_peek_token (parser)->location;
while (c_parser_next_token_is_not (parser, CPP_PRAGMA_EOL))
{
- if (!first && c_parser_next_token_is (parser, CPP_COMMA))
+ if (!first
+ && c_parser_next_token_is (parser, CPP_COMMA)
+ && c_parser_peek_2nd_token (parser)->type == CPP_NAME)
c_parser_consume_token (parser);
first = false;
@@ -21932,6 +21970,173 @@ c_parser_omp_nothing (c_parser *parser)
c_parser_skip_to_pragma_eol (parser);
}
+/* OpenMP 5.1
+ #pragma omp error clauses[optseq] new-line */
+
+static bool
+c_parser_omp_error (c_parser *parser, enum pragma_context context)
+{
+ int at_compilation = -1;
+ int severity_fatal = -1;
+ tree message = NULL_TREE;
+ bool first = true;
+ bool bad = false;
+ location_t loc = c_parser_peek_token (parser)->location;
+
+ c_parser_consume_pragma (parser);
+
+ while (c_parser_next_token_is_not (parser, CPP_PRAGMA_EOL))
+ {
+ if (!first
+ && c_parser_next_token_is (parser, CPP_COMMA)
+ && c_parser_peek_2nd_token (parser)->type == CPP_NAME)
+ c_parser_consume_token (parser);
+
+ first = false;
+
+ if (!c_parser_next_token_is (parser, CPP_NAME))
+ break;
+
+ const char *p
+ = IDENTIFIER_POINTER (c_parser_peek_token (parser)->value);
+ location_t cloc = c_parser_peek_token (parser)->location;
+ static const char *args[] = {
+ "execution", "compilation", "warning", "fatal"
+ };
+ int *v = NULL;
+ int idx = 0, n = -1;
+ tree m = NULL_TREE;
+
+ if (!strcmp (p, "at"))
+ v = &at_compilation;
+ else if (!strcmp (p, "severity"))
+ {
+ v = &severity_fatal;
+ idx += 2;
+ }
+ else if (strcmp (p, "message"))
+ {
+ error_at (cloc,
+ "expected %<at%>, %<severity%> or %<message%> clause");
+ c_parser_skip_to_pragma_eol (parser, false);
+ return false;
+ }
+
+ c_parser_consume_token (parser);
+
+ matching_parens parens;
+ if (parens.require_open (parser))
+ {
+ if (v == NULL)
+ {
+ location_t expr_loc = c_parser_peek_token (parser)->location;
+ c_expr expr = c_parser_expr_no_commas (parser, NULL);
+ expr = convert_lvalue_to_rvalue (expr_loc, expr, true, true);
+ m = convert (const_string_type_node, expr.value);
+ m = c_fully_fold (m, false, NULL);
+ }
+ else
+ {
+ if (c_parser_next_token_is (parser, CPP_NAME))
+ {
+ tree val = c_parser_peek_token (parser)->value;
+ const char *q = IDENTIFIER_POINTER (val);
+
+ if (!strcmp (q, args[idx]))
+ n = 0;
+ else if (!strcmp (q, args[idx + 1]))
+ n = 1;
+ }
+ if (n == -1)
+ {
+ error_at (c_parser_peek_token (parser)->location,
+ "expected %qs or %qs", args[idx], args[idx + 1]);
+ bad = true;
+ switch (c_parser_peek_token (parser)->type)
+ {
+ case CPP_EOF:
+ case CPP_PRAGMA_EOL:
+ case CPP_CLOSE_PAREN:
+ break;
+ default:
+ if (c_parser_peek_2nd_token (parser)->type
+ == CPP_CLOSE_PAREN)
+ c_parser_consume_token (parser);
+ break;
+ }
+ }
+ else
+ c_parser_consume_token (parser);
+ }
+
+ parens.skip_until_found_close (parser);
+
+ if (v == NULL)
+ {
+ if (message)
+ {
+ error_at (cloc, "too many %qs clauses", p);
+ bad = true;
+ }
+ else
+ message = m;
+ }
+ else if (n != -1)
+ {
+ if (*v != -1)
+ {
+ error_at (cloc, "too many %qs clauses", p);
+ bad = true;
+ }
+ else
+ *v = n;
+ }
+ }
+ else
+ bad = true;
+ }
+ c_parser_skip_to_pragma_eol (parser);
+ if (bad)
+ return true;
+
+ if (at_compilation == -1)
+ at_compilation = 1;
+ if (severity_fatal == -1)
+ severity_fatal = 1;
+ if (!at_compilation)
+ {
+ if (context != pragma_compound)
+ {
+ error_at (loc, "%<#pragma omp error%> with %<at(execution)%> clause "
+ "may only be used in compound statements");
+ return true;
+ }
+ tree fndecl
+ = builtin_decl_explicit (severity_fatal ? BUILT_IN_GOMP_ERROR
+ : BUILT_IN_GOMP_WARNING);
+ if (!message)
+ message = build_zero_cst (const_string_type_node);
+ tree stmt = build_call_expr_loc (loc, fndecl, 2, message,
+ build_all_ones_cst (size_type_node));
+ add_stmt (stmt);
+ return true;
+ }
+ const char *msg = NULL;
+ if (message)
+ {
+ msg = c_getstr (message);
+ if (msg == NULL)
+ msg = _("<message unknown at compile time>");
+ }
+ if (msg)
+ emit_diagnostic (severity_fatal ? DK_ERROR : DK_WARNING, loc, 0,
+ "%<pragma omp error%> encountered: %s", msg);
+ else
+ emit_diagnostic (severity_fatal ? DK_ERROR : DK_WARNING, loc, 0,
+ "%<pragma omp error%> encountered");
+ return false;
+}
+
/* Main entry point to parsing most OpenMP pragmas. */
static void
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 0c07af61..d9f26d6 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -1328,8 +1328,8 @@ comp_target_types (location_t location, tree ttl, tree ttr)
val = comptypes_check_enum_int (mvl, mvr, &enum_and_int_p);
if (val == 1 && val_ped != 1)
- pedwarn (location, OPT_Wpedantic, "pointers to arrays with different qualifiers "
- "are incompatible in ISO C");
+ pedwarn_c11 (location, OPT_Wpedantic, "invalid use of pointers to arrays with different qualifiers "
+ "in ISO C before C2X");
if (val == 2)
pedwarn (location, OPT_Wpedantic, "types are not quite compatible");
@@ -5406,39 +5406,41 @@ build_conditional_expr (location_t colon_loc, tree ifexp, bool ifexp_bcp,
"used in conditional expression");
return error_mark_node;
}
- else if (VOID_TYPE_P (TREE_TYPE (type1))
- && !TYPE_ATOMIC (TREE_TYPE (type1)))
- {
- if ((TREE_CODE (TREE_TYPE (type2)) == ARRAY_TYPE)
- && (TYPE_QUALS (strip_array_types (TREE_TYPE (type2)))
- & ~TYPE_QUALS (TREE_TYPE (type1))))
- warning_at (colon_loc, OPT_Wdiscarded_array_qualifiers,
- "pointer to array loses qualifier "
- "in conditional expression");
-
- if (TREE_CODE (TREE_TYPE (type2)) == FUNCTION_TYPE)
+ else if ((VOID_TYPE_P (TREE_TYPE (type1))
+ && !TYPE_ATOMIC (TREE_TYPE (type1)))
+ || (VOID_TYPE_P (TREE_TYPE (type2))
+ && !TYPE_ATOMIC (TREE_TYPE (type2))))
+ {
+ tree t1 = TREE_TYPE (type1);
+ tree t2 = TREE_TYPE (type2);
+ if (!(VOID_TYPE_P (t1)
+ && !TYPE_ATOMIC (t1)))
+ {
+ /* roles are swapped */
+ t1 = t2;
+ t2 = TREE_TYPE (type1);
+ }
+ tree t2_stripped = strip_array_types (t2);
+ if ((TREE_CODE (t2) == ARRAY_TYPE)
+ && (TYPE_QUALS (t2_stripped) & ~TYPE_QUALS (t1)))
+ {
+ if (!flag_isoc2x)
+ warning_at (colon_loc, OPT_Wdiscarded_array_qualifiers,
+ "pointer to array loses qualifier "
+ "in conditional expression");
+ else if (warn_c11_c2x_compat > 0)
+ warning_at (colon_loc, OPT_Wc11_c2x_compat,
+ "pointer to array loses qualifier "
+ "in conditional expression in ISO C before C2X");
+ }
+ if (TREE_CODE (t2) == FUNCTION_TYPE)
pedwarn (colon_loc, OPT_Wpedantic,
"ISO C forbids conditional expr between "
"%<void *%> and function pointer");
- result_type = build_pointer_type (qualify_type (TREE_TYPE (type1),
- TREE_TYPE (type2)));
- }
- else if (VOID_TYPE_P (TREE_TYPE (type2))
- && !TYPE_ATOMIC (TREE_TYPE (type2)))
- {
- if ((TREE_CODE (TREE_TYPE (type1)) == ARRAY_TYPE)
- && (TYPE_QUALS (strip_array_types (TREE_TYPE (type1)))
- & ~TYPE_QUALS (TREE_TYPE (type2))))
- warning_at (colon_loc, OPT_Wdiscarded_array_qualifiers,
- "pointer to array loses qualifier "
- "in conditional expression");
-
- if (TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE)
- pedwarn (colon_loc, OPT_Wpedantic,
- "ISO C forbids conditional expr between "
- "%<void *%> and function pointer");
- result_type = build_pointer_type (qualify_type (TREE_TYPE (type2),
- TREE_TYPE (type1)));
+ /* for array, use qualifiers of element type */
+ if (flag_isoc2x)
+ t2 = t2_stripped;
+ result_type = build_pointer_type (qualify_type (t1, t2));
}
/* Objective-C pointer comparisons are a bit more lenient. */
else if (objc_have_common_type (type1, type2, -3, NULL_TREE))
@@ -6797,27 +6799,40 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
/* This macro is used to emit diagnostics to ensure that all format
strings are complete sentences, visible to gettext and checked at
- compile time. It is the same as PEDWARN_FOR_ASSIGNMENT but with an
- extra parameter to enumerate qualifiers. */
-#define PEDWARN_FOR_QUALIFIERS(LOCATION, PLOC, OPT, AR, AS, IN, RE, QUALS) \
+ compile time. It can be called with 'pedwarn' or 'warning_at'. */
+#define WARNING_FOR_QUALIFIERS(PEDWARN, LOCATION, PLOC, OPT, AR, AS, IN, RE, QUALS) \
do { \
switch (errtype) \
{ \
case ic_argpass: \
- { \
- auto_diagnostic_group d; \
- if (pedwarn (PLOC, OPT, AR, parmnum, rname, QUALS)) \
- inform_for_arg (fundecl, (PLOC), parmnum, type, rhstype); \
- } \
+ { \
+ auto_diagnostic_group d; \
+ if (PEDWARN) { \
+ if (pedwarn (PLOC, OPT, AR, parmnum, rname, QUALS)) \
+ inform_for_arg (fundecl, (PLOC), parmnum, type, rhstype); \
+ } else { \
+ if (warning_at (PLOC, OPT, AR, parmnum, rname, QUALS)) \
+ inform_for_arg (fundecl, (PLOC), parmnum, type, rhstype); \
+ } \
+ } \
break; \
case ic_assign: \
- pedwarn (LOCATION, OPT, AS, QUALS); \
+ if (PEDWARN) \
+ pedwarn (LOCATION, OPT, AS, QUALS); \
+ else \
+ warning_at (LOCATION, OPT, AS, QUALS); \
break; \
case ic_init: \
- pedwarn (LOCATION, OPT, IN, QUALS); \
+ if (PEDWARN) \
+ pedwarn (LOCATION, OPT, IN, QUALS); \
+ else \
+ warning_at (LOCATION, OPT, IN, QUALS); \
break; \
case ic_return: \
- pedwarn (LOCATION, OPT, RE, QUALS); \
+ if (PEDWARN) \
+ pedwarn (LOCATION, OPT, RE, QUALS); \
+ else \
+ warning_at (LOCATION, OPT, RE, QUALS); \
break; \
default: \
gcc_unreachable (); \
@@ -6826,32 +6841,11 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
/* This macro is used to emit diagnostics to ensure that all format
strings are complete sentences, visible to gettext and checked at
- compile time. It is the same as PEDWARN_FOR_QUALIFIERS but uses
- warning_at instead of pedwarn. */
-#define WARNING_FOR_QUALIFIERS(LOCATION, PLOC, OPT, AR, AS, IN, RE, QUALS) \
- do { \
- switch (errtype) \
- { \
- case ic_argpass: \
- { \
- auto_diagnostic_group d; \
- if (warning_at (PLOC, OPT, AR, parmnum, rname, QUALS)) \
- inform_for_arg (fundecl, (PLOC), parmnum, type, rhstype); \
- } \
- break; \
- case ic_assign: \
- warning_at (LOCATION, OPT, AS, QUALS); \
- break; \
- case ic_init: \
- warning_at (LOCATION, OPT, IN, QUALS); \
- break; \
- case ic_return: \
- warning_at (LOCATION, OPT, RE, QUALS); \
- break; \
- default: \
- gcc_unreachable (); \
- } \
- } while (0)
+ compile time. It is the same as PEDWARN_FOR_ASSIGNMENT but with an
+ extra parameter to enumerate qualifiers. */
+#define PEDWARN_FOR_QUALIFIERS(LOCATION, PLOC, OPT, AR, AS, IN, RE, QUALS) \
+ WARNING_FOR_QUALIFIERS (true, LOCATION, PLOC, OPT, AR, AS, IN, RE, QUALS)
+
if (TREE_CODE (rhs) == EXCESS_PRECISION_EXPR)
rhs = TREE_OPERAND (rhs, 0);
@@ -7370,17 +7364,18 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
if (TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttr)
& ~TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttl))
- WARNING_FOR_QUALIFIERS (location, expr_loc,
- OPT_Wdiscarded_array_qualifiers,
- G_("passing argument %d of %qE discards "
+ WARNING_FOR_QUALIFIERS (flag_isoc2x,
+ location, expr_loc,
+ OPT_Wdiscarded_array_qualifiers,
+ G_("passing argument %d of %qE discards "
"%qv qualifier from pointer target type"),
- G_("assignment discards %qv qualifier "
+ G_("assignment discards %qv qualifier "
"from pointer target type"),
- G_("initialization discards %qv qualifier "
+ G_("initialization discards %qv qualifier "
"from pointer target type"),
- G_("return discards %qv qualifier from "
+ G_("return discards %qv qualifier from "
"pointer target type"),
- TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl));
+ TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl));
}
else if (pedantic
&& ((VOID_TYPE_P (ttl) && TREE_CODE (ttr) == FUNCTION_TYPE)
@@ -7403,28 +7398,31 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
else if (TREE_CODE (ttr) != FUNCTION_TYPE
&& TREE_CODE (ttl) != FUNCTION_TYPE)
{
+ /* Assignments between atomic and non-atomic objects are OK. */
+ bool warn_quals_ped = TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttr)
+ & ~TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttl);
+ bool warn_quals = TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttr)
+ & ~TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (strip_array_types (ttl));
+
/* Don't warn about loss of qualifier for conversions from
qualified void* to pointers to arrays with corresponding
- qualifier on the element type. */
- if (!pedantic)
- ttl = strip_array_types (ttl);
+ qualifier on the element type (except for pedantic before C23). */
+ if (warn_quals || (warn_quals_ped && pedantic && !flag_isoc2x))
+ PEDWARN_FOR_QUALIFIERS (location, expr_loc,
+ OPT_Wdiscarded_qualifiers,
+ G_("passing argument %d of %qE discards "
+ "%qv qualifier from pointer target type"),
+ G_("assignment discards %qv qualifier "
+ "from pointer target type"),
+ G_("initialization discards %qv qualifier "
+ "from pointer target type"),
+ G_("return discards %qv qualifier from "
+ "pointer target type"),
+ TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl));
+ else if (warn_quals_ped)
+ pedwarn_c11 (location, OPT_Wc11_c2x_compat,
+ "array with qualifier on the element is not qualified before C2X");
- /* Assignments between atomic and non-atomic objects are OK. */
- if (TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttr)
- & ~TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC (ttl))
- {
- PEDWARN_FOR_QUALIFIERS (location, expr_loc,
- OPT_Wdiscarded_qualifiers,
- G_("passing argument %d of %qE discards "
- "%qv qualifier from pointer target type"),
- G_("assignment discards %qv qualifier "
- "from pointer target type"),
- G_("initialization discards %qv qualifier "
- "from pointer target type"),
- G_("return discards %qv qualifier from "
- "pointer target type"),
- TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl));
- }
/* If this is not a case of ignoring a mismatch in signedness,
no warning. */
else if (VOID_TYPE_P (ttl) || VOID_TYPE_P (ttr)
diff --git a/gcc/config.gcc b/gcc/config.gcc
index eb232df..08e6c67 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1677,11 +1677,11 @@ moxie-*-moxiebox*)
;;
h8300-*-elf*)
tmake_file="h8300/t-h8300"
- tm_file="h8300/h8300.h dbxelf.h elfos.h newlib-stdint.h h8300/elf.h"
+ tm_file="h8300/h8300.h elfos.h newlib-stdint.h h8300/elf.h"
;;
h8300-*-linux*)
tmake_file="${tmake_file} h8300/t-h8300 h8300/t-linux"
- tm_file="h8300/h8300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h h8300/linux.h"
+ tm_file="h8300/h8300.h elfos.h gnu-user.h linux.h glibc-stdint.h h8300/linux.h"
;;
hppa*64*-*-linux*)
target_cpu_default="MASK_PA_11|MASK_PA_20"
@@ -3473,7 +3473,7 @@ tilepro*-*-linux*)
;;
v850-*-rtems*)
target_cpu_default="TARGET_CPU_generic"
- tm_file="dbxelf.h elfos.h v850/v850.h"
+ tm_file="elfos.h v850/v850.h"
tm_file="${tm_file} v850/rtems.h rtems.h newlib-stdint.h"
tmake_file="${tmake_file} v850/t-v850"
tmake_file="${tmake_file} v850/t-rtems"
@@ -3502,11 +3502,7 @@ v850*-*-*)
target_cpu_default="TARGET_CPU_generic"
;;
esac
- tm_file="dbxelf.h elfos.h newlib-stdint.h v850/v850.h"
- if test x$stabs = xyes
- then
- tm_file="${tm_file} dbx.h"
- fi
+ tm_file="elfos.h newlib-stdint.h v850/v850.h"
use_collect2=no
c_target_objs="v850-c.o"
cxx_target_objs="v850-c.o"
diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
index af478a9..7417b55 100644
--- a/gcc/config/arm/arm.opt
+++ b/gcc/config/arm/arm.opt
@@ -82,7 +82,7 @@ EnumValue
Enum(arm_arch) String(native) Value(-1) DriverOnly
; Set to the name of target architecture which is required for
-; multilib linking. This option is undocumented becuase it
+; multilib linking. This option is undocumented because it
; should not be used by the users.
mlibarch=
Target RejectNegative JoinedOrMissing NoDWARFRecord DriverOnly Undocumented
diff --git a/gcc/config/arm/arm_mve.h b/gcc/config/arm/arm_mve.h
index 83f1003..e04d462 100644
--- a/gcc/config/arm/arm_mve.h
+++ b/gcc/config/arm/arm_mve.h
@@ -3524,7 +3524,7 @@ __arm_vaddlvq_u32 (uint32x4_t __a)
return __builtin_mve_vaddlvq_uv4si (__a);
}
-__extension__ extern __inline int64_t
+__extension__ extern __inline mve_pred16_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
__arm_vctp16q (uint32_t __a)
{
diff --git a/gcc/config/arm/t-rmprofile b/gcc/config/arm/t-rmprofile
index 3e75fcc..a6036bf 100644
--- a/gcc/config/arm/t-rmprofile
+++ b/gcc/config/arm/t-rmprofile
@@ -54,7 +54,7 @@ MULTILIB_REQUIRED += mthumb/march=armv8.1-m.main+mve/mfloat-abi=hard
MULTILIB_MATCHES += march?armv6s-m=march?armv6-m
# For all MULITIB_MATCHES for v8-m and above add mlibarch? on the right hand side
-# of = in the variant string instead of march?. This is needed becuase all the
+# of = in the variant string instead of march?. This is needed because all the
# MULITIB_MATCHES variant strings are compared with mlibarch option for multilib
# linking.
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 0c4e508..8ccacec 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -213,9 +213,9 @@ static enum shift_alg shift_alg_hi[2][3][16] = {
/* 0 1 2 3 4 5 6 7 */
/* 8 9 10 11 12 13 14 15 */
{ INL, INL, INL, INL, INL, INL, INL, INL,
- SPC, SPC, SPC, SPC, SPC, ROT, ROT, ROT }, /* SHIFT_ASHIFT */
+ SPC, SPC, SPC, SPC, ROT, ROT, ROT, ROT }, /* SHIFT_ASHIFT */
{ INL, INL, INL, INL, INL, INL, INL, INL,
- SPC, SPC, SPC, SPC, SPC, ROT, ROT, ROT }, /* SHIFT_LSHIFTRT */
+ SPC, SPC, SPC, SPC, ROT, ROT, ROT, ROT }, /* SHIFT_LSHIFTRT */
{ INL, INL, INL, INL, INL, INL, INL, INL,
SPC, SPC, SPC, SPC, SPC, SPC, SPC, SPC }, /* SHIFT_ASHIFTRT */
}
@@ -237,9 +237,9 @@ static enum shift_alg shift_alg_si[2][3][32] = {
SPC, SPC, SPC, SPC, SPC, SPC, SPC, SPC,
SPC, SPC, SPC, SPC, SPC, SPC, SPC, SPC }, /* SHIFT_LSHIFTRT */
{ INL, INL, INL, INL, INL, INL, INL, LOP,
- SPC, LOP, LOP, LOP, LOP, LOP, LOP, LOP,
+ SPC, LOP, LOP, LOP, LOP, LOP, LOP, SPC,
SPC, SPC, SPC, SPC, SPC, SPC, SPC, SPC,
- SPC, SPC, SPC, SPC, LOP, LOP, LOP, SPC }, /* SHIFT_ASHIFTRT */
+ SPC, SPC, SPC, SPC, SPC, SPC, SPC, SPC }, /* SHIFT_ASHIFTRT */
},
{
/* TARGET_H8300S */
@@ -256,7 +256,7 @@ static enum shift_alg shift_alg_si[2][3][32] = {
SPC, SPC, SPC, SPC, SPC, SPC, SPC, SPC,
SPC, SPC, SPC, SPC, SPC, SPC, SPC, SPC }, /* SHIFT_LSHIFTRT */
{ INL, INL, INL, INL, INL, INL, INL, INL,
- INL, INL, INL, INL, INL, INL, INL, LOP,
+ INL, INL, INL, INL, INL, INL, INL, SPC,
SPC, SPC, SPC, SPC, SPC, SPC, SPC, SPC,
SPC, SPC, SPC, SPC, SPC, SPC, SPC, SPC }, /* SHIFT_ASHIFTRT */
}
@@ -372,6 +372,9 @@ h8300_option_override (void)
shift_alg_si[H8_300H][SHIFT_ASHIFTRT][25] = SHIFT_LOOP;
shift_alg_si[H8_300H][SHIFT_ASHIFTRT][26] = SHIFT_LOOP;
shift_alg_si[H8_300H][SHIFT_ASHIFTRT][27] = SHIFT_LOOP;
+ shift_alg_si[H8_300H][SHIFT_ASHIFTRT][28] = SHIFT_LOOP;
+ shift_alg_si[H8_300H][SHIFT_ASHIFTRT][29] = SHIFT_LOOP;
+ shift_alg_si[H8_300H][SHIFT_ASHIFTRT][30] = SHIFT_LOOP;
/* H8S */
shift_alg_hi[H8_S][SHIFT_ASHIFTRT][14] = SHIFT_LOOP;
@@ -3830,6 +3833,10 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode,
}
else if (count == 15)
{
+ /* The basic idea here is to use the shift-by-16 idiom to make things
+ small and efficient. Of course, that loses one bit that we need,
+ so we stuff the bit into C, shift by 16, then rotate the bit
+ back in. */
switch (shift_type)
{
case SHIFT_ASHIFT:
@@ -3841,7 +3848,9 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode,
info->cc_special = OLD_CC_SET_ZNV;
goto end;
case SHIFT_ASHIFTRT:
- gcc_unreachable ();
+ info->special = "shll.w\t%f0\n\tmov.w\t%e0,%f0\n\texts.l\t%S0\n\trotxl.l\t%S0";
+ info->cc_special = OLD_CC_SET_ZNV;
+ goto end;
}
}
else if (count >= 16 && count <= 23)
@@ -3863,6 +3872,23 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode,
goto end;
}
}
+ else if (TARGET_H8300S && count == 27)
+ {
+ switch (shift_type)
+ {
+ case SHIFT_ASHIFT:
+ info->special = "sub.w\t%e0,%e0\n\trotr.l\t#2,%S0\n\trotr.l\t#2,%S0\n\trotr.l\t%S0\n\tsub.w\t%f0,%f0";
+ goto end;
+ case SHIFT_LSHIFTRT:
+ info->special = "sub.w\t%f0,%f0\n\trotl.l\t#2,%S0\n\trotl.l\t#2,%S0\n\trotl.l\t%S0\n\textu.l\t%S0";
+ goto end;
+ case SHIFT_ASHIFTRT:
+ info->remainder = count - 24;
+ info->special = "mov.w\t%e0,%f0\n\tmov.b\t%t0,%s0\n\texts.w\t%f0\n\texts.l\t%S0";
+ info->cc_special = OLD_CC_SET_ZNV;
+ goto end;
+ }
+ }
else if (count >= 24 && count <= 27)
{
info->remainder = count - 24;
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 1388968..95f9582 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -11256,7 +11256,7 @@
(match_operand:V16QI 2 "pshufb_truncv8hiv8qi_operand")]
UNSPEC_PSHUFB) 0)
(parallel [(const_int 0)])))]
- "TARGET_AVX512VL && ix86_pre_reload_split ()"
+ "TARGET_AVX512VL && TARGET_AVX512BW && ix86_pre_reload_split ()"
"#"
"&& 1"
[(const_int 0)]
diff --git a/gcc/config/mips/mips-msa.md b/gcc/config/mips/mips-msa.md
index 3a67f25..d3b27d1 100644
--- a/gcc/config/mips/mips-msa.md
+++ b/gcc/config/mips/mips-msa.md
@@ -870,9 +870,12 @@
(match_operand:IMSA 1 "register_operand" "f,f")
(match_operand:IMSA 2 "reg_or_vector_same_uimm6_operand" "f,Uuv6")))]
"ISA_HAS_MSA"
- "@
- srl.<msafmt>\t%w0,%w1,%w2
- srli.<msafmt>\t%w0,%w1,%E2"
+{
+ if (which_alternative == 0)
+ return "srl.<msafmt>\t%w0,%w1,%w2";
+
+ return mips_msa_output_shift_immediate("srli.<msafmt>\t%w0,%w1,%E2", operands);
+}
[(set_attr "type" "simd_shift")
(set_attr "mode" "<MODE>")])
@@ -882,9 +885,12 @@
(match_operand:IMSA 1 "register_operand" "f,f")
(match_operand:IMSA 2 "reg_or_vector_same_uimm6_operand" "f,Uuv6")))]
"ISA_HAS_MSA"
- "@
- sra.<msafmt>\t%w0,%w1,%w2
- srai.<msafmt>\t%w0,%w1,%E2"
+{
+ if (which_alternative == 0)
+ return "sra.<msafmt>\t%w0,%w1,%w2";
+
+ return mips_msa_output_shift_immediate("srai.<msafmt>\t%w0,%w1,%E2", operands);
+}
[(set_attr "type" "simd_shift")
(set_attr "mode" "<MODE>")])
@@ -894,9 +900,12 @@
(match_operand:IMSA 1 "register_operand" "f,f")
(match_operand:IMSA 2 "reg_or_vector_same_uimm6_operand" "f,Uuv6")))]
"ISA_HAS_MSA"
- "@
- sll.<msafmt>\t%w0,%w1,%w2
- slli.<msafmt>\t%w0,%w1,%E2"
+{
+ if (which_alternative == 0)
+ return "sll.<msafmt>\t%w0,%w1,%w2";
+
+ return mips_msa_output_shift_immediate("slli.<msafmt>\t%w0,%w1,%E2", operands);
+}
[(set_attr "type" "simd_shift")
(set_attr "mode" "<MODE>")])
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index a5e4151..8d97eb3 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -317,6 +317,7 @@ extern const char *mips_output_sync_loop (rtx_insn *, rtx *);
extern unsigned int mips_sync_loop_insns (rtx_insn *, rtx *);
extern const char *mips_output_division (const char *, rtx *);
extern const char *mips_msa_output_division (const char *, rtx *);
+extern const char *mips_msa_output_shift_immediate (const char *, rtx *);
extern const char *mips_output_probe_stack_range (rtx, rtx);
extern bool mips_hard_regno_rename_ok (unsigned int, unsigned int);
extern bool mips_linked_madd_p (rtx_insn *, rtx_insn *);
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 89d1be6..2f7ffe8 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -9306,42 +9306,6 @@ mips_select_rtx_section (machine_mode mode, rtx x,
return default_elf_select_rtx_section (mode, x, align);
}
-/* Implement TARGET_ASM_FUNCTION_RODATA_SECTION.
-
- The complication here is that, with the combination TARGET_ABICALLS
- && !TARGET_ABSOLUTE_ABICALLS && !TARGET_GPWORD, jump tables will use
- absolute addresses, and should therefore not be included in the
- read-only part of a DSO. Handle such cases by selecting a normal
- data section instead of a read-only one. The logic apes that in
- default_function_rodata_section. */
-
-static section *
-mips_function_rodata_section (tree decl, bool)
-{
- if (!TARGET_ABICALLS || TARGET_ABSOLUTE_ABICALLS || TARGET_GPWORD)
- return default_function_rodata_section (decl, false);
-
- if (decl && DECL_SECTION_NAME (decl))
- {
- const char *name = DECL_SECTION_NAME (decl);
- if (DECL_COMDAT_GROUP (decl) && startswith (name, ".gnu.linkonce.t."))
- {
- char *rname = ASTRDUP (name);
- rname[14] = 'd';
- return get_section (rname, SECTION_LINKONCE | SECTION_WRITE, decl);
- }
- else if (flag_function_sections
- && flag_data_sections
- && startswith (name, ".text."))
- {
- char *rname = ASTRDUP (name);
- memcpy (rname + 1, "data", 4);
- return get_section (rname, SECTION_WRITE, decl);
- }
- }
- return data_section;
-}
-
/* Implement TARGET_IN_SMALL_DATA_P. */
static bool
@@ -14495,6 +14459,27 @@ mips_msa_output_division (const char *division, rtx *operands)
}
return s;
}
+
+/* Return the assembly code for MSA immediate shift instructions,
+ which has the operands given by OPERANDS. Truncate the shift amount
+ to make GAS happy. */
+
+const char *
+mips_msa_output_shift_immediate (const char *shift, rtx *operands)
+{
+ rtx amount = operands[2];
+ machine_mode mode = amount->mode;
+
+ unsigned val = UINTVAL (CONST_VECTOR_ELT (amount, 0));
+ val &= GET_MODE_UNIT_BITSIZE (mode) - 1;
+ if (!val)
+ return "";
+
+ rtx c = gen_int_mode (val, GET_MODE_INNER (mode));
+ operands[2] = gen_const_vec_duplicate (mode, c);
+
+ return shift;
+}
/* Return true if destination of IN_INSN is used as add source in
OUT_INSN. Both IN_INSN and OUT_INSN are of type fmadd. Example:
@@ -22606,8 +22591,6 @@ mips_asm_file_end (void)
#define TARGET_ASM_FUNCTION_EPILOGUE mips_output_function_epilogue
#undef TARGET_ASM_SELECT_RTX_SECTION
#define TARGET_ASM_SELECT_RTX_SECTION mips_select_rtx_section
-#undef TARGET_ASM_FUNCTION_RODATA_SECTION
-#define TARGET_ASM_FUNCTION_RODATA_SECTION mips_function_rodata_section
#undef TARGET_SCHED_INIT
#define TARGET_SCHED_INIT mips_sched_init
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 46194ba..0614302 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -9080,9 +9080,7 @@ pa_asm_output_aligned_common (FILE *stream,
max_common_align = TARGET_64BIT ? 128 : (size >= 4096 ? 256 : 64);
if (align > max_common_align)
{
- warning (0, "alignment (%u) for %s exceeds maximum alignment "
- "for global common data. Using %u",
- align / BITS_PER_UNIT, name, max_common_align / BITS_PER_UNIT);
+ /* Alignment exceeds maximum alignment for global common data. */
align = max_common_align;
}
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index fd86c300..2c73dde 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -175,16 +175,10 @@
UNSPEC_VPEXTD
UNSPEC_VCLRLB
UNSPEC_VCLRRB
- UNSPEC_XXEVAL
UNSPEC_VSTRIR
UNSPEC_VSTRIL
UNSPEC_SLDB
UNSPEC_SRDB
- UNSPEC_XXSPLTIW
- UNSPEC_XXSPLTID
- UNSPEC_XXSPLTI32DX
- UNSPEC_XXBLEND
- UNSPEC_XXPERMX
])
(define_c_enum "unspecv"
@@ -225,21 +219,6 @@
(KF "FLOAT128_VECTOR_P (KFmode)")
(TF "FLOAT128_VECTOR_P (TFmode)")])
-;; Like VM2, just do char, short, int, long, float and double
-(define_mode_iterator VM3 [V4SI
- V8HI
- V16QI
- V4SF
- V2DF
- V2DI])
-
-(define_mode_attr VM3_char [(V2DI "d")
- (V4SI "w")
- (V8HI "h")
- (V16QI "b")
- (V2DF "d")
- (V4SF "w")])
-
;; Map the Vector convert single precision to double precision for integer
;; versus floating point
(define_mode_attr VS_sxwsp [(V4SI "sxw") (V4SF "sp")])
@@ -859,170 +838,6 @@
"vs<SLDB_lr>dbi %0,%1,%2,%3"
[(set_attr "type" "vecsimple")])
-(define_insn "xxspltiw_v4si"
- [(set (match_operand:V4SI 0 "register_operand" "=wa")
- (unspec:V4SI [(match_operand:SI 1 "s32bit_cint_operand" "n")]
- UNSPEC_XXSPLTIW))]
- "TARGET_POWER10"
- "xxspltiw %x0,%1"
- [(set_attr "type" "vecsimple")
- (set_attr "prefixed" "yes")])
-
-(define_expand "xxspltiw_v4sf"
- [(set (match_operand:V4SF 0 "register_operand" "=wa")
- (unspec:V4SF [(match_operand:SF 1 "const_double_operand" "n")]
- UNSPEC_XXSPLTIW))]
- "TARGET_POWER10"
-{
- long value = rs6000_const_f32_to_i32 (operands[1]);
- emit_insn (gen_xxspltiw_v4sf_inst (operands[0], GEN_INT (value)));
- DONE;
-})
-
-(define_insn "xxspltiw_v4sf_inst"
- [(set (match_operand:V4SF 0 "register_operand" "=wa")
- (unspec:V4SF [(match_operand:SI 1 "c32bit_cint_operand" "n")]
- UNSPEC_XXSPLTIW))]
- "TARGET_POWER10"
- "xxspltiw %x0,%1"
- [(set_attr "type" "vecsimple")
- (set_attr "prefixed" "yes")])
-
-(define_expand "xxspltidp_v2df"
- [(set (match_operand:V2DF 0 "register_operand" )
- (unspec:V2DF [(match_operand:SF 1 "const_double_operand")]
- UNSPEC_XXSPLTID))]
- "TARGET_POWER10"
-{
- long value = rs6000_const_f32_to_i32 (operands[1]);
- rs6000_emit_xxspltidp_v2df (operands[0], value);
- DONE;
-})
-
-(define_insn "xxspltidp_v2df_inst"
- [(set (match_operand:V2DF 0 "register_operand" "=wa")
- (unspec:V2DF [(match_operand:SI 1 "c32bit_cint_operand" "n")]
- UNSPEC_XXSPLTID))]
- "TARGET_POWER10"
- "xxspltidp %x0,%1"
- [(set_attr "type" "vecsimple")
- (set_attr "prefixed" "yes")])
-
-(define_expand "xxsplti32dx_v4si"
- [(set (match_operand:V4SI 0 "register_operand" "=wa")
- (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "0")
- (match_operand:QI 2 "u1bit_cint_operand" "n")
- (match_operand:SI 3 "s32bit_cint_operand" "n")]
- UNSPEC_XXSPLTI32DX))]
- "TARGET_POWER10"
-{
- int index = INTVAL (operands[2]);
-
- if (!BYTES_BIG_ENDIAN)
- index = 1 - index;
-
- emit_insn (gen_xxsplti32dx_v4si_inst (operands[0], operands[1],
- GEN_INT (index), operands[3]));
- DONE;
-}
- [(set_attr "type" "vecsimple")])
-
-(define_insn "xxsplti32dx_v4si_inst"
- [(set (match_operand:V4SI 0 "register_operand" "=wa")
- (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "0")
- (match_operand:QI 2 "u1bit_cint_operand" "n")
- (match_operand:SI 3 "s32bit_cint_operand" "n")]
- UNSPEC_XXSPLTI32DX))]
- "TARGET_POWER10"
- "xxsplti32dx %x0,%2,%3"
- [(set_attr "type" "vecsimple")
- (set_attr "prefixed" "yes")])
-
-(define_expand "xxsplti32dx_v4sf"
- [(set (match_operand:V4SF 0 "register_operand" "=wa")
- (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0")
- (match_operand:QI 2 "u1bit_cint_operand" "n")
- (match_operand:SF 3 "const_double_operand" "n")]
- UNSPEC_XXSPLTI32DX))]
- "TARGET_POWER10"
-{
- int index = INTVAL (operands[2]);
- long value = rs6000_const_f32_to_i32 (operands[3]);
- if (!BYTES_BIG_ENDIAN)
- index = 1 - index;
-
- emit_insn (gen_xxsplti32dx_v4sf_inst (operands[0], operands[1],
- GEN_INT (index), GEN_INT (value)));
- DONE;
-})
-
-(define_insn "xxsplti32dx_v4sf_inst"
- [(set (match_operand:V4SF 0 "register_operand" "=wa")
- (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0")
- (match_operand:QI 2 "u1bit_cint_operand" "n")
- (match_operand:SI 3 "s32bit_cint_operand" "n")]
- UNSPEC_XXSPLTI32DX))]
- "TARGET_POWER10"
- "xxsplti32dx %x0,%2,%3"
- [(set_attr "type" "vecsimple")
- (set_attr "prefixed" "yes")])
-
-(define_insn "xxblend_<mode>"
- [(set (match_operand:VM3 0 "register_operand" "=wa")
- (unspec:VM3 [(match_operand:VM3 1 "register_operand" "wa")
- (match_operand:VM3 2 "register_operand" "wa")
- (match_operand:VM3 3 "register_operand" "wa")]
- UNSPEC_XXBLEND))]
- "TARGET_POWER10"
- "xxblendv<VM3_char> %x0,%x1,%x2,%x3"
- [(set_attr "type" "vecsimple")
- (set_attr "prefixed" "yes")])
-
-(define_expand "xxpermx"
- [(set (match_operand:V2DI 0 "register_operand" "+wa")
- (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "wa")
- (match_operand:V2DI 2 "register_operand" "wa")
- (match_operand:V16QI 3 "register_operand" "wa")
- (match_operand:QI 4 "u8bit_cint_operand" "n")]
- UNSPEC_XXPERMX))]
- "TARGET_POWER10"
-{
- if (BYTES_BIG_ENDIAN)
- emit_insn (gen_xxpermx_inst (operands[0], operands[1],
- operands[2], operands[3],
- operands[4]));
- else
- {
- /* Reverse value of byte element indexes by XORing with 0xFF.
- Reverse the 32-byte section identifier match by subracting bits [0:2]
- of elemet from 7. */
- int value = INTVAL (operands[4]);
- rtx vreg = gen_reg_rtx (V16QImode);
-
- emit_insn (gen_xxspltib_v16qi (vreg, GEN_INT (-1)));
- emit_insn (gen_xorv16qi3 (operands[3], operands[3], vreg));
- value = 7 - value;
- emit_insn (gen_xxpermx_inst (operands[0], operands[2],
- operands[1], operands[3],
- GEN_INT (value)));
- }
-
- DONE;
-}
- [(set_attr "type" "vecsimple")])
-
-(define_insn "xxpermx_inst"
- [(set (match_operand:V2DI 0 "register_operand" "+v")
- (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "v")
- (match_operand:V2DI 2 "register_operand" "v")
- (match_operand:V16QI 3 "register_operand" "v")
- (match_operand:QI 4 "u3bit_cint_operand" "n")]
- UNSPEC_XXPERMX))]
- "TARGET_POWER10"
- "xxpermx %x0,%x1,%x2,%x3,%4"
- [(set_attr "type" "vecsimple")
- (set_attr "prefixed" "yes")])
-
(define_expand "vstrir_<mode>"
[(set (match_operand:VIshort 0 "altivec_register_operand")
(unspec:VIshort [(match_operand:VIshort 1 "altivec_register_operand")]
@@ -3873,18 +3688,6 @@
[(set_attr "type" "vecperm")
(set_attr "isa" "p9v,*")])
-(define_insn "xxeval"
- [(set (match_operand:V2DI 0 "register_operand" "=wa")
- (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "wa")
- (match_operand:V2DI 2 "register_operand" "wa")
- (match_operand:V2DI 3 "register_operand" "wa")
- (match_operand:QI 4 "u8bit_cint_operand" "n")]
- UNSPEC_XXEVAL))]
- "TARGET_POWER10"
- "xxeval %0,%1,%2,%3,%4"
- [(set_attr "type" "vecsimple")
- (set_attr "prefixed" "yes")])
-
(define_expand "vec_unpacku_hi_v16qi"
[(set (match_operand:V8HI 0 "register_operand" "=v")
(unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")]
diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 8b16d65..3c3108a 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -11919,6 +11919,9 @@ rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi)
tree offset = gimple_call_arg (stmt, 0);
tree ptr = gimple_call_arg (stmt, 1);
tree lhs = gimple_call_lhs (stmt);
+ if (TREE_TYPE (TREE_TYPE (ptr)) != vector_pair_type_node)
+ ptr = build1 (VIEW_CONVERT_EXPR,
+ build_pointer_type (vector_pair_type_node), ptr);
tree mem = build_simple_mem_ref (build2 (POINTER_PLUS_EXPR,
TREE_TYPE (ptr), ptr, offset));
gimplify_assign (lhs, mem, &new_seq);
@@ -11932,6 +11935,9 @@ rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi)
tree src = gimple_call_arg (stmt, 0);
tree offset = gimple_call_arg (stmt, 1);
tree ptr = gimple_call_arg (stmt, 2);
+ if (TREE_TYPE (TREE_TYPE (ptr)) != vector_pair_type_node)
+ ptr = build1 (VIEW_CONVERT_EXPR,
+ build_pointer_type (vector_pair_type_node), ptr);
tree mem = build_simple_mem_ref (build2 (POINTER_PLUS_EXPR,
TREE_TYPE (ptr), ptr, offset));
gimplify_assign (mem, src, &new_seq);
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index 441735d..e4ca6e9 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -372,6 +372,12 @@
UNSPEC_REPLACE_UN
UNSPEC_VDIVES
UNSPEC_VDIVEU
+ UNSPEC_XXEVAL
+ UNSPEC_XXSPLTIW
+ UNSPEC_XXSPLTID
+ UNSPEC_XXSPLTI32DX
+ UNSPEC_XXBLEND
+ UNSPEC_XXPERMX
])
(define_int_iterator XVCVBF16 [UNSPEC_VSX_XVCVSPBF16
@@ -392,6 +398,22 @@
(define_mode_attr REPLACE_ELT_max [(V4SI "12") (V4SF "12")
(V2DI "8") (V2DF "8")])
+;; Like VM2 in altivec.md, just do char, short, int, long, float and double
+(define_mode_iterator VM3 [V4SI
+ V8HI
+ V16QI
+ V4SF
+ V2DF
+ V2DI])
+
+(define_mode_attr VM3_char [(V2DI "d")
+ (V4SI "w")
+ (V8HI "h")
+ (V16QI "b")
+ (V2DF "d")
+ (V4SF "w")])
+
+
;; VSX moves
;; The patterns for LE permuted loads and stores come before the general
@@ -6383,3 +6405,187 @@
"TARGET_POWER10"
"vmulld %0,%1,%2"
[(set_attr "type" "veccomplex")])
+
+
+;; XXSPLTIW built-in function support
+(define_insn "xxspltiw_v4si"
+ [(set (match_operand:V4SI 0 "register_operand" "=wa")
+ (unspec:V4SI [(match_operand:SI 1 "s32bit_cint_operand" "n")]
+ UNSPEC_XXSPLTIW))]
+ "TARGET_POWER10"
+ "xxspltiw %x0,%1"
+ [(set_attr "type" "vecsimple")
+ (set_attr "prefixed" "yes")])
+
+(define_expand "xxspltiw_v4sf"
+ [(set (match_operand:V4SF 0 "register_operand" "=wa")
+ (unspec:V4SF [(match_operand:SF 1 "const_double_operand" "n")]
+ UNSPEC_XXSPLTIW))]
+ "TARGET_POWER10"
+{
+ long value = rs6000_const_f32_to_i32 (operands[1]);
+ emit_insn (gen_xxspltiw_v4sf_inst (operands[0], GEN_INT (value)));
+ DONE;
+})
+
+(define_insn "xxspltiw_v4sf_inst"
+ [(set (match_operand:V4SF 0 "register_operand" "=wa")
+ (unspec:V4SF [(match_operand:SI 1 "c32bit_cint_operand" "n")]
+ UNSPEC_XXSPLTIW))]
+ "TARGET_POWER10"
+ "xxspltiw %x0,%1"
+ [(set_attr "type" "vecsimple")
+ (set_attr "prefixed" "yes")])
+
+;; XXSPLTIDP built-in function support
+(define_expand "xxspltidp_v2df"
+ [(set (match_operand:V2DF 0 "register_operand" )
+ (unspec:V2DF [(match_operand:SF 1 "const_double_operand")]
+ UNSPEC_XXSPLTID))]
+ "TARGET_POWER10"
+{
+ long value = rs6000_const_f32_to_i32 (operands[1]);
+ rs6000_emit_xxspltidp_v2df (operands[0], value);
+ DONE;
+})
+
+(define_insn "xxspltidp_v2df_inst"
+ [(set (match_operand:V2DF 0 "register_operand" "=wa")
+ (unspec:V2DF [(match_operand:SI 1 "c32bit_cint_operand" "n")]
+ UNSPEC_XXSPLTID))]
+ "TARGET_POWER10"
+ "xxspltidp %x0,%1"
+ [(set_attr "type" "vecsimple")
+ (set_attr "prefixed" "yes")])
+
+;; XXSPLTI32DX built-in function support
+(define_expand "xxsplti32dx_v4si"
+ [(set (match_operand:V4SI 0 "register_operand" "=wa")
+ (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "0")
+ (match_operand:QI 2 "u1bit_cint_operand" "n")
+ (match_operand:SI 3 "s32bit_cint_operand" "n")]
+ UNSPEC_XXSPLTI32DX))]
+ "TARGET_POWER10"
+{
+ int index = INTVAL (operands[2]);
+
+ if (!BYTES_BIG_ENDIAN)
+ index = 1 - index;
+
+ emit_insn (gen_xxsplti32dx_v4si_inst (operands[0], operands[1],
+ GEN_INT (index), operands[3]));
+ DONE;
+}
+ [(set_attr "type" "vecsimple")])
+
+(define_insn "xxsplti32dx_v4si_inst"
+ [(set (match_operand:V4SI 0 "register_operand" "=wa")
+ (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "0")
+ (match_operand:QI 2 "u1bit_cint_operand" "n")
+ (match_operand:SI 3 "s32bit_cint_operand" "n")]
+ UNSPEC_XXSPLTI32DX))]
+ "TARGET_POWER10"
+ "xxsplti32dx %x0,%2,%3"
+ [(set_attr "type" "vecsimple")
+ (set_attr "prefixed" "yes")])
+
+(define_expand "xxsplti32dx_v4sf"
+ [(set (match_operand:V4SF 0 "register_operand" "=wa")
+ (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0")
+ (match_operand:QI 2 "u1bit_cint_operand" "n")
+ (match_operand:SF 3 "const_double_operand" "n")]
+ UNSPEC_XXSPLTI32DX))]
+ "TARGET_POWER10"
+{
+ int index = INTVAL (operands[2]);
+ long value = rs6000_const_f32_to_i32 (operands[3]);
+ if (!BYTES_BIG_ENDIAN)
+ index = 1 - index;
+
+ emit_insn (gen_xxsplti32dx_v4sf_inst (operands[0], operands[1],
+ GEN_INT (index), GEN_INT (value)));
+ DONE;
+})
+
+(define_insn "xxsplti32dx_v4sf_inst"
+ [(set (match_operand:V4SF 0 "register_operand" "=wa")
+ (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "0")
+ (match_operand:QI 2 "u1bit_cint_operand" "n")
+ (match_operand:SI 3 "s32bit_cint_operand" "n")]
+ UNSPEC_XXSPLTI32DX))]
+ "TARGET_POWER10"
+ "xxsplti32dx %x0,%2,%3"
+ [(set_attr "type" "vecsimple")
+ (set_attr "prefixed" "yes")])
+
+;; XXBLEND built-in function support
+(define_insn "xxblend_<mode>"
+ [(set (match_operand:VM3 0 "register_operand" "=wa")
+ (unspec:VM3 [(match_operand:VM3 1 "register_operand" "wa")
+ (match_operand:VM3 2 "register_operand" "wa")
+ (match_operand:VM3 3 "register_operand" "wa")]
+ UNSPEC_XXBLEND))]
+ "TARGET_POWER10"
+ "xxblendv<VM3_char> %x0,%x1,%x2,%x3"
+ [(set_attr "type" "vecsimple")
+ (set_attr "prefixed" "yes")])
+
+;; XXPERMX built-in function support
+(define_expand "xxpermx"
+ [(set (match_operand:V2DI 0 "register_operand" "+wa")
+ (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "wa")
+ (match_operand:V2DI 2 "register_operand" "wa")
+ (match_operand:V16QI 3 "register_operand" "wa")
+ (match_operand:QI 4 "u8bit_cint_operand" "n")]
+ UNSPEC_XXPERMX))]
+ "TARGET_POWER10"
+{
+ if (BYTES_BIG_ENDIAN)
+ emit_insn (gen_xxpermx_inst (operands[0], operands[1],
+ operands[2], operands[3],
+ operands[4]));
+ else
+ {
+ /* Reverse value of byte element indexes by XORing with 0xFF.
+ Reverse the 32-byte section identifier match by subracting bits [0:2]
+ of elemet from 7. */
+ int value = INTVAL (operands[4]);
+ rtx vreg = gen_reg_rtx (V16QImode);
+
+ emit_insn (gen_xxspltib_v16qi (vreg, GEN_INT (-1)));
+ emit_insn (gen_xorv16qi3 (operands[3], operands[3], vreg));
+ value = 7 - value;
+ emit_insn (gen_xxpermx_inst (operands[0], operands[2],
+ operands[1], operands[3],
+ GEN_INT (value)));
+ }
+
+ DONE;
+}
+ [(set_attr "type" "vecsimple")])
+
+(define_insn "xxpermx_inst"
+ [(set (match_operand:V2DI 0 "register_operand" "+v")
+ (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "v")
+ (match_operand:V2DI 2 "register_operand" "v")
+ (match_operand:V16QI 3 "register_operand" "v")
+ (match_operand:QI 4 "u3bit_cint_operand" "n")]
+ UNSPEC_XXPERMX))]
+ "TARGET_POWER10"
+ "xxpermx %x0,%x1,%x2,%x3,%4"
+ [(set_attr "type" "vecsimple")
+ (set_attr "prefixed" "yes")])
+
+;; XXEVAL built-in function support
+(define_insn "xxeval"
+ [(set (match_operand:V2DI 0 "register_operand" "=wa")
+ (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "wa")
+ (match_operand:V2DI 2 "register_operand" "wa")
+ (match_operand:V2DI 3 "register_operand" "wa")
+ (match_operand:QI 4 "u8bit_cint_operand" "n")]
+ UNSPEC_XXEVAL))]
+ "TARGET_POWER10"
+ "xxeval %0,%1,%2,%3,%4"
+ [(set_attr "type" "vecsimple")
+ (set_attr "prefixed" "yes")])
+
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index 386f9f5..5162268 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -694,9 +694,6 @@ typedef enum
if ((LOG) != 0) \
fprintf (FILE, "\t.align %d\n", (LOG))
-/* We don't have to worry about dbx compatibility for the v850. */
-#define DEFAULT_GDB_EXTENSIONS 1
-
/* Use dwarf2 debugging info by default. */
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
diff --git a/gcc/configure b/gcc/configure
index a2d1003..500e3f6 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -22842,8 +22842,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# If build != host, and we aren't building gas in-tree, we identify a
# build->target assembler and hope that it will have the same features
# as the host->target assembler we'll be using.
-gcc_cv_gas_major_version=
-gcc_cv_gas_minor_version=
gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
if ${gcc_cv_as+:} false; then :
@@ -22913,52 +22911,6 @@ case "$ORIGINAL_AS_FOR_TARGET" in
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what assembler to use" >&5
-$as_echo_n "checking what assembler to use... " >&6; }
-if test "$gcc_cv_as" = ../gas/as-new$build_exeext; then
- # Single tree build which includes gas. We want to prefer it
- # over whatever linker top-level may have detected, since
- # we'll use what we're building after installation anyway.
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: newly built gas" >&5
-$as_echo "newly built gas" >&6; }
- in_tree_gas=yes
- gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
-for f in $gcc_cv_as_bfd_srcdir/configure \
- $gcc_cv_as_gas_srcdir/configure \
- $gcc_cv_as_gas_srcdir/configure.ac \
- $gcc_cv_as_gas_srcdir/Makefile.in ; do
- gcc_cv_gas_version=`sed -n -e 's/^[ ]*VERSION=[^0-9A-Za-z_]*\([0-9]*\.[0-9]*.*\)/VERSION=\1/p' < $f`
- if test x$gcc_cv_gas_version != x; then
- break
- fi
-done
-case $gcc_cv_gas_version in
- VERSION=[0-9]*) ;;
- *) as_fn_error $? "cannot find version of in-tree assembler" "$LINENO" 5;;
-esac
-gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
-gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
-gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.[0-9]*\.\([0-9]*\)"`
-case $gcc_cv_gas_patch_version in
- "") gcc_cv_gas_patch_version="0" ;;
-esac
-gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \
- + $gcc_cv_gas_minor_version \) \* 1000 \
- + $gcc_cv_gas_patch_version`
-
- in_tree_gas_is_elf=no
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
- || (grep 'obj_format = multi' ../gas/Makefile \
- && grep 'extra_objects =.* obj-elf' ../gas/Makefile) > /dev/null
- then
- in_tree_gas_is_elf=yes
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as" >&5
-$as_echo "$gcc_cv_as" >&6; }
- in_tree_gas=no
-fi
-
default_ld=
# Check whether --enable-ld was given.
if test "${enable_ld+set}" = set; then :
@@ -23582,11 +23534,7 @@ if ${gcc_cv_as_balign_and_p2align+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_balign_and_p2align=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 6 \) \* 1000 + 0`
- then gcc_cv_as_balign_and_p2align=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.balign 4
.p2align 2' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
@@ -23619,11 +23567,7 @@ if ${gcc_cv_as_max_skip_p2align+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_max_skip_p2align=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 8 \) \* 1000 + 0`
- then gcc_cv_as_max_skip_p2align=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.p2align 4,,7' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -23655,11 +23599,7 @@ if ${gcc_cv_as_literal16+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_literal16=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 8 \) \* 1000 + 0`
- then gcc_cv_as_literal16=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.literal16' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -23691,12 +23631,7 @@ if ${gcc_cv_as_subsection_m1+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_subsection_m1=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 9 \) \* 1000 + 0`
- then gcc_cv_as_subsection_m1=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo 'conftest_label1: .word 0
.subsection -1
conftest_label2: .word 0
@@ -23739,11 +23674,7 @@ if ${gcc_cv_as_weak+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_weak=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 2 \) \* 1000 + 0`
- then gcc_cv_as_weak=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .weak foobar' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -23775,11 +23706,7 @@ if ${gcc_cv_as_weakref+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_weakref=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 17 \) \* 1000 + 0`
- then gcc_cv_as_weakref=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .weakref foobar, barfnot' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -23811,11 +23738,7 @@ if ${gcc_cv_as_nsubspa_comdat+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_nsubspa_comdat=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 15 \) \* 1000 + 91`
- then gcc_cv_as_nsubspa_comdat=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .SPACE $TEXT$
.NSUBSPA $CODE$,COMDAT' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
@@ -23864,12 +23787,7 @@ if ${gcc_cv_as_hidden+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_hidden=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 13 \) \* 1000 + 0`
- then gcc_cv_as_hidden=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -24322,12 +24240,7 @@ if ${gcc_cv_as_leb128+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_leb128=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
- then gcc_cv_as_leb128=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .data
.uleb128 L2 - L1
L1:
@@ -24612,12 +24525,7 @@ if ${gcc_cv_as_eh_frame+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_eh_frame=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 12 \) \* 1000 + 0`
- then gcc_cv_as_eh_frame=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .text
.LFB1:
.4byte 0
@@ -24716,11 +24624,7 @@ if ${gcc_cv_as_section_exclude_e+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_section_exclude_e=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 22 \) \* 1000 + 51`
- then gcc_cv_as_section_exclude_e=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.section foo1,"e"
.byte 0,0,0,0' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags --fatal-warnings -o conftest.o conftest.s >&5'
@@ -24807,12 +24711,7 @@ if ${gcc_cv_as_shf_gnu_retain+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_shf_gnu_retain=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0`
- then gcc_cv_as_shf_gnu_retain=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.section .foo,"awR",%progbits
.byte 0' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags --fatal-warnings -o conftest.o conftest.s >&5'
@@ -24858,11 +24757,7 @@ if ${gcc_cv_as_section_link_order+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_section_link_order=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 35 \) \* 1000 + 0`
- then gcc_cv_as_section_link_order=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.section .foo,"a"
.byte 0
.section __patchable_function_entries,"awo",%progbits,.foo
@@ -24900,12 +24795,7 @@ if ${gcc_cv_as_shf_merge+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_shf_merge=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 12 \) \* 1000 + 0`
- then gcc_cv_as_shf_merge=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.section .rodata.str, "aMS", @progbits, 1' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags --fatal-warnings -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -24933,12 +24823,7 @@ if ${gcc_cv_as_shf_merge+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_shf_merge=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 12 \) \* 1000 + 0`
- then gcc_cv_as_shf_merge=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.section .rodata.str, "aMS", %progbits, 1' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags --fatal-warnings -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -25021,12 +24906,7 @@ if ${gcc_cv_as_comdat_group+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_comdat_group=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 0`
- then gcc_cv_as_comdat_group=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.section .text,"axG",@progbits,.foo,comdat' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags --fatal-warnings -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -25057,12 +24937,7 @@ if ${gcc_cv_as_comdat_group_percent+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_comdat_group_percent=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 0`
- then gcc_cv_as_comdat_group_percent=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.section .text,"axG",%progbits,.foo,comdat' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags --fatal-warnings -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -25239,11 +25114,7 @@ if ${gcc_cv_as_is_stmt+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_is_stmt=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 92`
- then gcc_cv_as_is_stmt=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .text
.file 1 "conf.c"
.loc 1 1 0 is_stmt 1' > conftest.s
@@ -25277,11 +25148,7 @@ if ${gcc_cv_as_discriminator+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_discriminator=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 51`
- then gcc_cv_as_discriminator=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .text
.file 1 "conf.c"
.loc 1 1 0 discriminator 1' > conftest.s
@@ -25324,8 +25191,6 @@ fi
# Thread-local storage - the check is heavily parameterized.
conftest_s=
-tls_first_major=
-tls_first_minor=
tls_as_opt=
case "$target" in
alpha*-*-*)
@@ -25347,15 +25212,11 @@ foo: .long 25
ldah $2,foo($29) !tprelhi
lda $3,foo($2) !tprello
lda $4,foo($29) !tprel'
- tls_first_major=2
- tls_first_minor=13
tls_as_opt=--fatal-warnings
;;
arc*-*-*)
conftest_s='
add_s r0,r0, @foo@tpoff'
- tls_first_major=2
- tls_first_minor=23
;;
cris-*-*|crisv32-*-*)
conftest_s='
@@ -25364,8 +25225,6 @@ x: .long 25
.text
move.d x:IE,$r10
nop'
- tls_first_major=2
- tls_first_minor=20
tls_as_opt=--fatal-warnings
;;
frv*-*-*)
@@ -25374,8 +25233,6 @@ x: .long 25
x: .long 25
.text
call #gettlsoff(x)'
- tls_first_major=2
- tls_first_minor=14
;;
hppa*-*-linux*)
conftest_s='
@@ -25402,8 +25259,6 @@ foo: .long 25
mfctl %cr27,%t1
addil LR%foo-$tls_leoff$,%t1
ldo RR%foo-$tls_leoff$(%r1),%t2'
- tls_first_major=2
- tls_first_minor=15
tls_as_opt=--fatal-warnings
;;
arm*-*-*)
@@ -25416,8 +25271,6 @@ foo: .long 25
.word foo(tlsgd)
.word foo(tlsldm)
.word foo(tlsldo)'
- tls_first_major=2
- tls_first_minor=17
;;
i[34567]86-*-* | x86_64-*-*)
case "$target" in
@@ -25431,8 +25284,6 @@ foo: .long 25
if test x$on_solaris = xyes && test x$gas_flag = xno; then
conftest_s='
.section .tdata,"awt",@progbits'
- tls_first_major=0
- tls_first_minor=0
tls_section_flag=t
$as_echo "#define TLS_SECTION_ASM_FLAG 't'" >>confdefs.h
@@ -25440,8 +25291,6 @@ $as_echo "#define TLS_SECTION_ASM_FLAG 't'" >>confdefs.h
else
conftest_s='
.section ".tdata","awT",@progbits'
- tls_first_major=2
- tls_first_minor=14
tls_section_flag=T
tls_as_opt="--fatal-warnings"
fi
@@ -25500,8 +25349,6 @@ foo: data8 25
addl r20 = @tprel(foo#), gp
adds r22 = @tprel(foo#), r13
movl r24 = @tprel(foo#)'
- tls_first_major=2
- tls_first_minor=13
tls_as_opt=--fatal-warnings
;;
microblaze*-*-*)
@@ -25512,8 +25359,6 @@ x:
.text
addik r5,r20,x@TLSGD
addik r5,r20,x@TLSLDM'
- tls_first_major=2
- tls_first_minor=20
tls_as_opt='--fatal-warnings'
;;
mips*-*-*)
@@ -25529,8 +25374,6 @@ x:
lw $4, %gottprel(x)($28)
lui $4, %tprel_hi(x)
addiu $4, $4, %tprel_lo(x)'
- tls_first_major=2
- tls_first_minor=16
tls_as_opt='-32 --fatal-warnings'
;;
m68k-*-*)
@@ -25545,15 +25388,11 @@ foo:
move.l x@TLSLDO(%a5),%a0
move.l x@TLSIE(%a5),%a0
move.l x@TLSLE(%a5),%a0'
- tls_first_major=2
- tls_first_minor=19
tls_as_opt='--fatal-warnings'
;;
nios2-*-*)
conftest_s='
.section ".tdata","awT",@progbits'
- tls_first_major=2
- tls_first_minor=23
tls_as_opt="--fatal-warnings"
;;
aarch64*-*-*)
@@ -25565,8 +25404,6 @@ foo: .long 25
add x0, x0, #:tlsgd_lo12:x
bl __tls_get_addr
nop'
- tls_first_major=2
- tls_first_minor=20
tls_as_opt='--fatal-warnings'
;;
or1k*-*-*)
@@ -25577,8 +25414,6 @@ foo: .long 25
l.movhi r3, tpoffha(foo)
l.add r3, r3, r10
l.lwz r4, tpofflo(foo)(r3)'
- tls_first_major=2
- tls_first_minor=30
tls_as_opt=--fatal-warnings
;;
powerpc-ibm-aix*)
@@ -25596,8 +25431,6 @@ LC..1:
.csect a[TL],4
a:
.space 4'
- tls_first_major=0
- tls_first_minor=0
;;
powerpc64*-*-*)
conftest_s='
@@ -25629,8 +25462,6 @@ x3: .space 8
add 9,9,3
bl .__tls_get_addr
nop'
- tls_first_major=2
- tls_first_minor=14
tls_as_opt="-a64 --fatal-warnings"
;;
powerpc*-*-*)
@@ -25655,8 +25486,6 @@ x3: .space 4
addi 9,2,x1@tprel
addis 9,2,x2@tprel@ha
addi 9,9,x2@tprel@l'
- tls_first_major=2
- tls_first_minor=14
tls_as_opt="-a32 --fatal-warnings"
;;
riscv*-*-*)
@@ -25666,8 +25495,6 @@ x: .word 2
.text
la.tls.gd a0,x
call __tls_get_addr'
- tls_first_major=2
- tls_first_minor=21
tls_as_opt='--fatal-warnings'
;;
s390-*-*)
@@ -25685,8 +25512,6 @@ foo: .long 25
l %r1,0(%r1):tls_load:foo
bas %r14,0(%r1,%r13):tls_gdcall:foo
bas %r14,0(%r1,%r13):tls_ldcall:foo'
- tls_first_major=2
- tls_first_minor=14
tls_as_opt="-m31 --fatal-warnings"
;;
s390x-*-*)
@@ -25703,8 +25528,6 @@ foo: .long 25
larl %r1,foo@INDNTPOFF
brasl %r14,__tls_get_offset@PLT:tls_gdcall:foo
brasl %r14,__tls_get_offset@PLT:tls_ldcall:foo'
- tls_first_major=2
- tls_first_minor=14
tls_as_opt="-m64 -Aesame --fatal-warnings"
;;
sh-*-* | sh[123456789lbe]*-*-*)
@@ -25717,8 +25540,6 @@ foo: .long 25
.long foo@DTPOFF
.long foo@GOTTPOFF
.long foo@TPOFF'
- tls_first_major=2
- tls_first_minor=13
tls_as_opt=--fatal-warnings
;;
sparc*-*-*)
@@ -25733,13 +25554,9 @@ foo: .long 25
if test x$on_solaris = xyes && test x$gas_flag = xno; then
conftest_s='
.section ".tdata",#alloc,#write,#tls'
- tls_first_major=0
- tls_first_minor=0
else
conftest_s='
.section ".tdata","awT",@progbits'
- tls_first_major=2
- tls_first_minor=14
tls_as_opt="-32 --fatal-warnings"
fi
conftest_s="$conftest_s
@@ -25776,8 +25593,6 @@ foo: .long 25
addli r0, zero, tls_ie(foo)
auli r0, r0, tls_ie_ha16(foo)
addli r0, r0, tls_ie_lo16(foo)'
- tls_first_major=2
- tls_first_minor=22
tls_as_opt="--fatal-warnings"
;;
tilegx*-*-*)
@@ -25791,8 +25606,6 @@ foo: .long 25
jal __tls_get_addr
shl16insli r0, zero, hw1_last_tls_ie(foo)
shl16insli r0, r0, hw0_tls_ie(foo)'
- tls_first_major=2
- tls_first_minor=22
tls_as_opt="--fatal-warnings"
;;
xtensa*-*-*)
@@ -25803,8 +25616,6 @@ foo: .long 25
movi a8, foo@TLSFUNC
movi a10, foo@TLSARG
callx8.tls a8, foo@TLSCALL'
- tls_first_major=2
- tls_first_minor=19
;;
esac
set_have_as_tls=no
@@ -25812,7 +25623,7 @@ if test "x$enable_tls" = xno ; then
: # TLS explicitly disabled.
elif test "x$enable_tls" = xyes ; then
set_have_as_tls=yes # TLS explicitly enabled.
-elif test -z "$tls_first_major"; then
+elif test -z "$conftest_s"; then
: # If we don't have a check, assume no support.
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for thread-local storage support" >&5
@@ -25821,11 +25632,7 @@ if ${gcc_cv_as_tls+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_tls=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( $tls_first_major \* 1000 \) + $tls_first_minor \) \* 1000 + 0`
- then gcc_cv_as_tls=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags $tls_as_opt -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -26237,11 +26044,7 @@ if ${gcc_cv_as_alpha_explicit_relocs+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_alpha_explicit_relocs=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 12 \) \* 1000 + 0`
- then gcc_cv_as_alpha_explicit_relocs=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .set nomacro
.text
extbl $3, $2, $3 !lituse_bytoff!1
@@ -26284,11 +26087,7 @@ if ${gcc_cv_as_alpha_jsrdirect_relocs+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_alpha_jsrdirect_relocs=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 90`
- then gcc_cv_as_alpha_jsrdirect_relocs=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .set nomacro
.text
ldq $27, a($29) !literal!1
@@ -26485,11 +26284,7 @@ if ${gcc_cv_as_cris_no_mul_bug+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_cris_no_mul_bug=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 15 \) \* 1000 + 91`
- then gcc_cv_as_cris_no_mul_bug=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.text' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -no-mul-bug-abort -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -26964,11 +26759,7 @@ if ${gcc_cv_as_comm_has_align+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_comm_has_align=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 52`
- then gcc_cv_as_comm_has_align=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.comm foo,1,32' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -27001,11 +26792,7 @@ if ${gcc_cv_as_ix86_pe_secrel32+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_ix86_pe_secrel32=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 15 \) \* 1000 + 91`
- then gcc_cv_as_ix86_pe_secrel32=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.text
foo: nop
.data
@@ -27047,11 +26834,7 @@ if ${gcc_cv_as_section_has_align+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_section_has_align=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 20 \) \* 1000 + 1`
- then gcc_cv_as_section_has_align=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.section lto_test,"dr0"' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -fatal-warnings -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -27752,11 +27535,7 @@ if ${gcc_cv_as_ix86_gotoff_in_data+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_ix86_gotoff_in_data=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
- then gcc_cv_as_ix86_gotoff_in_data=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .text
.L0:
nop
@@ -27850,11 +27629,7 @@ if ${gcc_cv_as_ia64_ltoffx_ldxmov_relocs+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_ia64_ltoffx_ldxmov_relocs=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 14 \) \* 1000 + 0`
- then gcc_cv_as_ia64_ltoffx_ldxmov_relocs=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .text
addl r15 = @ltoffx(x#), gp
;;
@@ -27942,11 +27717,7 @@ if ${gcc_cv_as_powerpc_mfcrf+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_powerpc_mfcrf=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 14 \) \* 1000 + 0`
- then gcc_cv_as_powerpc_mfcrf=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -27991,11 +27762,7 @@ if ${gcc_cv_as_powerpc_rel16+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_powerpc_rel16=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 17 \) \* 1000 + 0`
- then gcc_cv_as_powerpc_rel16=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a32 -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28036,11 +27803,7 @@ if ${gcc_cv_as_powerpc_vsx+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_powerpc_vsx=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 2`
- then gcc_cv_as_powerpc_vsx=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a32 -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28072,11 +27835,7 @@ if ${gcc_cv_as_powerpc_gnu_attribute+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_powerpc_gnu_attribute=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 18 \) \* 1000 + 0`
- then gcc_cv_as_powerpc_gnu_attribute=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.gnu_attribute 4,1' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28108,11 +27867,7 @@ if ${gcc_cv_as_powerpc_entry_markers+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_powerpc_entry_markers=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 26 \) \* 1000 + 0`
- then gcc_cv_as_powerpc_entry_markers=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .reloc .,R_PPC64_ENTRY; nop' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a64 --fatal-warnings -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28144,11 +27899,7 @@ if ${gcc_cv_as_powerpc_pltseq_markers+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_powerpc_pltseq_markers=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 31 \) \* 1000 + 0`
- then gcc_cv_as_powerpc_pltseq_markers=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .reloc .,R_PPC_PLTSEQ; nop' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -a32 --fatal-warnings -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28182,11 +27933,7 @@ if ${gcc_cv_as_aix_ref+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_aix_ref=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 21 \) \* 1000 + 0`
- then gcc_cv_as_aix_ref=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .csect stuff[rw]
stuff:
.long 1
@@ -28223,11 +27970,7 @@ if ${gcc_cv_as_aix_dwloc+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_aix_dwloc=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 21 \) \* 1000 + 0`
- then gcc_cv_as_aix_dwloc=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .dwsect 0xA0000
Lframe..0:
.vbyte 4,Lframe..0
@@ -28266,11 +28009,7 @@ if ${gcc_cv_as_mips_explicit_relocs+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_mips_explicit_relocs=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 14 \) \* 1000 + 0`
- then gcc_cv_as_mips_explicit_relocs=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' lw $4,%gp_rel(foo)($4)' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28303,11 +28042,7 @@ if ${gcc_cv_as_mips_no_shared+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_mips_no_shared=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 0`
- then gcc_cv_as_mips_no_shared=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo 'nop' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -mno-shared -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28339,11 +28074,7 @@ if ${gcc_cv_as_mips_gnu_attribute+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_mips_gnu_attribute=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 18 \) \* 1000 + 0`
- then gcc_cv_as_mips_gnu_attribute=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.gnu_attribute 4,1' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28444,11 +28175,7 @@ if ${gcc_cv_as_mips_dtprelword+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_mips_dtprelword=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 18 \) \* 1000 + 0`
- then gcc_cv_as_mips_dtprelword=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.section .tdata,"awT",@progbits
x:
.word 2
@@ -28652,11 +28379,7 @@ if ${gcc_cv_as_msp430_gnu_attribute+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_msp430_gnu_attribute=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 33 \) \* 1000 + 50`
- then gcc_cv_as_msp430_gnu_attribute=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.gnu_attribute 4,1' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28687,11 +28410,7 @@ if ${gcc_cv_as_msp430_mspabi_attribute+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_msp430_mspabi_attribute=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 33 \) \* 1000 + 50`
- then gcc_cv_as_msp430_mspabi_attribute=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.mspabi_attribute 4,2' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28766,11 +28485,7 @@ if ${gcc_cv_as_riscv_attribute+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_riscv_attribute=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 32 \) \* 1000 + 0`
- then gcc_cv_as_riscv_attribute=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.attribute stack_align,4' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28865,11 +28580,7 @@ if ${gcc_cv_as_s390_gnu_attribute+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_s390_gnu_attribute=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 18 \) \* 1000 + 0`
- then gcc_cv_as_s390_gnu_attribute=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.gnu_attribute 8,1' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28900,11 +28611,7 @@ if ${gcc_cv_as_s390_machine_machinemode+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_s390_machine_machinemode=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 24 \) \* 1000 + 0`
- then gcc_cv_as_s390_machine_machinemode=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .machinemode push
.machinemode pop
.machine push
@@ -28938,11 +28645,7 @@ if ${gcc_cv_as_s390_architecture_modifiers+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_s390_architecture_modifiers=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 26 \) \* 1000 + 0`
- then gcc_cv_as_s390_architecture_modifiers=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' .machine z13+vx ' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -28973,11 +28676,7 @@ if ${gcc_cv_as_s390_vector_loadstore_alignment_hints+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_s390_vector_loadstore_alignment_hints=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 31 \) \* 1000 + 0`
- then gcc_cv_as_s390_vector_loadstore_alignment_hints=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo ' vl %v24,0(%r15),3 ' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -29240,12 +28939,7 @@ if ${gcc_cv_as_dwarf2_debug_line+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_dwarf2_debug_line=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
- then gcc_cv_as_dwarf2_debug_line=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -29329,12 +29023,7 @@ if ${gcc_cv_as_dwarf2_debug_view+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_dwarf2_debug_view=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 27 \) \* 1000 + 0`
- then gcc_cv_as_dwarf2_debug_view=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -29368,12 +29057,7 @@ if ${gcc_cv_as_gdwarf2_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_gdwarf2_flag=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
- then gcc_cv_as_gdwarf2_flag=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$insn" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags --gdwarf2 -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -29405,12 +29089,7 @@ if ${gcc_cv_as_gdwarf_5_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_gdwarf_5_flag=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0`
- then gcc_cv_as_gdwarf_5_flag=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$insn" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags --gdwarf-5 -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -29614,12 +29293,7 @@ if ${gcc_cv_as_debug_line_32_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_debug_line_32_flag=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0`
- then gcc_cv_as_debug_line_32_flag=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -29649,12 +29323,7 @@ if ${gcc_cv_as_debug_line_64_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_debug_line_64_flag=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0`
- then gcc_cv_as_debug_line_64_flag=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -29686,12 +29355,7 @@ if ${gcc_cv_as_dwarf_4_debug_line_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_dwarf_4_debug_line_flag=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 36 \) \* 1000 + 0`
- then gcc_cv_as_dwarf_4_debug_line_flag=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$conftest_s" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags --gdwarf-4 -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -29827,12 +29491,7 @@ if ${gcc_cv_as_gstabs_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_gstabs_flag=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 11 \) \* 1000 + 0`
- then gcc_cv_as_gstabs_flag=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$insn" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags --gstabs -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -29864,11 +29523,7 @@ if ${gcc_cv_as_debug_prefix_map_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_debug_prefix_map_flag=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 18 \) \* 1000 + 0`
- then gcc_cv_as_debug_prefix_map_flag=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo "$insn" > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags --debug-prefix-map /a=/b -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -30053,12 +29708,7 @@ if ${gcc_cv_as_gnu_unique_object+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_gnu_unique_object=no
- if test $in_tree_gas = yes; then
- if test $in_tree_gas_is_elf = yes \
- && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 19 \) \* 1000 + 52`
- then gcc_cv_as_gnu_unique_object=yes
-fi
- elif test x$gcc_cv_as != x; then
+ if test x$gcc_cv_as != x; then
$as_echo '.type foo, '$target_type_format_char'gnu_unique_object' > conftest.s
if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
@@ -30102,11 +29752,7 @@ if ${gcc_cv_as_line_zero+:} false; then :
$as_echo_n "(cached) " >&6
else
gcc_cv_as_line_zero=no
- if test $in_tree_gas = yes; then
- if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 91`
- then gcc_cv_as_line_zero=yes
-fi
- elif test "x$gcc_cv_as" != x; then
+ if test "x$gcc_cv_as" != x; then
{ echo '# 1 "test.s" 1'; echo '# 0 "" 2'; } > conftest.s
if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5 2>conftest.out'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
diff --git a/gcc/configure.ac b/gcc/configure.ac
index ad8fa5a..c651db7 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2556,8 +2556,6 @@ AC_SUBST(enable_fast_install)
# If build != host, and we aren't building gas in-tree, we identify a
# build->target assembler and hope that it will have the same features
# as the host->target assembler we'll be using.
-gcc_cv_gas_major_version=
-gcc_cv_gas_minor_version=
gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
m4_pattern_allow([AS_FOR_TARGET])dnl
@@ -2584,26 +2582,6 @@ case "$ORIGINAL_AS_FOR_TARGET" in
*) AC_CONFIG_FILES(as:exec-tool.in, [chmod +x as]) ;;
esac
-AC_MSG_CHECKING(what assembler to use)
-if test "$gcc_cv_as" = ../gas/as-new$build_exeext; then
- # Single tree build which includes gas. We want to prefer it
- # over whatever linker top-level may have detected, since
- # we'll use what we're building after installation anyway.
- AC_MSG_RESULT(newly built gas)
- in_tree_gas=yes
- _gcc_COMPUTE_GAS_VERSION
- in_tree_gas_is_elf=no
- if grep 'obj_format = elf' ../gas/Makefile > /dev/null \
- || (grep 'obj_format = multi' ../gas/Makefile \
- && grep 'extra_objects =.* obj-elf' ../gas/Makefile) > /dev/null
- then
- in_tree_gas_is_elf=yes
- fi
-else
- AC_MSG_RESULT($gcc_cv_as)
- in_tree_gas=no
-fi
-
default_ld=
AC_ARG_ENABLE(ld,
[[ --enable-ld[=ARG] build ld [ARG={default,yes,no}]]],
@@ -2905,28 +2883,24 @@ case "$ORIGINAL_DSYMUTIL_FOR_TARGET" in
esac
# Figure out what assembler alignment features are present.
-gcc_GAS_CHECK_FEATURE([.balign and .p2align], gcc_cv_as_balign_and_p2align,
- [2,6,0],,
+gcc_GAS_CHECK_FEATURE([.balign and .p2align], gcc_cv_as_balign_and_p2align,,
[.balign 4
.p2align 2],,
[AC_DEFINE(HAVE_GAS_BALIGN_AND_P2ALIGN, 1,
[Define if your assembler supports .balign and .p2align.])])
-gcc_GAS_CHECK_FEATURE([.p2align with maximum skip], gcc_cv_as_max_skip_p2align,
- [2,8,0],,
+gcc_GAS_CHECK_FEATURE([.p2align with maximum skip], gcc_cv_as_max_skip_p2align,,
[.p2align 4,,7],,
[AC_DEFINE(HAVE_GAS_MAX_SKIP_P2ALIGN, 1,
[Define if your assembler supports specifying the maximum number
of bytes to skip when using the GAS .p2align command.])])
-gcc_GAS_CHECK_FEATURE([.literal16], gcc_cv_as_literal16,
- [2,8,0],,
+gcc_GAS_CHECK_FEATURE([.literal16], gcc_cv_as_literal16,,
[.literal16],,
[AC_DEFINE(HAVE_GAS_LITERAL16, 1,
[Define if your assembler supports .literal16.])])
-gcc_GAS_CHECK_FEATURE([working .subsection -1], gcc_cv_as_subsection_m1,
- [elf,2,9,0],,
+gcc_GAS_CHECK_FEATURE([working .subsection -1], gcc_cv_as_subsection_m1,,
[conftest_label1: .word 0
.subsection -1
conftest_label2: .word 0
@@ -2944,18 +2918,15 @@ conftest_label2: .word 0
[Define if your assembler supports .subsection and .subsection -1 starts
emitting at the beginning of your section.])])
-gcc_GAS_CHECK_FEATURE([.weak], gcc_cv_as_weak,
- [2,2,0],,
+gcc_GAS_CHECK_FEATURE([.weak], gcc_cv_as_weak,,
[ .weak foobar],,
[AC_DEFINE(HAVE_GAS_WEAK, 1, [Define if your assembler supports .weak.])])
-gcc_GAS_CHECK_FEATURE([.weakref], gcc_cv_as_weakref,
- [2,17,0],,
+gcc_GAS_CHECK_FEATURE([.weakref], gcc_cv_as_weakref,,
[ .weakref foobar, barfnot],,
[AC_DEFINE(HAVE_GAS_WEAKREF, 1, [Define if your assembler supports .weakref.])])
-gcc_GAS_CHECK_FEATURE([.nsubspa comdat], gcc_cv_as_nsubspa_comdat,
- [2,15,91],,
+gcc_GAS_CHECK_FEATURE([.nsubspa comdat], gcc_cv_as_nsubspa_comdat,,
[ .SPACE $TEXT$
.NSUBSPA $CODE$,COMDAT],,
[AC_DEFINE(HAVE_GAS_NSUBSPA_COMDAT, 1, [Define if your assembler supports .nsubspa comdat option.])])
@@ -2976,8 +2947,7 @@ case "${target}" in
foobar:'
;;
esac
-gcc_GAS_CHECK_FEATURE([.hidden], gcc_cv_as_hidden,
- [elf,2,13,0],, [$conftest_s])
+gcc_GAS_CHECK_FEATURE([.hidden], gcc_cv_as_hidden,, [$conftest_s])
case "${target}" in
*-*-darwin*)
# Darwin as has some visibility support, though with a different syntax.
@@ -3195,8 +3165,7 @@ gcc_AC_INITFINI_ARRAY
# Check if we have .[us]leb128, and support symbol arithmetic with it.
# Older versions of GAS and some non-GNU assemblers, have a bugs handling
# these directives, even when they appear to accept them.
-gcc_GAS_CHECK_FEATURE([.sleb128 and .uleb128], gcc_cv_as_leb128,
- [elf,2,11,0],,
+gcc_GAS_CHECK_FEATURE([.sleb128 and .uleb128], gcc_cv_as_leb128,,
[ .data
.uleb128 L2 - L1
L1:
@@ -3234,8 +3203,7 @@ gcc_fn_eh_frame_ro () {
}
# Check if we have assembler support for unwind directives.
-gcc_GAS_CHECK_FEATURE([cfi directives], gcc_cv_as_cfi_directive,
- ,,
+gcc_GAS_CHECK_FEATURE([cfi directives], gcc_cv_as_cfi_directive,,
[ .text
.cfi_startproc
.cfi_offset 0, 0
@@ -3290,8 +3258,7 @@ gcc_GAS_CHECK_FEATURE([cfi directives], gcc_cv_as_cfi_directive,
;;
esac])
if test $gcc_cv_as_cfi_directive = yes && test x$gcc_cv_objdump != x; then
-gcc_GAS_CHECK_FEATURE([working cfi advance], gcc_cv_as_cfi_advance_working,
- ,,
+gcc_GAS_CHECK_FEATURE([working cfi advance], gcc_cv_as_cfi_advance_working,,
[ .text
.cfi_startproc
.cfi_adjust_cfa_offset 64
@@ -3316,7 +3283,7 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_DIRECTIVE,
GCC_TARGET_TEMPLATE(HAVE_GAS_CFI_PERSONALITY_DIRECTIVE)
gcc_GAS_CHECK_FEATURE([cfi personality directive],
- gcc_cv_as_cfi_personality_directive, ,,
+ gcc_cv_as_cfi_personality_directive,,
[ .text
.cfi_startproc
.cfi_personality 0, symbol
@@ -3326,7 +3293,7 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_PERSONALITY_DIRECTIVE,
[Define 0/1 if your assembler supports .cfi_personality.])
gcc_GAS_CHECK_FEATURE([cfi sections directive],
- gcc_cv_as_cfi_sections_directive, ,,
+ gcc_cv_as_cfi_sections_directive,,
[ .text
.cfi_sections .debug_frame, .eh_frame
.cfi_startproc
@@ -3354,8 +3321,7 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_SECTIONS_DIRECTIVE,
# GAS versions up to and including 2.11.0 may mis-optimize
# .eh_frame data.
-gcc_GAS_CHECK_FEATURE(eh_frame optimization, gcc_cv_as_eh_frame,
- [elf,2,12,0],,
+gcc_GAS_CHECK_FEATURE(eh_frame optimization, gcc_cv_as_eh_frame,,
[ .text
.LFB1:
.4byte 0
@@ -3426,7 +3392,7 @@ fi
# Test if the assembler supports the section flag 'e' or #exclude for
# specifying an excluded section.
gcc_GAS_CHECK_FEATURE([section exclude flag], gcc_cv_as_section_exclude_e,
- [2,22,51], [--fatal-warnings],
+ [--fatal-warnings],
[.section foo1,"e"
.byte 0,0,0,0])
if test $gcc_cv_as_section_exclude_e = no; then
@@ -3443,7 +3409,7 @@ if test $gcc_cv_as_section_exclude_e = no; then
esac
;;
esac
- gcc_GAS_CHECK_FEATURE([section exclude flag], gcc_cv_as_section_exclude_hash,,,
+ gcc_GAS_CHECK_FEATURE([section exclude flag], gcc_cv_as_section_exclude_hash,,
[$conftest_s
.byte 0,0,0,0])
fi
@@ -3462,7 +3428,7 @@ case "${target}" in
;;
*)
gcc_GAS_CHECK_FEATURE([section 'R' flag], gcc_cv_as_shf_gnu_retain,
- [elf,2,36,0], [--fatal-warnings],
+ [--fatal-warnings],
[.section .foo,"awR",%progbits
.byte 0])
;;
@@ -3482,7 +3448,7 @@ case "${target}" in
;;
*)
gcc_GAS_CHECK_FEATURE([section 'o' flag], gcc_cv_as_section_link_order,
- [2,35,0], [--fatal-warnings],
+ [--fatal-warnings],
[.section .foo,"a"
.byte 0
.section __patchable_function_entries,"awo",%progbits,.foo
@@ -3494,11 +3460,11 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_SECTION_LINK_ORDER,
[Define 0/1 if your assembler supports 'o' flag in .section directive.])
gcc_GAS_CHECK_FEATURE(section merging support, gcc_cv_as_shf_merge,
- [elf,2,12,0], [--fatal-warnings],
+ [--fatal-warnings],
[.section .rodata.str, "aMS", @progbits, 1])
if test $gcc_cv_as_shf_merge = no; then
gcc_GAS_CHECK_FEATURE(section merging support, gcc_cv_as_shf_merge,
- [elf,2,12,0], [--fatal-warnings],
+ [--fatal-warnings],
[.section .rodata.str, "aMS", %progbits, 1])
fi
AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE,
@@ -3520,14 +3486,14 @@ AC_DEFINE_UNQUOTED(HAVE_LD_ALIGNED_SHF_MERGE,
[`if test $gcc_cv_ld_aligned_shf_merge = yes; then echo 1; else echo 0; fi`],
[Define 0/1 if your linker supports the SHF_MERGE flag with section alignment > 1.])
-gcc_GAS_CHECK_FEATURE([stabs directive], gcc_cv_as_stabs_directive, ,,
+gcc_GAS_CHECK_FEATURE([stabs directive], gcc_cv_as_stabs_directive,,
[.stabs "gcc2_compiled.",60,0,0,0],,
[AC_DEFINE(HAVE_AS_STABS_DIRECTIVE, 1,
[Define if your assembler supports .stabs.])])
gcc_GAS_CHECK_FEATURE([COMDAT group support (GNU as)],
gcc_cv_as_comdat_group,
- [elf,2,16,0], [--fatal-warnings],
+ [--fatal-warnings],
[.section .text,"axG",@progbits,.foo,comdat])
if test $gcc_cv_as_comdat_group = yes; then
gcc_cv_as_comdat_group_percent=no
@@ -3535,7 +3501,7 @@ if test $gcc_cv_as_comdat_group = yes; then
else
gcc_GAS_CHECK_FEATURE([COMDAT group support (GNU as, %type)],
gcc_cv_as_comdat_group_percent,
- [elf,2,16,0], [--fatal-warnings],
+ [--fatal-warnings],
[.section .text,"axG",%progbits,.foo,comdat])
if test $gcc_cv_as_comdat_group_percent = yes; then
gcc_cv_as_comdat_group_group=no
@@ -3563,7 +3529,7 @@ else
esac
gcc_GAS_CHECK_FEATURE([COMDAT group support (Sun as, .group)],
gcc_cv_as_comdat_group_group,
- ,, [$conftest_s])
+ , [$conftest_s])
;;
esac
if test -z "${gcc_cv_as_comdat_group_group+set}"; then
@@ -3658,8 +3624,7 @@ case "${target}" in
esac
gcc_GAS_CHECK_FEATURE([line table is_stmt support],
- gcc_cv_as_is_stmt,
- [2,16,92],,
+ gcc_cv_as_is_stmt,,
[ .text
.file 1 "conf.c"
.loc 1 1 0 is_stmt 1],,
@@ -3667,8 +3632,7 @@ gcc_GAS_CHECK_FEATURE([line table is_stmt support],
[Define if your assembler supports the .loc is_stmt sub-directive.])])
gcc_GAS_CHECK_FEATURE([line table discriminator support],
- gcc_cv_as_discriminator,
- [2,19,51],,
+ gcc_cv_as_discriminator,,
[ .text
.file 1 "conf.c"
.loc 1 1 0 discriminator 1],,
@@ -3689,8 +3653,6 @@ esac], [])
# Thread-local storage - the check is heavily parameterized.
conftest_s=
-tls_first_major=
-tls_first_minor=
tls_as_opt=
case "$target" in
changequote(,)dnl
@@ -3713,15 +3675,11 @@ foo: .long 25
ldah $2,foo($29) !tprelhi
lda $3,foo($2) !tprello
lda $4,foo($29) !tprel'
- tls_first_major=2
- tls_first_minor=13
tls_as_opt=--fatal-warnings
;;
arc*-*-*)
conftest_s='
add_s r0,r0, @foo@tpoff'
- tls_first_major=2
- tls_first_minor=23
;;
cris-*-*|crisv32-*-*)
conftest_s='
@@ -3730,8 +3688,6 @@ x: .long 25
.text
move.d x:IE,$r10
nop'
- tls_first_major=2
- tls_first_minor=20
tls_as_opt=--fatal-warnings
;;
frv*-*-*)
@@ -3740,8 +3696,6 @@ x: .long 25
x: .long 25
.text
call #gettlsoff(x)'
- tls_first_major=2
- tls_first_minor=14
;;
hppa*-*-linux*)
conftest_s='
@@ -3768,8 +3722,6 @@ foo: .long 25
mfctl %cr27,%t1
addil LR%foo-$tls_leoff$,%t1
ldo RR%foo-$tls_leoff$(%r1),%t2'
- tls_first_major=2
- tls_first_minor=15
tls_as_opt=--fatal-warnings
;;
arm*-*-*)
@@ -3782,8 +3734,6 @@ foo: .long 25
.word foo(tlsgd)
.word foo(tlsldm)
.word foo(tlsldo)'
- tls_first_major=2
- tls_first_minor=17
;;
i[34567]86-*-* | x86_64-*-*)
case "$target" in
@@ -3797,8 +3747,6 @@ foo: .long 25
if test x$on_solaris = xyes && test x$gas_flag = xno; then
conftest_s='
.section .tdata,"awt",@progbits'
- tls_first_major=0
- tls_first_minor=0
tls_section_flag=t
changequote([,])dnl
AC_DEFINE(TLS_SECTION_ASM_FLAG, 't',
@@ -3807,8 +3755,6 @@ changequote(,)dnl
else
conftest_s='
.section ".tdata","awT",@progbits'
- tls_first_major=2
- tls_first_minor=14
tls_section_flag=T
tls_as_opt="--fatal-warnings"
fi
@@ -3867,8 +3813,6 @@ foo: data8 25
addl r20 = @tprel(foo#), gp
adds r22 = @tprel(foo#), r13
movl r24 = @tprel(foo#)'
- tls_first_major=2
- tls_first_minor=13
tls_as_opt=--fatal-warnings
;;
microblaze*-*-*)
@@ -3879,8 +3823,6 @@ x:
.text
addik r5,r20,x@TLSGD
addik r5,r20,x@TLSLDM'
- tls_first_major=2
- tls_first_minor=20
tls_as_opt='--fatal-warnings'
;;
mips*-*-*)
@@ -3896,8 +3838,6 @@ x:
lw $4, %gottprel(x)($28)
lui $4, %tprel_hi(x)
addiu $4, $4, %tprel_lo(x)'
- tls_first_major=2
- tls_first_minor=16
tls_as_opt='-32 --fatal-warnings'
;;
m68k-*-*)
@@ -3912,15 +3852,11 @@ foo:
move.l x@TLSLDO(%a5),%a0
move.l x@TLSIE(%a5),%a0
move.l x@TLSLE(%a5),%a0'
- tls_first_major=2
- tls_first_minor=19
tls_as_opt='--fatal-warnings'
;;
nios2-*-*)
conftest_s='
.section ".tdata","awT",@progbits'
- tls_first_major=2
- tls_first_minor=23
tls_as_opt="--fatal-warnings"
;;
aarch64*-*-*)
@@ -3932,8 +3868,6 @@ foo: .long 25
add x0, x0, #:tlsgd_lo12:x
bl __tls_get_addr
nop'
- tls_first_major=2
- tls_first_minor=20
tls_as_opt='--fatal-warnings'
;;
or1k*-*-*)
@@ -3944,8 +3878,6 @@ foo: .long 25
l.movhi r3, tpoffha(foo)
l.add r3, r3, r10
l.lwz r4, tpofflo(foo)(r3)'
- tls_first_major=2
- tls_first_minor=30
tls_as_opt=--fatal-warnings
;;
powerpc-ibm-aix*)
@@ -3963,8 +3895,6 @@ LC..1:
.csect a[TL],4
a:
.space 4'
- tls_first_major=0
- tls_first_minor=0
;;
powerpc64*-*-*)
conftest_s='
@@ -3996,8 +3926,6 @@ x3: .space 8
add 9,9,3
bl .__tls_get_addr
nop'
- tls_first_major=2
- tls_first_minor=14
tls_as_opt="-a64 --fatal-warnings"
;;
powerpc*-*-*)
@@ -4022,8 +3950,6 @@ x3: .space 4
addi 9,2,x1@tprel
addis 9,2,x2@tprel@ha
addi 9,9,x2@tprel@l'
- tls_first_major=2
- tls_first_minor=14
tls_as_opt="-a32 --fatal-warnings"
;;
riscv*-*-*)
@@ -4033,8 +3959,6 @@ x: .word 2
.text
la.tls.gd a0,x
call __tls_get_addr'
- tls_first_major=2
- tls_first_minor=21
tls_as_opt='--fatal-warnings'
;;
s390-*-*)
@@ -4052,8 +3976,6 @@ foo: .long 25
l %r1,0(%r1):tls_load:foo
bas %r14,0(%r1,%r13):tls_gdcall:foo
bas %r14,0(%r1,%r13):tls_ldcall:foo'
- tls_first_major=2
- tls_first_minor=14
tls_as_opt="-m31 --fatal-warnings"
;;
s390x-*-*)
@@ -4070,8 +3992,6 @@ foo: .long 25
larl %r1,foo@INDNTPOFF
brasl %r14,__tls_get_offset@PLT:tls_gdcall:foo
brasl %r14,__tls_get_offset@PLT:tls_ldcall:foo'
- tls_first_major=2
- tls_first_minor=14
tls_as_opt="-m64 -Aesame --fatal-warnings"
;;
sh-*-* | sh[123456789lbe]*-*-*)
@@ -4084,8 +4004,6 @@ foo: .long 25
.long foo@DTPOFF
.long foo@GOTTPOFF
.long foo@TPOFF'
- tls_first_major=2
- tls_first_minor=13
tls_as_opt=--fatal-warnings
;;
sparc*-*-*)
@@ -4100,13 +4018,9 @@ foo: .long 25
if test x$on_solaris = xyes && test x$gas_flag = xno; then
conftest_s='
.section ".tdata",#alloc,#write,#tls'
- tls_first_major=0
- tls_first_minor=0
else
conftest_s='
.section ".tdata","awT",@progbits'
- tls_first_major=2
- tls_first_minor=14
tls_as_opt="-32 --fatal-warnings"
fi
conftest_s="$conftest_s
@@ -4143,8 +4057,6 @@ foo: .long 25
addli r0, zero, tls_ie(foo)
auli r0, r0, tls_ie_ha16(foo)
addli r0, r0, tls_ie_lo16(foo)'
- tls_first_major=2
- tls_first_minor=22
tls_as_opt="--fatal-warnings"
;;
tilegx*-*-*)
@@ -4158,8 +4070,6 @@ foo: .long 25
jal __tls_get_addr
shl16insli r0, zero, hw1_last_tls_ie(foo)
shl16insli r0, r0, hw0_tls_ie(foo)'
- tls_first_major=2
- tls_first_minor=22
tls_as_opt="--fatal-warnings"
;;
xtensa*-*-*)
@@ -4170,8 +4080,6 @@ foo: .long 25
movi a8, foo@TLSFUNC
movi a10, foo@TLSARG
callx8.tls a8, foo@TLSCALL'
- tls_first_major=2
- tls_first_minor=19
;;
changequote([,])dnl
esac
@@ -4180,11 +4088,11 @@ if test "x$enable_tls" = xno ; then
: # TLS explicitly disabled.
elif test "x$enable_tls" = xyes ; then
set_have_as_tls=yes # TLS explicitly enabled.
-elif test -z "$tls_first_major"; then
+elif test -z "$conftest_s"; then
: # If we don't have a check, assume no support.
else
gcc_GAS_CHECK_FEATURE(thread-local storage support, gcc_cv_as_tls,
- [$tls_first_major,$tls_first_minor,0], [$tls_as_opt], [$conftest_s],,
+ [$tls_as_opt], [$conftest_s],,
[set_have_as_tls=yes])
fi
if test $set_have_as_tls = yes ; then
@@ -4364,7 +4272,7 @@ AC_MSG_RESULT($gcc_cv_lto_plugin)
case "$target_os" in
darwin*)
gcc_GAS_CHECK_FEATURE([-mmacosx-version-min option],
- gcc_cv_as_mmacosx_version_min,,
+ gcc_cv_as_mmacosx_version_min,
[-mmacosx-version-min=10.1], [.text],,
[AC_DEFINE(HAVE_AS_MMACOSX_VERSION_MIN_OPTION, 1,
[Define if your Mac OS X assembler supports the -mmacos-version-min option.])])
@@ -4375,7 +4283,7 @@ esac
case "$target" in
aarch64*-*-*)
- gcc_GAS_CHECK_FEATURE([-mabi option], gcc_cv_as_aarch64_mabi,,
+ gcc_GAS_CHECK_FEATURE([-mabi option], gcc_cv_as_aarch64_mabi,
[-mabi=lp64], [.text],,,)
if test x$gcc_cv_as_aarch64_mabi = xyes; then
AC_DEFINE(HAVE_AS_MABI_OPTION, 1,
@@ -4402,7 +4310,7 @@ case "$target" in
fi
fi
# Check if we have binutils support for relocations types needed by -fpic
- gcc_GAS_CHECK_FEATURE([-fpic relocs], gcc_cv_as_aarch64_picreloc,,,
+ gcc_GAS_CHECK_FEATURE([-fpic relocs], gcc_cv_as_aarch64_picreloc,,
[
.text
ldr x0, [[x2, #:gotpage_lo15:globalsym]]
@@ -4482,7 +4390,7 @@ AS_HELP_STRING([--disable-fix-cortex-a53-843419],
# All TARGET_ABI_OSF targets.
alpha*-*-linux* | alpha*-*-*bsd*)
gcc_GAS_CHECK_FEATURE([explicit relocation support],
- gcc_cv_as_alpha_explicit_relocs, [2,12,0],,
+ gcc_cv_as_alpha_explicit_relocs,,
[ .set nomacro
.text
extbl $3, $2, $3 !lituse_bytoff!1
@@ -4499,7 +4407,7 @@ AS_HELP_STRING([--disable-fix-cortex-a53-843419],
[AC_DEFINE(HAVE_AS_EXPLICIT_RELOCS, 1,
[Define if your assembler supports explicit relocations.])])
gcc_GAS_CHECK_FEATURE([jsrdirect relocation support],
- gcc_cv_as_alpha_jsrdirect_relocs, [2,16,90],,
+ gcc_cv_as_alpha_jsrdirect_relocs,,
[ .set nomacro
.text
ldq $27, a($29) !literal!1
@@ -4509,18 +4417,18 @@ AS_HELP_STRING([--disable-fix-cortex-a53-843419],
;;
avr-*-*)
- gcc_GAS_CHECK_FEATURE([--mlink-relax option], gcc_cv_as_avr_mlink_relax,,
+ gcc_GAS_CHECK_FEATURE([--mlink-relax option], gcc_cv_as_avr_mlink_relax,
[--mlink-relax], [.text],,
[AC_DEFINE(HAVE_AS_AVR_MLINK_RELAX_OPTION, 1,
[Define if your avr assembler supports --mlink-relax option.])])
- gcc_GAS_CHECK_FEATURE([-mrmw option], gcc_cv_as_avr_mrmw,,
+ gcc_GAS_CHECK_FEATURE([-mrmw option], gcc_cv_as_avr_mrmw,
[-mrmw], [.text],,
[AC_DEFINE(HAVE_AS_AVR_MRMW_OPTION, 1,
[Define if your avr assembler supports -mrmw option.])])
gcc_GAS_CHECK_FEATURE([__gcc_isr pseudo instruction],
- gcc_cv_as_avr_mgccisr,,
+ gcc_cv_as_avr_mgccisr,
[-mgcc-isr], [.text
__gcc_isr 1
__gcc_isr 2
@@ -4568,20 +4476,20 @@ EOF
cris-*-*)
gcc_GAS_CHECK_FEATURE([-no-mul-bug-abort option],
- gcc_cv_as_cris_no_mul_bug,[2,15,91],
+ gcc_cv_as_cris_no_mul_bug,
[-no-mul-bug-abort], [.text],,
[AC_DEFINE(HAVE_AS_NO_MUL_BUG_ABORT_OPTION, 1,
[Define if your assembler supports the -no-mul-bug-abort option.])])
;;
sparc*-*-*)
- gcc_GAS_CHECK_FEATURE([-relax option], gcc_cv_as_sparc_relax,,
+ gcc_GAS_CHECK_FEATURE([-relax option], gcc_cv_as_sparc_relax,
[-relax], [.text],,
[AC_DEFINE(HAVE_AS_RELAX_OPTION, 1,
[Define if your assembler supports -relax option.])])
gcc_GAS_CHECK_FEATURE([GOTDATA_OP relocs],
- gcc_cv_as_sparc_gotdata_op,,
+ gcc_cv_as_sparc_gotdata_op,
[-K PIC],
[.text
.align 4
@@ -4607,7 +4515,7 @@ bar:
[Define if your assembler and linker support GOTDATA_OP relocs.])])
gcc_GAS_CHECK_FEATURE([unaligned pcrel relocs],
- gcc_cv_as_sparc_ua_pcrel,,
+ gcc_cv_as_sparc_ua_pcrel,
[-K PIC],
[.text
foo:
@@ -4625,7 +4533,7 @@ foo:
[Define if your assembler and linker support unaligned PC relative relocs.])
gcc_GAS_CHECK_FEATURE([unaligned pcrel relocs against hidden symbols],
- gcc_cv_as_sparc_ua_pcrel_hidden,,
+ gcc_cv_as_sparc_ua_pcrel_hidden,
[-K PIC],
[.data
.align 4
@@ -4653,7 +4561,7 @@ foo:
]) # unaligned pcrel relocs
gcc_GAS_CHECK_FEATURE([offsetable %lo()],
- gcc_cv_as_sparc_offsetable_lo10,,
+ gcc_cv_as_sparc_offsetable_lo10,
[-xarch=v9],
[.text
or %g1, %lo(ab) + 12, %g1
@@ -4667,7 +4575,7 @@ foo:
[Define if your assembler supports offsetable %lo().])])
gcc_GAS_CHECK_FEATURE([FMAF, HPC, and VIS 3.0 instructions],
- gcc_cv_as_sparc_fmaf,,
+ gcc_cv_as_sparc_fmaf,
[-xarch=v9d],
[.text
.register %g2, #scratch
@@ -4681,7 +4589,7 @@ foo:
[Define if your assembler supports FMAF, HPC, and VIS 3.0 instructions.])])
gcc_GAS_CHECK_FEATURE([SPARC4 instructions],
- gcc_cv_as_sparc_sparc4,,
+ gcc_cv_as_sparc_sparc4,
[-xarch=sparc4],
[.text
.register %g2, #scratch
@@ -4699,7 +4607,7 @@ foo:
[Define if your assembler supports SPARC4 instructions.])])
gcc_GAS_CHECK_FEATURE([SPARC5 and VIS 4.0 instructions],
- gcc_cv_as_sparc_sparc5,,
+ gcc_cv_as_sparc_sparc5,
[-xarch=sparc5],
[.text
.register %g2, #scratch
@@ -4711,7 +4619,7 @@ foo:
[Define if your assembler supports SPARC5 and VIS 4.0 instructions.])])
gcc_GAS_CHECK_FEATURE([SPARC6 instructions],
- gcc_cv_as_sparc_sparc6,,
+ gcc_cv_as_sparc_sparc6,
[-xarch=sparc6],
[.text
.register %g2, #scratch
@@ -4723,7 +4631,7 @@ foo:
[Define if your assembler supports SPARC6 instructions.])])
gcc_GAS_CHECK_FEATURE([LEON instructions],
- gcc_cv_as_sparc_leon,,
+ gcc_cv_as_sparc_leon,
[-Aleon],
[.text
.register %g2, #scratch
@@ -4763,16 +4671,15 @@ changequote([,])dnl
# Recent binutils allows the three-operand form of ".comm" on PE. This
# definition is used unconditionally to initialise the default state of
# the target option variable that governs usage of the feature.
- gcc_GAS_CHECK_FEATURE([.comm with alignment], gcc_cv_as_comm_has_align,
- [2,19,52],,[.comm foo,1,32])
+ gcc_GAS_CHECK_FEATURE([.comm with alignment], gcc_cv_as_comm_has_align,,
+ [.comm foo,1,32])
AC_DEFINE_UNQUOTED(HAVE_GAS_ALIGNED_COMM,
[`if test $gcc_cv_as_comm_has_align = yes; then echo 1; else echo 0; fi`],
[Define if your assembler supports specifying the alignment
of objects allocated using the GAS .comm command.])
# Used for DWARF 2 in PE
gcc_GAS_CHECK_FEATURE([.secrel32 relocs],
- gcc_cv_as_ix86_pe_secrel32,
- [2,15,91],,
+ gcc_cv_as_ix86_pe_secrel32,,
[.text
foo: nop
.data
@@ -4789,7 +4696,7 @@ foo: nop
# but normally only after installation, so we warn but don't fail the
# configure if LTO is enabled but the assembler does not support it.
gcc_GAS_CHECK_FEATURE([.section with alignment], gcc_cv_as_section_has_align,
- [2,20,1],-fatal-warnings,[.section lto_test,"dr0"])
+ -fatal-warnings,[.section lto_test,"dr0"])
if test x$gcc_cv_as_section_has_align != xyes; then
case ",$enable_languages," in
*,lto,*)
@@ -4809,50 +4716,50 @@ foo: nop
;;
esac
- gcc_GAS_CHECK_FEATURE([-xbrace_comment], gcc_cv_as_ix86_xbrace_comment,,
+ gcc_GAS_CHECK_FEATURE([-xbrace_comment], gcc_cv_as_ix86_xbrace_comment,
[-xbrace_comment=no], [.text],,
[AC_DEFINE(HAVE_AS_XBRACE_COMMENT_OPTION, 1,
[Define if your assembler supports -xbrace_comment option.])])
gcc_GAS_CHECK_FEATURE([filds and fists mnemonics],
- gcc_cv_as_ix86_filds,,,
+ gcc_cv_as_ix86_filds,,
[filds (%ebp); fists (%ebp)],,
[AC_DEFINE(HAVE_AS_IX86_FILDS, 1,
[Define if your assembler uses filds and fists mnemonics.])])
gcc_GAS_CHECK_FEATURE([fildq and fistpq mnemonics],
- gcc_cv_as_ix86_fildq,,,
+ gcc_cv_as_ix86_fildq,,
[fildq (%ebp); fistpq (%ebp)],,
[AC_DEFINE(HAVE_AS_IX86_FILDQ, 1,
[Define if your assembler uses fildq and fistq mnemonics.])])
gcc_GAS_CHECK_FEATURE([cmov syntax],
- gcc_cv_as_ix86_cmov_sun_syntax,,,
+ gcc_cv_as_ix86_cmov_sun_syntax,,
[cmovl.l %edx, %eax],,
[AC_DEFINE(HAVE_AS_IX86_CMOV_SUN_SYNTAX, 1,
[Define if your assembler supports the Sun syntax for cmov.])])
gcc_GAS_CHECK_FEATURE([ffreep mnemonic],
- gcc_cv_as_ix86_ffreep,,,
+ gcc_cv_as_ix86_ffreep,,
[ffreep %st(1)],,
[AC_DEFINE(HAVE_AS_IX86_FFREEP, 1,
[Define if your assembler supports the ffreep mnemonic.])])
gcc_GAS_CHECK_FEATURE([.quad directive],
- gcc_cv_as_ix86_quad,,,
+ gcc_cv_as_ix86_quad,,
[.quad 0],,
[AC_DEFINE(HAVE_AS_IX86_QUAD, 1,
[Define if your assembler supports the .quad directive.])])
gcc_GAS_CHECK_FEATURE([sahf mnemonic],
- gcc_cv_as_ix86_sahf,,,
+ gcc_cv_as_ix86_sahf,,
[.code64
sahf],,
[AC_DEFINE(HAVE_AS_IX86_SAHF, 1,
[Define if your assembler supports the sahf mnemonic in 64bit mode.])])
gcc_GAS_CHECK_FEATURE([interunit movq mnemonic],
- gcc_cv_as_ix86_interunit_movq,,,
+ gcc_cv_as_ix86_interunit_movq,,
[.code64
movq %mm0, %rax
movq %rax, %xmm0])
@@ -4861,19 +4768,19 @@ foo: nop
[Define if your assembler supports interunit movq mnemonic.])
gcc_GAS_CHECK_FEATURE([hle prefixes],
- gcc_cv_as_ix86_hle,,,
+ gcc_cv_as_ix86_hle,,
[lock xacquire cmpxchg %esi, (%ecx)],,
[AC_DEFINE(HAVE_AS_IX86_HLE, 1,
[Define if your assembler supports HLE prefixes.])])
gcc_GAS_CHECK_FEATURE([swap suffix],
- gcc_cv_as_ix86_swap,,,
+ gcc_cv_as_ix86_swap,,
[movl.s %esp, %ebp],,
[AC_DEFINE(HAVE_AS_IX86_SWAP, 1,
[Define if your assembler supports the swap suffix.])])
gcc_GAS_CHECK_FEATURE([different section symbol subtraction],
- gcc_cv_as_ix86_diff_sect_delta,,,
+ gcc_cv_as_ix86_diff_sect_delta,,
[.section .rodata
.L1:
.long .L2-.L1
@@ -4885,7 +4792,7 @@ foo: nop
[Define if your assembler supports the subtraction of symbols in different sections.])])
gcc_GAS_CHECK_FEATURE([rep and lock prefix],
- gcc_cv_as_ix86_rep_lock_prefix,,,
+ gcc_cv_as_ix86_rep_lock_prefix,,
[rep movsl
rep ret
rep nop
@@ -4897,7 +4804,7 @@ foo: nop
[Define if the assembler supports 'rep <insn>, lock <insn>'.])])
gcc_GAS_CHECK_FEATURE([ud2 mnemonic],
- gcc_cv_as_ix86_ud2,,,
+ gcc_cv_as_ix86_ud2,,
[ud2],,
[AC_DEFINE(HAVE_AS_IX86_UD2, 1,
[Define if your assembler supports the 'ud2' mnemonic.])])
@@ -4915,7 +4822,7 @@ foo: nop
fi
gcc_GAS_CHECK_FEATURE([R_386_TLS_GD_PLT reloc],
- gcc_cv_as_ix86_tlsgdplt,,
+ gcc_cv_as_ix86_tlsgdplt,
[$as_ix86_gas_32_opt],
[call tls_gd@tlsgdplt],
[if test x$gcc_cv_ld != x \
@@ -4933,7 +4840,7 @@ tls_ld:
call tls_ld@tlsldmplt'
gcc_GAS_CHECK_FEATURE([R_386_TLS_LDM_PLT reloc],
- gcc_cv_as_ix86_tlsldmplt,,
+ gcc_cv_as_ix86_tlsldmplt,
[$as_ix86_gas_32_opt],
[$conftest_s],
[if test x$gcc_cv_ld != x \
@@ -4957,7 +4864,7 @@ _start:
.type value, @object
value:'
gcc_GAS_CHECK_FEATURE([R_386_TLS_LDM reloc],
- gcc_cv_as_ix86_tlsldm,,
+ gcc_cv_as_ix86_tlsldm,
[$as_ix86_gas_32_opt],
[$conftest_s],
[if test x$gcc_cv_ld != x && test x$gcc_cv_objdump != x \
@@ -4982,7 +4889,7 @@ _start:
cmpl $0, bar@GOT
jmp *_start@GOT'
gcc_GAS_CHECK_FEATURE([R_386_GOT32X reloc],
- gcc_cv_as_ix86_got32x,,
+ gcc_cv_as_ix86_got32x,
[$as_ix86_gas_32_opt],
[$conftest_s],
[if test x$gcc_cv_ld != x && test x$gcc_cv_objdump != x \
@@ -5003,7 +4910,7 @@ _start:
[Define 0/1 if your assembler and linker support @GOT.])
gcc_GAS_CHECK_FEATURE([GOTOFF in data],
- gcc_cv_as_ix86_gotoff_in_data, [2,11,0],
+ gcc_cv_as_ix86_gotoff_in_data,
[$as_ix86_gas_32_opt],
[ .text
.L0:
@@ -5033,7 +4940,7 @@ ld:
gd:
.byte 0'
gcc_GAS_CHECK_FEATURE([calling ___tls_get_addr via GOT],
- gcc_cv_as_ix86_tls_get_addr_via_got,,
+ gcc_cv_as_ix86_tls_get_addr_via_got,
[$as_ix86_gas_32_opt],
[$conftest_s],
[if test x$gcc_cv_ld != x \
@@ -5048,7 +4955,7 @@ gd:
ia64*-*-*)
gcc_GAS_CHECK_FEATURE([ltoffx and ldxmov relocs],
- gcc_cv_as_ia64_ltoffx_ldxmov_relocs, [2,14,0],,
+ gcc_cv_as_ia64_ltoffx_ldxmov_relocs,,
[ .text
addl r15 = @ltoffx(x#), gp
;;
@@ -5064,7 +4971,7 @@ gd:
case $target in
*-*-darwin*)
gcc_GAS_CHECK_FEATURE([.machine directive support],
- gcc_cv_as_machine_directive,,,
+ gcc_cv_as_machine_directive,,
[ .machine ppc7400])
if test x$gcc_cv_as_machine_directive != xyes; then
echo "*** This target requires an assembler supporting \".machine\"" >&2
@@ -5086,7 +4993,7 @@ gd:
esac
gcc_GAS_CHECK_FEATURE([mfcr field support],
- gcc_cv_as_powerpc_mfcrf, [2,14,0],,
+ gcc_cv_as_powerpc_mfcrf,,
[$conftest_s],,
[AC_DEFINE(HAVE_AS_MFCRF, 1,
[Define if your assembler supports mfcr field.])])
@@ -5105,7 +5012,7 @@ LCF0:
esac
gcc_GAS_CHECK_FEATURE([rel16 relocs],
- gcc_cv_as_powerpc_rel16, [2,17,0], -a32,
+ gcc_cv_as_powerpc_rel16, -a32,
[$conftest_s],,
[AC_DEFINE(HAVE_AS_REL16, 1,
[Define if your assembler supports R_PPC_REL16 relocs.])])
@@ -5120,25 +5027,25 @@ LCF0:
esac
gcc_GAS_CHECK_FEATURE([vector-scalar support],
- gcc_cv_as_powerpc_vsx, [2,19,2], -a32,
+ gcc_cv_as_powerpc_vsx, -a32,
[$conftest_s],,
[AC_DEFINE(HAVE_AS_VSX, 1,
[Define if your assembler supports VSX instructions.])])
gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
- gcc_cv_as_powerpc_gnu_attribute, [2,18,0],,
+ gcc_cv_as_powerpc_gnu_attribute,,
[.gnu_attribute 4,1],,
[AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
[Define if your assembler supports .gnu_attribute.])])
gcc_GAS_CHECK_FEATURE([prologue entry point marker support],
- gcc_cv_as_powerpc_entry_markers, [2,26,0],-a64 --fatal-warnings,
+ gcc_cv_as_powerpc_entry_markers,-a64 --fatal-warnings,
[ .reloc .,R_PPC64_ENTRY; nop],,
[AC_DEFINE(HAVE_AS_ENTRY_MARKERS, 1,
[Define if your assembler supports the R_PPC64_ENTRY relocation.])])
gcc_GAS_CHECK_FEATURE([plt sequence marker support],
- gcc_cv_as_powerpc_pltseq_markers, [2,31,0],-a32 --fatal-warnings,
+ gcc_cv_as_powerpc_pltseq_markers,-a32 --fatal-warnings,
[ .reloc .,R_PPC_PLTSEQ; nop],,
[AC_DEFINE(HAVE_AS_PLTSEQ, 1,
[Define if your assembler supports R_PPC*_PLTSEQ relocations.])])
@@ -5146,7 +5053,7 @@ LCF0:
case $target in
*-*-aix*)
gcc_GAS_CHECK_FEATURE([AIX .ref support],
- gcc_cv_as_aix_ref, [2,21,0],,
+ gcc_cv_as_aix_ref,,
[ .csect stuff[[rw]]
stuff:
.long 1
@@ -5157,7 +5064,7 @@ LCF0:
[Define if your assembler supports .ref])])
gcc_GAS_CHECK_FEATURE([AIX DWARF location lists section support],
- gcc_cv_as_aix_dwloc, [2,21,0],,
+ gcc_cv_as_aix_dwloc,,
[ .dwsect 0xA0000
Lframe..0:
.vbyte 4,Lframe..0
@@ -5170,7 +5077,7 @@ LCF0:
mips*-*-*)
gcc_GAS_CHECK_FEATURE([explicit relocation support],
- gcc_cv_as_mips_explicit_relocs, [2,14,0],,
+ gcc_cv_as_mips_explicit_relocs,,
[ lw $4,%gp_rel(foo)($4)],,
[if test x$target_cpu_default = x
then target_cpu_default=MASK_EXPLICIT_RELOCS
@@ -5178,18 +5085,18 @@ LCF0:
fi])
gcc_GAS_CHECK_FEATURE([-mno-shared support],
- gcc_cv_as_mips_no_shared, [2,16,0], [-mno-shared], [nop],,
+ gcc_cv_as_mips_no_shared,[-mno-shared], [nop],,
[AC_DEFINE(HAVE_AS_NO_SHARED, 1,
[Define if the assembler understands -mno-shared.])])
gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
- gcc_cv_as_mips_gnu_attribute, [2,18,0],,
+ gcc_cv_as_mips_gnu_attribute,,
[.gnu_attribute 4,1],,
[AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
[Define if your assembler supports .gnu_attribute.])])
gcc_GAS_CHECK_FEATURE([.module support],
- gcc_cv_as_mips_dot_module,,[-32],
+ gcc_cv_as_mips_dot_module,[-32],
[.module mips2
.module fp=xx],,
[AC_DEFINE(HAVE_AS_DOT_MODULE, 1,
@@ -5201,13 +5108,13 @@ LCF0:
fi
gcc_GAS_CHECK_FEATURE([.micromips support],
- gcc_cv_as_micromips_support,,[--fatal-warnings],
+ gcc_cv_as_micromips_support,[--fatal-warnings],
[.set micromips],,
[AC_DEFINE(HAVE_GAS_MICROMIPS, 1,
[Define if your assembler supports the .set micromips directive])])
gcc_GAS_CHECK_FEATURE([.dtprelword support],
- gcc_cv_as_mips_dtprelword, [2,18,0],,
+ gcc_cv_as_mips_dtprelword,,
[.section .tdata,"awT",@progbits
x:
.word 2
@@ -5217,7 +5124,7 @@ x:
[Define if your assembler supports .dtprelword.])])
gcc_GAS_CHECK_FEATURE([DSPR1 mult with four accumulators support],
- gcc_cv_as_mips_dspr1_mult,,,
+ gcc_cv_as_mips_dspr1_mult,,
[ .set mips32r2
.set nodspr2
.set dsp
@@ -5312,7 +5219,7 @@ pointers into PC-relative form.])
fi
gcc_GAS_CHECK_FEATURE([-mnan= support],
- gcc_cv_as_mips_nan,,
+ gcc_cv_as_mips_nan,
[-mnan=2008],,,
[AC_DEFINE(HAVE_AS_NAN, 1,
[Define if the assembler understands -mnan=.])])
@@ -5326,12 +5233,12 @@ pointers into PC-relative form.])
# Earlier GAS versions generically support .gnu_attribute, but the
# msp430 assembler will not do anything with it.
gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
- gcc_cv_as_msp430_gnu_attribute, [2,33,50],,
+ gcc_cv_as_msp430_gnu_attribute,,
[.gnu_attribute 4,1],,
[AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
[Define if your assembler supports .gnu_attribute.])])
gcc_GAS_CHECK_FEATURE([.mspabi_attribute support],
- gcc_cv_as_msp430_mspabi_attribute, [2,33,50],,
+ gcc_cv_as_msp430_mspabi_attribute,,
[.mspabi_attribute 4,2],,
[AC_DEFINE(HAVE_AS_MSPABI_ATTRIBUTE, 1,
[Define if your assembler supports .mspabi_attribute.])])
@@ -5344,7 +5251,7 @@ configured with --enable-newlib-nano-formatted-io.])
# Versions 2.33 and earlier lacked support for the %gotoff relocation
# syntax that is documented in the ABI specification.
gcc_GAS_CHECK_FEATURE([support for %gotoff relocations in constant data],
- gcc_cv_as_nios2_gotoff_relocation,,,
+ gcc_cv_as_nios2_gotoff_relocation,,
[ .extern foo
.data
.long %gotoff(foo)],,
@@ -5353,29 +5260,29 @@ configured with --enable-newlib-nano-formatted-io.])
;;
riscv*-*-*)
gcc_GAS_CHECK_FEATURE([.attribute support],
- gcc_cv_as_riscv_attribute, [2,32,0],,
+ gcc_cv_as_riscv_attribute,,
[.attribute stack_align,4],,
[AC_DEFINE(HAVE_AS_RISCV_ATTRIBUTE, 1,
[Define if your assembler supports .attribute.])])
gcc_GAS_CHECK_FEATURE([-misa-spec= support],
- gcc_cv_as_riscv_isa_spec,,
+ gcc_cv_as_riscv_isa_spec,
[-misa-spec=2.2],,,
[AC_DEFINE(HAVE_AS_MISA_SPEC, 1,
[Define if the assembler understands -misa-spec=.])])
gcc_GAS_CHECK_FEATURE([-march=rv32i_zifencei support],
- gcc_cv_as_riscv_march_zifencei,,
+ gcc_cv_as_riscv_march_zifencei,
[-march=rv32i_zifencei],,,
[AC_DEFINE(HAVE_AS_MARCH_ZIFENCEI, 1,
[Define if the assembler understands -march=rv*_zifencei.])])
;;
s390*-*-*)
gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
- gcc_cv_as_s390_gnu_attribute, [2,18,0],,
+ gcc_cv_as_s390_gnu_attribute,,
[.gnu_attribute 8,1],,
[AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
[Define if your assembler supports .gnu_attribute.])])
gcc_GAS_CHECK_FEATURE([.machine and .machinemode support],
- gcc_cv_as_s390_machine_machinemode, [2,24,0],,
+ gcc_cv_as_s390_machine_machinemode,,
[ .machinemode push
.machinemode pop
.machine push
@@ -5383,17 +5290,17 @@ configured with --enable-newlib-nano-formatted-io.])
[AC_DEFINE(HAVE_AS_MACHINE_MACHINEMODE, 1,
[Define if your assembler supports .machine and .machinemode.])])
gcc_GAS_CHECK_FEATURE([architecture modifiers support],
- gcc_cv_as_s390_architecture_modifiers, [2,26,0],,
+ gcc_cv_as_s390_architecture_modifiers,,
[ .machine z13+vx ],,
[AC_DEFINE(HAVE_AS_ARCHITECTURE_MODIFIERS, 1,
[Define if your assembler supports architecture modifiers.])])
gcc_GAS_CHECK_FEATURE([vector load/store alignment hints],
- gcc_cv_as_s390_vector_loadstore_alignment_hints, [2,31,0],,
+ gcc_cv_as_s390_vector_loadstore_alignment_hints,,
[ vl %v24,0(%r15),3 ],,
[AC_DEFINE(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS, 1,
[Define if your assembler supports vl/vst/vlm/vstm with an optional alignment hint argument.])])
gcc_GAS_CHECK_FEATURE([vector load/store alignment hints on z13],
- gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13,, [-mzarch -march=z13],
+ gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13, [-mzarch -march=z13],
[ vl %v24,0(%r15),3 ],,
[AC_DEFINE(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13, 1,
[Define if your assembler supports vl/vst/vlm/vstm with an optional alignment hint argument on z13.])])
@@ -5494,8 +5401,8 @@ if test x"$insn" != x; then
.loc 1 3 0
$insn"
gcc_GAS_CHECK_FEATURE([dwarf2 debug_line support],
- gcc_cv_as_dwarf2_debug_line,
- [elf,2,11,0],, [$conftest_s],
+ gcc_cv_as_dwarf2_debug_line,,
+ [$conftest_s],
[if test x$gcc_cv_objdump != x \
&& $gcc_cv_objdump -h conftest.o 2> /dev/null \
| grep debug_line > /dev/null 2>&1; then
@@ -5511,7 +5418,7 @@ if test x"$insn" != x; then
# by DW_AT_decl_file. Approximate this test by testing if
# the assembler bitches if the same index is assigned twice.
gcc_GAS_CHECK_FEATURE([buggy dwarf2 .file directive],
- gcc_cv_as_dwarf2_file_buggy,,,
+ gcc_cv_as_dwarf2_file_buggy,,
[ .file 1 "foo.s"
.file 1 "bar.s"])
@@ -5531,8 +5438,8 @@ if test x"$insn" != x; then
.uleb128 .LVU1
"
gcc_GAS_CHECK_FEATURE([dwarf2 debug_view support],
- gcc_cv_as_dwarf2_debug_view,
- [elf,2,27,0],,[$conftest_s],,
+ gcc_cv_as_dwarf2_debug_view,,
+ [$conftest_s],,
[AC_DEFINE(HAVE_AS_DWARF2_DEBUG_VIEW, 1,
[Define if your assembler supports views in dwarf2 .loc directives.])])
fi
@@ -5540,13 +5447,13 @@ if test x"$insn" != x; then
gcc_GAS_CHECK_FEATURE([--gdwarf2 option],
gcc_cv_as_gdwarf2_flag,
- [elf,2,11,0], [--gdwarf2], [$insn],,
+ [--gdwarf2], [$insn],,
[AC_DEFINE(HAVE_AS_GDWARF2_DEBUG_FLAG, 1,
[Define if your assembler supports the --gdwarf2 option.])])
gcc_GAS_CHECK_FEATURE([--gdwarf-5 option],
gcc_cv_as_gdwarf_5_flag,
- [elf,2,36,0], [--gdwarf-5], [$insn],
+ [--gdwarf-5], [$insn],
[if test x$gcc_cv_objdump != x \
&& $gcc_cv_objdump -Wi conftest.o 2>&1 \
| grep DW_TAG_compile_unit > /dev/null 2>&1; then
@@ -5723,20 +5630,20 @@ foo:
dwarf4_success=no
if test $dwarf4_addr_size = 4; then
gcc_GAS_CHECK_FEATURE([assembly of compiler generated 32-bit .debug_line],
- gcc_cv_as_debug_line_32_flag,
- [elf,2,36,0], [], [$conftest_s],,
+ gcc_cv_as_debug_line_32_flag,,
+ [$conftest_s],,
[dwarf4_success=yes])
else
gcc_GAS_CHECK_FEATURE([assembly of compiler generated 64-bit .debug_line],
- gcc_cv_as_debug_line_64_flag,
- [elf,2,36,0], [], [$conftest_s],,
+ gcc_cv_as_debug_line_64_flag,,
+ [$conftest_s],,
[dwarf4_success=yes])
fi
if test $dwarf4_success = yes; then
dwarf4_success=no
gcc_GAS_CHECK_FEATURE([--gdwarf-4 not refusing compiler generated .debug_line],
gcc_cv_as_dwarf_4_debug_line_flag,
- [elf,2,36,0], [--gdwarf-4], [$conftest_s],,
+ [--gdwarf-4], [$conftest_s],,
[dwarf4_success=yes])
break
fi
@@ -5765,7 +5672,7 @@ foo:
"
dwarf4_success=no
gcc_GAS_CHECK_FEATURE([--gdwarf-4 with the APP marker],
- gcc_cv_as_dwarf_4_app_flag,,
+ gcc_cv_as_dwarf_4_app_flag,
[--gdwarf-4], [$conftest_s],, [dwarf4_success=yes])
fi
@@ -5780,7 +5687,7 @@ foo:
.file 1 \"foo.c\"
"
gcc_GAS_CHECK_FEATURE([working --gdwarf-4/--gdwarf-5 for all sources],
- gcc_cv_as_working_gdwarf_n_flag,,
+ gcc_cv_as_working_gdwarf_n_flag,
[--gdwarf-4],
[$conftest_s],
[changequote(,)dnl
@@ -5801,19 +5708,19 @@ foo:
gcc_GAS_CHECK_FEATURE([--gstabs option],
gcc_cv_as_gstabs_flag,
- [elf,2,11,0], [--gstabs], [$insn],,
+ [--gstabs], [$insn],,
[AC_DEFINE(HAVE_AS_GSTABS_DEBUG_FLAG, 1,
[Define if your assembler supports the --gstabs option.])])
gcc_GAS_CHECK_FEATURE([--debug-prefix-map option],
gcc_cv_as_debug_prefix_map_flag,
- [2,18,0], [--debug-prefix-map /a=/b], [$insn],,
+ [--debug-prefix-map /a=/b], [$insn],,
[AC_DEFINE(HAVE_AS_DEBUG_PREFIX_MAP, 1,
[Define if your assembler supports the --debug-prefix-map option.])])
fi
gcc_GAS_CHECK_FEATURE([compressed debug sections],
- gcc_cv_as_compress_debug,,,,
+ gcc_cv_as_compress_debug,,,
[# gas compiled without zlib cannot compress debug sections and warns
# about it, but still exits successfully. So check for this, too.
if $gcc_cv_as --compress-debug-sections -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null
@@ -5843,8 +5750,7 @@ AC_DEFINE_UNQUOTED(AS_COMPRESS_DEBUG_OPTION, "$gcc_cv_as_compress_debug_option",
AC_DEFINE_UNQUOTED(AS_NO_COMPRESS_DEBUG_OPTION, "$gcc_cv_as_no_compress_debug_option",
[Define to the assembler option to disable compressed debug sections.])
-gcc_GAS_CHECK_FEATURE([.lcomm with alignment], gcc_cv_as_lcomm_with_alignment,
- ,,
+gcc_GAS_CHECK_FEATURE([.lcomm with alignment], gcc_cv_as_lcomm_with_alignment,,
[.lcomm bar,4,16],,
[AC_DEFINE(HAVE_GAS_LCOMM_WITH_ALIGNMENT, 1,
[Define if your assembler supports .lcomm with an alignment field.])])
@@ -5889,8 +5795,7 @@ AC_ARG_ENABLE(gnu-unique-object,
*) AC_MSG_ERROR(['$enable_gnu_unique_object' is an invalid value for --enable-gnu-unique-object.
Valid choices are 'yes' and 'no'.]) ;;
esac],
- [gcc_GAS_CHECK_FEATURE([gnu_unique_object], gcc_cv_as_gnu_unique_object,
- [elf,2,19,52],,
+ [gcc_GAS_CHECK_FEATURE([gnu_unique_object], gcc_cv_as_gnu_unique_object,,
[.type foo, '$target_type_format_char'gnu_unique_object],,
# We need to unquote above to to use the definition from config.gcc.
# Also check for ld.so support, i.e. glibc 2.11 or higher.
@@ -5904,9 +5809,7 @@ fi
AC_CACHE_CHECK([assembler for tolerance to line number 0],
[gcc_cv_as_line_zero],
[gcc_cv_as_line_zero=no
- if test $in_tree_gas = yes; then
- gcc_GAS_VERSION_GTE_IFELSE(2, 16, 91, [gcc_cv_as_line_zero=yes])
- elif test "x$gcc_cv_as" != x; then
+ if test "x$gcc_cv_as" != x; then
{ echo '# 1 "test.s" 1'; echo '# 0 "" 2'; } > conftest.s
if AC_TRY_COMMAND([$gcc_cv_as -o conftest.o conftest.s >&AS_MESSAGE_LOG_FD 2>conftest.out]) &&
test "x`cat conftest.out`" = x
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a06a496..d496202 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,7 +1,36 @@
+2021-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ * parser.c (cp_parser_handle_statement_omp_attributes): Determine if
+ PRAGMA_OMP_ERROR directive is C_OMP_DIR_STANDALONE.
+ (cp_parser_omp_error): New function.
+ (cp_parser_pragma): Handle PRAGMA_OMP_ERROR.
+
+2021-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ * parser.c (cp_parser_omp_clause_depend_sink): Reject spurious
+ comma at the end of list. Don't parse closing paren here...
+ (cp_parser_omp_clause_depend): ... but here instead.
+
+2021-08-19 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/101803
+ * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT): Clarify comment.
+
+2021-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ * parser.c (cp_parser_omp_requires): Don't call cp_lexer_nth_token_is
+ and optionally consume token if current token is CPP_EOF,
+ CPP_PRAGMA_EOL or CPP_CLOSE_PAREN.
+
+2021-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ * parser.c (cp_parser_omp_nothing): Use cp_parser_require_pragma_eol
+ instead of cp_parser_skip_to_pragma_eol.
+
2021-08-18 Patrick Palka <ppalka@redhat.com>
PR c++/101344
- PR c++/101820
+ PR c++/101803
* cp-tree.h (CONSTRUCTOR_BRACES_ELIDED_P): Define.
* decl.c (reshape_init_r): Set it.
* pt.c (collect_ctor_idx_types): Recurse into a sub-CONSTRUCTOR
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 7ba02be..75ee887 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4503,8 +4503,8 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define CONSTRUCTOR_IS_PAREN_INIT(NODE) \
(CONSTRUCTOR_CHECK(NODE)->base.private_flag)
-/* True if reshape_init built this CONSTRUCTOR to undo the brace elision
- of another CONSTRUCTOR. This flag is used during C++20 aggregate
+/* True if reshape_init built this sub-CONSTRUCTOR to undo the brace elision
+ of the original CONSTRUCTOR. This flag is used during C++20 aggregate
CTAD. */
#define CONSTRUCTOR_BRACES_ELIDED_P(NODE) \
(CONSTRUCTOR_CHECK (NODE)->base.protected_flag)
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 0af1a2c..a959c71 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -11760,10 +11760,30 @@ cp_parser_handle_statement_omp_attributes (cp_parser *parser, tree attrs)
"depend") == 0)
kind = C_OMP_DIR_STANDALONE;
}
- /* else if (dir->id == PRAGMA_OMP_ERROR)
+ else if (dir->id == PRAGMA_OMP_ERROR)
{
- error with at(execution) clause is C_OMP_DIR_STANDALONE.
- } */
+ /* error with at(execution) clause is C_OMP_DIR_STANDALONE. */
+ int paren_depth = 0;
+ for (int i = 1; first + i < last; i++)
+ if (first[i].type == CPP_OPEN_PAREN)
+ paren_depth++;
+ else if (first[i].type == CPP_CLOSE_PAREN)
+ paren_depth--;
+ else if (paren_depth == 0
+ && first + i + 2 < last
+ && first[i].type == CPP_NAME
+ && first[i + 1].type == CPP_OPEN_PAREN
+ && first[i + 2].type == CPP_NAME
+ && !strcmp (IDENTIFIER_POINTER (first[i].u.value),
+ "at")
+ && !strcmp (IDENTIFIER_POINTER (first[i
+ + 2].u.value),
+ "execution"))
+ {
+ kind = C_OMP_DIR_STANDALONE;
+ break;
+ }
+ }
cp_omp_attribute_data v = { DEFPARSE_TOKENS (d), dir, kind };
vec.safe_push (v);
if (flag_openmp || dir->simd)
@@ -37217,7 +37237,10 @@ cp_parser_omp_clause_num_threads (cp_parser *parser, tree list,
}
/* OpenMP 4.5:
- num_tasks ( expression ) */
+ num_tasks ( expression )
+
+ OpenMP 5.1:
+ num_tasks ( strict : expression ) */
static tree
cp_parser_omp_clause_num_tasks (cp_parser *parser, tree list,
@@ -37229,6 +37252,19 @@ cp_parser_omp_clause_num_tasks (cp_parser *parser, tree list,
if (!parens.require_open (parser))
return list;
+ bool strict = false;
+ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
+ && cp_lexer_nth_token_is (parser->lexer, 2, CPP_COLON))
+ {
+ tree id = cp_lexer_peek_token (parser->lexer)->u.value;
+ if (!strcmp (IDENTIFIER_POINTER (id), "strict"))
+ {
+ strict = true;
+ cp_lexer_consume_token (parser->lexer);
+ cp_lexer_consume_token (parser->lexer);
+ }
+ }
+
t = cp_parser_assignment_expression (parser);
if (t == error_mark_node
@@ -37242,13 +37278,17 @@ cp_parser_omp_clause_num_tasks (cp_parser *parser, tree list,
c = build_omp_clause (location, OMP_CLAUSE_NUM_TASKS);
OMP_CLAUSE_NUM_TASKS_EXPR (c) = t;
+ OMP_CLAUSE_NUM_TASKS_STRICT (c) = strict;
OMP_CLAUSE_CHAIN (c) = list;
return c;
}
/* OpenMP 4.5:
- grainsize ( expression ) */
+ grainsize ( expression )
+
+ OpenMP 5.1:
+ grainsize ( strict : expression ) */
static tree
cp_parser_omp_clause_grainsize (cp_parser *parser, tree list,
@@ -37260,6 +37300,19 @@ cp_parser_omp_clause_grainsize (cp_parser *parser, tree list,
if (!parens.require_open (parser))
return list;
+ bool strict = false;
+ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
+ && cp_lexer_nth_token_is (parser->lexer, 2, CPP_COLON))
+ {
+ tree id = cp_lexer_peek_token (parser->lexer)->u.value;
+ if (!strcmp (IDENTIFIER_POINTER (id), "strict"))
+ {
+ strict = true;
+ cp_lexer_consume_token (parser->lexer);
+ cp_lexer_consume_token (parser->lexer);
+ }
+ }
+
t = cp_parser_assignment_expression (parser);
if (t == error_mark_node
@@ -37273,6 +37326,7 @@ cp_parser_omp_clause_grainsize (cp_parser *parser, tree list,
c = build_omp_clause (location, OMP_CLAUSE_GRAINSIZE);
OMP_CLAUSE_GRAINSIZE_EXPR (c) = t;
+ OMP_CLAUSE_GRAINSIZE_STRICT (c) = strict;
OMP_CLAUSE_CHAIN (c) = list;
return c;
@@ -38465,13 +38519,14 @@ cp_parser_omp_clause_depend_sink (cp_parser *parser, location_t clause_loc,
OMP_CLAUSE_DEPEND_SINK_NEGATIVE (vec) = 1;
}
- if (cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA))
+ if (cp_lexer_next_token_is_not (parser->lexer, CPP_COMMA)
+ || !cp_lexer_nth_token_is (parser->lexer, 2, CPP_NAME))
break;
cp_lexer_consume_token (parser->lexer);
}
- if (cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN) && vec)
+ if (vec)
{
tree u = build_omp_clause (clause_loc, OMP_CLAUSE_DEPEND);
OMP_CLAUSE_DEPEND_KIND (u) = OMP_CLAUSE_DEPEND_SINK;
@@ -38791,7 +38846,13 @@ cp_parser_omp_clause_depend (cp_parser *parser, tree list, location_t loc)
goto resync_fail;
if (kind == OMP_CLAUSE_DEPEND_SINK)
- nlist = cp_parser_omp_clause_depend_sink (parser, loc, list);
+ {
+ nlist = cp_parser_omp_clause_depend_sink (parser, loc, list);
+ if (!parens.require_close (parser))
+ cp_parser_skip_to_closing_parenthesis (parser, /*recovering=*/true,
+ /*or_comma=*/false,
+ /*consume_paren=*/true);
+ }
else
{
nlist = cp_parser_omp_var_list_no_open (parser, OMP_CLAUSE_DEPEND,
@@ -45583,6 +45644,184 @@ cp_parser_omp_nothing (cp_parser *parser, cp_token *pragma_tok)
}
+/* OpenMP 5.1
+ #pragma omp error clauses[optseq] new-line */
+
+static bool
+cp_parser_omp_error (cp_parser *parser, cp_token *pragma_tok,
+ enum pragma_context context)
+{
+ int at_compilation = -1;
+ int severity_fatal = -1;
+ tree message = NULL_TREE;
+ bool first = true;
+ bool bad = false;
+ location_t loc = pragma_tok->location;
+
+ while (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL))
+ {
+ /* For now only in C++ attributes, do it always for OpenMP 5.1. */
+ if ((!first || parser->lexer->in_omp_attribute_pragma)
+ && cp_lexer_next_token_is (parser->lexer, CPP_COMMA)
+ && cp_lexer_nth_token_is (parser->lexer, 2, CPP_NAME))
+ cp_lexer_consume_token (parser->lexer);
+
+ first = false;
+
+ if (cp_lexer_next_token_is_not (parser->lexer, CPP_NAME))
+ break;
+
+ const char *p
+ = IDENTIFIER_POINTER (cp_lexer_peek_token (parser->lexer)->u.value);
+ location_t cloc = cp_lexer_peek_token (parser->lexer)->location;
+ static const char *args[] = {
+ "execution", "compilation", "warning", "fatal"
+ };
+ int *v = NULL;
+ int idx = 0, n = -1;
+ tree m = NULL_TREE;
+
+ if (!strcmp (p, "at"))
+ v = &at_compilation;
+ else if (!strcmp (p, "severity"))
+ {
+ v = &severity_fatal;
+ idx += 2;
+ }
+ else if (strcmp (p, "message"))
+ {
+ error_at (cloc,
+ "expected %<at%>, %<severity%> or %<message%> clause");
+ cp_parser_skip_to_pragma_eol (parser, pragma_tok);
+ return false;
+ }
+
+ cp_lexer_consume_token (parser->lexer);
+
+ matching_parens parens;
+ if (parens.require_open (parser))
+ {
+ if (v == NULL)
+ {
+ m = cp_parser_assignment_expression (parser);
+ if (type_dependent_expression_p (m))
+ m = build1 (IMPLICIT_CONV_EXPR, const_string_type_node, m);
+ else
+ m = perform_implicit_conversion_flags (const_string_type_node, m,
+ tf_warning_or_error,
+ LOOKUP_NORMAL);
+ }
+ else
+ {
+ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME))
+ {
+ tree val = cp_lexer_peek_token (parser->lexer)->u.value;
+ const char *q = IDENTIFIER_POINTER (val);
+
+ if (!strcmp (q, args[idx]))
+ n = 0;
+ else if (!strcmp (q, args[idx + 1]))
+ n = 1;
+ }
+ if (n == -1)
+ {
+ error_at (cp_lexer_peek_token (parser->lexer)->location,
+ "expected %qs or %qs", args[idx], args[idx + 1]);
+ bad = true;
+ switch (cp_lexer_peek_token (parser->lexer)->type)
+ {
+ case CPP_EOF:
+ case CPP_PRAGMA_EOL:
+ case CPP_CLOSE_PAREN:
+ break;
+ default:
+ if (cp_lexer_nth_token_is (parser->lexer, 2,
+ CPP_CLOSE_PAREN))
+ cp_lexer_consume_token (parser->lexer);
+ break;
+ }
+ }
+ else
+ cp_lexer_consume_token (parser->lexer);
+ }
+
+ if (!parens.require_close (parser))
+ cp_parser_skip_to_closing_parenthesis (parser,
+ /*recovering=*/true,
+ /*or_comma=*/false,
+ /*consume_paren=*/
+ true);
+
+ if (v == NULL)
+ {
+ if (message)
+ {
+ error_at (cloc, "too many %qs clauses", p);
+ bad = true;
+ }
+ else
+ message = m;
+ }
+ else if (n != -1)
+ {
+ if (*v != -1)
+ {
+ error_at (cloc, "too many %qs clauses", p);
+ bad = true;
+ }
+ else
+ *v = n;
+ }
+ }
+ else
+ bad = true;
+ }
+ cp_parser_require_pragma_eol (parser, pragma_tok);
+ if (bad)
+ return true;
+
+ if (at_compilation == -1)
+ at_compilation = 1;
+ if (severity_fatal == -1)
+ severity_fatal = 1;
+ if (!at_compilation)
+ {
+ if (context != pragma_compound)
+ {
+ error_at (loc, "%<#pragma omp error%> with %<at(execution)%> clause "
+ "may only be used in compound statements");
+ return true;
+ }
+ tree fndecl
+ = builtin_decl_explicit (severity_fatal ? BUILT_IN_GOMP_ERROR
+ : BUILT_IN_GOMP_WARNING);
+ if (!message)
+ message = build_zero_cst (const_string_type_node);
+ tree stmt = build_call_expr_loc (loc, fndecl, 2, message,
+ build_all_ones_cst (size_type_node));
+ add_stmt (stmt);
+ return true;
+ }
+
+ if (in_discarded_stmt)
+ return false;
+
+ const char *msg = NULL;
+ if (message)
+ {
+ msg = c_getstr (fold_for_warn (message));
+ if (msg == NULL)
+ msg = _("<message unknown at compile time>");
+ }
+ if (msg)
+ emit_diagnostic (severity_fatal ? DK_ERROR : DK_WARNING, loc, 0,
+ "%<pragma omp error%> encountered: %s", msg);
+ else
+ emit_diagnostic (severity_fatal ? DK_ERROR : DK_WARNING, loc, 0,
+ "%<pragma omp error%> encountered");
+ return false;
+}
+
/* OpenMP 4.5:
#pragma omp taskloop taskloop-clause[optseq] new-line
for-loop
@@ -46696,6 +46935,9 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p)
cp_parser_omp_nothing (parser, pragma_tok);
return false;
+ case PRAGMA_OMP_ERROR:
+ return cp_parser_omp_error (parser, pragma_tok, context);
+
case PRAGMA_OMP_ORDERED:
if (context != pragma_stmt && context != pragma_compound)
goto bad_stmt;
diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def
index 2345899..c2bcc4e 100644
--- a/gcc/dbgcnt.def
+++ b/gcc/dbgcnt.def
@@ -175,6 +175,7 @@ DEBUG_COUNTER (ipa_cp_bits)
DEBUG_COUNTER (ipa_cp_values)
DEBUG_COUNTER (ipa_cp_vr)
DEBUG_COUNTER (ipa_mod_ref)
+DEBUG_COUNTER (ipa_mod_ref_pta)
DEBUG_COUNTER (ipa_sra_params)
DEBUG_COUNTER (ipa_sra_retvalues)
DEBUG_COUNTER (ira_move)
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ba0a6d6..07a479f 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -24476,7 +24476,26 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
&& DECL_RTL_SET_P (decl_or_origin))))
{
if (early_dwarf)
- add_pubname (decl_or_origin, var_die);
+ {
+ add_pubname (decl_or_origin, var_die);
+ /* For global register variables, emit DW_AT_location if possible
+ already during early_dwarf, as late_global_decl won't be usually
+ called. */
+ if (DECL_HARD_REGISTER (decl_or_origin)
+ && TREE_STATIC (decl_or_origin)
+ && !decl_by_reference_p (decl_or_origin)
+ && !get_AT (var_die, DW_AT_location)
+ && !get_AT (var_die, DW_AT_const_value)
+ && DECL_RTL_SET_P (decl_or_origin)
+ && REG_P (DECL_RTL (decl_or_origin)))
+ {
+ dw_loc_descr_ref descr
+ = reg_loc_descriptor (DECL_RTL (decl_or_origin),
+ VAR_INIT_STATUS_INITIALIZED);
+ if (descr)
+ add_AT_loc (var_die, DW_AT_location, descr);
+ }
+ }
else
add_location_or_const_value_attribute (var_die, decl_or_origin,
decl == NULL);
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 90a3e53..7da56e7 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,58 @@
+2021-08-20 Tobias Burnus <tobias@codesourcery.com>
+
+ * error.c
+ (error_uinteger): Take 'long long unsigned' instead
+ of 'long unsigned' as argumpent.
+ (error_integer): Take 'long long' instead of 'long'.
+ (error_hwuint, error_hwint): New.
+ (error_print): Update to handle 'll' and 'w'
+ length modifiers.
+ * simplify.c (substring_has_constant_len): Use '%wd'
+ in gfc_error.
+
+2021-08-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/100950
+ * simplify.c (substring_has_constant_len): Fix format string of
+ gfc_error, pass HOST_WIDE_INT bounds values via char buffer.
+
+2021-08-20 Tobias Burnus <tobias@codesourcery.com>
+
+ * dump-parse-tree.c (show_omp_clauses): Handle 'at', 'severity'
+ and 'message' clauses.
+ (show_omp_node, show_code_node): Handle EXEC_OMP_ERROR.
+ * gfortran.h (gfc_statement): Add ST_OMP_ERROR.
+ (gfc_omp_severity_type, gfc_omp_at_type): New.
+ (gfc_omp_clauses): Add 'at', 'severity' and 'message' clause;
+ use more bitfields + ENUM_BITFIELD.
+ (gfc_exec_op): Add EXEC_OMP_ERROR.
+ * match.h (gfc_match_omp_error): New.
+ * openmp.c (enum omp_mask1): Add OMP_CLAUSE_(AT,SEVERITY,MESSAGE).
+ (gfc_match_omp_clauses): Handle new clauses.
+ (OMP_ERROR_CLAUSES, gfc_match_omp_error): New.
+ (resolve_omp_clauses): Resolve new clauses.
+ (omp_code_to_statement, gfc_resolve_omp_directive): Handle
+ EXEC_OMP_ERROR.
+ * parse.c (decode_omp_directive, next_statement,
+ gfc_ascii_statement): Handle 'omp error'.
+ * resolve.c (gfc_resolve_blocks): Likewise.
+ * st.c (gfc_free_statement): Likewise.
+ * trans-openmp.c (gfc_trans_omp_error): Likewise.
+ (gfc_trans_omp_directive): Likewise.
+ * trans.c (trans_code): Likewise.
+
+2021-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ * types.def (BT_FN_VOID_CONST_PTR_SIZE): New DEF_FUNCTION_TYPE_2.
+ * f95-lang.c (ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST): Define.
+
+2021-08-19 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/100950
+ * simplify.c (substring_has_constant_len): New.
+ (gfc_simplify_len): Handle case of substrings with constant
+ bounds.
+
2021-08-18 Tobias Burnus <tobias@codesourcery.com>
* match.h (gfc_match_omp_nothing): New.
diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c
index 92d9f9e..c75a0a9 100644
--- a/gcc/fortran/dump-parse-tree.c
+++ b/gcc/fortran/dump-parse-tree.c
@@ -1908,6 +1908,26 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses)
fputc (' ', dumpfile);
fputs (memorder, dumpfile);
}
+ if (omp_clauses->at != OMP_AT_UNSET)
+ {
+ if (omp_clauses->at != OMP_AT_COMPILATION)
+ fputs (" AT (COMPILATION)", dumpfile);
+ else
+ fputs (" AT (EXECUTION)", dumpfile);
+ }
+ if (omp_clauses->severity != OMP_SEVERITY_UNSET)
+ {
+ if (omp_clauses->severity != OMP_SEVERITY_FATAL)
+ fputs (" SEVERITY (FATAL)", dumpfile);
+ else
+ fputs (" SEVERITY (WARNING)", dumpfile);
+ }
+ if (omp_clauses->message)
+ {
+ fputs (" ERROR (", dumpfile);
+ show_expr (omp_clauses->message);
+ fputc (')', dumpfile);
+ }
}
/* Show a single OpenMP or OpenACC directive node and everything underneath it
@@ -1950,8 +1970,9 @@ show_omp_node (int level, gfc_code *c)
case EXEC_OMP_DISTRIBUTE_SIMD: name = "DISTRIBUTE SIMD"; break;
case EXEC_OMP_DO: name = "DO"; break;
case EXEC_OMP_DO_SIMD: name = "DO SIMD"; break;
- case EXEC_OMP_LOOP: name = "LOOP"; break;
+ case EXEC_OMP_ERROR: name = "ERROR"; break;
case EXEC_OMP_FLUSH: name = "FLUSH"; break;
+ case EXEC_OMP_LOOP: name = "LOOP"; break;
case EXEC_OMP_MASKED: name = "MASKED"; break;
case EXEC_OMP_MASKED_TASKLOOP: name = "MASKED TASKLOOP"; break;
case EXEC_OMP_MASKED_TASKLOOP_SIMD: name = "MASKED TASKLOOP SIMD"; break;
@@ -2045,6 +2066,7 @@ show_omp_node (int level, gfc_code *c)
case EXEC_OMP_DISTRIBUTE_SIMD:
case EXEC_OMP_DO:
case EXEC_OMP_DO_SIMD:
+ case EXEC_OMP_ERROR:
case EXEC_OMP_LOOP:
case EXEC_OMP_ORDERED:
case EXEC_OMP_MASKED:
@@ -2135,7 +2157,7 @@ show_omp_node (int level, gfc_code *c)
|| c->op == EXEC_OACC_ENTER_DATA || c->op == EXEC_OACC_EXIT_DATA
|| c->op == EXEC_OMP_TARGET_UPDATE || c->op == EXEC_OMP_TARGET_ENTER_DATA
|| c->op == EXEC_OMP_TARGET_EXIT_DATA || c->op == EXEC_OMP_SCAN
- || c->op == EXEC_OMP_DEPOBJ
+ || c->op == EXEC_OMP_DEPOBJ || c->op == EXEC_OMP_ERROR
|| (c->op == EXEC_OMP_ORDERED && c->block == NULL))
return;
if (c->op == EXEC_OMP_SECTIONS || c->op == EXEC_OMP_PARALLEL_SECTIONS)
@@ -3268,6 +3290,7 @@ show_code_node (int level, gfc_code *c)
case EXEC_OMP_DISTRIBUTE_SIMD:
case EXEC_OMP_DO:
case EXEC_OMP_DO_SIMD:
+ case EXEC_OMP_ERROR:
case EXEC_OMP_FLUSH:
case EXEC_OMP_LOOP:
case EXEC_OMP_MASKED:
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index 529d97f..5e6e873 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -136,7 +136,7 @@ error_string (const char *p)
#define IBUF_LEN 60
static void
-error_uinteger (unsigned long int i)
+error_uinteger (unsigned long long int i)
{
char *p, int_buf[IBUF_LEN];
@@ -156,13 +156,50 @@ error_uinteger (unsigned long int i)
}
static void
-error_integer (long int i)
+error_integer (long long int i)
{
- unsigned long int u;
+ unsigned long long int u;
if (i < 0)
{
- u = (unsigned long int) -i;
+ u = (unsigned long long int) -i;
+ error_char ('-');
+ }
+ else
+ u = i;
+
+ error_uinteger (u);
+}
+
+
+static void
+error_hwuint (unsigned HOST_WIDE_INT i)
+{
+ char *p, int_buf[IBUF_LEN];
+
+ p = int_buf + IBUF_LEN - 1;
+ *p-- = '\0';
+
+ if (i == 0)
+ *p-- = '0';
+
+ while (i > 0)
+ {
+ *p-- = i % 10 + '0';
+ i = i / 10;
+ }
+
+ error_string (p + 1);
+}
+
+static void
+error_hwint (HOST_WIDE_INT i)
+{
+ unsigned HOST_WIDE_INT u;
+
+ if (i < 0)
+ {
+ u = (unsigned HOST_WIDE_INT) -i;
error_char ('-');
}
else
@@ -482,8 +519,8 @@ static void ATTRIBUTE_GCC_GFC(2,0)
error_print (const char *type, const char *format0, va_list argp)
{
enum { TYPE_CURRENTLOC, TYPE_LOCUS, TYPE_INTEGER, TYPE_UINTEGER,
- TYPE_LONGINT, TYPE_ULONGINT, TYPE_CHAR, TYPE_STRING,
- NOTYPE };
+ TYPE_LONGINT, TYPE_ULONGINT, TYPE_LLONGINT, TYPE_ULLONGINT,
+ TYPE_HWINT, TYPE_HWUINT, TYPE_CHAR, TYPE_STRING, NOTYPE };
struct
{
int type;
@@ -494,6 +531,10 @@ error_print (const char *type, const char *format0, va_list argp)
unsigned int uintval;
long int longintval;
unsigned long int ulongintval;
+ long long int llongintval;
+ unsigned long long int ullongintval;
+ HOST_WIDE_INT hwintval;
+ unsigned HOST_WIDE_INT hwuintval;
char charval;
const char * stringval;
} u;
@@ -577,7 +618,17 @@ error_print (const char *type, const char *format0, va_list argp)
case 'l':
c = *format++;
- if (c == 'u')
+ if (c == 'l')
+ {
+ c = *format++;
+ if (c == 'u')
+ arg[pos].type = TYPE_ULLONGINT;
+ else if (c == 'i' || c == 'd')
+ arg[pos].type = TYPE_LLONGINT;
+ else
+ gcc_unreachable ();
+ }
+ else if (c == 'u')
arg[pos].type = TYPE_ULONGINT;
else if (c == 'i' || c == 'd')
arg[pos].type = TYPE_LONGINT;
@@ -585,6 +636,16 @@ error_print (const char *type, const char *format0, va_list argp)
gcc_unreachable ();
break;
+ case 'w':
+ c = *format++;
+ if (c == 'u')
+ arg[pos].type = TYPE_HWUINT;
+ else if (c == 'i' || c == 'd')
+ arg[pos].type = TYPE_HWINT;
+ else
+ gcc_unreachable ();
+ break;
+
case 'c':
arg[pos].type = TYPE_CHAR;
break;
@@ -649,6 +710,22 @@ error_print (const char *type, const char *format0, va_list argp)
arg[pos].u.ulongintval = va_arg (argp, unsigned long int);
break;
+ case TYPE_LLONGINT:
+ arg[pos].u.llongintval = va_arg (argp, long long int);
+ break;
+
+ case TYPE_ULLONGINT:
+ arg[pos].u.ullongintval = va_arg (argp, unsigned long long int);
+ break;
+
+ case TYPE_HWINT:
+ arg[pos].u.hwintval = va_arg (argp, HOST_WIDE_INT);
+ break;
+
+ case TYPE_HWUINT:
+ arg[pos].u.hwuintval = va_arg (argp, unsigned HOST_WIDE_INT);
+ break;
+
case TYPE_CHAR:
arg[pos].u.charval = (char) va_arg (argp, int);
break;
@@ -725,12 +802,27 @@ error_print (const char *type, const char *format0, va_list argp)
case 'l':
format++;
+ if (*format == 'l')
+ {
+ format++;
+ if (*format == 'u')
+ error_uinteger (spec[n++].u.ullongintval);
+ else
+ error_integer (spec[n++].u.llongintval);
+ }
if (*format == 'u')
error_uinteger (spec[n++].u.ulongintval);
else
error_integer (spec[n++].u.longintval);
break;
+ case 'w':
+ format++;
+ if (*format == 'u')
+ error_hwuint (spec[n++].u.hwintval);
+ else
+ error_hwint (spec[n++].u.hwuintval);
+ break;
}
}
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index 5fc8481..026228d 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -535,7 +535,7 @@ gfc_builtin_function (tree decl)
return decl;
}
-/* So far we need just these 8 attribute types. */
+/* So far we need just these 10 attribute types. */
#define ATTR_NULL 0
#define ATTR_LEAF_LIST (ECF_LEAF)
#define ATTR_NOTHROW_LEAF_LIST (ECF_NOTHROW | ECF_LEAF)
@@ -546,6 +546,9 @@ gfc_builtin_function (tree decl)
#define ATTR_CONST_NOTHROW_LIST (ECF_NOTHROW | ECF_CONST)
#define ATTR_ALLOC_WARN_UNUSED_RESULT_SIZE_2_NOTHROW_LIST \
(ECF_NOTHROW)
+#define ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST \
+ (ECF_COLD | ECF_NORETURN | \
+ ECF_NOTHROW | ECF_LEAF)
static void
gfc_define_builtin (const char *name, tree type, enum built_in_function code,
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index a7d82ae..4b26cb4 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -281,7 +281,8 @@ enum gfc_statement
ST_OMP_PARALLEL_MASKED_TASKLOOP_SIMD,
ST_OMP_END_PARALLEL_MASKED_TASKLOOP_SIMD, ST_OMP_MASKED_TASKLOOP,
ST_OMP_END_MASKED_TASKLOOP, ST_OMP_MASKED_TASKLOOP_SIMD,
- ST_OMP_END_MASKED_TASKLOOP_SIMD, ST_OMP_SCOPE, ST_OMP_END_SCOPE, ST_NONE
+ ST_OMP_END_MASKED_TASKLOOP_SIMD, ST_OMP_SCOPE, ST_OMP_END_SCOPE,
+ ST_OMP_ERROR, ST_NONE
};
/* Types of interfaces that we can have. Assignment interfaces are
@@ -776,6 +777,20 @@ enum gfc_omp_device_type
OMP_DEVICE_TYPE_ANY
};
+enum gfc_omp_severity_type
+{
+ OMP_SEVERITY_UNSET,
+ OMP_SEVERITY_WARNING,
+ OMP_SEVERITY_FATAL
+};
+
+enum gfc_omp_at_type
+{
+ OMP_AT_UNSET,
+ OMP_AT_COMPILATION,
+ OMP_AT_EXECUTION
+};
+
/* Structure and list of supported extension attributes. */
typedef enum
{
@@ -1446,26 +1461,11 @@ enum gfc_omp_bind_type
typedef struct gfc_omp_clauses
{
+ gfc_omp_namelist *lists[OMP_LIST_NUM];
struct gfc_expr *if_expr;
struct gfc_expr *final_expr;
struct gfc_expr *num_threads;
- gfc_omp_namelist *lists[OMP_LIST_NUM];
- enum gfc_omp_sched_kind sched_kind;
- enum gfc_omp_device_type device_type;
struct gfc_expr *chunk_size;
- enum gfc_omp_default_sharing default_sharing;
- enum gfc_omp_defaultmap defaultmap[OMP_DEFAULTMAP_CAT_NUM];
- int collapse, orderedc;
- bool nowait, ordered, untied, mergeable;
- bool inbranch, notinbranch, nogroup;
- bool sched_simd, sched_monotonic, sched_nonmonotonic;
- bool simd, threads, depend_source, destroy, order_concurrent, capture;
- enum gfc_omp_atomic_op atomic_op;
- enum gfc_omp_memorder memorder;
- enum gfc_omp_cancel_kind cancel;
- enum gfc_omp_proc_bind_kind proc_bind;
- enum gfc_omp_depend_op depobj_update;
- enum gfc_omp_bind_type bind;
struct gfc_expr *safelen_expr;
struct gfc_expr *simdlen_expr;
struct gfc_expr *num_teams;
@@ -1479,9 +1479,28 @@ typedef struct gfc_omp_clauses
struct gfc_expr *detach;
struct gfc_expr *depobj;
struct gfc_expr *if_exprs[OMP_IF_LAST];
- enum gfc_omp_sched_kind dist_sched_kind;
struct gfc_expr *dist_chunk_size;
+ struct gfc_expr *message;
const char *critical_name;
+ enum gfc_omp_default_sharing default_sharing;
+ enum gfc_omp_atomic_op atomic_op;
+ enum gfc_omp_defaultmap defaultmap[OMP_DEFAULTMAP_CAT_NUM];
+ int collapse, orderedc;
+ unsigned nowait:1, ordered:1, untied:1, mergeable: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 capture: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_cancel_kind) cancel:3;
+ ENUM_BITFIELD (gfc_omp_proc_bind_kind) proc_bind:3;
+ ENUM_BITFIELD (gfc_omp_depend_op) depobj_update:3;
+ ENUM_BITFIELD (gfc_omp_bind_type) bind:2;
+ ENUM_BITFIELD (gfc_omp_at_type) at:2;
+ ENUM_BITFIELD (gfc_omp_severity_type) severity:2;
+ ENUM_BITFIELD (gfc_omp_sched_kind) dist_sched_kind:3;
/* OpenACC. */
struct gfc_expr *async_expr;
@@ -2768,7 +2787,8 @@ enum gfc_exec_op
EXEC_OMP_TEAMS_LOOP, EXEC_OMP_TARGET_PARALLEL_LOOP,
EXEC_OMP_TARGET_TEAMS_LOOP, EXEC_OMP_MASKED, EXEC_OMP_PARALLEL_MASKED,
EXEC_OMP_PARALLEL_MASKED_TASKLOOP, EXEC_OMP_PARALLEL_MASKED_TASKLOOP_SIMD,
- EXEC_OMP_MASKED_TASKLOOP, EXEC_OMP_MASKED_TASKLOOP_SIMD, EXEC_OMP_SCOPE
+ EXEC_OMP_MASKED_TASKLOOP, EXEC_OMP_MASKED_TASKLOOP_SIMD, EXEC_OMP_SCOPE,
+ EXEC_OMP_ERROR
};
typedef struct gfc_code
diff --git a/gcc/fortran/match.h b/gcc/fortran/match.h
index 5127b4b..92fd127 100644
--- a/gcc/fortran/match.h
+++ b/gcc/fortran/match.h
@@ -168,6 +168,7 @@ match gfc_match_omp_distribute_simd (void);
match gfc_match_omp_do (void);
match gfc_match_omp_do_simd (void);
match gfc_match_omp_loop (void);
+match gfc_match_omp_error (void);
match gfc_match_omp_flush (void);
match gfc_match_omp_masked (void);
match gfc_match_omp_masked_taskloop (void);
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index fd219dc..2380866 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "constructor.h"
#include "diagnostic.h"
#include "gomp-constants.h"
+#include "target-memory.h" /* For gfc_encode_character. */
/* Match an end of OpenMP directive. End of OpenMP directive is optional
whitespace, followed by '\n' or comment '!'. */
@@ -848,6 +849,9 @@ enum omp_mask1
OMP_CLAUSE_AFFINITY, /* OpenMP 5.0. */
OMP_CLAUSE_BIND, /* OpenMP 5.0. */
OMP_CLAUSE_FILTER, /* OpenMP 5.1. */
+ OMP_CLAUSE_AT, /* OpenMP 5.1. */
+ OMP_CLAUSE_MESSAGE, /* OpenMP 5.1. */
+ OMP_CLAUSE_SEVERITY, /* OpenMP 5.1. */
OMP_CLAUSE_NOWAIT,
/* This must come last. */
OMP_MASK1_LAST
@@ -1293,6 +1297,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
bool first = true, bool needs_space = true,
bool openacc = false)
{
+ bool error = false;
gfc_omp_clauses *c = gfc_get_omp_clauses ();
locus old_loc;
/* Determine whether we're dealing with an OpenACC directive that permits
@@ -1392,6 +1397,22 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
}
continue;
}
+ if ((mask & OMP_CLAUSE_AT)
+ && c->at == OMP_AT_UNSET
+ && gfc_match ("at ( ") == MATCH_YES)
+ {
+ if (gfc_match ("compilation )") == MATCH_YES)
+ c->at = OMP_AT_COMPILATION;
+ else if (gfc_match ("execution )") == MATCH_YES)
+ c->at = OMP_AT_EXECUTION;
+ else
+ {
+ gfc_error ("Expected COMPILATION or EXECUTION in AT clause "
+ "at %C");
+ goto error;
+ }
+ continue;
+ }
if ((mask & OMP_CLAUSE_ASYNC)
&& !c->async
&& gfc_match ("async") == MATCH_YES)
@@ -1616,7 +1637,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
else
gfc_error ("DEFAULTMAP at %C but prior DEFAULTMAP for "
"category %s", pcategory);
- goto end;
+ goto error;
}
}
c->defaultmap[category] = behavior;
@@ -2074,6 +2095,10 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
c->mergeable = needs_space = true;
continue;
}
+ if ((mask & OMP_CLAUSE_MESSAGE)
+ && !c->message
+ && gfc_match ("message ( %e )", &c->message) == MATCH_YES)
+ continue;
break;
case 'n':
if ((mask & OMP_CLAUSE_NO_CREATE)
@@ -2402,6 +2427,22 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
c->simd = needs_space = true;
continue;
}
+ if ((mask & OMP_CLAUSE_SEVERITY)
+ && c->severity == OMP_SEVERITY_UNSET
+ && gfc_match ("severity ( ") == MATCH_YES)
+ {
+ if (gfc_match ("fatal )") == MATCH_YES)
+ c->severity = OMP_SEVERITY_FATAL;
+ else if (gfc_match ("warning )") == MATCH_YES)
+ c->severity = OMP_SEVERITY_WARNING;
+ else
+ {
+ gfc_error ("Expected FATAL or WARNING in SEVERITY clause "
+ "at %C");
+ goto error;
+ }
+ continue;
+ }
break;
case 't':
if ((mask & OMP_CLAUSE_TASK_REDUCTION)
@@ -2553,7 +2594,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
}
end:
- if (gfc_match_omp_eos () != MATCH_YES)
+ if (error || gfc_match_omp_eos () != MATCH_YES)
{
if (!gfc_error_flag_test ())
gfc_error ("Failed to match clause at %C");
@@ -2563,6 +2604,10 @@ end:
*cp = c;
return MATCH_YES;
+
+error:
+ error = true;
+ goto end;
}
@@ -3208,6 +3253,9 @@ cleanup:
| OMP_CLAUSE_MEMORDER)
#define OMP_MASKED_CLAUSES \
(omp_mask (OMP_CLAUSE_FILTER))
+#define OMP_ERROR_CLAUSES \
+ (omp_mask (OMP_CLAUSE_AT) | OMP_CLAUSE_MESSAGE | OMP_CLAUSE_SEVERITY)
+
static match
@@ -3432,6 +3480,66 @@ gfc_match_omp_target_parallel_loop (void)
match
+gfc_match_omp_error (void)
+{
+ locus loc = gfc_current_locus;
+ match m = match_omp (EXEC_OMP_ERROR, OMP_ERROR_CLAUSES);
+ if (m != MATCH_YES)
+ return m;
+
+ gfc_omp_clauses *c = new_st.ext.omp_clauses;
+ if (c->severity == OMP_SEVERITY_UNSET)
+ c->severity = OMP_SEVERITY_FATAL;
+ if (new_st.ext.omp_clauses->at == OMP_AT_EXECUTION)
+ return MATCH_YES;
+ if (c->message
+ && (!gfc_resolve_expr (c->message)
+ || c->message->ts.type != BT_CHARACTER
+ || c->message->ts.kind != gfc_default_character_kind
+ || c->message->rank != 0))
+ {
+ gfc_error ("MESSAGE clause at %L requires a scalar default-kind "
+ "CHARACTER expression",
+ &new_st.ext.omp_clauses->message->where);
+ return MATCH_ERROR;
+ }
+ if (c->message && !gfc_is_constant_expr (c->message))
+ {
+ gfc_error ("Constant character expression required in MESSAGE clause "
+ "at %L", &new_st.ext.omp_clauses->message->where);
+ return MATCH_ERROR;
+ }
+ if (c->message)
+ {
+ const char *msg = G_("$OMP ERROR encountered at %L: %s");
+ gcc_assert (c->message->expr_type == EXPR_CONSTANT);
+ gfc_charlen_t slen = c->message->value.character.length;
+ int i = gfc_validate_kind (BT_CHARACTER, gfc_default_character_kind,
+ false);
+ size_t size = slen * gfc_character_kinds[i].bit_size / 8;
+ unsigned char *s = XCNEWVAR (unsigned char, size + 1);
+ gfc_encode_character (gfc_default_character_kind, slen,
+ c->message->value.character.string,
+ (unsigned char *) s, size);
+ s[size] = '\0';
+ if (c->severity == OMP_SEVERITY_WARNING)
+ gfc_warning_now (0, msg, &loc, s);
+ else
+ gfc_error_now (msg, &loc, s);
+ free (s);
+ }
+ else
+ {
+ const char *msg = G_("$OMP ERROR encountered at %L");
+ if (c->severity == OMP_SEVERITY_WARNING)
+ gfc_warning_now (0, msg, &loc);
+ else
+ gfc_error_now (msg, &loc);
+ }
+ return MATCH_YES;
+}
+
+match
gfc_match_omp_flush (void)
{
gfc_omp_namelist *list = NULL;
@@ -6463,6 +6571,15 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
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;
+ if (!gfc_resolve_expr (expr)
+ || expr->ts.kind != gfc_default_character_kind
+ || expr->ts.type != BT_CHARACTER || expr->rank != 0)
+ gfc_error ("MESSAGE clause at %L requires a scalar default-kind "
+ "CHARACTER expression", &expr->where);
+ }
if (!openacc
&& code
&& omp_clauses->lists[OMP_LIST_MAP] == NULL
@@ -7461,6 +7578,8 @@ omp_code_to_statement (gfc_code *code)
return ST_OMP_CANCEL;
case EXEC_OMP_CANCELLATION_POINT:
return ST_OMP_CANCELLATION_POINT;
+ case EXEC_OMP_ERROR:
+ return ST_OMP_ERROR;
case EXEC_OMP_FLUSH:
return ST_OMP_FLUSH;
case EXEC_OMP_DISTRIBUTE:
@@ -7971,6 +8090,7 @@ gfc_resolve_omp_directive (gfc_code *code, gfc_namespace *ns)
resolve_omp_do (code);
break;
case EXEC_OMP_CANCEL:
+ case EXEC_OMP_ERROR:
case EXEC_OMP_MASKED:
case EXEC_OMP_PARALLEL_WORKSHARE:
case EXEC_OMP_PARALLEL:
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index d004732..d37a0b5 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -908,6 +908,7 @@ decode_omp_directive (void)
matcho ("do", gfc_match_omp_do, ST_OMP_DO);
break;
case 'e':
+ matcho ("error", gfc_match_omp_error, ST_OMP_ERROR);
matcho ("end atomic", gfc_match_omp_eos_error, ST_OMP_END_ATOMIC);
matcho ("end critical", gfc_match_omp_end_critical, ST_OMP_END_CRITICAL);
matchs ("end distribute parallel do simd", gfc_match_omp_eos_error,
@@ -1183,6 +1184,9 @@ decode_omp_directive (void)
prog_unit->omp_target_seen = true;
break;
}
+ case ST_OMP_ERROR:
+ if (new_st.ext.omp_clauses->at != OMP_AT_EXECUTION)
+ return ST_NONE;
default:
break;
}
@@ -1654,7 +1658,7 @@ next_statement (void)
case ST_OMP_BARRIER: case ST_OMP_TASKWAIT: case ST_OMP_TASKYIELD: \
case ST_OMP_CANCEL: case ST_OMP_CANCELLATION_POINT: case ST_OMP_DEPOBJ: \
case ST_OMP_TARGET_UPDATE: case ST_OMP_TARGET_ENTER_DATA: \
- case ST_OMP_TARGET_EXIT_DATA: case ST_OMP_ORDERED_DEPEND: \
+ case ST_OMP_TARGET_EXIT_DATA: case ST_OMP_ORDERED_DEPEND: case ST_OMP_ERROR: \
case ST_ERROR_STOP: case ST_OMP_SCAN: case ST_SYNC_ALL: \
case ST_SYNC_IMAGES: case ST_SYNC_MEMORY: case ST_LOCK: case ST_UNLOCK: \
case ST_FORM_TEAM: case ST_CHANGE_TEAM: \
@@ -1716,7 +1720,6 @@ next_statement (void)
case ST_OMP_DECLARE_TARGET: case ST_OMP_DECLARE_REDUCTION: \
case ST_OMP_REQUIRES: case ST_OACC_ROUTINE: case ST_OACC_DECLARE
-
/* Block end statements. Errors associated with interchanging these
are detected in gfc_match_end(). */
@@ -2544,6 +2547,9 @@ gfc_ascii_statement (gfc_statement st)
case ST_OMP_END_WORKSHARE:
p = "!$OMP END WORKSHARE";
break;
+ case ST_OMP_ERROR:
+ p = "!$OMP ERROR";
+ break;
case ST_OMP_FLUSH:
p = "!$OMP FLUSH";
break;
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 117062b..5b9ba43 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -10817,6 +10817,7 @@ gfc_resolve_blocks (gfc_code *b, gfc_namespace *ns)
case EXEC_OMP_DISTRIBUTE_SIMD:
case EXEC_OMP_DO:
case EXEC_OMP_DO_SIMD:
+ case EXEC_OMP_ERROR:
case EXEC_OMP_LOOP:
case EXEC_OMP_MASKED:
case EXEC_OMP_MASKED_TASKLOOP:
@@ -12254,6 +12255,7 @@ start:
case EXEC_OMP_DISTRIBUTE_SIMD:
case EXEC_OMP_DO:
case EXEC_OMP_DO_SIMD:
+ case EXEC_OMP_ERROR:
case EXEC_OMP_LOOP:
case EXEC_OMP_MASTER:
case EXEC_OMP_MASTER_TASKLOOP:
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index c27b47a..4cb73e8 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -4512,6 +4512,76 @@ gfc_simplify_leadz (gfc_expr *e)
}
+/* Check for constant length of a substring. */
+
+static bool
+substring_has_constant_len (gfc_expr *e)
+{
+ gfc_ref *ref;
+ HOST_WIDE_INT istart, iend, length;
+ bool equal_length = false;
+
+ if (e->ts.type != BT_CHARACTER)
+ return false;
+
+ for (ref = e->ref; ref; ref = ref->next)
+ if (ref->type != REF_COMPONENT && ref->type != REF_ARRAY)
+ break;
+
+ if (!ref
+ || ref->type != REF_SUBSTRING
+ || !ref->u.ss.start
+ || ref->u.ss.start->expr_type != EXPR_CONSTANT
+ || !ref->u.ss.end
+ || ref->u.ss.end->expr_type != EXPR_CONSTANT
+ || !ref->u.ss.length)
+ return false;
+
+ /* For non-deferred strings the given length shall be constant. */
+ if (!e->ts.deferred
+ && (!ref->u.ss.length->length
+ || ref->u.ss.length->length->expr_type != EXPR_CONSTANT))
+ return false;
+
+ /* Basic checks on substring starting and ending indices. */
+ if (!gfc_resolve_substring (ref, &equal_length))
+ return false;
+
+ istart = gfc_mpz_get_hwi (ref->u.ss.start->value.integer);
+ iend = gfc_mpz_get_hwi (ref->u.ss.end->value.integer);
+
+ if (istart <= iend)
+ {
+ if (istart < 1)
+ {
+ gfc_error ("Substring start index (%wd) at %L below 1",
+ istart, &ref->u.ss.start->where);
+ return false;
+ }
+
+ /* For deferred strings use end index as proxy for length. */
+ if (e->ts.deferred)
+ length = iend;
+ else
+ length = gfc_mpz_get_hwi (ref->u.ss.length->length->value.integer);
+ if (iend > length)
+ {
+ gfc_error ("Substring end index (%wd) at %L exceeds string length",
+ iend, &ref->u.ss.end->where);
+ return false;
+ }
+ length = iend - istart + 1;
+ }
+ else
+ length = 0;
+
+ /* Fix substring length. */
+ e->value.character.length = length;
+
+ return true;
+}
+
+
gfc_expr *
gfc_simplify_len (gfc_expr *e, gfc_expr *kind)
{
@@ -4521,7 +4591,8 @@ gfc_simplify_len (gfc_expr *e, gfc_expr *kind)
if (k == -1)
return &gfc_bad_expr;
- if (e->expr_type == EXPR_CONSTANT)
+ if (e->expr_type == EXPR_CONSTANT
+ || substring_has_constant_len (e))
{
result = gfc_get_constant_expr (BT_INTEGER, k, &e->where);
mpz_set_si (result->value.integer, e->value.character.length);
diff --git a/gcc/fortran/st.c b/gcc/fortran/st.c
index 7d87709..6bf730c 100644
--- a/gcc/fortran/st.c
+++ b/gcc/fortran/st.c
@@ -225,6 +225,7 @@ gfc_free_statement (gfc_code *p)
case EXEC_OMP_DISTRIBUTE_SIMD:
case EXEC_OMP_DO:
case EXEC_OMP_DO_SIMD:
+ case EXEC_OMP_ERROR:
case EXEC_OMP_LOOP:
case EXEC_OMP_END_SINGLE:
case EXEC_OMP_MASKED_TASKLOOP:
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index e0a0014..91888f3 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -5369,6 +5369,38 @@ gfc_trans_omp_depobj (gfc_code *code)
}
static tree
+gfc_trans_omp_error (gfc_code *code)
+{
+ stmtblock_t block;
+ gfc_se se;
+ tree len, message;
+ bool fatal = code->ext.omp_clauses->severity == OMP_SEVERITY_FATAL;
+ tree fndecl = builtin_decl_explicit (fatal ? BUILT_IN_GOMP_ERROR
+ : BUILT_IN_GOMP_WARNING);
+ gfc_start_block (&block);
+ gfc_init_se (&se, NULL );
+ if (!code->ext.omp_clauses->message)
+ {
+ message = null_pointer_node;
+ len = build_int_cst (size_type_node, 0);
+ }
+ else
+ {
+ gfc_conv_expr (&se, code->ext.omp_clauses->message);
+ message = se.expr;
+ if (!POINTER_TYPE_P (TREE_TYPE (message)))
+ /* To ensure an ARRAY_TYPE is not passed as such. */
+ message = gfc_build_addr_expr (NULL, message);
+ len = se.string_length;
+ }
+ gfc_add_block_to_block (&block, &se.pre);
+ gfc_add_expr_to_block (&block, build_call_expr_loc (input_location, fndecl,
+ 2, message, len));
+ gfc_add_block_to_block (&block, &se.post);
+ return gfc_finish_block (&block);
+}
+
+static tree
gfc_trans_omp_flush (gfc_code *code)
{
tree call;
@@ -7096,6 +7128,8 @@ gfc_trans_omp_directive (gfc_code *code)
return gfc_trans_omp_distribute (code, NULL);
case EXEC_OMP_DO_SIMD:
return gfc_trans_omp_do_simd (code, NULL, NULL, NULL_TREE);
+ case EXEC_OMP_ERROR:
+ return gfc_trans_omp_error (code);
case EXEC_OMP_FLUSH:
return gfc_trans_omp_flush (code);
case EXEC_OMP_MASKED:
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 80b724d0..eb5682a 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -2155,6 +2155,7 @@ trans_code (gfc_code * code, tree cond)
case EXEC_OMP_DO:
case EXEC_OMP_DO_SIMD:
case EXEC_OMP_LOOP:
+ case EXEC_OMP_ERROR:
case EXEC_OMP_FLUSH:
case EXEC_OMP_MASKED:
case EXEC_OMP_MASKED_TASKLOOP:
diff --git a/gcc/fortran/types.def b/gcc/fortran/types.def
index 8626ed0..85b85ed 100644
--- a/gcc/fortran/types.def
+++ b/gcc/fortran/types.def
@@ -120,6 +120,7 @@ DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_INT_BOOL, BT_BOOL, BT_INT, BT_BOOL)
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_UINT_UINT, BT_VOID, BT_UINT, BT_UINT)
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_PTRMODE,
BT_VOID, BT_PTR, BT_PTRMODE)
+DEF_FUNCTION_TYPE_2 (BT_FN_VOID_CONST_PTR_SIZE, BT_VOID, BT_CONST_PTR, BT_SIZE)
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR)
diff --git a/gcc/gcov.c b/gcc/gcov.c
index 5c651a9..cf0a49d 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -662,8 +662,8 @@ static void accumulate_line_counts (source_info *);
static void output_gcov_file (const char *, source_info *);
static int output_branch_count (FILE *, int, const arc_info *);
static void output_lines (FILE *, const source_info *);
-static char *make_gcov_file_name (const char *, const char *);
-static char *mangle_name (const char *, char *);
+static string make_gcov_file_name (const char *, const char *);
+static char *mangle_name (const char *);
static void release_structures (void);
extern int main (int, char **);
@@ -1134,6 +1134,41 @@ output_intermediate_json_line (json::array *object,
object->append (lineo);
}
+/* Strip filename extension in STR. */
+
+static string
+strip_extention (string str)
+{
+ string::size_type pos = str.rfind ('.');
+ if (pos != string::npos)
+ str = str.substr (0, pos);
+
+ return str;
+}
+
+/* Calcualte md5sum for INPUT string and return it in hex string format. */
+
+static string
+get_md5sum (const char *input)
+{
+ md5_ctx ctx;
+ char md5sum[16];
+ string str;
+
+ md5_init_ctx (&ctx);
+ md5_process_bytes (input, strlen (input), &ctx);
+ md5_finish_ctx (&ctx, md5sum);
+
+ for (unsigned i = 0; i < 16; i++)
+ {
+ char b[3];
+ sprintf (b, "%02x", (unsigned char)md5sum[i]);
+ str += b;
+ }
+
+ return str;
+}
+
/* Get the name of the gcov file. The return value must be free'd.
It appends the '.gcov' extension to the *basename* of the file.
@@ -1143,20 +1178,26 @@ output_intermediate_json_line (json::array *object,
input: foo.da, output: foo.da.gcov
input: a/b/foo.cc, output: foo.cc.gcov */
-static char *
-get_gcov_intermediate_filename (const char *file_name)
+static string
+get_gcov_intermediate_filename (const char *input_file_name)
{
- const char *gcov = ".gcov.json.gz";
- char *result;
- const char *cptr;
+ string base = basename (input_file_name);
+ string str = strip_extention (base);
- /* Find the 'basename'. */
- cptr = lbasename (file_name);
-
- result = XNEWVEC (char, strlen (cptr) + strlen (gcov) + 1);
- sprintf (result, "%s%s", cptr, gcov);
+ if (flag_hash_filenames)
+ {
+ str += "##";
+ str += get_md5sum (input_file_name);
+ }
+ else if (flag_preserve_paths && base != input_file_name)
+ {
+ str += "##";
+ str += mangle_path (input_file_name);
+ str = strip_extention (str);
+ }
- return result;
+ str += ".gcov.json.gz";
+ return str.c_str ();
}
/* Output the result in JSON intermediate format.
@@ -1416,7 +1457,9 @@ process_all_functions (void)
static void
output_gcov_file (const char *file_name, source_info *src)
{
- char *gcov_file_name = make_gcov_file_name (file_name, src->coverage.name);
+ string gcov_file_name_str
+ = make_gcov_file_name (file_name, src->coverage.name);
+ const char *gcov_file_name = gcov_file_name_str.c_str ();
if (src->coverage.lines)
{
@@ -1438,13 +1481,12 @@ output_gcov_file (const char *file_name, source_info *src)
unlink (gcov_file_name);
fnotice (stdout, "Removing '%s'\n", gcov_file_name);
}
- free (gcov_file_name);
}
static void
generate_results (const char *file_name)
{
- char *gcov_intermediate_filename;
+ string gcov_intermediate_filename;
for (vector<function_info *>::iterator it = functions.begin ();
it != functions.end (); it++)
@@ -1547,11 +1589,13 @@ generate_results (const char *file_name)
root->print (&pp);
pp_formatted_text (&pp);
- gzFile output = gzopen (gcov_intermediate_filename, "w");
+ fnotice (stdout, "Creating '%s'\n",
+ gcov_intermediate_filename.c_str ());
+ gzFile output = gzopen (gcov_intermediate_filename.c_str (), "w");
if (output == NULL)
{
fnotice (stderr, "Cannot open JSON output file %s\n",
- gcov_intermediate_filename);
+ gcov_intermediate_filename.c_str ());
return;
}
@@ -1559,7 +1603,7 @@ generate_results (const char *file_name)
|| gzclose (output))
{
fnotice (stderr, "Error writing JSON output file %s\n",
- gcov_intermediate_filename);
+ gcov_intermediate_filename.c_str ());
return;
}
}
@@ -2546,15 +2590,6 @@ canonicalize_name (const char *name)
return result;
}
-/* Print hex representation of 16 bytes from SUM and write it to BUFFER. */
-
-static void
-md5sum_to_hex (const char *sum, char *buffer)
-{
- for (unsigned i = 0; i < 16; i++)
- sprintf (buffer + (2 * i), "%02x", (unsigned char)sum[i]);
-}
-
/* Generate an output file name. INPUT_NAME is the canonicalized main
input file and SRC_NAME is the canonicalized file name.
LONG_OUTPUT_NAMES and PRESERVE_PATHS affect name generation. With
@@ -2567,77 +2602,42 @@ md5sum_to_hex (const char *sum, char *buffer)
component. (Remember, the canonicalized name will already have
elided '.' components and converted \\ separators.) */
-static char *
+static string
make_gcov_file_name (const char *input_name, const char *src_name)
{
- char *ptr;
- char *result;
-
- if (flag_long_names && input_name && strcmp (src_name, input_name))
- {
- /* Generate the input filename part. */
- result = XNEWVEC (char, strlen (input_name) + strlen (src_name) + 10);
-
- ptr = result;
- ptr = mangle_name (input_name, ptr);
- ptr[0] = ptr[1] = '#';
- ptr += 2;
- }
- else
- {
- result = XNEWVEC (char, strlen (src_name) + 10);
- ptr = result;
- }
-
- ptr = mangle_name (src_name, ptr);
- strcpy (ptr, ".gcov");
+ string str;
/* When hashing filenames, we shorten them by only using the filename
component and appending a hash of the full (mangled) pathname. */
if (flag_hash_filenames)
+ str = (string (mangle_name (src_name)) + "##"
+ + get_md5sum (src_name) + ".gcov");
+ else
{
- md5_ctx ctx;
- char md5sum[16];
- char md5sum_hex[33];
-
- md5_init_ctx (&ctx);
- md5_process_bytes (src_name, strlen (src_name), &ctx);
- md5_finish_ctx (&ctx, md5sum);
- md5sum_to_hex (md5sum, md5sum_hex);
- free (result);
+ if (flag_long_names && input_name && strcmp (src_name, input_name) != 0)
+ {
+ str += mangle_name (input_name);
+ str += "##";
+ }
- result = XNEWVEC (char, strlen (src_name) + 50);
- ptr = result;
- ptr = mangle_name (src_name, ptr);
- ptr[0] = ptr[1] = '#';
- ptr += 2;
- memcpy (ptr, md5sum_hex, 32);
- ptr += 32;
- strcpy (ptr, ".gcov");
+ str += mangle_name (src_name);
+ str += ".gcov";
}
- return result;
+ return str;
}
/* Mangle BASE name, copy it at the beginning of PTR buffer and
return address of the \0 character of the buffer. */
static char *
-mangle_name (char const *base, char *ptr)
+mangle_name (char const *base)
{
- size_t len;
-
/* Generate the source filename part. */
if (!flag_preserve_paths)
- base = lbasename (base);
+ return xstrdup (lbasename (base));
else
- base = mangle_path (base);
-
- len = strlen (base);
- memcpy (ptr, base, len);
- ptr += len;
-
- return ptr;
+ return mangle_path (base);
}
/* Scan through the bb_data for each line in the block, increment
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
index 60b7d3a..ef3afea 100644
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -381,6 +381,10 @@ gimple_ranger::dump (FILE *f)
m_cache.dump (f);
}
+/* Create a new ranger instance and associate it with function FUN.
+ Each call must be paired with a call to disable_ranger to release
+ resources. */
+
gimple_ranger *
enable_ranger (struct function *fun)
{
@@ -392,6 +396,9 @@ enable_ranger (struct function *fun)
return r;
}
+/* Destroy and release the ranger instance associated with function FUN
+ and replace it the global ranger. */
+
void
disable_ranger (struct function *fun)
{
diff --git a/gcc/gimple-range.h b/gcc/gimple-range.h
index 41845b1..eaebb9c5 100644
--- a/gcc/gimple-range.h
+++ b/gcc/gimple-range.h
@@ -62,6 +62,9 @@ protected:
range_tracer tracer;
};
+/* Create a new ranger instance and associate it with a function.
+ Each call must be paired with a call to disable_ranger to release
+ resources. */
extern gimple_ranger *enable_ranger (struct function *);
extern void disable_ranger (struct function *);
diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c
index 5d3094b..781c02d 100644
--- a/gcc/gimple-ssa-store-merging.c
+++ b/gcc/gimple-ssa-store-merging.c
@@ -792,7 +792,7 @@ find_bswap_or_nop_1 (gimple *stmt, struct symbolic_number *n, int limit)
void
find_bswap_or_nop_finalize (struct symbolic_number *n, uint64_t *cmpxchg,
- uint64_t *cmpnop)
+ uint64_t *cmpnop, bool *cast64_to_32)
{
unsigned rsize;
uint64_t tmpn, mask;
@@ -802,6 +802,7 @@ find_bswap_or_nop_finalize (struct symbolic_number *n, uint64_t *cmpxchg,
according to the size of the symbolic number before using it. */
*cmpxchg = CMPXCHG;
*cmpnop = CMPNOP;
+ *cast64_to_32 = false;
/* Find real size of result (highest non-zero byte). */
if (n->base_addr)
@@ -814,7 +815,27 @@ find_bswap_or_nop_finalize (struct symbolic_number *n, uint64_t *cmpxchg,
if (n->range < (int) sizeof (int64_t))
{
mask = ((uint64_t) 1 << (n->range * BITS_PER_MARKER)) - 1;
- *cmpxchg >>= (64 / BITS_PER_MARKER - n->range) * BITS_PER_MARKER;
+ if (n->base_addr == NULL
+ && n->range == 4
+ && int_size_in_bytes (TREE_TYPE (n->src)) == 8)
+ {
+ /* If all bytes in n->n are either 0 or in [5..8] range, this
+ might be a candidate for (unsigned) __builtin_bswap64 (src).
+ It is not worth it for (unsigned short) __builtin_bswap64 (src)
+ or (unsigned short) __builtin_bswap32 (src). */
+ *cast64_to_32 = true;
+ for (tmpn = n->n; tmpn; tmpn >>= BITS_PER_MARKER)
+ if ((tmpn & MARKER_MASK)
+ && ((tmpn & MARKER_MASK) <= 4 || (tmpn & MARKER_MASK) > 8))
+ {
+ *cast64_to_32 = false;
+ break;
+ }
+ }
+ if (*cast64_to_32)
+ *cmpxchg &= mask;
+ else
+ *cmpxchg >>= (64 / BITS_PER_MARKER - n->range) * BITS_PER_MARKER;
*cmpnop &= mask;
}
@@ -837,6 +858,8 @@ find_bswap_or_nop_finalize (struct symbolic_number *n, uint64_t *cmpxchg,
n->range = rsize;
}
+ if (*cast64_to_32)
+ n->range = 8;
n->range *= BITS_PER_UNIT;
}
@@ -849,7 +872,8 @@ find_bswap_or_nop_finalize (struct symbolic_number *n, uint64_t *cmpxchg,
expression. */
gimple *
-find_bswap_or_nop (gimple *stmt, struct symbolic_number *n, bool *bswap)
+find_bswap_or_nop (gimple *stmt, struct symbolic_number *n, bool *bswap,
+ bool *cast64_to_32, uint64_t *mask)
{
tree type_size = TYPE_SIZE_UNIT (TREE_TYPE (gimple_get_lhs (stmt)));
if (!tree_fits_uhwi_p (type_size))
@@ -929,17 +953,30 @@ find_bswap_or_nop (gimple *stmt, struct symbolic_number *n, bool *bswap)
}
uint64_t cmpxchg, cmpnop;
- find_bswap_or_nop_finalize (n, &cmpxchg, &cmpnop);
+ find_bswap_or_nop_finalize (n, &cmpxchg, &cmpnop, cast64_to_32);
/* A complete byte swap should make the symbolic number to start with
the largest digit in the highest order byte. Unchanged symbolic
number indicates a read with same endianness as target architecture. */
+ *mask = ~(uint64_t) 0;
if (n->n == cmpnop)
*bswap = false;
else if (n->n == cmpxchg)
*bswap = true;
else
- return NULL;
+ {
+ int set = 0;
+ for (uint64_t msk = MARKER_MASK; msk; msk <<= BITS_PER_MARKER)
+ if ((n->n & msk) == 0)
+ *mask &= ~msk;
+ else if ((n->n & msk) == (cmpxchg & msk))
+ set++;
+ else
+ return NULL;
+ if (set < 2)
+ return NULL;
+ *bswap = true;
+ }
/* Useless bit manipulation performed by code. */
if (!n->base_addr && n->n == cmpnop && n->n_ops == 1)
@@ -1024,10 +1061,10 @@ bswap_view_convert (gimple_stmt_iterator *gsi, tree type, tree val)
tree
bswap_replace (gimple_stmt_iterator gsi, gimple *ins_stmt, tree fndecl,
tree bswap_type, tree load_type, struct symbolic_number *n,
- bool bswap)
+ bool bswap, uint64_t mask)
{
tree src, tmp, tgt = NULL_TREE;
- gimple *bswap_stmt;
+ gimple *bswap_stmt, *mask_stmt = NULL;
tree_code conv_code = NOP_EXPR;
gimple *cur_stmt = gsi_stmt (gsi);
@@ -1247,6 +1284,15 @@ bswap_replace (gimple_stmt_iterator gsi, gimple *ins_stmt, tree fndecl,
tgt = make_ssa_name (bswap_type);
tmp = tgt;
+ if (mask != ~(uint64_t) 0)
+ {
+ tree m = build_int_cst (bswap_type, mask);
+ tmp = make_temp_ssa_name (bswap_type, NULL, "bswapdst");
+ gimple_set_lhs (bswap_stmt, tmp);
+ mask_stmt = gimple_build_assign (tgt, BIT_AND_EXPR, tmp, m);
+ tmp = tgt;
+ }
+
/* Convert the result if necessary. */
if (!useless_type_conversion_p (TREE_TYPE (tgt), bswap_type))
{
@@ -1260,7 +1306,7 @@ bswap_replace (gimple_stmt_iterator gsi, gimple *ins_stmt, tree fndecl,
gsi_insert_after (&gsi, convert_stmt, GSI_SAME_STMT);
}
- gimple_set_lhs (bswap_stmt, tmp);
+ gimple_set_lhs (mask_stmt ? mask_stmt : bswap_stmt, tmp);
if (dump_file)
{
@@ -1277,11 +1323,17 @@ bswap_replace (gimple_stmt_iterator gsi, gimple *ins_stmt, tree fndecl,
if (cur_stmt)
{
+ if (mask_stmt)
+ gsi_insert_after (&gsi, mask_stmt, GSI_SAME_STMT);
gsi_insert_after (&gsi, bswap_stmt, GSI_SAME_STMT);
gsi_remove (&gsi, true);
}
else
- gsi_insert_before (&gsi, bswap_stmt, GSI_SAME_STMT);
+ {
+ gsi_insert_before (&gsi, bswap_stmt, GSI_SAME_STMT);
+ if (mask_stmt)
+ gsi_insert_before (&gsi, mask_stmt, GSI_SAME_STMT);
+ }
return tgt;
}
@@ -1341,8 +1393,14 @@ maybe_optimize_vector_constructor (gimple *cur_stmt)
return false;
}
- gimple *ins_stmt = find_bswap_or_nop (cur_stmt, &n, &bswap);
- if (!ins_stmt || n.range != (unsigned HOST_WIDE_INT) sz)
+ bool cast64_to_32;
+ uint64_t mask;
+ gimple *ins_stmt = find_bswap_or_nop (cur_stmt, &n, &bswap,
+ &cast64_to_32, &mask);
+ if (!ins_stmt
+ || n.range != (unsigned HOST_WIDE_INT) sz
+ || cast64_to_32
+ || mask != ~(uint64_t) 0)
return false;
if (bswap && !fndecl && n.range != 16)
@@ -1351,7 +1409,7 @@ maybe_optimize_vector_constructor (gimple *cur_stmt)
memset (&nop_stats, 0, sizeof (nop_stats));
memset (&bswap_stats, 0, sizeof (bswap_stats));
return bswap_replace (gsi_for_stmt (cur_stmt), ins_stmt, fndecl,
- bswap_type, load_type, &n, bswap) != NULL_TREE;
+ bswap_type, load_type, &n, bswap, mask) != NULL_TREE;
}
/* Find manual byte swap implementations as well as load in a given
@@ -1405,7 +1463,8 @@ pass_optimize_bswap::execute (function *fun)
tree fndecl = NULL_TREE, bswap_type = NULL_TREE, load_type;
enum tree_code code;
struct symbolic_number n;
- bool bswap;
+ bool bswap, cast64_to_32;
+ uint64_t mask;
/* This gsi_prev (&gsi) is not part of the for loop because cur_stmt
might be moved to a different basic block by bswap_replace and gsi
@@ -1442,7 +1501,8 @@ pass_optimize_bswap::execute (function *fun)
continue;
}
- ins_stmt = find_bswap_or_nop (cur_stmt, &n, &bswap);
+ ins_stmt = find_bswap_or_nop (cur_stmt, &n, &bswap,
+ &cast64_to_32, &mask);
if (!ins_stmt)
continue;
@@ -1479,7 +1539,7 @@ pass_optimize_bswap::execute (function *fun)
continue;
if (bswap_replace (gsi_for_stmt (cur_stmt), ins_stmt, fndecl,
- bswap_type, load_type, &n, bswap))
+ bswap_type, load_type, &n, bswap, mask))
changed = true;
}
}
@@ -2820,7 +2880,8 @@ imm_store_chain_info::try_coalesce_bswap (merged_store_group *merged_store,
}
uint64_t cmpxchg, cmpnop;
- find_bswap_or_nop_finalize (&n, &cmpxchg, &cmpnop);
+ bool cast64_to_32;
+ find_bswap_or_nop_finalize (&n, &cmpxchg, &cmpnop, &cast64_to_32);
/* A complete byte swap should make the symbolic number to start with
the largest digit in the highest order byte. Unchanged symbolic
@@ -2828,6 +2889,10 @@ imm_store_chain_info::try_coalesce_bswap (merged_store_group *merged_store,
if (n.n != cmpnop && n.n != cmpxchg)
return false;
+ /* For now. */
+ if (cast64_to_32)
+ return false;
+
if (n.base_addr == NULL_TREE && !is_gimple_val (n.src))
return false;
@@ -4161,7 +4226,8 @@ imm_store_chain_info::output_merged_store (merged_store_group *group)
n->vuse = gimple_vuse (ins_stmt);
}
bswap_res = bswap_replace (gsi_start (seq), ins_stmt, fndecl,
- bswap_type, load_type, n, bswap);
+ bswap_type, load_type, n, bswap,
+ ~(uint64_t) 0);
gcc_assert (bswap_res);
}
diff --git a/gcc/gimple-ssa-warn-access.cc b/gcc/gimple-ssa-warn-access.cc
index f3efe56..4a2dd9a 100644
--- a/gcc/gimple-ssa-warn-access.cc
+++ b/gcc/gimple-ssa-warn-access.cc
@@ -3310,12 +3310,16 @@ pass_waccess::check (basic_block bb)
unsigned
pass_waccess::execute (function *fun)
{
+ /* Create a new ranger instance and associate it with FUN. */
m_ranger = enable_ranger (fun);
basic_block bb;
FOR_EACH_BB_FN (bb, fun)
check (bb);
+ /* Release the ranger instance and replace it with a global ranger. */
+ disable_ranger (fun);
+
return 0;
}
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 4e2653c..bed7ff9 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "attr-fnspec.h"
#include "ipa-modref-tree.h"
#include "ipa-modref.h"
-
+#include "dbgcnt.h"
/* All the tuples have their operand vector (if present) at the very bottom
of the structure. Therefore, the offset required to find the
@@ -1601,7 +1601,8 @@ gimple_call_arg_flags (const gcall *stmt, unsigned arg)
if ((modref_flags & EAF_DIRECT) && !(flags & EAF_DIRECT))
modref_flags &= ~EAF_DIRECT;
}
- flags |= modref_flags;
+ if (dbg_cnt (ipa_mod_ref_pta))
+ flags |= modref_flags;
}
}
return flags;
diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c
index fafd804..cb0a314 100644
--- a/gcc/ipa-modref.c
+++ b/gcc/ipa-modref.c
@@ -1700,19 +1700,17 @@ analyze_ssa_name_flags (tree name, vec<modref_lattice> &lattice, int depth,
else if (gcall *call = dyn_cast <gcall *> (use_stmt))
{
tree callee = gimple_call_fndecl (call);
- /* Return slot optimization would require bit of propagation;
- give up for now. */
- if (gimple_call_return_slot_opt_p (call)
- && gimple_call_lhs (call) != NULL_TREE
- && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (call))))
- {
- if (dump_file)
- fprintf (dump_file, "%*s Unhandled return slot opt\n",
- depth * 4, "");
- lattice[index].merge (0);
- }
+
+ /* IPA PTA internally it treats calling a function as "writing" to
+ the argument space of all functions the function pointer points to
+ (PR101949). We can not drop EAF_NOCLOBBER only when ipa-pta
+ is on since that would allow propagation of this from -fno-ipa-pta
+ to -fipa-pta functions. */
+ if (gimple_call_fn (use_stmt) == name)
+ lattice[index].merge (~EAF_NOCLOBBER);
+
/* Recursion would require bit of propagation; give up for now. */
- else if (callee && !ipa && recursive_call_p (current_function_decl,
+ if (callee && !ipa && recursive_call_p (current_function_decl,
callee))
lattice[index].merge (0);
else
@@ -1726,7 +1724,15 @@ analyze_ssa_name_flags (tree name, vec<modref_lattice> &lattice, int depth,
/* Handle *name = func (...). */
if (gimple_call_lhs (call)
&& memory_access_to (gimple_call_lhs (call), name))
- lattice[index].merge_direct_store ();
+ {
+ lattice[index].merge_direct_store ();
+ /* Return slot optimization passes address of
+ LHS to callee via hidden parameter and this
+ may make LHS to escape. See PR 98499. */
+ if (gimple_call_return_slot_opt_p (call)
+ && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (call))))
+ lattice[index].merge (EAF_NOREAD | EAF_DIRECT);
+ }
/* We do not track accesses to the static chain (we could)
so give up. */
diff --git a/gcc/jit/ChangeLog b/gcc/jit/ChangeLog
index 7557e17..c7379f3 100644
--- a/gcc/jit/ChangeLog
+++ b/gcc/jit/ChangeLog
@@ -1,3 +1,10 @@
+2021-08-19 Iain Sandoe <iain@sandoe.co.uk>
+
+ * docs/examples/tut04-toyvm/toyvm.c: Include jit-dejagnu.h.
+ * docs/examples/tut04-toyvm/toyvm.cc: Likewise.
+ * jit-dejagnu.h: New file, imported from dejagnu-1.6.2 and
+ patched for this application.
+
2021-08-18 Iain Sandoe <iain@sandoe.co.uk>
PR jit/100613
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index ea8c88b..e2d452f 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,8 @@
+2021-08-19 Iain Sandoe <iain@sandoe.co.uk>
+
+ * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init):
+ Default receiver nilchecks on.
+
2021-08-18 Iain Sandoe <iain@sandoe.co.uk>
Matt Jacobson <mhjacobson@me.com>
diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c
index 0d963e3..ce831fc 100644
--- a/gcc/objc/objc-next-runtime-abi-02.c
+++ b/gcc/objc/objc-next-runtime-abi-02.c
@@ -254,6 +254,10 @@ objc_next_runtime_abi_02_init (objc_runtime_hooks *rthooks)
flag_objc_sjlj_exceptions = 0;
}
+ /* NeXT ABI 2 is intended to default to checking for nil receivers. */
+ if (! global_options_set.x_flag_objc_nilcheck)
+ flag_objc_nilcheck = 1;
+
rthooks->initialize = next_runtime_02_initialize;
rthooks->default_constant_string_class_name = DEF_CONSTANT_STRING_CLASS_NAME;
rthooks->tag_getclass = TAG_GETCLASS;
diff --git a/gcc/omp-builtins.def b/gcc/omp-builtins.def
index b168575..4520dc0 100644
--- a/gcc/omp-builtins.def
+++ b/gcc/omp-builtins.def
@@ -463,3 +463,7 @@ DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ALLOC,
ATTR_ALLOC_WARN_UNUSED_RESULT_SIZE_2_NOTHROW_LIST)
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_FREE,
"GOMP_free", BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
+DEF_GOMP_BUILTIN (BUILT_IN_GOMP_WARNING, "GOMP_warning",
+ BT_FN_VOID_CONST_PTR_SIZE, ATTR_NOTHROW_LEAF_LIST)
+DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ERROR, "GOMP_error",
+ BT_FN_VOID_CONST_PTR_SIZE, ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
index c868b8c..66c64f5 100644
--- a/gcc/omp-expand.c
+++ b/gcc/omp-expand.c
@@ -791,13 +791,19 @@ expand_task_call (struct omp_region *region, basic_block bb,
tree tclauses = gimple_omp_for_clauses (g);
num_tasks = omp_find_clause (tclauses, OMP_CLAUSE_NUM_TASKS);
if (num_tasks)
- num_tasks = OMP_CLAUSE_NUM_TASKS_EXPR (num_tasks);
+ {
+ if (OMP_CLAUSE_NUM_TASKS_STRICT (num_tasks))
+ iflags |= GOMP_TASK_FLAG_STRICT;
+ num_tasks = OMP_CLAUSE_NUM_TASKS_EXPR (num_tasks);
+ }
else
{
num_tasks = omp_find_clause (tclauses, OMP_CLAUSE_GRAINSIZE);
if (num_tasks)
{
iflags |= GOMP_TASK_FLAG_GRAINSIZE;
+ if (OMP_CLAUSE_GRAINSIZE_STRICT (num_tasks))
+ iflags |= GOMP_TASK_FLAG_STRICT;
num_tasks = OMP_CLAUSE_GRAINSIZE_EXPR (num_tasks);
}
else
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 57b714a..fa50fe5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,110 @@
+2021-08-22 Martin Uecker <muecker@gwdg.de>
+
+ PR c/98397
+ * gcc.dg/c11-qual-1.c: New test.
+ * gcc.dg/c2x-qual-1.c: New test.
+ * gcc.dg/c2x-qual-2.c: New test.
+ * gcc.dg/c2x-qual-3.c: New test.
+ * gcc.dg/c2x-qual-4.c: New test.
+ * gcc.dg/c2x-qual-5.c: New test.
+ * gcc.dg/c2x-qual-6.c: New test.
+ * gcc.dg/c2x-qual-7.c: New test.
+ * gcc.dg/pointer-array-quals-1.c: Remove unnecessary flag.
+ * gcc.dg/pointer-array-quals-2.c: Remove unnecessary flag.
+
+2021-08-22 Jan Hubicka <hubicka@ucw.cz>
+ Martin Liska <mliska@suse.cz>
+
+ * gcc.dg/lto/pr101949_0.c: New test.
+ * gcc.dg/lto/pr101949_1.c: New test.
+
+2021-08-21 Ankur Saini <arsenic@sourceware.org>
+
+ PR analyzer/101980
+ * gcc.dg/analyzer/function-ptr-2.c : Add issue for double 'free'.
+ * gcc.dg/analyzer/malloc-callbacks.c : Fix xfail testcase.
+
+2021-08-20 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/gomp/error-1.f90: New test.
+ * gfortran.dg/gomp/error-2.f90: New test.
+ * gfortran.dg/gomp/error-3.f90: New test.
+
+2021-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ * c-c++-common/gomp/error-1.c: New test.
+ * c-c++-common/gomp/error-2.c: New test.
+ * c-c++-common/gomp/error-3.c: New test.
+ * g++.dg/gomp/attrs-1.C (bar): Add error directive test.
+ * g++.dg/gomp/attrs-2.C (bar): Add error directive test.
+ * g++.dg/gomp/attrs-13.C: New test.
+ * g++.dg/gomp/error-1.C: New test.
+
+2021-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ * c-c++-common/gomp/sink-5.c: New test.
+ * c-c++-common/gomp/requires-3.c: Add test for spurious comma
+ at the end of pragma line.
+
+2021-08-19 Roger Sayle <roger@nextmovesoftware.com>
+
+ * c-c++-common/Wunused-var-16.c: Add an extra check that ~0
+ is optimized away.
+
+2021-08-19 Peter Bergner <bergner@linux.ibm.com>
+
+ PR target/101849
+ * gcc.target/powerpc/pr101849.c: New test.
+
+2021-08-19 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/100950
+ * gfortran.dg/pr100950.f90: New test.
+
+2021-08-19 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/101803
+ * g++.dg/cpp2a/class-deduction-aggr12.C: Fix PR number.
+
+2021-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/101950
+ * gcc.target/i386/pr101950-1.c: New test.
+ * gcc.target/i386/pr101950-2.c: New test.
+
+2021-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ * c-c++-common/gomp/requires-3.c: Add testcase for
+ atomic_default_mem_order ( at the end of line without corresponding ).
+
+2021-08-19 Iain Sandoe <iain@sandoe.co.uk>
+
+ * jit.dg/test-asm.c: Provide Mach-O fragment.
+ * jit.dg/test-asm.cc: Likewise.
+
+2021-08-19 Jakub Jelinek <jakub@redhat.com>
+
+ * c-c++-common/gomp/nothing-2.c: New test.
+
+2021-08-19 Iain Sandoe <iain@sandoe.co.uk>
+
+ * jit.dg/harness.h: Include jit-dejagnu.h.
+ * jit.dg/jit.exp: Use -rdynamic conditionally on target
+ support, instead of unconditional -Wl,--export-dynamic.
+
+2021-08-19 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR testsuite/101969
+ * gcc.dg/pr78213.c: Fix up for '--enable-checking=release' etc.
+
+2021-08-19 liuhongt <hongtao.liu@intel.com>
+
+ Revert:
+ 2021-08-19 liuhongt <hongtao.liu@intel.com>
+
+ PR target/99881
+ * gcc.target/i386/pr99881.c: New test.
+
2021-08-18 Tobias Burnus <tobias@codesourcery.com>
PR testsuite/101963
@@ -40,7 +147,7 @@
2021-08-18 Patrick Palka <ppalka@redhat.com>
PR c++/101344
- PR c++/101820
+ PR c++/101803
* g++.dg/cpp2a/class-deduction-aggr11.C: New test.
* g++.dg/cpp2a/class-deduction-aggr12.C: New test.
diff --git a/gcc/testsuite/c-c++-common/Wunused-var-16.c b/gcc/testsuite/c-c++-common/Wunused-var-16.c
index 8bdbcd3..31c7db3 100644
--- a/gcc/testsuite/c-c++-common/Wunused-var-16.c
+++ b/gcc/testsuite/c-c++-common/Wunused-var-16.c
@@ -1,6 +1,6 @@
/* PR c++/78949 */
/* { dg-do compile } */
-/* { dg-options "-Wunused" } */
+/* { dg-options "-Wunused -fdump-tree-optimized" } */
/* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
typedef unsigned char V __attribute__((vector_size(16)));
@@ -14,3 +14,5 @@ foo ()
y &= ~x;
v = y;
}
+
+/* { dg-final { scan-tree-dump-not " ~0" "optimized" } } */
diff --git a/gcc/testsuite/c-c++-common/gomp/error-1.c b/gcc/testsuite/c-c++-common/gomp/error-1.c
new file mode 100644
index 0000000..6a40f85
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/error-1.c
@@ -0,0 +1,45 @@
+#pragma omp error /* { dg-error "'pragma omp error' encountered" } */
+#pragma omp error at(compilation) /* { dg-error "'pragma omp error' encountered" } */
+#pragma omp error severity(fatal) /* { dg-error "'pragma omp error' encountered" } */
+#pragma omp error message("my msg") /* { dg-error "'pragma omp error' encountered: my msg" } */
+#pragma omp error severity(warning)message("another message")at(compilation) /* { dg-warning "'pragma omp error' encountered: another message" } */
+
+struct S {
+ #pragma omp error /* { dg-error "'pragma omp error' encountered" } */
+ #pragma omp error at(compilation) /* { dg-error "'pragma omp error' encountered" } */
+ #pragma omp error severity(fatal) /* { dg-error "'pragma omp error' encountered" } */
+ #pragma omp error message("42") /* { dg-error "'pragma omp error' encountered: 42" } */
+ #pragma omp error severity(warning), message("foo"), at(compilation) /* { dg-warning "'pragma omp error' encountered: foo" } */
+ int s;
+};
+
+int
+foo (int i, int x)
+{
+ #pragma omp error /* { dg-error "'pragma omp error' encountered" } */
+ #pragma omp error at(compilation) /* { dg-error "'pragma omp error' encountered" } */
+ #pragma omp error severity(fatal) /* { dg-error "'pragma omp error' encountered" } */
+ #pragma omp error message("42 / 1") /* { dg-error "'pragma omp error' encountered: 42 / 1" } */
+ #pragma omp error severity(warning) message("bar") at(compilation) /* { dg-warning "'pragma omp error' encountered: bar" } */
+ if (x)
+ #pragma omp error /* { dg-error "'pragma omp error' encountered" } */
+ i++;
+ if (x)
+ ;
+ else
+ #pragma omp error at(compilation) /* { dg-error "'pragma omp error' encountered" } */
+ i++;
+ switch (0)
+ #pragma omp error severity(fatal) /* { dg-error "'pragma omp error' encountered" } */
+ {
+ default:
+ break;
+ }
+ while (0)
+ #pragma omp error message("42 - 1") /* { dg-error "'pragma omp error' encountered: 42 - 1" } */
+ i++;
+ lab:
+ #pragma omp error severity(warning) message("bar") at(compilation) /* { dg-warning "'pragma omp error' encountered: bar" } */
+ i++;
+ return i;
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/error-2.c b/gcc/testsuite/c-c++-common/gomp/error-2.c
new file mode 100644
index 0000000..4e13f03
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/error-2.c
@@ -0,0 +1,24 @@
+void
+foo (int x, const char *msg1, const char *msg2)
+{
+ if (x == 0)
+ {
+ #pragma omp error at(execution)
+ }
+ else if (x == 1)
+ {
+ #pragma omp error severity (warning), at (execution)
+ }
+ else if (x == 2)
+ {
+ #pragma omp error at ( execution ) severity (fatal) message ("baz")
+ }
+ else if (x == 3)
+ {
+ #pragma omp error severity(warning) message (msg1) at(execution)
+ }
+ else
+ {
+ #pragma omp error message (msg2), at(execution), severity(fatal)
+ }
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/error-3.c b/gcc/testsuite/c-c++-common/gomp/error-3.c
new file mode 100644
index 0000000..d2b8b83
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/error-3.c
@@ -0,0 +1,70 @@
+#pragma omp error asdf /* { dg-error "expected 'at', 'severity' or 'message' clause" } */
+#pragma omp error at /* { dg-error "expected '\\\(' before end of line" } */
+#pragma omp error at( /* { dg-error "expected 'execution' or 'compilation'" } */
+ /* { dg-error "expected '\\\)' before end of line" "" { target *-*-* } .-1 } */
+#pragma omp error at(runtime) /* { dg-error "expected 'execution' or 'compilation'" } */
+#pragma omp error at(+ /* { dg-error "expected 'execution' or 'compilation'" } */
+ /* { dg-error "expected '\\\)' before '\\\+' token" "" { target *-*-* } .-1 } */
+#pragma omp error at(compilation /* { dg-error "expected '\\\)' before end of line" } */
+ /* { dg-error "'pragma omp error' encountered" "" { target *-*-* } .-1 } */
+#pragma omp error severity /* { dg-error "expected '\\\(' before end of line" } */
+#pragma omp error severity( /* { dg-error "expected 'warning' or 'fatal'" } */
+ /* { dg-error "expected '\\\)' before end of line" "" { target *-*-* } .-1 } */
+#pragma omp error severity(error) /* { dg-error "expected 'warning' or 'fatal'" } */
+#pragma omp error severity(- /* { dg-error "expected 'warning' or 'fatal'" } */
+ /* { dg-error "expected '\\\)' before '-' token" "" { target *-*-* } .-1 } */
+#pragma omp error severity(fatal /* { dg-error "expected '\\\)' before end of line" } */
+ /* { dg-error "'pragma omp error' encountered" "" { target *-*-* } .-1 } */
+#pragma omp error message /* { dg-error "expected '\\\(' before end of line" } */
+#pragma omp error message( /* { dg-error "expected expression before end of line" "" { target c } } */
+ /* { dg-error "expected primary-expression before end of line" "" { target c++ } .-1 } */
+ /* { dg-error "expected '\\\)' before end of line" "" { target c++ } .-2 } */
+ /* { dg-error "'pragma omp error' encountered: <message unknown at compile time>" "" { target *-*-* } .-3 } */
+#pragma omp error message(0 /* { dg-error "expected '\\\)' before end of line" } */
+ /* { dg-error "'pragma omp error' encountered: <message unknown at compile time>" "" { target *-*-* } .-1 } */
+#pragma omp error message("foo" /* { dg-error "expected '\\\)' before end of line" } */
+ /* { dg-error "'pragma omp error' encountered: foo" "" { target *-*-* } .-1 } */
+#pragma omp error message(1) /* { dg-error "'pragma omp error' encountered: <message unknown at compile time>" } */
+ /* { dg-error "invalid conversion from 'int' to 'const char\\*'" "" { target c++ } .-1 } */
+#pragma omp error message(1.2) /* { dg-error "cannot convert to a pointer type" "" { target c } } */
+ /* { dg-error "could not convert" "" { target c++ } .-1 } */
+ /* { dg-error "'pragma omp error' encountered: <message unknown at compile time>" "" { target *-*-* } .-2 } */
+#pragma omp error message(L"bar") /* { dg-error "'pragma omp error' encountered: <message unknown at compile time>" } */
+ /* { dg-error "could not convert" "" { target c++ } .-1 } */
+#pragma omp error message("foo"),at(compilation),severity(fatal), /* { dg-error "expected end of line before ',' token" } */
+ /* { dg-error "'pragma omp error' encountered: foo" "" { target *-*-* } .-1 } */
+#pragma omp error message("foo"),at(compilation),severity(fatal),asdf /* { dg-error "expected 'at', 'severity' or 'message' clause" } */
+#pragma omp error at(compilation) at(compilation) /* { dg-error "too many 'at' clauses" } */
+#pragma omp error severity(fatal) severity(warning) /* { dg-error "too many 'severity' clauses" } */
+#pragma omp error message("foo") message("foo") /* { dg-error "too many 'message' clauses" } */
+#pragma omp error at(execution) /* { dg-error "'#pragma omp error' with 'at\\\(execution\\\)' clause may only be used in compound statements" } */
+
+struct S
+{
+ #pragma omp error at(execution) message("foo")/* { dg-error "'#pragma omp error' with 'at\\\(execution\\\)' clause may only be used in compound statements" } */
+ int s;
+};
+
+int
+foo (int i, int x, const char *msg)
+{
+ #pragma omp error message(msg) /* { dg-error "'pragma omp error' encountered: <message unknown at compile time>" } */
+ if (x)
+ #pragma omp error at(execution) /* { dg-error "'#pragma omp error' with 'at\\\(execution\\\)' clause may only be used in compound statements" } */
+ i++;
+ if (x)
+ ;
+ else
+ #pragma omp error at(execution) severity(warning) /* { dg-error "'#pragma omp error' with 'at\\\(execution\\\)' clause may only be used in compound statements" } */
+ i++;
+ switch (0)
+ #pragma omp error severity(fatal) at(execution) /* { dg-error "'#pragma omp error' with 'at\\\(execution\\\)' clause may only be used in compound statements" } */
+ ;
+ while (0)
+ #pragma omp error at(execution)message("42 - 1") /* { dg-error "'#pragma omp error' with 'at\\\(execution\\\)' clause may only be used in compound statements" } */
+ i++;
+ lab:
+ #pragma omp error severity(warning) message("bar") at(execution) /* { dg-error "'#pragma omp error' with 'at\\\(execution\\\)' clause may only be used in compound statements" } */
+ i++;
+ return i;
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/requires-3.c b/gcc/testsuite/c-c++-common/gomp/requires-3.c
index 0e55b66..bd2479b 100644
--- a/gcc/testsuite/c-c++-common/gomp/requires-3.c
+++ b/gcc/testsuite/c-c++-common/gomp/requires-3.c
@@ -3,3 +3,4 @@
#pragma omp requires atomic_default_mem_order(foobar) /* { dg-error "expected 'seq_cst', 'relaxed' or 'acq_rel'" } */
#pragma omp requires atomic_default_mem_order ( /* { dg-error "expected 'seq_cst', 'relaxed' or 'acq_rel'" } */
/* { dg-error "expected '\\\)' before end of line" "" { target *-*-* } .-1 } */
+#pragma omp requires atomic_default_mem_order(seq_cst), /* { dg-error "expected end of line before ',' token" } */
diff --git a/gcc/testsuite/c-c++-common/gomp/sink-5.c b/gcc/testsuite/c-c++-common/gomp/sink-5.c
new file mode 100644
index 0000000..4fbaa8a
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/sink-5.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+
+void bar (int);
+
+void
+foo ()
+{
+ int i;
+#pragma omp parallel for ordered(1)
+ for (i = 0; i < 100; ++i)
+ {
+#pragma omp ordered depend(sink:i-1,) /* { dg-error "expected '\\\)' before ',' token" } */
+ bar (i);
+#pragma omp ordered depend(source)
+ }
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr12.C b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr12.C
index ebe73c1..3e330ac 100644
--- a/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr12.C
+++ b/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr12.C
@@ -1,4 +1,4 @@
-// PR c++/101820
+// PR c++/101803
// { dg-do compile { target c++20 } }
struct Inner { int i = 0; };
diff --git a/gcc/testsuite/g++.dg/gomp/attrs-1.C b/gcc/testsuite/g++.dg/gomp/attrs-1.C
index 435d54f..cd20845 100644
--- a/gcc/testsuite/g++.dg/gomp/attrs-1.C
+++ b/gcc/testsuite/g++.dg/gomp/attrs-1.C
@@ -109,9 +109,11 @@ baz (int d, int m, int i1, int i2, int p, int *idp, int s,
void
bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s,
- int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q, int *dd, int ntm)
+ int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q, int *dd, int ntm,
+ const char *msg)
{
[[omp::directive (nothing)]];
+ [[omp::directive (error at (execution) severity (warning) message (msg))]];
[[omp::directive (for simd
private (p) firstprivate (f) lastprivate (l) linear (ll:1) reduction(+:r) schedule(static, 4) collapse(1) nowait
safelen(8) simdlen(4) aligned(q: 32) nontemporal(ntm) if(i1) order(concurrent) allocate (f))]]
diff --git a/gcc/testsuite/g++.dg/gomp/attrs-13.C b/gcc/testsuite/g++.dg/gomp/attrs-13.C
new file mode 100644
index 0000000..35e2435c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/attrs-13.C
@@ -0,0 +1,34 @@
+// { dg-do compile { target c++11 } }
+
+[[omp::directive(error)]]; // { dg-error "'pragma omp error' encountered" }
+[[omp::directive(error, at(compilation))]]; // { dg-error "'pragma omp error' encountered" }
+[[omp::directive(error severity(fatal))]]; // { dg-error "'pragma omp error' encountered" }
+[[omp::directive(error, message("my msg"))]]; // { dg-error "'pragma omp error' encountered: my msg" }
+[[omp::directive(error severity(warning)message("another message")at(compilation))]]; // { dg-warning "'pragma omp error' encountered: another message" }
+
+int
+foo (int i, int x)
+{
+ [[omp::directive(error)]]; // { dg-error "'pragma omp error' encountered" }
+ [[omp::directive(error, at(compilation))]]; // { dg-error "'pragma omp error' encountered" }
+ [[omp::directive(error severity(fatal))]]; // { dg-error "'pragma omp error' encountered" }
+ [[omp::directive(error, message("42 / 1"))]]; // { dg-error "'pragma omp error' encountered: 42 / 1" }
+ [[omp::directive(error severity(warning) message("bar") at(compilation))]]; // { dg-warning "'pragma omp error' encountered: bar" }
+ if (x)
+ [[omp::directive(error)]]; // { dg-error "'pragma omp error' encountered" }
+ i++;
+ if (x)
+ ;
+ else
+ [[omp::directive(error at(compilation))]]; // { dg-error "'pragma omp error' encountered" }
+ i++;
+ switch (0)
+ [[omp::directive(error, severity(fatal))]]; // { dg-error "'pragma omp error' encountered" }
+ while (0)
+ [[omp::directive(error, message("42 - 1"))]]; // { dg-error "'pragma omp error' encountered: 42 - 1" }
+ i++;
+ lab:
+ [[omp::directive(error, severity(warning) message("bar"), at(compilation))]]; // { dg-warning "'pragma omp error' encountered: bar" }
+ i++;
+ return i;
+}
diff --git a/gcc/testsuite/g++.dg/gomp/attrs-2.C b/gcc/testsuite/g++.dg/gomp/attrs-2.C
index bea657f..5c54905 100644
--- a/gcc/testsuite/g++.dg/gomp/attrs-2.C
+++ b/gcc/testsuite/g++.dg/gomp/attrs-2.C
@@ -109,9 +109,11 @@ baz (int d, int m, int i1, int i2, int p, int *idp, int s,
void
bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s,
- int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q, int *dd, int ntm)
+ int nte, int tl, int nth, int g, int nta, int fi, int pp, int *q, int *dd, int ntm,
+ const char *msg)
{
[[omp::directive (nothing)]];
+ [[omp::directive (error, at (execution), severity (warning), message (msg))]];
[[omp::directive (for simd,
private (p),firstprivate (f),lastprivate (l),linear (ll:1),reduction(+:r),schedule(static, 4),collapse(1),nowait,
safelen(8),simdlen(4),aligned(q: 32),nontemporal(ntm),if(i1),order(concurrent),allocate (f))]]
diff --git a/gcc/testsuite/g++.dg/gomp/error-1.C b/gcc/testsuite/g++.dg/gomp/error-1.C
new file mode 100644
index 0000000..a636550
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/error-1.C
@@ -0,0 +1,42 @@
+// { dg-do compile { target c++17 } }
+
+void
+foo ()
+{
+ if constexpr (false)
+ {
+ #pragma omp error // { dg-bogus "'pragma omp error' encountered" }
+ }
+ else
+ {
+ #pragma omp error at(compilation) severity(warning) message("foo") // { dg-warning "'pragma omp error' encountered: foo" }
+ }
+ if constexpr (true)
+ {
+ #pragma omp error message("bar") // { dg-error "'pragma omp error' encountered: bar" }
+ }
+ else
+ {
+ #pragma omp error message("baz") // { dg-bogus "'pragma omp error' encountered" }
+ }
+}
+
+template <typename T>
+bool
+bar (T x)
+{
+ #pragma omp error at(execution) message (x)
+ return false;
+}
+
+bool a = bar ("foo");
+
+template <typename T>
+bool
+baz (T x)
+{
+ #pragma omp error at(execution) message (x) // { dg-error "could not convert" }
+ return false;
+}
+
+bool b = baz (L"foo");
diff --git a/gcc/testsuite/g++.dg/tree-ssa/modref-1.C b/gcc/testsuite/g++.dg/tree-ssa/modref-1.C
new file mode 100644
index 0000000..c742dfe
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/modref-1.C
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+struct S { int a; char b[20]; S(); S(S const&); };
+volatile int global;
+
+__attribute__ ((noinline,noclone))
+struct S noescape (int *b)
+{
+ struct S a;
+ a.a = b!=0;
+ global = 1;
+ return a;
+}
+
+void escape (struct S *p);
+
+__attribute__ ((noinline,noclone))
+int
+test(int *b)
+{
+ struct S s = noescape (b);
+ escape (&s);
+ return *b;
+}
+int test2()
+{
+ int b=1234;
+ test (&b);
+ return b;
+}
+// ipa-modref should analyze parameter B of test as noescape.
+// { dg-final { scan-tree-dump "return 1234" } }
diff --git a/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c b/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c
index d8e19e7..00517d1 100644
--- a/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c
@@ -9,10 +9,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "gcc_tmpnam.h"
int main (void)
{
- char *tmpfname = tmpnam (0);
+ char *tmpfname = gcc_tmpnam (0);
FILE *f = fopen (tmpfname, "w");
if (!f)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/gcc_tmpnam.h b/gcc/testsuite/gcc.c-torture/execute/gcc_tmpnam.h
new file mode 100644
index 0000000..2136e6e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/gcc_tmpnam.h
@@ -0,0 +1,13 @@
+#include <stdio.h>
+#ifndef GCC_TMPNAM
+#define GCC_TMPNAM
+static inline char *gcc_tmpnam(char *s)
+{
+ char *ret = tmpnam (s);
+ // Windows sometimes prepends a backslash to denote the current directory,
+ // so swallow that if it occurs
+ if (ret[0] == '\\')
+ ++ret;
+ return ret;
+}
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/printf-2.c b/gcc/testsuite/gcc.c-torture/execute/printf-2.c
index 4e7d8f7..2087bba 100644
--- a/gcc/testsuite/gcc.c-torture/execute/printf-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/printf-2.c
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "gcc_tmpnam.h"
__attribute__ ((noipa)) void
write_file (void)
@@ -26,7 +27,7 @@ write_file (void)
int main (void)
{
- char *tmpfname = tmpnam (0);
+ char *tmpfname = gcc_tmpnam (0);
FILE *f = freopen (tmpfname, "w", stdout);
if (!f)
{
diff --git a/gcc/testsuite/gcc.c-torture/execute/user-printf.c b/gcc/testsuite/gcc.c-torture/execute/user-printf.c
index 42a3b17..bfee076 100644
--- a/gcc/testsuite/gcc.c-torture/execute/user-printf.c
+++ b/gcc/testsuite/gcc.c-torture/execute/user-printf.c
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "gcc_tmpnam.h"
void __attribute__ ((format (printf, 1, 2), noipa))
user_print (const char *fmt, ...)
@@ -23,7 +24,7 @@ user_print (const char *fmt, ...)
int main (void)
{
- char *tmpfname = tmpnam (0);
+ char *tmpfname = gcc_tmpnam (0);
FILE *f = freopen (tmpfname, "w", stdout);
if (!f)
{
diff --git a/gcc/testsuite/gcc.dg/analyzer/function-ptr-2.c b/gcc/testsuite/gcc.dg/analyzer/function-ptr-2.c
index 411b1b3..fd25e3b 100644
--- a/gcc/testsuite/gcc.dg/analyzer/function-ptr-2.c
+++ b/gcc/testsuite/gcc.dg/analyzer/function-ptr-2.c
@@ -6,9 +6,10 @@ typedef void (*fn_ptr_t) (void *);
void
calls_free (void *victim)
{
- free (victim);
+ free (victim); /* { dg-warning "double-'free' of 'victim'" } */
}
+
void
no_op (void *ptr)
{
@@ -25,7 +26,6 @@ void test_1 (void *ptr)
fn_ptr (ptr);
fn_ptr (ptr);
}
-// TODO: issue a double-'free' warning at 2nd call to fn_ptr.
/* As above, but with an extra indirection to try to thwart
the optimizer. */
@@ -41,4 +41,3 @@ void test_2 (void *ptr, fn_ptr_t *fn_ptr)
(*fn_ptr) (ptr);
(*fn_ptr) (ptr);
}
-// TODO: issue a double-'free' warning at 2nd call to fn_ptr.
diff --git a/gcc/testsuite/gcc.dg/analyzer/malloc-callbacks.c b/gcc/testsuite/gcc.dg/analyzer/malloc-callbacks.c
index 901ca5c..53c75fd 100644
--- a/gcc/testsuite/gcc.dg/analyzer/malloc-callbacks.c
+++ b/gcc/testsuite/gcc.dg/analyzer/malloc-callbacks.c
@@ -69,7 +69,7 @@ int *test_5 (void)
static void __attribute__((noinline))
called_by_test_6a (void *ptr)
{
- free (ptr); /* { dg-warning "double-'free'" "" { xfail *-*-* } } */
+ free (ptr); /* { dg-warning "double-'free'"} */
}
static deallocator_t __attribute__((noinline))
diff --git a/gcc/testsuite/gcc.dg/c11-qual-1.c b/gcc/testsuite/gcc.dg/c11-qual-1.c
new file mode 100644
index 0000000..f731e06
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c11-qual-1.c
@@ -0,0 +1,11 @@
+/* Test that qualifiers are lost in tertiary operator for pointers to arrays before C2X, PR98397 */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -pedantic-errors -Wno-discarded-array-qualifiers" } */
+
+void foo(void)
+{
+ const int (*u)[1];
+ void *v;
+ _Static_assert(_Generic(1 ? u : v, const void*: 0, void*: 1), "qualifier not lost");
+ _Static_assert(_Generic(1 ? v : u, const void*: 0, void*: 1), "qualifier not lost");
+}
diff --git a/gcc/testsuite/gcc.dg/c2x-qual-1.c b/gcc/testsuite/gcc.dg/c2x-qual-1.c
new file mode 100644
index 0000000..4d33db1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c2x-qual-1.c
@@ -0,0 +1,30 @@
+/* Tests related to qualifiers and pointers to arrays in C2X, PR98397 */
+/* { dg-do compile } */
+/* { dg-options "-std=c2x -pedantic-errors" } */
+
+/* test that qualifiers are preserved in tertiary operator for pointers to arrays in C2X */
+
+void f(void)
+{
+ const int (*u)[1];
+ void *v;
+ _Static_assert(_Generic(1 ? u : v, const void*: 1, void*: 0), "lost qualifier");
+ _Static_assert(_Generic(1 ? v : u, const void*: 1, void*: 0), "lost qualifier");
+}
+
+/* test that assignment of unqualified to qualified pointers works as expected */
+
+void g(void)
+{
+ int (*x)[3];
+ const int (*p)[3] = x;
+}
+
+/* test that assignment of qualified void pointers works as expected */
+
+void h(void)
+{
+ const void* x;
+ const int (*p)[3] = x;
+}
+
diff --git a/gcc/testsuite/gcc.dg/c2x-qual-2.c b/gcc/testsuite/gcc.dg/c2x-qual-2.c
new file mode 100644
index 0000000..f60a5b1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c2x-qual-2.c
@@ -0,0 +1,30 @@
+/* Tests related to qualifiers and pointers to arrays in C2X, PR98397 */
+/* { dg-do compile } */
+/* { dg-options "-std=c2x -Wc11-c2x-compat" } */
+
+/* test that qualifiers are preserved in tertiary operator for pointers to arrays in C2X */
+
+void f(void)
+{
+ const int (*u)[1];
+ void *v;
+ _Static_assert(_Generic(1 ? u : v, const void*: 1, void*: 0), "lost qualifier"); /* { dg-warning "pointer to array loses qualifier in conditional" } */
+ _Static_assert(_Generic(1 ? v : u, const void*: 1, void*: 0), "lost qualifier"); /* { dg-warning "pointer to array loses qualifier in conditional" } */
+}
+
+/* test that assignment of unqualified to qualified pointers works as expected */
+
+void g(void)
+{
+ int (*x)[3];
+ const int (*p)[3] = x; /* { dg-warning "arrays with different qualifiers" } */
+}
+
+/* test that assignment of qualified void pointers works as expected */
+
+void h(void)
+{
+ const void* x;
+ const int (*p)[3] = x; /* { dg-warning "array with qualifier on the element is not qualified before C2X" } */
+}
+
diff --git a/gcc/testsuite/gcc.dg/c2x-qual-3.c b/gcc/testsuite/gcc.dg/c2x-qual-3.c
new file mode 100644
index 0000000..31896fcb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c2x-qual-3.c
@@ -0,0 +1,30 @@
+/* Tests related to qualifiers and pointers to arrays in C2X, PR98397 */
+/* { dg-do compile } */
+/* { dg-options "-std=c2x -Wc11-c2x-compat -pedantic-errors" } */
+
+/* test that qualifiers are preserved in tertiary operator for pointers to arrays in C2X */
+
+void f(void)
+{
+ const int (*u)[1];
+ void *v;
+ _Static_assert(_Generic(1 ? u : v, const void*: 1, void*: 0), "lost qualifier"); /* { dg-warning "pointer to array loses qualifier in conditional" } */
+ _Static_assert(_Generic(1 ? v : u, const void*: 1, void*: 0), "lost qualifier"); /* { dg-warning "pointer to array loses qualifier in conditional" } */
+}
+
+/* test that assignment of unqualified to qualified pointers works as expected */
+
+void g(void)
+{
+ int (*x)[3];
+ const int (*p)[3] = x; /* { dg-warning "arrays with different qualifiers" } */
+}
+
+/* test that assignment of qualified void pointers works as expected */
+
+void h(void)
+{
+ const void* x;
+ const int (*p)[3] = x; /* { dg-warning "array with qualifier on the element is not qualified before C2X" } */
+}
+
diff --git a/gcc/testsuite/gcc.dg/c2x-qual-4.c b/gcc/testsuite/gcc.dg/c2x-qual-4.c
new file mode 100644
index 0000000..93b4723
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c2x-qual-4.c
@@ -0,0 +1,105 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c2x" } */
+void tvoid(void* x);
+void transpose0(double* out, const double* in) { }
+void transpose1(double out[2][2], const double in[2][2]) { }
+void transpose2(double out[2][2][2], const double in[2][2][2]) { }
+// return
+int (*y2(const int x[3][3]))[3] { return x; } /* { dg-warning "return discards 'const' qualifier from pointer target type" } */
+const int (*y3(int x[3][3]))[3] { return x; }
+void test(void)
+{
+ double x0[2];
+ double y0[2];
+ const double z0[4];
+ double x1[2][2];
+ double y1[2][2];
+ double o1[2][3];
+ const double z1[2][2];
+ double x2[2][2][2];
+ double y2[2][2][2];
+ double o2[2][2][3];
+ const double z2[2][2][2];
+ // void pointers
+ tvoid(x0);
+ tvoid(x1);
+ tvoid(x2);
+ tvoid(z0); /* { dg-warning "passing argument 1 of 'tvoid' discards 'const' qualifier from pointer target type" } */
+ tvoid(z1); /* { dg-warning "passing argument 1 of 'tvoid' discards 'const' qualifier from pointer target type" } */
+ tvoid(z2); /* { dg-warning "passing argument 1 of 'tvoid' discards 'const' qualifier from pointer target type" } */
+ void* p;
+ const void* pc;
+ p = x0;
+ p = x1;
+ p = x2;
+ p = z0; /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ p = z1; /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ p = z2; /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ pc = x0;
+ pc = x1;
+ pc = x2;
+ pc = z0;
+ pc = z1;
+ pc = z2;
+ transpose0(pc, p); /* { dg-warning "passing argument 1 of 'transpose0' discards 'const' qualifier from pointer target type" } */
+ transpose1(pc, p); /* { dg-warning "passing argument 1 of 'transpose1' discards 'const' qualifier from pointer target type" } */
+ transpose2(pc, p); /* { dg-warning "passing argument 1 of 'transpose2' discards 'const' qualifier from pointer target type" } */
+ transpose0(p, pc);
+ transpose1(p, pc);
+ transpose2(p, pc);
+ // passing as arguments
+ transpose0(y0, x0);
+ transpose1(y1, x1);
+ transpose2(y2, x2);
+ // initialization
+ const double (*u0p) = x0;
+ const double (*u1p)[2] = x1;
+ const double (*u2p)[2][2] = x2;
+ double (*v0p) = z0; /* { dg-warning "initialization discards 'const' qualifier from pointer target type" } */
+ double (*v1p)[2] = z1; /* { dg-warning "initialization discards 'const' qualifier from pointer target type" } */
+ double (*v2p)[2][2] = z2; /* { dg-warning "initialization discards 'const' qualifier from pointer target type" } */
+ // subtraction
+ &(x0[1]) - &(z0[0]);
+ &(x1[1]) - &(z1[0]);
+ &(x2[1]) - &(z2[0]);
+ // comparison
+ x0 == z0;
+ x1 == z1;
+ x2 == z2;
+ x0 < z0;
+ x1 < z1;
+ x2 < z2;
+ x0 > z0;
+ x1 > z1;
+ x2 > z2;
+ // assignment
+ u0p = x0;
+ u1p = x1;
+ u2p = x2;
+ v0p = z0; /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = z1; /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v2p = z2; /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ // conditional expressions
+ (void)(1 ? x0 : z0);
+ (void)(1 ? x1 : z1);
+ (void)(1 ? x2 : z2);
+ (void)(1 ? x0 : x1); /* { dg-warning "pointer type mismatch in conditional expression" } */
+ (void)(1 ? x1 : x2); /* { dg-warning "pointer type mismatch in conditional expression" } */
+ (void)(1 ? x2 : x0); /* { dg-warning "pointer type mismatch in conditional expression" } */
+ v0p = (1 ? z0 : v0p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? z1 : v1p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v2p = (1 ? z2 : v2p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v0p = (1 ? x0 : u0p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? x1 : u1p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v2p = (1 ? x2 : u2p); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ (1 ? x0 : z0)[0] = 1; /* { dg-error "assignment of read-only location" } */
+ (1 ? x1 : z1)[0][0] = 1; /* { dg-error "assignment of read-only location" } */
+ (1 ? x2 : z2)[0][0][0] = 1; /* { dg-error "assignment of read-only location" } */
+ v0p = (1 ? p : z0); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? p : z1); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v2p = (1 ? p : z2); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v0p = (1 ? pc : x0); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? pc : x1); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+ v2p = (1 ? pc : x2); /* { dg-warning "assignment discards 'const' qualifier from pointer target type" } */
+}
+
diff --git a/gcc/testsuite/gcc.dg/c2x-qual-5.c b/gcc/testsuite/gcc.dg/c2x-qual-5.c
new file mode 100644
index 0000000..0801fa0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c2x-qual-5.c
@@ -0,0 +1,101 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c2x -pedantic-errors" } */
+void tvoid(void* x);
+void transpose0(double* out, const double* in) { }
+void transpose1(double out[2][2], const double in[2][2]) { }
+void transpose2(double out[2][2][2], const double in[2][2][2]) { }
+// return
+int (*x2(const int x[3][3]))[3] { return x; } /* { dg-error "return discards" } */
+const int (*x3(int x[3][3]))[3] { return x; }
+void test(void)
+{
+ double x0[2];
+ double y0[2];
+ const double z0[4];
+ double x1[2][2];
+ double y1[2][2];
+ double o1[2][3];
+ const double z1[2][2];
+ double x2[2][2][2];
+ double y2[2][2][2];
+ double o2[2][2][3];
+ const double z2[2][2][2];
+ // void pointers
+ tvoid(z0); /* { dg-error "passing argument 1 of 'tvoid' discards 'const' qualifier from pointer target type" } */
+ tvoid(z1); /* { dg-error "passing argument 1 of 'tvoid' discards 'const' qualifier from pointer target type" } */
+ tvoid(z2); /* { dg-error "passing argument 1 of 'tvoid' discards 'const' qualifier from pointer target type" } */
+ void* p;
+ const void* pc;
+ p = x0;
+ p = x1;
+ p = x2;
+ p = z0; /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ p = z1; /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ p = z2; /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ pc = x0;
+ pc = x1;
+ pc = x2;
+ pc = z0;
+ pc = z1;
+ pc = z2;
+ transpose0(pc, p); /* { dg-error "passing argument 1 of 'transpose0' discards 'const' qualifier from pointer target type" } */
+ transpose1(pc, p); /* { dg-error "passing argument 1 of 'transpose1' discards 'const' qualifier from pointer target type" } */
+ transpose2(pc, p); /* { dg-error "passing argument 1 of 'transpose2' discards 'const' qualifier from pointer target type" } */
+ transpose0(p, pc);
+ transpose1(p, pc);
+ transpose2(p, pc);
+ // passing as arguments
+ transpose0(y0, x0);
+ transpose1(y1, o1); /* { dg-error "passing argument 2 of 'transpose1' from incompatible pointer type" } */
+ transpose1(y1, x1);
+ transpose2(y2, o2); /* { dg-error "passing argument 2 of 'transpose2' from incompatible pointer type" } */
+ transpose2(y2, x2);
+ // initialization
+ const double (*x0p) = x0;
+ const double (*x1p)[2] = x1;
+ const double (*x2p)[2][2] = x2;
+ double (*v0p) = z0; /* { dg-error "initialization discards 'const' qualifier from pointer target type" } */
+ double (*v1p)[2] = z1; /* { dg-error "initialization discards" } */
+ double (*v2p)[2][2] = z2; /* { dg-error "initialization discards" } */
+ // assignment
+ x0p = x0;
+ x1p = x1;
+ x2p = x2;
+ // subtraction
+ &(x0[1]) - &(z0[0]);
+ &(x1[1]) - &(z1[0]);
+ &(x2[1]) - &(z2[0]);
+ // comparison
+ x0 == z0;
+ x1 == z1;
+ x2 == z2;
+ x0 < z0;
+ x1 < z1;
+ x2 < z2;
+ x0 > z0;
+ x1 > z1;
+ x2 > z2;
+ // conditional expressions
+ (void)(1 ? x0 : z0);
+ (void)(1 ? x1 : z1);
+ (void)(1 ? x2 : z2);
+ (void)(1 ? x0 : x1); /* { dg-error "pointer type mismatch in conditional expression" } */
+ (void)(1 ? x1 : x2); /* { dg-error "pointer type mismatch in conditional expression" } */
+ (void)(1 ? x2 : x0); /* { dg-error "pointer type mismatch in conditional expression" } */
+ v0p = (1 ? z0 : v0p); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? z1 : v1p); /* { dg-error "assignment discards" } */
+ v2p = (1 ? z2 : v2p); /* { dg-error "assignment discards" } */
+ v0p = (1 ? x0 : x0p); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? x1 : x1p); /* { dg-error "assignment discards" } */
+ v2p = (1 ? x2 : x2p); /* { dg-error "assignment discards" } */
+ (1 ? x0 : z0)[0] = 1; /* { dg-error "assignment of read-only location" } */
+ (1 ? x1 : z1)[0][0] = 1; /* { dg-error "assignment of read-only location" } */
+ (1 ? x2 : z2)[0][0][0] = 1; /* { dg-error "assignment of read-only location" } */
+ v0p = (1 ? p : z0); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? p : z1); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v2p = (1 ? p : z2); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v0p = (1 ? pc : x0); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? pc : x1); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v2p = (1 ? pc : x2); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+}
+
diff --git a/gcc/testsuite/gcc.dg/c2x-qual-6.c b/gcc/testsuite/gcc.dg/c2x-qual-6.c
new file mode 100644
index 0000000..9c91e20
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c2x-qual-6.c
@@ -0,0 +1,114 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c2x -Wc11-c2x-compat -pedantic-errors" } */
+void tvoid(void* x);
+void transpose0(double* out, const double* in) { }
+void transpose1(double out[2][2], const double in[2][2]) { }
+void transpose2(double out[2][2][2], const double in[2][2][2]) { }
+// return
+int (*x2(const int x[3][3]))[3] { return x; } /* { dg-warning "before C2X" } */
+ /* { dg-error "return discards" "" { target *-*-* } .-1 } */
+const int (*x3(int x[3][3]))[3] { return x; } /* { dg-warning "before C2X" } */
+void test(void)
+{
+ double x0[2];
+ double y0[2];
+ const double z0[4];
+ double x1[2][2];
+ double y1[2][2];
+ double o1[2][3];
+ const double z1[2][2];
+ double x2[2][2][2];
+ double y2[2][2][2];
+ double o2[2][2][3];
+ const double z2[2][2][2];
+ // void pointers
+ tvoid(z0); /* { dg-error "passing argument 1 of 'tvoid' discards 'const' qualifier from pointer target type" } */
+ tvoid(z1); /* { dg-error "passing argument 1 of 'tvoid' discards 'const' qualifier from pointer target type" } */
+ tvoid(z2); /* { dg-error "passing argument 1 of 'tvoid' discards 'const' qualifier from pointer target type" } */
+ void* p;
+ const void* pc;
+ p = x0;
+ p = x1;
+ p = x2;
+ p = z0; /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ p = z1; /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ p = z2; /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ pc = x0;
+ pc = x1;
+ pc = x2;
+ pc = z0;
+ pc = z1;
+ pc = z2;
+ transpose0(pc, p); /* { dg-error "passing argument 1 of 'transpose0' discards 'const' qualifier from pointer target type" } */
+ transpose1(pc, p); /* { dg-error "passing argument 1 of 'transpose1' discards 'const' qualifier from pointer target type" } */
+ transpose2(pc, p); /* { dg-error "passing argument 1 of 'transpose2' discards 'const' qualifier from pointer target type" } */
+ transpose0(p, pc);
+ transpose1(p, pc); /* { dg-warning "before C2X" } */
+ transpose2(p, pc); /* { dg-warning "before C2X" } */
+ // passing as arguments
+ transpose0(y0, x0);
+ transpose1(y1, o1); /* { dg-error "passing argument 2 of 'transpose1' from incompatible pointer type" } */
+ transpose1(y1, x1); /* { dg-warning "before C2X" } */
+ transpose2(y2, o2); /* { dg-error "passing argument 2 of 'transpose2' from incompatible pointer type" } */
+ transpose2(y2, x2); /* { dg-warning "before C2X" } */
+ // initialization
+ const double (*x0p) = x0;
+ const double (*x1p)[2] = x1; /* { dg-warning "before C2X" } */
+ const double (*x2p)[2][2] = x2; /* { dg-warning "before C2X" } */
+ double (*v0p) = z0; /* { dg-error "initialization discards 'const' qualifier from pointer target type" } */
+ double (*v1p)[2] = z1; /* { dg-warning "before C2X" } */
+ /* { dg-error "initialization discards" "" { target *-*-* } .-1 } */
+ double (*v2p)[2][2] = z2; /* { dg-warning "before C2X" } */
+ /* { dg-error "initialization discards" "" { target *-*-* } .-1 } */
+
+ // assignment
+ x0p = x0;
+ x1p = x1; /* { dg-warning "before C2X" } */
+ x2p = x2; /* { dg-warning "before C2X" } */
+
+ // subtraction
+ &(x0[1]) - &(z0[0]);
+ &(x1[1]) - &(z1[0]); /* { dg-warning "before C2X" } */
+ &(x2[1]) - &(z2[0]); /* { dg-warning "before C2X" } */
+ // comparison
+ x0 == z0;
+ x1 == z1; /* { dg-warning "before C2X" } */
+ x2 == z2; /* { dg-warning "before C2X" } */
+ x0 < z0;
+ x1 < z1; /* { dg-warning "before C2X" } */
+ x2 < z2; /* { dg-warning "before C2X" } */
+ x0 > z0;
+ x1 > z1; /* { dg-warning "before C2X" } */
+ x2 > z2; /* { dg-warning "before C2X" } */
+ // conditional expressions
+ (void)(1 ? x0 : z0);
+ (void)(1 ? x1 : z1); /* { dg-warning "before C2X" } */
+ (void)(1 ? x2 : z2); /* { dg-warning "before C2X" } */
+ (void)(1 ? x0 : x1); /* { dg-error "pointer type mismatch in conditional expression" } */
+ (void)(1 ? x1 : x2); /* { dg-error "pointer type mismatch in conditional expression" } */
+ (void)(1 ? x2 : x0); /* { dg-error "pointer type mismatch in conditional expression" } */
+ v0p = (1 ? z0 : v0p); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? z1 : v1p); /* { dg-warning "before C2X" } */
+ /* { dg-error "assignment discards" "" { target *-*-* } .-1 } */
+ v2p = (1 ? z2 : v2p); /* { dg-warning "before C2X" } */
+ /* { dg-error "assignment discards" "" { target *-*-* } .-1 } */
+ v0p = (1 ? x0 : x0p); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? x1 : x1p); /* { dg-error "assignment discards" } */
+ /* { dg-warning "before C2X" "" { target *-*-* } .-1 } */
+ v2p = (1 ? x2 : x2p); /* { dg-error "assignment discards" } */
+ /* { dg-warning "before C2X" "" { target *-*-* } .-1 } */
+ (1 ? x0 : z0)[0] = 1; /* { dg-error "assignment of read-only location" } */
+ (1 ? x1 : z1)[0][0] = 1; /* { dg-error "assignment of read-only location" } */
+ /* { dg-warning "before C2X" "" { target *-*-* } .-1 } */
+ (1 ? x2 : z2)[0][0][0] = 1; /* { dg-error "assignment of read-only location" } */
+ /* { dg-warning "before C2X" "" { target *-*-* } .-1 } */
+ v0p = (1 ? p : z0); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? p : z1); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ /* { dg-warning "before C2X" "" { target *-*-* } .-1 } */
+ v2p = (1 ? p : z2); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ /* { dg-warning "before C2X" "" { target *-*-* } .-1 } */
+ v0p = (1 ? pc : x0); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v1p = (1 ? pc : x1); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+ v2p = (1 ? pc : x2); /* { dg-error "assignment discards 'const' qualifier from pointer target type" } */
+}
+
diff --git a/gcc/testsuite/gcc.dg/c2x-qual-7.c b/gcc/testsuite/gcc.dg/c2x-qual-7.c
new file mode 100644
index 0000000..5fe15e1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c2x-qual-7.c
@@ -0,0 +1,16 @@
+/* Tests related to qualifiers and pointers to arrays in C2X, PR98397 */
+/* { dg-do compile } */
+/* { dg-options "-std=c2x -pedantic-errors" } */
+
+/* test that _Atomic qualifier is not preserved in tertiary operator for pointers to arrays in C2X */
+
+void f(void)
+{
+ _Atomic void *u;
+ void *v;
+ _Static_assert(_Generic(1 ? u : v, _Atomic void*: 0, void*: 1), "_Atomic should be removed");
+ _Static_assert(_Generic(1 ? v : u, _Atomic void*: 0, void*: 1), "_Atomic should be removed");
+}
+
+
+
diff --git a/gcc/testsuite/gcc.dg/guality/pr101905.c b/gcc/testsuite/gcc.dg/guality/pr101905.c
new file mode 100644
index 0000000..71b7516
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr101905.c
@@ -0,0 +1,15 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-g -ffixed-r15" } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
+
+register unsigned long long regVar asm ("r15");
+
+int
+main()
+{
+ regVar = 0xdeadbeefcafebabeULL;
+ asm ("nop" : "+r" (regVar));
+ asm volatile ("nop"); /* { dg-final { gdb-test . "regVar" "0xdeadbeefcafebabeULL" } } */
+ asm volatile ("nop" : : "r" (regVar));
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr101949_0.c b/gcc/testsuite/gcc.dg/lto/pr101949_0.c
new file mode 100644
index 0000000..142dffe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr101949_0.c
@@ -0,0 +1,20 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options { "-O2 -fipa-pta -flto -flto-partition=1to1" } } */
+
+extern int bar (int (*)(int *), int *);
+
+static int x;
+
+static int __attribute__ ((noinline)) foo (int *p)
+{
+ *p = 1;
+ x = 0;
+ return *p;
+}
+
+int main ()
+{
+ if (bar (foo, &x) != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr101949_1.c b/gcc/testsuite/gcc.dg/lto/pr101949_1.c
new file mode 100644
index 0000000..871d15c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr101949_1.c
@@ -0,0 +1,4 @@
+int __attribute__((noinline,noclone)) bar (int (*fn)(int *), int *p)
+{
+ return fn (p);
+}
diff --git a/gcc/testsuite/gcc.dg/optimize-bswapdi-1.c b/gcc/testsuite/gcc.dg/optimize-bswapdi-1.c
index a4a3a79..56a2071b 100644
--- a/gcc/testsuite/gcc.dg/optimize-bswapdi-1.c
+++ b/gcc/testsuite/gcc.dg/optimize-bswapdi-1.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target bswap } */
/* { dg-require-effective-target stdint_types } */
-/* { dg-options "-O2 -fdump-tree-bswap" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-additional-options "-mzarch" { target s390*-*-* } } */
#include <stdint.h>
@@ -58,4 +58,4 @@ swap64_c (uint64_t x)
}
-/* { dg-final { scan-tree-dump-times "64 bit bswap implementation found at" 3 "bswap" } } */
+/* { dg-final { scan-tree-dump-times "= __builtin_bswap64 \\\(" 3 "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/optimize-bswapdi-2.c b/gcc/testsuite/gcc.dg/optimize-bswapdi-2.c
index 89b251f..c6d9604 100644
--- a/gcc/testsuite/gcc.dg/optimize-bswapdi-2.c
+++ b/gcc/testsuite/gcc.dg/optimize-bswapdi-2.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target bswap } */
/* { dg-require-effective-target stdint_types } */
-/* { dg-options "-O2 -fdump-tree-bswap" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-additional-options "-mzarch" { target s390*-*-* } } */
#include <stdint.h>
@@ -23,4 +23,4 @@ swap64_c (uint64_t x)
}
-/* { dg-final { scan-tree-dump-times "64 bit bswap implementation found at" 1 "bswap" } } */
+/* { dg-final { scan-tree-dump-times "= __builtin_bswap64 \\\(" 1 "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/optimize-bswapsi-1.c b/gcc/testsuite/gcc.dg/optimize-bswapsi-1.c
index c403d04..2d24f43 100644
--- a/gcc/testsuite/gcc.dg/optimize-bswapsi-1.c
+++ b/gcc/testsuite/gcc.dg/optimize-bswapsi-1.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target bswap } */
/* { dg-require-effective-target stdint_types } */
-/* { dg-options "-O2 -fdump-tree-bswap" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-additional-options "-march=z900" { target s390*-*-* } } */
#include <stdint.h>
@@ -89,4 +89,4 @@ swap32_f (unsigned in)
return in;
}
-/* { dg-final { scan-tree-dump-times "32 bit bswap implementation found at" 6 "bswap" } } */
+/* { dg-final { scan-tree-dump-times "= __builtin_bswap32 \\\(" 6 "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/optimize-bswapsi-3.c b/gcc/testsuite/gcc.dg/optimize-bswapsi-3.c
index 9418a83..7cd1b40 100644
--- a/gcc/testsuite/gcc.dg/optimize-bswapsi-3.c
+++ b/gcc/testsuite/gcc.dg/optimize-bswapsi-3.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target bswap } */
/* { dg-require-effective-target stdint_types } */
-/* { dg-options "-O2 -fdump-tree-bswap" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-additional-options "-march=z900" { target s390-*-* } } */
typedef int SItype __attribute__ ((mode (SI)));
@@ -20,4 +20,4 @@ swap32 (SItype in)
| (((in >> 24) & 0xFF) << 0);
}
-/* { dg-final { scan-tree-dump-not "32 bit bswap implementation found at" "bswap" } } */
+/* { dg-final { scan-tree-dump-times "= __builtin_bswap32 \\\(" 1 "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/optimize-bswapsi-5.c b/gcc/testsuite/gcc.dg/optimize-bswapsi-5.c
index b4d8b9a..91a5284 100644
--- a/gcc/testsuite/gcc.dg/optimize-bswapsi-5.c
+++ b/gcc/testsuite/gcc.dg/optimize-bswapsi-5.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target bswap } */
-/* { dg-options "-O2 -fdump-tree-bswap -fno-inline-functions" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fno-inline-functions" } */
/* { dg-additional-options "-march=z900" { target s390-*-* } } */
struct L { unsigned int l[2]; };
@@ -28,4 +28,4 @@ bar (double a, struct L *p)
foo (a, p);
}
-/* { dg-final { scan-tree-dump-times "32 bit bswap implementation found at" 2 "bswap" } } */
+/* { dg-final { scan-tree-dump-times "= __builtin_bswap32 \\\(" 2 "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pointer-array-quals-1.c b/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
index 921a37e..498ab22 100644
--- a/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
+++ b/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* Origin: Martin Uecker <uecker@eecs.berkeley.edu> */
-/* { dg-options "-Wdiscarded-array-qualifiers" } */
+/* { dg-options "" } */
void tvoid(void* x);
void transpose0(double* out, const double* in) { }
void transpose1(double out[2][2], const double in[2][2]) { }
diff --git a/gcc/testsuite/gcc.dg/pointer-array-quals-2.c b/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
index 30689c7..4c95d8a 100644
--- a/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
+++ b/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-Wdiscarded-array-qualifiers -pedantic-errors" } */
+/* { dg-options "-pedantic-errors" } */
/* Origin: Martin Uecker <uecker@eecs.berkeley.edu> */
void tvoid(void* x);
void transpose0(double* out, const double* in) { }
diff --git a/gcc/testsuite/gcc.dg/pr86723.c b/gcc/testsuite/gcc.dg/pr86723.c
new file mode 100644
index 0000000..e3fd6b9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr86723.c
@@ -0,0 +1,63 @@
+/* PR tree-optimization/86723 */
+/* { dg-do run { target { ilp32 || lp64 } } } */
+/* { dg-options "-O2" } */
+
+__attribute__((noipa)) int
+foo (unsigned long long value)
+{
+ return (((value & 0x00000000000000ffull) << 56)
+ | ((value & 0x000000000000ff00ull) << 40)
+ | ((value & 0x0000000000ff0000ull) << 24)
+ | ((value & 0x00000000ff000000ull) << 8)
+ | ((value & 0x000000ff00000000ull) >> 8)
+ | ((value & 0x0000ff0000000000ull) >> 24)
+ | ((value & 0x00ff000000000000ull) >> 40)
+ | ((value & 0xff00000000000000ull) >> 56));
+}
+
+__attribute__((noipa)) int
+bar (unsigned long long value)
+{
+ return (((value & 0x000000ff00000000ull) >> 8)
+ | ((value & 0x0000ff0000000000ull) >> 24)
+ | ((value & 0x00ff000000000000ull) >> 40)
+ | ((value & 0xff00000000000000ull) >> 56));
+}
+
+__attribute__((noipa)) unsigned long long
+baz (unsigned long long value)
+{
+ return (((value & 0x00000000000000ffull) << 56)
+ | ((value & 0x000000000000ff00ull) << 40)
+ | ((value & 0x00000000ff000000ull) << 8)
+ | ((value & 0x000000ff00000000ull) >> 8)
+ | ((value & 0x0000ff0000000000ull) >> 24)
+ | ((value & 0xff00000000000000ull) >> 56));
+}
+
+__attribute__((noipa)) unsigned int
+qux (unsigned int value)
+{
+ return (((value & 0x000000ff) << 24)
+ | ((value & 0x00ff0000) >> 8)
+ | ((value & 0xff000000) >> 24));
+}
+
+__attribute__((noipa)) unsigned int
+corge (unsigned int value)
+{
+ return (((value & 0x000000ff) << 24)
+ | ((value & 0xff000000) >> 24));
+}
+
+int
+main ()
+{
+ if (foo (0x0102030405060708ull) != 0x04030201
+ || bar (0x0102030405060708ull) != 0x04030201
+ || baz (0x0102030405060708ull) != 0x0807000504030001ull
+ || qux (0x01020304) != 0x04000201
+ || corge (0x01020304) != 0x04000001)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr79334-0.c b/gcc/testsuite/gcc.dg/torture/pr79334-0.c
new file mode 100644
index 0000000..fa45a6d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr79334-0.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-additional-sources "pr79334-1.c" } */
+
+extern int d[][8];
+
+static void __attribute__((noinline))
+func_that_exits (int flag)
+{
+ if (!flag)
+ __builtin_exit (0);
+}
+
+int main ()
+{
+ int e = 0;
+ while (1)
+ {
+ func_that_exits (e);
+ /* We do not know whether d[1024][0] will trap. */
+ e = d[1024][0];
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr79334-1.c b/gcc/testsuite/gcc.dg/torture/pr79334-1.c
new file mode 100644
index 0000000..b1c8a27
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr79334-1.c
@@ -0,0 +1 @@
+int d[1][8];
diff --git a/gcc/testsuite/gcc.target/arm/acle/pr100856.c b/gcc/testsuite/gcc.target/arm/acle/pr100856.c
index 5bc030e..adbe1ab 100644
--- a/gcc/testsuite/gcc.target/arm/acle/pr100856.c
+++ b/gcc/testsuite/gcc.target/arm/acle/pr100856.c
@@ -1,6 +1,6 @@
/* { dg-do run } */
-/* { dg-require-effective-target arm_v8_1m_main_cde_mve_ok } */
-/* { dg-add-options arm_v8_1m_main_cde_mve } */
+/* { dg-require-effective-target arm_v8m_main_cde_multilib } */
+/* { dg-add-options arm_v8m_main_cde } */
#include "arm_cde.h"
diff --git a/gcc/testsuite/gcc.target/i386/pr102016.c b/gcc/testsuite/gcc.target/i386/pr102016.c
new file mode 100644
index 0000000..2ff75cb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr102016.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mavx512vl -O2" } */
+typedef char v8qi __attribute__((vector_size (8)));
+typedef char v16qi __attribute__((vector_size (16)));
+v8qi
+foo_wb_128 (v16qi x)
+{
+ return __builtin_shufflevector (x, x,
+ 0, 2, 4, 6, 8, 10, 12, 14);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr86723.c b/gcc/testsuite/gcc.target/i386/pr86723.c
new file mode 100644
index 0000000..b61d750c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr86723.c
@@ -0,0 +1,52 @@
+/* PR tree-optimization/86723 */
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-times "\tbswap\t" 5 } } */
+
+int
+foo (unsigned long long value)
+{
+ return (((value & 0x00000000000000ffull) << 56)
+ | ((value & 0x000000000000ff00ull) << 40)
+ | ((value & 0x0000000000ff0000ull) << 24)
+ | ((value & 0x00000000ff000000ull) << 8)
+ | ((value & 0x000000ff00000000ull) >> 8)
+ | ((value & 0x0000ff0000000000ull) >> 24)
+ | ((value & 0x00ff000000000000ull) >> 40)
+ | ((value & 0xff00000000000000ull) >> 56));
+}
+
+int
+bar (unsigned long long value)
+{
+ return (((value & 0x000000ff00000000ull) >> 8)
+ | ((value & 0x0000ff0000000000ull) >> 24)
+ | ((value & 0x00ff000000000000ull) >> 40)
+ | ((value & 0xff00000000000000ull) >> 56));
+}
+
+unsigned long long
+baz (unsigned long long value)
+{
+ return (((value & 0x00000000000000ffull) << 56)
+ | ((value & 0x000000000000ff00ull) << 40)
+ | ((value & 0x00000000ff000000ull) << 8)
+ | ((value & 0x000000ff00000000ull) >> 8)
+ | ((value & 0x0000ff0000000000ull) >> 24)
+ | ((value & 0xff00000000000000ull) >> 56));
+}
+
+unsigned int
+qux (unsigned int value)
+{
+ return (((value & 0x000000ff) << 24)
+ | ((value & 0x00ff0000) >> 8)
+ | ((value & 0xff000000) >> 24));
+}
+
+unsigned int
+corge (unsigned int value)
+{
+ return (((value & 0x000000ff) << 24)
+ | ((value & 0xff000000) >> 24));
+}
diff --git a/gcc/testsuite/gcc.target/mips/pr101922.c b/gcc/testsuite/gcc.target/mips/pr101922.c
new file mode 100644
index 0000000..00a6e49
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/pr101922.c
@@ -0,0 +1,19 @@
+/* PR target/101922
+ This was triggering an assembler error with -O3 -mmsa -mloongson-mmi. */
+
+/* { dg-do assemble } */
+/* { dg-options "-mmsa -mloongson-mmi" } */
+
+typedef __INT8_TYPE__ i8;
+typedef __INT32_TYPE__ i32;
+
+i8 d[16];
+
+i32 f(i32 x) {
+ int i;
+ for (i = 0; i < 16; i++) {
+ i32 t = (i32) d[i] >> 31;
+ x &= t;
+ }
+ return x;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr101849.c b/gcc/testsuite/gcc.target/powerpc/pr101849.c
new file mode 100644
index 0000000..823fbfe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr101849.c
@@ -0,0 +1,22 @@
+/* PR target/101849 */
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Verify we do not ICE on the tests below. */
+
+void
+foo (__vector_pair *dst, double *x, long offset)
+{
+ dst[0] = __builtin_vsx_lxvp (0, (__vector_pair *)(void *)x);
+ dst[1] = __builtin_vsx_lxvp (32, (__vector_pair *)(void *)x);
+ dst[2] = __builtin_vsx_lxvp (offset, (__vector_pair *)(void *)x);
+}
+
+void
+bar (__vector_pair *src, double *x, long offset)
+{
+ __builtin_vsx_stxvp (src[0], 0, (__vector_pair *)(void *)x);
+ __builtin_vsx_stxvp (src[1], 32, (__vector_pair *)(void *)x);
+ __builtin_vsx_stxvp (src[2], offset, (__vector_pair *)(void *)x);
+}
diff --git a/gcc/testsuite/gfortran.dg/gomp/error-1.f90 b/gcc/testsuite/gfortran.dg/gomp/error-1.f90
new file mode 100644
index 0000000..0ee0b4b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/error-1.f90
@@ -0,0 +1,51 @@
+! { dg-additional-options "-ffree-line-length-none" }
+module m
+!$omp error ! { dg-error ".OMP ERROR encountered at .1." }
+!$omp error at(compilation) ! { dg-error ".OMP ERROR encountered at .1." }
+!$omp error severity(fatal) ! { dg-error ".OMP ERROR encountered at .1." }
+!$omp error message("my msg") ! { dg-error ".OMP ERROR encountered at .1.: my msg" }
+!$omp error severity(warning)message("another message")at(compilation) ! { dg-warning ".OMP ERROR encountered at .1.: another message" }
+
+type S
+ !$omp error ! { dg-error ".OMP ERROR encountered at .1." }
+ !$omp error at(compilation) ! { dg-error ".OMP ERROR encountered at .1." }
+ !$omp error severity(fatal) ! { dg-error ".OMP ERROR encountered at .1." }
+ !$omp error message("42") ! { dg-error ".OMP ERROR encountered at .1.: 42" }
+ !$omp error severity(warning), message("foo"), at(compilation) ! { dg-warning ".OMP ERROR encountered at .1.: foo" }
+ integer s
+end type S
+end module m
+
+integer function foo (i, x)
+ integer :: i
+ logical :: x
+ !$omp error ! { dg-error ".OMP ERROR encountered at .1." }
+ !$omp error at(compilation) ! { dg-error ".OMP ERROR encountered at .1." }
+ !$omp error severity(fatal) ! { dg-error ".OMP ERROR encountered at .1." }
+ !$omp error message("42 / 1") ! { dg-error ".OMP ERROR encountered at .1.: 42 / 1" }
+ !$omp error severity(warning) message("bar") at(compilation) ! { dg-warning ".OMP ERROR encountered at .1.: bar" }
+ if (x) then
+ !$omp error ! { dg-error ".OMP ERROR encountered at .1." }
+ i = i + 1
+ end if
+ if (x) then
+ ;
+ else
+ !$omp error at(compilation) ! { dg-error ".OMP ERROR encountered at .1." }
+ i = i + 1
+ end if
+ select case (.false.)
+ !$omp error severity(fatal) ! { dg-error ".OMP ERROR encountered at .1." }
+ case default
+ !
+ end select
+ do while (.false.)
+ !$omp error message("42 - 1") ! { dg-error ".OMP ERROR encountered at .1.: 42 - 1" }
+ i = i + 1
+ end do
+ lab:
+ !$omp error severity(warning) message("bar") at(compilation) ! { dg-warning ".OMP ERROR encountered at .1.: bar" }
+ i++;
+ foo = i
+ return
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/error-2.f90 b/gcc/testsuite/gfortran.dg/gomp/error-2.f90
new file mode 100644
index 0000000..718e82c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/error-2.f90
@@ -0,0 +1,15 @@
+subroutine foo (x, msg1, msg2)
+ integer x
+ character(len=*) :: msg1, msg2
+ if (x == 0) then
+ !$omp error at(execution)
+ else if (x == 1) then
+ !$omp error severity (warning), at (execution)
+ else if (x == 2) then
+ !$omp error at ( execution ) severity (fatal) message ("baz")
+ else if (x == 3) then
+ !$omp error severity(warning) message (msg1) at(execution)
+ else
+ !$omp error message (msg2), at(execution), severity(fatal)
+ end if
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/error-3.f90 b/gcc/testsuite/gfortran.dg/gomp/error-3.f90
new file mode 100644
index 0000000..67948cd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/error-3.f90
@@ -0,0 +1,88 @@
+module m
+!$omp error asdf ! { dg-error "Failed to match clause" }
+!$omp error at ! { dg-error "Failed to match clause" }
+!$omp error at( ! { dg-error "Expected COMPILATION or EXECUTION in AT clause at" }
+!$omp error at(runtime) ! { dg-error "Expected COMPILATION or EXECUTION in AT clause at" }
+!$omp error at(+ ! { dg-error "Expected COMPILATION or EXECUTION in AT clause at" }
+!$omp error at(compilation ! { dg-error "Expected COMPILATION or EXECUTION in AT clause at" }
+!$omp error severity ! { dg-error "Failed to match clause" }
+!$omp error severity( ! { dg-error "Expected FATAL or WARNING in SEVERITY clause at" }
+!$omp error severity(error) ! { dg-error "Expected FATAL or WARNING in SEVERITY clause at" }
+!$omp error severity(- ! { dg-error "Expected FATAL or WARNING in SEVERITY clause at" }
+!$omp error severity(fatal ! { dg-error "Expected FATAL or WARNING in SEVERITY clause at" }
+!$omp error message ! { dg-error "Failed to match clause" }
+!$omp error message( ! { dg-error "Invalid character in name" }
+!$omp error message(0 ! { dg-error "Failed to match clause" }
+!$omp error message("foo" ! { dg-error "Failed to match clause" }
+
+!$omp error at(compilation) at(compilation) ! { dg-error "Failed to match clause at" }
+!$omp error severity(fatal) severity(warning) ! { dg-error "Failed to match clause at" }
+!$omp error message("foo") message("foo") ! { dg-error "Failed to match clause at" }
+!$omp error message("foo"),at(compilation),severity(fatal),asdf ! { dg-error "Failed to match clause" }
+
+!$omp error at(execution) ! { dg-error "Unexpected !.OMP ERROR statement in MODULE" }
+
+end module
+
+module m2
+character(len=10) :: msg
+!$omp error message(1) ! { dg-error "MESSAGE clause at .1. requires a scalar default-kind CHARACTER expression" }
+!$omp error message(1.2) ! { dg-error "MESSAGE clause at .1. requires a scalar default-kind CHARACTER expression" }
+!$omp error message(4_"foo") ! { dg-error "MESSAGE clause at .1. requires a scalar default-kind CHARACTER expression" }
+!$omp error message(["bar","bar"]) ! { dg-error "MESSAGE clause at .1. requires a scalar default-kind CHARACTER expression" }
+!$omp error message(msg) ! { dg-error "Constant character expression required in MESSAGE clause" }
+
+type S
+ !$omp error at(execution) message("foo")! { dg-error "Unexpected !.OMP ERROR statement at" }
+ integer s
+end type
+end module
+
+subroutine bar
+character(len=10) :: msg
+!$omp error at(execution) message(1) ! { dg-error "MESSAGE clause at .1. requires a scalar default-kind CHARACTER expression" }
+!$omp error at(execution) message(1.2) ! { dg-error "MESSAGE clause at .1. requires a scalar default-kind CHARACTER expression" }
+!$omp error at(execution) message(4_"foo") ! { dg-error "MESSAGE clause at .1. requires a scalar default-kind CHARACTER expression" }
+!$omp error at(execution) message(["bar","bar"]) ! { dg-error "MESSAGE clause at .1. requires a scalar default-kind CHARACTER expression" }
+!$omp error at(execution) message(msg) ! OK
+
+end
+
+integer function foo (i, x, msg)
+ integer :: i
+ logical :: x
+ character(len=*) :: msg
+ !$omp error message(msg) ! { dg-error "Constant character expression required in MESSAGE clause" }
+ if (x) then
+ !$omp error at(execution) ! OK
+ end if
+ i = i + 1
+ if (x) then
+ ;
+ else
+ !$omp error at(execution) severity(warning) ! OK
+ end if
+ i = i + 1
+ select case (.false.)
+ !$omp error severity(fatal) at(execution) ! { dg-error "Expected a CASE or END SELECT statement following SELECT CASE" }
+ end select
+ do while (.false.)
+ !$omp error at(execution)message("42 - 1") ! OK
+ i = i + 1
+ end do
+99 continue
+ !$omp error severity(warning) message("bar") at(execution) ! OK
+ i = i + 1
+ foo = i
+end
+
+
+subroutine foobar
+ if (.true.) & ! { dg-error "Syntax error in IF-clause after" }
+ !$omp error at(execution)
+
+ continue
+
+ if (.true.) & ! { dg-error "Syntax error in IF-clause after" }
+ !$omp error ! { dg-error ".OMP ERROR encountered at" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr100950.f90 b/gcc/testsuite/gfortran.dg/pr100950.f90
new file mode 100644
index 0000000..cb9d126
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr100950.f90
@@ -0,0 +1,53 @@
+! { dg-do run }
+! { dg-additional-options "-fdump-tree-original" }
+! PR fortran/100950 - ICE in output_constructor_regular_field, at varasm.c:5514
+
+program p
+ character(8), parameter :: u = "123"
+ character(8) :: x = "", s
+ character(2) :: w(2) = [character(len(x(3:4))) :: 'a','b' ]
+ character(*), parameter :: y(*) = [character(len(u(3:4))) :: 'a','b' ]
+ character(*), parameter :: z(*) = [character(len(x(3:4))) :: 'a','b' ]
+ character(*), parameter :: t(*) = [character(len(x( :2))) :: 'a','b' ]
+ character(*), parameter :: v(*) = [character(len(x(7: ))) :: 'a','b' ]
+ type t_
+ character(len=5) :: s
+ character(len=8) :: t(4)
+ character(len=8), pointer :: u(:)
+ character(len=:), allocatable :: str
+ character(len=:), allocatable :: str2(:)
+ end type t_
+ type(t_) :: q, r(1)
+ integer, parameter :: lq = len (q%s(3:4)), lr = len (r%s(3:4))
+ integer, parameter :: l1 = len (q %t(1)(3:4))
+ integer, parameter :: l2 = len (q %t(:)(3:4))
+ integer, parameter :: l3 = len (q %str (3:4))
+ integer, parameter :: l4 = len (r(:)%t(1)(3:4))
+ integer, parameter :: l5 = len (r(1)%t(:)(3:4))
+ integer, parameter :: l6 = len (r(1)%str (3:4))
+ integer, parameter :: l7 = len (r(1)%str2(1)(3:4))
+ integer, parameter :: l8 = len (r(1)%str2(:)(3:4))
+
+ if (len (y) /= 2) stop 1
+ if (len (z) /= 2) stop 2
+ if (any (w /= y)) stop 3
+ if (len ([character(len(u(3:4))) :: 'a','b' ]) /= 2) stop 4
+ if (len ([character(len(x(3:4))) :: 'a','b' ]) /= 2) stop 5
+ if (any ([character(len(x(3:4))) :: 'a','b' ] /= y)) stop 6
+ write(s,*) [character(len(x(3:4))) :: 'a','b' ]
+ if (s /= " a b ") stop 7
+ if (len (t) /= 2) stop 8
+ if (len (v) /= 2) stop 9
+ if (lq /= 2 .or. lr /= 2) stop 10
+ if (l1 /= 2 .or. l2 /= 2 .or. l4 /= 2 .or. l5 /= 2) stop 11
+ if (l3 /= 2 .or. l6 /= 2 .or. l7 /= 2 .or. l8 /= 2) stop 12
+
+ block
+ integer, parameter :: l9 = len (r(1)%u(:)(3:4))
+ if (l9 /= 2) stop 13
+ end block
+end
+
+! { dg-final { scan-tree-dump-times "_gfortran_stop_numeric" 2 "original" } }
+! { dg-final { scan-tree-dump "_gfortran_stop_numeric \\(3, 0\\);" "original" } }
+! { dg-final { scan-tree-dump "_gfortran_stop_numeric \\(7, 0\\);" "original" } }
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 44465b1..66ce48d 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5518,6 +5518,24 @@ foreach { armfunc armflag armdef arminc } {
global et_FUNC_flags
return "$flags $et_FUNC_flags"
}
+
+ proc check_effective_target_FUNC_multilib { } {
+ if { ! [check_effective_target_FUNC_ok] } {
+ return 0;
+ }
+ return [check_runtime FUNC_multilib {
+ #if !(DEF)
+ #error "DEF failed"
+ #endif
+ #include <arm_cde.h>
+ INC
+ int
+ main (void)
+ {
+ return 0;
+ }
+ } [add_options_for_FUNC ""]]
+ }
}]
}
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 0570fdc..e103d2c 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -1066,6 +1066,8 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
case OMP_CLAUSE_GRAINSIZE:
pp_string (pp, "grainsize(");
+ if (OMP_CLAUSE_GRAINSIZE_STRICT (clause))
+ pp_string (pp, "strict:");
dump_generic_node (pp, OMP_CLAUSE_GRAINSIZE_EXPR (clause),
spc, flags, false);
pp_right_paren (pp);
@@ -1073,6 +1075,8 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
case OMP_CLAUSE_NUM_TASKS:
pp_string (pp, "num_tasks(");
+ if (OMP_CLAUSE_NUM_TASKS_STRICT (clause))
+ pp_string (pp, "strict:");
dump_generic_node (pp, OMP_CLAUSE_NUM_TASKS_EXPR (clause),
spc, flags, false);
pp_right_paren (pp);
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 82bd10b..bf87cee 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -914,9 +914,8 @@ copy_reference_ops_from_ref (tree ref, vec<vn_reference_op_s> *result)
break;
case COMPONENT_REF:
/* The field decl is enough to unambiguously specify the field,
- a matching type is not necessary and a mismatching type
- is always a spurious difference. */
- temp.type = NULL_TREE;
+ so use its type here. */
+ temp.type = TREE_TYPE (TREE_OPERAND (ref, 1));
temp.op0 = TREE_OPERAND (ref, 1);
temp.op1 = TREE_OPERAND (ref, 2);
temp.reverse = (AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (ref, 0)))
@@ -5873,10 +5872,33 @@ vn_reference_may_trap (vn_reference_t ref)
return true;
break;
case ARRAY_RANGE_REF:
- case ARRAY_REF:
if (TREE_CODE (op->op0) == SSA_NAME)
return true;
break;
+ case ARRAY_REF:
+ {
+ if (TREE_CODE (op->op0) != INTEGER_CST)
+ return true;
+
+ /* !in_array_bounds */
+ tree domain_type = TYPE_DOMAIN (ref->operands[i+1].type);
+ if (!domain_type)
+ return true;
+
+ tree min = op->op1;
+ tree max = TYPE_MAX_VALUE (domain_type);
+ if (!min
+ || !max
+ || TREE_CODE (min) != INTEGER_CST
+ || TREE_CODE (max) != INTEGER_CST)
+ return true;
+
+ if (tree_int_cst_lt (op->op0, min)
+ || tree_int_cst_lt (max, op->op0))
+ return true;
+
+ break;
+ }
case MEM_REF:
/* Nothing interesting in itself, the base is separate. */
break;
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index b7dde07..37f46d1 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2831,12 +2831,6 @@ dr_group_sort_cmp (const void *dra_, const void *drb_)
if (dra == drb)
return 0;
- /* DRs in different basic-blocks never belong to the same group. */
- int bb_index1 = gimple_bb (DR_STMT (dra))->index;
- int bb_index2 = gimple_bb (DR_STMT (drb))->index;
- if (bb_index1 != bb_index2)
- return bb_index1 < bb_index2 ? -1 : 1;
-
/* Different group IDs lead never belong to the same group. */
if (dra_pair.second != drb_pair.second)
return dra_pair.second < drb_pair.second ? -1 : 1;
@@ -2963,7 +2957,13 @@ vect_analyze_data_ref_accesses (vec_info *vinfo,
datarefs_copy.create (datarefs.length ());
for (unsigned i = 0; i < datarefs.length (); i++)
{
- int group_id = dataref_groups ? (*dataref_groups)[i] : 0;
+ int group_id;
+ /* If the caller computed DR grouping use that, otherwise group by
+ basic blocks. */
+ if (dataref_groups)
+ group_id = (*dataref_groups)[i];
+ else
+ group_id = gimple_bb (DR_STMT (datarefs[i]))->index;
datarefs_copy.quick_push (data_ref_pair (datarefs[i], group_id));
}
datarefs_copy.qsort (dr_group_sort_cmp);
@@ -2999,13 +2999,8 @@ vect_analyze_data_ref_accesses (vec_info *vinfo,
matters we can push those to a worklist and re-iterate
over them. The we can just skip ahead to the next DR here. */
- /* DRs in a different BBs should not be put into the same
+ /* DRs in a different DR group should not be put into the same
interleaving group. */
- int bb_index1 = gimple_bb (DR_STMT (dra))->index;
- int bb_index2 = gimple_bb (DR_STMT (drb))->index;
- if (bb_index1 != bb_index2)
- break;
-
if (dra_group_id != drb_group_id)
break;
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 2e00b3e..0d7f041 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -2162,9 +2162,10 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi,
if (op >= FIRST_NORM_OPTAB && op <= LAST_NORM_OPTAB
&& optab_handler (op, TYPE_MODE (TREE_TYPE (type))) != CODE_FOR_nothing)
{
- tree slhs = make_ssa_name (TREE_TYPE (TREE_TYPE (lhs)));
- gimple *repl = gimple_build_assign (slhs, code, srhs1, srhs2);
- gsi_insert_before (gsi, repl, GSI_SAME_STMT);
+ tree stype = TREE_TYPE (TREE_TYPE (lhs));
+ tree slhs = (rhs2 != NULL_TREE)
+ ? gimplify_build2 (gsi, code, stype, srhs1, srhs2)
+ : gimplify_build1 (gsi, code, stype, srhs1);
gimple_assign_set_rhs_from_tree (gsi,
build_vector_from_val (type, slhs));
update_stmt (stmt);
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 4dcc70c..d2f6a16 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -5985,6 +5985,8 @@ vect_slp_bbs (const vec<basic_block> &bbs)
&dataref_groups, current_group))
++current_group;
}
+ /* New BBs always start a new DR group. */
+ ++current_group;
}
return vect_slp_region (bbs, datarefs, &dataref_groups, insns);
diff --git a/gcc/tree.h b/gcc/tree.h
index 905417f..060a41f 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1612,6 +1612,11 @@ class auto_suppress_location_wrappers
#define OMP_CLAUSE_PRIORITY_EXPR(NODE) \
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIORITY),0)
+#define OMP_CLAUSE_GRAINSIZE_STRICT(NODE) \
+ TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_GRAINSIZE))
+#define OMP_CLAUSE_NUM_TASKS_STRICT(NODE) \
+ TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_TASKS))
+
/* OpenACC clause expressions */
#define OMP_CLAUSE_EXPR(NODE, CLAUSE) \
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, CLAUSE), 0)