diff --git a/.gitignore b/.gitignore index b67c902..3bfbff8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,32 +1,60 @@ -/isl-0.24.tar.bz2 -/nvptx-tools-87ce9dc5999e5fca2e1d3478a30888d9864c9804.tar.xz -/newlib-cygwin-2e4db338ac125579d555aeee516e48588a628a16.tar.xz -/gcc-15.0.1-20250201.tar.xz -/gcc-15.0.1-20250204.tar.xz -/gcc-15.0.1-20250225.tar.xz -/gcc-15.0.1-20250301.tar.xz -/gcc-15.0.1-20250313.tar.xz -/gcc-15.0.1-20250329.tar.xz -/gcc-15.0.1-20250410.tar.xz -/newlib-cygwin-d35cc82b5ec15bb8a5fe0fe11e183d1887992e99.tar.xz -/gcc-15.0.1-20250417.tar.xz -/gcc-15.0.1-20250418.tar.xz -/gcc-15.1.1-20250425.tar.xz -/gcc-15.1.1-20250521.tar.xz -/gcc-15.1.1-20250707.tar.xz -/gcc-15.1.1-20250718.tar.xz -/gcc-15.1.1-20250719.tar.xz -/gcc-15.2.1-20250808.tar.xz -/nvptx-tools-a0c1fff6534a4df9fb17937c3c4a4b1071212029.tar.xz -/gcc-15.2.1-20250924.tar.xz -/gcc-15.2.1-20251022.tar.xz -/gcc-15.2.1-20251111.tar.xz -/gcc-15.2.1-20251211.tar.xz -/gcc-16.0.0-20251218.tar.xz -/gcc-16.0.0-20251220.tar.xz -/gcc-16.0.0-20260103.tar.xz -/gcc-16.0.0-20260110.tar.xz -/gcc-16.0.0-20260112.tar.xz -/gcc-16.0.1-20260112.tar.xz -/gcc-16.0.1-20260113.tar.xz -/gcc-16.0.1-20260115.tar.xz +/gcc-10.0.1-20200118.tar.xz +/newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz +/nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz +/gcc-10.0.1-20200121.tar.xz +/gcc-10.0.1-20200123.tar.xz +/gcc-10.0.1-20200126.tar.xz +/gcc-10.0.1-20200130.tar.xz +/gcc-10.0.1-20200216.tar.xz +/gcc-10.0.1-20200311.tar.xz +/gcc-10.0.1-20200325.tar.xz +/gcc-10.0.1-20200328.tar.xz +/gcc-10.0.1-20200420.tar.xz +/gcc-10.0.1-20200501.tar.xz +/gcc-10.1.1-20200507.tar.xz +/gcc-10.1.1-20200618.tar.xz +/gcc-10.2.1-20200723.tar.xz +/gcc-10.2.1-20200804.tar.xz +/gcc-10.2.1-20200826.tar.xz +/gcc-10.2.1-20200916.tar.xz +/gcc-10.2.1-20201005.tar.xz +/gcc-10.2.1-20201016.tar.xz +/gcc-10.2.1-20201102.tar.xz +/gcc-10.2.1-20201112.tar.xz +/gcc-10.2.1-20201125.tar.xz +/gcc-11.0.0-20201204.tar.xz +/gcc-11.0.0-20201216.tar.xz +/gcc-11.0.0-20201217.tar.xz +/gcc-11.0.0-20201223.tar.xz +/gcc-11.0.0-20210109.tar.xz +/gcc-11.0.0-20210113.tar.xz +/gcc-11.0.0-20210116.tar.xz +/gcc-11.0.0-20210119.tar.xz +/gcc-11.0.0-20210123.tar.xz +/gcc-11.0.0-20210130.tar.xz +/gcc-11.0.0-20210210.tar.xz +/gcc-11.0.0-20210225.tar.xz +/gcc-11.0.1-20210307.tar.xz +/gcc-11.0.1-20210319.tar.xz +/isl-0.18.tar.bz2 +/gcc-11.0.1-20210324.tar.xz +/gcc-11.0.1-20210405.tar.xz +/gcc-11.0.1-20210418.tar.xz +/gcc-11.0.1-20210422.tar.xz +/gcc-11.0.1-20210423.tar.xz +/gcc-11.1.1-20210428.tar.xz +/gcc-11.1.1-20210512.tar.xz +/gcc-11.1.1-20210531.tar.xz +/gcc-11.1.1-20210617.tar.xz +/gcc-11.1.1-20210623.tar.xz +/gcc-11.1.1-20210726.tar.xz +/gcc-11.2.1-20210728.tar.xz +/gcc-11.2.1-20210823.tar.xz +/gcc-11.2.1-20211012.tar.xz +/gcc-11.2.1-20211018.tar.xz +/gcc-11.2.1-20211019.tar.xz +/gcc-11.2.1-20211203.tar.xz +/gcc-11.2.1-20220125.tar.xz +/gcc-11.2.1-20220127.tar.xz +/gcc-11.2.1-20220401.tar.xz +/gcc-11.3.1-20220421.tar.xz diff --git a/gcc.spec b/gcc.spec index 71e5d1d..89e8939 100644 --- a/gcc.spec +++ b/gcc.spec @@ -1,19 +1,16 @@ -%global DATE 20260115 -%global gitrev 1a9a51aca25eaad91d80869c43859274fe5e1096 -%global gcc_version 16.0.1 -%global gcc_major 16 +%global DATE 20220421 +%global gitrev 1d3172725999deb0dca93ac70393ed9a0ad0da3f +%global gcc_version 11.3.1 +%global gcc_major 11 # Note, gcc_release must be integer, if you want to add suffixes to # %%{release}, append them after %%{gcc_release} on Release: line. -%global gcc_release 0 -%global nvptx_tools_gitrev a0c1fff6534a4df9fb17937c3c4a4b1071212029 -%global newlib_cygwin_gitrev d35cc82b5ec15bb8a5fe0fe11e183d1887992e99 +%global gcc_release 2 +%global nvptx_tools_gitrev 5f6f343a302d620b0868edab376c00b15741e39e +%global newlib_cygwin_gitrev 50e2a63b04bdd018484605fbb954fd1bd5147fa0 %global _unpackaged_files_terminate_build 0 -%if 0%{?fedora:1} %global _performance_build 1 # Hardening slows the compiler way too much. %undefine _hardened_build -%endif -%undefine _auto_set_build_flags %if 0%{?fedora} > 27 || 0%{?rhel} > 7 # Until annobin is fixed (#1519165). %undefine _annotated_build @@ -26,13 +23,6 @@ %if 0%{?__brp_strip_lto:1} %global __brp_strip_lto %{__brp_strip_lto} || : %endif -%if 0%{?rhel} > 0 -%define bugurl https://issues.redhat.com -%else -%define bugurl https://bugzilla.redhat.com/bugzilla -%endif -%{!?dist_bug_report_url: %global dist_bug_report_url %bugurl} - %if 0%{?fedora} < 32 && 0%{?rhel} < 8 %global multilib_64_archs sparc64 ppc64 ppc64p7 s390x x86_64 %else @@ -43,9 +33,6 @@ %global build_objc 0 %global build_go 0 %global build_d 0 -%global build_m2 0 -%global build_cobol 0 -%global build_algol68 0 %else %ifarch %{ix86} x86_64 ia64 ppc %{power64} alpha s390x %{arm} aarch64 riscv64 %global build_ada 1 @@ -58,49 +45,33 @@ %else %global build_go 0 %endif -%ifarch %{ix86} x86_64 %{arm} aarch64 %{mips} s390 s390x riscv64 +%ifarch %{ix86} x86_64 %{arm} %{mips} s390 s390x riscv64 %global build_d 1 %else %global build_d 0 %endif -%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64 %{mips} riscv64 -%global build_m2 1 -%else -%global build_m2 0 -%endif -%ifarch x86_64 aarch64 ppc64le -%global build_cobol 1 -%else -%global build_cobol 0 -%endif -%global build_algol68 1 %endif %ifarch %{ix86} x86_64 ia64 ppc64le %global build_libquadmath 1 %else %global build_libquadmath 0 %endif -%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64 riscv64 +%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64 %global build_libasan 1 %else %global build_libasan 0 %endif -%ifarch x86_64 aarch64 -%global build_libhwasan 1 -%else -%global build_libhwasan 0 -%endif -%ifarch x86_64 ppc64 ppc64le aarch64 s390x riscv64 +%ifarch x86_64 ppc64 ppc64le aarch64 %global build_libtsan 1 %else %global build_libtsan 0 %endif -%ifarch x86_64 ppc64 ppc64le aarch64 s390x riscv64 +%ifarch x86_64 ppc64 ppc64le aarch64 %global build_liblsan 1 %else %global build_liblsan 0 %endif -%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64 riscv64 +%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64 %global build_libubsan 1 %else %global build_libubsan 0 @@ -110,7 +81,7 @@ %else %global build_libatomic 0 %endif -%ifarch %{ix86} x86_64 %{arm} alpha ppc ppc64 ppc64le ppc64p7 s390 s390x aarch64 riscv64 +%ifarch %{ix86} x86_64 %{arm} alpha ppc ppc64 ppc64le ppc64p7 s390 s390x aarch64 %global build_libitm 1 %else %global build_libitm 0 @@ -121,7 +92,7 @@ %global build_isl 1 %endif %global build_libstdcxx_docs 1 -%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64 %{mips} riscv64 +%ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64 %{mips} %global attr_ifunc 1 %else %global attr_ifunc 0 @@ -131,11 +102,6 @@ %else %global build_offload_nvptx 0 %endif -%ifarch x86_64 -%global build_offload_amdgcn 1 -%else -%global build_offload_amdgcn 0 -%endif %if 0%{?fedora} < 32 && 0%{?rhel} < 8 %ifarch s390x %global multilib_32_arch s390 @@ -150,47 +116,36 @@ %ifarch x86_64 %global multilib_32_arch i686 %endif -%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10 -%global build_annobin_plugin 1 -%else -%global build_annobin_plugin 0 -%endif Summary: Various compilers (C, C++, Objective-C, ...) Name: gcc Version: %{gcc_version} -Release: %{gcc_release}.3%{?dist} -# License notes for some of the less obvious ones: -# gcc/doc/cppinternals.texi: Linux-man-pages-copyleft-2-para -# isl: MIT, BSD-2-Clause -# libcody: Apache-2.0 -# libphobos/src/etc/c/curl.d: curl -# All of the remaining license soup is in newlib. -License: GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel +Release: %{gcc_release}%{?dist} +# libgcc, libgfortran, libgomp, libstdc++ and crtstuff have +# GCC Runtime Exception. +License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD # The source for this package was pulled from upstream's vcs. # %%{gitrev} is some commit from the # https://gcc.gnu.org/git/?p=gcc.git;h=refs/vendors/redhat/heads/gcc-%%{gcc_major}-branch -# branch. Use the following command to generate the tarball: -# ./update-gcc.sh %%{gitrev} -# optionally if say /usr/src/gcc/.git/ is an existing gcc git clone -# ./update-gcc.sh %%{gitrev} /usr/src/gcc/.git/ -# to speed up the clone operations. Note, %%{gitrev} macro in -# gcc.spec shouldn't be updated before running the script, the script -# will update it, fill in some %%changelog details etc. +# branch. Use the following commands to generate the tarball: +# git clone --depth 1 git://gcc.gnu.org/git/gcc.git gcc-dir.tmp +# git --git-dir=gcc-dir.tmp/.git fetch --depth 1 origin %%{gitrev} +# git --git-dir=gcc-dir.tmp/.git archive --prefix=%%{name}-%%{version}-%%{DATE}/ %%{gitrev} | xz -9e > %%{name}-%%{version}-%%{DATE}.tar.xz +# rm -rf gcc-dir.tmp Source0: gcc-%{version}-%{DATE}.tar.xz # The source for nvptx-tools package was pulled from upstream's vcs. Use the # following commands to generate the tarball: -# git clone --depth 1 https://github.com/MentorEmbedded/nvptx-tools.git nvptx-tools-dir.tmp +# git clone --depth 1 git://github.com/MentorEmbedded/nvptx-tools.git nvptx-tools-dir.tmp # git --git-dir=nvptx-tools-dir.tmp/.git fetch --depth 1 origin %%{nvptx_tools_gitrev} # git --git-dir=nvptx-tools-dir.tmp/.git archive --prefix=nvptx-tools-%%{nvptx_tools_gitrev}/ %%{nvptx_tools_gitrev} | xz -9e > nvptx-tools-%%{nvptx_tools_gitrev}.tar.xz # rm -rf nvptx-tools-dir.tmp Source1: nvptx-tools-%{nvptx_tools_gitrev}.tar.xz # The source for nvptx-newlib package was pulled from upstream's vcs. Use the # following commands to generate the tarball: -# git clone https://sourceware.org/git/newlib-cygwin.git newlib-cygwin-dir.tmp +# git clone git://sourceware.org/git/newlib-cygwin.git newlib-cygwin-dir.tmp # git --git-dir=newlib-cygwin-dir.tmp/.git archive --prefix=newlib-cygwin-%%{newlib_cygwin_gitrev}/ %%{newlib_cygwin_gitrev} ":(exclude)newlib/libc/sys/linux/include/rpc/*.[hx]" | xz -9e > newlib-cygwin-%%{newlib_cygwin_gitrev}.tar.xz # rm -rf newlib-cygwin-dir.tmp Source2: newlib-cygwin-%{newlib_cygwin_gitrev}.tar.xz -%global isl_version 0.24 +%global isl_version 0.18 Source3: https://gcc.gnu.org/pub/gcc/infrastructure/isl-%{isl_version}.tar.bz2 URL: http://gcc.gnu.org # Need binutils with -pie support >= 2.14.90.0.4-4 @@ -206,8 +161,11 @@ URL: http://gcc.gnu.org # Need binutils which support -plugin # Need binutils which support .loc view >= 2.30 # Need binutils which support --generate-missing-build-notes=yes >= 2.31 -# Need binutils which support .base64 >= 2.43 -BuildRequires: binutils >= 2.43 +%if 0%{?fedora} >= 29 || 0%{?rhel} > 7 +BuildRequires: binutils >= 2.31 +%else +BuildRequires: binutils >= 2.24 +%endif # While gcc doesn't include statically linked binaries, during testing # -static is used several times. BuildRequires: glibc-static @@ -220,9 +178,6 @@ BuildRequires: gcc, gcc-c++, make %if %{build_go} BuildRequires: hostname, procps %endif -%if %{build_cobol} -BuildRequires: libxml2-devel -%endif # For VTA guality testing BuildRequires: gdb # Make sure pthread.h doesn't contain __thread tokens @@ -236,20 +191,14 @@ BuildRequires: libzstd-devel # Make sure glibc supports TFmode long double BuildRequires: glibc >= 2.3.90-35 %endif -%ifarch %{multilib_64_archs} -BuildRequires: (glibc32 or glibc-devel(%{__isa_name}-32)) -%endif -%ifarch sparcv9 ppc -BuildRequires: (glibc64 or glibc-devel(%{__isa_name}-64)) +%ifarch %{multilib_64_archs} sparcv9 ppc +# Ensure glibc{,-devel} is installed for both multilib arches +BuildRequires: /lib/libc.so.6 /usr/lib/libc.so /lib64/libc.so.6 /usr/lib64/libc.so %endif %if %{build_ada} # Ada requires Ada to build BuildRequires: gcc-gnat >= 3.1, libgnat >= 3.1 %endif -%if %{build_d} -# D requires D to build -BuildRequires: gcc-gdc >= 11.0.0, libgphobos-static >= 11.0.0 -%endif %ifarch ia64 BuildRequires: libunwind >= 0.98 %endif @@ -257,9 +206,6 @@ BuildRequires: libunwind >= 0.98 BuildRequires: doxygen >= 1.7.1 BuildRequires: graphviz, dblatex, texlive-collection-latex, docbook5-style-xsl %endif -%if %{build_offload_amdgcn} -BuildRequires: llvm >= 15, lld >= 15 -%endif Requires: cpp = %{version}-%{release} # Need .eh_frame ld optimizations # Need proper visibility support @@ -277,8 +223,11 @@ Requires: cpp = %{version}-%{release} # Need binutils that support -plugin # Need binutils that support .loc view >= 2.30 # Need binutils which support --generate-missing-build-notes=yes >= 2.31 -# Need binutils that support .base64 >= 2.43 -Requires: binutils >= 2.43 +%if 0%{?fedora} >= 29 || 0%{?rhel} > 7 +Requires: binutils >= 2.31 +%else +Requires: binutils >= 2.24 +%endif # Make sure gdb will understand DW_FORM_strp Conflicts: gdb < 5.1-2 Requires: glibc-devel >= 2.2.90-12 @@ -293,11 +242,6 @@ Requires: glibc >= 2.16 %endif Requires: libgcc >= %{version}-%{release} Requires: libgomp = %{version}-%{release} -%if %{build_libatomic} -Requires: libatomic = %{version}-%{release} -Obsoletes: libatomic-static < %{version}-%{release} -Provides: libatomic-static = %{version}-%{release} -%endif # lto-wrapper invokes make Requires: make %if !%{build_ada} @@ -310,23 +254,35 @@ Provides: bundled(libbacktrace) Provides: bundled(libffi) Provides: gcc(major) = %{gcc_major} -Patch0: gcc16-hack.patch -Patch2: gcc16-sparc-config-detection.patch -Patch3: gcc16-libgomp-omp_h-multilib.patch -Patch4: gcc16-libtool-no-rpath.patch -Patch5: gcc16-isl-dl.patch -Patch6: gcc16-isl-dl2.patch -Patch7: gcc16-libstdc++-docs.patch -Patch8: gcc16-no-add-needed.patch -Patch9: gcc16-Wno-format-security.patch -Patch10: gcc16-rh1574936.patch -Patch11: gcc16-d-shared-libphobos.patch -Patch12: gcc16-pr119006.patch -Patch13: gcc16-pr123273.patch +Patch0: gcc11-hack.patch +Patch2: gcc11-sparc-config-detection.patch +Patch3: gcc11-libgomp-omp_h-multilib.patch +Patch4: gcc11-libtool-no-rpath.patch +Patch5: gcc11-isl-dl.patch +Patch6: gcc11-isl-dl2.patch +Patch7: gcc11-libstdc++-docs.patch +Patch8: gcc11-no-add-needed.patch +Patch9: gcc11-foffload-default.patch +Patch10: gcc11-Wno-format-security.patch +Patch11: gcc11-rh1574936.patch +Patch12: gcc11-d-shared-libphobos.patch +Patch13: gcc11-pr99341-revert.patch +Patch14: gcc11-libgcc-link.patch +Patch15: gcc11-pr101786.patch +Patch16: gcc11-stringify-__VA_OPT__.patch +Patch17: gcc11-stringify-__VA_OPT__-2.patch +Patch18: gcc11-pr105331.patch -Patch50: isl-rh2155127.patch - -Patch100: gcc16-fortran-fdec-duplicates.patch +Patch100: gcc11-fortran-fdec-duplicates.patch +Patch101: gcc11-fortran-flogical-as-integer.patch +Patch102: gcc11-fortran-fdec-ichar.patch +Patch103: gcc11-fortran-fdec-non-integer-index.patch +Patch104: gcc11-fortran-fdec-old-init.patch +Patch105: gcc11-fortran-fdec-override-kind.patch +Patch106: gcc11-fortran-fdec-non-logical-if.patch +Patch107: gcc11-fortran-fdec-promotion.patch +Patch108: gcc11-fortran-fdec-sequence.patch +Patch109: gcc11-fortran-fdec-add-missing-indexes.patch # On ARM EABI systems, we do want -gnueabi to be part of the # target triple. @@ -348,7 +304,7 @@ Patch100: gcc16-fortran-fdec-duplicates.patch %if %{build_go} # Avoid stripping these libraries and binaries. %global __os_install_post \ -chmod 644 %{buildroot}%{_prefix}/%{_lib}/libgo.so.25.* \ +chmod 644 %{buildroot}%{_prefix}/%{_lib}/libgo.so.19.* \ chmod 644 %{buildroot}%{_prefix}/bin/go.gcc \ chmod 644 %{buildroot}%{_prefix}/bin/gofmt.gcc \ chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo \ @@ -356,7 +312,7 @@ chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major} chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/test2json \ chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/vet \ %__os_install_post \ -chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgo.so.25.* \ +chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgo.so.19.* \ chmod 755 %{buildroot}%{_prefix}/bin/go.gcc \ chmod 755 %{buildroot}%{_prefix}/bin/gofmt.gcc \ chmod 755 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo \ @@ -367,26 +323,26 @@ chmod 755 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major} %endif %description -The gcc package contains the GNU Compiler Collection version %{gcc_major}. +The gcc package contains the GNU Compiler Collection version 11. You'll need this package in order to compile C code. %package -n libgcc -Summary: GCC version %{gcc_major} shared support library +Summary: GCC version 11 shared support library Autoreq: false %if !%{build_ada} Obsoletes: libgnat < %{version}-%{release} %endif -Obsoletes: libmudflap < %{version}-%{release} -Obsoletes: libmudflap-devel < %{version}-%{release} -Obsoletes: libmudflap-static < %{version}-%{release} +Obsoletes: libmudflap +Obsoletes: libmudflap-devel +Obsoletes: libmudflap-static Obsoletes: libgcj < %{version}-%{release} Obsoletes: libgcj-devel < %{version}-%{release} Obsoletes: libgcj-src < %{version}-%{release} %ifarch %{ix86} x86_64 -Obsoletes: libcilkrts < %{version}-%{release} -Obsoletes: libcilkrts-static < %{version}-%{release} -Obsoletes: libmpx < %{version}-%{release} -Obsoletes: libmpx-static < %{version}-%{release} +Obsoletes: libcilkrts +Obsoletes: libcilkrts-static +Obsoletes: libmpx +Obsoletes: libmpx-static %endif %description -n libgcc @@ -411,12 +367,6 @@ including templates and exception handling. Summary: GNU Standard C++ Library Autoreq: true Requires: glibc >= 2.10.90-7 -BuildRequires: tzdata >= 2017c -%if 0%{?fedora} > 38 || 0%{?rhel} > 9 -Recommends: tzdata >= 2017c -%else -Requires: tzdata >= 2017c -%endif %description -n libstdc++ The libstdc++ package contains a rewritten standard compliant GCC Standard @@ -494,11 +444,9 @@ programs with the GNU Compiler Collection. %package -n libgfortran Summary: Fortran runtime Autoreq: true -%if 0%{?fedora} < 28 && 0%{?rhel} < 8 %if %{build_libquadmath} Requires: libquadmath = %{version}-%{release} %endif -%endif %description -n libgfortran This package contains Fortran shared library which is needed to run @@ -543,96 +491,15 @@ Requires: gcc-gdc = %{version}-%{release} %description -n libgphobos-static This package contains static D libraries. -%package gm2 -Summary: Modula-2 support -Requires: gcc = %{version}-%{release} -Requires: libgm2 = %{version}-%{release} -Provides: gcc-m2 = %{version}-%{release} -Provides: gm2 = %{version}-%{release} -Autoreq: true - -%description gm2 -The gcc-gm2 package provides support for compiling Modula-2 -programs with the GNU Compiler Collection. - -%package -n libgm2 -Summary: Modula-2 runtime -Autoreq: true - -%description -n libgm2 -This package contains Modula-2 shared libraries which are needed to run -Modula-2 dynamically linked programs. - -%package -n libgm2-static -Summary: Static Modula-2 libraries -Requires: libgm2 = %{version}-%{release} -Requires: gcc-gm2 = %{version}-%{release} - -%description -n libgm2-static -This package contains static Modula-2 libraries. - -%package gcobol -Summary: COBOL support -Requires: gcc = %{version}-%{release} -Requires: gcc-c++ = %{version}-%{release} -Requires: libgcobol = %{version}-%{release} -Autoreq: true - -%description gcobol -The gcc-gcobol package provides support for compiling COBOL -programs with the GNU Compiler Collection. - -%package -n libgcobol -Summary: COBOL runtime -Autoreq: true - -%description -n libgcobol -This package contains COBOL shared libraries which are needed to run -COBOL dynamically linked programs. - -%package -n libgcobol-static -Summary: Static COBOL libraries -Requires: libgcobol = %{version}-%{release} -Requires: gcc-gcobol = %{version}-%{release} - -%description -n libgcobol-static -This package contains static COBOL libraries. - -%package algol68 -Summary: Algol 68 support -Requires: gcc = %{version}-%{release} -Requires: libga68 = %{version}-%{release} -Autoreq: true - -%description algol68 -The gcc-algol68 package provides support for compiling Algol 68 -programs with the GNU Compiler Collection. - -%package -n libga68 -Summary: Algol 68 runtime -Autoreq: true - -%description -n libga68 -This package contains Algol 68 shared libraries which are needed to run -Algol 68 dynamically linked programs. - -%package -n libga68-static -Summary: Static Algol 68 libraries -Requires: libga68 = %{version}-%{release} -Requires: gcc-algol68 = %{version}-%{release} - -%description -n libga68-static -This package contains static Algol 68 libraries. - %package -n libgomp -Summary: GCC OpenMP v5.2 shared support library +Summary: GCC OpenMP v4.5 shared support library %description -n libgomp This package contains GCC shared support library which is needed -for OpenMP v5.2 support. +for OpenMP v4.5 support. %package -n libgomp-offload-nvptx -Summary: GCC OpenMP v5.2 plugin for offloading to NVPTX +Summary: GCC OpenMP v4.5 plugin for offloading to NVPTX Requires: libgomp = %{version}-%{release} %description -n libgomp-offload-nvptx @@ -640,17 +507,6 @@ This package contains libgomp plugin for offloading to NVidia PTX. The plugin needs libcuda.so.1 shared library that has to be installed separately. -%package -n libgomp-offload-amdgcn -Summary: GCC OpenMP v5.2 plugin for offloading to AMD GCN -Requires: libgomp = %{version}-%{release} -%if 0%{?fedora:1} -Requires: rocm-runtime >= 6.0.0 -%endif - -%description -n libgomp-offload-amdgcn -This package contains libgomp plugin for offloading to AMD ROCm capable -devices. - %package gdb-plugin Summary: GCC plugin for GDB Requires: gcc = %{version}-%{release} @@ -677,20 +533,6 @@ Requires: libgccjit = %{version}-%{release} %description -n libgccjit-devel This package contains header files and documentation for GCC JIT front-end. -%package -n libgdiagnostics -Summary: Library for emitting diagnostics - -%description -n libgdiagnostics -This package contains libgdiagnostics shared library and sarif-replay program. - -%package -n libgdiagnostics-devel -Summary: Support for emitting diagnostics -Requires: libgdiagnostics = %{version}-%{release} - -%description -n libgdiagnostics-devel -This package contains header files and documentation for the libgdiagnostics -library. - %package -n libquadmath Summary: GCC __float128 shared support library @@ -746,6 +588,13 @@ This package contains the GNU Atomic library which is a GCC support runtime library for atomic operations not supported by hardware. +%package -n libatomic-static +Summary: The GNU Atomic static library +Requires: libatomic = %{version}-%{release} + +%description -n libatomic-static +This package contains GNU Atomic static libraries. + %package -n libasan Summary: The Address Sanitizer runtime library @@ -760,21 +609,6 @@ Requires: libasan = %{version}-%{release} %description -n libasan-static This package contains Address Sanitizer static runtime library. -%package -n libhwasan -Summary: The Hardware-assisted Address Sanitizer runtime library - -%description -n libhwasan -This package contains the Hardware-assisted Address Sanitizer library -which is used for -fsanitize=hwaddress instrumented programs. - -%package -n libhwasan-static -Summary: The Hardware-assisted Address Sanitizer static library -Requires: libhwasan = %{version}-%{release} - -%description -n libhwasan-static -This package contains Hardware-assisted Address Sanitizer static runtime -library. - %package -n libtsan Summary: The Thread Sanitizer runtime library @@ -940,64 +774,61 @@ NVidia PTX. OpenMP and OpenACC programs linked with -fopenmp will by default add PTX code into the binaries, which can be offloaded to NVidia PTX capable devices if available. -%package offload-amdgcn -Summary: Offloading compiler to AMD GCN -Requires: gcc = %{version}-%{release} -Requires: libgomp-offload-amdgcn = %{version}-%{release} -Requires: llvm >= 15, lld >= 15 - -%description offload-amdgcn -The gcc-offload-amdgcn package provides offloading support for -AMD GCN. OpenMP and OpenACC programs linked with -fopenmp will -by default add GCN code into the binaries, which can be offloaded -to AMD ROCm capable devices if available. - -%package plugin-annobin -Summary: The annobin plugin for gcc, built by the installed version of gcc -Requires: gcc = %{version}-%{release} -%if %{build_annobin_plugin} -BuildRequires: annobin-plugin-gcc >= 10.62, rpm-devel, binutils-devel, xz -%endif - -%description plugin-annobin -This package adds a version of the annobin plugin for gcc. This version -of the plugin is explicitly built by the same version of gcc that is installed -so that there cannot be any synchronization problems. - %prep %setup -q -n gcc-%{version}-%{DATE} -a 1 -a 2 -a 3 -%autopatch -p0 -m 0 -M 4 +%patch0 -p0 -b .hack~ +%patch2 -p0 -b .sparc-config-detection~ +%patch3 -p0 -b .libgomp-omp_h-multilib~ +%patch4 -p0 -b .libtool-no-rpath~ %if %{build_isl} -%autopatch -p0 -m 5 -M 6 +%patch5 -p0 -b .isl-dl~ +%patch6 -p0 -b .isl-dl2~ %endif %if %{build_libstdcxx_docs} -%autopatch -p0 7 +%patch7 -p0 -b .libstdc++-docs~ %endif -%autopatch -p0 -m 8 -M 9 +%patch8 -p0 -b .no-add-needed~ +%patch9 -p0 -b .foffload-default~ +%patch10 -p0 -b .Wno-format-security~ %if 0%{?fedora} >= 29 || 0%{?rhel} > 7 -%autopatch -p0 10 +%patch11 -p0 -b .rh1574936~ %endif -%autopatch -p0 -m 11 -M 99 -touch -r isl-0.24/m4/ax_prog_cxx_for_build.m4 isl-0.24/m4/ax_prog_cc_for_build.m4 +%patch12 -p0 -b .d-shared-libphobos~ +%if 0%{?fedora} == 34 +%patch13 -p0 -b .pr99341-revert~ +%endif +%patch14 -p0 -b .libgcc-link~ +%patch15 -p0 -b .pr101786~ +%patch16 -p0 -b .stringify-__VA_OPT__~ +%patch17 -p0 -b .stringify-__VA_OPT__-2~ +%patch18 -p0 -b .pr105331~ %if 0%{?rhel} >= 9 -%autopatch -p1 100 +%patch100 -p1 -b .fortran-fdec-duplicates~ +%patch101 -p1 -b .fortran-flogical-as-integer~ +%patch102 -p1 -b .fortran-fdec-ichar~ +%patch103 -p1 -b .fortran-fdec-non-integer-index~ +%patch104 -p1 -b .fortran-fdec-old-init~ +%patch105 -p1 -b .fortran-fdec-override-kind~ +%patch106 -p1 -b .fortran-fdec-non-logical-if~ +%patch107 -p1 -b .fortran-fdec-promotion~ +%patch108 -p1 -b .fortran-fdec-sequence~ +%patch109 -p1 -b .fortran-fdec-add-missing-indexes~ %endif %ifarch %{arm} rm -f gcc/testsuite/go.test/test/fixedbugs/issue19182.go %endif -rm -f libphobos/testsuite/libphobos.gc/forkgc2.d -#rm -rf libphobos/testsuite/libphobos.gc echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE +cp -a libstdc++-v3/config/cpu/i{4,3}86/atomicity.h + ./contrib/gcc_update --touch LC_ALL=C sed -i -e 's/\xa0/ /' gcc/doc/options.texi sed -i -e 's/Common Driver Var(flag_report_bug)/& Init(1)/' gcc/common.opt -sed -i -e 's/m_report_bug = false;/m_report_bug = true;/' gcc/diagnostics/context.cc %ifarch ppc if [ -d libstdc++-v3/config/abi/post/powerpc64-linux-gnu ]; then @@ -1026,15 +857,11 @@ export CONFIG_SITE=NONE CC=gcc CXX=g++ -OPT_FLAGS="%{optflags}" -OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=[123]//g'` -OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[123]//g'` -OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/\(-Wp,\)\?-U_FORTIFY_SOURCE//g'` +OPT_FLAGS=`echo %{optflags}|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g'` OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-flto=auto//g;s/-flto//g;s/-ffat-lto-objects//g'` OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-m64//g;s/-m32//g;s/-m31//g'` OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mfpmath=sse/-mfpmath=sse -msse2/g'` OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/ -pipe / /g'` -OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-fno-omit-frame-pointer//g;s/-mbackchain//g;s/-mno-omit-leaf-frame-pointer//g'` OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-Werror=format-security/-Wformat-security/g'` %ifarch sparc OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-mcpu=ultrasparc/-mtune=ultrasparc/g;s/-mcpu=v[78]//g'` @@ -1077,7 +904,7 @@ CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" \ --target nvptx-none --enable-as-accelerator-for=%{gcc_target_platform} \ --enable-languages=c,c++,fortran,lto \ --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \ - --with-bugurl=%dist_bug_report_url \ + --with-bugurl=http://bugzilla.redhat.com/bugzilla \ --enable-checking=release --with-system-zlib \ --with-gcc-major-version-only --without-isl make %{?_smp_mflags} @@ -1085,42 +912,6 @@ cd .. rm -f newlib %endif -%if %{build_offload_amdgcn} -mkdir -p objia%{_prefix}/bin objia%{_prefix}/amdgcn-amdhsa/bin -IAROOT=`pwd`/objia -ln -sf %{_prefix}/bin/llvm-ar ${IAROOT}%{_prefix}/bin/amdgcn-amdhsa-ar -ln -sf %{_prefix}/bin/llvm-ar ${IAROOT}%{_prefix}/bin/amdgcn-amdhsa-ranlib -ln -sf %{_prefix}/bin/llvm-mc ${IAROOT}%{_prefix}/bin/amdgcn-amdhsa-as -ln -sf %{_prefix}/bin/llvm-nm ${IAROOT}%{_prefix}/bin/amdgcn-amdhsa-nm -ln -sf %{_prefix}/bin/lld ${IAROOT}%{_prefix}/bin/amdgcn-amdhsa-ld -ln -sf ../../bin/amdgcn-amdhsa-ar ${IAROOT}%{_prefix}/amdgcn-amdhsa/bin/ar -ln -sf ../../bin/amdgcn-amdhsa-ranlib ${IAROOT}%{_prefix}/amdgcn-amdhsa/bin/ranlib -ln -sf ../../bin/amdgcn-amdhsa-as ${IAROOT}%{_prefix}/amdgcn-amdhsa/bin/as -ln -sf ../../bin/amdgcn-amdhsa-nm ${IAROOT}%{_prefix}/amdgcn-amdhsa/bin/nm -ln -sf ../../bin/amdgcn-amdhsa-ld ${IAROOT}%{_prefix}/amdgcn-amdhsa/bin/ld - -ln -sf newlib-cygwin-%{newlib_cygwin_gitrev}/newlib newlib -rm -rf obj-offload-amdgcn-amdhsa -mkdir obj-offload-amdgcn-amdhsa - -cd obj-offload-amdgcn-amdhsa -CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" \ - CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g' \ - | sed 's/ -Wformat-security / -Wformat -Wformat-security /'`" \ - XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \ - ../configure --disable-bootstrap --disable-sjlj-exceptions \ - --with-build-time-tools=${IAROOT}%{_prefix}/amdgcn-amdhsa/bin \ - --target amdgcn-amdhsa --enable-as-accelerator-for=%{gcc_target_platform} \ - --enable-languages=c,c++,fortran,lto \ - --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \ - --with-bugurl=%dist_bug_report_url \ - --enable-checking=release --with-system-zlib \ - --with-gcc-major-version-only --without-isl --disable-libquadmath -make %{?_smp_mflags} -cd .. -rm -f newlib -%endif - rm -rf obj-%{gcc_target_platform} mkdir obj-%{gcc_target_platform} cd obj-%{gcc_target_platform} @@ -1133,24 +924,17 @@ ISL_FLAG_PIC=-fPIC ISL_FLAG_PIC=-fpic %endif cd isl-build - -%ifarch riscv64 -# Update config.{sub,guess} scripts for riscv64 (the original ones are too old) -cp -f -v /usr/lib/rpm/%{_vendor}/config.guess ../../isl-%{isl_version}/config.guess -cp -f -v /usr/lib/rpm/%{_vendor}/config.sub ../../isl-%{isl_version}/config.sub -%endif - -sed -i 's|libisl\([^-]\)|libgcc%{gcc_major}privateisl\1|g' \ +sed -i 's|libisl|libgcc11privateisl|g' \ ../../isl-%{isl_version}/Makefile.{am,in} ../../isl-%{isl_version}/configure \ CC=/usr/bin/gcc CXX=/usr/bin/g++ \ CFLAGS="${CFLAGS:-%optflags} $ISL_FLAG_PIC" --prefix=`cd ..; pwd`/isl-install -make %{?_smp_mflags} CFLAGS="${CFLAGS:-%optflags} $ISL_FLAG_PIC" +make %{?_smp_mflags} make install cd ../isl-install/lib -rm libgcc%{gcc_major}privateisl.so{,.23} -mv libgcc%{gcc_major}privateisl.so.23.1.0 libisl.so.23 -ln -sf libisl.so.23 libisl.so +rm libgcc11privateisl.so{,.15} +mv libgcc11privateisl.so.15.3.0 libisl.so.15 +ln -sf libisl.so.15 libisl.so cd ../.. %endif @@ -1158,9 +942,6 @@ enablelgo= enablelada= enablelobjc= enableld= -enablelm2= -enablelcob= -enablela68= %if %{build_objc} enablelobjc=,objc,obj-c++ %endif @@ -1173,25 +954,9 @@ enablelgo=,go %if %{build_d} enableld=,d %endif -%if %{build_m2} -enablelm2=,m2 -%endif -%if %{build_cobol} -enablelcob=,cobol -%endif -%if %{build_algol68} -enablela68=,algol68 -%endif -offloadtgts= -%if %{build_offload_nvptx} -offloadtgts=nvptx-none -%endif -%if %{build_offload_amdgcn} -offloadtgts=${offloadtgts:+${offloadtgts},}amdgcn-amdhsa -%endif CONFIGURE_OPTS="\ --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \ - --with-bugurl=%dist_bug_report_url \ + --with-bugurl=http://bugzilla.redhat.com/bugzilla \ --enable-shared --enable-threads=posix --enable-checking=release \ %ifarch ppc64le --enable-targets=powerpcle-linux \ @@ -1211,7 +976,6 @@ CONFIGURE_OPTS="\ %endif --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \ --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only \ - --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=%{_datadir}/zoneinfo \ %ifnarch %{mips} --with-linker-hash-style=gnu \ %endif @@ -1221,10 +985,8 @@ CONFIGURE_OPTS="\ %else --without-isl \ %endif -%if %{build_offload_nvptx} || %{build_offload_amdgcn} - --enable-offload-targets=$offloadtgts --enable-offload-defaulted \ -%endif %if %{build_offload_nvptx} + --enable-offload-targets=nvptx-none \ --without-cuda-driver \ %endif %if 0%{?fedora} >= 21 || 0%{?rhel} >= 7 @@ -1241,9 +1003,6 @@ CONFIGURE_OPTS="\ %ifarch sparc sparcv9 sparc64 ppc ppc64 ppc64le ppc64p7 s390 s390x alpha --with-long-double-128 \ %endif -%ifarch ppc64le - --with-long-double-format=ieee \ -%endif %ifarch sparc --disable-linux-futex \ %endif @@ -1262,12 +1021,8 @@ CONFIGURE_OPTS="\ %endif %endif %ifarch ppc64le -%if 0%{?rhel} >= 9 -%if 0%{?rhel} >= 10 - --with-cpu-32=power9 --with-tune-32=power10 --with-cpu-64=power9 --with-tune-64=power10 \ -%else +%if 0%{?rhel} == 9 --with-cpu-32=power9 --with-tune-32=power9 --with-cpu-64=power9 --with-tune-64=power9 \ -%endif %else --with-cpu-32=power8 --with-tune-32=power8 --with-cpu-64=power8 --with-tune-64=power8 \ %endif @@ -1278,9 +1033,6 @@ CONFIGURE_OPTS="\ %ifarch %{ix86} x86_64 --enable-cet \ --with-tune=generic \ -%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11 - --with-tls=gnu2 \ -%endif %endif %if 0%{?rhel} >= 7 %ifarch %{ix86} @@ -1288,11 +1040,7 @@ CONFIGURE_OPTS="\ %endif %ifarch x86_64 %if 0%{?rhel} > 8 -%if 0%{?rhel} > 9 - --with-arch_64=x86-64-v3 \ -%else --with-arch_64=x86-64-v2 \ -%endif %endif --with-arch_32=x86-64 \ %endif @@ -1308,7 +1056,7 @@ CONFIGURE_OPTS="\ %if 0%{?rhel} >= 7 %if 0%{?rhel} > 7 %if 0%{?rhel} > 8 -%if 0%{?rhel} >= 9 +%if 0%{?rhel} == 9 --with-arch=z14 --with-tune=z15 \ %else --with-arch=z13 --with-tune=arch13 \ @@ -1320,15 +1068,11 @@ CONFIGURE_OPTS="\ --with-arch=z196 --with-tune=zEC12 \ %endif %else -%if 0%{?fedora} >= 38 - --with-arch=z13 --with-tune=z14 \ -%else %if 0%{?fedora} >= 26 --with-arch=zEC12 --with-tune=z13 \ %else --with-arch=z9-109 --with-tune=z10 \ %endif -%endif %endif --enable-decimal-float \ %endif @@ -1352,19 +1096,6 @@ CONFIGURE_OPTS="\ %ifnarch %{arm} --with-build-config=bootstrap-lto --enable-link-serialization=1 \ %endif -%endif -%if 0%{?rhel:1} - --enable-host-pie --enable-host-bind-now \ -%endif - --disable-libssp \ -%if %{build_libquadmath} == 0 - --disable-libquadmath \ -%endif -%if %{build_libatomic} == 0 - --disable-libatomic \ -%endif -%if %{build_libitm} == 0 - --disable-libitm \ %endif " @@ -1373,7 +1104,7 @@ CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" \ | sed 's/ -Wformat-security / -Wformat -Wformat-security /'`" \ XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \ ../configure --enable-bootstrap \ - --enable-languages=c,c++,fortran${enablelobjc}${enablelada}${enablelgo}${enableld}${enablelm2}${enablelcob}${enablela68},lto \ + --enable-languages=c,c++,fortran${enablelobjc}${enablelada}${enablelgo}${enableld},lto \ $CONFIGURE_OPTS %ifarch sparc sparcv9 sparc64 @@ -1394,7 +1125,7 @@ CC="$CC" CXX="$CXX" CFLAGS="$OPT_FLAGS" \ | sed 's/ -Wformat-security / -Wformat -Wformat-security /'`" \ XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" \ ../../configure --disable-bootstrap --enable-host-shared \ - --enable-languages=jit --enable-libgdiagnostics $CONFIGURE_OPTS + --enable-languages=jit $CONFIGURE_OPTS make %{?_smp_mflags} BOOT_CFLAGS="$OPT_FLAGS" all-gcc cp -a gcc/libgccjit.so* ../gcc/ cd ../gcc/ @@ -1408,7 +1139,7 @@ make jit.sphinx.install-html jit_htmldir=`pwd`/../../rpm.doc/libgccjit-devel/htm cd .. %if %{build_isl} -cp -a isl-install/lib/libisl.so.23 gcc/ +cp -a isl-install/lib/libisl.so.15 gcc/ %endif # Make generated man pages even if Pod::Man is not new enough @@ -1429,7 +1160,7 @@ cd ../.. # Copy various doc files here and there cd .. -mkdir -p rpm.doc/{gfortran,objc,gdc,libphobos,gm2,libgm2,libgdiagnostics-devel,gcobol,libgcobol,algol68,libga68} +mkdir -p rpm.doc/gfortran rpm.doc/objc rpm.doc/gdc rpm.doc/libphobos mkdir -p rpm.doc/go rpm.doc/libgo rpm.doc/libquadmath rpm.doc/libitm mkdir -p rpm.doc/changelogs/{gcc/cp,gcc/ada,gcc/jit,libstdc++-v3,libobjc,libgomp,libcc1,libatomic,libsanitizer} @@ -1455,38 +1186,12 @@ done) (cd libphobos; for i in ChangeLog*; do cp -p $i ../rpm.doc/libphobos/$i.libphobos done -cp -a src/LICENSE*.txt libdruntime/LICENSE.txt ../rpm.doc/libphobos/) -%endif -%if %{build_m2} -(cd gcc/m2; for i in ChangeLog*; do - cp -p $i ../../rpm.doc/gm2/$i.gm2 -done) -(cd libgm2; for i in ChangeLog*; do - cp -p $i ../rpm.doc/libgm2/$i.libgm2 -done) -%endif -%if %{build_cobol} -(cd gcc/cobol; for i in ChangeLog*; do - cp -p $i ../../rpm.doc/gcobol/$i.gcobol -done) -(cd libgcobol; for i in ChangeLog*; do - cp -p $i ../rpm.doc/libgcobol/$i.libgcobol -done) -%endif -%if %{build_algol68} -(cd gcc/algol68; for i in ChangeLog*; do - cp -p $i ../../rpm.doc/algol68/$i.algol68 -done) -(cd libga68; for i in ChangeLog*; do - cp -p $i ../rpm.doc/libga68/$i.libga68 -done) +cp -a src/LICENSE*.txt libdruntime/LICENSE ../rpm.doc/libphobos/) %endif %if %{build_libquadmath} (cd libquadmath; for i in ChangeLog* COPYING.LIB; do cp -p $i ../rpm.doc/libquadmath/$i.libquadmath -done; -sed -n '/==========/,/==========/{/==========/d;s/^ \* *//p}' math/cosq.c \ - > ../rpm.doc/libquadmath/LICENSE.SunPro) +done) %endif %if %{build_libitm} (cd libitm; for i in ChangeLog*; do @@ -1501,33 +1206,10 @@ done) cp -p $i ../rpm.doc/libgo/$i.libgo done) %endif -(cd gcc/doc/libgdiagnostics; make html; \ -mv _build/html ../../../rpm.doc/libgdiagnostics-devel/html ) rm -f rpm.doc/changelogs/gcc/ChangeLog.[1-9] find rpm.doc -name \*ChangeLog\* | xargs bzip2 -9 -%if %{build_annobin_plugin} -mkdir annobin-plugin -cd annobin-plugin -tar xf %{_usrsrc}/annobin/latest-annobin.tar.xz -cd annobin* -touch aclocal.m4 configure Makefile.in */configure */config.h.in */Makefile.in -ANNOBIN_FLAGS=../../obj-%{gcc_target_platform}/%{gcc_target_platform}/libstdc++-v3/scripts/testsuite_flags -ANNOBIN_CFLAGS1="%build_cflags -I %{_builddir}/gcc-%{version}-%{DATE}/gcc" -ANNOBIN_CFLAGS1="$ANNOBIN_CFLAGS1 -I %{_builddir}/gcc-%{version}-%{DATE}/obj-%{gcc_target_platform}/gcc" -ANNOBIN_CFLAGS2="-I %{_builddir}/gcc-%{version}-%{DATE}/include -I %{_builddir}/gcc-%{version}-%{DATE}/libcpp/include" -ANNOBIN_LDFLAGS="%build_ldflags -L%{_builddir}/gcc-%{version}-%{DATE}/obj-%{gcc_target_platform}/%{gcc_target_platform}/libstdc++-v3/src/.libs" -CC="`$ANNOBIN_FLAGS --build-cc`" CXX="`$ANNOBIN_FLAGS --build-cxx`" \ - CFLAGS="$ANNOBIN_CFLAGS1 $ANNOBIN_CFLAGS2 $ANNOBIN_LDFLAGS" \ - CXXFLAGS="$ANNOBIN_CFLAGS1 `$ANNOBIN_FLAGS --build-includes` $ANNOBIN_CFLAGS2 $ANNOBIN_LDFLAGS" \ - ./configure --with-gcc-plugin-dir=%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/plugin \ - --without-annocheck --without-tests --without-docs --disable-rpath --without-debuginfod \ - --without-clang-plugin --without-llvm-plugin -make -cd ../.. -%endif - %install rm -rf %{buildroot} mkdir -p %{buildroot} @@ -1555,7 +1237,6 @@ cd obj-offload-nvptx-none make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \ infodir=%{buildroot}%{_infodir} install rm -rf %{buildroot}%{_prefix}/libexec/gcc/nvptx-none/%{gcc_major}/install-tools -rm -rf %{buildroot}%{_prefix}/libexec/gcc/nvptx-none/%{gcc_major}/g++-mapper-server rm -rf %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/accel/nvptx-none/{install-tools,plugin,cc1,cc1plus,f951} rm -rf %{buildroot}%{_infodir} %{buildroot}%{_mandir}/man7 %{buildroot}%{_prefix}/share/locale rm -rf %{buildroot}%{_prefix}/lib/gcc/nvptx-none/%{gcc_major}/{install-tools,plugin} @@ -1571,44 +1252,6 @@ cd .. rm -f newlib %endif -%if %{build_offload_amdgcn} -mkdir -p %{buildroot}%{_prefix}/bin %{buildroot}%{_prefix}/amdgcn-amdhsa/bin -ln -sf llvm-ar %{buildroot}%{_prefix}/bin/amdgcn-amdhsa-ar -ln -sf llvm-ar %{buildroot}%{_prefix}/bin/amdgcn-amdhsa-ranlib -ln -sf llvm-mc %{buildroot}%{_prefix}/bin/amdgcn-amdhsa-as -ln -sf llvm-nm %{buildroot}%{_prefix}/bin/amdgcn-amdhsa-nm -ln -sf lld %{buildroot}%{_prefix}/bin/amdgcn-amdhsa-ld -ln -sf ../../bin/amdgcn-amdhsa-ar %{buildroot}%{_prefix}/amdgcn-amdhsa/bin/ar -ln -sf ../../bin/amdgcn-amdhsa-ranlib %{buildroot}%{_prefix}/amdgcn-amdhsa/bin/ranlib -ln -sf ../../bin/amdgcn-amdhsa-as %{buildroot}%{_prefix}/amdgcn-amdhsa/bin/as -ln -sf ../../bin/amdgcn-amdhsa-nm %{buildroot}%{_prefix}/amdgcn-amdhsa/bin/nm -ln -sf ../../bin/amdgcn-amdhsa-ld %{buildroot}%{_prefix}/amdgcn-amdhsa/bin/ld - -ln -sf newlib-cygwin-%{newlib_cygwin_gitrev}/newlib newlib -cd obj-offload-amdgcn-amdhsa -make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \ - infodir=%{buildroot}%{_infodir} install -rm -rf %{buildroot}%{_prefix}/libexec/gcc/amdgcn-amdhsa/%{gcc_major}/install-tools -rm -rf %{buildroot}%{_prefix}/libexec/gcc/amdgcn-amdhsa/%{gcc_major}/g++-mapper-server -rm -rf %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/accel/amdgcn-amdhsa/{install-tools,plugin,cc1,cc1plus,f951} -rm -rf %{buildroot}%{_infodir} %{buildroot}%{_mandir}/man7 %{buildroot}%{_prefix}/share/locale -rm -rf %{buildroot}%{_prefix}/lib/gcc/amdgcn-amdhsa/%{gcc_major}/{install-tools,plugin} -rm -rf %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/amdgcn-amdhsa/{install-tools,plugin,include-fixed} -rm -rf %{buildroot}%{_prefix}/%{_lib}/libc[cp]1* -mv -f %{buildroot}%{_prefix}/amdgcn-amdhsa/lib/*.{a,spec} %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/amdgcn-amdhsa/ -mv -f %{buildroot}%{_prefix}/lib/gcc/amdgcn-amdhsa/%{gcc_major}/*.a %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/amdgcn-amdhsa/ -pushd %{buildroot}%{_prefix}/amdgcn-amdhsa/lib -for i in gfx*; do -mv -f %{buildroot}%{_prefix}/amdgcn-amdhsa/lib/$i/*.{a,spec} %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/amdgcn-amdhsa/$i/ -mv -f %{buildroot}%{_prefix}/lib/gcc/amdgcn-amdhsa/%{gcc_major}/$i/*.a %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/amdgcn-amdhsa/$i/ -done -popd -find %{buildroot}%{_prefix}/lib/gcc/amdgcn-amdhsa %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/amdgcn-amdhsa \ - %{buildroot}%{_prefix}/amdgcn-amdhsa/lib -name \*.la | xargs rm -cd .. -rm -f newlib -%endif - cd obj-%{gcc_target_platform} TARGET_PLATFORM=%{gcc_target_platform} @@ -1626,7 +1269,7 @@ FULLPATH=%{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} FULLEPATH=%{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major} %if %{build_isl} -cp -a isl-install/lib/libisl.so.23 $FULLPATH/ +cp -a isl-install/lib/libisl.so.15 $FULLPATH/ %endif # fix some things @@ -1636,9 +1279,7 @@ ln -sf ../bin/cpp %{buildroot}/%{_prefix}/lib/cpp ln -sf gfortran %{buildroot}%{_prefix}/bin/f95 rm -f %{buildroot}%{_infodir}/dir gzip -9 %{buildroot}%{_infodir}/*.info* -%if %{build_ada} ln -sf gcc %{buildroot}%{_prefix}/bin/gnatgcc -%endif mkdir -p %{buildroot}%{_fmoddir} %if %{build_go} @@ -1683,10 +1324,12 @@ for f in `find %{buildroot}%{_prefix}/include/c++/%{gcc_major}/%{gcc_target_plat done # Nuke bits/*.h.gch dirs -# 1) sometimes it is hard to match the exact options used for building +# 1) there is no bits/*.h header installed, so when gch file can't be +# used, compilation fails +# 2) sometimes it is hard to match the exact options used for building # libstdc++-v3 or they aren't desirable -# 2) there are multilib issues, conflicts etc. with this -# 3) it is huge +# 3) there are multilib issues, conflicts etc. with this +# 4) it is huge # People can always precompile on their own whatever they want, but # shipping this for everybody is unnecessary. rm -rf %{buildroot}%{_prefix}/include/c++/%{gcc_major}/%{gcc_target_platform}/bits/*.h.gch @@ -1698,7 +1341,7 @@ cp -r -p ../libstdc++-v3/doc/html ../rpm.doc/libstdc++-v3/html cp -r -p $libstdcxx_doc_builddir/html ../rpm.doc/libstdc++-v3/html/api mkdir -p %{buildroot}%{_mandir}/man3 cp -r -p $libstdcxx_doc_builddir/man/man3/* %{buildroot}%{_mandir}/man3/ -find ../rpm.doc/libstdc++-v3 -name \*~ -o -name \*.orig | xargs rm -f +find ../rpm.doc/libstdc++-v3 -name \*~ | xargs rm %endif %ifarch sparcv9 sparc64 @@ -1736,12 +1379,6 @@ mv %{buildroot}%{_prefix}/%{_lib}/libitm.spec $FULLPATH/ %if %{build_libasan} mv %{buildroot}%{_prefix}/%{_lib}/libsanitizer.spec $FULLPATH/ %endif -%if %{build_cobol} -mv %{buildroot}%{_prefix}/%{_lib}/libgcobol.spec $FULLPATH/ -%endif -%if %{build_algol68} -mv %{buildroot}%{_prefix}/%{_lib}/libga68.spec $FULLPATH/ -%endif mkdir -p %{buildroot}/%{_lib} mv -f %{buildroot}%{_prefix}/%{_lib}/libgcc_s.so.1 %{buildroot}/%{_lib}/libgcc_s-%{gcc_major}-%{DATE}.so.1 @@ -1757,11 +1394,6 @@ GROUP ( /%{_lib}/libgcc_s.so.1 libgcc.a )' > $FULLPATH/libgcc_s.so %else ln -sf /%{_lib}/libgcc_s.so.1 $FULLPATH/libgcc_s.so %endif -rm -f $FULLPATH/libgcc_s_asneeded.so -echo '/* GNU ld script - Add DT_NEEDED entry for libgcc_s.so only if needed. */ -OUTPUT_FORMAT('`gcc -Wl,--print-output-format -nostdlib -r -o /dev/null`') -INPUT ( AS_NEEDED ( -lgcc_s ) )' > $FULLPATH/libgcc_s_asneeded.so %ifarch sparcv9 ppc %ifarch ppc rm -f $FULLPATH/64/libgcc_s.so @@ -1773,11 +1405,6 @@ GROUP ( /lib64/libgcc_s.so.1 libgcc.a )' > $FULLPATH/64/libgcc_s.so %else ln -sf /lib64/libgcc_s.so.1 $FULLPATH/64/libgcc_s.so %endif -rm -f $FULLPATH/64/libgcc_s_asneeded.so -echo '/* GNU ld script - Add DT_NEEDED entry for libgcc_s.so only if needed. */ -OUTPUT_FORMAT('`gcc -m64 -Wl,--print-output-format -nostdlib -r -o /dev/null`') -INPUT ( AS_NEEDED ( -lgcc_s ) )' > $FULLPATH/64/libgcc_s_asneeded.so %endif %ifarch %{multilib_64_archs} %ifarch x86_64 ppc64 ppc64p7 @@ -1790,11 +1417,6 @@ GROUP ( /lib/libgcc_s.so.1 libgcc.a )' > $FULLPATH/32/libgcc_s.so %else ln -sf /lib/libgcc_s.so.1 $FULLPATH/32/libgcc_s.so %endif -rm -f $FULLPATH/32/libgcc_s_asneeded.so -echo '/* GNU ld script - Add DT_NEEDED entry for libgcc_s.so only if needed. */ -OUTPUT_FORMAT('`gcc -m32 -Wl,--print-output-format -nostdlib -r -o /dev/null`') -INPUT ( AS_NEEDED ( -lgcc_s ) )' > $FULLPATH/32/libgcc_s_asneeded.so %endif mv -f %{buildroot}%{_prefix}/%{_lib}/libgomp.spec $FULLPATH/ @@ -1815,8 +1437,18 @@ fi mkdir -p %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib} mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++*gdb.py* \ %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/ -%py_byte_compile %{python3} %{buildroot}%{_prefix}/share/gcc-%{gcc_major}/python/ -%py_byte_compile %{python3} %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/ +pushd ../libstdc++-v3/python +for i in `find . -name \*.py`; do + touch -r $i %{buildroot}%{_prefix}/share/gcc-%{gcc_major}/python/$i +done +touch -r hook.in %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/libstdc++*gdb.py +popd +for f in `find %{buildroot}%{_prefix}/share/gcc-%{gcc_major}/python/ \ + %{buildroot}%{_datadir}/gdb/auto-load/%{_prefix}/%{_lib}/ -name \*.py`; do + r=${f/$RPM_BUILD_ROOT/} + %{__python3} -c 'import py_compile; py_compile.compile("'$f'", dfile="'$r'")' + %{__python3} -O -c 'import py_compile; py_compile.compile("'$f'", dfile="'$r'")' +done rm -f $FULLEPATH/libgccjit.so cp -a objlibgccjit/gcc/libgccjit.so* %{buildroot}%{_prefix}/%{_lib}/ @@ -1824,15 +1456,6 @@ cp -a ../gcc/jit/libgccjit*.h %{buildroot}%{_prefix}/include/ /usr/bin/install -c -m 644 objlibgccjit/gcc/doc/libgccjit.info %{buildroot}/%{_infodir}/ gzip -9 %{buildroot}/%{_infodir}/libgccjit.info -rm -f $FULLEPATH/libgdiagnostics.so -cp -a objlibgccjit/gcc/libgdiagnostics.so* %{buildroot}%{_prefix}/%{_lib}/ -cp -a ../gcc/libgdiagnostics*.h %{buildroot}%{_prefix}/include/ -cp -a objlibgccjit/gcc/sarif-replay %{buildroot}%{_prefix}/bin/ - -sed -e 's,\.\./include/,../../../../include/,' \ - %{buildroot}%{_prefix}/%{_lib}/libstdc++.modules.json \ - > $FULLPATH/libstdc++.modules.json - pushd $FULLPATH if [ "%{_lib}" = "lib" ]; then %if %{build_objc} @@ -1842,40 +1465,23 @@ ln -sf ../../../libstdc++.so.6.*[0-9] libstdc++.so ln -sf ../../../libgfortran.so.5.* libgfortran.so ln -sf ../../../libgomp.so.1.* libgomp.so %if %{build_go} -ln -sf ../../../libgo.so.25.* libgo.so +ln -sf ../../../libgo.so.19.* libgo.so %endif %if %{build_libquadmath} ln -sf ../../../libquadmath.so.0.* libquadmath.so %endif %if %{build_d} -ln -sf ../../../libgdruntime.so.6.* libgdruntime.so -ln -sf ../../../libgphobos.so.6.* libgphobos.so -%endif -%if %{build_m2} -for i in cor iso log min pim; do - ln -sf ../../../libm2$i.so.21.* libm2$i.so -done -%endif -%if %{build_cobol} -ln -sf ../../../libgcobol.so.2.* libgcobol.so -%endif -%if %{build_algol68} -ln -sf ../../../libga68.so.2.* libga68.so +ln -sf ../../../libgdruntime.so.2.* libgdruntime.so +ln -sf ../../../libgphobos.so.2.* libgphobos.so %endif %if %{build_libitm} ln -sf ../../../libitm.so.1.* libitm.so %endif %if %{build_libatomic} ln -sf ../../../libatomic.so.1.* libatomic.so -rm -f libatomic_asneeded.so libatomic_asneeded.a -echo '/* GNU ld script - Add DT_NEEDED entry for -latomic only if needed. */ -OUTPUT_FORMAT('`gcc -Wl,--print-output-format -nostdlib -r -o /dev/null`') -INPUT ( AS_NEEDED ( -latomic ) )' > libatomic_asneeded.so -ln -sf libatomic.a libatomic_asneeded.a %endif %if %{build_libasan} -ln -sf ../../../libasan.so.8.* libasan.so +ln -sf ../../../libasan.so.6.* libasan.so mv ../../../libasan_preinit.o libasan_preinit.o %endif %if %{build_libubsan} @@ -1889,40 +1495,23 @@ ln -sf ../../../../%{_lib}/libstdc++.so.6.*[0-9] libstdc++.so ln -sf ../../../../%{_lib}/libgfortran.so.5.* libgfortran.so ln -sf ../../../../%{_lib}/libgomp.so.1.* libgomp.so %if %{build_go} -ln -sf ../../../../%{_lib}/libgo.so.25.* libgo.so +ln -sf ../../../../%{_lib}/libgo.so.19.* libgo.so %endif %if %{build_libquadmath} ln -sf ../../../../%{_lib}/libquadmath.so.0.* libquadmath.so %endif %if %{build_d} -ln -sf ../../../../%{_lib}/libgdruntime.so.6.* libgdruntime.so -ln -sf ../../../../%{_lib}/libgphobos.so.6.* libgphobos.so -%endif -%if %{build_m2} -for i in cor iso log min pim; do - ln -sf ../../../../%{_lib}/libm2$i.so.21.* libm2$i.so -done -%endif -%if %{build_cobol} -ln -sf ../../../../%{_lib}/libgcobol.so.2.* libgcobol.so -%endif -%if %{build_algol68} -ln -sf ../../../../%{_lib}/libga68.so.2.* libga68.so +ln -sf ../../../../%{_lib}/libgdruntime.so.2.* libgdruntime.so +ln -sf ../../../../%{_lib}/libgphobos.so.2.* libgphobos.so %endif %if %{build_libitm} ln -sf ../../../../%{_lib}/libitm.so.1.* libitm.so %endif %if %{build_libatomic} ln -sf ../../../../%{_lib}/libatomic.so.1.* libatomic.so -rm -f libatomic_asneeded.so libatomic_asneeded.a -echo '/* GNU ld script - Add DT_NEEDED entry for -latomic only if needed. */ -OUTPUT_FORMAT('`gcc -Wl,--print-output-format -nostdlib -r -o /dev/null`') -INPUT ( AS_NEEDED ( -latomic ) )' > libatomic_asneeded.so -ln -sf libatomic.a libatomic_asneeded.a %endif %if %{build_libasan} -ln -sf ../../../../%{_lib}/libasan.so.8.* libasan.so +ln -sf ../../../../%{_lib}/libasan.so.6.* libasan.so mv ../../../../%{_lib}/libasan_preinit.o libasan_preinit.o %endif %if %{build_libubsan} @@ -1930,14 +1519,9 @@ ln -sf ../../../../%{_lib}/libubsan.so.1.* libubsan.so %endif %if %{build_libtsan} rm -f libtsan.so -echo 'INPUT ( %{_prefix}/%{_lib}/'`echo ../../../../%{_lib}/libtsan.so.2.* | sed 's,^.*libt,libt,'`' )' > libtsan.so +echo 'INPUT ( %{_prefix}/%{_lib}/'`echo ../../../../%{_lib}/libtsan.so.0.* | sed 's,^.*libt,libt,'`' )' > libtsan.so mv ../../../../%{_lib}/libtsan_preinit.o libtsan_preinit.o %endif -%if %{build_libhwasan} -rm -f libhwasan.so -echo 'INPUT ( %{_prefix}/%{_lib}/'`echo ../../../../%{_lib}/libhwasan.so.0.* | sed 's,^.*libh,libh,'`' )' > libhwasan.so -mv ../../../../%{_lib}/libhwasan_preinit.o libhwasan_preinit.o -%endif %if %{build_liblsan} rm -f liblsan.so echo 'INPUT ( %{_prefix}/%{_lib}/'`echo ../../../../%{_lib}/liblsan.so.0.* | sed 's,^.*libl,libl,'`' )' > liblsan.so @@ -1946,7 +1530,6 @@ mv ../../../../%{_lib}/liblsan_preinit.o liblsan_preinit.o fi mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++.*a $FULLLPATH/ mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++fs.*a $FULLLPATH/ -mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++exp.*a $FULLLPATH/ mv -f %{buildroot}%{_prefix}/%{_lib}/libsupc++.*a $FULLLPATH/ mv -f %{buildroot}%{_prefix}/%{_lib}/libgfortran.*a $FULLLPATH/ %if %{build_objc} @@ -1960,25 +1543,11 @@ mv -f %{buildroot}%{_prefix}/%{_lib}/libquadmath.*a $FULLLPATH/ mv -f %{buildroot}%{_prefix}/%{_lib}/libgdruntime.*a $FULLLPATH/ mv -f %{buildroot}%{_prefix}/%{_lib}/libgphobos.*a $FULLLPATH/ %endif -%if %{build_m2} -for i in cor iso log min pim; do - mv -f %{buildroot}%{_prefix}/%{_lib}/libm2$i.*a $FULLLPATH/ - rm -f m2/m2$i/*.{a,la} - ln -sf ../../libm2$i.so m2/m2$i/ - ln -sf ../../libm2$i.a m2/m2$i/ -done -%endif -%if %{build_cobol} -mv -f %{buildroot}%{_prefix}/%{_lib}/libgcobol.*a $FULLLPATH/ -%endif -%if %{build_algol68} -mv -f %{buildroot}%{_prefix}/%{_lib}/libga68.*a $FULLLPATH/ -%endif %if %{build_libitm} mv -f %{buildroot}%{_prefix}/%{_lib}/libitm.*a $FULLLPATH/ %endif %if %{build_libatomic} -mv -f %{buildroot}%{_prefix}/%{_lib}/libatomic.*a $FULLPATH/ +mv -f %{buildroot}%{_prefix}/%{_lib}/libatomic.*a $FULLLPATH/ %endif %if %{build_libasan} mv -f %{buildroot}%{_prefix}/%{_lib}/libasan.*a $FULLLPATH/ @@ -1989,9 +1558,6 @@ mv -f %{buildroot}%{_prefix}/%{_lib}/libubsan.*a $FULLLPATH/ %if %{build_libtsan} mv -f %{buildroot}%{_prefix}/%{_lib}/libtsan.*a $FULLPATH/ %endif -%if %{build_libhwasan} -mv -f %{buildroot}%{_prefix}/%{_lib}/libhwasan.*a $FULLPATH/ -%endif %if %{build_liblsan} mv -f %{buildroot}%{_prefix}/%{_lib}/liblsan.*a $FULLPATH/ %endif @@ -2013,28 +1579,28 @@ mv -f $FULLPATH/ada{include,lib} $FULLLPATH/ pushd $FULLLPATH/adalib if [ "%{_lib}" = "lib" ]; then ln -sf ../../../../../libgnarl-*.so libgnarl.so -ln -sf ../../../../../libgnarl-*.so libgnarl-%{gcc_major}.so +ln -sf ../../../../../libgnarl-*.so libgnarl-11.so ln -sf ../../../../../libgnat-*.so libgnat.so -ln -sf ../../../../../libgnat-*.so libgnat-%{gcc_major}.so +ln -sf ../../../../../libgnat-*.so libgnat-11.so else ln -sf ../../../../../../%{_lib}/libgnarl-*.so libgnarl.so -ln -sf ../../../../../../%{_lib}/libgnarl-*.so libgnarl-%{gcc_major}.so +ln -sf ../../../../../../%{_lib}/libgnarl-*.so libgnarl-11.so ln -sf ../../../../../../%{_lib}/libgnat-*.so libgnat.so -ln -sf ../../../../../../%{_lib}/libgnat-*.so libgnat-%{gcc_major}.so +ln -sf ../../../../../../%{_lib}/libgnat-*.so libgnat-11.so fi popd else pushd $FULLPATH/adalib if [ "%{_lib}" = "lib" ]; then ln -sf ../../../../libgnarl-*.so libgnarl.so -ln -sf ../../../../libgnarl-*.so libgnarl-%{gcc_major}.so +ln -sf ../../../../libgnarl-*.so libgnarl-11.so ln -sf ../../../../libgnat-*.so libgnat.so -ln -sf ../../../../libgnat-*.so libgnat-%{gcc_major}.so +ln -sf ../../../../libgnat-*.so libgnat-11.so else ln -sf ../../../../../%{_lib}/libgnarl-*.so libgnarl.so -ln -sf ../../../../../%{_lib}/libgnarl-*.so libgnarl-%{gcc_major}.so +ln -sf ../../../../../%{_lib}/libgnarl-*.so libgnarl-11.so ln -sf ../../../../../%{_lib}/libgnat-*.so libgnat.so -ln -sf ../../../../../%{_lib}/libgnat-*.so libgnat-%{gcc_major}.so +ln -sf ../../../../../%{_lib}/libgnat-*.so libgnat-11.so fi popd fi @@ -2049,8 +1615,8 @@ ln -sf ../`echo ../../../../lib/libgfortran.so.5.* | sed s~/lib/~/lib64/~` 64/li ln -sf ../`echo ../../../../lib/libgomp.so.1.* | sed s~/lib/~/lib64/~` 64/libgomp.so %if %{build_go} rm -f libgo.so -echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libgo.so.25.* | sed 's,^.*libg,libg,'`' )' > libgo.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libgo.so.25.* | sed 's,^.*libg,libg,'`' )' > 64/libgo.so +echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libgo.so.19.* | sed 's,^.*libg,libg,'`' )' > libgo.so +echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libgo.so.19.* | sed 's,^.*libg,libg,'`' )' > 64/libgo.so %endif %if %{build_libquadmath} rm -f libquadmath.so @@ -2059,30 +1625,10 @@ echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libquadmath.so.0.* | sed ' %endif %if %{build_d} rm -f libgdruntime.so libgphobos.so -echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libgdruntime.so.6.* | sed 's,^.*libg,libg,'`' )' > libgdruntime.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libgdruntime.so.6.* | sed 's,^.*libg,libg,'`' )' > 64/libgdruntime.so -echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libgphobos.so.6.* | sed 's,^.*libg,libg,'`' )' > libgphobos.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libgphobos.so.6.* | sed 's,^.*libg,libg,'`' )' > 64/libgphobos.so -%endif -%if %{build_m2} -for i in cor iso log min pim; do - rm -f libm2$i.so - echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libm2$i.so.21.* | sed 's,^.*libm,libm,'`' )' > libm2$i.so - echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libm2$i.so.21.* | sed 's,^.*libm,libm,'`' )' > 64/libm2$i.so - rm -f 64/m2/m2$i/*.{a,la} - ln -sf ../../libm2$i.so 64/m2/m2$i/ - ln -sf ../../libm2$i.a 64/m2/m2$i/ -done -%endif -%if %{build_cobol} -rm -f libgcobol.so -echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libgcobol.so.2.* | sed 's,^.*libg,libg,'`' )' > libgcobol.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libgcobol.so.2.* | sed 's,^.*libg,libg,'`' )' > 64/libgcobol.so -%endif -%if %{build_algol68} -rm -f libga68.so -echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libga68.so.2.* | sed 's,^.*libg,libg,'`' )' > libga68.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libga68.so.2.* | sed 's,^.*libg,libg,'`' )' > 64/libga68.so +echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libgdruntime.so.2.* | sed 's,^.*libg,libg,'`' )' > libgdruntime.so +echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libgdruntime.so.2.* | sed 's,^.*libg,libg,'`' )' > 64/libgdruntime.so +echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libgphobos.so.2.* | sed 's,^.*libg,libg,'`' )' > libgphobos.so +echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libgphobos.so.2.* | sed 's,^.*libg,libg,'`' )' > 64/libgphobos.so %endif %if %{build_libitm} rm -f libitm.so @@ -2093,23 +1639,11 @@ echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libitm.so.1.* | sed 's,^.* rm -f libatomic.so echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libatomic.so.1.* | sed 's,^.*liba,liba,'`' )' > libatomic.so echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libatomic.so.1.* | sed 's,^.*liba,liba,'`' )' > 64/libatomic.so -mv -f %{buildroot}%{_prefix}/lib64/libatomic.*a 64/ -rm -f libatomic_asneeded.so libatomic_asneeded.a 64/libatomic_asneeded.so 64/libatomic_asneeded.a -echo '/* GNU ld script - Add DT_NEEDED entry for -latomic only if needed. */ -OUTPUT_FORMAT('`gcc -Wl,--print-output-format -nostdlib -r -o /dev/null`') -INPUT ( AS_NEEDED ( -latomic ) )' > libatomic_asneeded.so -ln -sf libatomic.a libatomic_asneeded.a -echo '/* GNU ld script - Add DT_NEEDED entry for -latomic only if needed. */ -OUTPUT_FORMAT('`gcc -m64 -Wl,--print-output-format -nostdlib -r -o /dev/null`') -INPUT ( AS_NEEDED ( -latomic ) )' > 64/libatomic_asneeded.so -ln -sf libatomic.a 64/libatomic_asneeded.a %endif %if %{build_libasan} rm -f libasan.so -echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libasan.so.8.* | sed 's,^.*liba,liba,'`' )' > libasan.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libasan.so.8.* | sed 's,^.*liba,liba,'`' )' > 64/libasan.so +echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib/libasan.so.6.* | sed 's,^.*liba,liba,'`' )' > libasan.so +echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib/libasan.so.6.* | sed 's,^.*liba,liba,'`' )' > 64/libasan.so mv ../../../../lib64/libasan_preinit.o 64/libasan_preinit.o %endif %if %{build_libubsan} @@ -2127,8 +1661,6 @@ ln -sf lib32/libstdc++.a libstdc++.a ln -sf ../lib64/libstdc++.a 64/libstdc++.a ln -sf lib32/libstdc++fs.a libstdc++fs.a ln -sf ../lib64/libstdc++fs.a 64/libstdc++fs.a -ln -sf lib32/libstdc++exp.a libstdc++exp.a -ln -sf ../lib64/libstdc++exp.a 64/libstdc++exp.a ln -sf lib32/libsupc++.a libsupc++.a ln -sf ../lib64/libsupc++.a 64/libsupc++.a %if %{build_libquadmath} @@ -2141,24 +1673,14 @@ ln -sf ../lib64/libgdruntime.a 64/libgdruntime.a ln -sf lib32/libgphobos.a libgphobos.a ln -sf ../lib64/libgphobos.a 64/libgphobos.a %endif -%if %{build_m2} -for i in cor iso log min pim; do - ln -sf lib32/libm2$i.a libm2$i.a - ln -sf ../lib64/libm2$i.a 64/libm2$i.a -done -%endif -%if %{build_cobol} -ln -sf lib32/libgcobol.a libgcobol.a -ln -sf ../lib64/libgcobol.a 64/libgcobol.a -%endif -%if %{build_algol68} -ln -sf lib32/libga68.a libga68.a -ln -sf ../lib64/libga68.a 64/libga68.a -%endif %if %{build_libitm} ln -sf lib32/libitm.a libitm.a ln -sf ../lib64/libitm.a 64/libitm.a %endif +%if %{build_libatomic} +ln -sf lib32/libatomic.a libatomic.a +ln -sf ../lib64/libatomic.a 64/libatomic.a +%endif %if %{build_libasan} ln -sf lib32/libasan.a libasan.a ln -sf ../lib64/libasan.a 64/libasan.a @@ -2192,8 +1714,8 @@ ln -sf ../`echo ../../../../lib64/libgfortran.so.5.* | sed s~/../lib64/~/~` 32/l ln -sf ../`echo ../../../../lib64/libgomp.so.1.* | sed s~/../lib64/~/~` 32/libgomp.so %if %{build_go} rm -f libgo.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libgo.so.25.* | sed 's,^.*libg,libg,'`' )' > libgo.so -echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libgo.so.25.* | sed 's,^.*libg,libg,'`' )' > 32/libgo.so +echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libgo.so.19.* | sed 's,^.*libg,libg,'`' )' > libgo.so +echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libgo.so.19.* | sed 's,^.*libg,libg,'`' )' > 32/libgo.so %endif %if %{build_libquadmath} rm -f libquadmath.so @@ -2202,30 +1724,10 @@ echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libquadmath.so.0.* | sed ' %endif %if %{build_d} rm -f libgdruntime.so libgphobos.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libgdruntime.so.6.* | sed 's,^.*libg,libg,'`' )' > libgdruntime.so -echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libgdruntime.so.6.* | sed 's,^.*libg,libg,'`' )' > 32/libgdruntime.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libgphobos.so.6.* | sed 's,^.*libg,libg,'`' )' > libgphobos.so -echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libgphobos.so.6.* | sed 's,^.*libg,libg,'`' )' > 32/libgphobos.so -%endif -%if %{build_m2} -for i in cor iso log min pim; do - rm -f libm2$i.so - echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libm2$i.so.21.* | sed 's,^.*libm,libm,'`' )' > libm2$i.so - echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libm2$i.so.21.* | sed 's,^.*libm,libm,'`' )' > 32/libm2$i.so - rm -f 32/m2/m2$i/*.{a,la} - ln -sf ../../libm2$i.so 32/m2/m2$i/ - ln -sf ../../libm2$i.a 32/m2/m2$i/ -done -%endif -%if %{build_cobol} -rm -f libgcobol.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libgcobol.so.2.* | sed 's,^.*libg,libg,'`' )' > libgcobol.so -#echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libgcobol.so.2.* | sed 's,^.*libg,libg,'`' )' > 32/libgcobol.so -%endif -%if %{build_algol68} -rm -f libga68.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libga68.so.2.* | sed 's,^.*libg,libg,'`' )' > libga68.so -echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libga68.so.2.* | sed 's,^.*libg,libg,'`' )' > 32/libga68.so +echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libgdruntime.so.2.* | sed 's,^.*libg,libg,'`' )' > libgdruntime.so +echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libgdruntime.so.2.* | sed 's,^.*libg,libg,'`' )' > 32/libgdruntime.so +echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libgphobos.so.2.* | sed 's,^.*libg,libg,'`' )' > libgphobos.so +echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libgphobos.so.2.* | sed 's,^.*libg,libg,'`' )' > 32/libgphobos.so %endif %if %{build_libitm} rm -f libitm.so @@ -2236,23 +1738,11 @@ echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libitm.so.1.* | sed 's,^.* rm -f libatomic.so echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libatomic.so.1.* | sed 's,^.*liba,liba,'`' )' > libatomic.so echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libatomic.so.1.* | sed 's,^.*liba,liba,'`' )' > 32/libatomic.so -mv -f %{buildroot}%{_prefix}/lib/libatomic.*a 32/ -rm -f libatomic_asneeded.so libatomic_asneeded.a 32/libatomic_asneeded.so 32/libatomic_asneeded.a -echo '/* GNU ld script - Add DT_NEEDED entry for -latomic only if needed. */ -OUTPUT_FORMAT('`gcc -Wl,--print-output-format -nostdlib -r -o /dev/null`') -INPUT ( AS_NEEDED ( -latomic ) )' > libatomic_asneeded.so -ln -sf libatomic.a libatomic_asneeded.a -echo '/* GNU ld script - Add DT_NEEDED entry for -latomic only if needed. */ -OUTPUT_FORMAT('`gcc -m32 -Wl,--print-output-format -nostdlib -r -o /dev/null`') -INPUT ( AS_NEEDED ( -latomic ) )' > 32/libatomic_asneeded.so -ln -sf libatomic.a 32/libatomic_asneeded.a %endif %if %{build_libasan} rm -f libasan.so -echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libasan.so.8.* | sed 's,^.*liba,liba,'`' )' > libasan.so -echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libasan.so.8.* | sed 's,^.*liba,liba,'`' )' > 32/libasan.so +echo 'INPUT ( %{_prefix}/lib64/'`echo ../../../../lib64/libasan.so.6.* | sed 's,^.*liba,liba,'`' )' > libasan.so +echo 'INPUT ( %{_prefix}/lib/'`echo ../../../../lib64/libasan.so.6.* | sed 's,^.*liba,liba,'`' )' > 32/libasan.so mv ../../../../lib/libasan_preinit.o 32/libasan_preinit.o %endif %if %{build_libubsan} @@ -2272,8 +1762,6 @@ ln -sf ../lib32/libstdc++.a 32/libstdc++.a ln -sf lib64/libstdc++.a libstdc++.a ln -sf ../lib32/libstdc++fs.a 32/libstdc++fs.a ln -sf lib64/libstdc++fs.a libstdc++fs.a -ln -sf ../lib32/libstdc++exp.a 32/libstdc++exp.a -ln -sf lib64/libstdc++exp.a libstdc++exp.a ln -sf ../lib32/libsupc++.a 32/libsupc++.a ln -sf lib64/libsupc++.a libsupc++.a %if %{build_libquadmath} @@ -2286,24 +1774,14 @@ ln -sf lib64/libgdruntime.a libgdruntime.a ln -sf ../lib32/libgphobos.a 32/libgphobos.a ln -sf lib64/libgphobos.a libgphobos.a %endif -%if %{build_m2} -for i in cor iso log min pim; do - ln -sf ../lib32/libm2$i.a 32/libm2$i.a - ln -sf lib64/libm2$i.a libm2$i.a -done -%endif -%if %{build_cobol} -ln -sf ../lib32/libgcobol.a 32/libgcobol.a -ln -sf lib64/libgcobol.a libgcobol.a -%endif -%if %{build_algol68} -ln -sf ../lib32/libga68.a 32/libga68.a -ln -sf lib64/libga68.a libga68.a -%endif %if %{build_libitm} ln -sf ../lib32/libitm.a 32/libitm.a ln -sf lib64/libitm.a libitm.a %endif +%if %{build_libatomic} +ln -sf ../lib32/libatomic.a 32/libatomic.a +ln -sf lib64/libatomic.a libatomic.a +%endif %if %{build_libasan} ln -sf ../lib32/libasan.a 32/libasan.a ln -sf lib64/libasan.a libasan.a @@ -2331,7 +1809,6 @@ ln -sf lib64/adalib adalib ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libgfortran.a 32/libgfortran.a ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libstdc++.a 32/libstdc++.a ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libstdc++fs.a 32/libstdc++fs.a -ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libstdc++exp.a 32/libstdc++exp.a ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libsupc++.a 32/libsupc++.a %if %{build_libquadmath} ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libquadmath.a 32/libquadmath.a @@ -2340,20 +1817,12 @@ ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libqua ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libgdruntime.a 32/libgdruntime.a ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libgphobos.a 32/libgphobos.a %endif -%if %{build_m2} -for i in cor iso log min pim; do - ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libm2$i.a 32/libm2$i.a -done -%endif -%if %{build_cobol} -#ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libgcobol.a 32/libgcobol.a -%endif -%if %{build_algol68} -ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libga68.a 32/libga68.a -%endif %if %{build_libitm} ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libitm.a 32/libitm.a %endif +%if %{build_libatomic} +ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libatomic.a 32/libatomic.a +%endif %if %{build_libasan} ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libasan.a 32/libasan.a %endif @@ -2374,8 +1843,7 @@ ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/adalib # If we are building a debug package then copy all of the static archives # into the debug directory to keep them as unstripped copies. -# if 0%{?_enable_debug_packages} -%if 0 +%if 0%{?_enable_debug_packages} for d in . $FULLLSUBDIR; do mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/$d for f in `find $d -maxdepth 1 -a \ @@ -2387,9 +1855,8 @@ for d in . $FULLLSUBDIR; do -o -name libgolibbegin.a -o -name libgomp.a \ -o -name libitm.a -o -name liblsan.a \ -o -name libobjc.a -o -name libgdruntime.a -o -name libgphobos.a \ - -o -name libm2\*.a -o -name libquadmath.a -o -name libstdc++.a \ - -o -name libstdc++fs.a -o -name libstdc++exp.a \ - -o -name libsupc++.a -o -name libgcobol.a \ + -o -name libquadmath.a -o -name libstdc++.a \ + -o -name libstdc++fs.a -o -name libsupc++.a \ -o -name libtsan.a -o -name libubsan.a \) -a -type f`; do cp -a $f $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/$d/ done @@ -2399,11 +1866,10 @@ done # Strip debug info from Fortran/ObjC/Java static libraries strip -g `find . \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \ -o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \ - -o -name libgdruntime.a -o -name libgphobos.a -o -name libm2\*.a \ + -o -name libgdruntime.a -o -name libgphobos.a \ -o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \ -o -name libatomic.a -o -name libasan.a -o -name libtsan.a \ - -o -name libubsan.a -o -name liblsan.a -o -name libcc1.a \ - -o -name libgcobol.a \) \ + -o -name libubsan.a -o -name liblsan.a -o -name libcc1.a \) \ -a -type f` popd chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgfortran.so.5.* @@ -2413,19 +1879,8 @@ chmod 755 %{buildroot}%{_prefix}/%{_lib}/libcc1.so.0.* chmod 755 %{buildroot}%{_prefix}/%{_lib}/libquadmath.so.0.* %endif %if %{build_d} -chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgdruntime.so.6.* -chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgphobos.so.6.* -%endif -%if %{build_m2} -for i in cor iso log min pim; do - chmod 755 %{buildroot}%{_prefix}/%{_lib}/libm2$i.so.21.* -done -%endif -%if %{build_cobol} -chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgcobol.so.2.* -%endif -%if %{build_algol68} -chmod 755 %{buildroot}%{_prefix}/%{_lib}/libga68.so.2.* +chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgdruntime.so.2.* +chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgphobos.so.2.* %endif %if %{build_libitm} chmod 755 %{buildroot}%{_prefix}/%{_lib}/libitm.so.1.* @@ -2434,23 +1889,20 @@ chmod 755 %{buildroot}%{_prefix}/%{_lib}/libitm.so.1.* chmod 755 %{buildroot}%{_prefix}/%{_lib}/libatomic.so.1.* %endif %if %{build_libasan} -chmod 755 %{buildroot}%{_prefix}/%{_lib}/libasan.so.8.* +chmod 755 %{buildroot}%{_prefix}/%{_lib}/libasan.so.6.* %endif %if %{build_libubsan} chmod 755 %{buildroot}%{_prefix}/%{_lib}/libubsan.so.1.* %endif %if %{build_libtsan} -chmod 755 %{buildroot}%{_prefix}/%{_lib}/libtsan.so.2.* -%endif -%if %{build_libhwasan} -chmod 755 %{buildroot}%{_prefix}/%{_lib}/libhwasan.so.0.* +chmod 755 %{buildroot}%{_prefix}/%{_lib}/libtsan.so.0.* %endif %if %{build_liblsan} chmod 755 %{buildroot}%{_prefix}/%{_lib}/liblsan.so.0.* %endif %if %{build_go} # Avoid stripping these libraries and binaries. -chmod 644 %{buildroot}%{_prefix}/%{_lib}/libgo.so.25.* +chmod 644 %{buildroot}%{_prefix}/%{_lib}/libgo.so.19.* chmod 644 %{buildroot}%{_prefix}/bin/go.gcc chmod 644 %{buildroot}%{_prefix}/bin/gofmt.gcc chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo @@ -2467,6 +1919,8 @@ chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgnarl*so* chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgnat*so* %endif +mv $FULLPATH/include-fixed/syslimits.h $FULLPATH/include/syslimits.h +mv $FULLPATH/include-fixed/limits.h $FULLPATH/include/limits.h for h in `find $FULLPATH/include -name \*.h`; do if grep -q 'It has been auto-edited by fixincludes from' $h; then rh=`grep -A2 'It has been auto-edited by fixincludes from' $h | tail -1 | sed 's|^.*"\(.*\)".*$|\1|'` @@ -2510,6 +1964,7 @@ cd .. rm -f %{buildroot}%{_prefix}/%{_lib}/{libffi*,libiberty.a} || : rm -f $FULLEPATH/install-tools/{mkheaders,fixincl} rm -f %{buildroot}%{_prefix}/lib/{32,64}/libiberty.a +rm -f %{buildroot}%{_prefix}/%{_lib}/libssp* rm -f %{buildroot}%{_prefix}/%{_lib}/libvtv* || : rm -f %{buildroot}%{_prefix}/bin/%{_target_platform}-gfortran || : rm -f %{buildroot}%{_prefix}/bin/%{_target_platform}-gccgo || : @@ -2518,10 +1973,6 @@ rm -f %{buildroot}%{_prefix}/bin/%{_target_platform}-gcc-ar || : rm -f %{buildroot}%{_prefix}/bin/%{_target_platform}-gcc-nm || : rm -f %{buildroot}%{_prefix}/bin/%{_target_platform}-gcc-ranlib || : rm -f %{buildroot}%{_prefix}/bin/%{_target_platform}-gdc || : -rm -f %{buildroot}%{_prefix}/bin/%{_target_platform}-gm2 || : -rm -f %{buildroot}%{_prefix}/bin/%{_target_platform}-gcobc || : -rm -f %{buildroot}%{_prefix}/bin/%{_target_platform}-gcobol || : -rm -f %{buildroot}%{_prefix}/bin/%{_target_platform}-ga68 || : %ifarch %{multilib_64_archs} # Remove libraries for the other arch on multilib arches @@ -2545,31 +1996,7 @@ rm -rf %{buildroot}%{_prefix}/lib64/go/%{gcc_major}/%{gcc_target_platform} %endif %endif -rm -f %{buildroot}%{_prefix}/lib*/lib*.spec || : -rm -f %{buildroot}%{_prefix}/lib*/libstdc++.modules.json || : -rm -f %{buildroot}%{_prefix}/%{_lib}/lib{asan,atomic,gcc_s,gcobol,ga68,gdruntime,gfortran,go,gomp-plugin-*,gomp,gphobos,hwasan}.so || : -rm -f %{buildroot}%{_prefix}/%{_lib}/lib{itm,lsan,m2{cor,iso,log,min,pim},objc,quadmath,stdc++,tsan,ubsan,gcc_s_asneeded,atomic_asneeded}.so || : -rm -f %{buildroot}%{_prefix}/%{_lib}/libatomic_asneeded.a || : -rm -f %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/install-tools/{fixinc.sh,mkinstalldirs} || : -rm -f %{buildroot}%{_prefix}/share/locale/*/LC_MESSAGES/libstdc++.mo || : -rm -f %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include-fixed/README || : -rm -rf %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/ssp || : -rm -rf %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/install-tools || : -%ifarch ppc ppc64 ppc64le ppc64p7 -rm -f %{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/{e,n}crt{i,n}.o || : -%endif - -%if %{build_offload_nvptx} -rm -f %{buildroot}%{_mandir}/man1/*-accel-*nvptx* -find %{buildroot}%{_prefix}/nvptx-none/lib -name libstdc++.a-gdb.py | xargs rm -f || : -find %{buildroot}%{_prefix}/nvptx-none/lib -name libstdc++.modules.json | xargs rm -f || : -%endif -%if %{build_offload_amdgcn} -rm -f %{buildroot}%{_mandir}/man1/*-accel-*amdgcn* -find %{buildroot}%{_prefix}/amdgcn-amdhsa/lib -name libstdc++.a-gdb.py | xargs rm -f || : -find %{buildroot}%{_prefix}/amdgcn-amdhsa/lib -name libstdc++.modules.json | xargs rm -f || : -%endif -rm -f %{buildroot}%{_mandir}/man7/{gpl,gfdl,fsf-funding}.7* +rm -f %{buildroot}%{mandir}/man3/ffi* # Help plugins find out nvra. echo gcc-%{version}-%{release}.%{_arch} > $FULLPATH/rpmver @@ -2579,26 +2006,16 @@ echo gcc-%{version}-%{release}.%{_arch} > $FULLPATH/rpmver ln -s ../../libexec/gcc/%{gcc_target_platform}/%{gcc_major}/liblto_plugin.so \ %{buildroot}%{_libdir}/bfd-plugins/ -%if %{build_annobin_plugin} -mkdir -p $FULLPATH/plugin -rm -f $FULLPATH/plugin/gcc-annobin* -cp -a %{_builddir}/gcc-%{version}-%{DATE}/annobin-plugin/annobin*/gcc-plugin/.libs/annobin.so.0.0.0 \ - $FULLPATH/plugin/gcc-annobin.so.0.0.0 -ln -sf gcc-annobin.so.0.0.0 $FULLPATH/plugin/gcc-annobin.so.0 -ln -sf gcc-annobin.so.0.0.0 $FULLPATH/plugin/gcc-annobin.so -%endif - %check cd obj-%{gcc_target_platform} # run the tests. LC_ALL=C make %{?_smp_mflags} -k check ALT_CC_UNDER_TEST=gcc ALT_CXX_UNDER_TEST=g++ \ %if 0%{?fedora} >= 20 || 0%{?rhel} > 7 - RUNTESTFLAGS="--target_board=unix/'{-foffload=disable,-fstack-protector-strong/-foffload=disable}'" || : + RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector-strong}'" || : %else - RUNTESTFLAGS="--target_board=unix/'{-foffload=disable,-fstack-protector/-foffload=disable}'" || : + RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector}'" || : %endif -%if !%{build_annobin_plugin} if [ -f %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/plugin/annobin.so ]; then # Test whether current annobin plugin won't fail miserably with the newly built gcc. echo -e '#include \nint main () { printf ("Hello, world!\\n"); return 0; }' > annobin-test.c @@ -2629,12 +2046,9 @@ if [ -f %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/plugin/annobin.so cat ANNOBINOUT ANNOBINRES[12] >> ANNOBINRES rm -f ANNOBINOUT* ANNOBINRES[12] annobin-test{c,C} fi -%endif echo ====================TESTING========================= ( LC_ALL=C ../contrib/test_summary || : ) 2>&1 | sed -n '/^cat.*EOF/,/^EOF/{/^cat.*EOF/d;/^EOF/d;/^LAST_UPDATED:/d;p;}' -%if !%{build_annobin_plugin} [ -f ANNOBINRES ] && cat ANNOBINRES -%endif echo ====================TESTING END===================== mkdir testlogs-%{_target_platform}-%{version}-%{release} for i in `find . -name \*.log | grep -F testsuite/ | grep -v 'config.log\|acats.*/tests/'`; do @@ -2654,20 +2068,28 @@ if [ $1 = 0 ]; then %{_sbindir}/update-alternatives --remove go %{_prefix}/bin/go.gcc fi -%{?ldconfig: # Because glibc Prereq's libgcc and /sbin/ldconfig # comes from glibc, it might not exist yet when # libgcc is installed %post -n libgcc -p -if posix.access ("%ldconfig", "x") then - rpm.execute ("%ldconfig") +if posix.access ("/sbin/ldconfig", "x") then + local pid = posix.fork () + if pid == 0 then + posix.exec ("/sbin/ldconfig") + elseif pid ~= -1 then + posix.wait (pid) + end end %postun -n libgcc -p -if posix.access ("%ldconfig", "x") then - rpm.execute ("%ldconfig") +if posix.access ("/sbin/ldconfig", "x") then + local pid = posix.fork () + if pid == 0 then + posix.exec ("/sbin/ldconfig") + elseif pid ~= -1 then + posix.wait (pid) + end end -} %ldconfig_scriptlets -n libstdc++ @@ -2677,8 +2099,6 @@ end %ldconfig_scriptlets -n libgphobos -%ldconfig_scriptlets -n libgm2 - %ldconfig_scriptlets -n libgnat %ldconfig_scriptlets -n libgomp @@ -2687,8 +2107,6 @@ end %ldconfig_scriptlets -n libgccjit -%ldconfig_scriptlets -n libgdiagnostics - %ldconfig_scriptlets -n libquadmath %ldconfig_scriptlets -n libitm @@ -2703,8 +2121,6 @@ end %ldconfig_scriptlets -n liblsan -%ldconfig_scriptlets -n libhwasan - %ldconfig_scriptlets -n libgo %files -f %{name}.lang @@ -2767,8 +2183,6 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/stdnoreturn.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/stdatomic.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/gcov.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/stdckdint.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/stdcountof.h %ifarch %{ix86} x86_64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/mmintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/xmmintrin.h @@ -2804,7 +2218,9 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/xsaveintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/xsaveoptintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx512cdintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx512erintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx512fintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx512pfintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/shaintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/mm_malloc.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/mm3dnow.h @@ -2826,6 +2242,8 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/xsavesintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/clzerointrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/pkuintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx5124fmapsintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx5124vnniwintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx512vpopcntdqintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/sgxintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/gfniintrin.h @@ -2860,35 +2278,6 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/keylockerintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avxvnniintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/mwaitintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx512fp16intrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx512fp16vlintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avxifmaintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avxvnniint8intrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avxneconvertintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/cmpccxaddintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/amxfp16intrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/prfchiintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/raointintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/amxcomplexintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx512bitalgvlintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avxvnniint16intrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/sha512intrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/sm3intrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/sm4intrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/usermsrintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/amxavx512intrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/amxfp8intrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/amxmovrsintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/amxtf32intrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx10_2bf16intrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx10_2convertintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx10_2copyintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx10_2mediaintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx10_2minmaxintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx10_2satcvtintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/movrsintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx512bmmintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/avx512bmmvlintrin.h %endif %ifarch ia64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/ia64intrin.h @@ -2913,10 +2302,6 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/tmmintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/smmintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/amo.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/nmmintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/immintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/x86gprintrin.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/rs6000-vecdefines.h %endif %ifarch %{arm} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/unwind-arm-common.h @@ -2933,10 +2318,6 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/arm_fp16.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/arm_bf16.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/arm_sve.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/arm_sme.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/arm_neon_sve_bridge.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/arm_private_fp8.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/arm_private_neon_types.h %endif %ifarch sparc sparcv9 sparc64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/visintrin.h @@ -2947,14 +2328,6 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/htmxlintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/vecintrin.h %endif -%ifarch riscv64 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/riscv_vector.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/riscv_crypto.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/riscv_bitmanip.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/riscv_th_vector.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/sifive_vector.h -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/andes_vector.h -%endif %if %{build_libasan} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/include/sanitizer %endif @@ -2964,7 +2337,6 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libgcov.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libgcc_eh.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libgcc_s.so -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libgcc_s_asneeded.so %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libgomp.spec %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libgomp.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libgomp.so @@ -2984,7 +2356,6 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libgcov.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libgcc_eh.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libgcc_s.so -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libgcc_s_asneeded.so %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libgomp.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libgomp.so %if %{build_libquadmath} @@ -2998,8 +2369,6 @@ end %if %{build_libatomic} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libatomic.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libatomic.so -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libatomic_asneeded.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libatomic_asneeded.so %endif %if %{build_libasan} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libasan.a @@ -3018,7 +2387,6 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libgcov.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libgcc_eh.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libgcc_s.so -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libgcc_s_asneeded.so %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libgomp.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libgomp.so %if %{build_libquadmath} @@ -3032,8 +2400,6 @@ end %if %{build_libatomic} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libatomic.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libatomic.so -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libatomic_asneeded.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libatomic_asneeded.so %endif %if %{build_libasan} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libasan.a @@ -3057,8 +2423,6 @@ end %if %{build_libatomic} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libatomic.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libatomic.so -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libatomic_asneeded.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libatomic_asneeded.so %endif %if %{build_libasan} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libasan.a @@ -3071,10 +2435,7 @@ end %endif %else %if %{build_libatomic} -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libatomic.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libatomic.so -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libatomic_asneeded.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libatomic_asneeded.so %endif %if %{build_libasan} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libasan.so @@ -3088,16 +2449,12 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libtsan.so %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libtsan_preinit.o %endif -%if %{build_libhwasan} -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libhwasan.so -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libhwasan_preinit.o -%endif %if %{build_liblsan} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/liblsan.so %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/liblsan_preinit.o %endif %{_prefix}/libexec/getconf/default -%doc gcc/README* rpm.doc/changelogs/gcc/ChangeLog* +%doc gcc/README* rpm.doc/changelogs/gcc/ChangeLog* %{!?_licensedir:%global license %%doc} %license gcc/COPYING* COPYING.RUNTIME @@ -3135,7 +2492,6 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libstdc++.so %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libstdc++.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libstdc++fs.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libstdc++exp.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libsupc++.a %endif %ifarch %{multilib_64_archs} @@ -3143,7 +2499,6 @@ end %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libstdc++.so %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libstdc++.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libstdc++fs.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libstdc++exp.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libsupc++.a %endif %ifarch sparcv9 ppc %{multilib_64_archs} @@ -3152,7 +2507,6 @@ end %ifarch sparcv9 sparc64 ppc ppc64 ppc64p7 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++fs.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++exp.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libsupc++.a %endif %doc rpm.doc/changelogs/gcc/cp/ChangeLog* @@ -3182,20 +2536,16 @@ end %ifnarch sparcv9 ppc %{multilib_64_archs} %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++.so %endif -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++.modules.json %ifarch sparcv9 ppc %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32/libstdc++fs.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32/libstdc++exp.a %endif %ifarch sparc64 ppc64 ppc64p7 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64/libstdc++fs.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64/libstdc++exp.a %endif %ifnarch sparcv9 sparc64 ppc ppc64 ppc64p7 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++fs.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++exp.a %endif %doc rpm.doc/changelogs/libstdc++-v3/ChangeLog* libstdc++-v3/README* @@ -3366,8 +2716,8 @@ end %doc rpm.doc/gdc/* %files -n libgphobos -%{_prefix}/%{_lib}/libgdruntime.so.6* -%{_prefix}/%{_lib}/libgphobos.so.6* +%{_prefix}/%{_lib}/libgdruntime.so.2* +%{_prefix}/%{_lib}/libgphobos.so.2* %doc rpm.doc/libphobos/* %files -n libgphobos-static @@ -3390,133 +2740,6 @@ end %endif %endif -%if %{build_m2} -%files gm2 -%{_prefix}/bin/gm2 -%{_mandir}/man1/gm2.1* -%{_infodir}/m2* -%dir %{_prefix}/lib/gcc -%dir %{_prefix}/lib/gcc/%{gcc_target_platform} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} -%dir %{_prefix}/libexec/gcc -%dir %{_prefix}/libexec/gcc/%{gcc_target_platform} -%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/plugin -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/m2 -%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cc1gm2 -%ifarch sparcv9 sparc64 ppc ppc64 ppc64p7 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libm2*.a -%endif -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libm2*.so -%ifarch sparcv9 ppc -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/m2 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libm2*.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libm2*.so -%endif -%ifarch %{multilib_64_archs} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/m2 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libm2*.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libm2*.so -%endif -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/plugin/m2rte.so -%doc rpm.doc/gm2/* - -%files -n libgm2 -%{_prefix}/%{_lib}/libm2*.so.21* -%doc rpm.doc/libgm2/* - -%files -n libgm2-static -%dir %{_prefix}/lib/gcc -%dir %{_prefix}/lib/gcc/%{gcc_target_platform} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} -%ifarch sparcv9 ppc -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32/libm2*.a -%endif -%ifarch sparc64 ppc64 ppc64p7 -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64/libm2*.a -%endif -%ifnarch sparcv9 sparc64 ppc ppc64 ppc64p7 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libm2*.a -%endif -%endif - -%if %{build_cobol} -%files gcobol -%{_prefix}/bin/gcobol -%{_prefix}/bin/gcobc -%{_mandir}/man1/gcobol.1* -%{_mandir}/man3/gcobol-io.3* -%dir %{_prefix}/libexec/gcc -%dir %{_prefix}/libexec/gcc/%{gcc_target_platform} -%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major} -%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cobol1 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libgcobol.spec -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libgcobol.so -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/cobol -%doc rpm.doc/gcobol/* - -%files -n libgcobol -%{_prefix}/%{_lib}/libgcobol.so.2* -%doc rpm.doc/libgcobol/* - -%files -n libgcobol-static -%dir %{_prefix}/lib/gcc -%dir %{_prefix}/lib/gcc/%{gcc_target_platform} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libgcobol.a -%endif - -%if %{build_algol68} -%files algol68 -%{_prefix}/bin/ga68 -%{_mandir}/man1/ga68.1* -%dir %{_prefix}/libexec/gcc -%dir %{_prefix}/libexec/gcc/%{gcc_target_platform} -%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major} -%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/a681 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libga68.spec -%ifarch sparcv9 sparc64 ppc ppc64 ppc64p7 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libga68.a -%endif -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libga68.so -%ifarch sparcv9 ppc -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libga68.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libga68.so -%endif -%ifarch %{multilib_64_archs} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libga68.a -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libga68.so -%endif -%{_infodir}/ga68* -%doc rpm.doc/algol68/* - -%files -n libga68 -%{_prefix}/%{_lib}/libga68.so.2* -%doc rpm.doc/libga68/* - -%files -n libga68-static -%dir %{_prefix}/lib/gcc -%dir %{_prefix}/lib/gcc/%{gcc_target_platform} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} -%ifarch sparcv9 ppc -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32/libga68.a -%endif -%ifarch sparc64 ppc64 ppc64p7 -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64/libga68.a -%endif -%ifnarch sparcv9 sparc64 ppc ppc64 ppc64p7 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libga68.a -%endif -%endif - %if %{build_ada} %files gnat %{_prefix}/bin/gnat @@ -3678,12 +2901,28 @@ end %if %{build_libatomic} %files -n libatomic %{_prefix}/%{_lib}/libatomic.so.1* + +%files -n libatomic-static +%dir %{_prefix}/lib/gcc +%dir %{_prefix}/lib/gcc/%{gcc_target_platform} +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} +%ifarch sparcv9 ppc +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32/libatomic.a +%endif +%ifarch sparc64 ppc64 ppc64p7 +%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64/libatomic.a +%endif +%ifnarch sparcv9 sparc64 ppc ppc64 ppc64p7 +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libatomic.a +%endif %doc rpm.doc/changelogs/libatomic/ChangeLog* %endif %if %{build_libasan} %files -n libasan -%{_prefix}/%{_lib}/libasan.so.8* +%{_prefix}/%{_lib}/libasan.so.6* %files -n libasan-static %dir %{_prefix}/lib/gcc @@ -3731,7 +2970,7 @@ end %if %{build_libtsan} %files -n libtsan -%{_prefix}/%{_lib}/libtsan.so.2* +%{_prefix}/%{_lib}/libtsan.so.0* %files -n libtsan-static %dir %{_prefix}/lib/gcc @@ -3743,20 +2982,6 @@ end %license libsanitizer/LICENSE.TXT %endif -%if %{build_libhwasan} -%files -n libhwasan -%{_prefix}/%{_lib}/libhwasan.so.0* - -%files -n libhwasan-static -%dir %{_prefix}/lib/gcc -%dir %{_prefix}/lib/gcc/%{gcc_target_platform} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libhwasan.a -%doc rpm.doc/changelogs/libsanitizer/ChangeLog* -%{!?_licensedir:%global license %%doc} -%license libsanitizer/LICENSE.TXT -%endif - %if %{build_liblsan} %files -n liblsan %{_prefix}/%{_lib}/liblsan.so.0* @@ -3817,8 +3042,7 @@ end %doc rpm.doc/go/* %files -n libgo -%{_prefix}/%{_lib}/libgo.so.25 -%attr(755,root,root) %{_prefix}/%{_lib}/libgo.so.25.* +%attr(755,root,root) %{_prefix}/%{_lib}/libgo.so.19* %doc rpm.doc/libgo/* %files -n libgo-devel @@ -3879,15 +3103,6 @@ end %doc rpm.doc/libgccjit-devel/* %doc gcc/jit/docs/examples -%files -n libgdiagnostics -%{_prefix}/bin/sarif-replay -%{_prefix}/%{_lib}/libgdiagnostics.so.* - -%files -n libgdiagnostics-devel -%{_prefix}/%{_lib}/libgdiagnostics.so -%{_prefix}/include/libgdiagnostics*.h -%doc rpm.doc/libgdiagnostics-devel/* - %files plugin-devel %dir %{_prefix}/lib/gcc %dir %{_prefix}/lib/gcc/%{gcc_target_platform} @@ -3934,130 +3149,795 @@ end %{_prefix}/%{_lib}/libgomp-plugin-nvptx.so.* %endif -%if %{build_offload_amdgcn} -%files offload-amdgcn -%{_prefix}/bin/amdgcn-amdhsa-* -%{_prefix}/bin/%{gcc_target_platform}-accel-amdgcn-amdhsa-gcc -%{_prefix}/bin/%{gcc_target_platform}-accel-amdgcn-amdhsa-lto-dump -%dir %{_prefix}/lib/gcc -%dir %{_prefix}/lib/gcc/%{gcc_target_platform} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel -%dir %{_prefix}/libexec/gcc -%dir %{_prefix}/libexec/gcc/%{gcc_target_platform} -%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major} -%dir %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/accel -%{_prefix}/lib/gcc/amdgcn-amdhsa -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/accel/amdgcn-amdhsa -%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/accel/amdgcn-amdhsa -%dir %{_prefix}/amdgcn-amdhsa -%{_prefix}/amdgcn-amdhsa/bin -%{_prefix}/amdgcn-amdhsa/include - -%files -n libgomp-offload-amdgcn -%{_prefix}/%{_lib}/libgomp-plugin-gcn.so.* -%endif - -%if %{build_annobin_plugin} -%files plugin-annobin -%dir %{_prefix}/lib/gcc -%dir %{_prefix}/lib/gcc/%{gcc_target_platform} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major} -%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/plugin -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/plugin/gcc-annobin.so -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/plugin/gcc-annobin.so.0 -%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/plugin/gcc-annobin.so.0.0.0 -%endif - %changelog -* Thu Jan 15 2026 Jakub Jelinek 16.0.1-0.3 -- update from trunk - - PRs c/123309, c++/120775, c++/122634, c++/123081, c++/123551, - debug/121045, driver/108865, driver/123504, ipa/122852, ipa/123542, - middle-end/123115, middle-end/123392, middle-end/123573, - rtl-optimization/123312, rtl-optimization/123544, target/38118, - target/114528, target/120250, target/121240, target/123092, - testsuite/122522, tree-optimization/119402, tree-optimization/120322, - tree-optimization/123109, tree-optimization/123190, - tree-optimization/123530 +* Thu Apr 21 2022 Jakub Jelinek 11.3.1-2 +- update from releases/gcc-11-branch + - PRs debug/105203, gcov-profile/105282, libstdc++/105324, target/105257 -* Tue Jan 13 2026 Jakub Jelinek 16.0.1-0.2 -- update from trunk - - PRs fortran/91960, fortran/112460, libstdc++/123396, - rtl-optimization/123444, rtl-optimization/123501, target/117581, - target/123484, testsuite/123098, tree-optimization/122843, - tree-optimization/122845, tree-optimization/123301, - tree-optimization/123525, tree-optimization/123539 +* Thu Apr 21 2022 Jakub Jelinek 11.3.1-1 +- update from releases/gcc-11-branch + - GCC 11.3 release + - PRs c++/98249, c++/99893, c++/100608, c++/101051, c++/101532, c++/101677, + c++/101717, c++/101894, c++/102869, c++/103105, c++/103328, + c++/103341, c++/103455, c++/103706, c++/103885, c++/103943, + c++/104008, c++/104079, c++/104225, c++/104507, c++/104565, + c++/105003, c++/105064, c++/105143, c++/105186, c++/105256, c/101585, + debug/105203, fortran/102992, fortran/104210, fortran/104228, + fortran/104570, fortran/105138, gcov-profile/105282, ipa/103083, + ipa/103432, jit/100613, libstdc++/90943, libstdc++/100516, + libstdc++/103630, libstdc++/103638, libstdc++/103650, + libstdc++/103955, libstdc++/104098, libstdc++/104301, + libstdc++/104542, libstdc++/104859, libstdc++/105021, + libstdc++/105027, middle-end/104497, middle-end/105165, + rtl-optimization/104985, rtl-optimization/105028, + rtl-optimization/105211, target/80556, target/100106, target/104117, + target/104474, target/104853, target/104894, target/105214, + target/105257, tree-optimization/99121, tree-optimization/104880, + tree-optimization/105053, tree-optimization/105070, + tree-optimization/105189, tree-optimization/105198, + tree-optimization/105226, tree-optimization/105232, + tree-optimization/105235 +- fix bogus -Wuninitialized warning on va_arg with complex types on x86_64 + (PR target/105331) +- remove bogus assertion in std::from_chars (PR libstdc++/105324) -* Mon Jan 12 2026 Jakub Jelinek 16.0.1-0.1 -- update from trunk - - PRs c++/81337, c++/115163, c++/123526, fortran/77415, ipa/122458, - ipa/123543, libfortran/123012, middle-end/123175, - rtl-optimization/123523, target/123415, testsuite/121752, - testsuite/123129, tree-optimization/122824, tree-optimization/122830, - tree-optimization/123417, tree-optimization/123528 +* Fri Apr 1 2022 Jakub Jelinek 11.2.1-10 +- update from releases/gcc-11-branch + - PRs ada/98724, ada/104258, ada/104767, ada/104861, c++/58646, c++/59950, + c++/61611, c++/95036, c++/100468, c++/101030, c++/101095, c++/101371, + c++/101515, c++/101767, c++/102045, c++/102123, c++/102538, + c++/102740, c++/102990, c++/103057, c++/103186, c++/103291, + c++/103299, c++/103337, c++/103711, c++/103769, c++/103968, + c++/104107, c++/104108, c++/104284, c++/104410, c++/104472, + c++/104513, c++/104568, c++/104667, c++/104806, c++/104847, + c++/104944, c++/104994, c++/105035, c++/105061, c/82283, c/84685, + c/104510, c/104711, d/104659, d/105004, debug/104337, debug/104517, + debug/104557, fortran/66193, fortran/99585, fortran/100337, + fortran/103790, fortran/104211, fortran/104311, fortran/104331, + fortran/104430, fortran/104619, fortran/104811, go/100537, + libgomp/104385, libstdc++/101231, libstdc++/102358, libstdc++/103904, + libstdc++/104442, lto/104237, lto/104333, lto/104617, + middle-end/95115, middle-end/99578, middle-end/100464, + middle-end/100680, middle-end/100775, middle-end/100786, + middle-end/104307, middle-end/104402, middle-end/104446, + middle-end/104786, middle-end/104971, middle-end/105032, + preprocessor/104147, rtl-optimization/104544, rtl-optimization/104589, + rtl-optimization/104777, rtl-optimization/104814, sanitizer/102656, + sanitizer/104449, sanitizer/105093, target/79754, target/87496, + target/99708, target/99754, target/100784, target/101324, + target/102140, target/102952, target/102957, target/103307, + target/103627, target/103925, target/104090, target/104208, + target/104219, target/104253, target/104362, target/104448, + target/104451, target/104453, target/104458, target/104462, + target/104469, target/104502, target/104674, target/104681, + target/104688, target/104775, target/104890, target/104910, + target/104923, target/104963, target/104998, target/105000, + target/105052, target/105058, target/105068, testsuite/103556, + testsuite/103586, testsuite/104730, testsuite/104759, + testsuite/105055, tree-optimization/45178, tree-optimization/100834, + tree-optimization/101636, tree-optimization/102819, + tree-optimization/102893, tree-optimization/103169, + tree-optimization/103361, tree-optimization/103489, + tree-optimization/103544, tree-optimization/103596, + tree-optimization/103641, tree-optimization/103864, + tree-optimization/104263, tree-optimization/104288, + tree-optimization/104511, tree-optimization/104601, + tree-optimization/104675, tree-optimization/104782, + tree-optimization/104931, tree-optimization/105094 +- fix x86 vector initialization expansion fallback (PR target/105123) -* Sat Jan 10 2026 Jakub Jelinek 16.0.0-0.5 -- update from trunk - - PRs ada/123003, ada/123371, ada/123490, c/117687, c/121081, c/121507, - c/123212, c/123435, c/123463, c/123475, c++/123331, c++/123347, - c++/123393, debug/123259, fortran/90218, fortran/123012, - fortran/123029, fortran/123071, fortran/123321, fortran/123352, - fortran/123483, gcov-profile/123019, ipa/123383, libstdc++/122878, - libstdc++/123100, libstdc++/123183, libstdc++/123326, - libstdc++/123378, libstdc++/123406, middle-end/111817, - middle-end/123107, rtl-optimization/119291, rtl-optimization/121675, - rtl-optimization/121773, rtl-optimization/123121, - rtl-optimization/123491, target/119430, target/121192, target/121290, - target/121535, target/121778, target/122846, target/123010, - target/123017, target/123268, target/123269, target/123317, - target/123320, target/123390, target/123403, target/123457, - target/123489, target/123492, testsuite/123353, testsuite/123377, - tree-optimization/42196, tree-optimization/102486, - tree-optimization/102954, tree-optimization/122103, - tree-optimization/122608, tree-optimization/122793, - tree-optimization/123197, tree-optimization/123200, - tree-optimization/123221, tree-optimization/123298, - tree-optimization/123300, tree-optimization/123310, - tree-optimization/123315, tree-optimization/123316, - tree-optimization/123319, tree-optimization/123351, - tree-optimization/123372, tree-optimization/123374, - tree-optimization/123382, tree-optimization/123414, - tree-optimization/123431 -- fix ICE on friend with noexcept (PR c++/123189) -- fix -E -fdirectives-only comment handling (PR preprocessor/123273) -- provide libatomic-static from gcc subpackage +* Thu Jan 25 2022 Jakub Jelinek 11.2.1-9 +- update from releases/gcc-11-branch + - PRs fortran/104127, fortran/104212, fortran/104227, target/101529 +- fix up va-opt-6.c testcase -* Sat Jan 3 2026 Jakub Jelinek 16.0.0-0.4 -- update from trunk - - PRs ada/123060, ada/123088, ada/123185, ada/123289, ada/123302, - ada/123306, ada/15605, c++/117518, c++/119097, c++/120005, c++/121864, - c++/122550, c++/122690, c++/122712, c++/122819, c++/122958, - c++/122994, c++/123080, c++/123261, c++/123277, fortran/101399, - fortran/121472, fortran/121475, fortran/122957, fortran/123201, - fortran/123253, libfortran/119136, middle-end/123067, - middle-end/123222, other/122243, rtl-optimization/123114, - rtl-optimization/123267, rtl-optimization/123276, - rtl-optimization/123295, rtl-optimization/123308, target/121485, - target/122769, target/123216, target/123217, target/123274, - target/123278, target/123283, target/123318, testsuite/123299, - testsuite/123334, tree-optimization/123089 -- require libatomic package from gcc package as -latomic is now linked - as-needed by default -- remove libatomic-static package, move libatomic.a into gcc package +* Tue Jan 25 2022 Jakub Jelinek 11.2.1-8 +- update from releases/gcc-11-branch + - PRs ada/103538, analyzer/101962, bootstrap/103688, c++/85846, c++/95009, + c++/98394, c++/99911, c++/100493, c++/101715, c++/102229, c++/102933, + c++/103012, c++/103198, c++/103480, c++/103703, c++/103714, + c++/103758, c++/103783, c++/103831, c++/103912, c++/104055, c/97548, + c/101289, c/101537, c/103587, c/103881, d/103604, debug/103838, + debug/103874, fortran/67804, fortran/83079, fortran/101329, + fortran/101762, fortran/102332, fortran/102717, fortran/102787, + fortran/103411, fortran/103412, fortran/103418, fortran/103473, + fortran/103505, fortran/103588, fortran/103591, fortran/103606, + fortran/103607, fortran/103609, fortran/103610, fortran/103692, + fortran/103717, fortran/103718, fortran/103719, fortran/103776, + fortran/103777, fortran/103778, fortran/103782, fortran/103789, + ipa/101354, jit/103562, libfortran/103634, libstdc++/100017, + libstdc++/102994, libstdc++/103453, libstdc++/103501, + libstdc++/103549, libstdc++/103877, libstdc++/103919, + middle-end/101751, middle-end/102860, middle-end/103813, objc/103639, + preprocessor/89971, preprocessor/102432, rtl-optimization/102478, + rtl-optimization/103837, rtl-optimization/103860, + rtl-optimization/103908, sanitizer/102911, target/102347, + target/103465, target/103661, target/104172, target/104188, + tree-optimization/101615, tree-optimization/103523, + tree-optimization/103603, tree-optimization/103995 -* Sat Dec 20 2025 Jakub Jelinek 16.0.0-0.3 -- update from trunk - - PRs bootstrap/12407, c/123156, c++/91388, c++/117034, c++/122070, - c++/122509, c++/122690, c++/122712, c++/122772, c++/122834, - c++/122922, c++/122995, c++/123030, c++/123044, c++/123186, - debug/122968, fortran/71565, fortran/92613, libstdc++/112591, - libstdc++/123147, libstdc++/123180, rtl-optimization/123223, - target/55212, target/122970, target/123171, target/123216, - target/123217, tree-optimization/122734, tree-optimization/123097, - tree-optimization/123117, tree-optimization/123118, - tree-optimization/123152, tree-optimization/123153, - tree-optimization/123192, tree-optimization/123205 +* Fri Dec 3 2021 Jakub Jelinek 11.2.1-7 +- update from releases/gcc-11-branch + - PRs ada/100486, c++/70796, c++/92746, c++/93286, c++/94490, c++/102642, + c++/102786, debug/101378, debug/103046, debug/103315, fortran/87711, + fortran/87851, fortran/97896, fortran/99061, fortran/99348, + fortran/102521, fortran/102685, fortran/102715, fortran/102745, + fortran/102816, fortran/102817, fortran/102917, fortran/103137, + fortran/103138, fortran/103392, gcov-profile/100520, ipa/102714, + ipa/102762, ipa/103052, ipa/103246, ipa/103267, libstdc++/96416, + libstdc++/98421, libstdc++/100117, libstdc++/100153, libstdc++/100748, + libstdc++/101571, libstdc++/101608, libstdc++/102894, + libstdc++/103022, libstdc++/103086, libstdc++/103133, + libstdc++/103240, libstdc++/103381, middle-end/64888, + middle-end/101480, middle-end/102431, middle-end/102518, + middle-end/103059, middle-end/103181, middle-end/103248, + middle-end/103384, preprocessor/103130, rtl-optimization/102356, + rtl-optimization/102842, target/101985, target/102976, target/102991, + target/103205, target/103274, target/103275, testsuite/102690, + tree-optimization/100393, tree-optimization/102139, + tree-optimization/102505, tree-optimization/102572, + tree-optimization/102788, tree-optimization/102789, + tree-optimization/102798, tree-optimization/102970, + tree-optimization/103192, tree-optimization/103204, + tree-optimization/103237, tree-optimization/103255, + tree-optimization/103435 +- fix up #__VA_OPT__ handling (PR preprocessor/103415) -* Thu Dec 18 2025 Jakub Jelinek 16.0.0-0.2 +* Tue Oct 19 2021 Jakub Jelinek 11.2.1-6 +- update from releases/gcc-11-branch + - PRs target/100208, target/100316, target/102761 +- fix up libstdc++ docs build + +* Mon Oct 18 2021 Jakub Jelinek 11.2.1-5 +- update from releases/gcc-11-branch + - PRs fortran/102716, libstdc++/65816, libstdc++/90787, libstdc++/99876, + libstdc++/100187, libstdc++/100237, libstdc++/100249, + libstdc++/100287, libstdc++/100606, libstdc++/100863, + libstdc++/101483, libstdc++/101583, libstdc++/101589, + libstdc++/101599, libstdc++/101761, libstdc++/101870, + libstdc++/101923, libstdc++/101960, libstdc++/102048, + libstdc++/102074, libstdc++/102270, libstdc++/102280, + libstdc++/102425, libstdc++/102592, libstdc++/102667, + rtl-optimization/102627, target/100340, target/102588 +- add mwaitintrin.h on x86 (#2013860) +- disable LTO bootstrap on 32-bit arm, 6 days long build and counting + isn't acceptable, build boxes don't have enough memory and are too + slow + +* Tue Oct 12 2021 Jakub Jelinek 11.2.1-4 +- update from releases/gcc-11-branch + - PRs ada/101970, c++/60318, c++/64697, c++/88578, c++/91292, c++/95567, + c++/98216, c++/98486, c++/99904, c++/100495, c++/101344, c++/101592, + c++/101803, c++/101883, c++/102163, c++/102295, c++/102305, + c++/102412, c++/102454, c++/102496, c++/102535, c++/102547, + c++/102548, c++/102640, d/102185, d/102574, debug/102373, + debug/102441, fortran/46691, fortran/82314, fortran/85130, + fortran/87737, fortran/98490, fortran/99819, fortran/100950, + fortran/101327, fortran/101349, fortran/102113, fortran/102287, + fortran/102311, fortran/102366, fortran/102458, fortran/102520, + ipa/97565, libgomp/96661, libstdc++/100180, libstdc++/100285, + libstdc++/100286, libstdc++/100351, libstdc++/100682, + libstdc++/101965, middle-end/101824, middle-end/101949, + rtl-optimization/102306, sanitizer/102515, target/94630, target/97142, + target/100734, target/101471, target/101472, target/101492, + target/101549, target/101849, target/101934, target/102035, + target/102107, target/102115, target/102166, target/102222, + target/102224, target/102498, tree-optimization/101925, + tree-optimization/102046, tree-optimization/102124, + tree-optimization/102400, tree-optimization/102451, + tree-optimization/102622 +- remove the PR libstdc++/99341 workaround for Fedora 35 and later, + the std::once_flag::_M_activate() and std::once_flag::_M_finish(bool) + symbols (mangled as _ZNSt9once_flag11_M_activateEv and + _ZNSt9once_flag9_M_finishEb) aren't part of upstream GCC 11 and were + present only because not all packaged have been successfully rebuilt + (#1961541) + +* Mon Aug 23 2021 Jakub Jelinek 11.2.1-3 +- update from releases/gcc-11-branch + - PRs c++/100828, c++/101663, c++/101725, c++/101759, c/100150, c/101512, + d/96435, d/101127, d/101441, d/101490, d/101619, d/101640, d/101664, + debug/101905, fortran/99351, fortran/101084, fortran/101514, + fortran/101536, fortran/101564, gcov-profile/89961, + gcov-profile/100788, ipa/100600, ipa/101261, ipa/101726, + libstdc++/100139, libstdc++/101056, libstdc++/101258, + libstdc++/101510, libstdc++/101866, middle-end/101624, + preprocessor/101638, sanitizer/101749, target/94780, target/100952, + target/101132, target/101531, target/101723, testsuite/101969, + tree-optimization/101373, tree-optimization/101505, + tree-optimization/101868 +- add bundled(libbacktrace) and bundled(libffi) provides +- build target shared libraries with -Wl,-z,relro,-z,now +- improve generated code with extern thread_local constinit vars + with trivial dtors +- add support for C++20 #__VA_OPT__ +- fix up %%ldconfig_scriptlets + +* Fri Jul 30 2021 Jakub Jelinek 11.2.1-2 +- enable LTO profiledbootstrap on all arches, and also for RHEL9+ + +* Wed Jul 28 2021 Jakub Jelinek 11.2.1-1 +- update from releases/gcc-11-branch + - GCC 11.2 release + - PRs middle-end/101586, rtl-optimization/101562 +- enable LTO profiledbootstrap on x86_64, i?86, ppc64le and s390x for f35+ + +* Mon Jul 26 2021 Jakub Jelinek 11.1.1-7 +- update from releases/gcc-11-branch + - PRs ada/101094, analyzer/100244, analyzer/100615, analyzer/101082, + bootstrap/100246, c++/100138, c++/100752, c++/100838, c++/100918, + c++/101040, c++/101087, c++/101098, c++/101181, c++/101182, + c++/101194, c++/101210, c++/101233, c++/101247, c++/101361, + c++/101443, c++/101516, c++/86355, c++/95520, c++/97420, c++/98832, + c/101171, c/101176, d/101273, d/101282, debug/101266, driver/101383, + fortran/100227, fortran/100949, fortran/93524, go/101407, ipa/101066, + libstdc++/100387, libstdc++/101411, libstdc++/101427, + middle-end/100672, middle-end/101156, middle-end/101172, + middle-end/101291, middle-end/101423, middle-end/101535, + middle-end/94366, target/100152, target/100809, target/101023, + target/101129, target/101142, target/101175, target/101185, + target/101235, target/101377, target/101384, target/101395, + testsuite/100422, tree-optimization/100299, tree-optimization/100778, + tree-optimization/100923, tree-optimization/101014, + tree-optimization/101025, tree-optimization/101088, + tree-optimization/101105, tree-optimization/101148, + tree-optimization/101151, tree-optimization/101158, + tree-optimization/101173, tree-optimization/101223, + tree-optimization/101229, tree-optimization/101280, + tree-optimization/101394, tree-optimization/101445 + +* Wed Jun 23 2021 Jakub Jelinek 11.1.1-6 +- update from releases/gcc-11-branch + - PRs c++/100876, c++/100879, c++/101106, c/100619, c/100783, fortran/95501, + fortran/95502, fortran/100283, fortran/101123, inline-asm/100785, + libstdc++/91488, libstdc++/95833, libstdc++/100806, libstdc++/100940, + middle-end/100250, middle-end/100307, middle-end/100574, + middle-end/100684, middle-end/100732, middle-end/100876, + middle-end/101062, middle-end/101167, target/99842, target/99939, + target/100310, target/100777, target/100856, target/100871, + target/101016 + +* Thu Jun 17 2021 Jakub Jelinek 11.1.1-5 +- update from releases/gcc-11-branch + - PRs bootstrap/100731, c++/91706, c++/91859, c++/95719, c++/100065, + c++/100102, c++/100580, c++/100666, c++/100796, c++/100797, + c++/100862, c++/100946, c++/100963, c++/101029, c++/101078, c/100902, + c/100920, d/100882, d/100935, d/100964, d/100967, d/100999, + debug/100852, fortran/82376, fortran/98301, fortran/99839, + fortran/100965, ipa/100791, libstdc++/98842, libstdc++/100475, + libstdc++/100577, libstdc++/100631, libstdc++/100639, + libstdc++/100676, libstdc++/100690, libstdc++/100768, + libstdc++/100770, libstdc++/100824, libstdc++/100833, + libstdc++/100889, libstdc++/100894, libstdc++/100900, + libstdc++/100982, libstdc++/101034, libstdc++/101055, + middle-end/100576, middle-end/100898, middle-end/101009, + preprocessor/100646, rtl-optimization/100342, rtl-optimization/100590, + rtl-optimization/101008, target/100333, target/100885, target/100887, + target/101046, testsuite/100750, tree-optimization/100934, + tree-optimization/100981 + +* Mon Jun 14 2021 Florian Weimer 11.1.1-4 +- NVR bump to enable rebuild in side tag + +* Mon May 31 2021 Jakub Jelinek 11.1.1-3 +- update from releases/gcc-11-branch + - PRs bootstrap/100552, c++/100205, c++/100261, c++/100281, c++/100367, + c++/100372, c++/100489, c++/100502, c++/100634, c++/100644, + c++/100659, c/100550, fortran/98411, fortran/100551, fortran/100602, + fortran/100633, fortran/100656, ipa/100513, libstdc++/100361, + libstdc++/100479, libstdc++/100630, middle-end/100471, + middle-end/100508, middle-end/100509, preprocessor/100392, + target/94177, target/99725, target/99960, target/99977, target/100419, + target/100563, target/100626, target/100767, testsuite/96488, + tree-optimization/100492, tree-optimization/100519 + +* Wed May 12 2021 Jakub Jelinek 11.1.1-2 +- update from releases/gcc-11-branch + - PRs c++/98032, c++/100319, c++/100362, c/100450, fortran/100274, + ipa/100308, libgomp/100352, libstdc++/99006, libstdc++/99453, + libstdc++/100259, libstdc++/100298, libstdc++/100384, + rtl-optimization/84878, rtl-optimization/100225, + rtl-optimization/100230, rtl-optimization/100263, + rtl-optimization/100411, target/99988, target/100217, target/100232, + target/100236, target/100270, target/100305, target/100311, + target/100375, target/100402, tree-optimization/96513, + tree-optimization/100253, tree-optimization/100278, + tree-optimization/100329, tree-optimization/100414 +- fix build with removed linux/cyclades.h header (PR sanitizer/100379) +- fix up mausezahn miscompilation (#1958887, PR tree-optimization/100566) + +* Wed Apr 28 2021 Jakub Jelinek 11.1.1-1 +- update from releases/gcc-11-branch + - GCC 11.1 release + - PRs c++/93383, c++/95291, c++/96380, c++/99200, c++/99683, c++/100161, + debug/100255, fortran/100154, fortran/100218, libstdc++/100290, + rtl-optimization/100254, target/98952, target/100200, + tree-optimization/100239 +- fix ICE in aarch64_add_offset_1_temporaries (PR target/100302) + +* Fri Apr 23 2021 Jakub Jelinek 11.0.1-0.7 +- update from trunk and releases/gcc-11 branch + - GCC 11.1-rc2 + - PRs libstdc++/100179, target/100182 + +* Thu Apr 22 2021 Jakub Jelinek 11.0.1-0.6 +- update from trunk and releases/gcc-11 branch + - GCC 11.1-rc1 + - PRs ada/99360, c++/97536, c/100143, d/98058, d/98457, d/98494, d/98584, + d/99794, demangler/100177, fortran/100110, libstdc++/95983, + libstdc++/100146, libstdc++/100164, preprocessor/100142, + rtl-optimization/99927, target/100108, testsuite/100176, + tree-optimization/100081 +- fix a cprop -fcompare-debug bug (PR rtl-optimization/100148) + +* Sun Apr 18 2021 Jakub Jelinek 11.0.1-0.5 +- update from trunk + - PRs analyzer/98599, analyzer/99042, analyzer/99212, analyzer/99774, + analyzer/99886, analyzer/99906, analyzer/100011, c++/41723, c++/49951, + c++/52202, c++/52625, c++/58123, c++/80456, c++/83476, c++/88742, + c++/90215, c++/90479, c++/90674, c++/91241, c++/91849, c++/91933, + c++/92918, c++/93085, c++/93295, c++/93314, c++/93867, c++/94529, + c++/95317, c++/95486, c++/95870, c++/96311, c++/96673, c++/96873, + c++/97121, c++/97134, c++/97679, c++/97974, c++/98440, c++/98800, + c++/98852, c++/99008, c++/99066, c++/99118, c++/99180, c++/99201, + c++/99380, c++/99478, c++/99700, c++/99803, c++/99806, c++/99833, + c++/99844, c++/99850, c++/99859, c++/99874, c++/99885, c++/99899, + c++/99901, c++/99961, c++/99994, c++/100006, c++/100032, c++/100054, + c++/100078, c++/100079, c++/100091, c++/100101, c++/100111, c/98852, + c/99420, c/99972, c/99990, d/99812, d/99914, d/99917, debug/99830, + fortran/63797, fortran/99307, fortran/99817, fortran/100018, + fortran/100094, jit/100096, libfortran/78314, libgomp/99984, + libstdc++/96657, libstdc++/99402, libstdc++/99433, libstdc++/99805, + libstdc++/99985, libstdc++/99995, libstdc++/100044, libstdc++/100060, + lto/98599, lto/99849, lto/99857, middle-end/55288, middle-end/84877, + middle-end/84991, middle-end/84992, middle-end/86058, + middle-end/90779, middle-end/98088, middle-end/99883, + middle-end/99989, preprocessor/99446, rtl-optimization/98601, + rtl-optimization/98689, rtl-optimization/99596, + rtl-optimization/99905, rtl-optimization/99929, + rtl-optimization/100066, sanitizer/99877, sanitizer/100114, + target/87763, target/99246, target/99647, target/99648, target/99748, + target/99767, target/99781, target/99872, target/100028, + target/100048, target/100056, target/100067, target/100075, + testsuite/99955, testsuite/100071, testsuite/100073, + tree-optimization/82800, tree-optimization/97513, + tree-optimization/98736, tree-optimization/99873, + tree-optimization/99880, tree-optimization/99924, + tree-optimization/99947, tree-optimization/99954, + tree-optimization/100053 +- for %%{rhel} == 9, default to -march=z14 -mtune=z15 on s390x and + to -mcpu=power9 -mtune=power9 on ppc64le + +* Mon Apr 5 2021 Jakub Jelinek 11.0.1-0.4 +- update from trunk + - PRs ada/99802, analyzer/93695, analyzer/99044, analyzer/99716, + analyzer/99771, bootstrap/98860, c++/90664, c++/91217, c++/91416, + c++/94751, c++/97900, c++/97938, c++/98352, c++/99331, c++/99445, + c++/99565, c++/99583, c++/99584, c++/99586, c++/99643, c++/99672, + c++/99705, c++/99745, c++/99790, c++/99815, c++/99831, c++/99869, + d/91595, d/99691, debug/99334, fortran/99369, fortran/99602, + fortran/99651, fortran/99818, fortran/99840, ipa/98265, ipa/99122, + ipa/99466, ipa/99751, libstdc++/99533, lto/99447, middle-end/65182, + rtl-optimization/97141, rtl-optimization/98726, + rtl-optimization/99863, target/96974, target/97653, target/98119, + target/98136, target/98209, target/99037, target/99133, target/99216, + target/99555, target/99718, target/99724, target/99727, target/99744, + target/99753, target/99766, target/99773, target/99786, target/99808, + target/99813, target/99820, target/99822, testsuite/98125, + tree-optimization/48483, tree-optimization/55060, + tree-optimization/59970, tree-optimization/61112, + tree-optimization/61677, tree-optimization/61869, + tree-optimization/96573, tree-optimization/96974, + tree-optimization/97009, tree-optimization/98268, + tree-optimization/99726, tree-optimization/99746, + tree-optimization/99777, tree-optimization/99807, + tree-optimization/99824, tree-optimization/99825, + tree-optimization/99856, tree-optimization/99863, + tree-optimization/99882 + +* Wed Mar 24 2021 Jakub Jelinek 11.0.1-0.3 +- update from trunk + - PRs analyzer/99614, c++/99239, c++/99283, c++/99318, c++/99425, c++/99456, + c++/99480, c++/99687, c/99588, fortran/93660, fortran/99688, + rtl-optimization/99680, target/97252, target/97926, target/98914, + target/99540, target/99581, target/99652, target/99660, target/99661, + target/99663, target/99679, target/99702, target/99704, target/99733, + tree-optimization/99296, tree-optimization/99656, + tree-optimization/99694, tree-optimization/99721 + +* Fri Mar 19 2021 Jakub Jelinek 11.0.1-0.2 +- update from trunk + - PRs c++/90448, c++/96268, c++/96749, c++/97973, c++/98480, c++/98704, + c++/99047, c++/99108, c++/99238, c++/99248, c++/99285, c++/99423, + c++/99436, c++/99459, c++/99472, c++/99496, c++/99500, c++/99507, + c++/99508, c++/99509, c++/99528, c++/99601, c++/99613, c++/99617, + fortran/49278, fortran/96983, fortran/97927, fortran/98858, + fortran/99125, fortran/99205, fortran/99345, fortran/99514, + fortran/99545, ipa/99517, libstdc++/99172, libstdc++/99341, + libstdc++/99413, libstdc++/99536, libstdc++/99537, middle-end/97631, + middle-end/98266, middle-end/99502, middle-end/99641, objc++/49070, + sanitizer/98920, target/98092, target/98959, target/99070, + target/99094, target/99102, target/99422, target/99437, target/99454, + target/99463, target/99464, target/99492, target/99504, target/99542, + target/99563, target/99592, target/99600, testsuite/97680, + testsuite/98245, testsuite/99292, testsuite/99498, testsuite/99626, + testsuite/99636, tree-optimization/98834, tree-optimization/99305, + tree-optimization/99489, tree-optimization/99510, + tree-optimization/99523, tree-optimization/99544 + - fix ARM ICE in neon_output_shift_immediate (#1922599, PR target/99593) +- avoid false positive aarch64 -Wpsabi notes in some cases (PR target/91710) +- fix a -fcompare-debug failure caused by C FE bug (PR debug/99230) +- fix up -gdwarf-5 -gsplit-dwarf ranges handling (PR debug/99490) +- fix up handling of > 64 bit constants in dwarf2out (PR debug/99562, + PR debug/66728) +- reject invalid C++ structured bindings that need reference to void + (PR c++/99650) +- include private isl 0.18 in the package instead of relying on old + distro version + +* Sun Mar 7 2021 Jakub Jelinek 11.0.1-0.1 +- update from trunk + - PRs ada/98996, ada/99020, ada/99095, ada/99264, analyzer/96374, + analyzer/99193, bootstrap/92002, bootstrap/98590, c++/82959, + c++/88146, c++/90333, c++/94521, c++/95451, c++/95615, c++/95616, + c++/95675, c++/95822, c++/96078, c++/96330, c++/96443, c++/96474, + c++/96960, c++/97034, c++/97587, c++/98118, c++/98318, c++/98810, + c++/98990, c++/99009, c++/99103, c++/99120, c++/99166, c++/99170, + c++/99176, c++/99213, c++/99245, c++/99251, c++/99287, c++/99294, + c++/99344, c++/99362, c++/99365, c++/99374, c++/99377, c++/99389, + c/99137, c/99275, c/99304, c/99323, c/99324, c/99325, c/99363, + d/99337, debug/66668, debug/99090, debug/99319, fortran/57871, + fortran/99300, fortran/99303, fortran/99355, gcov-profile/97461, + gcov-profile/99105, gcov-profile/99385, gcov-profile/99406, ipa/98078, + ipa/98338, libbacktrace/98818, libfortran/81986, libfortran/99218, + libgomp/98738, libstdc++/99265, libstdc++/99270, libstdc++/99301, + libstdc++/99382, libstdc++/99396, middle-end/93235, middle-end/94655, + middle-end/95757, middle-end/96963, middle-end/97172, + middle-end/97855, middle-end/99276, middle-end/99281, + middle-end/99295, middle-end/99322, other/99288, + rtl-optimization/99376, target/44107, target/48097, target/95798, + target/98996, target/99085, target/99234, target/99271, target/99279, + target/99313, target/99321, target/99381, testsuite/99233, + tree-optimization/80635, tree-optimization/99253 +- fix debug info for __fp16 constants (PR debug/99388) + +* Thu Feb 25 2021 Jakub Jelinek 11.0.0-0.20 +- update from trunk + - PRs analyzer/94596, analyzer/98969, analyzer/99196, c++/94034, c++/94546, + c++/95468, c++/95888, c++/96251, c++/96926, c++/97246, c++/97582, + c++/97742, c++/98718, c++/98741, c++/98988, c++/99023, c++/99030, + c++/99031, c++/99033, c++/99035, c++/99039, c++/99040, c++/99062, + c++/99063, c++/99071, c++/99072, c++/99074, c++/99116, c++/99132, + c++/99150, c++/99153, c++/99174, c++/99208, c/97172, c/99055, c/99136, + c/99224, debug/96997, debug/98755, fortran/98342, fortran/98686, + fortran/98897, fortran/98979, fortran/99010, fortran/99027, + fortran/99043, fortran/99060, fortran/99111, fortran/99124, + fortran/99146, fortran/99171, fortran/99206, fortran/99226, + inline-asm/98096, inline-asm/99123, ipa/97346, ipa/99003, ipa/99029, + ipa/99034, jit/99126, libfortran/95647, libfortran/98825, + libgcc/99236, libstdc++/88881, libstdc++/97549, libstdc++/98389, + libstdc++/99058, libstdc++/99077, libstdc++/99096, libstdc++/99181, + libstdc++/99261, middle-end/38474, middle-end/99007, middle-end/99109, + middle-end/99122, preprocessor/96391, rtl-optimization/96264, + rtl-optimization/98439, rtl-optimization/98791, + rtl-optimization/98872, rtl-optimization/99054, sanitizer/99106, + sanitizer/99168, target/85074, target/96166, target/97417, + target/98491, target/98657, target/98931, target/98998, target/99025, + target/99041, target/99100, target/99104, target/99113, target/99134, + target/99157, testsuite/99173, translation/99167, + tree-optimization/38474, tree-optimization/92879, + tree-optimization/98772, tree-optimization/99002, + tree-optimization/99024, tree-optimization/99026, + tree-optimization/99079, tree-optimization/99142, + tree-optimization/99149, tree-optimization/99165, + tree-optimization/99204, tree-optimization/99220, + tree-optimization/99225 + +* Wed Feb 10 2021 Jakub Jelinek 11.0.0-0.19 +- update from trunk + - PRs analyzer/93355, analyzer/96374, analyzer/98575, analyzer/98918, + c++/20408, c++/84494, c++/90926, c++/95192, c++/96199, c++/96462, + c++/96905, c++/97804, c++/97878, c++/98295, c++/98326, c++/98355, + c++/98531, c++/98570, c++/98717, c++/98802, c++/98835, c++/98899, + c++/98926, c++/98929, c++/98944, c++/98947, c++/98951, c++/98994, + c/97882, c/97932, d/98910, d/98921, debug/98656, driver/98943, + fortran/91862, fortran/98913, libstdc++/70303, libstdc++/99021, + lto/96591, lto/98912, lto/98971, middle-end/97172, middle-end/97487, + middle-end/97971, middle-end/98465, middle-end/98974, + middle-end/99004, preprocessor/98882, rtl-optimization/96015, + target/97510, target/98172, target/98537, target/98743, target/98957, + testsuite/98243, testsuite/98325, tree-optimization/97960, + tree-optimization/98287, tree-optimization/98499, + tree-optimization/98848, tree-optimization/98855, + tree-optimization/98863, tree-optimization/98928, + tree-optimization/98937, tree-optimization/99017 + +* Sat Jan 30 2021 Jakub Jelinek 11.0.0-0.18 +- update from trunk + - PRs ada/98228, bootstrap/98839, c++/33661, c++/88548, c++/94775, + c++/96137, c++/97474, c++/97566, c++/97874, c++/98463, c++/98646, + c++/98770, c++/98841, c++/98843, c++/98847, d/98806, debug/98331, + debug/98811, fortran/67539, fortran/70070, fortran/86470, + fortran/93924, fortran/93925, fortran/96843, fortran/98472, + fortran/98517, libstdc++/66414, lto/85574, middle-end/98726, + middle-end/98807, rtl-optimization/80960, rtl-optimization/97684, + rtl-optimization/98144, rtl-optimization/98863, sanitizer/98828, + target/97701, target/98730, target/98799, target/98827, target/98833, + target/98849, target/98853, testsuite/98771, testsuite/98870, + tree-optimization/97260, tree-optimization/97627, + tree-optimization/98854, tree-optimization/98866 + +* Sat Jan 23 2021 Jakub Jelinek 11.0.0-0.17 +- update from trunk + - PRs ada/98740, c++/41437, c++/58993, c++/71879, c++/82613, c++/95434, + c++/96623, c++/97399, c++/97966, c++/98333, c++/98530, c++/98545, + c++/98624, c++/98659, c++/98744, fortran/96320, fortran/98476, + fortran/98565, fortran/98757, fortran/98763, gcov-profile/98739, + ipa/97673, ipa/98330, ipa/98690, middle-end/98664, middle-end/98773, + middle-end/98793, rtl-optimization/92294, rtl-optimization/98694, + rtl-optimization/98722, rtl-optimization/98777, sanitizer/95693, + target/79251, target/96372, target/96891, target/98065, target/98093, + target/98348, target/98636, testsuite/97301, testsuite/98241, + testsuite/98795, tree-optimization/47059, tree-optimization/90248, + tree-optimization/96674, tree-optimization/98255, + tree-optimization/98535, tree-optimization/98758, + tree-optimization/98766, tree-optimization/98786 + - ensure for empty CUs -gdwarf-5 emits at least the required 0th directory + and filename entry in the .debug_line section (#1919243, PR debug/98796) +- fix aarch64 bug where emitted ubfix insn can't be assembled + (PR target/98681) + +* Wed Jan 20 2021 Jakub Jelinek 11.0.0-0.16 +- fix DWARF5 -g -flto -ffat-lto-objects, so that LTO sections can be stripped + off later (PR debug/98765) +- fix GOMP_task caller stack corruption on s390x +- libgccjit DWARF5 fixes (PR debug/98751) + +* Tue Jan 19 2021 Jakub Jelinek 11.0.0-0.15 +- update from trunk + - PRs debug/98708, debug/98716, ipa/98222, libstdc++/98725, target/97847, + testsuite/97299, testsuite/97494, testsuite/97987, + tree-optimization/96271 + - fix miscompilation of portable signed multiplication overflow check + (#1916576, PR tree-optimization/98727) + - switch to DWARF 5 by default +- fix PRs c++/98672, c++/98687, c++/98742, middle-end/98638, + tree-optimization/98721 + +* Sat Jan 16 2021 Jakub Jelinek 11.0.0-0.14 +- update from trunk + - PRs ada/98595, analyzer/98679, bootstrap/98696, c++/63707, c++/98231, + c++/98372, c++/98538, c++/98591, c++/98626, c++/98642, fortran/98661, + ipa/98652, jit/98586, libgomp/65099, libstdc++/98466, libstdc++/98471, + preprocessor/95253, target/70454, target/71233, target/88836, + target/95905, target/96938, target/98667, target/98671, target/98676, + testsuite/96098, testsuite/96147, tree-optimization/92645, + tree-optimization/96376, tree-optimization/96669, + tree-optimization/96681, tree-optimization/96688, + tree-optimization/96691, tree-optimization/98455, + tree-optimization/98597, tree-optimization/98640, + tree-optimization/98674, tree-optimization/98685 + - fix up pmovzx permutation SSE4.1 patterns (#1916240, PR target/98670) + +* Wed Jan 13 2021 Jakub Jelinek 11.0.0-0.13 +- update from trunk + - PRs analyzer/98628, c++/97284, c++/98481, c++/98556, c++/98611, c++/98620, + c/98592, debug/97714, jit/98615, libstdc++/98613, + rtl-optimization/98603, target/97875, target/97969, target/98612, + testsuite/98225, testsuite/98602, tree-optimization/91403, + tree-optimization/95731, tree-optimization/95852, + tree-optimization/95867, tree-optimization/98526, + tree-optimization/98550, tree-optimization/98629 + - fix ICEs in print_mem_ref (#1915400, #1915437, #1915781, PR c/98597) + +* Sat Jan 9 2021 Jakub Jelinek 11.0.0-0.12 +- update from trunk + - PRs analyzer/97072, analyzer/97074, analyzer/98073, analyzer/98223, + analyzer/98293, analyzer/98564, analyzer/98580, bootstrap/98324, + bootstrap/98506, c++/82099, c++/95768, c++/96045, c++/96504, + c++/97597, c++/98206, c++/98305, c++/98316, c++/98329, c++/98332, + c++/98353, c++/98413, c++/98441, c++/98469, c++/98515, c++/98551, + c/98029, d/98427, fortran/83118, fortran/93701, fortran/93794, + fortran/93833, fortran/97612, fortran/97694, fortran/97723, + fortran/98022, fortran/98458, libstdc++/98384, middle-end/98160, + middle-end/98578, other/98437, rtl-optimization/97144, + rtl-optimization/97978, rtl-optimization/98214, + rtl-optimization/98334, rtl-optimization/98403, target/89057, + target/96793, target/97269, target/98461, target/98482, target/98495, + target/98521, target/98522, target/98567, target/98585, + testsuite/98489, testsuite/98566, tree-optimization/56719, + tree-optimization/94785, tree-optimization/94802, + tree-optimization/94994, tree-optimization/95401, + tree-optimization/95582, tree-optimization/95771, + tree-optimization/96239, tree-optimization/96782, + tree-optimization/96928, tree-optimization/96930, + tree-optimization/98282, tree-optimization/98291, + tree-optimization/98302, tree-optimization/98308, + tree-optimization/98371, tree-optimization/98381, + tree-optimization/98393, tree-optimization/98428, + tree-optimization/98464, tree-optimization/98474, + tree-optimization/98513, tree-optimization/98514, + tree-optimization/98516, tree-optimization/98544, + tree-optimization/98560, tree-optimization/98568 + +* Wed Dec 23 2020 Jakub Jelinek 11.0.0-0.11 +- update from trunk + - PRs bootstrap/98300, bootstrap/98380, bootstrap/98412, c++/67343, + c++/93480, c++/96840, c++/98340, c++/98343, c++/98353, c++/98383, + c/98047, c/98260, d/98067, fortran/83118, fortran/92587, + fortran/96012, fortran/98284, fortran/98307, go/98402, + libstdc++/46447, libstdc++/93151, libstdc++/96083, libstdc++/98319, + libstdc++/98344, libstdc++/98370, libstdc++/98374, libstdc++/98377, + middle-end/98366, other/98400, other/98409, rtl-optimization/98271, + rtl-optimization/98276, rtl-optimization/98289, + rtl-optimization/98347, sanitizer/97868, target/96793, target/98146, + target/98177, target/98280, tree-optimization/96239, + tree-optimization/97750, tree-optimization/98272, + tree-optimization/98279, tree-optimization/98378, + tree-optimization/98407 + +* Thu Dec 17 2020 Jakub Jelinek 11.0.0-0.10 +- apply workaround for profiledbootstrap x86_64 failure +- put g++-mapper-server into the right directory + +* Wed Dec 16 2020 Jakub Jelinek 11.0.0-0.8 +- update from trunk + - PRs ada/98230, bootstrap/98188, c++/57111, c++/59238, c++/68451, + c++/78173, c++/91506, c++/93083, c++/96299, c++/97093, c++/97517, + c++/98043, c++/98103, c++/98122, c++/98126, c++/98130, c++/98187, + c++/98193, c/97981, c/98200, d/98277, fortran/90207, fortran/98016, + fortran/98022, gcov-profile/98273, libstdc++/98108, libstdc++/98226, + lto/98275, middle-end/94600, middle-end/98160, middle-end/98166, + middle-end/98183, middle-end/98190, middle-end/98205, + middle-end/98264, rtl-optimization/97092, rtl-optimization/97421, + rtl-optimization/98212, rtl-optimization/98229, sanitizer/98204, + target/58901, target/66791, target/92469, target/94440, target/95294, + target/96226, target/96470, target/97865, target/97872, target/98100, + target/98147, target/98152, target/98161, target/98162, target/98219, + target/98274, testsuite/95900, testsuite/98123, testsuite/98156, + testsuite/98239, testsuite/98240, testsuite/98242, testsuite/98244, + tree-optimization/95582, tree-optimization/96094, + tree-optimization/96232, tree-optimization/96272, + tree-optimization/96344, tree-optimization/96685, + tree-optimization/97559, tree-optimization/97929, + tree-optimization/98069, tree-optimization/98113, + tree-optimization/98117, tree-optimization/98137, + tree-optimization/98169, tree-optimization/98174, + tree-optimization/98180, tree-optimization/98182, + tree-optimization/98191, tree-optimization/98192, + tree-optimization/98199, tree-optimization/98211, + tree-optimization/98213, tree-optimization/98235, + tree-optimization/98256 + - C++20 modules support + - fix up __patchable_function_entries handling when gcc is configured + against recent binutils (#1907945) +- fix up handling of non-memory VIEW_CONVERT_EXPRs in PRE + (PR tree-optimization/98282) + +* Fri Dec 4 2020 Jakub Jelinek 11.0.0-0.7 +- update from trunk + - PRs bootstrap/97983, c++/80780, c++/90629, c++/93093, c++/97187, + c++/97947, c++/97975, c++/97993, c++/98019, c++/98054, c++/98072, + c++/98104, c++/98107, c++/98115, c++/98116, c/65455, c/92935, c/97880, + c/98087, d/87788, d/87818, d/98025, debug/97989, fortran/95342, + fortran/98010, fortran/98011, fortran/98013, ipa/88702, ipa/98057, + ipa/98075, jit/97867, libgcc/97543, libgcc/97643, libstdc++/65480, + libstdc++/68735, libstdc++/93121, libstdc++/98001, libstdc++/98003, + middle-end/89428, middle-end/92936, middle-end/92940, + middle-end/93195, middle-end/93197, middle-end/94527, + middle-end/97373, middle-end/97595, middle-end/98070, + middle-end/98082, middle-end/98099, other/98027, plugins/98059, + preprocessor/97602, rtl-optimization/97459, rtl-optimization/97777, + rtl-optimization/97954, rtl-optimization/98037, target/96607, + target/96906, target/97642, target/97770, target/97939, target/98063, + target/98079, target/98086, testsuite/98002, testsuite/98036, + testsuite/98085, tree-optimization/14799, tree-optimization/88702, + tree-optimization/96679, tree-optimization/96708, + tree-optimization/97630, tree-optimization/97953, + tree-optimization/97979, tree-optimization/97997, + tree-optimization/98024, tree-optimization/98048, + tree-optimization/98064, tree-optimization/98066, + tree-optimization/98084 + +* Thu Nov 26 2020 Jakub Jelinek 11.0.0-0.6 +- update from trunk + - PRs bootstrap/94982, bootstrap/97622, bootstrap/97933, c++/97899, c/97958, + fortran/85796, libstdc++/67791, libstdc++/97935, libstdc++/97936, + libstdc++/97944, middle-end/97943, middle-end/97956, + rtl-optimization/95862, target/91816, target/97534, target/97950, + tree-optimization/96929, tree-optimization/97849, + tree-optimization/97964 + +* Tue Nov 24 2020 Jakub Jelinek 11.0.0-0.5 +- update from trunk + - PRs c++/94695, c++/97427, c++/97839, c++/97846, c++/97881, c++/97904, + c/95630, d/97889, libstdc++/97948, tree-optimization/95853 + +* Sat Nov 21 2020 Jakub Jelinek 11.0.0-0.4 +- update from trunk + - PRs ada/97805, ada/97859, analyzer/97668, analyzer/97893, bootstrap/57076, + bootstrap/97666, bootstrap/97857, c++/25814, c++/52830, c++/63287, + c++/67453, c++/78209, c++/81660, c++/87765, c++/88115, c++/88982, + c++/89565, c++/90799, c++/91318, c++/93107, c++/93907, c++/95808, + c++/97388, c++/97412, c++/97453, c++/97479, c++/97518, c++/97523, + c++/97632, c++/97663, c++/97670, c++/97675, c++/97762, c++/97790, + c++/97871, c++/97877, c++/97895, c++/97905, c++/97918, c/90628, + c/97748, c/97860, d/97644, d/97842, d/97843, debug/97060, debug/97599, + debug/97718, driver/97574, fortran/90111, fortran/92793, + fortran/94358, fortran/95847, fortran/97652, fortran/97655, + fortran/97768, fortran/97782, ipa/97578, ipa/97660, ipa/97695, + ipa/97698, ipa/97816, jit/87291, libstdc++/55394, libstdc++/66146, + libstdc++/83938, libstdc++/84323, libstdc++/88101, libstdc++/92285, + libstdc++/92546, libstdc++/93421, libstdc++/93456, libstdc++/94971, + libstdc++/95989, libstdc++/96269, libstdc++/96958, libstdc++/97415, + libstdc++/97600, libstdc++/97613, libstdc++/97719, libstdc++/97729, + libstdc++/97731, libstdc++/97758, libstdc++/97798, libstdc++/97828, + libstdc++/97869, lto/97290, lto/97508, middle-end/85811, + middle-end/95673, middle-end/97267, middle-end/97556, + middle-end/97579, middle-end/97840, middle-end/97862, + middle-end/97879, objc/77404, objc/90707, objc/97854, other/97911, + pch/86674, pch/97593, preprocessor/97858, rtl-optimization/92180, + rtl-optimization/97705, sanitizer/95634, target/31799, target/85486, + target/91489, target/93449, target/96307, target/96770, target/96791, + target/96933, target/96967, target/96998, target/97140, target/97194, + target/97205, target/97326, target/97528, target/97532, target/97540, + target/97638, target/97682, target/97685, target/97715, target/97726, + target/97727, target/97730, target/97870, target/97873, + testsuite/80219, testsuite/85303, testsuite/97117, testsuite/97688, + testsuite/97788, testsuite/97797, testsuite/97803, + tree-optimization/80928, tree-optimization/83072, + tree-optimization/91029, tree-optimization/93781, + tree-optimization/94406, tree-optimization/96671, + tree-optimization/96789, tree-optimization/97223, + tree-optimization/97424, tree-optimization/97558, + tree-optimization/97609, tree-optimization/97623, + tree-optimization/97626, tree-optimization/97633, + tree-optimization/97650, tree-optimization/97678, + tree-optimization/97690, tree-optimization/97693, + tree-optimization/97706, tree-optimization/97709, + tree-optimization/97721, tree-optimization/97725, + tree-optimization/97732, tree-optimization/97733, + tree-optimization/97736, tree-optimization/97737, + tree-optimization/97741, tree-optimization/97746, + tree-optimization/97753, tree-optimization/97760, + tree-optimization/97761, tree-optimization/97764, + tree-optimization/97765, tree-optimization/97767, + tree-optimization/97769, tree-optimization/97780, + tree-optimization/97806, tree-optimization/97812, + tree-optimization/97830, tree-optimization/97835, + tree-optimization/97838, tree-optimization/97886, + tree-optimization/97888, tree-optimization/97897, + tree-optimization/97901 +- add BuildRequires: make and Requires: make, the latter for -flto reasons + +* Thu Oct 29 2020 Jakub Jelinek 11.0.0-0.3 +- update from trunk + - PRs ada/97504, analyzer/96608, analyzer/97489, analyzer/97514, + analyzer/97568, analyzer/97608, bootstrap/97451, c++/82239, c++/86773, + c++/91741, c++/94799, c++/95132, c++/96241, c++/96575, c++/96675, + c++/96742, c++/97328, c++/97438, c++/97511, c++/97573, c/94722, + c/97463, fortran/45516, fortran/97454, gcov-profile/97461, ipa/97445, + ipa/97576, ipa/97586, libstdc++/94268, libstdc++/95592, + libstdc++/95609, libstdc++/95917, libstdc++/96713, libstdc++/97512, + libstdc++/97570, lto/96680, lto/97524, middle-end/92942, + middle-end/97521, middle-end/97552, rtl-optimization/97249, + rtl-optimization/97439, rtl-optimization/97497, sanitizer/97414, + target/87767, target/95151, target/95458, target/97360, target/97502, + target/97506, target/97535, testsuite/81690, testsuite/97590, + tree-optimization/66552, tree-optimization/97164, + tree-optimization/97360, tree-optimization/97456, + tree-optimization/97457, tree-optimization/97466, + tree-optimization/97467, tree-optimization/97486, + tree-optimization/97488, tree-optimization/97496, + tree-optimization/97500, tree-optimization/97501, + tree-optimization/97503, tree-optimization/97505, + tree-optimization/97515, tree-optimization/97520, + tree-optimization/97538, tree-optimization/97539, + tree-optimization/97546, tree-optimization/97555, + tree-optimization/97560, tree-optimization/97567, + tree-optimization/97615 +- for ELN default to -march=x86-64-v2 for x86 64-bit compilation and + for s390x to -march=z13 -mtune=arch13 + +* Mon Oct 19 2020 Jakub Jelinek 11.0.0-0.2 - new package diff --git a/gcc11-Wno-format-security.patch b/gcc11-Wno-format-security.patch new file mode 100644 index 0000000..974ea44 --- /dev/null +++ b/gcc11-Wno-format-security.patch @@ -0,0 +1,27 @@ +2017-02-25 Jakub Jelinek + + * configure.ac: When adding -Wno-format, also add -Wno-format-security. + * configure: Regenerated. + +--- gcc/configure.ac.jj 2017-02-13 12:20:53.000000000 +0100 ++++ gcc/configure.ac 2017-02-25 12:42:32.859175403 +0100 +@@ -480,7 +480,7 @@ AC_ARG_ENABLE(build-format-warnings, + AS_HELP_STRING([--disable-build-format-warnings],[don't use -Wformat while building GCC]), + [],[enable_build_format_warnings=yes]) + AS_IF([test $enable_build_format_warnings = no], +- [wf_opt=-Wno-format],[wf_opt=]) ++ [wf_opt="-Wno-format -Wno-format-security"],[wf_opt=]) + ACX_PROG_CXX_WARNING_OPTS( + m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings ], + [-Wcast-qual -Wno-error=format-diag $wf_opt])), +--- gcc/configure.jj 2017-02-13 12:20:52.000000000 +0100 ++++ gcc/configure 2017-02-25 12:42:50.041946391 +0100 +@@ -6647,7 +6647,7 @@ else + fi + + if test $enable_build_format_warnings = no; then : +- wf_opt=-Wno-format ++ wf_opt="-Wno-format -Wno-format-security" + else + wf_opt= + fi diff --git a/gcc16-d-shared-libphobos.patch b/gcc11-d-shared-libphobos.patch similarity index 100% rename from gcc16-d-shared-libphobos.patch rename to gcc11-d-shared-libphobos.patch diff --git a/gcc11-foffload-default.patch b/gcc11-foffload-default.patch new file mode 100644 index 0000000..d1aae64 --- /dev/null +++ b/gcc11-foffload-default.patch @@ -0,0 +1,116 @@ +2019-01-17 Jakub Jelinek + + * gcc.c (offload_targets_default): New variable. + (process_command): Set it if -foffload is defaulted. + (driver::maybe_putenv_OFFLOAD_TARGETS): Add OFFLOAD_TARGET_DEFAULT=1 + into environment if -foffload has been defaulted. + * lto-wrapper.c (OFFLOAD_TARGET_DEFAULT_ENV): Define. + (compile_offload_image): If OFFLOAD_TARGET_DEFAULT + is in the environment, don't fail if corresponding mkoffload + can't be found. + (compile_images_for_offload_targets): Likewise. Free and clear + offload_names if no valid offload is found. +libgomp/ + * target.c (gomp_load_plugin_for_device): If a plugin can't be + dlopened, assume it has no devices silently. + +--- gcc/gcc.c.jj 2017-01-17 10:28:40.000000000 +0100 ++++ gcc/gcc.c 2017-01-20 16:26:29.649962902 +0100 +@@ -319,6 +319,10 @@ static const char *spec_host_machine = D + + static char *offload_targets = NULL; + ++/* Set to true if -foffload has not been used and offload_targets ++ is set to the configured in default. */ ++static bool offload_targets_default; ++ + /* Nonzero if cross-compiling. + When -b is used, the value comes from the `specs' file. */ + +@@ -4828,7 +4832,10 @@ process_command (unsigned int decoded_op + /* If the user didn't specify any, default to all configured offload + targets. */ + if (ENABLE_OFFLOADING && offload_targets == NULL) +- handle_foffload_option (OFFLOAD_TARGETS); ++ { ++ handle_foffload_option (OFFLOAD_TARGETS); ++ offload_targets_default = true; ++ } + + /* Handle -gtoggle as it would later in toplev.c:process_options to + make the debug-level-gt spec function work as expected. */ +@@ -8494,6 +8501,8 @@ driver::maybe_putenv_OFFLOAD_TARGETS () + obstack_grow (&collect_obstack, offload_targets, + strlen (offload_targets) + 1); + xputenv (XOBFINISH (&collect_obstack, char *)); ++ if (offload_targets_default) ++ xputenv ("OFFLOAD_TARGET_DEFAULT=1"); + } + + free (offload_targets); +--- gcc/lto-wrapper.c.jj 2017-01-01 12:45:34.000000000 +0100 ++++ gcc/lto-wrapper.c 2017-01-20 16:34:18.294016997 +0100 +@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. + /* Environment variable, used for passing the names of offload targets from GCC + driver to lto-wrapper. */ + #define OFFLOAD_TARGET_NAMES_ENV "OFFLOAD_TARGET_NAMES" ++#define OFFLOAD_TARGET_DEFAULT_ENV "OFFLOAD_TARGET_DEFAULT" + + /* By default there is no special suffix for target executables. */ + #ifdef TARGET_EXECUTABLE_SUFFIX +@@ -906,6 +907,12 @@ compile_offload_image (const char *targe + break; + } + ++ if (!compiler && getenv (OFFLOAD_TARGET_DEFAULT_ENV)) ++ { ++ free_array_of_ptrs ((void **) paths, n_paths); ++ return NULL; ++ } ++ + if (!compiler) + fatal_error (input_location, + "could not find %s in %s (consider using %<-B%>)", +@@ -975,6 +982,7 @@ compile_images_for_offload_targets (unsi + if (!target_names) + return; + unsigned num_targets = parse_env_var (target_names, &names, NULL); ++ int next_name_entry = 0; + + const char *compiler_path = getenv ("COMPILER_PATH"); + if (!compiler_path) +@@ -985,13 +993,19 @@ compile_images_for_offload_targets (unsi + offload_names = XCNEWVEC (char *, num_targets + 1); + for (unsigned i = 0; i < num_targets; i++) + { +- offload_names[i] ++ offload_names[next_name_entry] + = compile_offload_image (names[i], compiler_path, in_argc, in_argv, + compiler_opts, compiler_opt_count, + linker_opts, linker_opt_count); +- if (!offload_names[i]) +- fatal_error (input_location, +- "problem with building target image for %s", names[i]); ++ if (!offload_names[next_name_entry]) ++ continue; ++ next_name_entry++; ++ } ++ ++ if (next_name_entry == 0) ++ { ++ free (offload_names); ++ offload_names = NULL; + } + + out: +--- libgomp/target.c.jj 2017-01-01 12:45:52.000000000 +0100 ++++ libgomp/target.c 2017-01-20 20:12:13.756710875 +0100 +@@ -2356,7 +2356,7 @@ gomp_load_plugin_for_device (struct gomp + + void *plugin_handle = dlopen (plugin_name, RTLD_LAZY); + if (!plugin_handle) +- goto dl_fail; ++ return 0; + + /* Check if all required functions are available in the plugin and store + their handlers. None of the symbols can legitimately be NULL, diff --git a/gcc11-fortran-fdec-add-missing-indexes.patch b/gcc11-fortran-fdec-add-missing-indexes.patch new file mode 100644 index 0000000..d707b94 --- /dev/null +++ b/gcc11-fortran-fdec-add-missing-indexes.patch @@ -0,0 +1,181 @@ +From 7001d522d0273658d9e1fb12ca104d56bfcae34d Mon Sep 17 00:00:00 2001 +From: Mark Eggleston +Date: Fri, 22 Jan 2021 15:06:08 +0000 +Subject: [PATCH 10/10] Fill in missing array dimensions using the lower bound + +Use -fdec-add-missing-indexes to enable feature. Also enabled by fdec. +--- + gcc/fortran/lang.opt | 8 ++++++++ + gcc/fortran/options.c | 1 + + gcc/fortran/resolve.c | 24 ++++++++++++++++++++++++ + gcc/testsuite/gfortran.dg/array_6.f90 | 23 +++++++++++++++++++++++ + gcc/testsuite/gfortran.dg/array_7.f90 | 23 +++++++++++++++++++++++ + gcc/testsuite/gfortran.dg/array_8.f90 | 23 +++++++++++++++++++++++ + 6 files changed, 102 insertions(+) + create mode 100644 gcc/testsuite/gfortran.dg/array_6.f90 + create mode 100644 gcc/testsuite/gfortran.dg/array_7.f90 + create mode 100644 gcc/testsuite/gfortran.dg/array_8.f90 + +diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt +index 019c798cf09..f27de88ea3f 100644 +--- a/gcc/fortran/lang.opt ++++ b/gcc/fortran/lang.opt +@@ -281,6 +281,10 @@ Wmissing-include-dirs + Fortran + ; Documented in C/C++ + ++Wmissing-index ++Fortran Var(warn_missing_index) Warning LangEnabledBy(Fortran,Wall) ++Warn that the lower bound of a missing index will be used. ++ + Wuse-without-only + Fortran Var(warn_use_without_only) Warning + Warn about USE statements that have no ONLY qualifier. +@@ -460,6 +464,10 @@ fdec + Fortran Var(flag_dec) + Enable all DEC language extensions. + ++fdec-add-missing-indexes ++Fortran Var(flag_dec_add_missing_indexes) ++Enable the addition of missing indexes using their lower bounds. ++ + fdec-blank-format-item + Fortran Var(flag_dec_blank_format_item) + Enable the use of blank format items in format strings. +diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c +index 050f56fdc25..c3b2822685d 100644 +--- a/gcc/fortran/options.c ++++ b/gcc/fortran/options.c +@@ -84,6 +84,7 @@ set_dec_flags (int value) + SET_BITFLAG (flag_dec_non_logical_if, value, value); + SET_BITFLAG (flag_dec_promotion, value, value); + SET_BITFLAG (flag_dec_sequence, value, value); ++ SET_BITFLAG (flag_dec_add_missing_indexes, value, value); + } + + /* Finalize DEC flags. */ +diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c +index fe7d0cc5944..0efeedab46e 100644 +--- a/gcc/fortran/resolve.c ++++ b/gcc/fortran/resolve.c +@@ -4806,6 +4806,30 @@ compare_spec_to_ref (gfc_array_ref *ar) + if (ar->type == AR_FULL) + return true; + ++ if (flag_dec_add_missing_indexes && as->rank > ar->dimen) ++ { ++ /* Add in the missing dimensions, assuming they are the lower bound ++ of that dimension if not specified. */ ++ int j; ++ if (warn_missing_index) ++ { ++ gfc_warning (OPT_Wmissing_index, "Using the lower bound for " ++ "unspecified dimensions in array reference at %L", ++ &ar->where); ++ } ++ /* Other parts of the code iterate ar->start and ar->end from 0 to ++ ar->dimen, so it is safe to assume slots from ar->dimen upwards ++ are unused (i.e. there are no gaps; the specified indexes are ++ contiguous and start at zero. */ ++ for(j = ar->dimen; j <= as->rank; j++) ++ { ++ ar->start[j] = gfc_copy_expr (as->lower[j]); ++ ar->end[j] = gfc_copy_expr (as->lower[j]); ++ ar->dimen_type[j] = DIMEN_ELEMENT; ++ } ++ ar->dimen = as->rank; ++ } ++ + if (as->rank != ar->dimen) + { + gfc_error ("Rank mismatch in array reference at %L (%d/%d)", +diff --git a/gcc/testsuite/gfortran.dg/array_6.f90 b/gcc/testsuite/gfortran.dg/array_6.f90 +new file mode 100644 +index 00000000000..5c26e18ab3e +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/array_6.f90 +@@ -0,0 +1,23 @@ ++! { dg-do run } ++! { dg-options "-fdec -Wmissing-index" }! ++! Checks that under-specified arrays (referencing arrays with fewer ++! dimensions than the array spec) generates a warning. ++! ++! Contributed by Jim MacArthur ++! Updated by Mark Eggleston ++! ++ ++program under_specified_array ++ integer chessboard(8,8) ++ integer chessboard3d(8,8,3:5) ++ chessboard(3,1) = 5 ++ chessboard(3,2) = 55 ++ chessboard3d(4,1,3) = 6 ++ chessboard3d(4,1,4) = 66 ++ chessboard3d(4,4,3) = 7 ++ chessboard3d(4,4,4) = 77 ++ ++ if (chessboard(3).ne.5) stop 1 ! { dg-warning "Using the lower bound for unspecified dimensions in array reference" } ++ if (chessboard3d(4).ne.6) stop 2 ! { dg-warning "Using the lower bound for unspecified dimensions in array reference" } ++ if (chessboard3d(4,4).ne.7) stop 3 ! { dg-warning "Using the lower bound for unspecified dimensions in array reference" } ++end program +diff --git a/gcc/testsuite/gfortran.dg/array_7.f90 b/gcc/testsuite/gfortran.dg/array_7.f90 +new file mode 100644 +index 00000000000..5588a5bd02d +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/array_7.f90 +@@ -0,0 +1,23 @@ ++! { dg-do run } ++! { dg-options "-fdec-add-missing-indexes -Wmissing-index" }! ++! Checks that under-specified arrays (referencing arrays with fewer ++! dimensions than the array spec) generates a warning. ++! ++! Contributed by Jim MacArthur ++! Updated by Mark Eggleston ++! ++ ++program under_specified_array ++ integer chessboard(8,8) ++ integer chessboard3d(8,8,3:5) ++ chessboard(3,1) = 5 ++ chessboard(3,2) = 55 ++ chessboard3d(4,1,3) = 6 ++ chessboard3d(4,1,4) = 66 ++ chessboard3d(4,4,3) = 7 ++ chessboard3d(4,4,4) = 77 ++ ++ if (chessboard(3).ne.5) stop 1 ! { dg-warning "Using the lower bound for unspecified dimensions in array reference" } ++ if (chessboard3d(4).ne.6) stop 2 ! { dg-warning "Using the lower bound for unspecified dimensions in array reference" } ++ if (chessboard3d(4,4).ne.7) stop 3 ! { dg-warning "Using the lower bound for unspecified dimensions in array reference" } ++end program +diff --git a/gcc/testsuite/gfortran.dg/array_8.f90 b/gcc/testsuite/gfortran.dg/array_8.f90 +new file mode 100644 +index 00000000000..f0d2ef5e37d +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/array_8.f90 +@@ -0,0 +1,23 @@ ++! { dg-do compile } ++! { dg-options "-fdec -fno-dec-add-missing-indexes" }! ++! Checks that under-specified arrays (referencing arrays with fewer ++! dimensions than the array spec) generates a warning. ++! ++! Contributed by Jim MacArthur ++! Updated by Mark Eggleston ++! ++ ++program under_specified_array ++ integer chessboard(8,8) ++ integer chessboard3d(8,8,3:5) ++ chessboard(3,1) = 5 ++ chessboard(3,2) = 55 ++ chessboard3d(4,1,3) = 6 ++ chessboard3d(4,1,4) = 66 ++ chessboard3d(4,4,3) = 7 ++ chessboard3d(4,4,4) = 77 ++ ++ if (chessboard(3).ne.5) stop 1 ! { dg-error "Rank mismatch" } ++ if (chessboard3d(4).ne.6) stop 2 ! { dg-error "Rank mismatch" } ++ if (chessboard3d(4,4).ne.7) stop 3 ! { dg-error "Rank mismatch" } ++end program +-- +2.27.0 + diff --git a/gcc16-fortran-fdec-duplicates.patch b/gcc11-fortran-fdec-duplicates.patch similarity index 95% rename from gcc16-fortran-fdec-duplicates.patch rename to gcc11-fortran-fdec-duplicates.patch index 5298baa..b5d1104 100644 --- a/gcc16-fortran-fdec-duplicates.patch +++ b/gcc11-fortran-fdec-duplicates.patch @@ -9,8 +9,8 @@ Some fixes by Jim MacArthur Addition of -fdec-duplicates by Mark Eggleston --- gcc/fortran/lang.opt | 4 ++++ - gcc/fortran/options.cc | 1 + - gcc/fortran/symbol.cc | 21 +++++++++++++++++-- + gcc/fortran/options.c | 1 + + gcc/fortran/symbol.c | 21 +++++++++++++++++-- .../gfortran.dg/duplicate_type_4.f90 | 13 ++++++++++++ .../gfortran.dg/duplicate_type_5.f90 | 13 ++++++++++++ .../gfortran.dg/duplicate_type_6.f90 | 13 ++++++++++++ @@ -40,10 +40,10 @@ index 2b1977c523b..52bd522051e 100644 fdec-include Fortran Var(flag_dec_include) Enable legacy parsing of INCLUDE as statement. -diff --git a/gcc/fortran/options.cc b/gcc/fortran/options.cc +diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index 3a0b98bf1ec..f19ba87f8a0 100644 ---- a/gcc/fortran/options.cc -+++ b/gcc/fortran/options.cc +--- a/gcc/fortran/options.c ++++ b/gcc/fortran/options.c @@ -77,6 +77,7 @@ set_dec_flags (int value) SET_BITFLAG (flag_dec_format_defaults, value, value); SET_BITFLAG (flag_dec_blank_format_item, value, value); @@ -52,10 +52,10 @@ index 3a0b98bf1ec..f19ba87f8a0 100644 } /* Finalize DEC flags. */ -diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc +diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 3b988d1be22..9843175cc2a 100644 ---- a/gcc/fortran/symbol.cc -+++ b/gcc/fortran/symbol.cc +--- a/gcc/fortran/symbol.c ++++ b/gcc/fortran/symbol.c @@ -1995,6 +1995,8 @@ gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus *where) if (sym->attr.result && type == BT_UNKNOWN && sym->ns->proc_name) type = sym->ns->proc_name->ts.type; diff --git a/gcc11-fortran-fdec-ichar.patch b/gcc11-fortran-fdec-ichar.patch new file mode 100644 index 0000000..e7b0522 --- /dev/null +++ b/gcc11-fortran-fdec-ichar.patch @@ -0,0 +1,78 @@ +From f883ac209b0feea860354cb4ef7ff06dc8063fab Mon Sep 17 00:00:00 2001 +From: Mark Eggleston +Date: Fri, 22 Jan 2021 12:53:35 +0000 +Subject: [PATCH 03/10] Allow more than one character as argument to ICHAR + +Use -fdec to enable. +--- + gcc/fortran/check.c | 2 +- + gcc/fortran/simplify.c | 4 ++-- + .../gfortran.dg/dec_ichar_with_string_1.f | 21 +++++++++++++++++++ + 3 files changed, 24 insertions(+), 3 deletions(-) + create mode 100644 gcc/testsuite/gfortran.dg/dec_ichar_with_string_1.f + +diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c +index 82db8e4e1b2..623c1cc470e 100644 +--- a/gcc/fortran/check.c ++++ b/gcc/fortran/check.c +@@ -3157,7 +3157,7 @@ gfc_check_ichar_iachar (gfc_expr *c, gfc_expr *kind) + else + return true; + +- if (i != 1) ++ if (i != 1 && !flag_dec) + { + gfc_error ("Argument of %s at %L must be of length one", + gfc_current_intrinsic, &c->where); +diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c +index 23317a2e2d9..9900572424f 100644 +--- a/gcc/fortran/simplify.c ++++ b/gcc/fortran/simplify.c +@@ -3261,7 +3261,7 @@ gfc_simplify_iachar (gfc_expr *e, gfc_expr *kind) + if (e->expr_type != EXPR_CONSTANT) + return NULL; + +- if (e->value.character.length != 1) ++ if (e->value.character.length != 1 && !flag_dec) + { + gfc_error ("Argument of IACHAR at %L must be of length one", &e->where); + return &gfc_bad_expr; +@@ -3459,7 +3459,7 @@ gfc_simplify_ichar (gfc_expr *e, gfc_expr *kind) + if (e->expr_type != EXPR_CONSTANT) + return NULL; + +- if (e->value.character.length != 1) ++ if (e->value.character.length != 1 && !flag_dec) + { + gfc_error ("Argument of ICHAR at %L must be of length one", &e->where); + return &gfc_bad_expr; +diff --git a/gcc/testsuite/gfortran.dg/dec_ichar_with_string_1.f b/gcc/testsuite/gfortran.dg/dec_ichar_with_string_1.f +new file mode 100644 +index 00000000000..85efccecc0f +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_ichar_with_string_1.f +@@ -0,0 +1,21 @@ ++! { dg-do run } ++! { dg-options "-fdec" } ++! ++! Test ICHAR and IACHAR with more than one character as argument ++! ++! Test case contributed by Jim MacArthur ++! Modified by Mark Eggleston ++! ++ PROGRAM ichar_more_than_one_character ++ CHARACTER*4 st/'Test'/ ++ INTEGER i ++ ++ i = ICHAR(st) ++ if (i.NE.84) STOP 1 ++ i = IACHAR(st) ++ if (i.NE.84) STOP 2 ++ i = ICHAR('Test') ++ if (i.NE.84) STOP 3 ++ i = IACHAR('Test') ++ if (i.NE.84) STOP 4 ++ END +-- +2.27.0 + diff --git a/gcc11-fortran-fdec-non-integer-index.patch b/gcc11-fortran-fdec-non-integer-index.patch new file mode 100644 index 0000000..074df3b --- /dev/null +++ b/gcc11-fortran-fdec-non-integer-index.patch @@ -0,0 +1,158 @@ +From 67aef262311d6a746786ee0f59748ccaa7e1e711 Mon Sep 17 00:00:00 2001 +From: Mark Eggleston +Date: Fri, 22 Jan 2021 13:09:54 +0000 +Subject: [PATCH 04/10] Allow non-integer substring indexes + +Use -fdec-non-integer-index compiler flag to enable. Also enabled by -fdec. +--- + gcc/fortran/lang.opt | 4 ++++ + gcc/fortran/options.c | 1 + + gcc/fortran/resolve.c | 20 +++++++++++++++++++ + .../dec_not_integer_substring_indexes_1.f | 18 +++++++++++++++++ + .../dec_not_integer_substring_indexes_2.f | 18 +++++++++++++++++ + .../dec_not_integer_substring_indexes_3.f | 18 +++++++++++++++++ + 6 files changed, 79 insertions(+) + create mode 100644 gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_1.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_2.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_3.f + +diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt +index c4da248f07c..d527c106bd6 100644 +--- a/gcc/fortran/lang.opt ++++ b/gcc/fortran/lang.opt +@@ -489,6 +489,10 @@ fdec-math + Fortran Var(flag_dec_math) + Enable legacy math intrinsics for compatibility. + ++fdec-non-integer-index ++Fortran Var(flag_dec_non_integer_index) ++Enable support for non-integer substring indexes. ++ + fdec-structure + Fortran Var(flag_dec_structure) + Enable support for DEC STRUCTURE/RECORD. +diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c +index f19ba87f8a0..9a042f64881 100644 +--- a/gcc/fortran/options.c ++++ b/gcc/fortran/options.c +@@ -78,6 +78,7 @@ set_dec_flags (int value) + SET_BITFLAG (flag_dec_blank_format_item, value, value); + SET_BITFLAG (flag_dec_char_conversions, value, value); + SET_BITFLAG (flag_dec_duplicates, value, value); ++ SET_BITFLAG (flag_dec_non_integer_index, value, value); + } + + /* Finalize DEC flags. */ +diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c +index 4b90cb59902..bc0df0fdb99 100644 +--- a/gcc/fortran/resolve.c ++++ b/gcc/fortran/resolve.c +@@ -5131,6 +5131,16 @@ gfc_resolve_substring (gfc_ref *ref, bool *equal_length) + if (!gfc_resolve_expr (ref->u.ss.start)) + return false; + ++ /* In legacy mode, allow non-integer string indexes by converting */ ++ if (flag_dec_non_integer_index && ref->u.ss.start->ts.type != BT_INTEGER ++ && gfc_numeric_ts (&ref->u.ss.start->ts)) ++ { ++ gfc_typespec t; ++ t.type = BT_INTEGER; ++ t.kind = ref->u.ss.start->ts.kind; ++ gfc_convert_type_warn (ref->u.ss.start, &t, 2, 1); ++ } ++ + if (ref->u.ss.start->ts.type != BT_INTEGER) + { + gfc_error ("Substring start index at %L must be of type INTEGER", +@@ -5160,6 +5170,16 @@ gfc_resolve_substring (gfc_ref *ref, bool *equal_length) + if (!gfc_resolve_expr (ref->u.ss.end)) + return false; + ++ /* Non-integer string index endings, as for start */ ++ if (flag_dec_non_integer_index && ref->u.ss.end->ts.type != BT_INTEGER ++ && gfc_numeric_ts (&ref->u.ss.end->ts)) ++ { ++ gfc_typespec t; ++ t.type = BT_INTEGER; ++ t.kind = ref->u.ss.end->ts.kind; ++ gfc_convert_type_warn (ref->u.ss.end, &t, 2, 1); ++ } ++ + if (ref->u.ss.end->ts.type != BT_INTEGER) + { + gfc_error ("Substring end index at %L must be of type INTEGER", +diff --git a/gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_1.f b/gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_1.f +new file mode 100644 +index 00000000000..0be28abaa4b +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_1.f +@@ -0,0 +1,18 @@ ++! { dg-do run } ++! { dg-options "-fdec" } ++! ++! Test not integer substring indexes ++! ++! Test case contributed by Mark Eggleston ++! ++ PROGRAM not_integer_substring_indexes ++ CHARACTER*5 st/'Tests'/ ++ REAL ir/1.0/ ++ REAL ir2/4.0/ ++ ++ if (st(ir:4).ne.'Test') stop 1 ++ if (st(1:ir2).ne.'Test') stop 2 ++ if (st(1.0:4).ne.'Test') stop 3 ++ if (st(1:4.0).ne.'Test') stop 4 ++ if (st(2.5:4).ne.'est') stop 5 ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_2.f b/gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_2.f +new file mode 100644 +index 00000000000..3cf05296d0c +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_2.f +@@ -0,0 +1,18 @@ ++! { dg-do run } ++! { dg-options "-fdec-non-integer-index" } ++! ++! Test not integer substring indexes ++! ++! Test case contributed by Mark Eggleston ++! ++ PROGRAM not_integer_substring_indexes ++ CHARACTER*5 st/'Tests'/ ++ REAL ir/1.0/ ++ REAL ir2/4.0/ ++ ++ if (st(ir:4).ne.'Test') stop 1 ++ if (st(1:ir2).ne.'Test') stop 2 ++ if (st(1.0:4).ne.'Test') stop 3 ++ if (st(1:4.0).ne.'Test') stop 4 ++ if (st(2.5:4).ne.'est') stop 5 ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_3.f b/gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_3.f +new file mode 100644 +index 00000000000..703de995897 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_not_integer_substring_indexes_3.f +@@ -0,0 +1,18 @@ ++! { dg-do compile } ++! { dg-options "-fdec -fno-dec-non-integer-index" } ++! ++! Test not integer substring indexes ++! ++! Test case contributed by Mark Eggleston ++! ++ PROGRAM not_integer_substring_indexes ++ CHARACTER*5 st/'Tests'/ ++ REAL ir/1.0/ ++ REAL ir2/4.0/ ++ ++ if (st(ir:4).ne.'Test') stop 1 ! { dg-error "Substring start index" } ++ if (st(1:ir2).ne.'Test') stop 2 ! { dg-error "Substring end index" } ++ if (st(1.0:4).ne.'Test') stop 3 ! { dg-error "Substring start index" } ++ if (st(1:4.0).ne.'Test') stop 4 ! { dg-error "Substring end index" } ++ if (st(2.5:4).ne.'est') stop 5 ! { dg-error "Substring start index" } ++ END +-- +2.27.0 + diff --git a/gcc11-fortran-fdec-non-logical-if.patch b/gcc11-fortran-fdec-non-logical-if.patch new file mode 100644 index 0000000..0133d23 --- /dev/null +++ b/gcc11-fortran-fdec-non-logical-if.patch @@ -0,0 +1,378 @@ +From cc87ddb841017bb0976b05091733609ee17d7f05 Mon Sep 17 00:00:00 2001 +From: Mark Eggleston +Date: Fri, 22 Jan 2021 13:15:17 +0000 +Subject: [PATCH 07/10] Allow non-logical expressions in IF statements + +Use -fdec-non-logical-if to enable feature. Also enabled using -fdec. +--- + gcc/fortran/lang.opt | 4 ++ + gcc/fortran/options.c | 1 + + gcc/fortran/resolve.c | 60 ++++++++++++++++--- + ...gical_expressions_if_statements_blocks_1.f | 25 ++++++++ + ...gical_expressions_if_statements_blocks_2.f | 25 ++++++++ + ...gical_expressions_if_statements_blocks_3.f | 25 ++++++++ + ...gical_expressions_if_statements_blocks_4.f | 45 ++++++++++++++ + ...gical_expressions_if_statements_blocks_5.f | 45 ++++++++++++++ + ...gical_expressions_if_statements_blocks_6.f | 45 ++++++++++++++ + 9 files changed, 266 insertions(+), 9 deletions(-) + create mode 100644 gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_1.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_2.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_3.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_4.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_5.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_6.f + +diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt +index 4a269ebb22d..d886c2f33ed 100644 +--- a/gcc/fortran/lang.opt ++++ b/gcc/fortran/lang.opt +@@ -497,6 +497,10 @@ fdec-override-kind + Fortran Var(flag_dec_override_kind) + Enable support for per variable kind specification. + ++fdec-non-logical-if ++Fortran Var(flag_dec_non_logical_if) ++Enable support for non-logical expressions in if statements. ++ + fdec-old-init + Fortran Var(flag_dec_old_init) + Enable support for old style initializers in derived types. +diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c +index edbab483b36..a946c86790a 100644 +--- a/gcc/fortran/options.c ++++ b/gcc/fortran/options.c +@@ -81,6 +81,7 @@ set_dec_flags (int value) + SET_BITFLAG (flag_dec_non_integer_index, value, value); + SET_BITFLAG (flag_dec_old_init, value, value); + SET_BITFLAG (flag_dec_override_kind, value, value); ++ SET_BITFLAG (flag_dec_non_logical_if, value, value); + } + + /* Finalize DEC flags. */ +diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c +index bc0df0fdb99..07dd039f3bf 100644 +--- a/gcc/fortran/resolve.c ++++ b/gcc/fortran/resolve.c +@@ -10789,10 +10789,31 @@ gfc_resolve_blocks (gfc_code *b, gfc_namespace *ns) + switch (b->op) + { + case EXEC_IF: +- if (t && b->expr1 != NULL +- && (b->expr1->ts.type != BT_LOGICAL || b->expr1->rank != 0)) +- gfc_error ("IF clause at %L requires a scalar LOGICAL expression", +- &b->expr1->where); ++ if (t && b->expr1 != NULL) ++ { ++ if (flag_dec_non_logical_if && b->expr1->ts.type != BT_LOGICAL) ++ { ++ gfc_expr* cast; ++ cast = gfc_ne (b->expr1, ++ gfc_get_int_expr (1, &gfc_current_locus, 0), ++ INTRINSIC_NE); ++ if (cast == NULL) ++ gfc_internal_error ("gfc_resolve_blocks(): Failed to cast " ++ "to LOGICAL in IF"); ++ b->expr1 = cast; ++ if (warn_conversion_extra) ++ { ++ gfc_warning (OPT_Wconversion_extra, "Non-LOGICAL type in" ++ " IF statement condition %L will be true if" ++ " it evaluates to nonzero", ++ &b->expr1->where); ++ } ++ } ++ ++ if ((b->expr1->ts.type != BT_LOGICAL || b->expr1->rank != 0)) ++ gfc_error ("IF clause at %L requires a scalar LOGICAL " ++ "expression", &b->expr1->where); ++ } + break; + + case EXEC_WHERE: +@@ -12093,11 +12114,32 @@ start: + break; + + case EXEC_IF: +- if (t && code->expr1 != NULL +- && (code->expr1->ts.type != BT_LOGICAL +- || code->expr1->rank != 0)) +- gfc_error ("IF clause at %L requires a scalar LOGICAL expression", +- &code->expr1->where); ++ if (t && code->expr1 != NULL) ++ { ++ if (flag_dec_non_logical_if ++ && code->expr1->ts.type != BT_LOGICAL) ++ { ++ gfc_expr* cast; ++ cast = gfc_ne (code->expr1, ++ gfc_get_int_expr (1, &gfc_current_locus, 0), ++ INTRINSIC_NE); ++ if (cast == NULL) ++ gfc_internal_error ("gfc_resolve_code(): Failed to cast " ++ "to LOGICAL in IF"); ++ code->expr1 = cast; ++ if (warn_conversion_extra) ++ { ++ gfc_warning (OPT_Wconversion_extra, "Non-LOGICAL type in" ++ " IF statement condition %L will be true if" ++ " it evaluates to nonzero", ++ &code->expr1->where); ++ } ++ } ++ ++ if (code->expr1->ts.type != BT_LOGICAL || code->expr1->rank != 0) ++ gfc_error ("IF clause at %L requires a scalar LOGICAL " ++ "expression", &code->expr1->where); ++ } + break; + + case EXEC_CALL: +diff --git a/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_1.f b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_1.f +new file mode 100644 +index 00000000000..0101db893ca +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_1.f +@@ -0,0 +1,25 @@ ++! { dg-do run } ++! { dg-options "-fdec -Wconversion-extra" } ++! ++! Allow logical expressions in if statements and blocks ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM logical_exp_if_st_bl ++ INTEGER ipos/1/ ++ INTEGER ineg/0/ ++ ++ ! Test non logical variables ++ if (ineg) STOP 1 ! { dg-warning "if it evaluates to nonzero" } ++ if (0) STOP 2 ! { dg-warning "if it evaluates to nonzero" } ++ ++ ! Test non logical expressions in if statements ++ if (MOD(ipos, 1)) STOP 3 ! { dg-warning "if it evaluates to nonzero" } ++ ++ ! Test non logical expressions in if blocks ++ if (MOD(2 * ipos, 2)) then ! { dg-warning "if it evaluates to nonzero" } ++ STOP 4 ++ endif ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_2.f b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_2.f +new file mode 100644 +index 00000000000..876f4e09508 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_2.f +@@ -0,0 +1,25 @@ ++! { dg-do run } ++! { dg-options "-fdec-non-logical-if -Wconversion-extra" } ++! ++! Allow logical expressions in if statements and blocks ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM logical_exp_if_st_bl ++ INTEGER ipos/1/ ++ INTEGER ineg/0/ ++ ++ ! Test non logical variables ++ if (ineg) STOP 1 ! { dg-warning "if it evaluates to nonzero" } ++ if (0) STOP 2 ! { dg-warning "if it evaluates to nonzero" } ++ ++ ! Test non logical expressions in if statements ++ if (MOD(ipos, 1)) STOP 3 ! { dg-warning "if it evaluates to nonzero" } ++ ++ ! Test non logical expressions in if blocks ++ if (MOD(2 * ipos, 2)) then ! { dg-warning "if it evaluates to nonzero" } ++ STOP 4 ++ endif ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_3.f b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_3.f +new file mode 100644 +index 00000000000..35cb4c51b8d +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_3.f +@@ -0,0 +1,25 @@ ++! { dg-do compile } ++! { dg-options "-fdec -fno-dec-non-logical-if" } ++! ++! Allow logical expressions in if statements and blocks ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM logical_exp_if_st_bl ++ INTEGER ipos/1/ ++ INTEGER ineg/0/ ++ ++ ! Test non logical variables ++ if (ineg) STOP 1 ! { dg-error "IF clause at" } ++ if (0) STOP 2 ! { dg-error "IF clause at" } ++ ++ ! Test non logical expressions in if statements ++ if (MOD(ipos, 1)) STOP 3 ! { dg-error "IF clause at" } ++ ++ ! Test non logical expressions in if blocks ++ if (MOD(2 * ipos, 2)) then ! { dg-error "IF clause at" } ++ STOP 4 ++ endif ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_4.f b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_4.f +new file mode 100644 +index 00000000000..7b60b60827f +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_4.f +@@ -0,0 +1,45 @@ ++! { dg-do run } ++! { dg-options "-fdec -Wconversion-extra" } ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ function othersub1() ++ integer*4 othersub1 ++ othersub1 = 9 ++ end ++ ++ function othersub2() ++ integer*4 othersub2 ++ othersub2 = 0 ++ end ++ ++ program MAIN ++ integer*4 othersub1 ++ integer*4 othersub2 ++ integer a /1/ ++ integer b /2/ ++ ++ if (othersub1()) then ! { dg-warning "if it evaluates to nonzero" } ++ write(*,*) "OK" ++ else ++ stop 1 ++ end if ++ if (othersub2()) then ! { dg-warning "if it evaluates to nonzero" } ++ stop 2 ++ else ++ write(*,*) "OK" ++ end if ++ if (a-b) then ! { dg-warning "if it evaluates to nonzero" } ++ write(*,*) "OK" ++ else ++ stop 3 ++ end if ++ if (b-(a+1)) then ! { dg-warning "if it evaluates to nonzero" } ++ stop 3 ++ else ++ write(*,*) "OK" ++ end if ++ end ++ +diff --git a/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_5.f b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_5.f +new file mode 100644 +index 00000000000..80336f48ca1 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_5.f +@@ -0,0 +1,45 @@ ++! { dg-do run } ++! { dg-options "-fdec-non-logical-if -Wconversion-extra" } ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ function othersub1() ++ integer*4 othersub1 ++ othersub1 = 9 ++ end ++ ++ function othersub2() ++ integer*4 othersub2 ++ othersub2 = 0 ++ end ++ ++ program MAIN ++ integer*4 othersub1 ++ integer*4 othersub2 ++ integer a /1/ ++ integer b /2/ ++ ++ if (othersub1()) then ! { dg-warning "Non-LOGICAL type in IF statement" } ++ write(*,*) "OK" ++ else ++ stop 1 ++ end if ++ if (othersub2()) then ! { dg-warning "Non-LOGICAL type in IF statement" } ++ stop 2 ++ else ++ write(*,*) "OK" ++ end if ++ if (a-b) then ! { dg-warning "Non-LOGICAL type in IF statement" } ++ write(*,*) "OK" ++ else ++ stop 3 ++ end if ++ if (b-(a+1)) then ! { dg-warning "Non-LOGICAL type in IF statement" } ++ stop 3 ++ else ++ write(*,*) "OK" ++ end if ++ end ++ +diff --git a/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_6.f b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_6.f +new file mode 100644 +index 00000000000..e1125ca717a +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_logical_expressions_if_statements_blocks_6.f +@@ -0,0 +1,45 @@ ++! { dg-do compile } ++! { dg-options "-fdec -fno-dec-non-logical-if" } ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ function othersub1() ++ integer*4 othersub1 ++ othersub1 = 9 ++ end ++ ++ function othersub2() ++ integer*4 othersub2 ++ othersub2 = 0 ++ end ++ ++ program MAIN ++ integer*4 othersub1 ++ integer*4 othersub2 ++ integer a /1/ ++ integer b /2/ ++ ++ if (othersub1()) then ! { dg-error "IF clause at" } ++ write(*,*) "OK" ++ else ++ stop 1 ++ end if ++ if (othersub2()) then ! { dg-error "IF clause at" } ++ stop 2 ++ else ++ write(*,*) "OK" ++ end if ++ if (a-b) then ! { dg-error "IF clause at" } ++ write(*,*) "OK" ++ else ++ stop 3 ++ end if ++ if (b-(a+1)) then ! { dg-error "IF clause at" } ++ stop 3 ++ else ++ write(*,*) "OK" ++ end if ++ end ++ +-- +2.27.0 + diff --git a/gcc11-fortran-fdec-old-init.patch b/gcc11-fortran-fdec-old-init.patch new file mode 100644 index 0000000..8554f2e --- /dev/null +++ b/gcc11-fortran-fdec-old-init.patch @@ -0,0 +1,185 @@ +From 8bcc0f85ed1718c0dd9033ad4a34df181aabaffe Mon Sep 17 00:00:00 2001 +From: Mark Eggleston +Date: Fri, 22 Jan 2021 13:11:06 +0000 +Subject: [PATCH 05/10] Allow old-style initializers in derived types + +This allows simple declarations in derived types and structures, such as: + LOGICAL*1 NIL /0/ +Only single value expressions are allowed at the moment. + +Use -fdec-old-init to enable. Also enabled by -fdec. +--- + gcc/fortran/decl.c | 27 +++++++++++++++---- + gcc/fortran/lang.opt | 4 +++ + gcc/fortran/options.c | 1 + + ...ec_derived_types_initialised_old_style_1.f | 25 +++++++++++++++++ + ...ec_derived_types_initialised_old_style_2.f | 25 +++++++++++++++++ + ...ec_derived_types_initialised_old_style_3.f | 26 ++++++++++++++++++ + 6 files changed, 103 insertions(+), 5 deletions(-) + create mode 100644 gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_1.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_2.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_3.f + +diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c +index 723915822f3..5c8c1b7981b 100644 +--- a/gcc/fortran/decl.c ++++ b/gcc/fortran/decl.c +@@ -2827,12 +2827,29 @@ variable_decl (int elem) + but not components of derived types. */ + else if (gfc_current_state () == COMP_DERIVED) + { +- gfc_error ("Invalid old style initialization for derived type " +- "component at %C"); +- m = MATCH_ERROR; +- goto cleanup; ++ if (flag_dec_old_init) ++ { ++ /* Attempt to match an old-style initializer which is a simple ++ integer or character expression; this will not work with ++ multiple values. */ ++ m = gfc_match_init_expr (&initializer); ++ if (m == MATCH_ERROR) ++ goto cleanup; ++ else if (m == MATCH_YES) ++ { ++ m = gfc_match ("/"); ++ if (m != MATCH_YES) ++ goto cleanup; ++ } ++ } ++ else ++ { ++ gfc_error ("Invalid old style initialization for derived type " ++ "component at %C"); ++ m = MATCH_ERROR; ++ goto cleanup; ++ } + } +- + /* For structure components, read the initializer as a special + expression and let the rest of this function apply the initializer + as usual. */ +diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt +index d527c106bd6..25cc948699b 100644 +--- a/gcc/fortran/lang.opt ++++ b/gcc/fortran/lang.opt +@@ -493,6 +493,10 @@ fdec-non-integer-index + Fortran Var(flag_dec_non_integer_index) + Enable support for non-integer substring indexes. + ++fdec-old-init ++Fortran Var(flag_dec_old_init) ++Enable support for old style initializers in derived types. ++ + fdec-structure + Fortran Var(flag_dec_structure) + Enable support for DEC STRUCTURE/RECORD. +diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c +index 9a042f64881..d6bd36c3a8a 100644 +--- a/gcc/fortran/options.c ++++ b/gcc/fortran/options.c +@@ -79,6 +79,7 @@ set_dec_flags (int value) + SET_BITFLAG (flag_dec_char_conversions, value, value); + SET_BITFLAG (flag_dec_duplicates, value, value); + SET_BITFLAG (flag_dec_non_integer_index, value, value); ++ SET_BITFLAG (flag_dec_old_init, value, value); + } + + /* Finalize DEC flags. */ +diff --git a/gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_1.f b/gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_1.f +new file mode 100644 +index 00000000000..eac4f9bfcf1 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_1.f +@@ -0,0 +1,25 @@ ++! { dg-do run } ++! { dg-options "-fdec" } ++! ++! Test old style initializers in derived types ++! ++! Contributed by Jim MacArthur ++! Modified by Mark Eggleston ++! ++ PROGRAM spec_in_var ++ TYPE STRUCT1 ++ INTEGER*4 ID /8/ ++ INTEGER*4 TYPE /5/ ++ INTEGER*8 DEFVAL /0/ ++ CHARACTER*(5) NAME /'tests'/ ++ LOGICAL*1 NIL /0/ ++ END TYPE STRUCT1 ++ ++ TYPE (STRUCT1) SINST ++ ++ IF(SINST%ID.NE.8) STOP 1 ++ IF(SINST%TYPE.NE.5) STOP 2 ++ IF(SINST%DEFVAL.NE.0) STOP 3 ++ IF(SINST%NAME.NE.'tests') STOP 4 ++ IF(SINST%NIL) STOP 5 ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_2.f b/gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_2.f +new file mode 100644 +index 00000000000..d904c8b2974 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_2.f +@@ -0,0 +1,25 @@ ++! { dg-do run } ++! { dg-options "-std=legacy -fdec-old-init" } ++! ++! Test old style initializers in derived types ++! ++! Contributed by Jim MacArthur ++! Modified by Mark Eggleston ++! ++ PROGRAM spec_in_var ++ TYPE STRUCT1 ++ INTEGER*4 ID /8/ ++ INTEGER*4 TYPE /5/ ++ INTEGER*8 DEFVAL /0/ ++ CHARACTER*(5) NAME /'tests'/ ++ LOGICAL*1 NIL /0/ ++ END TYPE STRUCT1 ++ ++ TYPE (STRUCT1) SINST ++ ++ IF(SINST%ID.NE.8) STOP 1 ++ IF(SINST%TYPE.NE.5) STOP 2 ++ IF(SINST%DEFVAL.NE.0) STOP 3 ++ IF(SINST%NAME.NE.'tests') STOP 4 ++ IF(SINST%NIL) STOP 5 ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_3.f b/gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_3.f +new file mode 100644 +index 00000000000..58c2b4b66cf +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_derived_types_initialised_old_style_3.f +@@ -0,0 +1,26 @@ ++! { dg-do compile } ++! { dg-options "-std=legacy -fdec -fno-dec-old-init" } ++! ++! Test old style initializers in derived types ++! ++! Contributed by Jim MacArthur ++! Modified by Mark Eggleston ++! ++ ++ PROGRAM spec_in_var ++ TYPE STRUCT1 ++ INTEGER*4 ID /8/ ! { dg-error "Invalid old style initialization" } ++ INTEGER*4 TYPE /5/ ! { dg-error "Invalid old style initialization" } ++ INTEGER*8 DEFVAL /0/ ! { dg-error "Invalid old style initialization" } ++ CHARACTER*(5) NAME /'tests'/ ! { dg-error "Invalid old style initialization" } ++ LOGICAL*1 NIL /0/ ! { dg-error "Invalid old style initialization" } ++ END TYPE STRUCT1 ++ ++ TYPE (STRUCT1) SINST ++ ++ IF(SINST%ID.NE.8) STOP 1 ! { dg-error "'id' at \\(1\\) is not a member" } ++ IF(SINST%TYPE.NE.5) STOP 2 ! { dg-error "'type' at \\(1\\) is not a member" } ++ IF(SINST%DEFVAL.NE.0) STOP 3 ! { dg-error "'defval' at \\(1\\) is not a member" } ++ IF(SINST%NAME.NE.'tests') STOP 4 ! { dg-error "'name' at \\(1\\) is not a member" } ++ IF(SINST%NIL) STOP 5 ! { dg-error "'nil' at \\(1\\) is not a member" } ++ END +-- +2.27.0 + diff --git a/gcc11-fortran-fdec-override-kind.patch b/gcc11-fortran-fdec-override-kind.patch new file mode 100644 index 0000000..e1c7b83 --- /dev/null +++ b/gcc11-fortran-fdec-override-kind.patch @@ -0,0 +1,588 @@ +From 786869fd62813e80da9b6545a295d53c36275c19 Mon Sep 17 00:00:00 2001 +From: Mark Eggleston +Date: Fri, 22 Jan 2021 13:12:14 +0000 +Subject: [PATCH 06/10] Allow string length and kind to be specified on a per + variable basis. + +This allows kind/length to be mixed with array specification in +declarations. + +e.g. + + INTEGER*4 x*2, y*8 + CHARACTER names*20(10) + REAL v(100)*8, vv*4(50) + +The per-variable size overrides the kind or length specified for the type. + +Use -fdec-override-kind to enable. Also enabled by -fdec. + +Note: this feature is a merger of two previously separate features. + +Now accepts named constants as kind parameters: + + INTEGER A + PARAMETER (A=2) + INTEGER B*(A) + +Contributed by Mark Eggleston + +Now rejects invalid kind parameters and prints error messages: + + INTEGER X*3 + +caused an internal compiler error. + +Contributed by Mark Eggleston +--- + gcc/fortran/decl.c | 156 ++++++++++++++---- + gcc/fortran/lang.opt | 4 + + gcc/fortran/options.c | 1 + + .../dec_mixed_char_array_declaration_1.f | 13 ++ + .../dec_mixed_char_array_declaration_2.f | 13 ++ + .../dec_mixed_char_array_declaration_3.f | 13 ++ + .../gfortran.dg/dec_spec_in_variable_1.f | 31 ++++ + .../gfortran.dg/dec_spec_in_variable_2.f | 31 ++++ + .../gfortran.dg/dec_spec_in_variable_3.f | 31 ++++ + .../gfortran.dg/dec_spec_in_variable_4.f | 14 ++ + .../gfortran.dg/dec_spec_in_variable_5.f | 19 +++ + .../gfortran.dg/dec_spec_in_variable_6.f | 19 +++ + .../gfortran.dg/dec_spec_in_variable_7.f | 15 ++ + .../gfortran.dg/dec_spec_in_variable_8.f | 14 ++ + 14 files changed, 340 insertions(+), 34 deletions(-) + create mode 100644 gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_1.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_2.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_3.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_spec_in_variable_1.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_spec_in_variable_2.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_spec_in_variable_3.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_spec_in_variable_4.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_spec_in_variable_5.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_spec_in_variable_6.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_spec_in_variable_7.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_spec_in_variable_8.f + +diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c +index 5c8c1b7981b..f7dc9d8263d 100644 +--- a/gcc/fortran/decl.c ++++ b/gcc/fortran/decl.c +@@ -1213,6 +1213,54 @@ syntax: + return MATCH_ERROR; + } + ++/* This matches the nonstandard kind given after a variable name, like: ++ INTEGER x*2, y*4 ++ The per-variable kind will override any kind given in the type ++ declaration. ++*/ ++ ++static match ++match_per_symbol_kind (int *length) ++{ ++ match m; ++ gfc_expr *expr = NULL; ++ ++ m = gfc_match_char ('*'); ++ if (m != MATCH_YES) ++ return m; ++ ++ m = gfc_match_small_literal_int (length, NULL); ++ if (m == MATCH_YES || m == MATCH_ERROR) ++ return m; ++ ++ if (gfc_match_char ('(') == MATCH_NO) ++ return MATCH_ERROR; ++ ++ m = gfc_match_expr (&expr); ++ if (m == MATCH_YES) ++ { ++ m = MATCH_ERROR; // Assume error ++ if (gfc_expr_check_typed (expr, gfc_current_ns, false)) ++ { ++ if ((expr->expr_type == EXPR_CONSTANT) ++ && (expr->ts.type == BT_INTEGER)) ++ { ++ *length = mpz_get_si(expr->value.integer); ++ m = MATCH_YES; ++ } ++ } ++ ++ if (m == MATCH_YES) ++ { ++ if (gfc_match_char (')') == MATCH_NO) ++ m = MATCH_ERROR; ++ } ++ } ++ ++ if (expr != NULL) ++ gfc_free_expr (expr); ++ return m; ++} + + /* Special subroutine for finding a symbol. Check if the name is found + in the current name space. If not, and we're compiling a function or +@@ -2443,6 +2491,35 @@ check_function_name (char *name) + } + + ++static match ++match_character_length_clause (gfc_charlen **cl, bool *cl_deferred, int elem) ++{ ++ gfc_expr* char_len; ++ char_len = NULL; ++ ++ match m = match_char_length (&char_len, cl_deferred, false); ++ if (m == MATCH_YES) ++ { ++ *cl = gfc_new_charlen (gfc_current_ns, NULL); ++ (*cl)->length = char_len; ++ } ++ else if (m == MATCH_NO) ++ { ++ if (elem > 1 ++ && (current_ts.u.cl->length == NULL ++ || current_ts.u.cl->length->expr_type != EXPR_CONSTANT)) ++ { ++ *cl = gfc_new_charlen (gfc_current_ns, NULL); ++ (*cl)->length = gfc_copy_expr (current_ts.u.cl->length); ++ } ++ else ++ *cl = current_ts.u.cl; ++ ++ *cl_deferred = current_ts.deferred; ++ } ++ return m; ++} ++ + /* Match a variable name with an optional initializer. When this + subroutine is called, a variable is expected to be parsed next. + Depending on what is happening at the moment, updates either the +@@ -2453,7 +2530,7 @@ variable_decl (int elem) + { + char name[GFC_MAX_SYMBOL_LEN + 1]; + static unsigned int fill_id = 0; +- gfc_expr *initializer, *char_len; ++ gfc_expr *initializer; + gfc_array_spec *as; + gfc_array_spec *cp_as; /* Extra copy for Cray Pointees. */ + gfc_charlen *cl; +@@ -2462,11 +2539,15 @@ variable_decl (int elem) + match m; + bool t; + gfc_symbol *sym; ++ match cl_match; ++ match kind_match; ++ int overridden_kind; + char c; + + initializer = NULL; + as = NULL; + cp_as = NULL; ++ kind_match = MATCH_NO; + + /* When we get here, we've just matched a list of attributes and + maybe a type and a double colon. The next thing we expect to see +@@ -2519,6 +2600,28 @@ variable_decl (int elem) + + var_locus = gfc_current_locus; + ++ ++ cl = NULL; ++ cl_deferred = false; ++ cl_match = MATCH_NO; ++ ++ /* Check for a character length clause before an array clause */ ++ if (flag_dec_override_kind) ++ { ++ if (current_ts.type == BT_CHARACTER) ++ { ++ cl_match = match_character_length_clause (&cl, &cl_deferred, elem); ++ if (cl_match == MATCH_ERROR) ++ goto cleanup; ++ } ++ else ++ { ++ kind_match = match_per_symbol_kind (&overridden_kind); ++ if (kind_match == MATCH_ERROR) ++ goto cleanup; ++ } ++ } ++ + /* Now we could see the optional array spec. or character length. */ + m = gfc_match_array_spec (&as, true, true); + if (m == MATCH_ERROR) +@@ -2667,40 +2770,12 @@ variable_decl (int elem) + } + } + +- char_len = NULL; +- cl = NULL; +- cl_deferred = false; +- +- if (current_ts.type == BT_CHARACTER) ++ /* Second chance for a character length clause */ ++ if (cl_match == MATCH_NO && current_ts.type == BT_CHARACTER) + { +- switch (match_char_length (&char_len, &cl_deferred, false)) +- { +- case MATCH_YES: +- cl = gfc_new_charlen (gfc_current_ns, NULL); +- +- cl->length = char_len; +- break; +- +- /* Non-constant lengths need to be copied after the first +- element. Also copy assumed lengths. */ +- case MATCH_NO: +- if (elem > 1 +- && (current_ts.u.cl->length == NULL +- || current_ts.u.cl->length->expr_type != EXPR_CONSTANT)) +- { +- cl = gfc_new_charlen (gfc_current_ns, NULL); +- cl->length = gfc_copy_expr (current_ts.u.cl->length); +- } +- else +- cl = current_ts.u.cl; +- +- cl_deferred = current_ts.deferred; +- +- break; +- +- case MATCH_ERROR: +- goto cleanup; +- } ++ m = match_character_length_clause (&cl, &cl_deferred, elem); ++ if (m == MATCH_ERROR) ++ goto cleanup; + } + + /* The dummy arguments and result of the abreviated form of MODULE +@@ -2802,6 +2877,19 @@ variable_decl (int elem) + goto cleanup; + } + ++ if (kind_match == MATCH_YES) ++ { ++ gfc_find_symbol (name, gfc_current_ns, 1, &sym); ++ /* sym *must* be found at this point */ ++ sym->ts.kind = overridden_kind; ++ if (gfc_validate_kind (sym->ts.type, sym->ts.kind, true) < 0) ++ { ++ gfc_error ("Kind %d not supported for type %s at %C", ++ sym->ts.kind, gfc_basic_typename (sym->ts.type)); ++ return MATCH_ERROR; ++ } ++ } ++ + if (!check_function_name (name)) + { + m = MATCH_ERROR; +diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt +index 25cc948699b..4a269ebb22d 100644 +--- a/gcc/fortran/lang.opt ++++ b/gcc/fortran/lang.opt +@@ -493,6 +493,10 @@ fdec-non-integer-index + Fortran Var(flag_dec_non_integer_index) + Enable support for non-integer substring indexes. + ++fdec-override-kind ++Fortran Var(flag_dec_override_kind) ++Enable support for per variable kind specification. ++ + fdec-old-init + Fortran Var(flag_dec_old_init) + Enable support for old style initializers in derived types. +diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c +index d6bd36c3a8a..edbab483b36 100644 +--- a/gcc/fortran/options.c ++++ b/gcc/fortran/options.c +@@ -80,6 +80,7 @@ set_dec_flags (int value) + SET_BITFLAG (flag_dec_duplicates, value, value); + SET_BITFLAG (flag_dec_non_integer_index, value, value); + SET_BITFLAG (flag_dec_old_init, value, value); ++ SET_BITFLAG (flag_dec_override_kind, value, value); + } + + /* Finalize DEC flags. */ +diff --git a/gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_1.f b/gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_1.f +new file mode 100644 +index 00000000000..706ea4112a4 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_1.f +@@ -0,0 +1,13 @@ ++! { dg-do run } ++! { dg-options "-fdec" } ++! ++! Test character declaration with mixed string length and array specification ++! ++! Contributed by Jim MacArthur ++! Modified by Mark Eggleston ++! ++ PROGRAM character_declaration ++ CHARACTER ASPEC_SLENGTH*2 (5) /'01','02','03','04','05'/ ++ CHARACTER SLENGTH_ASPEC(5)*2 /'01','02','03','04','05'/ ++ if (ASPEC_SLENGTH(3).NE.SLENGTH_ASPEC(3)) STOP 1 ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_2.f b/gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_2.f +new file mode 100644 +index 00000000000..26d2acf01de +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_2.f +@@ -0,0 +1,13 @@ ++! { dg-do run } ++! { dg-options "-fdec-override-kind" } ++! ++! Test character declaration with mixed string length and array specification ++! ++! Contributed by Jim MacArthur ++! Modified by Mark Eggleston ++! ++ PROGRAM character_declaration ++ CHARACTER ASPEC_SLENGTH*2 (5) /'01','02','03','04','05'/ ++ CHARACTER SLENGTH_ASPEC(5)*2 /'01','02','03','04','05'/ ++ if (ASPEC_SLENGTH(3).NE.SLENGTH_ASPEC(3)) STOP 1 ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_3.f b/gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_3.f +new file mode 100644 +index 00000000000..76e4f0bdb93 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_mixed_char_array_declaration_3.f +@@ -0,0 +1,13 @@ ++! { dg-do compile } ++! { dg-options "-fdec-override-kind -fno-dec-override-kind" } ++! ++! Test character declaration with mixed string length and array specification ++! ++! Contributed by Jim MacArthur ++! Modified by Mark Eggleston ++! ++ PROGRAM character_declaration ++ CHARACTER ASPEC_SLENGTH*2 (5) /'01','02','03','04','05'/ ! { dg-error "Syntax error" } ++ CHARACTER SLENGTH_ASPEC(5)*2 /'01','02','03','04','05'/ ++ if (ASPEC_SLENGTH(3).NE.SLENGTH_ASPEC(3)) STOP 1 ! { dg-error " Operands of comparison operator" } ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_spec_in_variable_1.f b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_1.f +new file mode 100644 +index 00000000000..edd0f5874b7 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_1.f +@@ -0,0 +1,31 @@ ++! { dg-do run } ++! { dg-options "-fdec" } ++! ++! Test kind specification in variable not in type ++! ++! Contributed by Mark Eggleston ++! ++ program spec_in_var ++ integer*8 ai*1, bi*4, ci ++ real*4 ar*4, br*8, cr ++ ++ ai = 1 ++ ar = 1.0 ++ bi = 2 ++ br = 2.0 ++ ci = 3 ++ cr = 3.0 ++ ++ if (ai .ne. 1) stop 1 ++ if (abs(ar - 1.0) > 1.0D-6) stop 2 ++ if (bi .ne. 2) stop 3 ++ if (abs(br - 2.0) > 1.0D-6) stop 4 ++ if (ci .ne. 3) stop 5 ++ if (abs(cr - 3.0) > 1.0D-6) stop 6 ++ if (kind(ai) .ne. 1) stop 7 ++ if (kind(ar) .ne. 4) stop 8 ++ if (kind(bi) .ne. 4) stop 9 ++ if (kind(br) .ne. 8) stop 10 ++ if (kind(ci) .ne. 8) stop 11 ++ if (kind(cr) .ne. 4) stop 12 ++ end +diff --git a/gcc/testsuite/gfortran.dg/dec_spec_in_variable_2.f b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_2.f +new file mode 100644 +index 00000000000..bfaba584dbb +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_2.f +@@ -0,0 +1,31 @@ ++! { dg-do run } ++! { dg-options "-fdec-override-kind" } ++! ++! Test kind specification in variable not in type ++! ++! Contributed by Mark Eggleston ++! ++ program spec_in_var ++ integer*8 ai*1, bi*4, ci ++ real*4 ar*4, br*8, cr ++ ++ ai = 1 ++ ar = 1.0 ++ bi = 2 ++ br = 2.0 ++ ci = 3 ++ cr = 3.0 ++ ++ if (ai .ne. 1) stop 1 ++ if (abs(ar - 1.0) > 1.0D-6) stop 2 ++ if (bi .ne. 2) stop 3 ++ if (abs(br - 2.0) > 1.0D-6) stop 4 ++ if (ci .ne. 3) stop 5 ++ if (abs(cr - 3.0) > 1.0D-6) stop 6 ++ if (kind(ai) .ne. 1) stop 7 ++ if (kind(ar) .ne. 4) stop 8 ++ if (kind(bi) .ne. 4) stop 9 ++ if (kind(br) .ne. 8) stop 10 ++ if (kind(ci) .ne. 8) stop 11 ++ if (kind(cr) .ne. 4) stop 12 ++ end +diff --git a/gcc/testsuite/gfortran.dg/dec_spec_in_variable_3.f b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_3.f +new file mode 100644 +index 00000000000..5ff434e7466 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_3.f +@@ -0,0 +1,31 @@ ++! { dg-do compile } ++! { dg-options "-fdec -fno-dec-override-kind" } ++! ++! Test kind specification in variable not in type ++! ++! Contributed by Mark Eggleston ++! ++ program spec_in_var ++ integer*8 ai*1, bi*4, ci ! { dg-error "Syntax error" } ++ real*4 ar*4, br*8, cr ! { dg-error "Syntax error" } ++ ++ ai = 1 ++ ar = 1.0 ++ bi = 2 ++ br = 2.0 ++ ci = 3 ++ cr = 3.0 ++ ++ if (ai .ne. 1) stop 1 ++ if (abs(ar - 1.0) > 1.0D-6) stop 2 ++ if (bi .ne. 2) stop 3 ++ if (abs(br - 2.0) > 1.0D-6) stop 4 ++ if (ci .ne. 3) stop 5 ++ if (abs(cr - 3.0) > 1.0D-6) stop 6 ++ if (kind(ai) .ne. 1) stop 7 ++ if (kind(ar) .ne. 4) stop 8 ++ if (kind(bi) .ne. 4) stop 9 ++ if (kind(br) .ne. 8) stop 10 ++ if (kind(ci) .ne. 8) stop 11 ++ if (kind(cr) .ne. 4) stop 12 ++ end +diff --git a/gcc/testsuite/gfortran.dg/dec_spec_in_variable_4.f b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_4.f +new file mode 100644 +index 00000000000..c01980e8b9d +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_4.f +@@ -0,0 +1,14 @@ ++! { dg-do compile } ++! ++! Test kind specification in variable not in type. The per variable ++! kind specification is not enabled so these should fail ++! ++! Contributed by Mark Eggleston ++! ++ program spec_in_var ++ integer a ++ parameter(a=2) ++ integer b*(a) ! { dg-error "Syntax error" } ++ real c*(8) ! { dg-error "Syntax error" } ++ logical d*1_1 ! { dg-error "Syntax error" } ++ end +diff --git a/gcc/testsuite/gfortran.dg/dec_spec_in_variable_5.f b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_5.f +new file mode 100644 +index 00000000000..e2f39da3f4f +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_5.f +@@ -0,0 +1,19 @@ ++! { dg-do run } ++! { dg-options "-fdec-override-kind" } ++! ++! Test kind specification in variable not in type ++! ++! Contributed by Mark Eggleston ++! ++ program spec_in_var ++ integer a ++ parameter(a=2) ++ integer b*(a) ++ real c*(8) ++ logical d*(1_1) ++ character e*(a) ++ if (kind(b).ne.2) stop 1 ++ if (kind(c).ne.8) stop 2 ++ if (kind(d).ne.1) stop 3 ++ if (len(e).ne.2) stop 4 ++ end +diff --git a/gcc/testsuite/gfortran.dg/dec_spec_in_variable_6.f b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_6.f +new file mode 100644 +index 00000000000..569747874e3 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_6.f +@@ -0,0 +1,19 @@ ++! { dg-do run } ++! { dg-options "-fdec" } ++! ++! Test kind specification in variable not in type ++! ++! Contributed by Mark Eggleston ++! ++ program spec_in_var ++ integer a ++ parameter(a=2) ++ integer b*(a) ++ real c*(8) ++ logical d*(1_1) ++ character e*(a) ++ if (kind(b).ne.2) stop 1 ++ if (kind(c).ne.8) stop 2 ++ if (kind(d).ne.1) stop 3 ++ if (len(e).ne.2) stop 4 ++ end +diff --git a/gcc/testsuite/gfortran.dg/dec_spec_in_variable_7.f b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_7.f +new file mode 100644 +index 00000000000..b975bfd15c5 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_7.f +@@ -0,0 +1,15 @@ ++! { dg-do compile } ++! { dg-options "-fdec -fno-dec-override-kind" } ++! ++! Test kind specification in variable not in type as the per variable ++! kind specification is not enables these should fail ++! ++! Contributed by Mark Eggleston ++! ++ program spec_in_var ++ integer a ++ parameter(a=2) ++ integer b*(a) ! { dg-error "Syntax error" } ++ real c*(8) ! { dg-error "Syntax error" } ++ logical d*1_1 ! { dg-error "Syntax error" } ++ end +diff --git a/gcc/testsuite/gfortran.dg/dec_spec_in_variable_8.f b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_8.f +new file mode 100644 +index 00000000000..85732e0bd85 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_spec_in_variable_8.f +@@ -0,0 +1,14 @@ ++! { dg-do compile } ++! { dg-options "-fdec" } ++! ++! Check that invalid kind values are rejected. ++! ++! Contributed by Mark Eggleston ++! ++ program spec_in_var ++ integer a ++ parameter(a=3) ++ integer b*(a) ! { dg-error "Kind 3 not supported" } ++ real c*(78) ! { dg-error "Kind 78 not supported" } ++ logical d*(*) ! { dg-error "Invalid character" } ++ end +-- +2.27.0 + diff --git a/gcc11-fortran-fdec-promotion.patch b/gcc11-fortran-fdec-promotion.patch new file mode 100644 index 0000000..36e0ff0 --- /dev/null +++ b/gcc11-fortran-fdec-promotion.patch @@ -0,0 +1,2093 @@ +From 7a27318818e359a277f2fa5f7dc3932d0fb950f5 Mon Sep 17 00:00:00 2001 +From: Mark Eggleston +Date: Fri, 22 Jan 2021 14:58:07 +0000 +Subject: [PATCH 08/10] Support type promotion in calls to intrinsics + +Use -fdec-promotion or -fdec to enable this feature. + +Merged 2 commits: worked on by Ben Brewer , +Francisco Redondo Marchena and +Jeff Law + +Re-worked by Mark Eggleston +--- + gcc/fortran/check.c | 71 +++++- + gcc/fortran/intrinsic.c | 5 + + gcc/fortran/iresolve.c | 91 ++++--- + gcc/fortran/lang.opt | 4 + + gcc/fortran/options.c | 1 + + gcc/fortran/simplify.c | 240 ++++++++++++++---- + ...trinsic_int_real_array_const_promotion_1.f | 18 ++ + ...trinsic_int_real_array_const_promotion_2.f | 18 ++ + ...trinsic_int_real_array_const_promotion_3.f | 18 ++ + ...dec_intrinsic_int_real_const_promotion_1.f | 90 +++++++ + ...dec_intrinsic_int_real_const_promotion_2.f | 90 +++++++ + ...dec_intrinsic_int_real_const_promotion_3.f | 92 +++++++ + .../dec_intrinsic_int_real_promotion_1.f | 130 ++++++++++ + .../dec_intrinsic_int_real_promotion_2.f | 130 ++++++++++ + .../dec_intrinsic_int_real_promotion_3.f | 130 ++++++++++ + .../dec_intrinsic_int_real_promotion_4.f | 118 +++++++++ + .../dec_intrinsic_int_real_promotion_5.f | 118 +++++++++ + .../dec_intrinsic_int_real_promotion_6.f | 118 +++++++++ + .../dec_intrinsic_int_real_promotion_7.f | 118 +++++++++ + .../gfortran.dg/dec_kind_promotion-1.f | 40 +++ + .../gfortran.dg/dec_kind_promotion-2.f | 40 +++ + .../gfortran.dg/dec_kind_promotion-3.f | 39 +++ + 22 files changed, 1639 insertions(+), 80 deletions(-) + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_1.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_2.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_3.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_1.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_2.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_3.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_1.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_2.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_3.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_4.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_5.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_6.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_7.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_kind_promotion-1.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_kind_promotion-2.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_kind_promotion-3.f + +diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c +index 623c1cc470e..e20a834a860 100644 +--- a/gcc/fortran/check.c ++++ b/gcc/fortran/check.c +@@ -1396,12 +1396,40 @@ gfc_check_allocated (gfc_expr *array) + } + + ++/* Check function where both arguments must be real or integer ++ and warn if they are different types. */ ++ ++bool ++check_int_real_promotion (gfc_expr *a, gfc_expr *b) ++{ ++ gfc_expr *i; ++ ++ if (!int_or_real_check (a, 0)) ++ return false; ++ ++ if (!int_or_real_check (b, 1)) ++ return false; ++ ++ if (a->ts.type != b->ts.type) ++ { ++ i = (a->ts.type != BT_REAL ? a : b); ++ gfc_warning_now (OPT_Wconversion, "Conversion from INTEGER to REAL " ++ "at %L might lose precision", &i->where); ++ } ++ ++ return true; ++} ++ ++ + /* Common check function where the first argument must be real or + integer and the second argument must be the same as the first. */ + + bool + gfc_check_a_p (gfc_expr *a, gfc_expr *p) + { ++ if (flag_dec_promotion) ++ return check_int_real_promotion (a, p); ++ + if (!int_or_real_check (a, 0)) + return false; + +@@ -3724,6 +3752,41 @@ check_rest (bt type, int kind, gfc_actual_arglist *arglist) + } + + ++/* Check function where all arguments of an argument list must be real ++ or integer. */ ++ ++static bool ++check_rest_int_real (gfc_actual_arglist *arglist) ++{ ++ gfc_actual_arglist *arg, *tmp; ++ gfc_expr *x; ++ int m, n; ++ ++ if (!min_max_args (arglist)) ++ return false; ++ ++ for (arg = arglist, n=1; arg; arg = arg->next, n++) ++ { ++ x = arg->expr; ++ if (x->ts.type != BT_INTEGER && x->ts.type != BT_REAL) ++ { ++ gfc_error ("% argument of %qs intrinsic at %L must be " ++ "INTEGER or REAL", n, gfc_current_intrinsic, &x->where); ++ return false; ++ } ++ ++ for (tmp = arglist, m=1; tmp != arg; tmp = tmp->next, m++) ++ if (!gfc_check_conformance (tmp->expr, x, ++ "arguments 'a%d' and 'a%d' for " ++ "intrinsic '%s'", m, n, ++ gfc_current_intrinsic)) ++ return false; ++ } ++ ++ return true; ++} ++ ++ + bool + gfc_check_min_max (gfc_actual_arglist *arg) + { +@@ -3748,7 +3811,10 @@ gfc_check_min_max (gfc_actual_arglist *arg) + return false; + } + +- return check_rest (x->ts.type, x->ts.kind, arg); ++ if (flag_dec_promotion && x->ts.type != BT_CHARACTER) ++ return check_rest_int_real (arg); ++ else ++ return check_rest (x->ts.type, x->ts.kind, arg); + } + + +@@ -5121,6 +5187,9 @@ gfc_check_shift (gfc_expr *i, gfc_expr *shift) + bool + gfc_check_sign (gfc_expr *a, gfc_expr *b) + { ++ if (flag_dec_promotion) ++ return check_int_real_promotion (a, b); ++ + if (!int_or_real_check (a, 0)) + return false; + +diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c +index e68eff8bdbb..81b3a24c2be 100644 +--- a/gcc/fortran/intrinsic.c ++++ b/gcc/fortran/intrinsic.c +@@ -4467,6 +4467,11 @@ check_arglist (gfc_actual_arglist **ap, gfc_intrinsic_sym *sym, + if (ts.kind == 0) + ts.kind = actual->expr->ts.kind; + ++ /* If kind promotion is allowed don't check for kind if it is smaller */ ++ if (flag_dec_promotion && ts.type == BT_INTEGER) ++ if (actual->expr->ts.kind < ts.kind) ++ ts.kind = actual->expr->ts.kind; ++ + if (!gfc_compare_types (&ts, &actual->expr->ts)) + { + if (error_flag) +diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c +index e17fe45f080..b9cdaff2499 100644 +--- a/gcc/fortran/iresolve.c ++++ b/gcc/fortran/iresolve.c +@@ -817,19 +817,22 @@ gfc_resolve_dble (gfc_expr *f, gfc_expr *a) + void + gfc_resolve_dim (gfc_expr *f, gfc_expr *a, gfc_expr *p) + { +- f->ts.type = a->ts.type; + if (p != NULL) +- f->ts.kind = gfc_kind_max (a,p); +- else +- f->ts.kind = a->ts.kind; +- +- if (p != NULL && a->ts.kind != p->ts.kind) + { +- if (a->ts.kind == gfc_kind_max (a,p)) +- gfc_convert_type (p, &a->ts, 2); ++ f->ts.kind = gfc_kind_max (a,p); ++ if (a->ts.type == BT_REAL || p->ts.type == BT_REAL) ++ f->ts.type = BT_REAL; + else +- gfc_convert_type (a, &p->ts, 2); ++ f->ts.type = BT_INTEGER; ++ ++ if (a->ts.kind != f->ts.kind || a->ts.type != f->ts.type) ++ gfc_convert_type (a, &f->ts, 2); ++ ++ if (p->ts.kind != f->ts.kind || p->ts.type != f->ts.type) ++ gfc_convert_type (p, &f->ts, 2); + } ++ else ++ f->ts = a->ts; + + f->value.function.name + = gfc_get_string ("__dim_%c%d", gfc_type_letter (f->ts.type), f->ts.kind); +@@ -1606,14 +1609,17 @@ gfc_resolve_minmax (const char *name, gfc_expr *f, gfc_actual_arglist *args) + /* Find the largest type kind. */ + for (a = args->next; a; a = a->next) + { ++ if (a->expr-> ts.type == BT_REAL) ++ f->ts.type = BT_REAL; ++ + if (a->expr->ts.kind > f->ts.kind) + f->ts.kind = a->expr->ts.kind; + } + +- /* Convert all parameters to the required kind. */ ++ /* Convert all parameters to the required type and/or kind. */ + for (a = args; a; a = a->next) + { +- if (a->expr->ts.kind != f->ts.kind) ++ if (a->expr->ts.type != f->ts.type || a->expr->ts.kind != f->ts.kind) + gfc_convert_type (a->expr, &f->ts, 2); + } + +@@ -2106,19 +2112,22 @@ gfc_resolve_minval (gfc_expr *f, gfc_expr *array, gfc_expr *dim, + void + gfc_resolve_mod (gfc_expr *f, gfc_expr *a, gfc_expr *p) + { +- f->ts.type = a->ts.type; + if (p != NULL) +- f->ts.kind = gfc_kind_max (a,p); +- else +- f->ts.kind = a->ts.kind; +- +- if (p != NULL && a->ts.kind != p->ts.kind) + { +- if (a->ts.kind == gfc_kind_max (a,p)) +- gfc_convert_type (p, &a->ts, 2); ++ f->ts.kind = gfc_kind_max (a,p); ++ if (a->ts.type == BT_REAL || p->ts.type == BT_REAL) ++ f->ts.type = BT_REAL; + else +- gfc_convert_type (a, &p->ts, 2); ++ f->ts.type = BT_INTEGER; ++ ++ if (a->ts.kind != f->ts.kind || a->ts.type != f->ts.type) ++ gfc_convert_type (a, &f->ts, 2); ++ ++ if (p->ts.kind != f->ts.kind || p->ts.type != f->ts.type) ++ gfc_convert_type (p, &f->ts, 2); + } ++ else ++ f->ts = a->ts; + + f->value.function.name + = gfc_get_string ("__mod_%c%d", gfc_type_letter (f->ts.type), f->ts.kind); +@@ -2128,19 +2137,22 @@ gfc_resolve_mod (gfc_expr *f, gfc_expr *a, gfc_expr *p) + void + gfc_resolve_modulo (gfc_expr *f, gfc_expr *a, gfc_expr *p) + { +- f->ts.type = a->ts.type; + if (p != NULL) +- f->ts.kind = gfc_kind_max (a,p); +- else +- f->ts.kind = a->ts.kind; +- +- if (p != NULL && a->ts.kind != p->ts.kind) + { +- if (a->ts.kind == gfc_kind_max (a,p)) +- gfc_convert_type (p, &a->ts, 2); ++ f->ts.kind = gfc_kind_max (a,p); ++ if (a->ts.type == BT_REAL || p->ts.type == BT_REAL) ++ f->ts.type = BT_REAL; + else +- gfc_convert_type (a, &p->ts, 2); ++ f->ts.type = BT_INTEGER; ++ ++ if (a->ts.kind != f->ts.kind || a->ts.type != f->ts.type) ++ gfc_convert_type (a, &f->ts, 2); ++ ++ if (p->ts.kind != f->ts.kind || p->ts.type != f->ts.type) ++ gfc_convert_type (p, &f->ts, 2); + } ++ else ++ f->ts = a->ts; + + f->value.function.name + = gfc_get_string ("__modulo_%c%d", gfc_type_letter (f->ts.type), +@@ -2515,9 +2527,26 @@ gfc_resolve_shift (gfc_expr *f, gfc_expr *i, gfc_expr *shift ATTRIBUTE_UNUSED) + + + void +-gfc_resolve_sign (gfc_expr *f, gfc_expr *a, gfc_expr *b ATTRIBUTE_UNUSED) ++gfc_resolve_sign (gfc_expr *f, gfc_expr *a, gfc_expr *b) + { +- f->ts = a->ts; ++ if (b != NULL) ++ { ++ f->ts.kind = gfc_kind_max (a, b); ++ if (a->ts.type == BT_REAL || b->ts.type == BT_REAL) ++ f->ts.type = BT_REAL; ++ else ++ f->ts.type = BT_INTEGER; ++ ++ if (a->ts.kind != f->ts.kind || a->ts.type != f->ts.type) ++ gfc_convert_type (a, &f->ts, 2); ++ ++ if (b->ts.kind != f->ts.kind || b->ts.type != f->ts.type) ++ gfc_convert_type (b, &f->ts, 2); ++ } ++ else ++ { ++ f->ts = a->ts; ++ } + f->value.function.name + = gfc_get_string ("__sign_%c%d", gfc_type_letter (a->ts.type), a->ts.kind); + } +diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt +index d886c2f33ed..4ca2f93f2df 100644 +--- a/gcc/fortran/lang.opt ++++ b/gcc/fortran/lang.opt +@@ -505,6 +505,10 @@ fdec-old-init + Fortran Var(flag_dec_old_init) + Enable support for old style initializers in derived types. + ++fdec-promotion ++Fortran Var(flag_dec_promotion) ++Add support for type promotion in intrinsic arguments. ++ + fdec-structure + Fortran Var(flag_dec_structure) + Enable support for DEC STRUCTURE/RECORD. +diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c +index a946c86790a..15079c7e95a 100644 +--- a/gcc/fortran/options.c ++++ b/gcc/fortran/options.c +@@ -82,6 +82,7 @@ set_dec_flags (int value) + SET_BITFLAG (flag_dec_old_init, value, value); + SET_BITFLAG (flag_dec_override_kind, value, value); + SET_BITFLAG (flag_dec_non_logical_if, value, value); ++ SET_BITFLAG (flag_dec_promotion, value, value); + } + + /* Finalize DEC flags. */ +diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c +index 9900572424f..3419e06fec2 100644 +--- a/gcc/fortran/simplify.c ++++ b/gcc/fortran/simplify.c +@@ -2333,39 +2333,79 @@ gfc_simplify_digits (gfc_expr *x) + } + + ++/* Simplify function which sets the floating-point value of ar from ++ the value of a independently if a is integer of real. */ ++ ++static void ++simplify_int_real_promotion (const gfc_expr *a, const gfc_expr *b, mpfr_t *ar) ++{ ++ if (a->ts.type == BT_REAL) ++ { ++ mpfr_init2 (*ar, (a->ts.kind * 8)); ++ mpfr_set (*ar, a->value.real, GFC_RND_MODE); ++ } ++ else ++ { ++ mpfr_init2 (*ar, (b->ts.kind * 8)); ++ mpfr_set_z (*ar, a->value.integer, GFC_RND_MODE); ++ } ++} ++ ++ ++/* Simplify function which promotes a and b arguments from integer to real if ++ required in ar and br floating-point values. This function returns true if ++ a or b are reals and false otherwise. */ ++ ++static bool ++simplify_int_real_promotion2 (const gfc_expr *a, const gfc_expr *b, mpfr_t *ar, ++ mpfr_t *br) ++{ ++ if (a->ts.type != BT_REAL && b->ts.type != BT_REAL) ++ return false; ++ ++ simplify_int_real_promotion (a, b, ar); ++ simplify_int_real_promotion (b, a, br); ++ ++ return true; ++} ++ ++ + gfc_expr * + gfc_simplify_dim (gfc_expr *x, gfc_expr *y) + { + gfc_expr *result; + int kind; + ++ mpfr_t xr; ++ mpfr_t yr; ++ + if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT) + return NULL; + +- kind = x->ts.kind > y->ts.kind ? x->ts.kind : y->ts.kind; +- result = gfc_get_constant_expr (x->ts.type, kind, &x->where); +- +- switch (x->ts.type) ++ if ((x->ts.type != BT_REAL && x->ts.type != BT_INTEGER) ++ || (y->ts.type != BT_REAL && y->ts.type != BT_INTEGER)) + { +- case BT_INTEGER: +- if (mpz_cmp (x->value.integer, y->value.integer) > 0) +- mpz_sub (result->value.integer, x->value.integer, y->value.integer); +- else +- mpz_set_ui (result->value.integer, 0); +- +- break; +- +- case BT_REAL: +- if (mpfr_cmp (x->value.real, y->value.real) > 0) +- mpfr_sub (result->value.real, x->value.real, y->value.real, +- GFC_RND_MODE); +- else +- mpfr_set_ui (result->value.real, 0, GFC_RND_MODE); ++ gfc_internal_error ("gfc_simplify_dim(): Bad arguments"); ++ return NULL; ++ } + +- break; ++ kind = x->ts.kind > y->ts.kind ? x->ts.kind : y->ts.kind; + +- default: +- gfc_internal_error ("gfc_simplify_dim(): Bad type"); ++ if (simplify_int_real_promotion2 (x, y, &xr, &yr)) ++ { ++ result = gfc_get_constant_expr (BT_REAL, kind, &x->where); ++ if (mpfr_cmp (xr, yr) > 0) ++ mpfr_sub (result->value.real, xr, yr, GFC_RND_MODE); ++ else ++ mpfr_set_ui (result->value.real, 0, GFC_RND_MODE); ++ } ++ else ++ { ++ result = gfc_get_constant_expr (BT_INTEGER, kind, &x->where); ++ if (mpz_cmp (x->value.integer, y->value.integer) > 0) ++ mpz_sub (result->value.integer, x->value.integer, y->value.integer); ++ else ++ mpz_set_ui (result->value.integer, 0); + } + + return range_check (result, "DIM"); +@@ -4953,6 +4993,76 @@ min_max_choose (gfc_expr *arg, gfc_expr *extremum, int sign, bool back_val) + { + int ret; + ++ mpfr_t *arp; ++ mpfr_t *erp; ++ mpfr_t ar; ++ mpfr_t er; ++ ++ if (arg->ts.type != extremum->ts.type) ++ { ++ if (arg->ts.type == BT_REAL) ++ { ++ arp = &arg->value.real; ++ } ++ else ++ { ++ mpfr_init2 (ar, (arg->ts.kind * 8)); ++ mpfr_set_z (ar, arg->value.integer, GFC_RND_MODE); ++ arp = &ar; ++ } ++ ++ if (extremum->ts.type == BT_REAL) ++ { ++ erp = &extremum->value.real; ++ } ++ else ++ { ++ mpfr_init2 (er, (extremum->ts.kind * 8)); ++ mpfr_set_z (er, extremum->value.integer, GFC_RND_MODE); ++ erp = &er; ++ } ++ ++ if (mpfr_nan_p (*erp)) ++ { ++ ret = 1; ++ extremum->ts.type = arg->ts.type; ++ extremum->ts.kind = arg->ts.kind; ++ if (arg->ts.type == BT_INTEGER) ++ { ++ mpz_init2 (extremum->value.integer, (arg->ts.kind * 8)); ++ mpz_set (extremum->value.integer, arg->value.integer); ++ } ++ else ++ { ++ mpfr_init2 (extremum->value.real, (arg->ts.kind * 8)); ++ mpfr_set (extremum->value.real, *arp, GFC_RND_MODE); ++ } ++ } ++ else if (mpfr_nan_p (*arp)) ++ ret = -1; ++ else ++ { ++ ret = mpfr_cmp (*arp, *erp) * sign; ++ if (ret > 0) ++ { ++ extremum->ts.type = arg->ts.type; ++ extremum->ts.kind = arg->ts.kind; ++ if (arg->ts.type == BT_INTEGER) ++ { ++ mpz_init2 (extremum->value.integer, (arg->ts.kind * 8)); ++ mpz_set (extremum->value.integer, arg->value.integer); ++ } ++ else ++ { ++ mpfr_init2 (extremum->value.real, (arg->ts.kind * 8)); ++ mpfr_set (extremum->value.real, *arp, GFC_RND_MODE); ++ } ++ } ++ } ++ ++ return ret; ++ } ++ + switch (arg->ts.type) + { + case BT_INTEGER: +@@ -5912,7 +6022,9 @@ gfc_simplify_mod (gfc_expr *a, gfc_expr *p) + gfc_expr *result; + int kind; + +- /* First check p. */ ++ mpfr_t ar; ++ mpfr_t pr; ++ + if (p->expr_type != EXPR_CONSTANT) + return NULL; + +@@ -5942,16 +6054,24 @@ gfc_simplify_mod (gfc_expr *a, gfc_expr *p) + if (a->expr_type != EXPR_CONSTANT) + return NULL; + ++ if (a->ts.type != BT_REAL && a->ts.type != BT_INTEGER) ++ { ++ gfc_internal_error ("gfc_simplify_mod(): Bad arguments"); ++ return NULL; ++ } ++ + kind = a->ts.kind > p->ts.kind ? a->ts.kind : p->ts.kind; +- result = gfc_get_constant_expr (a->ts.type, kind, &a->where); + +- if (a->ts.type == BT_INTEGER) +- mpz_tdiv_r (result->value.integer, a->value.integer, p->value.integer); +- else ++ if (simplify_int_real_promotion2 (a, p, &ar, &pr)) + { ++ result = gfc_get_constant_expr (BT_REAL, kind, &a->where); + gfc_set_model_kind (kind); +- mpfr_fmod (result->value.real, a->value.real, p->value.real, +- GFC_RND_MODE); ++ mpfr_fmod (result->value.real, ar, pr, GFC_RND_MODE); ++ } ++ else ++ { ++ result = gfc_get_constant_expr (BT_INTEGER, kind, &a->where); ++ mpz_tdiv_r (result->value.integer, a->value.integer, p->value.integer); + } + + return range_check (result, "MOD"); +@@ -5964,7 +6084,9 @@ gfc_simplify_modulo (gfc_expr *a, gfc_expr *p) + gfc_expr *result; + int kind; + +- /* First check p. */ ++ mpfr_t ar; ++ mpfr_t pr; ++ + if (p->expr_type != EXPR_CONSTANT) + return NULL; + +@@ -5991,28 +6113,36 @@ gfc_simplify_modulo (gfc_expr *a, gfc_expr *p) + gfc_internal_error ("gfc_simplify_modulo(): Bad arguments"); + } + ++ if (a->ts.type != BT_REAL && a->ts.type != BT_INTEGER) ++ { ++ gfc_internal_error ("gfc_simplify_modulo(): Bad arguments"); ++ return NULL; ++ } ++ + if (a->expr_type != EXPR_CONSTANT) + return NULL; + + kind = a->ts.kind > p->ts.kind ? a->ts.kind : p->ts.kind; +- result = gfc_get_constant_expr (a->ts.type, kind, &a->where); + +- if (a->ts.type == BT_INTEGER) +- mpz_fdiv_r (result->value.integer, a->value.integer, p->value.integer); +- else ++ if (simplify_int_real_promotion2 (a, p, &ar, &pr)) + { ++ result = gfc_get_constant_expr (BT_REAL, kind, &a->where); + gfc_set_model_kind (kind); +- mpfr_fmod (result->value.real, a->value.real, p->value.real, +- GFC_RND_MODE); ++ mpfr_fmod (result->value.real, ar, pr, GFC_RND_MODE); + if (mpfr_cmp_ui (result->value.real, 0) != 0) +- { +- if (mpfr_signbit (a->value.real) != mpfr_signbit (p->value.real)) +- mpfr_add (result->value.real, result->value.real, p->value.real, +- GFC_RND_MODE); +- } +- else +- mpfr_copysign (result->value.real, result->value.real, +- p->value.real, GFC_RND_MODE); ++ { ++ if (mpfr_signbit (ar) != mpfr_signbit (pr)) ++ mpfr_add (result->value.real, result->value.real, pr, ++ GFC_RND_MODE); ++ } ++ else ++ mpfr_copysign (result->value.real, result->value.real, pr, ++ GFC_RND_MODE); ++ } ++ else ++ { ++ result = gfc_get_constant_expr (BT_INTEGER, kind, &a->where); ++ mpz_fdiv_r (result->value.integer, a->value.integer, p->value.integer); + } + + return range_check (result, "MODULO"); +@@ -7578,27 +7708,41 @@ gfc_expr * + gfc_simplify_sign (gfc_expr *x, gfc_expr *y) + { + gfc_expr *result; ++ bool neg; + + if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT) + return NULL; + + result = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); + ++ switch (y->ts.type) ++ { ++ case BT_INTEGER: ++ neg = (mpz_sgn (y->value.integer) < 0); ++ break; ++ ++ case BT_REAL: ++ neg = (mpfr_sgn (y->value.real) < 0); ++ break; ++ ++ default: ++ gfc_internal_error ("Bad type in gfc_simplify_sign"); ++ } ++ + switch (x->ts.type) + { + case BT_INTEGER: + mpz_abs (result->value.integer, x->value.integer); +- if (mpz_sgn (y->value.integer) < 0) ++ if (neg) + mpz_neg (result->value.integer, result->value.integer); + break; + + case BT_REAL: +- if (flag_sign_zero) ++ if (flag_sign_zero && y->ts.type == BT_REAL) + mpfr_copysign (result->value.real, x->value.real, y->value.real, +- GFC_RND_MODE); ++ GFC_RND_MODE); + else +- mpfr_setsign (result->value.real, x->value.real, +- mpfr_sgn (y->value.real) < 0 ? 1 : 0, GFC_RND_MODE); ++ mpfr_setsign (result->value.real, x->value.real, neg, GFC_RND_MODE); + break; + + default: +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_1.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_1.f +new file mode 100644 +index 00000000000..25763852139 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_1.f +@@ -0,0 +1,18 @@ ++! { dg-do compile } ++! { dg-options "-fdec" } ++! ++! Test promotion between integers and reals for mod and modulo where ++! A is a constant array and P is zero. ++! ++! Compilation errors are expected ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ program promotion_int_real_array_const ++ real a(2) = mod([12, 34], 0.0)*4 ! { dg-error "shall not be zero" } ++ a = mod([12.0, 34.0], 0)*4 ! { dg-error "shall not be zero" } ++ real b(2) = modulo([12, 34], 0.0)*4 ! { dg-error "shall not be zero" } ++ b = modulo([12.0, 34.0], 0)*4 ! { dg-error "shall not be zero" } ++ end program +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_2.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_2.f +new file mode 100644 +index 00000000000..b78a46054f4 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_2.f +@@ -0,0 +1,18 @@ ++! { dg-do compile } ++! { dg-options "-fdec-promotion" } ++! ++! Test promotion between integers and reals for mod and modulo where ++! A is a constant array and P is zero. ++! ++! Compilation errors are expected ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ program promotion_int_real_array_const ++ real a(2) = mod([12, 34], 0.0)*4 ! { dg-error "shall not be zero" } ++ a = mod([12.0, 34.0], 0)*4 ! { dg-error "shall not be zero" } ++ real b(2) = modulo([12, 34], 0.0)*4 ! { dg-error "shall not be zero" } ++ b = modulo([12.0, 34.0], 0)*4 ! { dg-error "shall not be zero" } ++ end program +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_3.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_3.f +new file mode 100644 +index 00000000000..318ab5db97e +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_array_const_promotion_3.f +@@ -0,0 +1,18 @@ ++! { dg-do compile } ++! { dg-options "-fdec -fno-dec-promotion" } ++! ++! Test promotion between integers and reals for mod and modulo where ++! A is a constant array and P is zero. ++! ++! Compilation errors are expected ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ program promotion_int_real_array_const ++ real a(2) = mod([12, 34], 0.0)*4 ! { dg-error "'a' and 'p' arguments of 'mod'" } ++ a = mod([12.0, 34.0], 0)*4 ! { dg-error "'a' and 'p' arguments of 'mod'" } ++ real b(2) = modulo([12, 34], 0.0)*4 ! { dg-error "'a' and 'p' arguments of 'modulo'" } ++ b = modulo([12.0, 34.0], 0)*4 ! { dg-error "'a' and 'p' arguments of 'modulo'" } ++ end program +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_1.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_1.f +new file mode 100644 +index 00000000000..27eb2582bb2 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_1.f +@@ -0,0 +1,90 @@ ++! { dg-do run } ++! { dg-options "-fdec -finit-real=snan" } ++! ++! Test promotion between integers and reals in intrinsic operations. ++! These operations are: mod, modulo, dim, sign, min, max, minloc and ++! maxloc. ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM promotion_int_real_const ++ ! array_nan 4th position value is NAN ++ REAL array_nan(4) ++ DATA array_nan(1)/-4.0/ ++ DATA array_nan(2)/3.0/ ++ DATA array_nan(3)/-2/ ++ ++ INTEGER m_i/0/ ++ REAL m_r/0.0/ ++ ++ INTEGER md_i/0/ ++ REAL md_r/0.0/ ++ ++ INTEGER d_i/0/ ++ REAL d_r/0.0/ ++ ++ INTEGER s_i/0/ ++ REAL s_r/0.0/ ++ ++ INTEGER mn_i/0/ ++ REAL mn_r/0.0/ ++ ++ INTEGER mx_i/0/ ++ REAL mx_r/0.0/ ++ ++ m_i = MOD(4, 3) ++ if (m_i .ne. 1) STOP 1 ++ m_r = MOD(4.0, 3.0) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 2 ++ m_r = MOD(4, 3.0) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 3 ++ m_r = MOD(4.0, 3) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 4 ++ ++ md_i = MODULO(4, 3) ++ if (md_i .ne. 1) STOP 5 ++ md_r = MODULO(4.0, 3.0) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 6 ++ md_r = MODULO(4, 3.0) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 7 ++ md_r = MODULO(4.0, 3) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 8 ++ ++ d_i = DIM(4, 3) ++ if (d_i .ne. 1) STOP 9 ++ d_r = DIM(4.0, 3.0) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 10 ++ d_r = DIM(4.0, 3) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 11 ++ d_r = DIM(3, 4.0) ++ if (abs(d_r) > 1.0D-6) STOP 12 ++ ++ s_i = SIGN(-4, 3) ++ if (s_i .ne. 4) STOP 13 ++ s_r = SIGN(4.0, -3.0) ++ if (abs(s_r - (-4.0)) > 1.0D-6) STOP 14 ++ s_r = SIGN(4.0, -3) ++ if (abs(s_r - (-4.0)) > 1.0D-6) STOP 15 ++ s_r = SIGN(-4, 3.0) ++ if (abs(s_r - 4.0) > 1.0D-6) STOP 16 ++ ++ mx_i = MAX(-4, -3, 2, 1) ++ if (mx_i .ne. 2) STOP 17 ++ mx_r = MAX(-4.0, -3.0, 2.0, 1.0) ++ if (abs(mx_r - 2.0) > 1.0D-6) STOP 18 ++ mx_r = MAX(-4, -3.0, 2.0, 1) ++ if (abs(mx_r - 2.0) > 1.0D-6) STOP 19 ++ mx_i = MAXLOC(array_nan, 1) ++ if (mx_i .ne. 2) STOP 20 ++ ++ mn_i = MIN(-4, -3, 2, 1) ++ if (mn_i .ne. -4) STOP 21 ++ mn_r = MIN(-4.0, -3.0, 2.0, 1.0) ++ if (abs(mn_r - (-4.0)) > 1.0D-6) STOP 22 ++ mn_r = MIN(-4, -3.0, 2.0, 1) ++ if (abs(mn_r - (-4.0)) > 1.0D-6) STOP 23 ++ mn_i = MINLOC(array_nan, 1) ++ if (mn_i .ne. 1) STOP 24 ++ END PROGRAM +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_2.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_2.f +new file mode 100644 +index 00000000000..bdd017b7280 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_2.f +@@ -0,0 +1,90 @@ ++! { dg-do run } ++! { dg-options "-fdec-promotion -finit-real=snan" } ++! ++! Test promotion between integers and reals in intrinsic operations. ++! These operations are: mod, modulo, dim, sign, min, max, minloc and ++! maxloc. ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM promotion_int_real_const ++ ! array_nan 4th position value is NAN ++ REAL array_nan(4) ++ DATA array_nan(1)/-4.0/ ++ DATA array_nan(2)/3.0/ ++ DATA array_nan(3)/-2/ ++ ++ INTEGER m_i/0/ ++ REAL m_r/0.0/ ++ ++ INTEGER md_i/0/ ++ REAL md_r/0.0/ ++ ++ INTEGER d_i/0/ ++ REAL d_r/0.0/ ++ ++ INTEGER s_i/0/ ++ REAL s_r/0.0/ ++ ++ INTEGER mn_i/0/ ++ REAL mn_r/0.0/ ++ ++ INTEGER mx_i/0/ ++ REAL mx_r/0.0/ ++ ++ m_i = MOD(4, 3) ++ if (m_i .ne. 1) STOP 1 ++ m_r = MOD(4.0, 3.0) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 2 ++ m_r = MOD(4, 3.0) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 3 ++ m_r = MOD(4.0, 3) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 4 ++ ++ md_i = MODULO(4, 3) ++ if (md_i .ne. 1) STOP 5 ++ md_r = MODULO(4.0, 3.0) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 6 ++ md_r = MODULO(4, 3.0) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 7 ++ md_r = MODULO(4.0, 3) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 8 ++ ++ d_i = DIM(4, 3) ++ if (d_i .ne. 1) STOP 9 ++ d_r = DIM(4.0, 3.0) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 10 ++ d_r = DIM(4.0, 3) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 11 ++ d_r = DIM(3, 4.0) ++ if (abs(d_r) > 1.0D-6) STOP 12 ++ ++ s_i = SIGN(-4, 3) ++ if (s_i .ne. 4) STOP 13 ++ s_r = SIGN(4.0, -3.0) ++ if (abs(s_r - (-4.0)) > 1.0D-6) STOP 14 ++ s_r = SIGN(4.0, -3) ++ if (abs(s_r - (-4.0)) > 1.0D-6) STOP 15 ++ s_r = SIGN(-4, 3.0) ++ if (abs(s_r - 4.0) > 1.0D-6) STOP 16 ++ ++ mx_i = MAX(-4, -3, 2, 1) ++ if (mx_i .ne. 2) STOP 17 ++ mx_r = MAX(-4.0, -3.0, 2.0, 1.0) ++ if (abs(mx_r - 2.0) > 1.0D-6) STOP 18 ++ mx_r = MAX(-4, -3.0, 2.0, 1) ++ if (abs(mx_r - 2.0) > 1.0D-6) STOP 19 ++ mx_i = MAXLOC(array_nan, 1) ++ if (mx_i .ne. 2) STOP 20 ++ ++ mn_i = MIN(-4, -3, 2, 1) ++ if (mn_i .ne. -4) STOP 21 ++ mn_r = MIN(-4.0, -3.0, 2.0, 1.0) ++ if (abs(mn_r - (-4.0)) > 1.0D-6) STOP 22 ++ mn_r = MIN(-4, -3.0, 2.0, 1) ++ if (abs(mn_r - (-4.0)) > 1.0D-6) STOP 23 ++ mn_i = MINLOC(array_nan, 1) ++ if (mn_i .ne. 1) STOP 24 ++ END PROGRAM +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_3.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_3.f +new file mode 100644 +index 00000000000..ce90a5667d6 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion_3.f +@@ -0,0 +1,92 @@ ++! { dg-do compile } ++! { dg-options "-fdec -fno-dec-promotion -finit-real=snan" } ++! ++! Test that there is no promotion between integers and reals in ++! intrinsic operations. ++! ++! These operations are: mod, modulo, dim, sign, min, max, minloc and ++! maxloc. ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM promotion_int_real_const ++ ! array_nan 4th position value is NAN ++ REAL array_nan(4) ++ DATA array_nan(1)/-4.0/ ++ DATA array_nan(2)/3.0/ ++ DATA array_nan(3)/-2/ ++ ++ INTEGER m_i/0/ ++ REAL m_r/0.0/ ++ ++ INTEGER md_i/0/ ++ REAL md_r/0.0/ ++ ++ INTEGER d_i/0/ ++ REAL d_r/0.0/ ++ ++ INTEGER s_i/0/ ++ REAL s_r/0.0/ ++ ++ INTEGER mn_i/0/ ++ REAL mn_r/0.0/ ++ ++ INTEGER mx_i/0/ ++ REAL mx_r/0.0/ ++ ++ m_i = MOD(4, 3) ++ if (m_i .ne. 1) STOP 1 ++ m_r = MOD(4.0, 3.0) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 2 ++ m_r = MOD(4, 3.0) ! { dg-error "'a' and 'p' arguments" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 3 ++ m_r = MOD(4.0, 3) ! { dg-error "'a' and 'p' arguments" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 4 ++ ++ md_i = MODULO(4, 3) ++ if (md_i .ne. 1) STOP 5 ++ md_r = MODULO(4.0, 3.0) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 6 ++ md_r = MODULO(4, 3.0) ! { dg-error "'a' and 'p' arguments" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 7 ++ md_r = MODULO(4.0, 3) ! { dg-error "'a' and 'p' arguments" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 8 ++ ++ d_i = DIM(4, 3) ++ if (d_i .ne. 1) STOP 9 ++ d_r = DIM(4.0, 3.0) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 10 ++ d_r = DIM(4.0, 3) ! { dg-error "'x' and 'y' arguments" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 11 ++ d_r = DIM(3, 4.0) ! { dg-error "'x' and 'y' arguments" } ++ if (abs(d_r) > 1.0D-6) STOP 12 ++ ++ s_i = SIGN(-4, 3) ++ if (s_i .ne. 4) STOP 13 ++ s_r = SIGN(4.0, -3.0) ++ if (abs(s_r - (-4.0)) > 1.0D-6) STOP 14 ++ s_r = SIGN(4.0, -3) ! { dg-error "'b' argument" } ++ if (abs(s_r - (-4.0)) > 1.0D-6) STOP 15 ++ s_r = SIGN(-4, 3.0) ! { dg-error "'b' argument" } ++ if (abs(s_r - 4.0) > 1.0D-6) STOP 16 ++ ++ mx_i = MAX(-4, -3, 2, 1) ++ if (mx_i .ne. 2) STOP 17 ++ mx_r = MAX(-4.0, -3.0, 2.0, 1.0) ++ if (abs(mx_r - 2.0) > 1.0D-6) STOP 18 ++ mx_r = MAX(-4, -3.0, 2.0, 1) ! { dg-error "'a2' argument" } ++ if (abs(mx_r - 2.0) > 1.0D-6) STOP 19 ++ mx_i = MAXLOC(array_nan, 1) ++ if (mx_i .ne. 2) STOP 20 ++ ++ mn_i = MIN(-4, -3, 2, 1) ++ if (mn_i .ne. -4) STOP 21 ++ mn_r = MIN(-4.0, -3.0, 2.0, 1.0) ++ if (abs(mn_r - (-4.0)) > 1.0D-6) STOP 22 ++ mn_r = MIN(-4, -3.0, 2.0, 1) ! { dg-error "'a2' argument" } ++ if (abs(mn_r - (-4.0)) > 1.0D-6) STOP 23 ++ mn_i = MINLOC(array_nan, 1) ++ if (mn_i .ne. 1) STOP 24 ++ END PROGRAM +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_1.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_1.f +new file mode 100644 +index 00000000000..5c2cd931a4b +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_1.f +@@ -0,0 +1,130 @@ ++! { dg-do run } ++! { dg-options "-fdec" } ++! ++! Test promotion between integers and reals in intrinsic operations. ++! These operations are: mod, modulo, dim, sign, min, max, minloc and ++! maxloc. ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM promotion_int_real ++ REAL l/0.0/ ++ INTEGER a_i/4/ ++ INTEGER*4 a2_i/4/ ++ INTEGER b_i/3/ ++ INTEGER*8 b2_i/3/ ++ INTEGER x_i/2/ ++ INTEGER y_i/1/ ++ REAL a_r/4.0/ ++ REAL*4 a2_r/4.0/ ++ REAL b_r/3.0/ ++ REAL*8 b2_r/3.0/ ++ REAL x_r/2.0/ ++ REAL y_r/1.0/ ++ ++ REAL array_nan(4) ++ DATA array_nan(1)/-4.0/ ++ DATA array_nan(2)/3.0/ ++ DATA array_nan(3)/-2/ ++ ++ INTEGER m_i/0/ ++ REAL m_r/0.0/ ++ ++ INTEGER md_i/0/ ++ REAL md_r/0.0/ ++ ++ INTEGER d_i/0/ ++ REAL d_r/0.0/ ++ ++ INTEGER s_i/0/ ++ REAL s_r/0.0/ ++ ++ INTEGER mn_i/0/ ++ REAL mn_r/0.0/ ++ ++ INTEGER mx_i/0/ ++ REAL mx_r/0.0/ ++ ++ ! array_nan 4th position value is NAN ++ array_nan(4) = 0/l ++ ++ m_i = MOD(a_i, b_i) ++ if (m_i .ne. 1) STOP 1 ++ m_i = MOD(a2_i, b2_i) ++ if (m_i .ne. 1) STOP 2 ++ m_r = MOD(a_r, b_r) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 3 ++ m_r = MOD(a2_r, b2_r) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 4 ++ m_r = MOD(a_i, b_r) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 5 ++ m_r = MOD(a_r, b_i) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 6 ++ ++ md_i = MODULO(a_i, b_i) ++ if (md_i .ne. 1) STOP 7 ++ md_i = MODULO(a2_i, b2_i) ++ if (md_i .ne. 1) STOP 8 ++ md_r = MODULO(a_r, b_r) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 9 ++ md_r = MODULO(a2_r, b2_r) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 10 ++ md_r = MODULO(a_i, b_r) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 11 ++ md_r = MODULO(a_r, b_i) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 12 ++ ++ d_i = DIM(a_i, b_i) ++ if (d_i .ne. 1) STOP 13 ++ d_i = DIM(a2_i, b2_i) ++ if (d_i .ne. 1) STOP 14 ++ d_r = DIM(a_r, b_r) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 15 ++ d_r = DIM(a2_r, b2_r) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 16 ++ d_r = DIM(a_r, b_i) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 17 ++ d_r = DIM(b_i, a_r) ++ if (abs(d_r) > 1.0D-6) STOP 18 ++ ++ s_i = SIGN(-a_i, b_i) ++ if (s_i .ne. 4) STOP 19 ++ s_i = SIGN(-a2_i, b2_i) ++ if (s_i .ne. 4) STOP 20 ++ s_r = SIGN(a_r, -b_r) ++ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 21 ++ s_r = SIGN(a2_r, -b2_r) ++ if (abs(s_r - (-a2_r)) > 1.0D-6) STOP 22 ++ s_r = SIGN(a_r, -b_i) ++ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 23 ++ s_r = SIGN(-a_i, b_r) ++ if (abs(s_r - a_r) > 1.0D-6) STOP 24 ++ ++ mx_i = MAX(-a_i, -b_i, x_i, y_i) ++ if (mx_i .ne. x_i) STOP 25 ++ mx_i = MAX(-a2_i, -b2_i, x_i, y_i) ++ if (mx_i .ne. x_i) STOP 26 ++ mx_r = MAX(-a_r, -b_r, x_r, y_r) ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 27 ++ mx_r = MAX(-a_r, -b_r, x_r, y_r) ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 28 ++ mx_r = MAX(-a_i, -b_r, x_r, y_i) ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 29 ++ mx_i = MAXLOC(array_nan, 1) ++ if (mx_i .ne. 2) STOP 30 ++ ++ mn_i = MIN(-a_i, -b_i, x_i, y_i) ++ if (mn_i .ne. -a_i) STOP 31 ++ mn_i = MIN(-a2_i, -b2_i, x_i, y_i) ++ if (mn_i .ne. -a2_i) STOP 32 ++ mn_r = MIN(-a_r, -b_r, x_r, y_r) ++ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 33 ++ mn_r = MIN(-a2_r, -b2_r, x_r, y_r) ++ if (abs(mn_r - (-a2_r)) > 1.0D-6) STOP 34 ++ mn_r = MIN(-a_i, -b_r, x_r, y_i) ++ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 35 ++ mn_i = MINLOC(array_nan, 1) ++ if (mn_i .ne. 1) STOP 36 ++ END PROGRAM +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_2.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_2.f +new file mode 100644 +index 00000000000..d64d468f7d1 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_2.f +@@ -0,0 +1,130 @@ ++! { dg-do run } ++! { dg-options "-fdec-promotion" } ++! ++! Test promotion between integers and reals in intrinsic operations. ++! These operations are: mod, modulo, dim, sign, min, max, minloc and ++! maxloc. ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM promotion_int_real ++ REAL l/0.0/ ++ INTEGER a_i/4/ ++ INTEGER*4 a2_i/4/ ++ INTEGER b_i/3/ ++ INTEGER*8 b2_i/3/ ++ INTEGER x_i/2/ ++ INTEGER y_i/1/ ++ REAL a_r/4.0/ ++ REAL*4 a2_r/4.0/ ++ REAL b_r/3.0/ ++ REAL*8 b2_r/3.0/ ++ REAL x_r/2.0/ ++ REAL y_r/1.0/ ++ ++ REAL array_nan(4) ++ DATA array_nan(1)/-4.0/ ++ DATA array_nan(2)/3.0/ ++ DATA array_nan(3)/-2/ ++ ++ INTEGER m_i/0/ ++ REAL m_r/0.0/ ++ ++ INTEGER md_i/0/ ++ REAL md_r/0.0/ ++ ++ INTEGER d_i/0/ ++ REAL d_r/0.0/ ++ ++ INTEGER s_i/0/ ++ REAL s_r/0.0/ ++ ++ INTEGER mn_i/0/ ++ REAL mn_r/0.0/ ++ ++ INTEGER mx_i/0/ ++ REAL mx_r/0.0/ ++ ++ ! array_nan 4th position value is NAN ++ array_nan(4) = 0/l ++ ++ m_i = MOD(a_i, b_i) ++ if (m_i .ne. 1) STOP 1 ++ m_i = MOD(a2_i, b2_i) ++ if (m_i .ne. 1) STOP 2 ++ m_r = MOD(a_r, b_r) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 3 ++ m_r = MOD(a2_r, b2_r) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 4 ++ m_r = MOD(a_i, b_r) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 5 ++ m_r = MOD(a_r, b_i) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 6 ++ ++ md_i = MODULO(a_i, b_i) ++ if (md_i .ne. 1) STOP 7 ++ md_i = MODULO(a2_i, b2_i) ++ if (md_i .ne. 1) STOP 8 ++ md_r = MODULO(a_r, b_r) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 9 ++ md_r = MODULO(a2_r, b2_r) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 10 ++ md_r = MODULO(a_i, b_r) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 11 ++ md_r = MODULO(a_r, b_i) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 12 ++ ++ d_i = DIM(a_i, b_i) ++ if (d_i .ne. 1) STOP 13 ++ d_i = DIM(a2_i, b2_i) ++ if (d_i .ne. 1) STOP 14 ++ d_r = DIM(a_r, b_r) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 15 ++ d_r = DIM(a2_r, b2_r) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 16 ++ d_r = DIM(a_r, b_i) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 17 ++ d_r = DIM(b_i, a_r) ++ if (abs(d_r) > 1.0D-6) STOP 18 ++ ++ s_i = SIGN(-a_i, b_i) ++ if (s_i .ne. 4) STOP 19 ++ s_i = SIGN(-a2_i, b2_i) ++ if (s_i .ne. 4) STOP 20 ++ s_r = SIGN(a_r, -b_r) ++ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 21 ++ s_r = SIGN(a2_r, -b2_r) ++ if (abs(s_r - (-a2_r)) > 1.0D-6) STOP 22 ++ s_r = SIGN(a_r, -b_i) ++ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 23 ++ s_r = SIGN(-a_i, b_r) ++ if (abs(s_r - a_r) > 1.0D-6) STOP 24 ++ ++ mx_i = MAX(-a_i, -b_i, x_i, y_i) ++ if (mx_i .ne. x_i) STOP 25 ++ mx_i = MAX(-a2_i, -b2_i, x_i, y_i) ++ if (mx_i .ne. x_i) STOP 26 ++ mx_r = MAX(-a_r, -b_r, x_r, y_r) ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 27 ++ mx_r = MAX(-a_r, -b_r, x_r, y_r) ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 28 ++ mx_r = MAX(-a_i, -b_r, x_r, y_i) ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 29 ++ mx_i = MAXLOC(array_nan, 1) ++ if (mx_i .ne. 2) STOP 30 ++ ++ mn_i = MIN(-a_i, -b_i, x_i, y_i) ++ if (mn_i .ne. -a_i) STOP 31 ++ mn_i = MIN(-a2_i, -b2_i, x_i, y_i) ++ if (mn_i .ne. -a2_i) STOP 32 ++ mn_r = MIN(-a_r, -b_r, x_r, y_r) ++ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 33 ++ mn_r = MIN(-a2_r, -b2_r, x_r, y_r) ++ if (abs(mn_r - (-a2_r)) > 1.0D-6) STOP 34 ++ mn_r = MIN(-a_i, -b_r, x_r, y_i) ++ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 35 ++ mn_i = MINLOC(array_nan, 1) ++ if (mn_i .ne. 1) STOP 36 ++ END PROGRAM +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_3.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_3.f +new file mode 100644 +index 00000000000..0708b666633 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_3.f +@@ -0,0 +1,130 @@ ++! { dg-do compile } ++! { dg-options "-fdec -fno-dec-promotion" } ++! ++! Test promotion between integers and reals in intrinsic operations. ++! These operations are: mod, modulo, dim, sign, min, max, minloc and ++! maxloc. ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM promotion_int_real ++ REAL l/0.0/ ++ INTEGER a_i/4/ ++ INTEGER*4 a2_i/4/ ++ INTEGER b_i/3/ ++ INTEGER*8 b2_i/3/ ++ INTEGER x_i/2/ ++ INTEGER y_i/1/ ++ REAL a_r/4.0/ ++ REAL*4 a2_r/4.0/ ++ REAL b_r/3.0/ ++ REAL*8 b2_r/3.0/ ++ REAL x_r/2.0/ ++ REAL y_r/1.0/ ++ ++ REAL array_nan(4) ++ DATA array_nan(1)/-4.0/ ++ DATA array_nan(2)/3.0/ ++ DATA array_nan(3)/-2/ ++ ++ INTEGER m_i/0/ ++ REAL m_r/0.0/ ++ ++ INTEGER md_i/0/ ++ REAL md_r/0.0/ ++ ++ INTEGER d_i/0/ ++ REAL d_r/0.0/ ++ ++ INTEGER s_i/0/ ++ REAL s_r/0.0/ ++ ++ INTEGER mn_i/0/ ++ REAL mn_r/0.0/ ++ ++ INTEGER mx_i/0/ ++ REAL mx_r/0.0/ ++ ++ ! array_nan 4th position value is NAN ++ array_nan(4) = 0/l ++ ++ m_i = MOD(a_i, b_i) ++ if (m_i .ne. 1) STOP 1 ++ m_i = MOD(a2_i, b2_i) ++ if (m_i .ne. 1) STOP 2 ++ m_r = MOD(a_r, b_r) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 3 ++ m_r = MOD(a2_r, b2_r) ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 4 ++ m_r = MOD(a_i, b_r) ! { dg-error "'a' and 'p' arguments" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 5 ++ m_r = MOD(a_r, b_i) ! { dg-error "'a' and 'p' arguments" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 6 ++ ++ md_i = MODULO(a_i, b_i) ++ if (md_i .ne. 1) STOP 7 ++ md_i = MODULO(a2_i, b2_i) ++ if (md_i .ne. 1) STOP 8 ++ md_r = MODULO(a_r, b_r) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 9 ++ md_r = MODULO(a2_r, b2_r) ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 10 ++ md_r = MODULO(a_i, b_r) ! { dg-error "'a' and 'p' arguments" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 11 ++ md_r = MODULO(a_r, b_i) ! { dg-error "'a' and 'p' arguments" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 12 ++ ++ d_i = DIM(a_i, b_i) ++ if (d_i .ne. 1) STOP 13 ++ d_i = DIM(a2_i, b2_i) ++ if (d_i .ne. 1) STOP 14 ++ d_r = DIM(a_r, b_r) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 15 ++ d_r = DIM(a2_r, b2_r) ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 16 ++ d_r = DIM(a_r, b_i) ! { dg-error "'x' and 'y' arguments" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 17 ++ d_r = DIM(b_i, a_r) ! { dg-error "'x' and 'y' arguments" } ++ if (abs(d_r) > 1.0D-6) STOP 18 ++ ++ s_i = SIGN(-a_i, b_i) ++ if (s_i .ne. 4) STOP 19 ++ s_i = SIGN(-a2_i, b2_i) ! { dg-error "'b' argument" } ++ if (s_i .ne. 4) STOP 20 ++ s_r = SIGN(a_r, -b_r) ++ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 21 ++ s_r = SIGN(a2_r, -b2_r) ! { dg-error "'b' argument" } ++ if (abs(s_r - (-a2_r)) > 1.0D-6) STOP 22 ++ s_r = SIGN(a_r, -b_i) ! { dg-error "'b' argument" } ++ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 23 ++ s_r = SIGN(-a_i, b_r) ! { dg-error "'b' argument" } ++ if (abs(s_r - a_r) > 1.0D-6) STOP 24 ++ ++ mx_i = MAX(-a_i, -b_i, x_i, y_i) ++ if (mx_i .ne. x_i) STOP 25 ++ mx_i = MAX(-a2_i, -b2_i, x_i, y_i) ++ if (mx_i .ne. x_i) STOP 26 ++ mx_r = MAX(-a_r, -b_r, x_r, y_r) ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 27 ++ mx_r = MAX(-a_r, -b_r, x_r, y_r) ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 28 ++ mx_r = MAX(-a_i, -b_r, x_r, y_i) ! { dg-error "'a2' argument" } ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 29 ++ mx_i = MAXLOC(array_nan, 1) ++ if (mx_i .ne. 2) STOP 30 ++ ++ mn_i = MIN(-a_i, -b_i, x_i, y_i) ++ if (mn_i .ne. -a_i) STOP 31 ++ mn_i = MIN(-a2_i, -b2_i, x_i, y_i) ++ if (mn_i .ne. -a2_i) STOP 32 ++ mn_r = MIN(-a_r, -b_r, x_r, y_r) ++ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 33 ++ mn_r = MIN(-a2_r, -b2_r, x_r, y_r) ++ if (abs(mn_r - (-a2_r)) > 1.0D-6) STOP 34 ++ mn_r = MIN(-a_i, -b_r, x_r, y_i) ! { dg-error "'a2' argument" } ++ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 35 ++ mn_i = MINLOC(array_nan, 1) ++ if (mn_i .ne. 1) STOP 36 ++ END PROGRAM +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_4.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_4.f +new file mode 100644 +index 00000000000..efa4f236410 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_4.f +@@ -0,0 +1,118 @@ ++! { dg-do compile } ++! { dg-options "-fdec" } ++! ++! Test promotion between integers and reals in intrinsic operations. ++! These operations are: mod, modulo, dim, sign, min, max, minloc and ++! maxloc. ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM promotion_int_real ++ REAL l/0.0/ ++ LOGICAL a_l ++ LOGICAL*4 a2_l ++ LOGICAL b_l ++ LOGICAL*8 b2_l ++ LOGICAL x_l ++ LOGICAL y_l ++ CHARACTER a_c ++ CHARACTER*4 a2_c ++ CHARACTER b_c ++ CHARACTER*8 b2_c ++ CHARACTER x_c ++ CHARACTER y_c ++ ++ INTEGER m_i/0/ ++ REAL m_r/0.0/ ++ ++ INTEGER md_i/0/ ++ REAL md_r/0.0/ ++ ++ INTEGER d_i/0/ ++ REAL d_r/0.0/ ++ ++ INTEGER s_i/0/ ++ REAL s_r/0.0/ ++ ++ INTEGER mn_i/0/ ++ REAL mn_r/0.0/ ++ ++ INTEGER mx_i/0/ ++ REAL mx_r/0.0/ ++ ++ m_i = MOD(a_l, b_l) ! { dg-error "" } ++ if (m_i .ne. 1) STOP 1 ++ m_i = MOD(a2_l, b2_l) ! { dg-error "" } ++ if (m_i .ne. 1) STOP 2 ++ m_r = MOD(a_c, b_c) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 3 ++ m_r = MOD(a2_c, b2_c) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 4 ++ m_r = MOD(a_l, b_c) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 5 ++ m_r = MOD(a_c, b_l) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 6 ++ ++ md_i = MODULO(a_l, b_l) ! { dg-error "" } ++ if (md_i .ne. 1) STOP 7 ++ md_i = MODULO(a2_l, b2_l) ! { dg-error "" } ++ if (md_i .ne. 1) STOP 8 ++ md_r = MODULO(a_c, b_c) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 9 ++ md_r = MODULO(a2_c, b2_c) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 10 ++ md_r = MODULO(a_l, b_c) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 11 ++ md_r = MODULO(a_c, b_l) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 12 ++ ++ d_i = DIM(a_l, b_l) ! { dg-error "" } ++ if (d_i .ne. 1) STOP 13 ++ d_i = DIM(a2_l, b2_l) ! { dg-error "" } ++ if (d_i .ne. 1) STOP 14 ++ d_r = DIM(a_c, b_c) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 15 ++ d_r = DIM(a2_c, b2_c) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 16 ++ d_r = DIM(a_c, b_l) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 17 ++ d_r = DIM(b_l, a_c) ! { dg-error "" } ++ if (abs(d_r) > 1.0D-6) STOP 18 ++ ++ s_i = SIGN(-a_l, b_l) ! { dg-error "" } ++ if (s_i .ne. 4) STOP 19 ++ s_i = SIGN(-a2_l, b2_l) ! { dg-error "" } ++ if (s_i .ne. 4) STOP 20 ++ s_r = SIGN(a_c, -b_c) ! { dg-error "" } ++ if (abs(s_r - (-a_c)) > 1.0D-6) STOP 21 ! { dg-error "" } ++ s_r = SIGN(a2_c, -b2_c) ! { dg-error "" } ++ if (abs(s_r - (-a2_c)) > 1.0D-6) STOP 22 ! { dg-error "" } ++ s_r = SIGN(a_c, -b_l) ! { dg-error "" } ++ if (abs(s_r - (-a_c)) > 1.0D-6) STOP 23 ! { dg-error "" } ++ s_r = SIGN(-a_l, b_c) ! { dg-error "" } ++ if (abs(s_r - a_c) > 1.0D-6) STOP 24 ! { dg-error "" } ++ ++ mx_i = MAX(-a_l, -b_l, x_l, y_l) ! { dg-error "" } ++ if (mx_i .ne. x_l) STOP 25 ! { dg-error "" } ++ mx_i = MAX(-a2_l, -b2_l, x_l, y_l) ! { dg-error "" } ++ if (mx_i .ne. x_l) STOP 26 ! { dg-error "" } ++ mx_r = MAX(-a_c, -b_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mx_r - x_c) > 1.0D-6) STOP 27 ! { dg-error "" } ++ mx_r = MAX(-a_c, -b_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mx_r - x_c) > 1.0D-6) STOP 28 ! { dg-error "" } ++ mx_r = MAX(-a_l, -b_c, x_c, y_l) ! { dg-error "" } ++ if (abs(mx_r - x_c) > 1.0D-6) STOP 29 ! { dg-error "" } ++ ++ mn_i = MIN(-a_l, -b_l, x_l, y_l) ! { dg-error "" } ++ if (mn_i .ne. -a_l) STOP 31 ! { dg-error "" } ++ mn_i = MIN(-a2_l, -b2_l, x_l, y_l) ! { dg-error "" } ++ if (mn_i .ne. -a2_l) STOP 32 ! { dg-error "" } ++ mn_r = MIN(-a_c, -b_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mn_r - (-a_c)) > 1.0D-6) STOP 33 ! { dg-error "" } ++ mn_r = MIN(-a2_c, -b2_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mn_r - (-a2_c)) > 1.0D-6) STOP 34 ! { dg-error "" } ++ mn_r = MIN(-a_l, -b_c, x_c, y_l) ! { dg-error "" } ++ if (abs(mn_r - (-a_c)) > 1.0D-6) STOP 35 ! { dg-error "" } ++ END PROGRAM +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_5.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_5.f +new file mode 100644 +index 00000000000..d023af5086d +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_5.f +@@ -0,0 +1,118 @@ ++! { dg-do compile } ++! { dg-options "-fdec-promotion" } ++! ++! Test promotion between integers and reals in intrinsic operations. ++! These operations are: mod, modulo, dim, sign, min, max, minloc and ++! maxloc. ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM promotion_int_real ++ REAL l/0.0/ ++ LOGICAL a_l ++ LOGICAL*4 a2_l ++ LOGICAL b_l ++ LOGICAL*8 b2_l ++ LOGICAL x_l ++ LOGICAL y_l ++ CHARACTER a_c ++ CHARACTER*4 a2_c ++ CHARACTER b_c ++ CHARACTER*8 b2_c ++ CHARACTER x_c ++ CHARACTER y_c ++ ++ INTEGER m_i/0/ ++ REAL m_r/0.0/ ++ ++ INTEGER md_i/0/ ++ REAL md_r/0.0/ ++ ++ INTEGER d_i/0/ ++ REAL d_r/0.0/ ++ ++ INTEGER s_i/0/ ++ REAL s_r/0.0/ ++ ++ INTEGER mn_i/0/ ++ REAL mn_r/0.0/ ++ ++ INTEGER mx_i/0/ ++ REAL mx_r/0.0/ ++ ++ m_i = MOD(a_l, b_l) ! { dg-error "" } ++ if (m_i .ne. 1) STOP 1 ++ m_i = MOD(a2_l, b2_l) ! { dg-error "" } ++ if (m_i .ne. 1) STOP 2 ++ m_r = MOD(a_c, b_c) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 3 ++ m_r = MOD(a2_c, b2_c) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 4 ++ m_r = MOD(a_l, b_c) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 5 ++ m_r = MOD(a_c, b_l) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 6 ++ ++ md_i = MODULO(a_l, b_l) ! { dg-error "" } ++ if (md_i .ne. 1) STOP 7 ++ md_i = MODULO(a2_l, b2_l) ! { dg-error "" } ++ if (md_i .ne. 1) STOP 8 ++ md_r = MODULO(a_c, b_c) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 9 ++ md_r = MODULO(a2_c, b2_c) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 10 ++ md_r = MODULO(a_l, b_c) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 11 ++ md_r = MODULO(a_c, b_l) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 12 ++ ++ d_i = DIM(a_l, b_l) ! { dg-error "" } ++ if (d_i .ne. 1) STOP 13 ++ d_i = DIM(a2_l, b2_l) ! { dg-error "" } ++ if (d_i .ne. 1) STOP 14 ++ d_r = DIM(a_c, b_c) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 15 ++ d_r = DIM(a2_c, b2_c) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 16 ++ d_r = DIM(a_c, b_l) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 17 ++ d_r = DIM(b_l, a_c) ! { dg-error "" } ++ if (abs(d_r) > 1.0D-6) STOP 18 ++ ++ s_i = SIGN(-a_l, b_l) ! { dg-error "" } ++ if (s_i .ne. 4) STOP 19 ++ s_i = SIGN(-a2_l, b2_l) ! { dg-error "" } ++ if (s_i .ne. 4) STOP 20 ++ s_r = SIGN(a_c, -b_c) ! { dg-error "" } ++ if (abs(s_r - (-a_c)) > 1.0D-6) STOP 21 ! { dg-error "" } ++ s_r = SIGN(a2_c, -b2_c) ! { dg-error "" } ++ if (abs(s_r - (-a2_c)) > 1.0D-6) STOP 22 ! { dg-error "" } ++ s_r = SIGN(a_c, -b_l) ! { dg-error "" } ++ if (abs(s_r - (-a_c)) > 1.0D-6) STOP 23 ! { dg-error "" } ++ s_r = SIGN(-a_l, b_c) ! { dg-error "" } ++ if (abs(s_r - a_c) > 1.0D-6) STOP 24 ! { dg-error "" } ++ ++ mx_i = MAX(-a_l, -b_l, x_l, y_l) ! { dg-error "" } ++ if (mx_i .ne. x_l) STOP 25 ! { dg-error "" } ++ mx_i = MAX(-a2_l, -b2_l, x_l, y_l) ! { dg-error "" } ++ if (mx_i .ne. x_l) STOP 26 ! { dg-error "" } ++ mx_r = MAX(-a_c, -b_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mx_r - x_c) > 1.0D-6) STOP 27 ! { dg-error "" } ++ mx_r = MAX(-a_c, -b_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mx_r - x_c) > 1.0D-6) STOP 28 ! { dg-error "" } ++ mx_r = MAX(-a_l, -b_c, x_c, y_l) ! { dg-error "" } ++ if (abs(mx_r - x_c) > 1.0D-6) STOP 29 ! { dg-error "" } ++ ++ mn_i = MIN(-a_l, -b_l, x_l, y_l) ! { dg-error "" } ++ if (mn_i .ne. -a_l) STOP 31 ! { dg-error "" } ++ mn_i = MIN(-a2_l, -b2_l, x_l, y_l) ! { dg-error "" } ++ if (mn_i .ne. -a2_l) STOP 32 ! { dg-error "" } ++ mn_r = MIN(-a_c, -b_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mn_r - (-a_c)) > 1.0D-6) STOP 33 ! { dg-error "" } ++ mn_r = MIN(-a2_c, -b2_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mn_r - (-a2_c)) > 1.0D-6) STOP 34 ! { dg-error "" } ++ mn_r = MIN(-a_l, -b_c, x_c, y_l) ! { dg-error "" } ++ if (abs(mn_r - (-a_c)) > 1.0D-6) STOP 35 ! { dg-error "" } ++ END PROGRAM +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_6.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_6.f +new file mode 100644 +index 00000000000..00f8fb88f1b +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_6.f +@@ -0,0 +1,118 @@ ++! { dg-do compile } ++! { dg-options "-fdec" } ++! ++! Test promotion between integers and reals in intrinsic operations. ++! These operations are: mod, modulo, dim, sign, min, max, minloc and ++! maxloc. ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM promotion_int_real ++ REAL l/0.0/ ++ INTEGER a_i/4/ ++ INTEGER*4 a2_i/4/ ++ CHARACTER b_c ++ CHARACTER*8 b2_c ++ INTEGER x_i/2/ ++ CHARACTER y_c ++ REAL a_r/4.0/ ++ REAL*4 a2_r/4.0/ ++ LOGICAL b_l ++ LOGICAL*8 b2_l ++ REAL x_r/2.0/ ++ LOGICAL y_l ++ ++ INTEGER m_i/0/ ++ REAL m_r/0.0/ ++ ++ INTEGER md_i/0/ ++ REAL md_r/0.0/ ++ ++ INTEGER d_i/0/ ++ REAL d_r/0.0/ ++ ++ INTEGER s_i/0/ ++ REAL s_r/0.0/ ++ ++ INTEGER mn_i/0/ ++ REAL mn_r/0.0/ ++ ++ INTEGER mx_i/0/ ++ REAL mx_r/0.0/ ++ ++ m_i = MOD(a_i, b_c) ! { dg-error "" } ++ if (m_i .ne. 1) STOP 1 ++ m_i = MOD(a2_i, b2_c) ! { dg-error "" } ++ if (m_i .ne. 1) STOP 2 ++ m_r = MOD(a_r, b_l) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 3 ++ m_r = MOD(a2_r, b2_l) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 4 ++ m_r = MOD(a_i, b_l) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 5 ++ m_r = MOD(a_r, b_c) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 6 ++ ++ md_i = MODULO(a_i, b_c) ! { dg-error "" } ++ if (md_i .ne. 1) STOP 7 ++ md_i = MODULO(a2_i, b2_c) ! { dg-error "" } ++ if (md_i .ne. 1) STOP 8 ++ md_r = MODULO(a_r, b_l) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 9 ++ md_r = MODULO(a2_r, b2_l) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 10 ++ md_r = MODULO(a_i, b_l) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 11 ++ md_r = MODULO(a_r, b_c) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 12 ++ ++ d_i = DIM(a_i, b_c) ! { dg-error "" } ++ if (d_i .ne. 1) STOP 13 ++ d_i = DIM(a2_i, b2_c) ! { dg-error "" } ++ if (d_i .ne. 1) STOP 14 ++ d_r = DIM(a_r, b_l) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 15 ++ d_r = DIM(a2_r, b2_l) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 16 ++ d_r = DIM(a_r, b_c) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 17 ++ d_r = DIM(b_c, a_r) ! { dg-error "" } ++ if (abs(d_r) > 1.0D-6) STOP 18 ++ ++ s_i = SIGN(-a_i, b_c) ! { dg-error "" } ++ if (s_i .ne. 4) STOP 19 ++ s_i = SIGN(-a2_i, b2_c) ! { dg-error "" } ++ if (s_i .ne. 4) STOP 20 ++ s_r = SIGN(a_r, -b_l) ! { dg-error "" } ++ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 21 ++ s_r = SIGN(a2_r, -b2_l) ! { dg-error "" } ++ if (abs(s_r - (-a2_r)) > 1.0D-6) STOP 22 ++ s_r = SIGN(a_r, -b_c) ! { dg-error "" } ++ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 23 ++ s_r = SIGN(-a_i, b_l) ! { dg-error "" } ++ if (abs(s_r - a_r) > 1.0D-6) STOP 24 ++ ++ mx_i = MAX(-a_i, -b_c, x_i, y_c) ! { dg-error "" } ++ if (mx_i .ne. x_i) STOP 25 ++ mx_i = MAX(-a2_i, -b2_c, x_i, y_c) ! { dg-error "" } ++ if (mx_i .ne. x_i) STOP 26 ++ mx_r = MAX(-a_r, -b_l, x_r, y_l) ! { dg-error "" } ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 27 ++ mx_r = MAX(-a_r, -b_l, x_r, y_l) ! { dg-error "" } ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 28 ++ mx_r = MAX(-a_i, -b_l, x_r, y_c) ! { dg-error "" } ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 29 ++ ++ mn_i = MIN(-a_i, -b_c, x_i, y_c) ! { dg-error "" } ++ if (mn_i .ne. -a_i) STOP 31 ++ mn_i = MIN(-a2_i, -b2_c, x_i, y_c) ! { dg-error "" } ++ if (mn_i .ne. -a2_i) STOP 32 ++ mn_r = MIN(-a_r, -b_l, x_r, y_l) ! { dg-error "" } ++ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 33 ++ mn_r = MIN(-a2_r, -b2_l, x_r, y_l) ! { dg-error "" } ++ if (abs(mn_r - (-a2_r)) > 1.0D-6) STOP 34 ++ mn_r = MIN(-a_i, -b_l, x_r, y_c) ! { dg-error "" } ++ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 35 ++ END PROGRAM +diff --git a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_7.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_7.f +new file mode 100644 +index 00000000000..1d4150d81c0 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion_7.f +@@ -0,0 +1,118 @@ ++! { dg-do compile } ++! { dg-options "-fdec-promotion" } ++! ++! Test promotion between integers and reals in intrinsic operations. ++! These operations are: mod, modulo, dim, sign, min, max, minloc and ++! maxloc. ++! ++! Contributed by Francisco Redondo Marchena ++! and Jeff Law ++! Modified by Mark Eggleston ++! ++ PROGRAM promotion_int_real ++ REAL l/0.0/ ++ INTEGER a_i/4/ ++ INTEGER*4 a2_i/4/ ++ CHARACTER b_c ++ CHARACTER*8 b2_c ++ INTEGER x_i/2/ ++ CHARACTER y_c ++ REAL a_r/4.0/ ++ REAL*4 a2_r/4.0/ ++ LOGICAL b_l ++ LOGICAL*8 b2_l ++ REAL x_r/2.0/ ++ LOGICAL y_l ++ ++ INTEGER m_i/0/ ++ REAL m_r/0.0/ ++ ++ INTEGER md_i/0/ ++ REAL md_r/0.0/ ++ ++ INTEGER d_i/0/ ++ REAL d_r/0.0/ ++ ++ INTEGER s_i/0/ ++ REAL s_r/0.0/ ++ ++ INTEGER mn_i/0/ ++ REAL mn_r/0.0/ ++ ++ INTEGER mx_i/0/ ++ REAL mx_r/0.0/ ++ ++ m_i = MOD(a_i, b_c) ! { dg-error "" } ++ if (m_i .ne. 1) STOP 1 ++ m_i = MOD(a2_i, b2_c) ! { dg-error "" } ++ if (m_i .ne. 1) STOP 2 ++ m_r = MOD(a_r, b_l) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 3 ++ m_r = MOD(a2_r, b2_l) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 4 ++ m_r = MOD(a_i, b_l) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 5 ++ m_r = MOD(a_r, b_c) ! { dg-error "" } ++ if (abs(m_r - 1.0) > 1.0D-6) STOP 6 ++ ++ md_i = MODULO(a_i, b_c) ! { dg-error "" } ++ if (md_i .ne. 1) STOP 7 ++ md_i = MODULO(a2_i, b2_c) ! { dg-error "" } ++ if (md_i .ne. 1) STOP 8 ++ md_r = MODULO(a_r, b_l) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 9 ++ md_r = MODULO(a2_r, b2_l) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 10 ++ md_r = MODULO(a_i, b_l) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 11 ++ md_r = MODULO(a_r, b_c) ! { dg-error "" } ++ if (abs(md_r - 1.0) > 1.0D-6) STOP 12 ++ ++ d_i = DIM(a_i, b_c) ! { dg-error "" } ++ if (d_i .ne. 1) STOP 13 ++ d_i = DIM(a2_i, b2_c) ! { dg-error "" } ++ if (d_i .ne. 1) STOP 14 ++ d_r = DIM(a_r, b_l) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 15 ++ d_r = DIM(a2_r, b2_l) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 16 ++ d_r = DIM(a_r, b_c) ! { dg-error "" } ++ if (abs(d_r - 1.0) > 1.0D-6) STOP 17 ++ d_r = DIM(b_c, a_r) ! { dg-error "" } ++ if (abs(d_r) > 1.0D-6) STOP 18 ++ ++ s_i = SIGN(-a_i, b_c) ! { dg-error "" } ++ if (s_i .ne. 4) STOP 19 ++ s_i = SIGN(-a2_i, b2_c) ! { dg-error "" } ++ if (s_i .ne. 4) STOP 20 ++ s_r = SIGN(a_r, -b_l) ! { dg-error "" } ++ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 21 ++ s_r = SIGN(a2_r, -b2_l) ! { dg-error "" } ++ if (abs(s_r - (-a2_r)) > 1.0D-6) STOP 22 ++ s_r = SIGN(a_r, -b_c) ! { dg-error "" } ++ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 23 ++ s_r = SIGN(-a_i, b_l) ! { dg-error "" } ++ if (abs(s_r - a_r) > 1.0D-6) STOP 24 ++ ++ mx_i = MAX(-a_i, -b_c, x_i, y_c) ! { dg-error "" } ++ if (mx_i .ne. x_i) STOP 25 ++ mx_i = MAX(-a2_i, -b2_c, x_i, y_c) ! { dg-error "" } ++ if (mx_i .ne. x_i) STOP 26 ++ mx_r = MAX(-a_r, -b_l, x_r, y_l) ! { dg-error "" } ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 27 ++ mx_r = MAX(-a_r, -b_l, x_r, y_l) ! { dg-error "" } ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 28 ++ mx_r = MAX(-a_i, -b_l, x_r, y_c) ! { dg-error "" } ++ if (abs(mx_r - x_r) > 1.0D-6) STOP 29 ++ ++ mn_i = MIN(-a_i, -b_c, x_i, y_c) ! { dg-error "" } ++ if (mn_i .ne. -a_i) STOP 31 ++ mn_i = MIN(-a2_i, -b2_c, x_i, y_c) ! { dg-error "" } ++ if (mn_i .ne. -a2_i) STOP 32 ++ mn_r = MIN(-a_r, -b_l, x_r, y_l) ! { dg-error "" } ++ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 33 ++ mn_r = MIN(-a2_r, -b2_l, x_r, y_l) ! { dg-error "" } ++ if (abs(mn_r - (-a2_r)) > 1.0D-6) STOP 34 ++ mn_r = MIN(-a_i, -b_l, x_r, y_c) ! { dg-error "" } ++ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 35 ++ END PROGRAM +diff --git a/gcc/testsuite/gfortran.dg/dec_kind_promotion-1.f b/gcc/testsuite/gfortran.dg/dec_kind_promotion-1.f +new file mode 100644 +index 00000000000..435bf98350c +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_kind_promotion-1.f +@@ -0,0 +1,40 @@ ++!{ dg-do run } ++!{ dg-options "-fdec" } ++! ++! integer types of a smaller kind than expected should be ++! accepted by type specific intrinsic functions ++! ++! Contributed by Mark Eggleston ++! ++ program test_small_type_promtion ++ implicit none ++ integer(1) :: a = 1 ++ integer :: i ++ if (iiabs(-9_1).ne.9) stop 1 ++ if (iabs(-9_1).ne.9) stop 2 ++ if (iabs(-9_2).ne.9) stop 3 ++ if (jiabs(-9_1).ne.9) stop 4 ++ if (jiabs(-9_2).ne.9) stop 5 ++ if (iishft(1_1, 2).ne.4) stop 6 ++ if (jishft(1_1, 2).ne.4) stop 7 ++ if (jishft(1_2, 2).ne.4) stop 8 ++ if (kishft(1_1, 2).ne.4) stop 9 ++ if (kishft(1_2, 2).ne.4) stop 10 ++ if (kishft(1_4, 2).ne.4) stop 11 ++ if (imod(17_1, 3).ne.2) stop 12 ++ if (jmod(17_1, 3).ne.2) stop 13 ++ if (jmod(17_2, 3).ne.2) stop 14 ++ if (kmod(17_1, 3).ne.2) stop 15 ++ if (kmod(17_2, 3).ne.2) stop 16 ++ if (kmod(17_4, 3).ne.2) stop 17 ++ if (inot(5_1).ne.-6) stop 18 ++ if (jnot(5_1).ne.-6) stop 19 ++ if (jnot(5_2).ne.-6) stop 20 ++ if (knot(5_1).ne.-6) stop 21 ++ if (knot(5_2).ne.-6) stop 22 ++ if (knot(5_4).ne.-6) stop 23 ++ if (isign(-77_1, 1).ne.77) stop 24 ++ if (isign(-77_1, -1).ne.-77) stop 25 ++ if (isign(-77_2, 1).ne.77) stop 26 ++ if (isign(-77_2, -1).ne.-77) stop 27 ++ end program +diff --git a/gcc/testsuite/gfortran.dg/dec_kind_promotion-2.f b/gcc/testsuite/gfortran.dg/dec_kind_promotion-2.f +new file mode 100644 +index 00000000000..7b1697ca665 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_kind_promotion-2.f +@@ -0,0 +1,40 @@ ++!{ dg-do run } ++!{ dg-options "-fdec-intrinsic-ints -fdec-promotion" } ++! ++! integer types of a smaller kind than expected should be ++! accepted by type specific intrinsic functions ++! ++! Contributed by Mark Eggleston ++! ++ program test_small_type_promtion ++ implicit none ++ integer(1) :: a = 1 ++ integer :: i ++ if (iiabs(-9_1).ne.9) stop 1 ++ if (iabs(-9_1).ne.9) stop 2 ++ if (iabs(-9_2).ne.9) stop 3 ++ if (jiabs(-9_1).ne.9) stop 4 ++ if (jiabs(-9_2).ne.9) stop 5 ++ if (iishft(1_1, 2).ne.4) stop 6 ++ if (jishft(1_1, 2).ne.4) stop 7 ++ if (jishft(1_2, 2).ne.4) stop 8 ++ if (kishft(1_1, 2).ne.4) stop 9 ++ if (kishft(1_2, 2).ne.4) stop 10 ++ if (kishft(1_4, 2).ne.4) stop 11 ++ if (imod(17_1, 3).ne.2) stop 12 ++ if (jmod(17_1, 3).ne.2) stop 13 ++ if (jmod(17_2, 3).ne.2) stop 14 ++ if (kmod(17_1, 3).ne.2) stop 15 ++ if (kmod(17_2, 3).ne.2) stop 16 ++ if (kmod(17_4, 3).ne.2) stop 17 ++ if (inot(5_1).ne.-6) stop 18 ++ if (jnot(5_1).ne.-6) stop 19 ++ if (jnot(5_2).ne.-6) stop 20 ++ if (knot(5_1).ne.-6) stop 21 ++ if (knot(5_2).ne.-6) stop 22 ++ if (knot(5_4).ne.-6) stop 23 ++ if (isign(-77_1, 1).ne.77) stop 24 ++ if (isign(-77_1, -1).ne.-77) stop 25 ++ if (isign(-77_2, 1).ne.77) stop 26 ++ if (isign(-77_2, -1).ne.-77) stop 27 ++ end program +diff --git a/gcc/testsuite/gfortran.dg/dec_kind_promotion-3.f b/gcc/testsuite/gfortran.dg/dec_kind_promotion-3.f +new file mode 100644 +index 00000000000..db8dff6c55d +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_kind_promotion-3.f +@@ -0,0 +1,39 @@ ++!{ dg-do compile } ++!{ dg-options "-fdec -fno-dec-promotion" } ++! ++! integer types of a smaller kind than expected should be ++! accepted by type specific intrinsic functions ++! ++! Contributed by Mark Eggleston ++! ++ program test_small_type_promtion ++ integer(1) :: a = 1 ++ integer :: i ++ if (iiabs(-9_1).ne.9) stop 1 ++ if (iabs(-9_1).ne.9) stop 2 ! { dg-error "type mismatch in argument" } ++ if (iabs(-9_2).ne.9) stop 3 ! { dg-error "type mismatch in argument" } ++ if (jiabs(-9_1).ne.9) stop 4 ++ if (jiabs(-9_2).ne.9) stop 5 ++ if (iishft(1_1, 2).ne.4) stop 6 ++ if (jishft(1_1, 2).ne.4) stop 7 ++ if (jishft(1_2, 2).ne.4) stop 8 ++ if (kishft(1_1, 2).ne.4) stop 9 ++ if (kishft(1_2, 2).ne.4) stop 10 ++ if (kishft(1_4, 2).ne.4) stop 11 ++ if (imod(17_1, 3).ne.2) stop 12 ++ if (jmod(17_1, 3).ne.2) stop 13 ++ if (jmod(17_2, 3).ne.2) stop 14 ++ if (kmod(17_1, 3).ne.2) stop 15 ++ if (kmod(17_2, 3).ne.2) stop 16 ++ if (kmod(17_4, 3).ne.2) stop 17 ++ if (inot(5_1).ne.-6) stop 18 ++ if (jnot(5_1).ne.-6) stop 19 ++ if (jnot(5_2).ne.-6) stop 20 ++ if (knot(5_1).ne.-6) stop 21 ++ if (knot(5_2).ne.-6) stop 22 ++ if (knot(5_4).ne.-6) stop 23 ++ if (isign(-77_1, 1).ne.77) stop 24 ! { dg-error "type mismatch in argument" } ++ if (isign(-77_1, -1).ne.-77) stop 25 ! { dg-error "type mismatch in argument" } ++ if (isign(-77_2, 1).ne.77) stop 26 ! { dg-error "type mismatch in argument" } ++ if (isign(-77_2, -1).ne.-77) stop 27 ! { dg-error "type mismatch in argument" } ++ end program +-- +2.27.0 + diff --git a/gcc11-fortran-fdec-sequence.patch b/gcc11-fortran-fdec-sequence.patch new file mode 100644 index 0000000..7b9ce71 --- /dev/null +++ b/gcc11-fortran-fdec-sequence.patch @@ -0,0 +1,262 @@ +From bb76446db10c21860a4e19569ce3e350d8a2b59f Mon Sep 17 00:00:00 2001 +From: Mark Eggleston +Date: Fri, 22 Jan 2021 15:00:44 +0000 +Subject: [PATCH 09/10] Add the SEQUENCE attribute by default if it's not + present. + +Use -fdec-sequence to enable this feature. Also enabled by -fdec. +--- + gcc/fortran/lang.opt | 4 ++ + gcc/fortran/options.c | 1 + + gcc/fortran/resolve.c | 13 ++++- + ...dd_SEQUENCE_to_COMMON_block_by_default_1.f | 57 +++++++++++++++++++ + ...dd_SEQUENCE_to_COMMON_block_by_default_2.f | 57 +++++++++++++++++++ + ...dd_SEQUENCE_to_COMMON_block_by_default_3.f | 57 +++++++++++++++++++ + 6 files changed, 186 insertions(+), 3 deletions(-) + create mode 100644 gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_1.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_2.f + create mode 100644 gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_3.f + +diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt +index 4ca2f93f2df..019c798cf09 100644 +--- a/gcc/fortran/lang.opt ++++ b/gcc/fortran/lang.opt +@@ -509,6 +509,10 @@ fdec-promotion + Fortran Var(flag_dec_promotion) + Add support for type promotion in intrinsic arguments. + ++fdec-sequence ++Fortran Var(flag_dec_sequence) ++Add the SEQUENCE attribute by default if it's not present. ++ + fdec-structure + Fortran Var(flag_dec_structure) + Enable support for DEC STRUCTURE/RECORD. +diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c +index 15079c7e95a..050f56fdc25 100644 +--- a/gcc/fortran/options.c ++++ b/gcc/fortran/options.c +@@ -83,6 +83,7 @@ set_dec_flags (int value) + SET_BITFLAG (flag_dec_override_kind, value, value); + SET_BITFLAG (flag_dec_non_logical_if, value, value); + SET_BITFLAG (flag_dec_promotion, value, value); ++ SET_BITFLAG (flag_dec_sequence, value, value); + } + + /* Finalize DEC flags. */ +diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c +index 07dd039f3bf..fe7d0cc5944 100644 +--- a/gcc/fortran/resolve.c ++++ b/gcc/fortran/resolve.c +@@ -978,9 +978,16 @@ resolve_common_vars (gfc_common_head *common_block, bool named_common) + + if (!(csym->ts.u.derived->attr.sequence + || csym->ts.u.derived->attr.is_bind_c)) +- gfc_error_now ("Derived type variable %qs in COMMON at %L " +- "has neither the SEQUENCE nor the BIND(C) " +- "attribute", csym->name, &csym->declared_at); ++ { ++ if (flag_dec_sequence) ++ /* Assume sequence. */ ++ csym->ts.u.derived->attr.sequence = 1; ++ else ++ gfc_error_now ("Derived type variable '%s' in COMMON at %L " ++ "has neither the SEQUENCE nor the BIND(C) " ++ "attribute", csym->name, &csym->declared_at); ++ } ++ + if (csym->ts.u.derived->attr.alloc_comp) + gfc_error_now ("Derived type variable %qs in COMMON at %L " + "has an ultimate component that is " +diff --git a/gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_1.f b/gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_1.f +new file mode 100644 +index 00000000000..fe7b39625eb +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_1.f +@@ -0,0 +1,57 @@ ++! { dg-do run } ++! { dg-options "-fdec" } ++! ++! Test add default SEQUENCE attribute derived types appearing in ++! COMMON blocks and EQUIVALENCE statements. ++! ++! Contributed by Francisco Redondo Marchena ++! Modified by Mark Eggleston ++! ++ MODULE SEQ ++ TYPE STRUCT1 ++ INTEGER*4 ID ++ INTEGER*4 TYPE ++ INTEGER*8 DEFVAL ++ CHARACTER*(4) NAME ++ LOGICAL*1 NIL ++ END TYPE STRUCT1 ++ END MODULE ++ ++ SUBROUTINE A ++ USE SEQ ++ TYPE (STRUCT1) S ++ COMMON /BLOCK1/ S ++ IF (S%ID.NE.5) STOP 1 ++ IF (S%TYPE.NE.1000) STOP 2 ++ IF (S%DEFVAL.NE.-99) STOP 3 ++ IF (S%NAME.NE."JANE") STOP 4 ++ IF (S%NIL.NEQV..FALSE.) STOP 5 ++ END SUBROUTINE ++ ++ PROGRAM sequence_att_common ++ USE SEQ ++ IMPLICIT NONE ++ TYPE (STRUCT1) S1 ++ TYPE (STRUCT1) S2 ++ TYPE (STRUCT1) S3 ++ ++ EQUIVALENCE (S1,S2) ++ COMMON /BLOCK1/ S3 ++ ++ S1%ID = 5 ++ S1%TYPE = 1000 ++ S1%DEFVAL = -99 ++ S1%NAME = "JANE" ++ S1%NIL = .FALSE. ++ ++ IF (S2%ID.NE.5) STOP 1 ++ IF (S2%TYPE.NE.1000) STOP 2 ++ IF (S2%DEFVAL.NE.-99) STOP 3 ++ IF (S2%NAME.NE."JANE") STOP 4 ++ IF (S2%NIL.NEQV..FALSE.) STOP 5 ++ ++ S3 = S1 ++ ++ CALL A ++ ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_2.f b/gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_2.f +new file mode 100644 +index 00000000000..83512f0f3a2 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_2.f +@@ -0,0 +1,57 @@ ++! { dg-do run } ++! { dg-options "-fdec-sequence" } ++! ++! Test add default SEQUENCE attribute derived types appearing in ++! COMMON blocks and EQUIVALENCE statements. ++! ++! Contributed by Francisco Redondo Marchena ++! Modified by Mark Eggleston ++! ++ MODULE SEQ ++ TYPE STRUCT1 ++ INTEGER*4 ID ++ INTEGER*4 TYPE ++ INTEGER*8 DEFVAL ++ CHARACTER*(4) NAME ++ LOGICAL*1 NIL ++ END TYPE STRUCT1 ++ END MODULE ++ ++ SUBROUTINE A ++ USE SEQ ++ TYPE (STRUCT1) S ++ COMMON /BLOCK1/ S ++ IF (S%ID.NE.5) STOP 1 ++ IF (S%TYPE.NE.1000) STOP 2 ++ IF (S%DEFVAL.NE.-99) STOP 3 ++ IF (S%NAME.NE."JANE") STOP 4 ++ IF (S%NIL.NEQV..FALSE.) STOP 5 ++ END SUBROUTINE ++ ++ PROGRAM sequence_att_common ++ USE SEQ ++ IMPLICIT NONE ++ TYPE (STRUCT1) S1 ++ TYPE (STRUCT1) S2 ++ TYPE (STRUCT1) S3 ++ ++ EQUIVALENCE (S1,S2) ++ COMMON /BLOCK1/ S3 ++ ++ S1%ID = 5 ++ S1%TYPE = 1000 ++ S1%DEFVAL = -99 ++ S1%NAME = "JANE" ++ S1%NIL = .FALSE. ++ ++ IF (S2%ID.NE.5) STOP 1 ++ IF (S2%TYPE.NE.1000) STOP 2 ++ IF (S2%DEFVAL.NE.-99) STOP 3 ++ IF (S2%NAME.NE."JANE") STOP 4 ++ IF (S2%NIL.NEQV..FALSE.) STOP 5 ++ ++ S3 = S1 ++ ++ CALL A ++ ++ END +diff --git a/gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_3.f b/gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_3.f +new file mode 100644 +index 00000000000..26cd59f9090 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/dec_add_SEQUENCE_to_COMMON_block_by_default_3.f +@@ -0,0 +1,57 @@ ++! { dg-do compile } ++! { dg-options "-fdec -fno-dec-sequence" } ++! ++! Test add default SEQUENCE attribute derived types appearing in ++! COMMON blocks and EQUIVALENCE statements. ++! ++! Contributed by Francisco Redondo Marchena ++! Modified by Mark Eggleston ++! ++ MODULE SEQ ++ TYPE STRUCT1 ++ INTEGER*4 ID ++ INTEGER*4 TYPE ++ INTEGER*8 DEFVAL ++ CHARACTER*(4) NAME ++ LOGICAL*1 NIL ++ END TYPE STRUCT1 ++ END MODULE ++ ++ SUBROUTINE A ++ USE SEQ ++ TYPE (STRUCT1) S ! { dg-error "Derived type variable" } ++ COMMON /BLOCK1/ S ++ IF (S%ID.NE.5) STOP 1 ++ IF (S%TYPE.NE.1000) STOP 2 ++ IF (S%DEFVAL.NE.-99) STOP 3 ++ IF (S%NAME.NE."JANE") STOP 4 ++ IF (S%NIL.NEQV..FALSE.) STOP 5 ++ END SUBROUTINE ++ ++ PROGRAM sequence_att_common ++ USE SEQ ++ IMPLICIT NONE ++ TYPE (STRUCT1) S1 ++ TYPE (STRUCT1) S2 ++ TYPE (STRUCT1) S3 ! { dg-error "Derived type variable" } ++ ++ EQUIVALENCE (S1,S2) ! { dg-error "Derived type variable" } ++ COMMON /BLOCK1/ S3 ++ ++ S1%ID = 5 ++ S1%TYPE = 1000 ++ S1%DEFVAL = -99 ++ S1%NAME = "JANE" ++ S1%NIL = .FALSE. ++ ++ IF (S2%ID.NE.5) STOP 1 ++ IF (S2%TYPE.NE.1000) STOP 2 ++ IF (S2%DEFVAL.NE.-99) STOP 3 ++ IF (S2%NAME.NE."JANE") STOP 4 ++ IF (S2%NIL.NEQV..FALSE.) STOP 5 ++ ++ S3 = S1 ++ ++ CALL A ++ ++ END +-- +2.27.0 + diff --git a/gcc11-fortran-flogical-as-integer.patch b/gcc11-fortran-flogical-as-integer.patch new file mode 100644 index 0000000..41cbf60 --- /dev/null +++ b/gcc11-fortran-flogical-as-integer.patch @@ -0,0 +1,305 @@ +From 9b45f3063dfd2b893e7963a4828c1b0afecdc68a Mon Sep 17 00:00:00 2001 +From: Mark Eggleston +Date: Fri, 22 Jan 2021 12:41:46 +0000 +Subject: [PATCH 02/10] Convert LOGICAL to INTEGER for arithmetic ops, and vice + versa + +We allow converting LOGICAL types to INTEGER when doing arithmetic +operations, and converting INTEGER types to LOGICAL for use in +boolean operations. + +This feature is enabled with the -flogical-as-integer flag. + +Note: using this feature will disable bitwise logical operations enabled by +-fdec. +--- + gcc/fortran/lang.opt | 4 ++ + gcc/fortran/resolve.c | 55 ++++++++++++++++++- + .../logical_to_integer_and_vice_versa_1.f | 31 +++++++++++ + .../logical_to_integer_and_vice_versa_2.f | 31 +++++++++++ + .../logical_to_integer_and_vice_versa_3.f | 33 +++++++++++ + .../logical_to_integer_and_vice_versa_4.f | 33 +++++++++++ + 6 files changed, 186 insertions(+), 1 deletion(-) + create mode 100644 gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_1.f + create mode 100644 gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_2.f + create mode 100644 gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_3.f + create mode 100644 gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_4.f + +diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt +index 52bd522051e..c4da248f07c 100644 +--- a/gcc/fortran/lang.opt ++++ b/gcc/fortran/lang.opt +@@ -497,6 +497,10 @@ fdec-static + Fortran Var(flag_dec_static) + Enable DEC-style STATIC and AUTOMATIC attributes. + ++flogical-as-integer ++Fortran Var(flag_logical_as_integer) ++Convert from integer to logical or logical to integer for arithmetic operations. ++ + fdefault-double-8 + Fortran Var(flag_default_double) + Set the default double precision kind to an 8 byte wide type. +diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c +index c075d0fa0c4..4b90cb59902 100644 +--- a/gcc/fortran/resolve.c ++++ b/gcc/fortran/resolve.c +@@ -3915,7 +3915,6 @@ lookup_uop_fuzzy (const char *op, gfc_symtree *uop) + return gfc_closest_fuzzy_match (op, candidates); + } + +- + /* Callback finding an impure function as an operand to an .and. or + .or. expression. Remember the last function warned about to + avoid double warnings when recursing. */ +@@ -3975,6 +3974,22 @@ convert_hollerith_to_character (gfc_expr *e) + } + } + ++/* If E is a logical, convert it to an integer and issue a warning ++ for the conversion. */ ++ ++static void ++convert_integer_to_logical (gfc_expr *e) ++{ ++ if (e->ts.type == BT_INTEGER) ++ { ++ /* Convert to LOGICAL */ ++ gfc_typespec t; ++ t.type = BT_LOGICAL; ++ t.kind = 1; ++ gfc_convert_type_warn (e, &t, 2, 1); ++ } ++} ++ + /* Convert to numeric and issue a warning for the conversion. */ + + static void +@@ -3987,6 +4002,22 @@ convert_to_numeric (gfc_expr *a, gfc_expr *b) + gfc_convert_type_warn (a, &t, 2, 1); + } + ++/* If E is a logical, convert it to an integer and issue a warning ++ for the conversion. */ ++ ++static void ++convert_logical_to_integer (gfc_expr *e) ++{ ++ if (e->ts.type == BT_LOGICAL) ++ { ++ /* Convert to INTEGER */ ++ gfc_typespec t; ++ t.type = BT_INTEGER; ++ t.kind = 1; ++ gfc_convert_type_warn (e, &t, 2, 1); ++ } ++} ++ + /* Resolve an operator expression node. This can involve replacing the + operation with a user defined function call. */ + +@@ -4072,6 +4103,12 @@ resolve_operator (gfc_expr *e) + case INTRINSIC_TIMES: + case INTRINSIC_DIVIDE: + case INTRINSIC_POWER: ++ if (flag_logical_as_integer) ++ { ++ convert_logical_to_integer (op1); ++ convert_logical_to_integer (op2); ++ } ++ + if (gfc_numeric_ts (&op1->ts) && gfc_numeric_ts (&op2->ts)) + { + gfc_type_convert_binary (e, 1); +@@ -4108,6 +4145,13 @@ resolve_operator (gfc_expr *e) + case INTRINSIC_OR: + case INTRINSIC_EQV: + case INTRINSIC_NEQV: ++ ++ if (flag_logical_as_integer) ++ { ++ convert_integer_to_logical (op1); ++ convert_integer_to_logical (op2); ++ } ++ + if (op1->ts.type == BT_LOGICAL && op2->ts.type == BT_LOGICAL) + { + e->ts.type = BT_LOGICAL; +@@ -4158,6 +4202,9 @@ resolve_operator (gfc_expr *e) + goto simplify_op; + } + ++ if (flag_logical_as_integer) ++ convert_integer_to_logical (op1); ++ + if (op1->ts.type == BT_LOGICAL) + { + e->ts.type = BT_LOGICAL; +@@ -4198,6 +4245,12 @@ resolve_operator (gfc_expr *e) + convert_hollerith_to_character (op2); + } + ++ if (flag_logical_as_integer) ++ { ++ convert_logical_to_integer (op1); ++ convert_logical_to_integer (op2); ++ } ++ + if (op1->ts.type == BT_CHARACTER && op2->ts.type == BT_CHARACTER + && op1->ts.kind == op2->ts.kind) + { +diff --git a/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_1.f b/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_1.f +new file mode 100644 +index 00000000000..938a91d9e9a +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_1.f +@@ -0,0 +1,31 @@ ++! { dg-do run } ++! { dg-options "-std=legacy -flogical-as-integer" } ++! ++! Test conversion between logical and integer for logical operators ++! ++! Test case contributed by Jim MacArthur ++! Modified for -flogical-as-integer by Mark Eggleston ++! ++! ++ PROGRAM logical_integer_conversion ++ LOGICAL lpos /.true./ ++ INTEGER ineg/0/ ++ INTEGER ires ++ LOGICAL lres ++ ++ ! Test Logicals converted to Integers ++ if ((lpos.AND.ineg).EQ.1) STOP 3 ++ if ((ineg.AND.lpos).NE.0) STOP 4 ++ ires = (.true..AND.0) ++ if (ires.NE.0) STOP 5 ++ ires = (1.AND..false.) ++ if (ires.EQ.1) STOP 6 ++ ++ ! Test Integers converted to Logicals ++ if (lpos.EQ.ineg) STOP 7 ++ if (ineg.EQ.lpos) STOP 8 ++ lres = (.true..EQ.0) ++ if (lres) STOP 9 ++ lres = (1.EQ..false.) ++ if (lres) STOP 10 ++ END +diff --git a/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_2.f b/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_2.f +new file mode 100644 +index 00000000000..9f146202ba5 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_2.f +@@ -0,0 +1,31 @@ ++! { dg-do compile } ++! { dg-options "-std=legacy -flogical-as-integer -fno-logical-as-integer" } ++! ++! Based on logical_to_integer_and_vice_versa_1.f but with option disabled ++! to test for error messages. ++! ++! Test case contributed by by Mark Eggleston ++! ++! ++ PROGRAM logical_integer_conversion ++ LOGICAL lpos /.true./ ++ INTEGER ineg/0/ ++ INTEGER ires ++ LOGICAL lres ++ ++ ! Test Logicals converted to Integers ++ if ((lpos.AND.ineg).EQ.1) STOP 3 ! { dg-error "Operands of logical operator" } ++ if ((ineg.AND.lpos).NE.0) STOP 4 ! { dg-error "Operands of logical operator" } ++ ires = (.true..AND.0) ! { dg-error "Operands of logical operator" } ++ if (ires.NE.0) STOP 5 ++ ires = (1.AND..false.) ! { dg-error "Operands of logical operator" } ++ if (ires.EQ.1) STOP 6 ++ ++ ! Test Integers converted to Logicals ++ if (lpos.EQ.ineg) STOP 7 ! { dg-error "Operands of comparison operator" } ++ if (ineg.EQ.lpos) STOP 8 ! { dg-error "Operands of comparison operator" } ++ lres = (.true..EQ.0) ! { dg-error "Operands of comparison operator" } ++ if (lres) STOP 9 ++ lres = (1.EQ..false.) ! { dg-error "Operands of comparison operator" } ++ if (lres) STOP 10 ++ END +diff --git a/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_3.f b/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_3.f +new file mode 100644 +index 00000000000..446873eb2dc +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_3.f +@@ -0,0 +1,33 @@ ++! { dg-do compile } ++! { dg-options "-std=legacy -flogical-as-integer" } ++! ++! Test conversion between logical and integer for logical operators ++! ++ program test ++ logical f /.false./ ++ logical t /.true./ ++ real x ++ ++ x = 7.7 ++ x = x + t*3.0 ++ if (abs(x - 10.7).gt.0.00001) stop 1 ++ x = x + .false.*5.0 ++ if (abs(x - 10.7).gt.0.00001) stop 2 ++ x = x - .true.*5.0 ++ if (abs(x - 5.7).gt.0.00001) stop 3 ++ x = x + t ++ if (abs(x - 6.7).gt.0.00001) stop 4 ++ x = x + f ++ if (abs(x - 6.7).gt.0.00001) stop 5 ++ x = x - t ++ if (abs(x - 5.7).gt.0.00001) stop 6 ++ x = x - f ++ if (abs(x - 5.7).gt.0.00001) stop 7 ++ x = x**.true. ++ if (abs(x - 5.7).gt.0.00001) stop 8 ++ x = x**.false. ++ if (abs(x - 1.0).gt.0.00001) stop 9 ++ x = x/t ++ if (abs(x - 1.0).gt.0.00001) stop 10 ++ if ((x/.false.).le.huge(x)) stop 11 ++ end +diff --git a/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_4.f b/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_4.f +new file mode 100644 +index 00000000000..4301a4988d8 +--- /dev/null ++++ b/gcc/testsuite/gfortran.dg/logical_to_integer_and_vice_versa_4.f +@@ -0,0 +1,33 @@ ++! { dg-do compile } ++! { dg-options "-std=legacy -flogical-as-integer -fno-logical-as-integer" } ++! ++! Test conversion between logical and integer for logical operators ++! ++ program test ++ logical f /.false./ ++ logical t /.true./ ++ real x ++ ++ x = 7.7 ++ x = x + t*3.0 ! { dg-error "Operands of binary numeric" } ++ if (abs(x - 10.7).gt.0.00001) stop 1 ++ x = x + .false.*5.0 ! { dg-error "Operands of binary numeric" } ++ if (abs(x - 10.7).gt.0.00001) stop 2 ++ x = x - .true.*5.0 ! { dg-error "Operands of binary numeric" } ++ if (abs(x - 5.7).gt.0.00001) stop 3 ++ x = x + t ! { dg-error "Operands of binary numeric" } ++ if (abs(x - 6.7).gt.0.00001) stop 4 ++ x = x + f ! { dg-error "Operands of binary numeric" } ++ if (abs(x - 6.7).gt.0.00001) stop 5 ++ x = x - t ! { dg-error "Operands of binary numeric" } ++ if (abs(x - 5.7).gt.0.00001) stop 6 ++ x = x - f ! { dg-error "Operands of binary numeric" } ++ if (abs(x - 5.7).gt.0.00001) stop 7 ++ x = x**.true. ! { dg-error "Operands of binary numeric" } ++ if (abs(x - 5.7).gt.0.00001) stop 8 ++ x = x**.false. ! { dg-error "Operands of binary numeric" } ++ if (abs(x - 1.0).gt.0.00001) stop 9 ++ x = x/t ! { dg-error "Operands of binary numeric" } ++ if (abs(x - 1.0).gt.0.00001) stop 10 ++ if ((x/.false.).le.huge(x)) stop 11 ! { dg-error "Operands of binary numeric" } ++ end +-- +2.27.0 + diff --git a/gcc16-hack.patch b/gcc11-hack.patch similarity index 55% rename from gcc16-hack.patch rename to gcc11-hack.patch index 61331bf..3a5f3f3 100644 --- a/gcc16-hack.patch +++ b/gcc11-hack.patch @@ -64,119 +64,63 @@ + infodir="$(infodir)" \ GOCFLAGS="$(GOCFLAGS) $${flags}" \ GDCFLAGS="$(GDCFLAGS) $${flags}" \ - A68FLAGS="$(A68FLAGS) $${flags}" \ ---- libcpp/macro.cc.jj 2019-01-09 13:01:21.420552123 +0100 -+++ libcpp/macro.cc 2024-11-30 13:16:41.163056391 +0100 -@@ -3680,8 +3680,6 @@ static cpp_macro * + CXXFLAGS="$(CXXFLAGS) $${flags}" \ +--- libcpp/macro.c.jj 2019-01-09 13:01:21.420552123 +0100 ++++ libcpp/macro.c 2019-01-11 18:18:17.736876285 +0100 +@@ -3256,8 +3256,6 @@ static cpp_macro * create_iso_definition (cpp_reader *pfile) { bool following_paste_op = false; - const char *paste_op_error_msg = -- N_("%<##%> cannot appear at either end of a macro expansion"); +- N_("'##' cannot appear at either end of a macro expansion"); unsigned int num_extra_tokens = 0; unsigned nparms = 0; cpp_hashnode **params = NULL; -@@ -3809,7 +3807,9 @@ create_iso_definition (cpp_reader *pfile +@@ -3382,7 +3380,9 @@ create_iso_definition (cpp_reader *pfile function-like macros, but not at the end. */ if (following_paste_op) { - cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg); + cpp_error (pfile, CPP_DL_ERROR, -+ "%<##%> cannot appear at either end of a macro " ++ "'##' cannot appear at either end of a macro " + "expansion"); goto out; } if (!vaopt_tracker.completed ()) -@@ -3824,7 +3824,9 @@ create_iso_definition (cpp_reader *pfile +@@ -3397,7 +3397,9 @@ create_iso_definition (cpp_reader *pfile function-like macros, but not at the beginning. */ if (macro->count == 1) { - cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg); + cpp_error (pfile, CPP_DL_ERROR, -+ "%<##%> cannot appear at either end of a macro " ++ "'##' cannot appear at either end of a macro " + "expansion"); goto out; } ---- libcpp/expr.cc.jj 2019-01-09 13:01:22.415535734 +0100 -+++ libcpp/expr.cc 2024-11-30 13:14:52.468583689 +0100 -@@ -874,50 +874,54 @@ cpp_classify_number (cpp_reader *pfile, +--- libcpp/expr.c.jj 2019-01-09 13:01:22.415535734 +0100 ++++ libcpp/expr.c 2019-01-11 18:16:23.444726882 +0100 +@@ -803,16 +803,17 @@ cpp_classify_number (cpp_reader *pfile, if ((result & CPP_N_WIDTH) == CPP_N_LARGE && CPP_OPTION (pfile, cpp_warn_long_long)) { -- const char *message = CPP_OPTION (pfile, cplusplus) +- const char *message = CPP_OPTION (pfile, cplusplus) - ? N_("use of C++11 long long integer constant") - : N_("use of C99 long long integer constant"); - if (CPP_OPTION (pfile, c99)) -- cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location, + cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location, - 0, message); -+ cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location, 0, -+ CPP_OPTION (pfile, cplusplus) -+ ? N_("use of C++11 long long integer " -+ "constant") -+ : N_("use of C99 long long integer " -+ "constant")); ++ 0, CPP_OPTION (pfile, cplusplus) ++ ? N_("use of C++11 long long integer constant") ++ : N_("use of C99 long long integer constant")); else cpp_pedwarning_with_line (pfile, CPP_W_LONG_LONG, - virtual_location, 0, message); + virtual_location, 0, + CPP_OPTION (pfile, cplusplus) -+ ? N_("use of C++11 long long integer " -+ "constant") -+ : N_("use of C99 long long integer " -+ "constant")); ++ ? N_("use of C++11 long long integer constant") ++ : N_("use of C99 long long integer constant")); } if ((result & CPP_N_SIZE_T) == CPP_N_SIZE_T - && !CPP_OPTION (pfile, size_t_literals)) -- { -- const char *message -- = (result & CPP_N_UNSIGNED) == CPP_N_UNSIGNED -- ? N_("use of C++23 % integer constant") -- : N_("use of C++23 %%> integer constant"); -- cpp_warning_with_line (pfile, CPP_W_SIZE_T_LITERALS, -- virtual_location, 0, message); -- } -+ cpp_warning_with_line (pfile, CPP_W_SIZE_T_LITERALS, -+ virtual_location, 0, -+ (result & CPP_N_UNSIGNED) == CPP_N_UNSIGNED -+ ? N_("use of C++23 % integer " -+ "constant") -+ : N_("use of C++23 %%> " -+ "integer constant")); - - if ((result & CPP_N_BITINT) != 0 - && CPP_OPTION (pfile, cpp_warn_c11_c23_compat) != 0) - { - if (CPP_OPTION (pfile, cpp_warn_c11_c23_compat) > 0) - { -- const char *message = N_("ISO C does not support literal " -- "% suffixes before C23"); - if (CPP_PEDANTIC (pfile) && !CPP_OPTION (pfile, true_false)) - cpp_pedwarning_with_line (pfile, CPP_W_C11_C23_COMPAT, -- virtual_location, 0, message); -+ virtual_location, 0, -+ "ISO C does not support literal " -+ "% suffixes before C23"); - else - cpp_warning_with_line (pfile, CPP_W_C11_C23_COMPAT, -- virtual_location, 0, message); -- } -- else if (!CPP_OPTION (pfile, true_false)) -- { -- const char *message = N_("ISO C does not support literal " -+ virtual_location, 0, -+ "ISO C does not support literal " - "% suffixes before C23"); -- cpp_pedwarning_with_line (pfile, CPP_W_PEDANTIC, -- virtual_location, 0, message); - } -+ else if (!CPP_OPTION (pfile, true_false)) -+ cpp_pedwarning_with_line (pfile, CPP_W_PEDANTIC, -+ virtual_location, 0, -+ "ISO C does not support literal " -+ "% suffixes before C23"); - } - - result |= CPP_N_INTEGER; diff --git a/gcc16-isl-dl.patch b/gcc11-isl-dl.patch similarity index 96% rename from gcc16-isl-dl.patch rename to gcc11-isl-dl.patch index dc0c49b..b3982f9 100644 --- a/gcc16-isl-dl.patch +++ b/gcc11-isl-dl.patch @@ -26,7 +26,7 @@ # Generate header and source files from the machine description, # and compile them. --- gcc/graphite.h.jj 2016-01-27 12:44:06.000000000 +0100 -+++ gcc/graphite.h 2022-11-03 19:14:50.369690720 +0100 ++++ gcc/graphite.h 2016-01-27 13:26:38.309876856 +0100 @@ -24,6 +24,591 @@ along with GCC; see the file COPYING3. #include "sese.h" @@ -41,15 +41,15 @@ + DYNSYM (isl_aff_set_coefficient_si); \ + DYNSYM (isl_aff_set_constant_si); \ + DYNSYM (isl_aff_zero_on_domain); \ -+ /* DYNSYM (isl_band_free); */ \ -+ /* DYNSYM (isl_band_get_children); */ \ -+ /* DYNSYM (isl_band_get_partial_schedule); */ \ -+ /* DYNSYM (isl_band_has_children); */ \ -+ /* DYNSYM (isl_band_list_free); */ \ -+ /* DYNSYM (isl_band_list_get_band); */ \ -+ /* DYNSYM (isl_band_list_get_ctx); */ \ -+ /* DYNSYM (isl_band_list_n_band); */ \ -+ /* DYNSYM (isl_band_n_member); */ \ ++ DYNSYM (isl_band_free); \ ++ DYNSYM (isl_band_get_children); \ ++ DYNSYM (isl_band_get_partial_schedule); \ ++ DYNSYM (isl_band_has_children); \ ++ DYNSYM (isl_band_list_free); \ ++ DYNSYM (isl_band_list_get_band); \ ++ DYNSYM (isl_band_list_get_ctx); \ ++ DYNSYM (isl_band_list_n_band); \ ++ DYNSYM (isl_band_n_member); \ + DYNSYM (isl_basic_map_add_constraint); \ + DYNSYM (isl_basic_map_project_out); \ + DYNSYM (isl_basic_map_universe); \ @@ -91,7 +91,7 @@ + DYNSYM (isl_map_is_empty); \ + DYNSYM (isl_map_lex_ge); \ + DYNSYM (isl_map_lex_le); \ -+ /* DYNSYM (isl_map_n_out); */ \ ++ DYNSYM (isl_map_n_out); \ + DYNSYM (isl_map_range); \ + DYNSYM (isl_map_set_tuple_id); \ + DYNSYM (isl_map_universe); \ @@ -124,7 +124,7 @@ + DYNSYM (isl_pw_aff_sub); \ + DYNSYM (isl_pw_aff_zero_set); \ + DYNSYM (isl_schedule_free); \ -+ /* DYNSYM (isl_schedule_get_band_forest); */ \ ++ DYNSYM (isl_schedule_get_band_forest); \ + DYNSYM (isl_set_add_constraint); \ + DYNSYM (isl_set_add_dims); \ + DYNSYM (isl_set_apply); \ @@ -626,10 +626,10 @@ +extern const char *get_isl_version (bool); #endif ---- gcc/graphite.cc.jj 2015-11-04 14:15:32.000000000 +0100 -+++ gcc/graphite.cc 2015-11-04 14:56:02.645536409 +0100 +--- gcc/graphite.c.jj 2015-11-04 14:15:32.000000000 +0100 ++++ gcc/graphite.c 2015-11-04 14:56:02.645536409 +0100 @@ -60,6 +60,35 @@ along with GCC; see the file COPYING3. - #include "tree-ssa-propagate.h" + #include "tree-into-ssa.h" #include "graphite.h" +__typeof (isl_pointers__) isl_pointers__; @@ -641,7 +641,7 @@ + + if (isl_pointers__.inited) + return isl_pointers__.h != NULL; -+ h = dlopen ("libisl.so.23", RTLD_LAZY); ++ h = dlopen ("libisl.so.15", RTLD_LAZY); + isl_pointers__.h = h; + if (h == NULL) + return false; @@ -664,7 +664,7 @@ /* Print global statistics to FILE. */ static void -@@ -424,6 +453,15 @@ graphite_transform_loops (void) +@@ -365,6 +394,15 @@ graphite_transform_loops (void) if (parallelized_function_p (cfun->decl)) return; @@ -680,7 +680,7 @@ calculate_dominance_info (CDI_DOMINATORS); /* We rely on post-dominators during merging of SESE regions so those -@@ -519,6 +557,14 @@ graphite_transform_loops (void) +@@ -455,6 +493,14 @@ graphite_transform_loops (void) } } @@ -695,17 +695,17 @@ #else /* If isl is not available: #ifndef HAVE_isl. */ static void ---- gcc/toplev.cc.jj 2017-02-19 13:02:31.000000000 +0100 -+++ gcc/toplev.cc 2024-11-30 13:22:34.175096117 +0100 -@@ -100,6 +100,7 @@ along with GCC; see the file COPYING3. +--- gcc/toplev.c.jj 2017-02-19 13:02:31.000000000 +0100 ++++ gcc/toplev.c 2017-02-19 16:50:25.536301350 +0100 +@@ -94,6 +94,7 @@ along with GCC; see the file COPYING3. #ifdef HAVE_isl #include +extern const char *get_isl_version (bool); #endif - static void general_init (const char *, bool, unique_argv original_argv); -@@ -652,7 +653,7 @@ print_version (FILE *file, const char *i + static void general_init (const char *, bool); +@@ -683,7 +684,7 @@ print_version (FILE *file, const char *i #ifndef HAVE_isl "none" #else diff --git a/gcc16-isl-dl2.patch b/gcc11-isl-dl2.patch similarity index 61% rename from gcc16-isl-dl2.patch rename to gcc11-isl-dl2.patch index 8d2c4d9..ac14ed3 100644 --- a/gcc16-isl-dl2.patch +++ b/gcc11-isl-dl2.patch @@ -1,32 +1,32 @@ 2011-04-04 Jakub Jelinek - * toplev.cc (toplev_main_argv): New variable. + * toplev.c (toplev_main_argv): New variable. (toplev_main): Initialize it. - * graphite.cc (init_isl_pointers): Load libisl.so.23 from gcc's private + * graphite.c (init_isl_pointers): Load libisl.so.15 from gcc's private directory. ---- gcc/toplev.cc.jj 2008-12-09 23:59:10.000000000 +0100 -+++ gcc/toplev.cc 2024-11-30 13:26:05.085132543 +0100 -@@ -112,6 +112,8 @@ static void finalize (); - static void crash_signal (int) ATTRIBUTE_NORETURN; - static void compile_file (void); +--- gcc/toplev.c.jj 2008-12-09 23:59:10.000000000 +0100 ++++ gcc/toplev.c 2009-01-27 14:33:52.000000000 +0100 +@@ -117,6 +117,8 @@ static void compile_file (void); + /* True if we don't need a backend (e.g. preprocessing only). */ + static bool no_backend; +const char **toplev_main_argv; + /* Decoded options, and number of such options. */ struct cl_decoded_option *save_decoded_options; unsigned int save_decoded_options_count; -@@ -2296,6 +2298,8 @@ toplev::main (int argc, char **argv) +@@ -2287,6 +2289,8 @@ toplev::main (int argc, char **argv) expandargv (&argc, &argv); + toplev_main_argv = CONST_CAST2 (const char **, char **, argv); + /* Initialization of GCC's environment, and diagnostics. */ - general_init (argv[0], m_init_signals, std::move (original_argv)); + general_init (argv[0], m_init_signals); ---- gcc/graphite.cc.jj 2010-12-01 10:24:32.000000000 -0500 -+++ gcc/graphite.cc 2010-12-01 11:46:07.832118193 -0500 +--- gcc/graphite.c.jj 2010-12-01 10:24:32.000000000 -0500 ++++ gcc/graphite.c 2010-12-01 11:46:07.832118193 -0500 @@ -64,11 +64,39 @@ __typeof (isl_pointers__) isl_pointers__ static bool init_isl_pointers (void) @@ -39,12 +39,12 @@ if (isl_pointers__.inited) return isl_pointers__.h != NULL; -- h = dlopen ("libisl.so.23", RTLD_LAZY); +- h = dlopen ("libisl.so.15", RTLD_LAZY); + len = progname - toplev_main_argv[0]; -+ buf = XALLOCAVAR (char, len + sizeof "libisl.so.23"); ++ buf = XALLOCAVAR (char, len + sizeof "libisl.so.15"); + memcpy (buf, toplev_main_argv[0], len); -+ strcpy (buf + len, "libisl.so.23"); -+ len += sizeof "libisl.so.23"; ++ strcpy (buf + len, "libisl.so.15"); ++ len += sizeof "libisl.so.15"; + p = strstr (buf, "/libexec/"); + if (p != NULL) + { @@ -61,7 +61,7 @@ + { + len = progname - toplev_main_argv[0]; + memcpy (buf, toplev_main_argv[0], len); -+ strcpy (buf + len, "libisl.so.23"); ++ strcpy (buf + len, "libisl.so.15"); + } + } + if (h == NULL) diff --git a/gcc11-libgcc-link.patch b/gcc11-libgcc-link.patch new file mode 100644 index 0000000..1904c4b --- /dev/null +++ b/gcc11-libgcc-link.patch @@ -0,0 +1,45 @@ +libgcc: Honor LDFLAGS_FOR_TARGET when linking libgcc_s + +When building gcc with some specific LDFLAGS_FOR_TARGET, e.g. +LDFLAGS_FOR_TARGET=-Wl,-z,relro,-z,now +those flags propagate info linking of target shared libraries, +e.g. lib{ubsan,tsan,stdc++,quadmath,objc,lsan,itm,gphobos,gdruntime,gomp,go,gfortran,atomic,asan}.so.* +but there is one important exception, libgcc_s.so.* linking ignores it. + +The following patch fixes that. + +Bootstrapped/regtested on x86_64-linux with LDFLAGS_FOR_TARGET=-Wl,-z,relro,-z,now +and verified that libgcc_s.so.* is BIND_NOW when it previously wasn't, and +without any LDFLAGS_FOR_TARGET on x86_64-linux and i686-linux. +There on x86_64-linux I've verified that the libgcc_s.so.1 linking command +line for -m64 is identical except for whitespace to one without the patch, +and for -m32 multilib $(LDFLAGS) actually do supply there an extra -m32 +that also repeats later in the @multilib_flags@, which should be harmless. + +2021-08-04 Jakub Jelinek + + * config/t-slibgcc (SHLIB_LINK): Add $(LDFLAGS). + * config/t-slibgcc-vms (SHLIB_LINK): Likewise. + +--- libgcc/config/t-slibgcc ++++ libgcc/config/t-slibgcc +@@ -32,7 +32,7 @@ SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \ + $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) + + SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \ +- $(SHLIB_LDFLAGS) \ ++ $(SHLIB_LDFLAGS) $(LDFLAGS) \ + -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \ + $(SHLIB_OBJS) $(SHLIB_LC) && \ + rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ +--- libgcc/config/t-slibgcc-vms ++++ libgcc/config/t-slibgcc-vms +@@ -22,7 +22,7 @@ SHLIB_LINK = \ + objdump --syms $(SHLIB_OBJS) | \ + $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt ; \ + echo "case_sensitive=NO" >> SYMVEC_$$$$.opt; \ +- $(CC) $(LIBGCC2_CFLAGS) -nodefaultlibs \ ++ $(CC) $(LIBGCC2_CFLAGS) $(LDFLAGS) -nodefaultlibs \ + -shared --for-linker=/noinform -o $(SHLIB_NAME) $(SHLIB_OBJS) \ + --for-linker=SYMVEC_$$$$.opt \ + --for-linker=gsmatch=equal,$(shlib_version) diff --git a/gcc16-libgomp-omp_h-multilib.patch b/gcc11-libgomp-omp_h-multilib.patch similarity index 100% rename from gcc16-libgomp-omp_h-multilib.patch rename to gcc11-libgomp-omp_h-multilib.patch diff --git a/gcc16-libstdc++-docs.patch b/gcc11-libstdc++-docs.patch similarity index 74% rename from gcc16-libstdc++-docs.patch rename to gcc11-libstdc++-docs.patch index 7d2d357..b044a4d 100644 --- a/gcc16-libstdc++-docs.patch +++ b/gcc11-libstdc++-docs.patch @@ -4,21 +4,21 @@ FSF

-+ Release 16.0.1 ++ Release 11.3.1 +

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the --- libstdc++-v3/doc/html/api.html.jj 2011-01-03 12:53:21.000000000 +0100 -+++ libstdc++-v3/doc/html/api.html 2024-11-30 13:30:16.607594623 +0100 ++++ libstdc++-v3/doc/html/api.html 2011-01-04 18:12:01.672757784 +0100 @@ -20,7 +20,9 @@ member functions for the library classes, finding out what is in a particular include file, looking at inheritance diagrams, etc.

- The API documentation, rendered into HTML, can be viewed online + The API documentation, rendered into HTML, can be viewed locally -+ for the 16.0.1 release, ++ for the 11.3.1 release, + online - for each GCC release + for each GCC release and - + diff --git a/gcc16-libtool-no-rpath.patch b/gcc11-libtool-no-rpath.patch similarity index 87% rename from gcc16-libtool-no-rpath.patch rename to gcc11-libtool-no-rpath.patch index 8429a4c..466c661 100644 --- a/gcc16-libtool-no-rpath.patch +++ b/gcc11-libtool-no-rpath.patch @@ -5,7 +5,7 @@ libtool sucks. rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do -+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64|/usr/lib/../lib64/lp64d) continue;; esac ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then @@ -13,7 +13,7 @@ libtool sucks. rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do -+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64|/usr/lib/../lib64/lp64d) continue;; esac ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then @@ -21,7 +21,7 @@ libtool sucks. rpath= hardcode_libdirs= for libdir in $finalize_rpath; do -+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64|/usr/lib/../lib64/lp64d) continue;; esac ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then diff --git a/gcc16-no-add-needed.patch b/gcc11-no-add-needed.patch similarity index 96% rename from gcc16-no-add-needed.patch rename to gcc11-no-add-needed.patch index 74f5c1f..5817299 100644 --- a/gcc16-no-add-needed.patch +++ b/gcc11-no-add-needed.patch @@ -34,4 +34,4 @@ +#define LINK_EH_SPEC "--no-add-needed %{!static|static-pie:--eh-frame-hdr} " #endif - + #define GNU_USER_TARGET_LINK_GCC_C_SEQUENCE_SPEC \ diff --git a/gcc11-pr101786.patch b/gcc11-pr101786.patch new file mode 100644 index 0000000..427c10a --- /dev/null +++ b/gcc11-pr101786.patch @@ -0,0 +1,66 @@ +c++: Optimize constinit thread_local vars [PR101786] + +The paper that introduced constinit mentioned in rationale that constinit +can be used on externs as well and that it can be used to avoid the +thread_local initialization wrappers, because the standard requires that +if constinit is present on any declaration, it is also present on the +initialization declaration, even if it is in some other TU etc. + +There is a small problem though, we use the tls wrappers not just if +the thread_local variable needs dynamic initialization, but also when +it has static initialization, but non-trivial destructor, as the +"dynamic initialization" in that case needs to register the destructor. + +So, the following patch optimizes constinit thread_local vars only +if we can prove they will not have non-trivial destructors. That includes +the case where we have incomplete type where we don't know and need to +conservatively assume the type will have non-trivial destructor at the +initializing declaration side. + +2021-08-11 Jakub Jelinek + + PR c++/101786 + * decl2.c (var_defined_without_dynamic_init): Return true for + DECL_DECLARED_CONSTINIT_P with complete type and trivial destructor. + + * g++.dg/cpp2a/constinit16.C: New test. + +--- gcc/cp/decl2.c ++++ gcc/cp/decl2.c +@@ -3447,6 +3447,12 @@ set_guard (tree guard) + static bool + var_defined_without_dynamic_init (tree var) + { ++ /* constinit vars are guaranteed to not have dynamic initializer, ++ but still registering the destructor counts as dynamic initialization. */ ++ if (DECL_DECLARED_CONSTINIT_P (var) ++ && COMPLETE_TYPE_P (TREE_TYPE (var)) ++ && !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (var))) ++ return true; + /* If it's defined in another TU, we can't tell. */ + if (DECL_EXTERNAL (var)) + return false; +--- gcc/testsuite/g++.dg/cpp2a/constinit16.C ++++ gcc/testsuite/g++.dg/cpp2a/constinit16.C +@@ -0,0 +1,21 @@ ++// PR c++/101786 ++// { dg-do compile { target c++20 } } ++// { dg-add-options tls } ++// { dg-require-alias "" } ++// { dg-require-effective-target tls_runtime } ++// { dg-final { scan-assembler-not "_ZTH17mythreadlocalvar1" } } ++// { dg-final { scan-assembler "_ZTH17mythreadlocalvar2" } } ++// { dg-final { scan-assembler-not "_ZTH17mythreadlocalvar3" } } ++// { dg-final { scan-assembler "_ZTH17mythreadlocalvar4" } } ++ ++extern thread_local constinit int mythreadlocalvar1; ++struct S; ++extern thread_local constinit S mythreadlocalvar2; ++struct T { int t; }; ++extern thread_local constinit T mythreadlocalvar3; ++struct U { int u; ~U (); }; ++extern thread_local constinit U mythreadlocalvar4; ++int foo () { return mythreadlocalvar1; } ++S *bar () { return &mythreadlocalvar2; } ++T *baz () { return &mythreadlocalvar3; } ++U *qux () { return &mythreadlocalvar4; } diff --git a/gcc11-pr105331.patch b/gcc11-pr105331.patch new file mode 100644 index 0000000..fa1a9d3 --- /dev/null +++ b/gcc11-pr105331.patch @@ -0,0 +1,33 @@ +2022-04-21 Jakub Jelinek + + PR target/105331 + * config/i386/i386.c (ix86_gimplify_va_arg): Mark va_arg_tmp + temporary TREE_ADDRESSABLE before trying to gimplify ADDR_EXPR + of it. + + * gcc.dg/pr105331.c: New test. + +--- gcc/config/i386/i386.c.jj 2022-04-12 09:20:07.566662842 +0200 ++++ gcc/config/i386/i386.c 2022-04-21 12:03:32.201951522 +0200 +@@ -4891,6 +4891,7 @@ ix86_gimplify_va_arg (tree valist, tree + { + int i, prev_size = 0; + tree temp = create_tmp_var (type, "va_arg_tmp"); ++ TREE_ADDRESSABLE (temp) = 1; + + /* addr = &temp; */ + t = build1 (ADDR_EXPR, build_pointer_type (type), temp); +--- gcc/testsuite/gcc.dg/pr105331.c.jj 2022-04-21 12:09:34.398906718 +0200 ++++ gcc/testsuite/gcc.dg/pr105331.c 2022-04-21 12:09:07.304283903 +0200 +@@ -0,0 +1,11 @@ ++/* PR target/105331 */ ++/* { dg-do compile } */ ++/* { dg-options "-O -Wuninitialized" } */ ++ ++#include ++ ++int ++foo (va_list *va) ++{ ++ return va_arg (*va, double _Complex); /* { dg-bogus "may be used uninitialized" } */ ++} diff --git a/gcc11-pr99341-revert.patch b/gcc11-pr99341-revert.patch new file mode 100644 index 0000000..c7419cb --- /dev/null +++ b/gcc11-pr99341-revert.patch @@ -0,0 +1,176 @@ +libstdc++: Remove symbols for new std::call_once implementation [PR 99341] + +This removes the new symbols added for the new futex-based +std::call_once implementation. These symbols were new on trunk, so not +in any released version. However, they are already present in some +beta distro releases (Fedora Linux 34) and in Fedora Linux rawhide. This +change can be locally reverted by distros that need to keep the symbols +present until affected packages have been rebuilt. + +Revert: +2021-03-12 Jonathan Wakely + + PR libstdc++/99341 + * config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Remove + std::once_flag symbols. + * config/abi/post/ia64-linux-gnu/baseline_symbols.txt: Likewise. + * config/abi/post/m68k-linux-gnu/baseline_symbols.txt: Likewise. + * config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: + Likewise. + * config/abi/pre/gnu.ver: Likewise. + * src/c++11/mutex.cc [_GLIBCXX_HAVE_LINUX_FUTEX] + (struct __once_flag_compat): Remove. + (_ZNSt9once_flag11_M_activateEv): Remove. + (_ZNSt9once_flag9_M_finishEb): Remove. + +--- libstdc++-v3/config/abi/post/aarch64-linux-gnu/baseline_symbols.txt ++++ libstdc++-v3/config/abi/post/aarch64-linux-gnu/baseline_symbols.txt +@@ -4086,6 +4086,8 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Em@@GLIBCXX + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4 ++FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29 ++FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29 + FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4 + FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4 + FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4 +--- libstdc++-v3/config/abi/post/ia64-linux-gnu/baseline_symbols.txt ++++ libstdc++-v3/config/abi/post/ia64-linux-gnu/baseline_symbols.txt +@@ -4086,6 +4086,8 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Em@@GLIBCXX + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4 ++FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29 ++FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29 + FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4 + FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4 + FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4 +--- libstdc++-v3/config/abi/post/m68k-linux-gnu/baseline_symbols.txt ++++ libstdc++-v3/config/abi/post/m68k-linux-gnu/baseline_symbols.txt +@@ -4086,6 +4086,8 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Ej@@GLIBCXX + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4 ++FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29 ++FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29 + FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4 + FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4 + FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4 +--- libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt ++++ libstdc++-v3/config/abi/post/riscv64-linux-gnu/baseline_symbols.txt +@@ -4086,6 +4086,8 @@ FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2Em@@GLIBCXX + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED0Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED1Ev@@GLIBCXX_3.4 + FUNC:_ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEED2Ev@@GLIBCXX_3.4 ++FUNC:_ZNSt9once_flag11_M_activateEv@@GLIBCXX_3.4.29 ++FUNC:_ZNSt9once_flag9_M_finishEb@@GLIBCXX_3.4.29 + FUNC:_ZNSt9strstream3strEv@@GLIBCXX_3.4 + FUNC:_ZNSt9strstream6freezeEb@@GLIBCXX_3.4 + FUNC:_ZNSt9strstreamC1EPciSt13_Ios_Openmode@@GLIBCXX_3.4 +--- libstdc++-v3/config/abi/pre/gnu.ver ++++ libstdc++-v3/config/abi/pre/gnu.ver +@@ -2388,6 +2388,11 @@ GLIBCXX_3.4.29 { + _ZNKRSt7__cxx1118basic_stringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EE3strEv; + _ZNSt7__cxx1118basic_stringstreamI[cw]St11char_traitsI[cw]ESaI[cw]EE3strEONS_12basic_stringI[cw]S2_S3_EE; + ++ # std::once_flag::_M_activate() ++ _ZNSt9once_flag11_M_activateEv; ++ # std::once_flag::_M_finish(bool) ++ _ZNSt9once_flag9_M_finishEb; ++ + # std::to_chars(char*, char*, [float|double|long double]) + _ZSt8to_charsPcS_[def]; + # std::to_chars(char*, char*, [float|double|long double], chars_format) +--- libstdc++-v3/src/c++11/mutex.cc ++++ libstdc++-v3/src/c++11/mutex.cc +@@ -26,6 +26,90 @@ + + #ifdef _GLIBCXX_HAS_GTHREADS + ++#if defined _GLIBCXX_SHARED && ! _GLIBCXX_INLINE_VERSION ++ ++#ifdef _GLIBCXX_HAVE_LINUX_FUTEX ++# include ++# include ++# include ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++struct __once_flag_compat ++{ ++ enum _Bits : int { _Init = 0, _Active = 1, _Done = 2 }; ++ int _M_once = 0; ++ bool _M_activate(); ++ void _M_finish(bool returning) noexcept; ++}; ++ ++bool ++__once_flag_compat::_M_activate() ++{ ++ if (__gnu_cxx::__is_single_threaded()) ++ { ++ if (_M_once == _Bits::_Done) ++ return false; ++ _M_once = _Bits::_Active; ++ return true; ++ } ++ ++ while (true) ++ { ++ int expected = _Bits::_Init; ++ constexpr int active = _Bits::_Active; ++ if (__atomic_compare_exchange_n(&_M_once, &expected, active, false, ++ __ATOMIC_ACQ_REL, ++ __ATOMIC_ACQUIRE)) ++ { ++ // This thread is now doing an active execution. ++ return true; ++ } ++ ++ if (expected == _Bits::_Done) ++ return false; // A returning execution happened, this is passive. ++ ++ // Otherwise, an active execution is happening. Wait for it to finish. ++ constexpr int futex_wait = 128; // FUTEX_WAIT_PRIVATE ++ syscall (SYS_futex, &_M_once, futex_wait, expected, 0); ++ } ++} ++ ++void ++std::__once_flag_compat::_M_finish(bool returning) noexcept ++{ ++ const int newval = returning ? _Bits::_Done : _Bits::_Init; ++ if (__gnu_cxx::__is_single_threaded()) ++ { ++ __glibcxx_assert(_M_once == _Bits::_Active); ++ _M_once = newval; ++ } ++ else ++ { ++ int prev [[maybe_unused]] ++ = __atomic_exchange_n(&_M_once, newval, __ATOMIC_RELEASE); ++ __glibcxx_assert(prev & _Bits::_Active); ++ // Wake any other threads waiting for this execution to finish. ++ constexpr int futex_wake = 129; // FUTEX_WAKE_PRIVATE ++ syscall (SYS_futex, &_M_once, futex_wake, INT_MAX); ++ } ++} ++ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wattribute-alias" ++extern "C" bool _ZNSt9once_flag11_M_activateEv() ++ __attribute__((alias ("_ZNSt18__once_flag_compat11_M_activateEv"))); ++extern "C" void _ZNSt9once_flag9_M_finishEb() noexcept ++ __attribute__((alias ("_ZNSt18__once_flag_compat9_M_finishEb"))); ++#pragma GCC diagnostic pop ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace std ++#endif // FUTEX ++#endif // ONCE_FLAG_COMPAT && SHARED && ! INLINE_VERSION ++ + namespace std _GLIBCXX_VISIBILITY(default) + { + _GLIBCXX_BEGIN_NAMESPACE_VERSION diff --git a/gcc11-rh1574936.patch b/gcc11-rh1574936.patch new file mode 100644 index 0000000..6b4be0c --- /dev/null +++ b/gcc11-rh1574936.patch @@ -0,0 +1,30 @@ +crt files and statically linked libgcc objects cause false positives +in annobin coverage, so we add the assembler flag to generate notes +for them. + +The patch also adds notes to libgcc_s.so, but this is harmless because +these notes only confer that there is no other annobin markup. + +2018-07-25 Florian Weimer + + * Makefile.in (LIBGCC2_CFLAGS, CRTSTUFF_CFLAGS): Add + -Wa,--generate-missing-build-notes=yes. + +--- libgcc/Makefile.in 2018-01-13 13:05:41.000000000 +0100 ++++ libgcc/Makefile.in 2018-07-25 13:15:02.036226940 +0200 +@@ -246,6 +246,7 @@ LIBGCC2_DEBUG_CFLAGS = -g + LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \ + $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \ + -fbuilding-libgcc -fno-stack-protector \ ++ -Wa,--generate-missing-build-notes=yes \ + $(INHIBIT_LIBC_CFLAGS) + + # Additional options to use when compiling libgcc2.a. +@@ -301,6 +302,7 @@ CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(IN + $(NO_PIE_CFLAGS) -finhibit-size-directive -fno-inline -fno-exceptions \ + -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ + -fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \ ++ -Wa,--generate-missing-build-notes=yes \ + $(INHIBIT_LIBC_CFLAGS) $(USE_TM_CLONE_REGISTRY) + + # Extra flags to use when compiling crt{begin,end}.o. diff --git a/gcc16-sparc-config-detection.patch b/gcc11-sparc-config-detection.patch similarity index 77% rename from gcc16-sparc-config-detection.patch rename to gcc11-sparc-config-detection.patch index bbe8ec3..bb06b35 100644 --- a/gcc16-sparc-config-detection.patch +++ b/gcc11-sparc-config-detection.patch @@ -1,21 +1,21 @@ --- gcc/config.gcc.jj 2008-04-24 15:42:46.000000000 -0500 +++ gcc/config.gcc 2008-04-24 15:44:51.000000000 -0500 -@@ -3330,7 +3330,7 @@ sparc-*-rtems*) - tm_file="${tm_file} elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h" +@@ -2790,7 +2790,7 @@ sparc-*-rtems*) + tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h" tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems" ;; -sparc-*-linux*) +sparc-*-linux* | sparcv9-*-linux*) - tm_file="${tm_file} elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h" + tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h" extra_options="${extra_options} sparc/long-double-switch.opt" case ${target} in -@@ -3384,7 +3384,7 @@ sparc64-*-rtems*) +@@ -2844,7 +2844,7 @@ sparc64-*-rtems*) extra_options="${extra_options}" tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64" ;; -sparc64-*-linux*) +sparc64*-*-linux*) - tm_file="sparc/biarch64.h ${tm_file} elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default64.h sparc/linux64.h sparc/tso.h" + tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default64.h sparc/linux64.h sparc/tso.h" extra_options="${extra_options} sparc/long-double-switch.opt" tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64" --- libgcc/config.host.jj 2008-04-24 15:46:19.000000000 -0500 diff --git a/gcc11-stringify-__VA_OPT__-2.patch b/gcc11-stringify-__VA_OPT__-2.patch new file mode 100644 index 0000000..5874bc1 --- /dev/null +++ b/gcc11-stringify-__VA_OPT__-2.patch @@ -0,0 +1,197 @@ +libcpp: Fix up #__VA_OPT__ handling [PR103415] + +stringify_arg uses pfile->u_buff to create the string literal. +Unfortunately, paste_tokens -> _cpp_lex_direct -> lex_number -> _cpp_unaligned_alloc +can in some cases use pfile->u_buff too, which results in losing everything +prepared for the string literal until the token pasting. + +The following patch fixes that by not calling paste_token during the +construction of the string literal, but doing that before. All the tokens +we are processing have been pushed into a token buffer using +tokens_buff_add_token so it is fine if we paste some of them in that buffer +(successful pasting creates a new token in that buffer), move following +tokens if any to make it contiguous, pop (throw away) the extra tokens at +the end and then do stringify_arg. + +Also, paste_tokens now copies over PREV_WHITE and PREV_FALLTHROUGH flags +from the original lhs token to the replacement token. Copying that way +the PREV_WHITE flag is needed for the #__VA_OPT__ handling and copying +over PREV_FALLTHROUGH fixes the new Wimplicit-fallthrough-38.c test. + +2021-12-01 Jakub Jelinek + + PR preprocessor/103415 +libcpp/ + * macro.c (stringify_arg): Remove va_opt argument and va_opt handling. + (paste_tokens): On successful paste or in PREV_WHITE and + PREV_FALLTHROUGH flags from the *plhs token to the new token. + (replace_args): Adjust stringify_arg callers. For #__VA_OPT__, + perform token pasting in a separate loop before stringify_arg call. +gcc/testsuite/ + * c-c++-common/cpp/va-opt-8.c: New test. + * c-c++-common/Wimplicit-fallthrough-38.c: New test. + +--- libcpp/macro.c.jj ++++ libcpp/macro.c +@@ -295,7 +295,7 @@ static cpp_context *next_context (cpp_re + static const cpp_token *padding_token (cpp_reader *, const cpp_token *); + static const cpp_token *new_string_token (cpp_reader *, uchar *, unsigned int); + static const cpp_token *stringify_arg (cpp_reader *, const cpp_token **, +- unsigned int, bool); ++ unsigned int); + static void paste_all_tokens (cpp_reader *, const cpp_token *); + static bool paste_tokens (cpp_reader *, location_t, + const cpp_token **, const cpp_token *); +@@ -826,8 +826,7 @@ cpp_quote_string (uchar *dest, const uch + /* Convert a token sequence FIRST to FIRST+COUNT-1 to a single string token + according to the rules of the ISO C #-operator. */ + static const cpp_token * +-stringify_arg (cpp_reader *pfile, const cpp_token **first, unsigned int count, +- bool va_opt) ++stringify_arg (cpp_reader *pfile, const cpp_token **first, unsigned int count) + { + unsigned char *dest; + unsigned int i, escape_it, backslash_count = 0; +@@ -844,24 +843,6 @@ stringify_arg (cpp_reader *pfile, const + { + const cpp_token *token = first[i]; + +- if (va_opt && (token->flags & PASTE_LEFT)) +- { +- location_t virt_loc = pfile->invocation_location; +- const cpp_token *rhs; +- do +- { +- if (i == count) +- abort (); +- rhs = first[++i]; +- if (!paste_tokens (pfile, virt_loc, &token, rhs)) +- { +- --i; +- break; +- } +- } +- while (rhs->flags & PASTE_LEFT); +- } +- + if (token->type == CPP_PADDING) + { + if (source == NULL +@@ -995,6 +976,7 @@ paste_tokens (cpp_reader *pfile, locatio + return false; + } + ++ lhs->flags |= (*plhs)->flags & (PREV_WHITE | PREV_FALLTHROUGH); + *plhs = lhs; + _cpp_pop_buffer (pfile); + return true; +@@ -1937,8 +1919,7 @@ replace_args (cpp_reader *pfile, cpp_has + if (src->flags & STRINGIFY_ARG) + { + if (!arg->stringified) +- arg->stringified = stringify_arg (pfile, arg->first, arg->count, +- false); ++ arg->stringified = stringify_arg (pfile, arg->first, arg->count); + } + else if ((src->flags & PASTE_LEFT) + || (src != macro->exp.tokens && (src[-1].flags & PASTE_LEFT))) +@@ -2065,11 +2046,46 @@ replace_args (cpp_reader *pfile, cpp_has + { + unsigned int count + = start ? paste_flag - start : tokens_buff_count (buff); +- const cpp_token *t +- = stringify_arg (pfile, +- start ? start + 1 +- : (const cpp_token **) (buff->base), +- count, true); ++ const cpp_token **first ++ = start ? start + 1 ++ : (const cpp_token **) (buff->base); ++ unsigned int i, j; ++ ++ /* Paste any tokens that need to be pasted before calling ++ stringify_arg, because stringify_arg uses pfile->u_buff ++ which paste_tokens can use as well. */ ++ for (i = 0, j = 0; i < count; i++, j++) ++ { ++ const cpp_token *token = first[i]; ++ ++ if (token->flags & PASTE_LEFT) ++ { ++ location_t virt_loc = pfile->invocation_location; ++ const cpp_token *rhs; ++ do ++ { ++ if (i == count) ++ abort (); ++ rhs = first[++i]; ++ if (!paste_tokens (pfile, virt_loc, &token, rhs)) ++ { ++ --i; ++ break; ++ } ++ } ++ while (rhs->flags & PASTE_LEFT); ++ } ++ ++ first[j] = token; ++ } ++ if (j != i) ++ { ++ while (i-- != j) ++ tokens_buff_remove_last_token (buff); ++ count = j; ++ } ++ ++ const cpp_token *t = stringify_arg (pfile, first, count); + while (count--) + tokens_buff_remove_last_token (buff); + if (src->flags & PASTE_LEFT) +--- gcc/testsuite/c-c++-common/cpp/va-opt-8.c.jj ++++ gcc/testsuite/c-c++-common/cpp/va-opt-8.c +@@ -0,0 +1,18 @@ ++/* PR preprocessor/103415 */ ++/* { dg-do run } */ ++/* { dg-options "-std=gnu99" { target c } } */ ++/* { dg-options "-std=c++20" { target c++ } } */ ++ ++#define n(x, ...) = #__VA_OPT__(x##3) ++#define o(x, ...) #__VA_OPT__(x##__VA_ARGS__##9) ++const char *c n(1 2, 4); ++const char *d = o(5 6, 7 8); ++ ++int ++main () ++{ ++ if (__builtin_strcmp (c, "1 23") ++ || __builtin_strcmp (d, "5 67 89")) ++ __builtin_abort (); ++ return 0; ++} +--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-38.c.jj ++++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-38.c +@@ -0,0 +1,24 @@ ++/* { dg-do compile } */ ++/* { dg-options "-Wimplicit-fallthrough=3" } */ ++ ++#define FOO \ ++int \ ++foo (int a) \ ++{ \ ++ switch (a) \ ++ { \ ++ case 1: \ ++ ++a; \ ++ /* FALLTHRU */ \ ++ case 2: \ ++ ++a; \ ++ /* FALLTHRU */ \ ++ ca##se 3: \ ++ ++a; \ ++ default: \ ++ break; \ ++ } \ ++ return a; \ ++} ++ ++FOO diff --git a/gcc11-stringify-__VA_OPT__.patch b/gcc11-stringify-__VA_OPT__.patch new file mode 100644 index 0000000..101b026 --- /dev/null +++ b/gcc11-stringify-__VA_OPT__.patch @@ -0,0 +1,307 @@ +c++: Add C++20 #__VA_OPT__ support + +The following patch implements C++20 # __VA_OPT__ (...) support. +Testcases cover what I came up with myself and what LLVM has for #__VA_OPT__ +in its testsuite and the string literals are identical between the two +compilers on the va-opt-5.c testcase. + +2021-08-17 Jakub Jelinek + +libcpp/ + * macro.c (vaopt_state): Add m_stringify member. + (vaopt_state::vaopt_state): Initialize it. + (vaopt_state::update): Overwrite it. + (vaopt_state::stringify): New method. + (stringify_arg): Replace arg argument with first, count arguments + and add va_opt argument. Use first instead of arg->first and + count instead of arg->count, for va_opt add paste_tokens handling. + (paste_tokens): Fix up len calculation. Don't spell rhs twice, + instead use %.*s to supply lhs and rhs spelling lengths. Don't call + _cpp_backup_tokens here. + (paste_all_tokens): Call it here instead. + (replace_args): Adjust stringify_arg caller. For vaopt_state::END + if stringify is true handle __VA_OPT__ stringification. + (create_iso_definition): Handle # __VA_OPT__ similarly to # macro_arg. +gcc/testsuite/ + * c-c++-common/cpp/va-opt-5.c: New test. + * c-c++-common/cpp/va-opt-6.c: New test. + +--- libcpp/macro.c ++++ libcpp/macro.c +@@ -118,6 +118,7 @@ class vaopt_state { + m_arg (arg), + m_variadic (is_variadic), + m_last_was_paste (false), ++ m_stringify (false), + m_state (0), + m_paste_location (0), + m_location (0), +@@ -145,6 +146,7 @@ class vaopt_state { + } + ++m_state; + m_location = token->src_loc; ++ m_stringify = (token->flags & STRINGIFY_ARG) != 0; + return BEGIN; + } + else if (m_state == 1) +@@ -234,6 +236,12 @@ class vaopt_state { + return m_state == 0; + } + ++ /* Return true for # __VA_OPT__. */ ++ bool stringify () const ++ { ++ return m_stringify; ++ } ++ + private: + + /* The cpp_reader. */ +@@ -247,6 +255,8 @@ class vaopt_state { + /* If true, the previous token was ##. This is used to detect when + a paste occurs at the end of the sequence. */ + bool m_last_was_paste; ++ /* True for #__VA_OPT__. */ ++ bool m_stringify; + + /* The state variable: + 0 means not parsing +@@ -284,7 +294,8 @@ static _cpp_buff *collect_args (cpp_read + static cpp_context *next_context (cpp_reader *); + static const cpp_token *padding_token (cpp_reader *, const cpp_token *); + static const cpp_token *new_string_token (cpp_reader *, uchar *, unsigned int); +-static const cpp_token *stringify_arg (cpp_reader *, macro_arg *); ++static const cpp_token *stringify_arg (cpp_reader *, const cpp_token **, ++ unsigned int, bool); + static void paste_all_tokens (cpp_reader *, const cpp_token *); + static bool paste_tokens (cpp_reader *, location_t, + const cpp_token **, const cpp_token *); +@@ -812,10 +823,11 @@ cpp_quote_string (uchar *dest, const uch + return dest; + } + +-/* Convert a token sequence ARG to a single string token according to +- the rules of the ISO C #-operator. */ ++/* Convert a token sequence FIRST to FIRST+COUNT-1 to a single string token ++ according to the rules of the ISO C #-operator. */ + static const cpp_token * +-stringify_arg (cpp_reader *pfile, macro_arg *arg) ++stringify_arg (cpp_reader *pfile, const cpp_token **first, unsigned int count, ++ bool va_opt) + { + unsigned char *dest; + unsigned int i, escape_it, backslash_count = 0; +@@ -828,9 +840,27 @@ stringify_arg (cpp_reader *pfile, macro_ + *dest++ = '"'; + + /* Loop, reading in the argument's tokens. */ +- for (i = 0; i < arg->count; i++) ++ for (i = 0; i < count; i++) + { +- const cpp_token *token = arg->first[i]; ++ const cpp_token *token = first[i]; ++ ++ if (va_opt && (token->flags & PASTE_LEFT)) ++ { ++ location_t virt_loc = pfile->invocation_location; ++ const cpp_token *rhs; ++ do ++ { ++ if (i == count) ++ abort (); ++ rhs = first[++i]; ++ if (!paste_tokens (pfile, virt_loc, &token, rhs)) ++ { ++ --i; ++ break; ++ } ++ } ++ while (rhs->flags & PASTE_LEFT); ++ } + + if (token->type == CPP_PADDING) + { +@@ -917,7 +947,7 @@ paste_tokens (cpp_reader *pfile, locatio + cpp_token *lhs; + unsigned int len; + +- len = cpp_token_len (*plhs) + cpp_token_len (rhs) + 1; ++ len = cpp_token_len (*plhs) + cpp_token_len (rhs) + 2; + buf = (unsigned char *) alloca (len); + end = lhsend = cpp_spell_token (pfile, *plhs, buf, true); + +@@ -943,8 +973,10 @@ paste_tokens (cpp_reader *pfile, locatio + location_t saved_loc = lhs->src_loc; + + _cpp_pop_buffer (pfile); +- _cpp_backup_tokens (pfile, 1); +- *lhsend = '\0'; ++ ++ unsigned char *rhsstart = lhsend; ++ if ((*plhs)->type == CPP_DIV && rhs->type != CPP_EQ) ++ rhsstart++; + + /* We have to remove the PASTE_LEFT flag from the old lhs, but + we want to keep the new location. */ +@@ -956,8 +988,10 @@ paste_tokens (cpp_reader *pfile, locatio + /* Mandatory error for all apart from assembler. */ + if (CPP_OPTION (pfile, lang) != CLK_ASM) + cpp_error_with_line (pfile, CPP_DL_ERROR, location, 0, +- "pasting \"%s\" and \"%s\" does not give a valid preprocessing token", +- buf, cpp_token_as_text (pfile, rhs)); ++ "pasting \"%.*s\" and \"%.*s\" does not give " ++ "a valid preprocessing token", ++ (int) (lhsend - buf), buf, ++ (int) (end - rhsstart), rhsstart); + return false; + } + +@@ -1033,7 +1067,10 @@ paste_all_tokens (cpp_reader *pfile, con + abort (); + } + if (!paste_tokens (pfile, virt_loc, &lhs, rhs)) +- break; ++ { ++ _cpp_backup_tokens (pfile, 1); ++ break; ++ } + } + while (rhs->flags & PASTE_LEFT); + +@@ -1900,7 +1937,8 @@ replace_args (cpp_reader *pfile, cpp_has + if (src->flags & STRINGIFY_ARG) + { + if (!arg->stringified) +- arg->stringified = stringify_arg (pfile, arg); ++ arg->stringified = stringify_arg (pfile, arg->first, arg->count, ++ false); + } + else if ((src->flags & PASTE_LEFT) + || (src != macro->exp.tokens && (src[-1].flags & PASTE_LEFT))) +@@ -2023,6 +2061,24 @@ replace_args (cpp_reader *pfile, cpp_has + paste_flag = tokens_buff_last_token_ptr (buff); + } + ++ if (vaopt_tracker.stringify ()) ++ { ++ unsigned int count ++ = start ? paste_flag - start : tokens_buff_count (buff); ++ const cpp_token *t ++ = stringify_arg (pfile, ++ start ? start + 1 ++ : (const cpp_token **) (buff->base), ++ count, true); ++ while (count--) ++ tokens_buff_remove_last_token (buff); ++ if (src->flags & PASTE_LEFT) ++ copy_paste_flag (pfile, &t, src); ++ tokens_buff_add_token (buff, virt_locs, ++ t, t->src_loc, t->src_loc, ++ NULL, 0); ++ continue; ++ } + if (start && paste_flag == start && (*start)->flags & PASTE_LEFT) + /* If __VA_OPT__ expands to nothing (either because __VA_ARGS__ + is empty or because it is __VA_OPT__() ), drop PASTE_LEFT +@@ -3584,7 +3640,10 @@ create_iso_definition (cpp_reader *pfile + function-like macros when lexing the subsequent token. */ + if (macro->count > 1 && token[-1].type == CPP_HASH && macro->fun_like) + { +- if (token->type == CPP_MACRO_ARG) ++ if (token->type == CPP_MACRO_ARG ++ || (macro->variadic ++ && token->type == CPP_NAME ++ && token->val.node.node == pfile->spec_nodes.n__VA_OPT__)) + { + if (token->flags & PREV_WHITE) + token->flags |= SP_PREV_WHITE; +--- gcc/testsuite/c-c++-common/cpp/va-opt-5.c ++++ gcc/testsuite/c-c++-common/cpp/va-opt-5.c +@@ -0,0 +1,67 @@ ++/* { dg-do run } */ ++/* { dg-options "-std=gnu99" { target c } } */ ++/* { dg-options "-std=c++20" { target c++ } } */ ++ ++#define lparen ( ++#define a0 fooa0 ++#define a1 fooa1 a0 ++#define a2 fooa2 a1 ++#define a3 fooa3 a2 ++#define a() b lparen ) ++#define b() c lparen ) ++#define c() d lparen ) ++#define g h ++#define i(j) j ++#define f(...) #__VA_OPT__(g i(0)) ++#define k(x,...) # __VA_OPT__(x) #x #__VA_OPT__(__VA_ARGS__) ++#define l(x,...) #__VA_OPT__(a1 x) ++#define m(x,...) "a()" #__VA_OPT__(a3 __VA_ARGS__ x ## __VA_ARGS__ ## x ## c a3) "a()" ++#define n(x,...) = #__VA_OPT__(a3 __VA_ARGS__ x ## __VA_ARGS__ ## x ## c a3) #x #__VA_OPT__(a0 __VA_ARGS__ x ## __VA_ARGS__ ## x ## c a0) ; ++#define o(x, ...) #__VA_OPT__(x##x x##x) ++#define p(x, ...) #__VA_OPT__(_Pragma ("foobar")) ++#define q(...) #__VA_OPT__(/* foo */x/* bar */) ++const char *v1 = f(); ++const char *v2 = f(123); ++const char *v3 = k(1); ++const char *v4 = k(1, 2, 3 ); ++const char *v5 = l(a()); ++const char *v6 = l(a1 a(), 1); ++const char *v7 = m(); ++const char *v8 = m(,); ++const char *v9 = m(,a3); ++const char *v10 = m(a3,a(),a0); ++const char *v11 n() ++const char *v12 n(,) ++const char *v13 n(,a0) ++const char *v14 n(a0, a(),a0) ++const char *v15 = o(, 0); ++const char *v16 = p(0); ++const char *v17 = p(0, 1); ++const char *v18 = q(); ++const char *v19 = q(1); ++ ++int ++main () ++{ ++ if (__builtin_strcmp (v1, "") ++ || __builtin_strcmp (v2, "g i(0)") ++ || __builtin_strcmp (v3, "1") ++ || __builtin_strcmp (v4, "112, 3") ++ || __builtin_strcmp (v5, "") ++ || __builtin_strcmp (v6, "a1 fooa1 fooa0 b ( )") ++ || __builtin_strcmp (v7, "a()a()") ++ || __builtin_strcmp (v8, "a()a()") ++ || __builtin_strcmp (v9, "a()a3 fooa3 fooa2 fooa1 fooa0 a3c a3a()") ++ || __builtin_strcmp (v10, "a()a3 b ( ),fooa0 a3a(),a0a3c a3a()") ++ || __builtin_strcmp (v11, "") ++ || __builtin_strcmp (v12, "") ++ || __builtin_strcmp (v13, "a3 fooa0 a0c a3a0 fooa0 a0c a0") ++ || __builtin_strcmp (v14, "a3 b ( ),fooa0 a0a(),a0a0c a3a0a0 b ( ),fooa0 a0a(),a0a0c a0") ++ || __builtin_strcmp (v15, "") ++ || __builtin_strcmp (v16, "") ++ || __builtin_strcmp (v17, "_Pragma (\"foobar\")") ++ || __builtin_strcmp (v18, "") ++ || __builtin_strcmp (v19, "x")) ++ __builtin_abort (); ++ return 0; ++} +--- gcc/testsuite/c-c++-common/cpp/va-opt-6.c ++++ gcc/testsuite/c-c++-common/cpp/va-opt-6.c +@@ -0,0 +1,17 @@ ++/* { dg-do preprocess } */ ++/* { dg-options "-std=gnu99" { target c } } */ ++/* { dg-options "-std=c++20" { target c++ } } */ ++ ++#define a "" ++#define b(...) a ## #__VA_OPT__(1) /* { dg-error "pasting \"a\" and \"\"\"\" does not give a valid preprocessing token" } */ ++#define c(...) a ## #__VA_OPT__(1) /* { dg-error "pasting \"a\" and \"\"1\"\" does not give a valid preprocessing token" } */ ++#define d(...) #__VA_OPT__(1) ## ! ++#define e(...) #__VA_OPT__(1) ## ! ++#define f(...) #__VA_OPT__(. ## !) ++#define g(...) #__VA_OPT__(. ## !) ++b() ++c(1) ++d( ) /* { dg-error "pasting \"\"\"\" and \"!\" does not give a valid preprocessing token" } */ ++e( 1 ) /* { dg-error "pasting \"\"1\"\" and \"!\" does not give a valid preprocessing token" } */ ++f() ++g(0) /* { dg-error "pasting \".\" and \"!\" does not give a valid preprocessing token" } */ diff --git a/gcc16-Wno-format-security.patch b/gcc16-Wno-format-security.patch deleted file mode 100644 index 2a4f0f3..0000000 --- a/gcc16-Wno-format-security.patch +++ /dev/null @@ -1,66 +0,0 @@ -2022-01-07 Jakub Jelinek - - * Makefile.tpl (GOCFLAGS, GDCFLAGS): Filter out -Wformat-security. - * Makefile.in: Regenerated. - -2017-02-25 Jakub Jelinek - - * configure.ac: When adding -Wno-format, also add -Wno-format-security. - * configure: Regenerated. - ---- gcc/configure.ac.jj 2017-02-13 12:20:53.000000000 +0100 -+++ gcc/configure.ac 2024-11-30 13:34:11.100296256 +0100 -@@ -592,7 +592,7 @@ AC_ARG_ENABLE(build-format-warnings, - AS_HELP_STRING([--disable-build-format-warnings],[don't use -Wformat while building GCC]), - [],[enable_build_format_warnings=yes]) - AS_IF([test $enable_build_format_warnings = no], -- [wf_opt=-Wno-format],[wf_opt=]) -+ [wf_opt="-Wno-format -Wno-format-security"],[wf_opt=]) - ACX_PROG_CXX_WARNING_OPTS( - m4_quote(m4_do([-W -Wall -Wno-error=narrowing -Wwrite-strings ], - [-Wcast-qual $wf_opt])), ---- gcc/configure.jj 2017-02-13 12:20:52.000000000 +0100 -+++ gcc/configure 2017-02-25 12:42:50.041946391 +0100 -@@ -7077,7 +7077,7 @@ else - fi - - if test $enable_build_format_warnings = no; then : -- wf_opt=-Wno-format -+ wf_opt="-Wno-format -Wno-format-security" - else - wf_opt= - fi ---- Makefile.tpl.jj 2023-11-29 13:21:41.680292662 +0100 -+++ Makefile.tpl 2024-11-30 13:35:29.303196246 +0100 -@@ -450,10 +450,10 @@ LDFLAGS = @LDFLAGS@ - LIBCFLAGS = $(CFLAGS) - CXXFLAGS = @CXXFLAGS@ - LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates --GOCFLAGS = $(CFLAGS) --A68FLAGS = @A68FLAGS@ --GDCFLAGS = @GDCFLAGS@ --GM2FLAGS = $(CFLAGS) -+GOCFLAGS = $(filter-out -Wformat-security,$(CFLAGS)) -+A68FLAGS = $(filter-out -Wformat-security,@A68FLAGS@) -+GDCFLAGS = $(filter-out -Wformat-security,@GDCFLAGS@) -+GM2FLAGS = $(filter-out -Wformat-security,$(CFLAGS)) - - CRAB1_LIBS = @CRAB1_LIBS@ - ---- Makefile.in.jj 2023-11-29 13:21:41.691292507 +0100 -+++ Makefile.in 2024-11-30 13:36:12.113594079 +0100 -@@ -447,10 +447,10 @@ LDFLAGS = @LDFLAGS@ - LIBCFLAGS = $(CFLAGS) - CXXFLAGS = @CXXFLAGS@ - LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates --GOCFLAGS = $(CFLAGS) --A68FLAGS = @A68FLAGS@ --GDCFLAGS = @GDCFLAGS@ --GM2FLAGS = $(CFLAGS) -+GOCFLAGS = $(filter-out -Wformat-security,$(CFLAGS)) -+A68FLAGS = $(filter-out -Wformat-security,@A68FLAGS@) -+GDCFLAGS = $(filter-out -Wformat-security,@GDCFLAGS@) -+GM2FLAGS = $(filter-out -Wformat-security,$(CFLAGS)) - - CRAB1_LIBS = @CRAB1_LIBS@ - diff --git a/gcc16-pr119006.patch b/gcc16-pr119006.patch deleted file mode 100644 index dfbdaa9..0000000 --- a/gcc16-pr119006.patch +++ /dev/null @@ -1,76 +0,0 @@ -2025-02-27 Jakub Jelinek - - PR ipa/119006 - * ipa-icf-gimple.cc (func_checker::compare_operand): If t1 and t2 - are ADDR_EXPRs, call operand_equal_p on their operands rather than on - the ADDR_EXPRs themselves. Formatting fix. - - * g++.dg/opt/pr119006.C: New test. - ---- gcc/ipa-icf-gimple.cc.jj 2025-02-01 00:50:02.080774328 +0100 -+++ gcc/ipa-icf-gimple.cc 2025-02-27 14:35:19.931183246 +0100 -@@ -437,12 +437,23 @@ func_checker::compare_operand (tree t1, - ("compare_ao_refs failed (dependence clique difference)"); - gcc_unreachable (); - } -+ else if (TREE_CODE (t1) == ADDR_EXPR && TREE_CODE (t2) == ADDR_EXPR) -+ { -+ /* For ADDR_EXPR compare the operands of the ADDR_EXPR rather than -+ the ADDR_EXPRs themselves. operand_equal_p will compare the -+ operands with OEP_ADDRESS_OF and only care about the value -+ of the ADDR_EXPR, rather than e.g. types of MEM_REFs in there. -+ Some optimizations use such details though, see PR119006. */ -+ if (operand_equal_p (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0), -+ OEP_MATCH_SIDE_EFFECTS)) -+ return true; -+ return return_false_with_msg ("operand_equal_p failed"); -+ } - else - { - if (operand_equal_p (t1, t2, OEP_MATCH_SIDE_EFFECTS)) - return true; -- return return_false_with_msg -- ("operand_equal_p failed"); -+ return return_false_with_msg ("operand_equal_p failed"); - } - } - ---- gcc/testsuite/g++.dg/opt/pr119006.C.jj 2025-02-27 14:37:05.952707350 +0100 -+++ gcc/testsuite/g++.dg/opt/pr119006.C 2025-02-27 14:36:29.251218260 +0100 -@@ -0,0 +1,36 @@ -+// PR ipa/119006 -+// { dg-do run { target c++11 } } -+// { dg-options "-O2 -fwhole-program" } -+ -+struct A { -+ bool operator== (const char *x) const { return x && !__builtin_strcmp (a, x); } -+ char a[11]; -+}; -+ -+struct B { -+ bool operator== (const char *x) const { return x && !__builtin_strcmp (a, x); } -+ bool operator!= (const char *x) const { return !(*this == x); } -+ char a[128]; -+}; -+ -+[[gnu::noinline,gnu::used]] int -+foo (const A& lhs, const char* rhs) -+{ -+ return lhs == rhs; -+} -+ -+constexpr const char *t = "abcdefghijklmno"; -+ -+[[gnu::noinline,gnu::used]] void -+bar (B x) -+{ -+ if (x != t) __builtin_abort (); -+} -+ -+int -+main () -+{ -+ B b; -+ __builtin_strcpy (b.a, t); -+ bar (b); -+} diff --git a/gcc16-pr123273.patch b/gcc16-pr123273.patch deleted file mode 100644 index 987f6e0..0000000 --- a/gcc16-pr123273.patch +++ /dev/null @@ -1,54 +0,0 @@ -2026-01-06 Jakub Jelinek - - PR preprocessor/123273 - * lex.cc (cpp_directive_only_process): Only go to done_comment - for '/' if star is true and esc is false. When seeing '\\' with - esc set to true, clear esc as well as star instead of keeping esc - set. - - * c-c++-common/cpp/dir-only-10.c: New test. - * c-c++-common/cpp/dir-only-11.c: New test. - ---- libcpp/lex.cc.jj 2026-01-02 09:56:10.417332292 +0100 -+++ libcpp/lex.cc 2026-01-05 16:40:26.413766032 +0100 -@@ -5461,7 +5461,13 @@ cpp_directive_only_process (cpp_reader * - switch (c) - { - case '\\': -- esc = true; -+ if (esc) -+ { -+ star = false; -+ esc = false; -+ } -+ else -+ esc = true; - break; - - case '\r': -@@ -5492,7 +5498,7 @@ cpp_directive_only_process (cpp_reader * - break; - - case '/': -- if (star) -+ if (star && !esc) - goto done_comment; - /* FALLTHROUGH */ - ---- gcc/testsuite/c-c++-common/cpp/dir-only-10.c.jj 2026-01-05 17:04:26.144566116 +0100 -+++ gcc/testsuite/c-c++-common/cpp/dir-only-10.c 2026-01-05 17:05:02.226946201 +0100 -@@ -0,0 +1,5 @@ -+/* PR preprocessor/123273 */ -+/* { dg-do preprocess } */ -+/* { dg-options -fdirectives-only } */ -+ -+/* *\/""" */ ---- gcc/testsuite/c-c++-common/cpp/dir-only-11.c.jj 2026-01-05 17:05:18.498666647 +0100 -+++ gcc/testsuite/c-c++-common/cpp/dir-only-11.c 2026-01-05 17:06:17.574651691 +0100 -@@ -0,0 +1,6 @@ -+/* PR preprocessor/123273 */ -+/* { dg-do preprocess } */ -+/* { dg-options -fdirectives-only } */ -+ -+/* *\\ -+/""" */ diff --git a/gcc16-rh1574936.patch b/gcc16-rh1574936.patch deleted file mode 100644 index bcc7000..0000000 --- a/gcc16-rh1574936.patch +++ /dev/null @@ -1,21 +0,0 @@ -crt files and statically linked libgcc objects cause false positives -in annobin coverage, so we add the assembler flag to generate notes -for them. - -The patch also adds notes to libgcc_s.so, but this is harmless because -these notes only confer that there is no other annobin markup. - -2018-07-25 Florian Weimer - - * config/t-linux (LIBGCC2_CFLAGS, CRTSTUFF_CFLAGS): Add - -Wa,--generate-missing-build-notes=yes. - ---- libgcc/config/t-linux 2022-12-15 19:25:20.581394950 +0100 -+++ libgcc/config/t-linux 2023-03-21 22:00:37.054478562 +0100 -@@ -1,3 +1,6 @@ - # Override t-slibgcc-elf-ver to export some libgcc symbols with - # the symbol versions that glibc used. - SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver -+ -+LIBGCC2_CFLAGS += -Wa,--generate-missing-build-notes=yes -+CRTSTUFF_CFLAGS += -Wa,--generate-missing-build-notes=yes diff --git a/isl-rh2155127.patch b/isl-rh2155127.patch deleted file mode 100644 index 092bddb..0000000 --- a/isl-rh2155127.patch +++ /dev/null @@ -1,85 +0,0 @@ -From: Sven Verdoolaege -Date: Mon, 6 Jun 2022 12:56:02 +0000 (+0200) -Subject: update m4/ax_prog_cc_for_build.m4 -X-Git-Tag: isl-0.25~11 -X-Git-Url: https://repo.or.cz/isl.git/commitdiff_plain/b4dcdfadc29a6c9f410a72f345f3f32725b1d38b - -update m4/ax_prog_cc_for_build.m4 - -In particular, update to the latest version from the autoconf archive, -but preserve the changes from isl-0.22.1-358-gcd42abdf2 -(m4/ax_prog_cc_for_build.m4: do not override host compiler dependency style, -Tue Jun 9 10:54:10 2020 +0200). - -Signed-off-by: Sven Verdoolaege - ---- isl-0.24/m4/ax_prog_cc_for_build.m4.jj 2021-03-02 12:07:09.000000000 +0100 -+++ isl-0.24/m4/ax_prog_cc_for_build.m4 2022-12-20 18:11:18.855777817 +0100 -@@ -32,7 +32,7 @@ - # and this notice are preserved. This file is offered as-is, without any - # warranty. - --#serial 18 -+#serial 21 - - AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) - AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl -@@ -44,6 +44,8 @@ dnl Use the standard macros, but make th - dnl - pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl - pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl -+pushdef([ac_cv_prog_cc_c99], ac_cv_build_prog_cc_c99)dnl -+pushdef([ac_cv_prog_cc_c11], ac_cv_build_prog_cc_c11)dnl - pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl - pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl - pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl -@@ -86,7 +88,21 @@ AS_IF([test -n "$build"], [ac_build - [test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"]) - - AC_LANG_PUSH([C]) -+ -+dnl The pushdef([ac_cv_c_compiler_gnu], ...) currently does not cover -+dnl the use of this variable in _AC_LANG_COMPILER_GNU called by -+dnl AC_PROG_CC. Unset this cache variable temporarily as a workaround. -+was_set_c_compiler_gnu=${[ac_cv_c_compiler_gnu]+y} -+AS_IF([test ${was_set_c_compiler_gnu}], -+ [saved_c_compiler_gnu=$[ac_cv_c_compiler_gnu] -+ AS_UNSET([[ac_cv_c_compiler_gnu]])]) -+ - AC_PROG_CC -+ -+dnl Restore ac_cv_c_compiler_gnu -+AS_IF([test ${was_set_c_compiler_gnu}], -+ [[ac_cv_c_compiler_gnu]=$[saved_c_compiler_gnu]]) -+ - _AC_COMPILER_EXEEXT - _AC_COMPILER_OBJEXT - AC_PROG_CPP ---- isl-0.24/configure.jj 2021-04-26 11:13:19.000000000 +0200 -+++ isl-0.24/configure 2022-12-20 18:11:36.882518568 +0100 -@@ -5002,6 +4990,13 @@ ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR - ac_link='$CC_FOR_BUILD -o conftest$ac_build_exeext $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_build_c_compiler_gnu - -+ -+was_set_c_compiler_gnu=${ac_cv_c_compiler_gnu+y} -+if test ${was_set_c_compiler_gnu}; then : -+ saved_c_compiler_gnu=$ac_cv_c_compiler_gnu -+ { ac_cv_c_compiler_gnu=; unset ac_cv_c_compiler_gnu;} -+fi -+ - ac_ext=c - ac_cpp='$CPP_FOR_BUILD $CPPFLAGS_FOR_BUILD' - ac_compile='$CC_FOR_BUILD -c $CFLAGS_FOR_BUILD $CPPFLAGS_FOR_BUILD conftest.$ac_ext >&5' -@@ -5728,6 +5723,11 @@ else - fi - - -+ -+if test ${was_set_c_compiler_gnu}; then : -+ ac_cv_c_compiler_gnu=$saved_c_compiler_gnu -+fi -+ - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - diff --git a/plans/ci.fmf b/plans/ci.fmf index b661134..85710d6 100644 --- a/plans/ci.fmf +++ b/plans/ci.fmf @@ -1,13 +1,6 @@ summary: CI Gating Plan discover: how: fmf - url: https://gitlab.com/redhat/centos-stream/tests/gcc.git - filter: 'tag: Fedora-CI-gating' + directory: tests execute: how: tmt -adjust: - - prepare+: - - name: Add secondary architecture RPMs - how: shell - script: ./plans/provide_secondary_arch_rpms.sh - when: arch == x86_64 diff --git a/plans/provide_secondary_arch_rpms.sh b/plans/provide_secondary_arch_rpms.sh deleted file mode 100755 index f26a5ab..0000000 --- a/plans/provide_secondary_arch_rpms.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash - -# Fedora CI testing systems don't provide a repository with the i686 -# RPMs of the build being tested. As a consequence, most -# dnf install -y .i686 -# commands (whether being run by a test or by TMT's prepare) will probably -# fail on a version mismatch with the present x86_64 gcc RPMs. To prevent -# such failures we provide this script which we recommend to include in every -# Fedora CI test plan. -# -# Implementation notes: -# -# * The gcc build being tested in Fedora CI is given via KOJI_TASK_ID. See -# https://github.com/fedora-ci/dist-git-pipeline/pull/50 for details. -# -# * Currently this script just downloads and installs the i686 RPMs. It -# would not be sufficient for tests that uninstall and reinstall those -# RPMs. If such a test appears, this script should create a repository. -# -# * Fedora CI testing systems seem to have extremely small RAM-based /tmp, -# unable to host all the downloaded RPMs, and no other "real" filesystem -# than "/". That's the reason for using -# mktemp -d --tmpdir=/ - -set -x - -true "V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V-V" - -echo "KOJI_TASK_ID=$KOJI_TASK_ID" - -. /etc/os-release - -echo "ID=$ID" -echo "arch=$(arch)" -echo "KOJI_TASK_ID=$KOJI_TASK_ID" - -if [[ "$ID" = fedora ]] && [[ "$(arch)" = x86_64 ]] && [[ -n "$KOJI_TASK_ID" ]]; then - - if tmpd=$(mktemp -d --tmpdir=/) && pushd "$tmpd"; then - - # Download - rpm -q koji || dnf -y install koji - koji download-task "$KOJI_TASK_ID" --noprogress --arch={x86_64,i686,noarch} - - # Remove conflicting RPMs - rm -f ./*debuginfo* ./*debugsource* - rm -f gcc-[0-9]*.i686.* - rm -f ./*docs*.i686.* - - # Install - ls - dnf -y install ./*.rpm - - # Clean up - # shellcheck disable=SC2164 - popd - rm -rf "$tmpd" - fi - -else - echo "Not applicable" -fi - -true "^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^" diff --git a/rpminspect.yaml b/rpminspect.yaml deleted file mode 100644 index f31bc02..0000000 --- a/rpminspect.yaml +++ /dev/null @@ -1,37 +0,0 @@ -inspections: - # GCC subpackages are inter-dependent but without requesting an explicit - # version - which rpmdeps dislikes and creates huge reports. We can't fix - # it easily and it's not a practical problem anyway. Unfortunately we - # can't tell rpmdeps to ignore just that particular warning. Switching off - # the rpmdeps checks looks like a lesser evil. - rpmdeps: off - -badfuncs: - # GCC doesn't use the so called bad functions "much". If they appear then - # - it is instrumenting them in sanitizers - # - in languages that don't move further downstream. - # We are OK with that. - ignore: - - /usr/lib*/libasan.so.*.*.* - - /usr/lib*/libtsan.so.*.*.* - - /usr/lib*/libgnat-*.so - - /usr/lib*/libgphobos.so.*.*.* - - /usr/lib*/libm2iso.so.*.*.* - - /usr/lib*/libm2pim.so.*.*.* - -pathmigration: - # Incomplete UsrMove, known but not planned at the moment - ignore: - - /lib*/libgcc_s-*.so.* - - /lib*/libgcc_s.so.* - -debuginfo: - # Skip the Go binaries, they ship unstripped - ignore: - - /usr/bin/go.gcc - - /usr/bin/gofmt.gcc - - /usr/lib*/libgo.so.*.*.* - - /usr/libexec/gcc/*-redhat-linux/*/buildid - - /usr/libexec/gcc/*-redhat-linux/*/cgo - - /usr/libexec/gcc/*-redhat-linux/*/test2json - - /usr/libexec/gcc/*-redhat-linux/*/vet diff --git a/sources b/sources index f1dba4c..5ba9a7a 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (gcc-16.0.1-20260115.tar.xz) = 51ab079dedde5547caba601ce03954d4c5b2bf687538f106d3e851a8918162017fe65817d9e22fd115cf4d4f970bfba6a70a34db183141ce28c5c203a68eec0b -SHA512 (isl-0.24.tar.bz2) = aab3bddbda96b801d0f56d2869f943157aad52a6f6e6a61745edd740234c635c38231af20bc3f1a08d416a5e973a90e18249078ed8e4ae2f1d5de57658738e95 -SHA512 (newlib-cygwin-d35cc82b5ec15bb8a5fe0fe11e183d1887992e99.tar.xz) = ef9495745a96d1d76f9f425c4a48c807fface36a1aa92351c5d024103678d144d046e8de55d195103784472c14874e29e4b9284d5d6a2e7bb27fd98c8455a881 -SHA512 (nvptx-tools-a0c1fff6534a4df9fb17937c3c4a4b1071212029.tar.xz) = 7f862986065028df70c843fc3f2c89e200a76b48ad0bd51c749ac8a5aab7be0ebdf35be182fad2407b3281615e75be1ac6833ab6a5130ae9920169a0412f94f0 +SHA512 (gcc-11.3.1-20220421.tar.xz) = c631a8a990a6977b70a878c34a69c64dd49387edae0931ef64433cbf5f361ecec6a4118a9a5b1eab57b354eecea125297f721ddd25daebc2290749a7eae17af2 +SHA512 (isl-0.18.tar.bz2) = 85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c41b2de5f351025370e57448b63b2b8a8cf8a0843a089c3263f9baee1542d5c2e1cb37ed39d94 +SHA512 (newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz) = 002a48a7b689a81abbf16161bcaec001a842e67dfbe372e9e109092703bfc666675f16198f60ca429370e8850d564547dc505df81bc3aaca4ce6defbc014ad6c +SHA512 (nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz) = f6d10db94fa1570ae0f94df073fa3c73c8e5ee16d59070b53d94f7db0de8a031bc44d7f3f1852533da04b625ce758e022263855ed43cfc6867e0708d001e53c7 diff --git a/tests/Regression/bz1815504-Regression-in-the-line-information-debug/main.fmf b/tests/Regression/bz1815504-Regression-in-the-line-information-debug/main.fmf new file mode 100644 index 0000000..82cdc4e --- /dev/null +++ b/tests/Regression/bz1815504-Regression-in-the-line-information-debug/main.fmf @@ -0,0 +1,12 @@ +summary: Test for BZ#1815504 (Regression in the line information debug) +description: | + Bug summary: Regression in the line information debug information generated by gcc + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1815504 +recommend: +- gcc +- valgrind +duration: 5m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1815504 +extra-summary: /tools/gcc/Regression/bz1815504-Regression-in-the-line-information-debug +extra-task: /tools/gcc/Regression/bz1815504-Regression-in-the-line-information-debug diff --git a/tests/Regression/bz1815504-Regression-in-the-line-information-debug/runtest.sh b/tests/Regression/bz1815504-Regression-in-the-line-information-debug/runtest.sh new file mode 100755 index 0000000..585e76c --- /dev/null +++ b/tests/Regression/bz1815504-Regression-in-the-line-information-debug/runtest.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/gcc/Regression/bz1815504-Regression-in-the-line-information-debug +# Description: Test for BZ#1815504 (Regression in the line information debug) +# Author: Alexandra Hájková +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="gcc" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "valgrind -q date &> log" 0 + rlAssertNotGrep "Can't handle inlined call info entry with line number" log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support/main.fmf b/tests/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support/main.fmf new file mode 100644 index 0000000..1c87a12 --- /dev/null +++ b/tests/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support/main.fmf @@ -0,0 +1,17 @@ +summary: Test for BZ#1852781 (Compiling with -flto and -g removes CET support) +description: | + Bug summary: Compiling with -flto and -g removes CET support + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1852781 +contact: Alexandra Hájková +component: +- gcc +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc +- binutils +duration: 15m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1852781 +extra-summary: /tools/gcc/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support +extra-task: /tools/gcc/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support diff --git a/tests/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support/runtest.sh b/tests/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support/runtest.sh new file mode 100755 index 0000000..84cae8f --- /dev/null +++ b/tests/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support/runtest.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/gcc/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support +# Description: Test for BZ#1852781 (Compiling with -flto and -g removes CET support) +# Author: Alexandra Hájková +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="gcc" +TESTPROG="x" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp $TESTPROG.c $TmpDir" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -flto -c -fcf-protection -g $TESTPROG.c" + rlRun "gcc -flto -Wl,-z,cet-report=error -fcf-protection -g $TESTPROG.o &> log" + rlAssertNotGrep " missing IBT and SHSTK properties" log + rlRun "readelf --wide --notes a.out | grep IBT &> log" + rlAsserGrep "IBT, SHSTK" log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support/x.c b/tests/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support/x.c new file mode 100644 index 0000000..64fffec --- /dev/null +++ b/tests/Regression/bz1852781-Compiling-with-flto-and-g-removes-CET-support/x.c @@ -0,0 +1,8 @@ +#include + +int +main () +{ + printf ("hello\n"); + return 0; +} diff --git a/tests/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul/main.fmf b/tests/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul/main.fmf new file mode 100644 index 0000000..1540389 --- /dev/null +++ b/tests/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul/main.fmf @@ -0,0 +1,17 @@ +summary: Test for BZ#1853900 (typeinfo for stdcodecvt_utf8 not found + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1853900 +contact: Alexandra Hájková +component: +- gcc +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc +- gcc-c++ +duration: 10m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1853900 +extra-summary: /tools/gcc/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul +extra-task: /tools/gcc/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul diff --git a/tests/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul/runtest.sh b/tests/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul/runtest.sh new file mode 100755 index 0000000..a6eb4ed --- /dev/null +++ b/tests/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul/runtest.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/gcc/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul +# Description: Test for BZ#1853900 (typeinfo for stdcodecvt_utf8 +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="gcc" +TESTPROG="test.cc" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp $TESTPROG $TmpDir" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "g++ -std=c++17 $TESTPROG &> log" + rlAssertNotGrep "hidden symbol " log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul/test.cc b/tests/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul/test.cc new file mode 100644 index 0000000..075633f --- /dev/null +++ b/tests/Regression/bz1853900-typeinfo-for-std-codecvt-utf8-wchar-t-1114111ul/test.cc @@ -0,0 +1,7 @@ +#include + +namespace fs = std::filesystem; +int main() { + fs::create_directory("sandbox"); + fs::remove_all("sandbox"); +} diff --git a/tests/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and/main.fmf b/tests/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and/main.fmf new file mode 100644 index 0000000..8167f92 --- /dev/null +++ b/tests/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and/main.fmf @@ -0,0 +1,16 @@ +summary: Test for BZ#1878841 (GOMP_parallel_loop_nonmonotonic_dynamic and) +description: | + Bug summary: GOMP_parallel_loop_nonmonotonic_dynamic and GOMP_loop_nonmonotonic_dynamic_next missing + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1878841 +contact: Alexandra Hájková +component: +- gcc +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc +duration: 5m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1878841 +extra-summary: /tools/gcc/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and +extra-task: /tools/gcc/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and diff --git a/tests/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and/runtest.sh b/tests/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and/runtest.sh new file mode 100755 index 0000000..83c42ef --- /dev/null +++ b/tests/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and/runtest.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/gcc/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and +# Description: Test for BZ#1878841 (GOMP_parallel_loop_nonmonotonic_dynamic and) +# Author: Alexandra Hájková +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="gcc" +TESTPROG="tst" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp $TESTPROG.c $TmpDir" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -fopenmp $TESTPROG.c &> log" + rlAssertNotGrep "undefined reference to `GOMP_parallel_loop_nonmonotonic_dynamic`" log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and/tst.c b/tests/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and/tst.c new file mode 100644 index 0000000..741559e --- /dev/null +++ b/tests/Regression/bz1878841-GOMP-parallel-loop-nonmonotonic-dynamic-and/tst.c @@ -0,0 +1,6 @@ +#include +int main () +{ + #pragma omp parallel for schedule(dynamic) + for (int i = 0; i < 10; i++); +} diff --git a/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/b.gdb b/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/b.gdb new file mode 100644 index 0000000..341301d --- /dev/null +++ b/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/b.gdb @@ -0,0 +1,2 @@ +info functions foo +q diff --git a/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/main.fmf b/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/main.fmf new file mode 100644 index 0000000..7054cbd --- /dev/null +++ b/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/main.fmf @@ -0,0 +1,17 @@ +summary: Test for BZ#1893340 (Variadic arguments are missing from debugging data) +description: | + Bug summary: Variadic arguments are missing from debugging data when building with -flto + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1893340 +contact: Alexandra Hájková +component: +- gcc +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc +- gdb +duration: 5m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1893340 +extra-summary: /tools/gcc/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data +extra-task: /tools/gcc/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data diff --git a/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/runtest.sh b/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/runtest.sh new file mode 100755 index 0000000..f2dd2ca --- /dev/null +++ b/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/runtest.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/gcc/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data +# Description: Test for BZ#1893340 (Variadic arguments are missing from debugging data) +# Author: Alexandra Hájková +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="gcc" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp test.c b.gdb $TmpDir" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -fPIC -shared -o libtest.so -O0 -g test.c" + rlRun "gdb -x b.gdb libtest.so > gdb.log" + rlAssertGrep "void foo(int, ...);" gdb.log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/test.c b/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/test.c new file mode 100644 index 0000000..3de5962 --- /dev/null +++ b/tests/Regression/bz1893340-Variadic-arguments-are-missing-from-debugging-data/test.c @@ -0,0 +1,6 @@ +#include +void foo(int args, ...) { + va_list ap; + va_start(ap, args); + va_end(ap); +} diff --git a/tests/Regression/bz1896093-Compiling-with-flto-auto-fails-if-make-is-not/main.fmf b/tests/Regression/bz1896093-Compiling-with-flto-auto-fails-if-make-is-not/main.fmf new file mode 100644 index 0000000..c1da31b --- /dev/null +++ b/tests/Regression/bz1896093-Compiling-with-flto-auto-fails-if-make-is-not/main.fmf @@ -0,0 +1,16 @@ +summary: Test for BZ#1896093 (Compiling with -flto=auto fails if make is not) +description: | + Bug summary: Compiling with -flto=auto fails if make is not installed + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1896093 +contact: Alexandra Hájková +component: +- gcc +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc +duration: 5m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1896093 +extra-summary: /tools/gcc/Regression/bz1896093-Compiling-with-flto-auto-fails-if-make-is-not +extra-task: /tools/gcc/Regression/bz1896093-Compiling-with-flto-auto-fails-if-make-is-not diff --git a/tests/Regression/bz1896093-Compiling-with-flto-auto-fails-if-make-is-not/runtest.sh b/tests/Regression/bz1896093-Compiling-with-flto-auto-fails-if-make-is-not/runtest.sh new file mode 100755 index 0000000..a23ce5c --- /dev/null +++ b/tests/Regression/bz1896093-Compiling-with-flto-auto-fails-if-make-is-not/runtest.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/gcc/Regression/bz1896093-Compiling-with-flto-auto-fails-if-make-is-not +# Description: Test for BZ#1896093 (Compiling with -flto=auto fails if make is not) +# Author: Alexandra Hájková +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="gcc" + +rlJournalStart + rlPhaseStartSetup + MAKE_WAS_PRESENT=false + rpm -q make &>/dev/null && MAKE_WAS_PRESENT=true + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlRun "rpm -e --nodeps make" 0,1 + rlPhaseEnd + + rlPhaseStartTest + echo "void main() { }" | gcc -x c -flto=auto - &> log + rlAssertNotGrep "lto-wrapper: fatal error: execvp: No such file or directory" log + rlPhaseEnd + + rlPhaseStartCleanup + if $MAKE_WAS_PRESENT; then + rpm -q make &>/dev/null || rlRun "yum -y install make" + fi + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1927579-libgfortran-seems-to-be-missing/alloc1.f90 b/tests/Regression/bz1927579-libgfortran-seems-to-be-missing/alloc1.f90 new file mode 100644 index 0000000..8765255 --- /dev/null +++ b/tests/Regression/bz1927579-libgfortran-seems-to-be-missing/alloc1.f90 @@ -0,0 +1,5 @@ +program test_allocated + integer :: i = 4 + real(4), allocatable :: x(:) + if (.not. allocated(x)) allocate(x(i)) +end program test_allocated diff --git a/tests/Regression/bz1927579-libgfortran-seems-to-be-missing/main.fmf b/tests/Regression/bz1927579-libgfortran-seems-to-be-missing/main.fmf new file mode 100644 index 0000000..d6b5ead --- /dev/null +++ b/tests/Regression/bz1927579-libgfortran-seems-to-be-missing/main.fmf @@ -0,0 +1,17 @@ +summary: Test for BZ#1927579 (libgfortran seems to be missing) +description: | + Bug summary: libgfortran seems to be missing _gfortran_os_error_at + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1927579 +contact: Alexandra Hájková +component: +- gcc +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc +- gcc-gfortran +duration: 5m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1927579 +extra-summary: /tools/gcc/Regression/bz1927579-libgfortran-seems-to-be-missing +extra-task: /tools/gcc/Regression/bz1927579-libgfortran-seems-to-be-missing diff --git a/tests/Regression/bz1927579-libgfortran-seems-to-be-missing/runtest.sh b/tests/Regression/bz1927579-libgfortran-seems-to-be-missing/runtest.sh new file mode 100755 index 0000000..e635213 --- /dev/null +++ b/tests/Regression/bz1927579-libgfortran-seems-to-be-missing/runtest.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/gcc/Regression/bz1927579-libgfortran-seems-to-be-missing +# Description: Test for BZ#1927579 (libgfortran seems to be missing) +# Author: Alexandra Hájková +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="gcc" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp alloc1.f90 $TmpDir" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gfortran alloc1.f90" &> log + rlAssertNotGrep "alloc1.f90:(.text+0x131): undefined reference" log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1939638-gcc-toolset-10-libasan-devel-depends-on-the-wrong/main.fmf b/tests/Regression/bz1939638-gcc-toolset-10-libasan-devel-depends-on-the-wrong/main.fmf new file mode 100644 index 0000000..4cfef47 --- /dev/null +++ b/tests/Regression/bz1939638-gcc-toolset-10-libasan-devel-depends-on-the-wrong/main.fmf @@ -0,0 +1,17 @@ +summary: Test for BZ#1939638 (gcc-toolset-10-libasan-devel depends on the wrong) +description: | + Bug summary: gcc-toolset-10-libasan-devel depends on the wrong libasan + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1939638 +contact: Alexandra Hájková +component: +- gcc +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc +- libasan +duration: 5m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1939638 +extra-summary: /tools/gcc/Regression/bz1939638-gcc-toolset-10-libasan-devel-depends-on-the-wrong +extra-task: /tools/gcc/Regression/bz1939638-gcc-toolset-10-libasan-devel-depends-on-the-wrong diff --git a/tests/Regression/bz1939638-gcc-toolset-10-libasan-devel-depends-on-the-wrong/runtest.sh b/tests/Regression/bz1939638-gcc-toolset-10-libasan-devel-depends-on-the-wrong/runtest.sh new file mode 100755 index 0000000..1d29c6c --- /dev/null +++ b/tests/Regression/bz1939638-gcc-toolset-10-libasan-devel-depends-on-the-wrong/runtest.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/gcc/Regression/bz1939638-gcc-toolset-10-libasan-devel-depends-on-the-wrong +# Description: Test for BZ#1939638 (gcc-toolset-10-libasan-devel depends on the wrong) +# Author: Alexandra Hájková +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="gcc" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "echo 'int main () { return 0; }' | gcc -xc -fsanitize=address -" &> log + rlAssertNotGrep "cannot find /usr/lib64/libasan" log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2/main.fmf b/tests/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2/main.fmf new file mode 100644 index 0000000..ae2fc2b --- /dev/null +++ b/tests/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2/main.fmf @@ -0,0 +1,16 @@ +summary: Test for BZ#1960701 (Wrong-code regression starting with gcc 8.2) +description: | + Bug summary: Wrong-code regression starting with gcc 8.2 + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1960701 +contact: Vaclav Kadlcik +component: +- gcc +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc-c++ +duration: 15m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1960701 +extra-summary: /tools/gcc/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2 +extra-task: /tools/gcc/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2 diff --git a/tests/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2/reproducer.cc b/tests/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2/reproducer.cc new file mode 100644 index 0000000..6ebd8e0 --- /dev/null +++ b/tests/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2/reproducer.cc @@ -0,0 +1,14 @@ +#include + +struct T { + unsigned a; + float b {8.}; +}; + +int main() +{ + T t = {1}; + std::vector tt = {{1}, {2}}; + if (t.a != 1 || t.b != 8.0f || tt[0].a != 1 || tt[0].b != 8.0f || tt[1].a != 2 || tt[1].b != 8.0f) + __builtin_abort (); +} diff --git a/tests/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2/runtest.sh b/tests/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2/runtest.sh new file mode 100755 index 0000000..196486b --- /dev/null +++ b/tests/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2/runtest.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/gcc/Regression/bz1960701-Wrong-code-regression-starting-with-gcc-8-2 +# Description: Test for BZ#1960701 (Wrong-code regression starting with gcc 8.2) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +GCC="${GCC:-$(type -P gcc)}" +PACKAGE=$(rpm --qf '%{name}\n' -qf $GCC | head -1) +PACKAGES="${PACKAGE} ${PACKAGE}-c++" + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlRun "dnf -y install $PACKAGES" 0-255 + rlAssertRpm --all + rlRun "TmpDir=\$(mktemp -d)" + rlRun "cp reproducer.cc $TmpDir" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun 'g++ -o reproducer -Wall -Wextra -std=c++17 reproducer.cc' + rlRun './reproducer' + rlPhaseEnd + + rlPhaseStartCleanup + rlRun 'popd' + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5/main.fmf b/tests/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5/main.fmf new file mode 100644 index 0000000..c699de0 --- /dev/null +++ b/tests/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5/main.fmf @@ -0,0 +1,16 @@ +summary: Test for BZ#1965951 (Wrong-code regression starting with gcc 8.5) +description: | + Bug summary: Wrong-code regression starting with gcc 8.5 + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1965951 +contact: Vaclav Kadlcik +component: +- gcc +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc-c++ +duration: 15m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1965951 +extra-summary: /tools/gcc/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5 +extra-task: /tools/gcc/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5 diff --git a/tests/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5/reproducer.cc b/tests/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5/reproducer.cc new file mode 100644 index 0000000..40b0c81 --- /dev/null +++ b/tests/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5/reproducer.cc @@ -0,0 +1,12 @@ +#include +struct S1 { virtual ~S1() = default; }; +struct S2 { virtual void f1() = 0; }; +struct S3: S1, S2 { + void f1() { f2(); } + virtual void f2() = 0; +}; +struct S4: S3 { + void f2() { std::cout << "called\n"; } + using S2::f1; +}; +int main() { S4().f1(); } diff --git a/tests/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5/runtest.sh b/tests/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5/runtest.sh new file mode 100755 index 0000000..d8d69d0 --- /dev/null +++ b/tests/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5/runtest.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/gcc/Regression/bz1965951-Wrong-code-regression-starting-with-gcc-8-5 +# Description: Test for BZ#1965951 (Wrong-code regression starting with gcc 8.5) +# Author: Vaclav Kadlcik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +GCC="${GCC:-$(type -P gcc)}" +PACKAGE=$(rpm --qf '%{name}\n' -qf $GCC | head -1) +PACKAGES="${PACKAGE} ${PACKAGE}-c++" + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlRun "dnf -y install $PACKAGES" 0-255 + rlAssertRpm --all + rlRun "TmpDir=\$(mktemp -d)" + rlRun "cp reproducer.cc $TmpDir" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun 'g++ -o reproducer reproducer.cc' + rlRun './reproducer' + rlPhaseEnd + + rlPhaseStartCleanup + rlRun 'popd' + rlRun "rm -r $TmpDir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/smoke-test/Makefile b/tests/smoke-test/Makefile new file mode 100644 index 0000000..fb46790 --- /dev/null +++ b/tests/smoke-test/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/gcc/Sanity/smoke-test +# Description: Basic smoke test. +# Author: Marek Polacek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2012 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/gcc/Sanity/smoke-test +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE hello.c hello.f90 hello.cpp tm.c quad.c omphello.c thr-init-2.c clear_cache.c + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Marek Polacek " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Basic smoke test." >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: gcc" >> $(METADATA) + @echo "RunFor: devtoolset-1.0-gcc" >> $(METADATA) + @echo "Requires: gcc gcc-c++ gcc-gfortran glibc-common glibc-devel" >> $(METADATA) + @echo "Requires: libquadmath libquadmath-devel libgomp libgcc libstdc++-devel" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/smoke-test/PURPOSE b/tests/smoke-test/PURPOSE new file mode 100644 index 0000000..912f7b4 --- /dev/null +++ b/tests/smoke-test/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/gcc/Sanity/smoke-test +Description: Basic smoke test. +Author: Marek Polacek diff --git a/tests/smoke-test/clear_cache.c b/tests/smoke-test/clear_cache.c new file mode 100644 index 0000000..b10479f --- /dev/null +++ b/tests/smoke-test/clear_cache.c @@ -0,0 +1,7 @@ +int +main (void) +{ + char *mem = __builtin_alloca (40); + __builtin___clear_cache (mem, mem + 40); + return 0; +} diff --git a/tests/smoke-test/hello.c b/tests/smoke-test/hello.c new file mode 100644 index 0000000..4096e11 --- /dev/null +++ b/tests/smoke-test/hello.c @@ -0,0 +1,7 @@ +#include + +int +main (void) +{ + puts ("Hello World!"); +} diff --git a/tests/smoke-test/hello.cpp b/tests/smoke-test/hello.cpp new file mode 100644 index 0000000..0f2234e --- /dev/null +++ b/tests/smoke-test/hello.cpp @@ -0,0 +1,7 @@ +#include + +int +main (void) +{ + std::cout << "Hello, world!\n"; +} diff --git a/tests/smoke-test/hello.f90 b/tests/smoke-test/hello.f90 new file mode 100644 index 0000000..afabbb2 --- /dev/null +++ b/tests/smoke-test/hello.f90 @@ -0,0 +1,3 @@ + program hello + print *, "Hello World!" + end program hello diff --git a/tests/smoke-test/main.fmf b/tests/smoke-test/main.fmf new file mode 100644 index 0000000..3710ca3 --- /dev/null +++ b/tests/smoke-test/main.fmf @@ -0,0 +1,22 @@ +summary: Basic smoke test. +description: '' +contact: +- Marek Polacek +component: +- gcc +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc +- gcc-c++ +- gcc-gfortran +- glibc-common +- glibc-devel +- libquadmath +- libquadmath-devel +- libgomp +- libgcc +- libstdc++-devel +duration: 10m +extra-summary: /tools/gcc/Sanity/smoke-test +extra-task: /tools/gcc/Sanity/smoke-test diff --git a/tests/smoke-test/omphello.c b/tests/smoke-test/omphello.c new file mode 100644 index 0000000..85b591f --- /dev/null +++ b/tests/smoke-test/omphello.c @@ -0,0 +1,24 @@ +#include +#include +#include + +int +main (void) +{ + int th_id; + int nthreads; + + #pragma omp parallel private(th_id) + { + th_id = omp_get_thread_num (); + printf ("Hello World from thread %d\n", th_id); + + #pragma omp barrier + if (th_id == 0) + { + nthreads = omp_get_num_threads (); + printf ("There are %d threads\n", nthreads); + } + } + return EXIT_SUCCESS; +} diff --git a/tests/smoke-test/quad.c b/tests/smoke-test/quad.c new file mode 100644 index 0000000..e5a6cc7 --- /dev/null +++ b/tests/smoke-test/quad.c @@ -0,0 +1,38 @@ +#include +#include +#include + +int +main (void) +{ + __float128 r = strtoflt128 ("1.23456789", NULL); + + int prec = 20; + int width = 46; + char buf[128]; + + r = 2.0q; + r = sqrtq (r); + int n = quadmath_snprintf (buf, sizeof buf, "%+-#*.20Qe", width, r); + if ((size_t) n < sizeof buf) + /* Prints: +1.41421356237309504880e+00 */ + printf ("%s\n", buf); + quadmath_snprintf (buf, sizeof buf, "%Qa", r); + if ((size_t) n < sizeof buf) + /* Prints: 0x1.6a09e667f3bcc908b2fb1366ea96p+0 */ + printf ("%s\n", buf); + n = quadmath_snprintf (NULL, 0, "%+-#46.*Qe", prec, r); + if (n > -1) + { + char *str = malloc (n + 1); + if (str) + { + quadmath_snprintf (str, n + 1, "%+-#46.*Qe", prec, r); + /* Prints: +1.41421356237309504880e+00 */ + printf ("%s\n", str); + } + free (str); + } + + return 0; +} diff --git a/tests/smoke-test/runtest.sh b/tests/smoke-test/runtest.sh new file mode 100755 index 0000000..78fda72 --- /dev/null +++ b/tests/smoke-test/runtest.sh @@ -0,0 +1,125 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/gcc/Sanity/smoke-test +# Description: Basic smoke test. +# Author: Marek Polacek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2012 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGES=(gcc gcc-c++ gcc-gfortran glibc-common libgomp libgcc glibc-devel libstdc++ libstdc++-devel) + +# Choose the compiler. +GCC=${GCC:-gcc} +GXX=${GXX:-g++} +GFORTRAN=${GFORTRAN:-gfortran} + +PACKAGE=gcc + +rlJournalStart + rlPhaseStartSetup + export PRI_ARCH=`rlGetPrimaryArch` + export SEC_ARCH=`rlGetSecondaryArch` + # don't assert anything under devtoolset + if type gcc | grep -q -v devtoolset + then + for p in "${PACKAGES[@]}"; do + rpm -q "$p.$PRI_ARCH" || yum install -y "$p.$PRI_ARCH" + rlAssertRpm "$p.$PRI_ARCH" + done; unset p + fi + rlLog "GCC = $GCC" + rlLog "Installed within `rpmquery -f $(which $GCC)`" + rlLog "GXX = $GXX" + rlLog "Installed within `rpmquery -f $(which $GXX)`" + rlLog "GFORTRAN = $GFORTRAN" + rlLog "Installed within `rpmquery -f $(which $GFORTRAN)`" + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + # We need some files. + rlRun "cp -v hello.{c,cpp,f90} tm.c quad.c thr-init-2.c clear_cache.c omphello.c $TmpDir" + rlRun "pushd $TmpDir" + rlRun "rpmquery -l libstdc++-devel.$PRI_ARCH" + test -n "$SEC_ARCH" && rpmquery "libstdc++-devel.$SEC_ARCH" && rlRun "rpmquery -l libstdc++-devel.$SEC_ARCH" + rlPhaseEnd + + rlPhaseStartSetup "Showing compiler versions" + for compiler in $GCC $GXX $GFORTRAN + do + rlLog "Version of compiler: $compiler" + eval "$compiler --version 2>&1" | while read line + do + rlLog " $line" + done + done + rlPhaseEnd + + rlPhaseStartTest "Compile" + rlRun "$GCC hello.c -o hello_c" + rlRun "$GXX hello.cpp -o hello_cpp" + rlRun "$GFORTRAN hello.f90 -o hello_fortran" + + # TM support is GCC >=4.7 only. + $GCC -xc -O2 -std=gnu99 -fgnu-tm - <<< "int main(){}" + if test $? -eq 0; then + rlRun "$GCC -O2 -std=gnu99 -fgnu-tm tm.c -o tm" + rlRun "./tm" + fi + + # Test OpenMP. + rlRun "$GCC omphello.c -O2 -std=gnu99 -fopenmp -o omp" + rlRun "./omp" + + # Test __thread. + rlRun "$GCC thr-init-2.c -O2 -std=gnu99 -ftls-model=initial-exec -o thr" + rlRun "./thr" + + # Now test some libquadmath stuff (__float128 support). + # libquadmath is mising on RHEL machines, usually. + test "`rpmquery --qf '%{version}-%{release}' libquadmath`" = "`rpmquery --qf '%{version}-%{release}' $GCC`" + if test $? -eq 0 -a "$GCC" = "gcc"; then + rlRun "$GCC quad.c -O2 -std=gnu99 -lquadmath -lm -o quad" + rlRun "./quad" + fi + + # And now something from libgcc, e.g. __builtin___clear_cache. + # But not on RHEL5. + if ! rlIsRHEL 5; then + rlRun "$GCC clear_cache.c -O2 -std=gnu99 -o cache" + rlRun "./cache" + fi + rlPhaseEnd + + rlPhaseStartTest "Check dependant libraries" + rlRun "ldd hello_{c,cpp,fortran} &> ldd.out" + # Nothing should be linked against anything in /opt. + rlAssertNotGrep "/opt" ldd.out + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/smoke-test/thr-init-2.c b/tests/smoke-test/thr-init-2.c new file mode 100644 index 0000000..051cff9 --- /dev/null +++ b/tests/smoke-test/thr-init-2.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-require-effective-target tls_runtime } */ +/* { dg-add-options tls } */ + +extern void abort() ; + +static __thread int fstat ; +static __thread int fstat = 1; + +int test_code(int b) +{ + fstat += b ; + return fstat; +} + +int main (int ac, char *av[]) +{ + int a = test_code(1); + + if ((a != 2) || (fstat != 2)) + abort () ; + + return 0; +} diff --git a/tests/smoke-test/tm.c b/tests/smoke-test/tm.c new file mode 100644 index 0000000..f9b4c9b --- /dev/null +++ b/tests/smoke-test/tm.c @@ -0,0 +1,34 @@ +extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe)); + +static int __attribute__((transaction_safe)) +something (void) +{ + return 0; +} + +struct large { int foo[500]; }; + +int +main (void) +{ + int *p; + struct large *lp; + + __transaction_atomic { + p = malloc (sizeof (*p) * 100); + lp = malloc (sizeof (*lp) * 100); + + /* No instrumentation necessary; P and LP are transaction local. */ + p[5] = 123; + lp->foo[66] = 123; + + if (something ()) + __transaction_cancel; + } + + __transaction_relaxed { + ++p[5]; + } + + return ( (p[5] == 124) ? 0 : 1 ); +} diff --git a/update-gcc.sh b/update-gcc.sh index 47d7d70..bacec6a 100755 --- a/update-gcc.sh +++ b/update-gcc.sh @@ -1,36 +1,7 @@ #!/bin/sh -if [ "$#" -eq 0 ]; then - echo "Usage: ./update-gcc.sh gcc/redhat/heads/gcc-NN-branch_commit_hash [git_reference_dir_to_speed_up]" - exit 1 -fi -export LC_ALL=C -if ! [ -f gcc.spec ]; then echo Must be run in the directory with gcc.spec file.; exit 1; fi -if [ -d gcc-dir.tmp ]; then echo gcc-dir.tmp already exists.; exit 1; fi -v=`sed -n 's/^%global gcc_version //p' gcc.spec` -p=`sed -n 's/^%global gitrev //p' gcc.spec` -h=$1 -if [ "$#" -ge 2 ]; then - git clone --dissociate --reference $2 https://gcc.gnu.org/git/gcc.git gcc-dir.tmp -else - git clone https://gcc.gnu.org/git/gcc.git gcc-dir.tmp -fi -git --git-dir=gcc-dir.tmp/.git fetch origin $h +[ -d gcc-dir.tmp ] && echo gcc-dir.tmp already exists && exit 1 +git clone --depth 1 git://gcc.gnu.org/git/gcc.git gcc-dir.tmp +git --git-dir=gcc-dir.tmp/.git fetch --depth 1 origin $1 d=`date --iso | sed 's/-//g'` -cd gcc-dir.tmp -git diff $p..$h > P1 -git log --format=%B `git log --format='%ae %H' $p..$h | awk '/^gccadmin@gcc.gnu.org/{print $2;exit 0}'`..$h > P2 -diff -up /dev/null P2 >> P1 -sed -n 's,^+[[:blank:]]\+PR \([a-z0-9+-]\+/[0-9]\+\)$,\1,p' P1 | sed 's/ - .*$//;s/[: ;.]//g' | LC_ALL=C sort -u -t / -k 1,1 -k 2,2n > P3 -> P4 -for i in `cat P3`; do if grep -F $i ../gcc.spec >/dev/null; then echo $i already recorded.; else echo $i >> P4; fi; done -case "$v" in - *.0.*) echo "- update from trunk" > P5;; - *) echo "- update from releases/gcc-`echo $v | sed 's/\..*$//'` branch" > P5;; -esac -echo `cat P4` | sed 's/ /, /g' | fold -w 71 -s | sed '1s/^/ - PRs /;2,$s/^/ /;s/, $/,/' >> P5 -echo >> P5 -cd .. -sed -i -e '/^%global gitrev /s/ [0-9a-f]\+$/ '$h'/;/^%global DATE /s/ [0-9]\+$/ '$d'/;/^%changelog$/r gcc-dir.tmp/P5' gcc.spec -git --git-dir=gcc-dir.tmp/.git archive --prefix=gcc-$v-$d/ $h | xz -9e > gcc-$v-$d.tar.xz +git --git-dir=gcc-dir.tmp/.git archive --prefix=gcc-11.3.1-$d/ $1 | xz -9e > gcc-11.3.1-$d.tar.xz rm -rf gcc-dir.tmp -fedpkg new-sources gcc-$v-$d.tar.xz `sed 's/SHA512 (\(.*\)) = [0-9a-f]\+$/\1/' sources | grep -v '^gcc-'`