diff -u gcc-8-8.3.0/debian/changelog gcc-8-8.3.0/debian/changelog --- gcc-8-8.3.0/debian/changelog +++ gcc-8-8.3.0/debian/changelog @@ -1,3 +1,46 @@ +gcc-8 (8.3.0-22ubuntu2) eoan; urgency=medium + + * Disable lto builds on armhf and arm64, too slow, or ftbfs on the buildds. + + -- Matthias Klose Tue, 10 Sep 2019 18:51:27 +0200 + +gcc-8 (8.3.0-22ubuntu1) eoan; urgency=medium + + * Merge with Debian; remaining changes: + - Build from upstream sources. + + -- Matthias Klose Mon, 09 Sep 2019 19:29:41 +0200 + +gcc-8 (8.3.0-22) unstable; urgency=medium + + * Update to SVN 20190909 (r275519) from the gcc-8-branch. + - Fix PR libgomp/90585, PR libstdc++/91308, PR libstdc++/51333, + PR libstdc++/78179, PR libstdc++/90770, PR libstdc++/85965, PR pch/61250, + PR c/90474, PR sanitizer/90954, PR debug/90197, PR pch/90326, + PR target/81800 (AArch64), PR target/91472 (SPARC), + PR tree-optimization/90930, PR tree-optimization/90637, + PR tree-optimization/91108, PR target/91481 (PPC), PR middle-end/88567, + PR tree-optimization/88315, PR debug/90900, PR tree-optimization/90278, + PR middle-end/90194, PR lto/91375, PR tree-optimization/91293, + PR tree-optimization/91280, PR tree-optimization/91200, + PR middle-end/91162, PR middle-end/91131, PR tree-optimization/91126, + PR tree-optimization/90328, PR middle-end/89578, PR middle-end/87609, + PR tree-optimization/87609, PR tree-optimization/87609, + PR tree-optimization/91137, PR tree-optimization/90006, + PR tree-optimization/89725, PR tree-optimization/81740, + PR middle-end/90213, PR tree-optimization/90020, PR bootstrap/87030, + PR target/91150 (x86), PR middle-end/78884, PR rtl-optimization/90756, + PR c/90760, PR debug/90733, PR middle-end/90139, PR target/91533 (x86), + PR rtl-optimization/91347, PR pch/90326, PR middle-end/89392, + PR c++/90950, PR debug/90197, PR fortran/91660, PR target/83531, + PR target/87853 (x86), PR target/91704 (x86). + * Configure --without-target-system-zlib for gdc cross builds. + * any_archs: Remove mips and powerpcspe, add riscv64. + * libstdc++: Fix GCC_LINUX_FUTEX to work with C99 compilers, taken from + the trunk. + + -- Matthias Klose Mon, 09 Sep 2019 17:28:17 +0200 + gcc-8 (8.3.0-21ubuntu1) eoan; urgency=medium * Merge with Debian; remaining changes: diff -u gcc-8-8.3.0/debian/control gcc-8-8.3.0/debian/control --- gcc-8-8.3.0/debian/control +++ gcc-8-8.3.0/debian/control @@ -20,7 +20,7 @@ libisl-dev, libmpc-dev (>= 1.0), libmpfr-dev (>= 3.0.0-9~), libgmp-dev (>= 2:5.0.1~), lib32z1-dev [amd64 kfreebsd-amd64], lib64z1-dev [i386], libx32z1-dev [amd64 kfreebsd-amd64 i386], dejagnu [!m68k !hurd-amd64 !hurd-i386 !hurd-alpha !kfreebsd-amd64 !kfreebsd-i386 !kfreebsd-alpha] , coreutils (>= 2.26) | realpath (>= 1.9.12), chrpath, lsb-release, quilt, pkg-config, libgc-dev, - g++-8-alpha-linux-gnu [alpha] , gobjc-8-alpha-linux-gnu [alpha] , gfortran-8-alpha-linux-gnu [alpha] , gdc-8-alpha-linux-gnu [alpha] , gccgo-8-alpha-linux-gnu [alpha] , gnat-8-alpha-linux-gnu [alpha] , g++-8-x86-64-linux-gnu [amd64] , gobjc-8-x86-64-linux-gnu [amd64] , gfortran-8-x86-64-linux-gnu [amd64] , gdc-8-x86-64-linux-gnu [amd64] , gccgo-8-x86-64-linux-gnu [amd64] , gnat-8-x86-64-linux-gnu [amd64] , g++-8-arm-linux-gnueabi [armel] , gobjc-8-arm-linux-gnueabi [armel] , gfortran-8-arm-linux-gnueabi [armel] , gdc-8-arm-linux-gnueabi [armel] , gccgo-8-arm-linux-gnueabi [armel] , gnat-8-arm-linux-gnueabi [armel] , g++-8-arm-linux-gnueabihf [armhf] , gobjc-8-arm-linux-gnueabihf [armhf] , gfortran-8-arm-linux-gnueabihf [armhf] , gdc-8-arm-linux-gnueabihf [armhf] , gccgo-8-arm-linux-gnueabihf [armhf] , gnat-8-arm-linux-gnueabihf [armhf] , g++-8-aarch64-linux-gnu [arm64] , gobjc-8-aarch64-linux-gnu [arm64] , gfortran-8-aarch64-linux-gnu [arm64] , gdc-8-aarch64-linux-gnu [arm64] , gccgo-8-aarch64-linux-gnu [arm64] , gnat-8-aarch64-linux-gnu [arm64] , g++-8-i686-linux-gnu [i386] , gobjc-8-i686-linux-gnu [i386] , gfortran-8-i686-linux-gnu [i386] , gdc-8-i686-linux-gnu [i386] , gccgo-8-i686-linux-gnu [i386] , gnat-8-i686-linux-gnu [i386] , g++-8-mips-linux-gnu [mips] , gobjc-8-mips-linux-gnu [mips] , gfortran-8-mips-linux-gnu [mips] , gdc-8-mips-linux-gnu [mips] , gccgo-8-mips-linux-gnu [mips] , gnat-8-mips-linux-gnu [mips] , g++-8-mipsel-linux-gnu [mipsel] , gobjc-8-mipsel-linux-gnu [mipsel] , gfortran-8-mipsel-linux-gnu [mipsel] , gdc-8-mipsel-linux-gnu [mipsel] , gccgo-8-mipsel-linux-gnu [mipsel] , gnat-8-mipsel-linux-gnu [mipsel] , g++-8-mips64-linux-gnuabi64 [mips64] , gobjc-8-mips64-linux-gnuabi64 [mips64] , gfortran-8-mips64-linux-gnuabi64 [mips64] , gdc-8-mips64-linux-gnuabi64 [mips64] , gccgo-8-mips64-linux-gnuabi64 [mips64] , gnat-8-mips64-linux-gnuabi64 [mips64] , g++-8-mips64el-linux-gnuabi64 [mips64el] , gobjc-8-mips64el-linux-gnuabi64 [mips64el] , gfortran-8-mips64el-linux-gnuabi64 [mips64el] , gdc-8-mips64el-linux-gnuabi64 [mips64el] , gccgo-8-mips64el-linux-gnuabi64 [mips64el] , gnat-8-mips64el-linux-gnuabi64 [mips64el] , g++-8-mips64-linux-gnuabin32 [mipsn32] , gobjc-8-mips64-linux-gnuabin32 [mipsn32] , gfortran-8-mips64-linux-gnuabin32 [mipsn32] , gdc-8-mips64-linux-gnuabin32 [mipsn32] , gccgo-8-mips64-linux-gnuabin32 [mipsn32] , gnat-8-mips64-linux-gnuabin32 [mipsn32] , g++-8-powerpc-linux-gnu [powerpc] , gobjc-8-powerpc-linux-gnu [powerpc] , gfortran-8-powerpc-linux-gnu [powerpc] , gdc-8-powerpc-linux-gnu [powerpc] , gccgo-8-powerpc-linux-gnu [powerpc] , gnat-8-powerpc-linux-gnu [powerpc] , g++-8-powerpc64-linux-gnu [ppc64] , gobjc-8-powerpc64-linux-gnu [ppc64] , gfortran-8-powerpc64-linux-gnu [ppc64] , gdc-8-powerpc64-linux-gnu [ppc64] , gccgo-8-powerpc64-linux-gnu [ppc64] , gnat-8-powerpc64-linux-gnu [ppc64] , g++-8-powerpc64le-linux-gnu [ppc64el] , gobjc-8-powerpc64le-linux-gnu [ppc64el] , gfortran-8-powerpc64le-linux-gnu [ppc64el] , gdc-8-powerpc64le-linux-gnu [ppc64el] , gccgo-8-powerpc64le-linux-gnu [ppc64el] , gnat-8-powerpc64le-linux-gnu [ppc64el] , g++-8-m68k-linux-gnu [m68k] , gobjc-8-m68k-linux-gnu [m68k] , gfortran-8-m68k-linux-gnu [m68k] , gdc-8-m68k-linux-gnu [m68k] , g++-8-sh4-linux-gnu [sh4] , gobjc-8-sh4-linux-gnu [sh4] , gfortran-8-sh4-linux-gnu [sh4] , gnat-8-sh4-linux-gnu [sh4] , g++-8-sparc64-linux-gnu [sparc64] , gobjc-8-sparc64-linux-gnu [sparc64] , gfortran-8-sparc64-linux-gnu [sparc64] , gdc-8-sparc64-linux-gnu [sparc64] , gccgo-8-sparc64-linux-gnu [sparc64] , gnat-8-sparc64-linux-gnu [sparc64] , g++-8-s390x-linux-gnu [s390x] , gobjc-8-s390x-linux-gnu [s390x] , gfortran-8-s390x-linux-gnu [s390x] , gdc-8-s390x-linux-gnu [s390x] , gccgo-8-s390x-linux-gnu [s390x] , gnat-8-s390x-linux-gnu [s390x] , g++-8-x86-64-linux-gnux32 [x32] , gobjc-8-x86-64-linux-gnux32 [x32] , gfortran-8-x86-64-linux-gnux32 [x32] , gdc-8-x86-64-linux-gnux32 [x32] , gccgo-8-x86-64-linux-gnux32 [x32] , gnat-8-x86-64-linux-gnux32 [x32] , g++-8-mips64el-linux-gnuabin32 [mipsn32el] , gobjc-8-mips64el-linux-gnuabin32 [mipsn32el] , gfortran-8-mips64el-linux-gnuabin32 [mipsn32el] , gdc-8-mips64el-linux-gnuabin32 [mipsn32el] , gccgo-8-mips64el-linux-gnuabin32 [mipsn32el] , gnat-8-mips64el-linux-gnuabin32 [mipsn32el] , g++-8-mipsisa32r6-linux-gnu [mipsr6] , gobjc-8-mipsisa32r6-linux-gnu [mipsr6] , gfortran-8-mipsisa32r6-linux-gnu [mipsr6] , gdc-8-mipsisa32r6-linux-gnu [mipsr6] , gccgo-8-mipsisa32r6-linux-gnu [mipsr6] , gnat-8-mipsisa32r6-linux-gnu [mipsr6] , g++-8-mipsisa32r6el-linux-gnu [mipsr6el] , gobjc-8-mipsisa32r6el-linux-gnu [mipsr6el] , gfortran-8-mipsisa32r6el-linux-gnu [mipsr6el] , gdc-8-mipsisa32r6el-linux-gnu [mipsr6el] , gccgo-8-mipsisa32r6el-linux-gnu [mipsr6el] , gnat-8-mipsisa32r6el-linux-gnu [mipsr6el] , g++-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , gobjc-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , gfortran-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , gdc-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , gccgo-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , gnat-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , g++-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , gobjc-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , gfortran-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , gdc-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , gccgo-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , gnat-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , g++-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , gobjc-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , gfortran-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , gdc-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , gccgo-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , gnat-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , g++-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , gobjc-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , gfortran-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , gdc-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , gccgo-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , gnat-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , + g++-8-alpha-linux-gnu [alpha] , gobjc-8-alpha-linux-gnu [alpha] , gfortran-8-alpha-linux-gnu [alpha] , gdc-8-alpha-linux-gnu [alpha] , gccgo-8-alpha-linux-gnu [alpha] , gnat-8-alpha-linux-gnu [alpha] , g++-8-x86-64-linux-gnu [amd64] , gobjc-8-x86-64-linux-gnu [amd64] , gfortran-8-x86-64-linux-gnu [amd64] , gdc-8-x86-64-linux-gnu [amd64] , gccgo-8-x86-64-linux-gnu [amd64] , gnat-8-x86-64-linux-gnu [amd64] , g++-8-arm-linux-gnueabi [armel] , gobjc-8-arm-linux-gnueabi [armel] , gfortran-8-arm-linux-gnueabi [armel] , gdc-8-arm-linux-gnueabi [armel] , gccgo-8-arm-linux-gnueabi [armel] , gnat-8-arm-linux-gnueabi [armel] , g++-8-arm-linux-gnueabihf [armhf] , gobjc-8-arm-linux-gnueabihf [armhf] , gfortran-8-arm-linux-gnueabihf [armhf] , gdc-8-arm-linux-gnueabihf [armhf] , gccgo-8-arm-linux-gnueabihf [armhf] , gnat-8-arm-linux-gnueabihf [armhf] , g++-8-aarch64-linux-gnu [arm64] , gobjc-8-aarch64-linux-gnu [arm64] , gfortran-8-aarch64-linux-gnu [arm64] , gdc-8-aarch64-linux-gnu [arm64] , gccgo-8-aarch64-linux-gnu [arm64] , gnat-8-aarch64-linux-gnu [arm64] , g++-8-i686-linux-gnu [i386] , gobjc-8-i686-linux-gnu [i386] , gfortran-8-i686-linux-gnu [i386] , gdc-8-i686-linux-gnu [i386] , gccgo-8-i686-linux-gnu [i386] , gnat-8-i686-linux-gnu [i386] , g++-8-mipsel-linux-gnu [mipsel] , gobjc-8-mipsel-linux-gnu [mipsel] , gfortran-8-mipsel-linux-gnu [mipsel] , gdc-8-mipsel-linux-gnu [mipsel] , gccgo-8-mipsel-linux-gnu [mipsel] , gnat-8-mipsel-linux-gnu [mipsel] , g++-8-mips64-linux-gnuabi64 [mips64] , gobjc-8-mips64-linux-gnuabi64 [mips64] , gfortran-8-mips64-linux-gnuabi64 [mips64] , gdc-8-mips64-linux-gnuabi64 [mips64] , gccgo-8-mips64-linux-gnuabi64 [mips64] , gnat-8-mips64-linux-gnuabi64 [mips64] , g++-8-mips64el-linux-gnuabi64 [mips64el] , gobjc-8-mips64el-linux-gnuabi64 [mips64el] , gfortran-8-mips64el-linux-gnuabi64 [mips64el] , gdc-8-mips64el-linux-gnuabi64 [mips64el] , gccgo-8-mips64el-linux-gnuabi64 [mips64el] , gnat-8-mips64el-linux-gnuabi64 [mips64el] , g++-8-mips64-linux-gnuabin32 [mipsn32] , gobjc-8-mips64-linux-gnuabin32 [mipsn32] , gfortran-8-mips64-linux-gnuabin32 [mipsn32] , gdc-8-mips64-linux-gnuabin32 [mipsn32] , gccgo-8-mips64-linux-gnuabin32 [mipsn32] , gnat-8-mips64-linux-gnuabin32 [mipsn32] , g++-8-powerpc-linux-gnu [powerpc] , gobjc-8-powerpc-linux-gnu [powerpc] , gfortran-8-powerpc-linux-gnu [powerpc] , gdc-8-powerpc-linux-gnu [powerpc] , gccgo-8-powerpc-linux-gnu [powerpc] , gnat-8-powerpc-linux-gnu [powerpc] , g++-8-powerpc64-linux-gnu [ppc64] , gobjc-8-powerpc64-linux-gnu [ppc64] , gfortran-8-powerpc64-linux-gnu [ppc64] , gdc-8-powerpc64-linux-gnu [ppc64] , gccgo-8-powerpc64-linux-gnu [ppc64] , gnat-8-powerpc64-linux-gnu [ppc64] , g++-8-powerpc64le-linux-gnu [ppc64el] , gobjc-8-powerpc64le-linux-gnu [ppc64el] , gfortran-8-powerpc64le-linux-gnu [ppc64el] , gdc-8-powerpc64le-linux-gnu [ppc64el] , gccgo-8-powerpc64le-linux-gnu [ppc64el] , gnat-8-powerpc64le-linux-gnu [ppc64el] , g++-8-m68k-linux-gnu [m68k] , gobjc-8-m68k-linux-gnu [m68k] , gfortran-8-m68k-linux-gnu [m68k] , gdc-8-m68k-linux-gnu [m68k] , g++-8-riscv64-linux-gnu [riscv64] , gobjc-8-riscv64-linux-gnu [riscv64] , gfortran-8-riscv64-linux-gnu [riscv64] , gdc-8-riscv64-linux-gnu [riscv64] , gccgo-8-riscv64-linux-gnu [riscv64] , gnat-8-riscv64-linux-gnu [riscv64] , g++-8-sh4-linux-gnu [sh4] , gobjc-8-sh4-linux-gnu [sh4] , gfortran-8-sh4-linux-gnu [sh4] , gnat-8-sh4-linux-gnu [sh4] , g++-8-sparc64-linux-gnu [sparc64] , gobjc-8-sparc64-linux-gnu [sparc64] , gfortran-8-sparc64-linux-gnu [sparc64] , gdc-8-sparc64-linux-gnu [sparc64] , gccgo-8-sparc64-linux-gnu [sparc64] , gnat-8-sparc64-linux-gnu [sparc64] , g++-8-s390x-linux-gnu [s390x] , gobjc-8-s390x-linux-gnu [s390x] , gfortran-8-s390x-linux-gnu [s390x] , gdc-8-s390x-linux-gnu [s390x] , gccgo-8-s390x-linux-gnu [s390x] , gnat-8-s390x-linux-gnu [s390x] , g++-8-x86-64-linux-gnux32 [x32] , gobjc-8-x86-64-linux-gnux32 [x32] , gfortran-8-x86-64-linux-gnux32 [x32] , gdc-8-x86-64-linux-gnux32 [x32] , gccgo-8-x86-64-linux-gnux32 [x32] , gnat-8-x86-64-linux-gnux32 [x32] , g++-8-mips64el-linux-gnuabin32 [mipsn32el] , gobjc-8-mips64el-linux-gnuabin32 [mipsn32el] , gfortran-8-mips64el-linux-gnuabin32 [mipsn32el] , gdc-8-mips64el-linux-gnuabin32 [mipsn32el] , gccgo-8-mips64el-linux-gnuabin32 [mipsn32el] , gnat-8-mips64el-linux-gnuabin32 [mipsn32el] , g++-8-mipsisa32r6-linux-gnu [mipsr6] , gobjc-8-mipsisa32r6-linux-gnu [mipsr6] , gfortran-8-mipsisa32r6-linux-gnu [mipsr6] , gdc-8-mipsisa32r6-linux-gnu [mipsr6] , gccgo-8-mipsisa32r6-linux-gnu [mipsr6] , gnat-8-mipsisa32r6-linux-gnu [mipsr6] , g++-8-mipsisa32r6el-linux-gnu [mipsr6el] , gobjc-8-mipsisa32r6el-linux-gnu [mipsr6el] , gfortran-8-mipsisa32r6el-linux-gnu [mipsr6el] , gdc-8-mipsisa32r6el-linux-gnu [mipsr6el] , gccgo-8-mipsisa32r6el-linux-gnu [mipsr6el] , gnat-8-mipsisa32r6el-linux-gnu [mipsr6el] , g++-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , gobjc-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , gfortran-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , gdc-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , gccgo-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , gnat-8-mipsisa64r6-linux-gnuabi64 [mips64r6] , g++-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , gobjc-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , gfortran-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , gdc-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , gccgo-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , gnat-8-mipsisa64r6el-linux-gnuabi64 [mips64r6el] , g++-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , gobjc-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , gfortran-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , gdc-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , gccgo-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , gnat-8-mipsisa64r6-linux-gnuabin32 [mipsn32r6] , g++-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , gobjc-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , gfortran-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , gdc-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , gccgo-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , gnat-8-mipsisa64r6el-linux-gnuabin32 [mipsn32r6el] , Build-Depends-Indep: doxygen (>= 1.7.2), graphviz (>= 2.2), ghostscript, texlive-latex-base, xsltproc, libxml2-utils, docbook-xsl-ns Homepage: http://gcc.gnu.org/ Vcs-Browser: https://salsa.debian.org/toolchain-team/gcc/tree/gcc-8-debian diff -u gcc-8-8.3.0/debian/patches/svn-updates.diff gcc-8-8.3.0/debian/patches/svn-updates.diff --- gcc-8-8.3.0/debian/patches/svn-updates.diff +++ gcc-8-8.3.0/debian/patches/svn-updates.diff @@ -1,10 +1,10 @@ -# DP: updates from the 8 branch upto 20190817 (r274599). +# DP: updates from the 8 branch upto 20190909 (r275519). last_update() { cat > ${dir}LAST_UPDATED ++ ++ Backported from mainline ++ 2019-05-24 Jakub Jelinek ++ ++ PR libgomp/90585 ++ * plugin/plugin-hsa.c (print_kernel_dispatch, run_kernel): Use PRIu64 ++ macro instead of "lu". ++ (release_kernel_dispatch): Likewise. Cast shadow->debug to uintptr_t ++ before casting to void *. ++ +2019-06-11 Jakub Jelinek + + PR target/90811 @@ -59,6 +70,52 @@ + } + return 0; +} +Index: libgomp/plugin/plugin-hsa.c +=================================================================== +--- a/src/libgomp/plugin/plugin-hsa.c (.../tags/gcc_8_3_0_release) ++++ b/src/libgomp/plugin/plugin-hsa.c (.../branches/gcc-8-branch) +@@ -1154,8 +1154,9 @@ + static void + release_kernel_dispatch (struct GOMP_hsa_kernel_dispatch *shadow) + { +- HSA_DEBUG ("Released kernel dispatch: %p has value: %lu (%p)\n", shadow, +- shadow->debug, (void *) shadow->debug); ++ HSA_DEBUG ("Released kernel dispatch: %p has value: %" PRIu64 " (%p)\n", ++ shadow, shadow->debug, ++ (void *) (uintptr_t) shadow->debug); + + hsa_fns.hsa_memory_free_fn (shadow->kernarg_address); + +@@ -1276,9 +1277,9 @@ + indent_stream (stderr, indent); + fprintf (stderr, "kernarg_address: %p\n", dispatch->kernarg_address); + indent_stream (stderr, indent); +- fprintf (stderr, "object: %lu\n", dispatch->object); ++ fprintf (stderr, "object: %" PRIu64 "\n", dispatch->object); + indent_stream (stderr, indent); +- fprintf (stderr, "signal: %lu\n", dispatch->signal); ++ fprintf (stderr, "signal: %" PRIu64 "\n", dispatch->signal); + indent_stream (stderr, indent); + fprintf (stderr, "private_segment_size: %u\n", + dispatch->private_segment_size); +@@ -1286,7 +1287,7 @@ + fprintf (stderr, "group_segment_size: %u\n", + dispatch->group_segment_size); + indent_stream (stderr, indent); +- fprintf (stderr, "children dispatches: %lu\n", ++ fprintf (stderr, "children dispatches: %" PRIu64 "\n", + dispatch->kernel_dispatch_count); + indent_stream (stderr, indent); + fprintf (stderr, "omp_num_threads: %u\n", +@@ -1594,7 +1595,7 @@ + hsa_signal_t child_s; + child_s.handle = shadow->children_dispatches[i]->signal; + +- HSA_DEBUG ("Waiting for children completion signal: %lu\n", ++ HSA_DEBUG ("Waiting for children completion signal: %" PRIu64 "\n", + shadow->children_dispatches[i]->signal); + hsa_fns.hsa_signal_load_acquire_fn (child_s); + } Index: libstdc++-v3/configure =================================================================== --- a/src/libstdc++-v3/configure (.../tags/gcc_8_3_0_release) @@ -1061,6 +1118,15 @@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ XSL_STYLE_DIR = @XSL_STYLE_DIR@ +@@ -993,7 +994,7 @@ + fi; \ + echo `date` > stamp-libstdc++convenience; + stamp-debug: +- if test ! -d ${debugdir}; then \ ++ if test ! -d ${debugdir} || test ! -f ${debugdir}/Makefile ; then \ + mkdir -p ${debugdir}; \ + for d in $(SUBDIRS); do mkdir -p ${debugdir}/$$d; done; \ + (cd ${debugdir}; \ Index: libstdc++-v3/src/filesystem/path.cc =================================================================== --- a/src/libstdc++-v3/src/filesystem/path.cc (.../tags/gcc_8_3_0_release) @@ -1285,6 +1351,19 @@ return ret; } if (p.is_absolute()) +Index: libstdc++-v3/src/Makefile.am +=================================================================== +--- a/src/libstdc++-v3/src/Makefile.am (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/src/Makefile.am (.../branches/gcc-8-branch) +@@ -321,7 +321,7 @@ + # Take care to fix all possibly-relative paths. + debugdir = ${glibcxx_builddir}/src/debug + stamp-debug: +- if test ! -d ${debugdir}; then \ ++ if test ! -d ${debugdir} || test ! -f ${debugdir}/Makefile ; then \ + mkdir -p ${debugdir}; \ + for d in $(SUBDIRS); do mkdir -p ${debugdir}/$$d; done; \ + (cd ${debugdir}; \ Index: libstdc++-v3/src/c++98/Makefile.in =================================================================== --- a/src/libstdc++-v3/src/c++98/Makefile.in (.../tags/gcc_8_3_0_release) @@ -1398,10 +1477,52 @@ 2684: priority_queue lacking comparator typedef +Index: libstdc++-v3/doc/xml/manual/shared_ptr.xml +=================================================================== +--- a/src/libstdc++-v3/doc/xml/manual/shared_ptr.xml (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/doc/xml/manual/shared_ptr.xml (.../branches/gcc-8-branch) +@@ -239,7 +239,7 @@ + + + +- _S_Atomic ++ _S_atomic + + + Selected when GCC supports a builtin atomic compare-and-swap operation +@@ -252,7 +252,7 @@ + + + +- _S_Mutex ++ _S_mutex + + + The _Sp_counted_base specialization for this policy contains a mutex, +@@ -263,7 +263,7 @@ + + + +- _S_Single ++ _S_single + + + This policy uses a non-reentrant add_ref_lock() with no locking. It is Index: libstdc++-v3/doc/xml/manual/status_cxx2017.xml =================================================================== --- a/src/libstdc++-v3/doc/xml/manual/status_cxx2017.xml (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/doc/xml/manual/status_cxx2017.xml (.../branches/gcc-8-branch) +@@ -25,8 +25,8 @@ + + + +-The following table lists new library features that have been accepted into +-the C++17 working draft. The "Proposal" column provides a link to the ++The following table lists new library features that are included in ++the C++17 standard. The "Proposal" column provides a link to the + ISO C++ committee proposal that describes the feature, while the "Status" + column indicates the first version of GCC that contains an implementation of + this feature (if it has been implemented). @@ -382,7 +382,7 @@ @@ -1693,6 +1814,17 @@ =================================================================== --- a/src/libstdc++-v3/doc/html/manual/status.html (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/doc/html/manual/status.html (.../branches/gcc-8-branch) +@@ -526,8 +526,8 @@ + This section describes the C++17 and library TS support in mainline GCC SVN, + not in any particular release. +

+-The following table lists new library features that have been accepted into +-the C++17 working draft. The "Proposal" column provides a link to the ++The following table lists new library features that are included in ++the C++17 standard. The "Proposal" column provides a link to the + ISO C++ committee proposal that describes the feature, while the "Status" + column indicates the first version of GCC that contains an implementation of + this feature (if it has been implemented). @@ -665,7 +665,7 @@ P0040R3 @@ -1796,6 +1928,35 @@

2684: priority_queue lacking comparator typedef +Index: libstdc++-v3/doc/html/manual/memory.html +=================================================================== +--- a/src/libstdc++-v3/doc/html/manual/memory.html (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/doc/html/manual/memory.html (.../branches/gcc-8-branch) +@@ -554,7 +554,7 @@ + extra template parameter, even if it had a default value. The + available policies are: +

  1. +- _S_Atomic ++ _S_atomic +

    + Selected when GCC supports a builtin atomic compare-and-swap operation + on the target processor (see Atomic +@@ -562,13 +562,13 @@ + algorithm and GCC's atomic builtins, which provide the required memory + synchronisation. +

  2. +- _S_Mutex ++ _S_mutex +

    + The _Sp_counted_base specialization for this policy contains a mutex, + which is locked in add_ref_lock(). This policy is used when GCC's atomic + builtins aren't available so explicit memory barriers are needed in places. +

  3. +- _S_Single ++ _S_single +

    + This policy uses a non-reentrant add_ref_lock() with no locking. It is + used when libstdc++ is built without --enable-threads. Index: libstdc++-v3/doc/html/manual/api.html =================================================================== --- a/src/libstdc++-v3/doc/html/manual/api.html (.../tags/gcc_8_3_0_release) @@ -2144,7 +2305,118 @@ template class tuple; template class variant; -@@ -1076,6 +1076,17 @@ +@@ -809,9 +809,8 @@ + { + using _Alternative = variant_alternative_t<__index, _Next>; + __element = __gen_vtable_impl< +- remove_reference_t< +- decltype(__element)>, tuple<_Variants...>, +- std::index_sequence<__indices..., __index>>::_S_apply(); ++ remove_reference_t, tuple<_Variants...>, ++ std::index_sequence<__indices..., __index>>::_S_apply(); + } + }; + +@@ -824,11 +823,11 @@ + using _Array_type = + _Multi_array<_Result_type (*)(_Visitor&&, _Variants...)>; + +- decltype(auto) +- static constexpr __visit_invoke(_Visitor&& __visitor, _Variants... __vars) ++ static constexpr decltype(auto) ++ __visit_invoke(_Visitor&& __visitor, _Variants... __vars) + { + return std::__invoke(std::forward<_Visitor>(__visitor), +- std::get<__indices>(std::forward<_Variants>(__vars))...); ++ __variant::__get<__indices>(std::forward<_Variants>(__vars))...); + } + + static constexpr auto +@@ -869,8 +868,8 @@ + } // namespace __detail + + template +- inline constexpr bool holds_alternative(const variant<_Types...>& __v) +- noexcept ++ constexpr bool ++ holds_alternative(const variant<_Types...>& __v) noexcept + { + static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, + "T should occur for exactly once in alternatives"); +@@ -878,7 +877,7 @@ + } + + template +- constexpr inline _Tp& get(variant<_Types...>& __v) ++ constexpr _Tp& get(variant<_Types...>& __v) + { + static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, + "T should occur for exactly once in alternatives"); +@@ -887,7 +886,7 @@ + } + + template +- constexpr inline _Tp&& get(variant<_Types...>&& __v) ++ constexpr _Tp&& get(variant<_Types...>&& __v) + { + static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, + "T should occur for exactly once in alternatives"); +@@ -897,7 +896,7 @@ + } + + template +- constexpr inline const _Tp& get(const variant<_Types...>& __v) ++ constexpr const _Tp& get(const variant<_Types...>& __v) + { + static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, + "T should occur for exactly once in alternatives"); +@@ -906,7 +905,7 @@ + } + + template +- constexpr inline const _Tp&& get(const variant<_Types...>&& __v) ++ constexpr const _Tp&& get(const variant<_Types...>&& __v) + { + static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, + "T should occur for exactly once in alternatives"); +@@ -916,8 +915,7 @@ + } + + template +- constexpr inline +- add_pointer_t>> ++ constexpr add_pointer_t>> + get_if(variant<_Types...>* __ptr) noexcept + { + using _Alternative_type = variant_alternative_t<_Np, variant<_Types...>>; +@@ -930,7 +928,7 @@ + } + + template +- constexpr inline ++ constexpr + add_pointer_t>> + get_if(const variant<_Types...>* __ptr) noexcept + { +@@ -944,7 +942,7 @@ + } + + template +- constexpr inline add_pointer_t<_Tp> ++ constexpr add_pointer_t<_Tp> + get_if(variant<_Types...>* __ptr) noexcept + { + static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, +@@ -955,7 +953,7 @@ + } + + template +- constexpr inline add_pointer_t ++ constexpr add_pointer_t + get_if(const variant<_Types...>* __ptr) + noexcept + { +@@ -1076,6 +1074,17 @@ using _Traits = __detail::__variant::_Traits<_Types...>; @@ -2162,7 +2434,7 @@ public: variant() = default; variant(const variant& __rhs) = default; -@@ -1087,6 +1098,7 @@ +@@ -1087,6 +1096,7 @@ template, variant>>, typename = enable_if_t<(sizeof...(_Types)>0)>, @@ -2170,6 +2442,36 @@ typename = enable_if_t<__exactly_once<__accepted_type<_Tp&&>> && is_constructible_v<__accepted_type<_Tp&&>, _Tp&&>>> constexpr +@@ -1275,7 +1285,7 @@ + { &__detail::__variant::__erased_##__NAME< \ + const variant&, __indices>... }; \ + template \ +- constexpr inline bool \ ++ constexpr bool \ + _M_##__NAME(const variant& __rhs, \ + std::index_sequence<__indices...>) const \ + { \ +Index: libstdc++-v3/include/std/ostream +=================================================================== +--- a/src/libstdc++-v3/include/std/ostream (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/include/std/ostream (.../branches/gcc-8-branch) +@@ -444,6 +444,8 @@ + explicit + sentry(basic_ostream<_CharT, _Traits>& __os); + ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /** + * @brief Possibly flushes the stream. + * +@@ -461,6 +463,7 @@ + _M_os.setstate(ios_base::badbit); + } + } ++#pragma GCC diagnostic pop + + /** + * @brief Quick status checking. Index: libstdc++-v3/include/experimental/any =================================================================== --- a/src/libstdc++-v3/include/experimental/any (.../tags/gcc_8_3_0_release) @@ -2294,6 +2596,27 @@ { #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS return __ch == L'/' || __ch == preferred_separator; +Index: libstdc++-v3/include/experimental/type_traits +=================================================================== +--- a/src/libstdc++-v3/include/experimental/type_traits (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/include/experimental/type_traits (.../branches/gcc-8-branch) +@@ -251,12 +251,12 @@ + template class _Op, typename... _Args> + using detected_or_t = typename detected_or<_Default, _Op, _Args...>::type; + +-template class _Op, typename... _Args> +- using is_detected_exact = is_same>; ++template class _Op, typename... _Args> ++ using is_detected_exact = is_same<_Expected, detected_t<_Op, _Args...>>; + +-template class _Op, typename... _Args> ++template class _Op, typename... _Args> + constexpr bool is_detected_exact_v +- = is_detected_exact::value; ++ = is_detected_exact<_Expected, _Op, _Args...>::value; + + template class _Op, typename... _Args> + using is_detected_convertible Index: libstdc++-v3/include/bits/hashtable.h =================================================================== --- a/src/libstdc++-v3/include/bits/hashtable.h (.../tags/gcc_8_3_0_release) @@ -2310,19 +2633,44 @@ using __traits_type = _Traits; using __hash_cached = typename __traits_type::__hash_cached; -@@ -1373,6 +1368,12 @@ - { - clear(); - _M_deallocate_buckets(); -+ -+ static_assert(__is_invocable{}, -+ "hash function must be invocable with an argument of key type"); -+ static_assert(__is_invocable{}, -+ "key equality predicate must be invocable with two arguments of " -+ "key type"); - } +Index: libstdc++-v3/include/bits/stl_algobase.h +=================================================================== +--- a/src/libstdc++-v3/include/bits/stl_algobase.h (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/include/bits/stl_algobase.h (.../branches/gcc-8-branch) +@@ -998,27 +998,27 @@ + // Precondition: __n > 0. + inline _GLIBCXX_CONSTEXPR int + __lg(int __n) +- { return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); } ++ { return (int)sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); } + + inline _GLIBCXX_CONSTEXPR unsigned + __lg(unsigned __n) +- { return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); } ++ { return (int)sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); } + + inline _GLIBCXX_CONSTEXPR long + __lg(long __n) +- { return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); } ++ { return (int)sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); } + + inline _GLIBCXX_CONSTEXPR unsigned long + __lg(unsigned long __n) +- { return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); } ++ { return (int)sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); } + + inline _GLIBCXX_CONSTEXPR long long + __lg(long long __n) +- { return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); } ++ { return (int)sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); } + + inline _GLIBCXX_CONSTEXPR unsigned long long + __lg(unsigned long long __n) +- { return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); } ++ { return (int)sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); } + + _GLIBCXX_BEGIN_NAMESPACE_ALGO - template> priority_queue(const priority_queue& __q, const _Alloc& __a) +Index: libstdc++-v3/include/bits/hashtable_policy.h +=================================================================== +--- a/src/libstdc++-v3/include/bits/hashtable_policy.h (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/include/bits/hashtable_policy.h (.../branches/gcc-8-branch) +@@ -1296,7 +1296,11 @@ + + __hash_code + _M_hash_code(const _Key& __k) const +- { return _M_h1()(__k); } ++ { ++ static_assert(__is_invocable{}, ++ "hash function must be invocable with an argument of key type"); ++ return _M_h1()(__k); ++ } + + std::size_t + _M_bucket_index(const _Key&, __hash_code __c, std::size_t __n) const +@@ -1384,7 +1388,11 @@ + + __hash_code + _M_hash_code(const _Key& __k) const +- { return _M_h1()(__k); } ++ { ++ static_assert(__is_invocable{}, ++ "hash function must be invocable with an argument of key type"); ++ return _M_h1()(__k); ++ } + + std::size_t + _M_bucket_index(const _Key&, __hash_code __c, +@@ -1830,6 +1838,9 @@ + bool + _M_equals(const _Key& __k, __hash_code __c, __node_type* __n) const + { ++ static_assert(__is_invocable{}, ++ "key equality predicate must be invocable with two arguments of " ++ "key type"); + return _EqualHelper::_S_equals(_M_eq(), this->_M_extract(), + __k, __c, __n); + } Index: libstdc++-v3/include/bits/fs_path.h =================================================================== --- a/src/libstdc++-v3/include/bits/fs_path.h (.../tags/gcc_8_3_0_release) @@ -2390,6 +2778,83 @@ _M_pathname = std::move(__p._M_pathname); _M_cmpts = std::move(__p._M_cmpts); _M_type = __p._M_type; +Index: libstdc++-v3/include/bits/unique_ptr.h +=================================================================== +--- a/src/libstdc++-v3/include/bits/unique_ptr.h (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/include/bits/unique_ptr.h (.../branches/gcc-8-branch) +@@ -174,14 +174,9 @@ + // unique_ptr + template + using __safe_conversion_up = __and_< +- is_convertible::pointer, pointer>, +- __not_>, +- __or_<__and_, +- is_same>, +- __and_<__not_>, +- is_convertible<_Ep, deleter_type>> +- > +- >; ++ is_convertible::pointer, pointer>, ++ __not_> ++ >; + + // Constructors. + +@@ -425,16 +420,14 @@ + // helper template for detecting a safe conversion from another + // unique_ptr + template, +- typename _Up_element_type = typename _Up_up::element_type> ++ typename _UPtr = unique_ptr<_Up, _Ep>, ++ typename _UP_pointer = typename _UPtr::pointer, ++ typename _UP_element_type = typename _UPtr::element_type> + using __safe_conversion_up = __and_< + is_array<_Up>, + is_same, +- is_same, +- is_convertible<_Up_element_type(*)[], element_type(*)[]>, +- __or_<__and_, is_same>, +- __and_<__not_>, +- is_convertible<_Ep, deleter_type>>> ++ is_same<_UP_pointer, _UP_element_type*>, ++ is_convertible<_UP_element_type(*)[], element_type(*)[]> + >; + + // helper template for detecting a safe conversion from a raw pointer +@@ -519,8 +512,11 @@ + typename = _DeleterConstraint<_Up>> + constexpr unique_ptr(nullptr_t) noexcept : _M_t() { } + +- template>> ++ template, ++ typename conditional::value, ++ is_same<_Ep, _Dp>, ++ is_convertible<_Ep, _Dp>>::type>> + unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept + : _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter())) + { } +Index: libstdc++-v3/include/bits/stl_vector.h +=================================================================== +--- a/src/libstdc++-v3/include/bits/stl_vector.h (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/include/bits/stl_vector.h (.../branches/gcc-8-branch) +@@ -1600,11 +1600,11 @@ + { _Alloc_traits::destroy(_M_this->_M_impl, _M_ptr()); } + + value_type& +- _M_val() { return *reinterpret_cast<_Tp*>(&__buf); } ++ _M_val() { return *_M_ptr(); } + + private: +- pointer +- _M_ptr() { return pointer_traits::pointer_to(_M_val()); } ++ _Tp* ++ _M_ptr() { return reinterpret_cast<_Tp*>(&__buf); } + + vector* _M_this; + typename aligned_storage::type __buf; Index: libstdc++-v3/include/bits/stl_uninitialized.h =================================================================== --- a/src/libstdc++-v3/include/bits/stl_uninitialized.h (.../tags/gcc_8_3_0_release) @@ -2478,6 +2943,22 @@ }; template +Index: libstdc++-v3/include/bits/random.h +=================================================================== +--- a/src/libstdc++-v3/include/bits/random.h (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/include/bits/random.h (.../branches/gcc-8-branch) +@@ -5982,9 +5982,9 @@ + size_t size() const noexcept + { return _M_v.size(); } + +- template ++ template + void +- param(OutputIterator __dest) const ++ param(_OutputIterator __dest) const + { std::copy(_M_v.begin(), _M_v.end(), __dest); } + + // no copy functions Index: libstdc++-v3/include/bits/stl_tree.h =================================================================== --- a/src/libstdc++-v3/include/bits/stl_tree.h (.../tags/gcc_8_3_0_release) @@ -2500,30 +2981,43 @@ protected: typedef _Rb_tree_node_base* _Base_ptr; typedef const _Rb_tree_node_base* _Const_Base_ptr; -@@ -962,8 +951,22 @@ - #endif +@@ -773,8 +762,26 @@ - ~_Rb_tree() _GLIBCXX_NOEXCEPT -- { _M_erase(_M_begin()); } + static const _Key& + _S_key(_Const_Link_type __x) +- { return _KeyOfValue()(_S_value(__x)); } + { -+ _M_erase(_M_begin()); - +#if __cplusplus >= 201103L ++ // If we're asking for the key we're presumably using the comparison ++ // object, and so this is a good place to sanity check it. + static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{}, + "comparison object must be invocable " + "with two arguments of key type"); +# if __cplusplus >= 201703L -+ // _GLIBCXX_RESOLVE_LIB_DEFECTS -+ // 2542. Missing const requirements for associative containers -+ static_assert(is_invocable_v, -+ "comparison object must be invocable as const"); ++ // _GLIBCXX_RESOLVE_LIB_DEFECTS ++ // 2542. Missing const requirements for associative containers ++ if constexpr (__is_invocable<_Compare&, const _Key&, const _Key&>{}) ++ static_assert( ++ is_invocable_v, ++ "comparison object must be invocable as const"); +# endif // C++17 +#endif // C++11 + ++ return _KeyOfValue()(*__x->_M_valptr()); + } + - _Rb_tree& - operator=(const _Rb_tree& __x); + static _Link_type + _S_left(_Base_ptr __x) _GLIBCXX_NOEXCEPT + { return static_cast<_Link_type>(__x->_M_left); } +@@ -797,7 +804,7 @@ + + static const _Key& + _S_key(_Const_Base_ptr __x) +- { return _KeyOfValue()(_S_value(__x)); } ++ { return _S_key(static_cast<_Const_Link_type>(__x)); } + static _Base_ptr + _S_minimum(_Base_ptr __x) _GLIBCXX_NOEXCEPT Index: libstdc++-v3/libsupc++/Makefile.in =================================================================== --- a/src/libstdc++-v3/libsupc++/Makefile.in (.../tags/gcc_8_3_0_release) @@ -2536,6 +3030,19 @@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ XSL_STYLE_DIR = @XSL_STYLE_DIR@ +Index: libstdc++-v3/libsupc++/guard_error.cc +=================================================================== +--- a/src/libstdc++-v3/libsupc++/guard_error.cc (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/libsupc++/guard_error.cc (.../branches/gcc-8-branch) +@@ -26,6 +26,6 @@ + + namespace __gnu_cxx + { +- recursive_init_error::~recursive_init_error() throw() { } ++ recursive_init_error::recursive_init_error() noexcept { } ++ recursive_init_error::~recursive_init_error() noexcept { } + } +- Index: libstdc++-v3/libsupc++/hash_bytes.cc =================================================================== --- a/src/libstdc++-v3/libsupc++/hash_bytes.cc (.../tags/gcc_8_3_0_release) @@ -2564,11 +3071,185 @@ /// The number of uncaught exceptions. int uncaught_exceptions() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__)); #endif +Index: libstdc++-v3/libsupc++/cxxabi.h +=================================================================== +--- a/src/libstdc++-v3/libsupc++/cxxabi.h (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/libsupc++/cxxabi.h (.../branches/gcc-8-branch) +@@ -683,8 +683,9 @@ + * @brief Exception thrown by __cxa_guard_acquire. + * @ingroup exceptions + * +- * 6.7[stmt.dcl]/4: If control re-enters the declaration (recursively) +- * while the object is being initialized, the behavior is undefined. ++ * C++ 2011 6.7 [stmt.dcl]/4: If control re-enters the declaration ++ * recursively while the variable is being initialized, the behavior ++ * is undefined. + * + * Since we already have a library function to handle locking, we might + * as well check for this situation and throw an exception. +@@ -694,8 +695,8 @@ + class recursive_init_error: public std::exception + { + public: +- recursive_init_error() throw() { } +- virtual ~recursive_init_error() throw (); ++ recursive_init_error() _GLIBCXX_NOTHROW; ++ virtual ~recursive_init_error() _GLIBCXX_NOTHROW; + }; + } + #endif // __cplusplus Index: libstdc++-v3/ChangeLog =================================================================== --- a/src/libstdc++-v3/ChangeLog (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/ChangeLog (.../branches/gcc-8-branch) -@@ -1,3 +1,325 @@ +@@ -1,3 +1,472 @@ ++2019-09-02 Jonathan Wakely ++ ++ * doc/html/*: Regenerate. ++ ++ * testsuite/20_util/unique_ptr/assign/48635_neg.cc: Replace dg-error ++ with dg-prune-output for enable_if failure. ++ * testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc: Add ++ dg-prune-output for enable_if failure. ++ ++2019-08-30 Jonathan Wakely ++ ++ Backport from mainline ++ 2018-10-02 Jonathan Wakely ++ ++ * include/std/variant (__gen_vtable_impl::__visit_invoke): Call __get ++ directly instead of get, as caller ensures correct index is used. ++ (holds_alternative, get, get_if): Remove redundant inline specifiers. ++ (_VARIANT_RELATION_FUNCTION_TEMPLATE): Likewise. ++ ++2019-08-30 Jonathan Wakely ++ ++ Backport from mainline ++ 2018-08-16 Jonathan Wakely ++ ++ * include/std/ostream (basic_ostream::sentry::~sentry): Suppress ++ deprecation warnings for using uncaught_exception(). ++ ++2019-08-30 Jonathan Wakely ++ ++ Backport from mainline ++ 2019-07-31 Jonathan Wakely ++ ++ PR libstdc++/91308 ++ * include/bits/unique_ptr.h (unique_ptr::__safe_conversion_up): Remove ++ constraints on deleter that should only apply to the constructor. ++ (unique_ptr::__safe_conversion_up): Likewise. ++ (unique_ptr::unique_ptr(unique_ptr&&)): Restore ++ constraints on deleter here. ++ * testsuite/20_util/unique_ptr/assign/91308.cc: New test. ++ ++2019-08-30 Jonathan Wakely ++ ++ Backport from mainline ++ 2019-07-29 Jonathan Wakely ++ ++ PR libstdc++/51333 ++ * libsupc++/cxxabi.h (__gnu_cxx::recursive_init_error): Do not define ++ constructor inline. ++ * libsupc++/guard_error.cc (__gnu_cxx::recursive_init_error): Define ++ constructor. ++ * testsuite/18_support/51333.cc: New test. ++ ++2019-08-30 Jonathan Wakely ++ ++ Backport from mainline ++ 2019-05-23 Jonathan Wakely ++ ++ * doc/xml/manual/status_cxx2017.xml: Add feature test macro for ++ P0040R3. ++ * doc/html/*: Regenerate. ++ ++ Backport from mainline ++ 2019-06-20 Jonathan Wakely ++ ++ * doc/xml/manual/status_cxx2017.xml: Fix outdated reference to ++ C++17 working draft. ++ ++ Backport from mainline ++ 2019-05-21 Jonathan Wakely ++ ++ * doc/xml/manual/shared_ptr.xml: Fix names of lock policy constants. ++ ++2019-08-30 Jonathan Wakely ++ ++ Backport from mainline ++ 2018-09-21 Jonathan Wakely ++ ++ PR libstdc++/78179 ++ * testsuite/26_numerics/headers/cmath/hypot.cc: Use lower tolerance ++ when sizeof(long double) == sizeof(double). ++ ++2019-08-30 Jonathan Wakely ++ ++ Backport from mainline ++ 2019-03-22 Jonathan Wakely ++ ++ * include/bits/stl_algobase.h (__lg): Do arithmetic on type int to ++ avoid -Wconversion warnings. ++ ++2019-08-30 Jonathan Wakely ++ ++ Backport from mainline ++ 2019-06-07 Jonathan Wakely ++ ++ PR libstdc++/90770 ++ * src/Makefile.am (stamp-debug): Also test for missing makefile. ++ * src/Makefile.in: Regenerate. ++ ++2019-08-30 Jonathan Wakely ++ ++ Backport from mainline ++ 2019-05-17 Jonathan Wakely ++ ++ * include/bits/random.h (seed_seq::param): Fix non-reserved name. ++ * include/experimental/type_traits (is_detected_exact) ++ (is_detected_exact_v): Likewise. ++ * testsuite/17_intro/names.cc: Check for more non-reserved names. ++ * testsuite/experimental/names.cc: New test. ++ ++2019-08-30 Jonathan Wakely ++ ++ Backport from mainline ++ 2019-05-17 Jonathan Wakely ++ ++ PR libstdc++/85965 ++ * include/bits/hashtable.h (_Hashtable::~_Hashtable()): Remove static ++ assertions from the destructor. ++ * include/bits/hashtable_policy.h (_Hash_code_base::_M_hash_code): ++ Move static_assert for hash function to here. ++ (_Hash_table_base::_M_equals): Move static_assert for equality ++ predicate to here. ++ * include/bits/stl_tree.h (_Rb_tree::_S_key(_Const_Link_type)): Move ++ assertions here. Access the value directly instead of calling _S_value. ++ (_Rb_tree::_S_key(_Const_Base_ptr)): Do downcast and forward to ++ _S_key(_Const_Link_type). ++ * testsuite/23_containers/set/85965.cc: Check construction, ++ destruction, assignment and size() do not trigger the assertions. ++ * testsuite/23_containers/unordered_set/85965.cc: Likewise. ++ * testsuite/23_containers/map/48101_neg.cc: Call find and adjust ++ expected errors. ++ * testsuite/23_containers/multimap/48101_neg.cc: Likewise. ++ * testsuite/23_containers/multiset/48101_neg.cc: Likewise. ++ * testsuite/23_containers/set/48101_neg.cc: Likewise. ++ * testsuite/23_containers/unordered_map/48101_neg.cc: Likewise. ++ * testsuite/23_containers/unordered_multimap/48101_neg.cc: Likewise. ++ * testsuite/23_containers/unordered_multiset/48101_neg.cc: Likewise. ++ * testsuite/23_containers/unordered_set/48101_neg.cc: Likewise. ++ ++2019-08-30 Jonathan Wakely ++ ++ Backport from mainline ++ 2018-09-03 Jonathan Wakely ++ ++ * include/bits/stl_vector.h (vector::_Temporary_value::_M_ptr): ++ Return raw pointer not allocator's pointer type. ++ (vector::_Temporary_value::_M_val): Use _M_ptr. ++ +2019-06-01 Iain Sandoe + + Backport from mainline @@ -2906,19 +3587,50 @@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ XSL_STYLE_DIR = @XSL_STYLE_DIR@ +Index: libstdc++-v3/testsuite/18_support/51333.cc +=================================================================== +--- a/src/libstdc++-v3/testsuite/18_support/51333.cc (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/testsuite/18_support/51333.cc (.../branches/gcc-8-branch) +@@ -0,0 +1,22 @@ ++// Copyright (C) 2019 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++// { dg-options "-fkeep-inline-functions" } ++// { dg-do link } ++ ++#include ++int main() { } // PR libstdc++/51333 Index: libstdc++-v3/testsuite/23_containers/unordered_map/48101_neg.cc =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/unordered_map/48101_neg.cc (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/testsuite/23_containers/unordered_map/48101_neg.cc (.../branches/gcc-8-branch) -@@ -23,7 +23,7 @@ +@@ -23,9 +23,11 @@ test01() { using namespace std; - unordered_map, hash> c2; // { dg-error "here" } + unordered_map, hash> c2; ++ c2.find(2); // { dg-error "here" } } // { dg-error "hash function must be invocable" "" { target *-*-* } 0 } + // { dg-error "key equality predicate must be invocable" "" { target *-*-* } 0 } + // { dg-prune-output "use of deleted function" } ++// { dg-prune-output "no match for call" } Index: libstdc++-v3/testsuite/23_containers/priority_queue/dr2537.cc =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/priority_queue/dr2537.cc (.../tags/gcc_8_3_0_release) @@ -2978,24 +3690,28 @@ =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/multimap/48101_neg.cc (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/testsuite/23_containers/multimap/48101_neg.cc (.../branches/gcc-8-branch) -@@ -23,8 +23,10 @@ +@@ -23,8 +23,14 @@ void test01() { - std::multimap> c; // { dg-error "here" } - std::multimap> c2; // { dg-error "here" } + std::multimap> c; ++ c.find(1); // { dg-error "here" } + std::multimap> c2; ++ c2.find(2); // { dg-error "here" } } +// { dg-error "_Compare = std::less" "" { target *-*-* } 0 } +// { dg-error "_Compare = std::allocator" "" { target *-*-* } 0 } // { dg-error "comparison object must be invocable" "" { target *-*-* } 0 } ++// { dg-prune-output "no match for call" } ++// { dg-prune-output "invalid conversion" } Index: libstdc++-v3/testsuite/23_containers/set/85965.cc =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/set/85965.cc (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/testsuite/23_containers/set/85965.cc (.../branches/gcc-8-branch) -@@ -0,0 +1,29 @@ +@@ -0,0 +1,38 @@ +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free @@ -3025,19 +3741,33 @@ + // PR libstdc++/85965 + std::set> s; +}; ++ ++std::size_t ++test01(std::set> s) ++{ ++ // these operations should not require the comparison object ++ auto copy = s; ++ copy = s; ++ return s.size(); ++} Index: libstdc++-v3/testsuite/23_containers/set/48101_neg.cc =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/set/48101_neg.cc (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/testsuite/23_containers/set/48101_neg.cc (.../branches/gcc-8-branch) -@@ -23,7 +23,7 @@ +@@ -23,9 +23,12 @@ test01() { std::set c; // { dg-error "here" } - std::set> c2; // { dg-error "here" } + std::set> c2; ++ c2.find(2); // { dg-error "here" } } // { dg-error "non-const, non-volatile value_type" "" { target *-*-* } 0 } + // { dg-error "comparison object must be invocable" "" { target *-*-* } 0 } + // { dg-prune-output "std::allocator<.* has no member named " } ++// { dg-prune-output "no match for call" } ++// { dg-prune-output "invalid conversion" } Index: libstdc++-v3/testsuite/23_containers/forward_list/operations/90105.cc =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/forward_list/operations/90105.cc (.../tags/gcc_8_3_0_release) @@ -3171,20 +3901,24 @@ =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/unordered_multimap/48101_neg.cc (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/testsuite/23_containers/unordered_multimap/48101_neg.cc (.../branches/gcc-8-branch) -@@ -23,7 +23,7 @@ +@@ -23,9 +23,11 @@ test01() { using namespace std; - unordered_multimap, hash> c2; // { dg-error "here" } + unordered_multimap, hash> c2; ++ c2.find(2); // { dg-error "here" } } // { dg-error "hash function must be invocable" "" { target *-*-* } 0 } + // { dg-error "key equality predicate must be invocable" "" { target *-*-* } 0 } + // { dg-prune-output "use of deleted function" } ++// { dg-prune-output "no match for call" } Index: libstdc++-v3/testsuite/23_containers/unordered_set/85965.cc =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/unordered_set/85965.cc (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/testsuite/23_containers/unordered_set/85965.cc (.../branches/gcc-8-branch) -@@ -0,0 +1,29 @@ +@@ -0,0 +1,38 @@ +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free @@ -3214,62 +3948,92 @@ + // PR libstdc++/85965 + std::unordered_set, std::hash> u; +}; ++ ++std::size_t ++test01(std::unordered_set, std::hash> s) ++{ ++ // these operations should not require the comparison object ++ auto copy = s; ++ copy = s; ++ return s.size(); ++} Index: libstdc++-v3/testsuite/23_containers/unordered_set/48101_neg.cc =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/unordered_set/48101_neg.cc (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/testsuite/23_containers/unordered_set/48101_neg.cc (.../branches/gcc-8-branch) -@@ -24,7 +24,7 @@ +@@ -24,7 +24,8 @@ { using namespace std; unordered_set> c; // { dg-error "here" } - unordered_set, hash> c2; // { dg-error "here" } + unordered_set, hash> c2; ++ c2.find(2); // { dg-error "here" } } // { dg-error "non-const, non-volatile value_type" "" { target *-*-* } 0 } +@@ -31,3 +32,4 @@ + // { dg-error "hash function must be invocable" "" { target *-*-* } 0 } + // { dg-error "key equality predicate must be invocable" "" { target *-*-* } 0 } + // { dg-prune-output "use of deleted function" } ++// { dg-prune-output "no match for call" } Index: libstdc++-v3/testsuite/23_containers/multiset/48101_neg.cc =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/multiset/48101_neg.cc (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/testsuite/23_containers/multiset/48101_neg.cc (.../branches/gcc-8-branch) -@@ -23,7 +23,7 @@ +@@ -23,9 +23,12 @@ test01() { std::multiset c; // { dg-error "here" } - std::multiset> c2; // { dg-error "here" } + std::multiset> c2; ++ c2.find(2); // { dg-error "here" } } // { dg-error "non-const, non-volatile value_type" "" { target *-*-* } 0 } + // { dg-error "comparison object must be invocable" "" { target *-*-* } 0 } + // { dg-prune-output "std::allocator<.* has no member named " } ++// { dg-prune-output "no match for call" } ++// { dg-prune-output "invalid conversion" } Index: libstdc++-v3/testsuite/23_containers/unordered_multiset/48101_neg.cc =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/unordered_multiset/48101_neg.cc (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/testsuite/23_containers/unordered_multiset/48101_neg.cc (.../branches/gcc-8-branch) -@@ -24,7 +24,7 @@ +@@ -24,7 +24,8 @@ { using namespace std; unordered_multiset> c; // { dg-error "here" } - unordered_multiset, hash> c2; // { dg-error "here" } + unordered_multiset, hash> c2; ++ c2.find(2); // { dg-error "here" } } // { dg-error "non-const, non-volatile value_type" "" { target *-*-* } 0 } +@@ -31,3 +32,4 @@ + // { dg-error "hash function must be invocable" "" { target *-*-* } 0 } + // { dg-error "key equality predicate must be invocable" "" { target *-*-* } 0 } + // { dg-prune-output "use of deleted function" } ++// { dg-prune-output "no match for call" } Index: libstdc++-v3/testsuite/23_containers/map/48101_neg.cc =================================================================== --- a/src/libstdc++-v3/testsuite/23_containers/map/48101_neg.cc (.../tags/gcc_8_3_0_release) +++ b/src/libstdc++-v3/testsuite/23_containers/map/48101_neg.cc (.../branches/gcc-8-branch) -@@ -23,8 +23,10 @@ +@@ -23,8 +23,14 @@ void test01() { - std::map> c; // { dg-error "here" } - std::map> c2; // { dg-error "here" } + std::map> c; ++ c.find(1); // { dg-error "here" } + std::map> c2; ++ c2.find(2); // { dg-error "here" } } +// { dg-error "_Compare = std::less" "" { target *-*-* } 0 } +// { dg-error "_Compare = std::allocator" "" { target *-*-* } 0 } // { dg-error "comparison object must be invocable" "" { target *-*-* } 0 } ++// { dg-prune-output "no match for call" } ++// { dg-prune-output "invalid conversion" } Index: libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc =================================================================== --- a/src/libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc (.../tags/gcc_8_3_0_release) @@ -3586,6 +4350,36 @@ + std::string_view s1, s2; + return s1 != s2; +} +Index: libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot.cc +=================================================================== +--- a/src/libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot.cc (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/testsuite/26_numerics/headers/cmath/hypot.cc (.../branches/gcc-8-branch) +@@ -1,4 +1,4 @@ +-// Copyright (C) 2016-2018 Free Software Foundation, Inc. ++// Copyright (C) 2016-2019 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free + // software; you can redistribute it and/or modify it under the +@@ -17,7 +17,6 @@ + + // { dg-options "-std=gnu++17" } + // { dg-do run { target c++17 } } +-// { dg-xfail-run-if "AIX long double" { powerpc-ibm-aix* } } + + #include + #include +@@ -128,7 +127,10 @@ + { + test(data1, toler1); + test(data2, toler2); +- test(data3, toler3); ++ if (sizeof(long double) > sizeof(double)) ++ test(data3, toler3); ++ else ++ test(data3, (long double)toler1); + } + + int Index: libstdc++-v3/testsuite/experimental/any/misc/any_cast.cc =================================================================== --- a/src/libstdc++-v3/testsuite/experimental/any/misc/any_cast.cc (.../tags/gcc_8_3_0_release) @@ -3783,6 +4577,169 @@ +static_assert( !std::is_constructible::value, "" ); +static_assert( !std::is_constructible::value, "" ); +static_assert( !std::is_constructible::value, "" ); +Index: libstdc++-v3/testsuite/experimental/names.cc +=================================================================== +--- a/src/libstdc++-v3/testsuite/experimental/names.cc (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/testsuite/experimental/names.cc (.../branches/gcc-8-branch) +@@ -0,0 +1,57 @@ ++// Copyright (C) 2017-2019 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++// { dg-do compile } ++ ++// Define macros for some common variables names that we must not use for ++// naming variables, parameters etc. in the library. ++ ++#include "../17_intro/names.cc" ++// Filesystem ++#if __has_include() ++# include ++#endif ++// Library Fundamentals ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include +Index: libstdc++-v3/testsuite/17_intro/names.cc +=================================================================== +--- a/src/libstdc++-v3/testsuite/17_intro/names.cc (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/testsuite/17_intro/names.cc (.../branches/gcc-8-branch) +@@ -19,7 +19,6 @@ + + // Define macros for some common variables names that we must not use for + // naming variables, parameters etc. in the library. +-#define tmp ( + #define A ( + #define B ( + #define C ( +@@ -99,6 +98,78 @@ + #define y ( + #define z ( + ++#define tmp ( ++ ++#if __cplusplus < 201703L ++// defines to_chars_result::ptr and to_chars_result::ec ++#define ec ( ++#define ptr ( ++#endif ++ ++// Common template parameter names ++#define OutputIterator OutputIterator is not a reserved name ++#define InputIterator InputIterator is not a reserved name ++#define ForwardIterator ForwardIterator is not a reserved name ++#define BidirectionalIterator BidirectionalIterator is not a reserved name ++#define RandomAccessIterator RandomAccessIterator is not a reserved name ++#define RandomAccessOutputIterator RandomAccessOutputIterator is not a reserved name ++#define RAIter RAIter is not a reserved name ++#define FwdIter FwdIter is not a reserved name ++#define OutIter OutIter is not a reserved name ++#define InIter InIter is not a reserved name ++ ++#define Alloc Alloc is not a reserved name ++#define BinaryFunction1 BinaryFunction1 is not a reserved name ++#define BinaryFunction2 BinaryFunction2 is not a reserved name ++#define Char Char is not a reserved name ++#define CharT CharT is not a reserved name ++#define Cmp Cmp is not a reserved name ++#define Compare Compare is not a reserved name ++#define Const_Iterator Const_Iterator is not a reserved name ++#define Const_Key_Reference Const_Key_Reference is not a reserved name ++#define Const_Node_Iter Const_Node_Iter is not a reserved name ++#define Const_Pointer Const_Pointer is not a reserved name ++#define Const_Reference Const_Reference is not a reserved name ++#define Data Data is not a reserved name ++#define DiffType DiffType is not a reserved name ++#define Eq Eq is not a reserved name ++#define ExecPolicy ExecPolicy is not a reserved name ++#define Expected Expected is not a reserved name ++#define External_Load_Access External_Load_Access is not a reserved name ++#define External_Size_Access External_Size_Access is not a reserved name ++#define Fn Fn is not a reserved name ++#define Function Function is not a reserved name ++#define Functor Functor is not a reserved name ++#define Hash Hash is not a reserved name ++#define H1 H1 is not a reserved name ++#define H2 H2 is not a reserved name ++#define Head Head is not a reserved name ++#define It It is not a reserved name ++#define Iter Iter is not a reserved name ++#define Iterator Iterator is not a reserved name ++#define Key Key is not a reserved name ++#define Mapped Mapped is not a reserved name ++#define Node Node is not a reserved name ++#define Node_iter Node_iter is not a reserved name ++#define Node_ptr Node_ptr is not a reserved name ++#define Overflow Overflow is not a reserved name ++#define Pointer Pointer is not a reserved name ++#define Policy Policy is not a reserved name ++#define Pred Pred is not a reserved name ++#define Ptr Ptr is not a reserved name ++#define Reference Reference is not a reserved name ++#define Seq Seq is not a reserved name ++#define Seq_RAIter Seq_RAIter is not a reserved name ++#define Series Series is not a reserved name ++#define Set Set is not a reserved name ++#define String String is not a reserved name ++#define Tp Tp is not a reserved name ++#define Traits Traits is not a reserved name ++#define Type Type is not a reserved name ++#define Value Value is not a reserved name ++#define ValueT ValueT is not a reserved name ++#define ValueType ValueType is not a reserved name ++ + #ifdef _AIX + // See https://gcc.gnu.org/ml/libstdc++/2017-03/msg00015.html + #undef f +@@ -116,4 +187,9 @@ + #undef y + #endif + ++#ifdef __sun__ ++// See https://gcc.gnu.org/ml/libstdc++/2019-05/msg00175.html ++#undef ptr ++#endif ++ + #include Index: libstdc++-v3/testsuite/util/thread/all.h =================================================================== --- a/src/libstdc++-v3/testsuite/util/thread/all.h (.../tags/gcc_8_3_0_release) @@ -4013,6 +4970,86 @@ + test06(); + test07(); } +Index: libstdc++-v3/testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc +=================================================================== +--- a/src/libstdc++-v3/testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc (.../branches/gcc-8-branch) +@@ -39,7 +39,7 @@ + std::unique_ptr cA3(p); // { dg-error "no matching function" } + std::unique_ptr vA3(p); // { dg-error "no matching function" } + std::unique_ptr cvA3(p); // { dg-error "no matching function" } +- // { dg-error "no type" "" { target *-*-* } 473 } ++ // { dg-prune-output "no type" } + } + + template +Index: libstdc++-v3/testsuite/20_util/unique_ptr/assign/48635_neg.cc +=================================================================== +--- a/src/libstdc++-v3/testsuite/20_util/unique_ptr/assign/48635_neg.cc (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/testsuite/20_util/unique_ptr/assign/48635_neg.cc (.../branches/gcc-8-branch) +@@ -42,10 +42,9 @@ + std::unique_ptr ud(nullptr, d); + ub = std::move(ud); // { dg-error "no match" } + ub2 = ud; // { dg-error "no match" } +-// { dg-error "no type" "" { target *-*-* } 307 } + + std::unique_ptr uba(nullptr, b); + std::unique_ptr uda(nullptr, d); + uba = std::move(uda); // { dg-error "no match" } +-// { dg-error "no type" "" { target *-*-* } 566 } + } ++// { dg-prune-output "no type" } +Index: libstdc++-v3/testsuite/20_util/unique_ptr/assign/91308.cc +=================================================================== +--- a/src/libstdc++-v3/testsuite/20_util/unique_ptr/assign/91308.cc (.../tags/gcc_8_3_0_release) ++++ b/src/libstdc++-v3/testsuite/20_util/unique_ptr/assign/91308.cc (.../branches/gcc-8-branch) +@@ -0,0 +1,46 @@ ++// Copyright (C) 2019 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++// { dg-do compile { target c++11 } } ++ ++#include ++ ++struct D1 ++{ ++ void operator()(int* p) const noexcept { } ++}; ++ ++struct D2 : D1 ++{ ++ D2& operator=(D1&&) noexcept { return *this; } ++}; ++ ++void ++test01() ++{ ++ std::unique_ptr d1; ++ std::unique_ptr d2; ++ d2 = std::move(d1); ++} ++ ++void ++test02() ++{ ++ std::unique_ptr d1; ++ std::unique_ptr d2; ++ d2 = std::move(d1); ++} Index: libstdc++-v3/testsuite/20_util/variant/compile.cc =================================================================== --- a/src/libstdc++-v3/testsuite/20_util/variant/compile.cc (.../tags/gcc_8_3_0_release) @@ -4614,7 +5651,15 @@ =================================================================== --- a/src/libgcc/ChangeLog (.../tags/gcc_8_3_0_release) +++ b/src/libgcc/ChangeLog (.../branches/gcc-8-branch) -@@ -1,3 +1,10 @@ +@@ -1,3 +1,18 @@ ++2019-08-27 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-06-06 Iain Sandoe ++ ++ * config/rs6000/t-darwin: Ensure that the unwinder is built with ++ altivec enabled. ++ +2019-08-11 Iain Sandoe + + Backport from mainline. @@ -4625,6 +5670,18 @@ 2019-02-22 Release Manager * GCC 8.3.0 released. +Index: libgcc/config/rs6000/t-darwin +=================================================================== +--- a/src/libgcc/config/rs6000/t-darwin (.../tags/gcc_8_3_0_release) ++++ b/src/libgcc/config/rs6000/t-darwin (.../branches/gcc-8-branch) +@@ -20,4 +20,7 @@ + # earlier OSX versions. + HOST_LIBGCC2_CFLAGS += -Wa,-force_cpusubtype_ALL -mmacosx-version-min=10.4 + ++unwind-dw2_s.o: HOST_LIBGCC2_CFLAGS += -maltivec ++unwind-dw2.o: HOST_LIBGCC2_CFLAGS += -maltivec ++ + LIB2ADDEH += $(srcdir)/config/rs6000/darwin-fallback.c Index: libgcc/config/rs6000/darwin-vecsave.S =================================================================== --- a/src/libgcc/config/rs6000/darwin-vecsave.S (.../tags/gcc_8_3_0_release) @@ -4706,7 +5763,35 @@ =================================================================== --- a/src/gcc/c-family/ChangeLog (.../tags/gcc_8_3_0_release) +++ b/src/gcc/c-family/ChangeLog (.../branches/gcc-8-branch) -@@ -1,3 +1,26 @@ +@@ -1,3 +1,54 @@ ++2019-09-03 Iain Sandoe ++ ++ Backport from mainline ++ 2019-08-23 Iain Sandoe ++ ++ PR pch/61250 ++ * c-lex.c (c_lex_with_flags): Don't call ++ c_common_no_more_pch () from here. ++ ++2019-08-30 Richard Biener ++ ++ Backport from mainline ++ 2019-05-15 Richard Biener ++ ++ PR c/90474 ++ * c-common.c (c_common_mark_addressable_vec): Also mark ++ a COMPOUND_LITERAL_EXPR_DECL addressable similar to ++ c_mark_addressable. ++ ++2019-08-29 Jakub Jelinek ++ ++ Backported from mainline ++ 2019-06-25 Jakub Jelinek ++ ++ PR sanitizer/90954 ++ * c-omp.c (c_finish_omp_atomic): Allow tree_invariant_p in addition ++ to SAVE_EXPR in first operand of a COMPOUND_EXPR. ++ +2019-05-22 Eric Botcazou + + Backport from mainline @@ -4733,6 +5818,57 @@ 2019-02-22 Release Manager * GCC 8.3.0 released. +Index: gcc/c-family/c-lex.c +=================================================================== +--- a/src/gcc/c-family/c-lex.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/c-family/c-lex.c (.../branches/gcc-8-branch) +@@ -392,7 +392,6 @@ + c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags, + int lex_flags) + { +- static bool no_more_pch; + const cpp_token *tok; + enum cpp_ttype type; + unsigned char add_flags = 0; +@@ -626,12 +625,6 @@ + if (cpp_flags) + *cpp_flags = tok->flags | add_flags; + +- if (!no_more_pch) +- { +- no_more_pch = true; +- c_common_no_more_pch (); +- } +- + timevar_pop (TV_CPP); + + return type; +Index: gcc/c-family/c-common.c +=================================================================== +--- a/src/gcc/c-family/c-common.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/c-family/c-common.c (.../branches/gcc-8-branch) +@@ -6440,6 +6440,8 @@ + return; + if (!VAR_P (t) || !DECL_HARD_REGISTER (t)) + TREE_ADDRESSABLE (t) = 1; ++ if (TREE_CODE (t) == COMPOUND_LITERAL_EXPR) ++ TREE_ADDRESSABLE (COMPOUND_LITERAL_EXPR_DECL (t)) = 1; + } + + +Index: gcc/c-family/c-omp.c +=================================================================== +--- a/src/gcc/c-family/c-omp.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/c-family/c-omp.c (.../branches/gcc-8-branch) +@@ -300,7 +300,7 @@ + if (TREE_CODE (x) == COMPOUND_EXPR) + { + pre = TREE_OPERAND (x, 0); +- gcc_assert (TREE_CODE (pre) == SAVE_EXPR); ++ gcc_assert (TREE_CODE (pre) == SAVE_EXPR || tree_invariant_p (pre)); + x = TREE_OPERAND (x, 1); + } + gcc_assert (TREE_CODE (x) == MODIFY_EXPR); Index: gcc/c-family/c-attribs.c =================================================================== --- a/src/gcc/c-family/c-attribs.c (.../tags/gcc_8_3_0_release) @@ -4815,7 +5951,30 @@ =================================================================== --- a/src/gcc/c/ChangeLog (.../tags/gcc_8_3_0_release) +++ b/src/gcc/c/ChangeLog (.../branches/gcc-8-branch) -@@ -1,3 +1,35 @@ +@@ -1,3 +1,58 @@ ++2019-09-03 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-08-23 Iain Sandoe ++ ++ PR pch/61250 ++ * c-parser.c (c_parse_file): Call c_common_no_more_pch () ++ after determining that the first token is not ++ PRAGMA_GCC_PCH_PREPROCESS. ++ ++2019-08-29 Jakub Jelinek ++ ++ Backported from mainline ++ 2019-04-26 Jakub Jelinek ++ ++ PR debug/90197 ++ * c-tree.h (c_finish_loop): Add 2 further location_t arguments. ++ * c-parser.c (c_parser_while_statement): Adjust c_finish_loop caller. ++ (c_parser_do_statement): Likewise. ++ (c_parser_for_statement): Likewise. Formatting fixes. ++ * c-typeck.c (c_finish_loop): Add COND_LOCUS and INCR_LOCUS arguments, ++ emit DEBUG_BEGIN_STMTs if needed. ++ +2019-07-21 Richard Sandiford + + Backport from mainline @@ -4851,6 +6010,245 @@ 2019-02-22 Release Manager * GCC 8.3.0 released. +Index: gcc/c/c-parser.c +=================================================================== +--- a/src/gcc/c/c-parser.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/c/c-parser.c (.../branches/gcc-8-branch) +@@ -5933,7 +5933,8 @@ + location_t loc_after_labels; + bool open_brace = c_parser_next_token_is (parser, CPP_OPEN_BRACE); + body = c_parser_c99_block_statement (parser, if_p, &loc_after_labels); +- c_finish_loop (loc, cond, NULL, body, c_break_label, c_cont_label, true); ++ c_finish_loop (loc, loc, cond, UNKNOWN_LOCATION, NULL, body, ++ c_break_label, c_cont_label, true); + add_stmt (c_end_compound_stmt (loc, block, flag_isoc99)); + c_parser_maybe_reclassify_token (parser); + +@@ -5978,6 +5979,7 @@ + c_break_label = save_break; + new_cont = c_cont_label; + c_cont_label = save_cont; ++ location_t cond_loc = c_parser_peek_token (parser)->location; + cond = c_parser_paren_condition (parser); + if (ivdep && cond != error_mark_node) + cond = build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond, +@@ -5991,7 +5993,8 @@ + build_int_cst (integer_type_node, unroll)); + if (!c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>")) + c_parser_skip_to_end_of_block_or_statement (parser); +- c_finish_loop (loc, cond, NULL, body, new_break, new_cont, false); ++ c_finish_loop (loc, cond_loc, cond, UNKNOWN_LOCATION, NULL, body, ++ new_break, new_cont, false); + add_stmt (c_end_compound_stmt (loc, block, flag_isoc99)); + } + +@@ -6064,7 +6067,9 @@ + /* Silence the bogus uninitialized warning. */ + tree collection_expression = NULL; + location_t loc = c_parser_peek_token (parser)->location; +- location_t for_loc = c_parser_peek_token (parser)->location; ++ location_t for_loc = loc; ++ location_t cond_loc = UNKNOWN_LOCATION; ++ location_t incr_loc = UNKNOWN_LOCATION; + bool is_foreach_statement = false; + gcc_assert (c_parser_next_token_is_keyword (parser, RID_FOR)); + token_indent_info for_tinfo +@@ -6098,7 +6103,8 @@ + c_parser_consume_token (parser); + is_foreach_statement = true; + if (check_for_loop_decls (for_loc, true) == NULL_TREE) +- c_parser_error (parser, "multiple iterating variables in fast enumeration"); ++ c_parser_error (parser, "multiple iterating variables in " ++ "fast enumeration"); + } + else + check_for_loop_decls (for_loc, flag_isoc99); +@@ -6128,7 +6134,8 @@ + c_parser_consume_token (parser); + is_foreach_statement = true; + if (check_for_loop_decls (for_loc, true) == NULL_TREE) +- c_parser_error (parser, "multiple iterating variables in fast enumeration"); ++ c_parser_error (parser, "multiple iterating variables in " ++ "fast enumeration"); + } + else + check_for_loop_decls (for_loc, flag_isoc99); +@@ -6150,8 +6157,10 @@ + c_parser_consume_token (parser); + is_foreach_statement = true; + if (! lvalue_p (init_expression)) +- c_parser_error (parser, "invalid iterating variable in fast enumeration"); +- object_expression = c_fully_fold (init_expression, false, NULL); ++ c_parser_error (parser, "invalid iterating variable in " ++ "fast enumeration"); ++ object_expression ++ = c_fully_fold (init_expression, false, NULL); + } + else + { +@@ -6158,7 +6167,8 @@ + ce = convert_lvalue_to_rvalue (loc, ce, true, false); + init_expression = ce.value; + c_finish_expr_stmt (loc, init_expression); +- c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); ++ c_parser_skip_until_found (parser, CPP_SEMICOLON, ++ "expected %<;%>"); + } + } + } +@@ -6167,18 +6177,19 @@ + gcc_assert (!parser->objc_could_be_foreach_context); + if (!is_foreach_statement) + { ++ cond_loc = c_parser_peek_token (parser)->location; + if (c_parser_next_token_is (parser, CPP_SEMICOLON)) + { + if (ivdep) + { +- c_parser_error (parser, "missing loop condition in loop with " +- "% pragma"); ++ c_parser_error (parser, "missing loop condition in loop " ++ "with % pragma"); + cond = error_mark_node; + } + else if (unroll) + { +- c_parser_error (parser, "missing loop condition in loop with " +- "% pragma"); ++ c_parser_error (parser, "missing loop condition in loop " ++ "with % pragma"); + cond = error_mark_node; + } + else +@@ -6207,11 +6218,13 @@ + /* Parse the increment expression (the third expression in a + for-statement). In the case of a foreach-statement, this is + the expression that follows the 'in'. */ ++ loc = incr_loc = c_parser_peek_token (parser)->location; + if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN)) + { + if (is_foreach_statement) + { +- c_parser_error (parser, "missing collection in fast enumeration"); ++ c_parser_error (parser, ++ "missing collection in fast enumeration"); + collection_expression = error_mark_node; + } + else +@@ -6220,8 +6233,8 @@ + else + { + if (is_foreach_statement) +- collection_expression = c_fully_fold (c_parser_expression (parser).value, +- false, NULL); ++ collection_expression ++ = c_fully_fold (c_parser_expression (parser).value, false, NULL); + else + { + struct c_expr ce = c_parser_expression (parser); +@@ -6244,10 +6257,14 @@ + body = c_parser_c99_block_statement (parser, if_p, &loc_after_labels); + + if (is_foreach_statement) +- objc_finish_foreach_loop (loc, object_expression, collection_expression, body, c_break_label, c_cont_label); ++ objc_finish_foreach_loop (for_loc, object_expression, ++ collection_expression, body, c_break_label, ++ c_cont_label); + else +- c_finish_loop (loc, cond, incr, body, c_break_label, c_cont_label, true); +- add_stmt (c_end_compound_stmt (loc, block, flag_isoc99 || c_dialect_objc ())); ++ c_finish_loop (for_loc, cond_loc, cond, incr_loc, incr, body, ++ c_break_label, c_cont_label, true); ++ add_stmt (c_end_compound_stmt (for_loc, block, ++ flag_isoc99 || c_dialect_objc ())); + c_parser_maybe_reclassify_token (parser); + + token_indent_info next_tinfo +@@ -18461,6 +18478,8 @@ + + if (c_parser_peek_token (&tparser)->pragma_kind == PRAGMA_GCC_PCH_PREPROCESS) + c_parser_pragma_pch_preprocess (&tparser); ++ else ++ c_common_no_more_pch (); + + the_parser = ggc_alloc (); + *the_parser = tparser; +Index: gcc/c/c-typeck.c +=================================================================== +--- a/src/gcc/c/c-typeck.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/c/c-typeck.c (.../branches/gcc-8-branch) +@@ -10528,11 +10528,14 @@ + the beginning of the loop. COND is the loop condition. COND_IS_FIRST + is false for DO loops. INCR is the FOR increment expression. BODY is + the statement controlled by the loop. BLAB is the break label. CLAB is +- the continue label. Everything is allowed to be NULL. */ ++ the continue label. Everything is allowed to be NULL. ++ COND_LOCUS is the location of the loop condition, INCR_LOCUS is the ++ location of the FOR increment expression. */ + + void +-c_finish_loop (location_t start_locus, tree cond, tree incr, tree body, +- tree blab, tree clab, bool cond_is_first) ++c_finish_loop (location_t start_locus, location_t cond_locus, tree cond, ++ location_t incr_locus, tree incr, tree body, tree blab, ++ tree clab, bool cond_is_first) + { + tree entry = NULL, exit = NULL, t; + +@@ -10574,12 +10577,8 @@ + } + + t = build_and_jump (&blab); +- if (cond_is_first) +- exit = fold_build3_loc (start_locus, +- COND_EXPR, void_type_node, cond, exit, t); +- else +- exit = fold_build3_loc (input_location, +- COND_EXPR, void_type_node, cond, exit, t); ++ exit = fold_build3_loc (cond_is_first ? start_locus : input_location, ++ COND_EXPR, void_type_node, cond, exit, t); + } + else + { +@@ -10600,9 +10599,23 @@ + if (clab) + add_stmt (build1 (LABEL_EXPR, void_type_node, clab)); + if (incr) +- add_stmt (incr); ++ { ++ if (MAY_HAVE_DEBUG_MARKER_STMTS && incr_locus != UNKNOWN_LOCATION) ++ { ++ t = build0 (DEBUG_BEGIN_STMT, void_type_node); ++ SET_EXPR_LOCATION (t, incr_locus); ++ add_stmt (t); ++ } ++ add_stmt (incr); ++ } + if (entry) + add_stmt (entry); ++ if (MAY_HAVE_DEBUG_MARKER_STMTS && cond_locus != UNKNOWN_LOCATION) ++ { ++ t = build0 (DEBUG_BEGIN_STMT, void_type_node); ++ SET_EXPR_LOCATION (t, cond_locus); ++ add_stmt (t); ++ } + if (exit) + add_stmt (exit); + if (blab) +Index: gcc/c/c-tree.h +=================================================================== +--- a/src/gcc/c/c-tree.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/c/c-tree.h (.../branches/gcc-8-branch) +@@ -684,7 +684,8 @@ + extern tree c_begin_compound_stmt (bool); + extern tree c_end_compound_stmt (location_t, tree, bool); + extern void c_finish_if_stmt (location_t, tree, tree, tree); +-extern void c_finish_loop (location_t, tree, tree, tree, tree, tree, bool); ++extern void c_finish_loop (location_t, location_t, tree, location_t, tree, ++ tree, tree, tree, bool); + extern tree c_begin_stmt_expr (void); + extern tree c_finish_stmt_expr (location_t, tree); + extern tree c_process_expr_stmt (location_t, tree); Index: gcc/c/c-decl.c =================================================================== --- a/src/gcc/c/c-decl.c (.../tags/gcc_8_3_0_release) @@ -5055,13 +6453,25 @@ /* Walk all functions with body defined. */ #define FOR_EACH_FUNCTION_WITH_GIMPLE_BODY(node) \ for ((node) = symtab->first_function_with_gimple_body (); (node); \ +Index: gcc/cfgloopmanip.c +=================================================================== +--- a/src/gcc/cfgloopmanip.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/cfgloopmanip.c (.../branches/gcc-8-branch) +@@ -1019,6 +1019,7 @@ + target->warned_aggressive_loop_optimizations + |= loop->warned_aggressive_loop_optimizations; + target->in_oacc_kernels_region = loop->in_oacc_kernels_region; ++ target->owned_clique = loop->owned_clique; + } + + /* Copies copy of LOOP as subloop of TARGET loop, placing newly Index: gcc/DATESTAMP =================================================================== --- a/src/gcc/DATESTAMP (.../tags/gcc_8_3_0_release) +++ b/src/gcc/DATESTAMP (.../branches/gcc-8-branch) @@ -1 +1 @@ -20190222 -+20190817 ++20190909 Index: gcc/tree-ssa-loop-ch.c =================================================================== --- a/src/gcc/tree-ssa-loop-ch.c (.../tags/gcc_8_3_0_release) @@ -5169,6 +6579,20 @@ /* The above functions should be neither const nor pure. Punt if they aren't. */ if (gimple_vdef (stmt) == NULL_TREE || gimple_vuse (stmt) == NULL_TREE) +Index: gcc/tree.c +=================================================================== +--- a/src/gcc/tree.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree.c (.../branches/gcc-8-branch) +@@ -5133,8 +5133,7 @@ + free_lang_data_in_binfo (TYPE_BINFO (type)); + /* We need to preserve link to bases and virtual table for all + polymorphic types to make devirtualization machinery working. */ +- if (!BINFO_VTABLE (TYPE_BINFO (type)) +- || !flag_devirtualize) ++ if (!BINFO_VTABLE (TYPE_BINFO (type))) + TYPE_BINFO (type) = NULL; + } + } Index: gcc/tree.h =================================================================== --- a/src/gcc/tree.h (.../tags/gcc_8_3_0_release) @@ -5370,6 +6794,89 @@ } } // namespace selftest +Index: gcc/cfghooks.c +=================================================================== +--- a/src/gcc/cfghooks.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/cfghooks.c (.../branches/gcc-8-branch) +@@ -1066,7 +1066,7 @@ + AFTER. */ + + basic_block +-duplicate_block (basic_block bb, edge e, basic_block after) ++duplicate_block (basic_block bb, edge e, basic_block after, copy_bb_data *id) + { + edge s, n; + basic_block new_bb; +@@ -1082,7 +1082,7 @@ + + gcc_checking_assert (can_duplicate_block_p (bb)); + +- new_bb = cfg_hooks->duplicate_block (bb); ++ new_bb = cfg_hooks->duplicate_block (bb, id); + if (after) + move_block_after (new_bb, after); + +@@ -1337,6 +1337,7 @@ + unsigned i, j; + basic_block bb, new_bb, dom_bb; + edge e; ++ copy_bb_data id; + + /* Mark the blocks to be copied. This is used by edge creation hooks + to decide whether to reallocate PHI nodes capacity to avoid reallocating +@@ -1349,7 +1350,7 @@ + { + /* Duplicate. */ + bb = bbs[i]; +- new_bb = new_bbs[i] = duplicate_block (bb, NULL, after); ++ new_bb = new_bbs[i] = duplicate_block (bb, NULL, after, &id); + after = new_bb; + if (bb->loop_father) + { +Index: gcc/cfghooks.h +=================================================================== +--- a/src/gcc/cfghooks.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/cfghooks.h (.../branches/gcc-8-branch) +@@ -54,7 +54,20 @@ + bool run; + }; + ++typedef int_hash dependence_hash; + ++/* Optional data for duplicate_block. */ ++ ++struct copy_bb_data ++{ ++ copy_bb_data() : dependence_map (NULL) {} ++ ~copy_bb_data () { delete dependence_map; } ++ ++ /* A map from the copied BBs dependence info cliques to ++ equivalents in the BBs duplicated to. */ ++ hash_map *dependence_map; ++}; ++ + struct cfg_hooks + { + /* Name of the corresponding ir. */ +@@ -112,7 +125,7 @@ + bool (*can_duplicate_block_p) (const_basic_block a); + + /* Duplicate block A. */ +- basic_block (*duplicate_block) (basic_block a); ++ basic_block (*duplicate_block) (basic_block a, copy_bb_data *); + + /* Higher level functions representable by primitive operations above if + we didn't have some oddities in RTL and Tree representations. */ +@@ -227,7 +240,8 @@ + extern void predict_edge (edge e, enum br_predictor predictor, int probability); + extern bool predicted_by_p (const_basic_block bb, enum br_predictor predictor); + extern bool can_duplicate_block_p (const_basic_block); +-extern basic_block duplicate_block (basic_block, edge, basic_block); ++extern basic_block duplicate_block (basic_block, edge, basic_block, ++ copy_bb_data * = NULL); + extern bool block_ends_with_call_p (basic_block bb); + extern bool empty_block_p (basic_block); + extern basic_block split_block_before_cond_jump (basic_block); Index: gcc/fold-const.c =================================================================== --- a/src/gcc/fold-const.c (.../tags/gcc_8_3_0_release) @@ -5579,6 +7086,122 @@ ctx->depth = 1; } +Index: gcc/objc/ChangeLog +=================================================================== +--- a/src/gcc/objc/ChangeLog (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/objc/ChangeLog (.../branches/gcc-8-branch) +@@ -1,3 +1,22 @@ ++2019-08-29 Jakub Jelinek ++ ++ Backported from mainline ++ 2019-05-10 Jakub Jelinek ++ ++ PR pch/90326 ++ * config-lang.in (gtfiles): Add c-family/c-format.c. ++ ++2019-08-28 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-18 Iain Sandoe ++ ++ * objc/objc-act.h (OCTI_INSTANCE_TYPE, OCTI_INSTANCETYPE_NAME): New. ++ (objc_global_trees): Add instance type and name. ++ (INSTANCE_TYPEDEF_NAME): New. ++ * objc/objc-act.c (synth_module_prologue): Build decls for ++ objc_instancetype_type and objc_instancetype_name. ++ + 2019-02-22 Release Manager + + * GCC 8.3.0 released. +Index: gcc/objc/config-lang.in +=================================================================== +--- a/src/gcc/objc/config-lang.in (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/objc/config-lang.in (.../branches/gcc-8-branch) +@@ -35,4 +35,4 @@ + # Order is important. If you change this list, make sure you test + # building without C++ as well; that is, remove the gcc/cp directory, + # and build with --enable-languages=c,objc. +-gtfiles="\$(srcdir)/objc/objc-map.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/objc/objc-act.h \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-runtime-shared-support.c \$(srcdir)/objc/objc-gnu-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-02.c \$(srcdir)/c/c-parser.h \$(srcdir)/c/c-parser.c \$(srcdir)/c/c-tree.h \$(srcdir)/c/c-decl.c \$(srcdir)/c/c-lang.h \$(srcdir)/c/c-objc-common.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c" ++gtfiles="\$(srcdir)/objc/objc-map.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/objc/objc-act.h \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-runtime-shared-support.c \$(srcdir)/objc/objc-gnu-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-02.c \$(srcdir)/c/c-parser.h \$(srcdir)/c/c-parser.c \$(srcdir)/c/c-tree.h \$(srcdir)/c/c-decl.c \$(srcdir)/c/c-lang.h \$(srcdir)/c/c-objc-common.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/c-family/c-format.c" +Index: gcc/objc/objc-act.c +=================================================================== +--- a/src/gcc/objc/objc-act.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/objc/objc-act.c (.../branches/gcc-8-branch) +@@ -2944,12 +2944,14 @@ + objc_class_reference = xref_tag (RECORD_TYPE, objc_class_id); + + objc_object_type = build_pointer_type (objc_object_reference); ++ objc_instancetype_type = build_pointer_type (objc_object_reference); + objc_class_type = build_pointer_type (objc_class_reference); + + objc_object_name = get_identifier (OBJECT_TYPEDEF_NAME); ++ objc_instancetype_name = get_identifier (INSTANCE_TYPEDEF_NAME); + objc_class_name = get_identifier (CLASS_TYPEDEF_NAME); + +- /* Declare the 'id' and 'Class' typedefs. */ ++ /* Declare the 'id', 'instancetype' and 'Class' typedefs. */ + type = lang_hooks.decls.pushdecl (build_decl (input_location, + TYPE_DECL, + objc_object_name, +@@ -2958,6 +2960,12 @@ + + type = lang_hooks.decls.pushdecl (build_decl (input_location, + TYPE_DECL, ++ objc_instancetype_name, ++ objc_instancetype_type)); ++ TREE_NO_WARNING (type) = 1; ++ ++ type = lang_hooks.decls.pushdecl (build_decl (input_location, ++ TYPE_DECL, + objc_class_name, + objc_class_type)); + TREE_NO_WARNING (type) = 1; +Index: gcc/objc/objc-act.h +=================================================================== +--- a/src/gcc/objc/objc-act.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/objc/objc-act.h (.../branches/gcc-8-branch) +@@ -313,6 +313,7 @@ + OCTI_SUPER_TYPE, + OCTI_SEL_TYPE, + OCTI_ID_TYPE, ++ OCTI_INSTANCE_TYPE, + OCTI_CLS_TYPE, + OCTI_NST_TYPE, + OCTI_PROTO_TYPE, +@@ -368,6 +369,7 @@ + OCTI_OBJ_ID, + OCTI_CLS_ID, + OCTI_ID_NAME, ++ OCTI_INSTANCETYPE_NAME, + OCTI_CLASS_NAME, + OCTI_CNST_STR_ID, + OCTI_CNST_STR_TYPE, +@@ -443,6 +445,7 @@ + #define objc_super_type objc_global_trees[OCTI_SUPER_TYPE] + #define objc_selector_type objc_global_trees[OCTI_SEL_TYPE] + #define objc_object_type objc_global_trees[OCTI_ID_TYPE] ++#define objc_instancetype_type objc_global_trees[OCTI_INSTANCE_TYPE] + #define objc_class_type objc_global_trees[OCTI_CLS_TYPE] + #define objc_instance_type objc_global_trees[OCTI_NST_TYPE] + #define objc_protocol_type objc_global_trees[OCTI_PROTO_TYPE] +@@ -570,7 +573,8 @@ + + #define objc_object_id objc_global_trees[OCTI_OBJ_ID] + #define objc_class_id objc_global_trees[OCTI_CLS_ID] +-#define objc_object_name objc_global_trees[OCTI_ID_NAME] ++#define objc_object_name objc_global_trees[OCTI_ID_NAME] ++#define objc_instancetype_name objc_global_trees[OCTI_INSTANCETYPE_NAME] + #define objc_class_name objc_global_trees[OCTI_CLASS_NAME] + + /* Constant string classes. */ +@@ -608,6 +612,7 @@ + /* Reserved tag definitions. */ + + #define OBJECT_TYPEDEF_NAME "id" ++#define INSTANCE_TYPEDEF_NAME "instancetype" + #define CLASS_TYPEDEF_NAME "Class" + + #define TAG_OBJECT "objc_object" Index: gcc/gcov.c =================================================================== --- a/src/gcc/gcov.c (.../tags/gcc_8_3_0_release) @@ -5778,119 +7401,810 @@ /* Set up the back-end if requested. */ if (!no_backend) backend_init (); +Index: gcc/tree-chrec.c +=================================================================== +--- a/src/gcc/tree-chrec.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-chrec.c (.../branches/gcc-8-branch) +@@ -979,10 +979,11 @@ + return false; + } + +-/* Determines whether the chrec contains symbolic names or not. */ ++/* Determines whether the chrec contains symbolic names or not. If LOOP isn't ++ NULL, we also consider chrec wrto outer loops of LOOP as symbol. */ + + bool +-chrec_contains_symbols (const_tree chrec) ++chrec_contains_symbols (const_tree chrec, struct loop *loop) + { + int i, n; + +@@ -999,9 +1000,14 @@ + || TREE_CODE (chrec) == FIELD_DECL) + return true; + ++ if (loop != NULL ++ && TREE_CODE (chrec) == POLYNOMIAL_CHREC ++ && flow_loop_nested_p (get_chrec_loop (chrec), loop)) ++ return true; ++ + n = TREE_OPERAND_LENGTH (chrec); + for (i = 0; i < n; i++) +- if (chrec_contains_symbols (TREE_OPERAND (chrec, i))) ++ if (chrec_contains_symbols (TREE_OPERAND (chrec, i), loop)) + return true; + return false; + } +Index: gcc/tree-chrec.h +=================================================================== +--- a/src/gcc/tree-chrec.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-chrec.h (.../branches/gcc-8-branch) +@@ -80,7 +80,7 @@ + /* Observers. */ + extern bool eq_evolutions_p (const_tree, const_tree); + extern bool is_multivariate_chrec (const_tree); +-extern bool chrec_contains_symbols (const_tree); ++extern bool chrec_contains_symbols (const_tree, struct loop * = NULL); + extern bool chrec_contains_symbols_defined_in_loop (const_tree, unsigned); + extern bool chrec_contains_undetermined (const_tree); + extern bool tree_contains_chrecs (const_tree, int *); +Index: gcc/tree-ssa-sccvn.c +=================================================================== +--- a/src/gcc/tree-ssa-sccvn.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-ssa-sccvn.c (.../branches/gcc-8-branch) +@@ -69,6 +69,7 @@ + #include "tree-cfgcleanup.h" + #include "tree-ssa-loop.h" + #include "tree-scalar-evolution.h" ++#include "builtins.h" + #include "tree-ssa-sccvn.h" + + /* This algorithm is based on the SCC algorithm presented by Keith +@@ -1857,23 +1858,11 @@ + /* If we reach a clobbering statement try to skip it and see if + we find a VN result with exactly the same value as the + possible clobber. In this case we can ignore the clobber +- and return the found value. +- Note that we don't need to worry about partial overlapping +- accesses as we then can use TBAA to disambiguate against the +- clobbering statement when looking up a load (thus the +- VN_WALKREWRITE guard). */ ++ and return the found value. */ + if (vn_walk_kind == VN_WALKREWRITE + && is_gimple_reg_type (TREE_TYPE (lhs)) + && types_compatible_p (TREE_TYPE (lhs), vr->type) +- /* The overlap restriction breaks down when either access +- alias-set is zero. Still for accesses of the size of +- an addressable unit there can be no overlaps. Overlaps +- between different union members are not an issue since +- activation of a union member via a store makes the +- values of untouched bytes unspecified. */ +- && (known_eq (ref->size, BITS_PER_UNIT) +- || (get_alias_set (lhs) != 0 +- && ao_ref_alias_set (ref) != 0))) ++ && ref->ref) + { + tree *saved_last_vuse_ptr = last_vuse_ptr; + /* Do not update last_vuse_ptr in vn_reference_lookup_2. */ +@@ -1891,7 +1880,14 @@ + vn_reference_t vnresult = (vn_reference_t) res; + if (vnresult->result + && operand_equal_p (vnresult->result, +- gimple_assign_rhs1 (def_stmt), 0)) ++ gimple_assign_rhs1 (def_stmt), 0) ++ /* We have to honor our promise about union type punning ++ and also support arbitrary overlaps with ++ -fno-strict-aliasing. So simply resort to alignment to ++ rule out overlaps. Do this check last because it is ++ quite expensive compared to the hash-lookup above. */ ++ && multiple_p (get_object_alignment (ref->ref), ref->size) ++ && multiple_p (get_object_alignment (lhs), ref->size)) + return res; + } + } +@@ -2031,9 +2027,20 @@ + tree rhs = gimple_assign_rhs1 (def_stmt); + if (TREE_CODE (rhs) == SSA_NAME) + rhs = SSA_VAL (rhs); +- len = native_encode_expr (gimple_assign_rhs1 (def_stmt), ++ unsigned pad = 0; ++ if (BYTES_BIG_ENDIAN ++ && is_a (TYPE_MODE (TREE_TYPE (rhs)))) ++ { ++ /* On big-endian the padding is at the 'front' so ++ just skip the initial bytes. */ ++ fixed_size_mode mode ++ = as_a (TYPE_MODE (TREE_TYPE (rhs))); ++ pad = GET_MODE_SIZE (mode) - size2 / BITS_PER_UNIT; ++ } ++ len = native_encode_expr (rhs, + buffer, sizeof (buffer), +- (offseti - offset2) / BITS_PER_UNIT); ++ ((offseti - offset2) / BITS_PER_UNIT ++ + pad)); + if (len > 0 && len * BITS_PER_UNIT >= maxsizei) + { + tree type = vr->type; +@@ -5207,6 +5214,57 @@ + auto_vec avail_stack; + }; + ++/* Return true if the reference operation REF may trap. */ ++ ++bool ++vn_reference_may_trap (vn_reference_t ref) ++{ ++ switch (ref->operands[0].opcode) ++ { ++ case MODIFY_EXPR: ++ case CALL_EXPR: ++ /* We do not handle calls. */ ++ case ADDR_EXPR: ++ /* And toplevel address computations never trap. */ ++ return false; ++ default:; ++ } ++ ++ vn_reference_op_t op; ++ unsigned i; ++ FOR_EACH_VEC_ELT (ref->operands, i, op) ++ { ++ switch (op->opcode) ++ { ++ case WITH_SIZE_EXPR: ++ case TARGET_MEM_REF: ++ /* Always variable. */ ++ return true; ++ case COMPONENT_REF: ++ if (op->op1 && TREE_CODE (op->op1) == SSA_NAME) ++ return true; ++ break; ++ case ARRAY_RANGE_REF: ++ case ARRAY_REF: ++ if (TREE_CODE (op->op0) == SSA_NAME) ++ return true; ++ break; ++ case MEM_REF: ++ /* Nothing interesting in itself, the base is separate. */ ++ break; ++ /* The following are the address bases. */ ++ case SSA_NAME: ++ return true; ++ case ADDR_EXPR: ++ if (op->op0) ++ return tree_could_trap_p (TREE_OPERAND (op->op0, 0)); ++ return false; ++ default:; ++ } ++ } ++ return false; ++} ++ + eliminate_dom_walker::eliminate_dom_walker (cdi_direction direction, + bitmap inserted_exprs_) + : dom_walker (direction), do_pre (inserted_exprs_ != NULL), +Index: gcc/tree-ssa-sccvn.h +=================================================================== +--- a/src/gcc/tree-ssa-sccvn.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-ssa-sccvn.h (.../branches/gcc-8-branch) +@@ -239,6 +239,7 @@ + bool vn_nary_op_eq (const_vn_nary_op_t const vno1, + const_vn_nary_op_t const vno2); + bool vn_nary_may_trap (vn_nary_op_t); ++bool vn_reference_may_trap (vn_reference_t); + bool vn_reference_eq (const_vn_reference_t const, const_vn_reference_t const); + unsigned int get_max_value_id (void); + unsigned int get_next_value_id (void); Index: gcc/ChangeLog =================================================================== --- a/src/gcc/ChangeLog (.../tags/gcc_8_3_0_release) +++ b/src/gcc/ChangeLog (.../branches/gcc-8-branch) -@@ -1,3 +1,1230 @@ -+2019-08-16 Iain Sandoe +@@ -1,3 +1,1727 @@ ++2019-09-09 Jakub Jelinek ++ ++ PR target/87853 ++ * config/i386/emmintrin.h (_mm_cmpeq_epi8): Use casts to __v16qi ++ instead of __v16qs. ++ ++ PR target/91704 ++ * config/i386/avxintrin.h (__v32qs): New typedef. ++ * config/i386/avx2intrin.h (_mm256_cmpgt_epi8): Use casts to __v32qs ++ instead of __v32qi. ++ ++2019-09-04 Wilco Dijkstra + + Backport from mainline -+ 2019-04-21 Iain Sandoe ++ 2019-08-13 Wilco Dijkstra ++ ++ PR target/81800 ++ * gcc/config/aarch64/aarch64.md (lrint): Disable lrint pattern if GPF ++ operand is larger than a long int. + -+ * config/rs6000/rs6000.md (group_end_nop): Emit insn register -+ names using operand format, rather than hard-wired. -+ (speculation_barrier): Likewise. ++2019-09-03 Iain Sandoe + -+2019-08-14 Iain Sandoe ++ Backport from mainline ++ 2019-08-23 Iain Sandoe ++ ++ PR pch/61250 ++ * ggc-page.c (ggc_pch_read): Read the ggc_pch_ondisk structure ++ and issue any diagnostics needed before collecting the pre-PCH ++ state. ++ ++2019-09-01 Eric Botcazou ++ ++ PR target/91472 ++ * config/sparc/sparc.c (sparc_cannot_force_const_mem): Return true ++ during LRA/reload in PIC mode if the PIC register hasn't been used yet. ++ (sparc_pic_register_p): Test reload_in_progress for consistency's sake. ++ ++2019-08-30 Richard Biener + + Backport from mainline -+ 2018-08-22 Iain Sandoe ++ 2019-06-21 Richard Biener + -+ * config/darwin.h (LINK_COMMAND_SPEC_A): Update lto options -+ to match gcc/gcc.c. ++ PR tree-optimization/90930 ++ * tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Set visited ++ flag on new stmts to avoid re-processing them. + -+2019-08-05 Kito Cheng ++ 2019-05-27 Richard Biener ++ ++ PR tree-optimization/90637 ++ * tree-ssa-sink.c (statement_sink_location): Honor the ++ computed sink location for single-uses. ++ ++2019-08-30 Richard Biener + + Backport from mainline -+ 2019-08-05 Kito Cheng ++ 2019-07-08 Richard Biener + -+ * config/riscv/riscv.c (riscv_promote_function_mode): New. -+ (TARGET_PROMOTE_FUNCTION_MODE): Use riscv_promote_function_mode. ++ PR tree-optimization/91108 ++ * tree-ssa-sccvn.c: Include builtins.h. ++ (vn_reference_lookup_3): Use only alignment constraints to ++ verify same-valued store disambiguation. + -+2019-08-04 Segher Boessenkool ++2019-08-30 Segher Boessenkool + + Backport from trunk -+ 2019-05-02 Segher Boessenkool ++ 2019-08-22 Segher Boessenkool + -+ * config/rs6000/rs6000.c (rs6000_dbx_register_number): Return the -+ correct numbers for TFHAR, TFIAR, TEXASR. ++ PR target/91481 ++ * config/rs6000/rs6000.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32, ++ and UNSPEC_DARN_RAW. ++ (unspecv): New enumerator values UNSPECV_DARN, UNSPECV_DARN_32, and ++ UNSPECV_DARN_RAW. ++ (darn_32): Use an unspec_volatile, and UNSPECV_DARN_32. ++ (darn_raw): Use an unspec_volatile, and UNSPECV_DARN_RAW. ++ (darn): Use an unspec_volatile, and UNSPECV_DARN. + -+2019-07-23 Matthew Beliveau -+ -+ Backported from mainline -+ 2019-07-16 Jeff Law -+ -+ PR rtl-optimization/91173 -+ * tree-ssa-address.c (addr_for_mem_ref): If the base is an -+ SSA_NAME with a constant value, fold its value into the offset -+ and clear the base before calling gen_addr_rtx. -+ * g++.dg/pr91173.C: New test. ++2019-08-30 Segher Boessenkool + -+2019-07-23 Richard Biener ++ Backport from trunk ++ 2019-08-22 Segher Boessenkool + -+ PR debug/91231 -+ * lto-streamer-in.c (input_function): Drop inline-entry markers -+ that ended up with an unknown location block. ++ * config/rs6000/altivec.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32, ++ UNSPEC_DARN_RAW, UNSPEC_CMPRB, UNSPEC_CMPRB2, UNSPEC_CMPEQB; move to... ++ * config/rs6000/rs6000.md (unspec): ... here. ++ * config/rs6000/altivec.md (darn_32, darn_raw, darn, cmprb, ++ *cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal, ++ cmpeqb, *cmpeqb_internal): Delete, move to... ++ * config/rs6000/rs6000.md (darn_32, darn_raw, darn, cmprb, ++ *cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal, ++ cmpeqb, *cmpeqb_internal): ... here. + -+2019-07-22 Martin Liska ++2019-08-30 Richard Biener + + Backport from mainline -+ 2019-07-22 Martin Liska ++ 2019-01-07 Richard Sandiford + -+ PR driver/91172 -+ * opts-common.c (decode_cmdline_option): Decode -+ argument of -Werror and check it for a wrong language. -+ * opts-global.c (complain_wrong_lang): Remove such case. ++ PR middle-end/88567 ++ * tree-vect-loop.c (get_initial_defs_for_reduction): Pass the ++ output vector directly to duplicate_and_interleave instead of ++ going through a temporary. Postpone insertion of ctor_seq to ++ the end of the loop. + -+2019-07-21 Richard Sandiford ++ 2018-12-04 Richard Biener ++ ++ PR tree-optimization/88315 ++ * tree-vect-loop.c (get_initial_defs_for_reduction): Simplify ++ and fix initialization vector for SAD and DOT_PROD SLP reductions. ++ ++2019-08-30 Richard Biener + + Backport from mainline -+ 2019-07-10 Richard Sandiford ++ 2019-06-18 Richard Biener + -+ * fold-const.c (fold_relational_const): Fix folding of -+ vector-to-scalar NE_EXPRs. -+ (test_vector_folding): Add more tests. ++ PR debug/90900 ++ * cfgexpand.c (expand_debug_expr): Treat NOTE_P DECL_RTL ++ as if optimized away. + -+2019-07-19 Jason Merrill ++ 2019-04-29 Richard Biener + -+ PR c++/82081 - tail call optimization breaks noexcept -+ * tree-tailcall.c (find_tail_calls): Don't turn a call from a -+ nothrow function to a might-throw function into a tail call. ++ PR tree-optimization/90278 ++ * tree-ssa-forwprop.c (pass_forwprop::execute): Transfer/clean ++ EH on comparison simplification. + -+2019-07-16 Wilco Dijkstra ++ 2019-04-25 Richard Biener + -+ Backport from mainline -+ PR target/89222 -+ * config/arm/arm.md (movsi): Use targetm.cannot_force_const_mem -+ to decide when to split off a non-zero offset from a symbol. -+ * config/arm/arm.c (arm_cannot_force_const_mem): Disallow offsets -+ in function symbols. ++ PR middle-end/90194 ++ * match.pd: Add pattern to simplify view-conversion of an ++ empty constructor. + -+2019-07-16 Wilco Dijkstra ++2019-08-30 Richard Biener + + Backport from mainline -+ 2019-02-13 Wilco Dijkstra -+ PR target/89190 -+ * config/arm/arm.c (ldm_stm_operation_p) Set -+ addr_reg_in_reglist correctly for first register. -+ (load_multiple_sequence): Remove dead base check. -+ (gen_ldm_seq): Correctly set write_back for Thumb-1. ++ 2019-08-12 Richard Biener + -+2019-07-15 Andreas Krebbel ++ PR lto/91375 ++ * tree.c (free_lang_data_in_type): Do not free TYPE_BINFO dependent on ++ flag_devirtualize. + -+ Backport from mainline -+ 2019-07-01 Andreas Krebbel ++ 2019-07-31 Richard Biener + -+ * config/s390/vector.md: Fix shift count operand printing. ++ PR tree-optimization/91293 ++ * tree-vect-slp.c (vect_build_slp_tree_2): Do not swap operands ++ of reduction stmts. + -+2019-07-15 Wilco Dijkstra ++ 2019-07-31 Richard Biener + -+ Backport from mainline -+ 2019-01-23 Bin Cheng -+ Steve Ellcey ++ PR tree-optimization/91280 ++ * tree-ssa-structalias.c (get_constraint_for_component_ref): ++ Decompose MEM_REF manually for offset handling. + -+ PR target/85711 ++ 2019-07-19 Richard Biener ++ ++ PR tree-optimization/91200 ++ * tree-ssa-phiopt.c (cond_store_replacement): Check we have ++ no PHI nodes in middle-bb. ++ ++ 2019-07-15 Richard Biener ++ ++ PR middle-end/91162 ++ * tree-cfg.c (move_block_to_fn): When releasing a virtual PHI ++ node make sure to replace all uses with something valid. ++ ++ 2019-07-11 Richard Biener ++ ++ PR middle-end/91131 ++ * gimplify.c (gimplify_compound_literal_expr): Force a temporary ++ when the object is volatile and we have not cleared it even though ++ there are no nonzero elements. ++ ++ 2019-07-10 Richard Biener ++ ++ PR tree-optimization/91126 ++ * tree-ssa-sccvn.c (vn_reference_lookup_3): Adjust ++ native encoding offset for BYTES_BIG_ENDIAN. ++ ++2019-08-30 Richard Biener ++ ++ * lto-streamer.h (LTO_minor_version): Bump. ++ ++ Backport from mainline ++ 2019-05-06 Richard Biener ++ ++ PR tree-optimization/90328 ++ * tree-data-ref.h (dr_may_alias_p): Pass in the actual loop nest. ++ * tree-data-ref.c (dr_may_alias_p): Check whether the clique ++ is valid in the loop nest before using it. ++ (initialize_data_dependence_relation): Adjust. ++ * graphite-scop-detection.c (build_alias_set): Pass the SCOP enclosing ++ loop as loop-nest to dr_may_alias_p. ++ ++ 2019-03-08 Richard Biener ++ ++ PR middle-end/89578 ++ * cfgloop.h (struct loop): Add owned_clique field. ++ * cfgloopmanip.c (copy_loop_info): Copy it. ++ * tree-cfg.c (gimple_duplicate_bb): Do not remap owned_clique ++ cliques. ++ * tree-inline.c (copy_loops): Remap owned_clique. ++ * lto-streamer-in.c (input_cfg): Stream owned_clique. ++ * lto-streamer-out.c (output_cfg): Likewise. ++ ++ 2019-02-22 Richard Biener ++ ++ PR tree-optimization/87609 ++ * tree-cfg.c (gimple_duplicate_bb): Only remap inlined cliques. ++ ++ 2019-02-22 Richard Biener ++ ++ PR middle-end/87609 ++ * cfghooks.h (dependence_hash): New typedef. ++ (struct copy_bb_data): New type. ++ (cfg_hooks::duplicate_block): Adjust to take a copy_bb_data argument. ++ (duplicate_block): Likewise. ++ * cfghooks.c (duplicate_block): Pass down copy_bb_data. ++ (copy_bbs): Create and pass down copy_bb_data. ++ * cfgrtl.c (cfg_layout_duplicate_bb): Adjust. ++ (rtl_duplicate_bb): Likewise. ++ * tree-cfg.c (gimple_duplicate_bb): If the copy_bb_data arg is not NULL ++ remap dependence info. ++ ++ 2019-02-22 Richard Biener ++ ++ PR tree-optimization/87609 ++ * tree-core.h (tree_base): Document special clique values. ++ * tree-inline.c (remap_dependence_clique): Do not use the ++ special clique value of one. ++ (maybe_set_dependence_info): Use clique one. ++ (clear_dependence_clique): New callback. ++ (compute_dependence_clique): Clear clique one from all refs ++ before assigning it (again). ++ ++2019-08-30 Bin Cheng ++ ++ Backport from mainline ++ 2019-07-18 Bin Cheng ++ ++ PR tree-optimization/91137 ++ * tree-ssa-loop-ivopts.c (struct ivopts_data): New field. ++ (tree_ssa_iv_optimize_init, alloc_iv, tree_ssa_iv_optimize_finalize): ++ Init, use and fini the above new field. ++ (determine_base_object_1): New function. ++ (determine_base_object): Reimplement using walk_tree. ++ ++2019-08-30 Richard Biener ++ ++ Backport from mainline ++ 2019-04-09 Richard Sandiford ++ ++ * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Always ++ use gimple_expr_type for load and store calls. Skip over the ++ condition argument in a conditional internal function. ++ Protect use of TREE_INT_CST_LOW. ++ ++ 2019-04-08 Richard Biener ++ ++ PR tree-optimization/90006 ++ * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Handle ++ calls like lrint. ++ ++ 2019-04-01 Bin Cheng ++ ++ PR tree-optimization/89725 ++ * tree-chrec.c (chrec_contains_symbols): New parameter. Handle outer ++ loop's chrec as invariant symbol. ++ * tree-chrec.h (chrec_contains_symbols): New parameter. ++ * tree-data-ref.c (analyze_miv_subscript): Pass new argument. ++ (build_classic_dist_vector_1, add_other_self_distances): Bypass access ++ function of loops not in DDR's loop_nest. ++ ++ 2019-03-26 Bin Cheng ++ ++ PR tree-optimization/81740 ++ * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): ++ In case of outer loop vectorization, check for backward dependence ++ at the inner loop if outer loop dependence is reversed. ++ ++2019-08-30 Richard Biener ++ ++ Backport from mainline ++ 2019-04-24 Richard Biener ++ ++ PR middle-end/90213 ++ * gimple-fold.c (fold_const_aggregate_ref_1): Do multiplication ++ by size and BITS_PER_UNIT on poly-wide-ints. ++ ++ 2019-04-11 Richard Biener ++ ++ PR tree-optimization/90020 ++ * tree-ssa-sccvn.c (vn_reference_may_trap): New function. ++ * tree-ssa-sccvn.h (vn_reference_may_trap): Declare. ++ * tree-ssa-pre.c (compute_avail): Use it to not put ++ possibly trapping references after a call that might not ++ return into EXP_GEN. ++ * gcse.c (compute_hash_table_work): Do not elide ++ marking a block containing a call if the call might not ++ return. ++ ++2019-08-29 Iain Sandoe ++ ++ Backport from mainline ++ 2019-07-24 Iain Sandoe ++ ++ PR bootstrap/87030 ++ * config/i386/darwin.h (REAL_LIBGCC_SPEC): Revert change from r273749. ++ ++ PR bootstrap/87030 ++ * config/i386/darwin.h (REAL_LIBGCC_SPEC): Move from here... ++ * config/i386/darwin32-biarch.h .. to here. ++ * config/i386/darwin64-biarch.h: Adjust comments. ++ * config/rs6000/darwin32-biarch.h: Likewise. ++ * config/rs6000/darwin64-biarch.h: Likewise. ++ * config.gcc: Missed commit from r273746 ++ (*-*-darwin*): Don't include CPU t-darwin here. ++ (i[34567]86-*-darwin*): Adjust to use biarch files. Produce ++ an error message if i686-darwin configuration is attempted for ++ Darwin >= 18. ++ ++ Backport from mainline ++ 2019-07-23 Iain Sandoe ++ ++ PR bootstrap/87030 ++ * config.gcc (*-*-darwin*): Don't include CPU t-darwin here. ++ (i[34567]86-*-darwin*): Adjust to use biarch files. Produce ++ an error message if i686-darwin configuration is attempted for ++ Darwin >= 18. ++ (x86_64-*-darwin*): Switch to single multilib for Darwin >= 18. ++ (powerpc-*-darwin*): Use biarch files where needed. ++ (powerpc64-*-darwin*): Likewise. ++ * config/i386/darwin.h (REAL_LIBGCC_SPEC): Move to new biarch file. ++ (DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single ++ arch case. ++ * config/i386/darwin32-biarch.h: New. ++ * config/i386/darwin64.h: Rename. ++ * gcc/config/i386/darwin64-biarch.h: To this. ++ * config/i386/t-darwin: Rename. ++ * gcc/config/i386/t-darwin32-biarch: To this. ++ * config/i386/t-darwin64: Rename. ++ * gcc/config/i386/t-darwin64-biarch: To this. ++ * config/rs6000/darwin32-biarch.h: New. ++ * config/rs6000/darwin64.h: Rename. ++ * config/rs6000/darwin64-biarch.h: To this. ++ (DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single ++ arch case. ++ * config/rs6000/t-darwin8: Rename. ++ * config/rs6000/t-darwin32-biarch: To this. ++ * config/rs6000/t-darwin64 Rename. ++ * config/rs6000/t-darwin64-biarch: To this. ++ ++2019-08-29 Jakub Jelinek ++ ++ Backported from mainline ++ 2019-07-30 Jakub Jelinek ++ ++ PR target/91150 ++ * config/i386/i386.c (expand_vec_perm_blend): Change mask type ++ from unsigned to unsigned HOST_WIDE_INT. For E_V64QImode cast ++ comparison to unsigned HOST_WIDE_INT before shifting it left. ++ ++ 2019-07-04 Jakub Jelinek ++ ++ PR middle-end/78884 ++ * gimplify.c (struct gimplify_omp_ctx): Add add_safelen1 member. ++ (gimplify_bind_expr): If seeing TREE_ADDRESSABLE VLA inside of simd ++ loop body, set ctx->add_safelen1 instead of making it GOVD_PRIVATE. ++ (gimplify_adjust_omp_clauses): Add safelen (1) clause if ++ ctx->add_safelen1 is set. ++ ++ PR rtl-optimization/90756 ++ * explow.c (promote_ssa_mode): Always use TYPE_MODE, don't bypass it ++ for VECTOR_TYPE_P. ++ ++ 2019-06-12 Jakub Jelinek ++ ++ PR c/90760 ++ * symtab.c (symtab_node::set_section): Allow being called on aliases ++ as long as they aren't analyzed yet. ++ ++ 2019-06-05 Jakub Jelinek ++ ++ PR debug/90733 ++ * var-tracking.c (vt_expand_loc_callback): Don't create raw subregs ++ with VOIDmode inner operands. ++ ++ 2019-04-19 Jakub Jelinek ++ ++ PR middle-end/90139 ++ * tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return ++ assign_temp instead of gen_reg_rtx. ++ ++2019-08-27 Iain Sandoe ++ ++ Backport from mainline ++ 2019-07-07 Iain Sandoe ++ ++ * config/darwin.c (darwin_override_options): Make a final check on PIC ++ options. ++ ++2019-08-27 Iain Sandoe ++ ++ Backport from mainline ++ 2019-07-07 Iain Sandoe ++ * config/darwin.c (darwin_override_options): Don't jam symbol stubs ++ on for kernel code. ++ ++2019-08-27 Iain Sandoe ++ ++ Backport from mainline ++ 2019-06-27 Iain Sandoe ++ ++ * config/rs6000/rs6000.c (darwin_rs6000_override_options): Do not ++ use longcall for 64b code. ++ ++2019-08-27 Iain Sandoe ++ ++ Backport from mainline ++ 2019-08-18 Iain Sandoe ++ ++ * config/rs6000/darwin.h (TARGET_OS_CPP_BUILTINS): Add asserts ++ for cpu and machine. Factor 64/32b builtins. ++ ++ Backport from mainline ++ 2019-06-23 Iain Sandoe ++ ++ * config/rs6000/darwin.h: (__PPC__, __PPC64__): New. ++ ++2019-08-25 Iain Sandoe ++ ++ Backport from mainline ++ 2019-06-19 Iain Sandoe ++ ++ * config/darwin-driver.c (darwin_driver_init): Fix off-by-one errors ++ in computing the number of options to be moved. ++ ++ Backport from mainline ++ 2019-06-13 Iain Sandoe ++ ++ * config/darwin-driver.c (validate_macosx_version_min): New. ++ (darwin_default_min_version): Cleanup and validate supplied version. ++ (darwin_driver_init): Likewise and push cleaned version into opts. ++ ++2019-08-25 Uroš Bizjak ++ ++ PR target/91533 ++ Backport from mainline ++ 2019-06-30 Uroš Bizjak ++ ++ * config/i386/sse.md (ssse3_abs2): Rename from abs2. ++ * config/i386/i386-builtin.def (__builtin_ia32_pabsb): ++ Use CODE_FOR_ssse3_absv8qi2. ++ (__builtin_ia32_pabsw): Use CODE_FOR_ssse3_absv4hi2. ++ (__builtin_ia32_pabsd): Use CODE_FOR_ssse3_absv2si2. ++ ++2019-08-23 Mihailo Stojanovic ++ ++ Backport from mainline ++ 2019-08-23 Mihailo Stojanovic ++ ++ * config/mips/mips.md (mips_get_fcsr, *mips_get_fcsr): Use SI ++ machine mode for unspec_volatile operand. ++ ++2019-08-22 Iain Sandoe ++ ++ Backport from mainline ++ 2018-12-23 Iain Sandoe ++ ++ * config/i386/darwin.h (TARGET_ASM_OUTPUT_IDENT): New. ++ ++2019-08-22 Iain Sandoe ++ ++ Backport from mainline ++ 2019-05-31 Iain Sandoe ++ ++ * config/i386/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN): New. ++ ++2019-08-22 Iain Sandoe ++ ++ Backport from mainline ++ 2019-05-18 Iain Sandoe ++ ++ * config/darwin-c.c (darwin_register_objc_includes): Do not ++ prepend the sysroot when building gnu-runtime header search ++ paths. ++ ++2019-08-22 Iain Sandoe ++ ++ Backport from mainline ++ 2019-05-18 Iain Sandoe ++ ++ * config/darwin.c (darwin_file_end): Use switch_to_section () ++ instead of direct output of the asm. ++ ++2019-08-20 Eric Botcazou ++ ++ PR rtl-optimization/91347 ++ * dse.c (scan_insn): Call add_wild_read for non-const/memset tail calls ++ before reload if HARD_FRAME_POINTER_IS_ARG_POINTER. ++ ++2019-08-16 Iain Sandoe ++ ++ Backport from mainline ++ 2019-04-21 Iain Sandoe ++ ++ * config/rs6000/rs6000.md (group_end_nop): Emit insn register ++ names using operand format, rather than hard-wired. ++ (speculation_barrier): Likewise. ++ ++2019-08-14 Iain Sandoe ++ ++ Backport from mainline ++ 2018-08-22 Iain Sandoe ++ ++ * config/darwin.h (LINK_COMMAND_SPEC_A): Update lto options ++ to match gcc/gcc.c. ++ ++2019-08-05 Kito Cheng ++ ++ Backport from mainline ++ 2019-08-05 Kito Cheng ++ ++ * config/riscv/riscv.c (riscv_promote_function_mode): New. ++ (TARGET_PROMOTE_FUNCTION_MODE): Use riscv_promote_function_mode. ++ ++2019-08-04 Segher Boessenkool ++ ++ Backport from trunk ++ 2019-05-02 Segher Boessenkool ++ ++ * config/rs6000/rs6000.c (rs6000_dbx_register_number): Return the ++ correct numbers for TFHAR, TFIAR, TEXASR. ++ ++2019-07-23 Matthew Beliveau ++ ++ Backported from mainline ++ 2019-07-16 Jeff Law ++ ++ PR rtl-optimization/91173 ++ * tree-ssa-address.c (addr_for_mem_ref): If the base is an ++ SSA_NAME with a constant value, fold its value into the offset ++ and clear the base before calling gen_addr_rtx. ++ * g++.dg/pr91173.C: New test. ++ ++2019-07-23 Richard Biener ++ ++ PR debug/91231 ++ * lto-streamer-in.c (input_function): Drop inline-entry markers ++ that ended up with an unknown location block. ++ ++2019-07-22 Martin Liska ++ ++ Backport from mainline ++ 2019-07-22 Martin Liska ++ ++ PR driver/91172 ++ * opts-common.c (decode_cmdline_option): Decode ++ argument of -Werror and check it for a wrong language. ++ * opts-global.c (complain_wrong_lang): Remove such case. ++ ++2019-07-21 Richard Sandiford ++ ++ Backport from mainline ++ 2019-07-10 Richard Sandiford ++ ++ * fold-const.c (fold_relational_const): Fix folding of ++ vector-to-scalar NE_EXPRs. ++ (test_vector_folding): Add more tests. ++ ++2019-07-19 Jason Merrill ++ ++ PR c++/82081 - tail call optimization breaks noexcept ++ * tree-tailcall.c (find_tail_calls): Don't turn a call from a ++ nothrow function to a might-throw function into a tail call. ++ ++2019-07-16 Wilco Dijkstra ++ ++ Backport from mainline ++ PR target/89222 ++ * config/arm/arm.md (movsi): Use targetm.cannot_force_const_mem ++ to decide when to split off a non-zero offset from a symbol. ++ * config/arm/arm.c (arm_cannot_force_const_mem): Disallow offsets ++ in function symbols. ++ ++2019-07-16 Wilco Dijkstra ++ ++ Backport from mainline ++ 2019-02-13 Wilco Dijkstra ++ PR target/89190 ++ * config/arm/arm.c (ldm_stm_operation_p) Set ++ addr_reg_in_reglist correctly for first register. ++ (load_multiple_sequence): Remove dead base check. ++ (gen_ldm_seq): Correctly set write_back for Thumb-1. ++ ++2019-07-15 Andreas Krebbel ++ ++ Backport from mainline ++ 2019-07-01 Andreas Krebbel ++ ++ * config/s390/vector.md: Fix shift count operand printing. ++ ++2019-07-15 Wilco Dijkstra ++ ++ Backport from mainline ++ 2019-01-23 Bin Cheng ++ Steve Ellcey ++ ++ PR target/85711 + * recog.c (address_operand): Return false on wrong mode for address. + (constrain_operands): Check for mode with 'p' constraint. + @@ -6049,7 +8363,7 @@ + +2019-05-23 Uroš Bizjak + -+ Backported from mainline ++ Backport from mainline + 2019-05-21 Uroš Bizjak + + * config/i386/cpuid.h (__cpuid): For 32bit targets, zero @@ -6259,7 +8573,7 @@ + in cfglayout mode, use emit_barrier_after_bb. + + 2019-04-11 Jakub Jelinek -+ ++ + PR rtl-optimization/89965 + * dce.c (sp_based_mem_offset): New function. + (find_call_stack_args): Use sp_based_mem_offset. @@ -7013,7 +9327,7 @@ 2019-02-22 Release Manager * GCC 8.3.0 released. -@@ -568,7 +1799,7 @@ +@@ -568,7 +2296,7 @@ Backport from mainline 2018-11-20 Richard Biener @@ -7462,6 +9776,41 @@ + + return 0; +} +Index: gcc/testsuite/gcc.target/powerpc/pr80125.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/pr80125.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/pr80125.c (.../branches/gcc-8-branch) +@@ -16,7 +16,7 @@ + vector int k = vec_mergel (i, j); + vector int l = vec_sl (k, c); + vector int m = vec_sl (l, d); +- vector char o; ++ vector unsigned char o; + vector int p = vec_perm (m, n, o); + e = vec_sra (p, c); + vec_st (e, 0, a); +Index: gcc/testsuite/gcc.target/powerpc/darn-3.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/darn-3.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/darn-3.c (.../branches/gcc-8-branch) +@@ -0,0 +1,17 @@ ++/* { dg-do compile { target { powerpc*-*-* } } } */ ++/* { dg-skip-if "" { powerpc*-*-aix* } } */ ++/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ ++/* { dg-options "-O2 -mcpu=power9" } */ ++ ++static int darn32(void) { return __builtin_darn_32(); } ++ ++int four(void) ++{ ++ int sum = 0; ++ int i; ++ for (i = 0; i < 4; i++) ++ sum += darn32(); ++ return sum; ++} ++ ++/* { dg-final { scan-assembler-times {(?n)\mdarn .*,0\M} 4 } } */ Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-20a.c =================================================================== --- a/src/gcc/testsuite/gcc.target/powerpc/vsx-builtin-20a.c (.../tags/gcc_8_3_0_release) @@ -7896,6 +10245,17 @@ + + return 0; +} +Index: gcc/testsuite/gcc.target/powerpc/builtins-2.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/builtins-2.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/builtins-2.c (.../branches/gcc-8-branch) +@@ -1,5 +1,6 @@ + /* { dg-do run { target { powerpc*-*-* } } } */ + /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ ++/* { dg-require-effective-target vsx_hw } */ + /* { dg-options "-mcpu=power8 " } */ + + #include Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-9b.c =================================================================== --- a/src/gcc/testsuite/gcc.target/powerpc/vsx-builtin-9b.c (.../tags/gcc_8_3_0_release) @@ -8179,6 +10539,16 @@ + + return 0; +} +Index: gcc/testsuite/gcc.target/powerpc/pr64205.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/pr64205.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/pr64205.c (.../branches/gcc-8-branch) +@@ -1,4 +1,5 @@ + /* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */ ++/* { dg-require-effective-target dfp } */ + /* { dg-skip-if "" { powerpc*-*-aix* } } */ + /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=G5" } } */ + /* { dg-options "-O2 -mcpu=G5 -maltivec" } */ Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-20c.c =================================================================== --- a/src/gcc/testsuite/gcc.target/powerpc/vsx-builtin-20c.c (.../tags/gcc_8_3_0_release) @@ -8453,6 +10823,23 @@ + + return 0; +} +Index: gcc/testsuite/gcc.target/powerpc/pr71785.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/pr71785.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/pr71785.c (.../branches/gcc-8-branch) +@@ -1,6 +1,11 @@ + /* { dg-do compile { target { powerpc*-*-* } } } */ + /* { dg-options "-O2" } */ +-/* { dg-final { scan-assembler-not {\mb\M} } } */ ++/* We have to lose the default pic codegen on Darwin. */ ++/* { dg-additional-options "-mdynamic-no-pic" { target powerpc*-*-darwin* } } */ ++/* ... and account for the out-of-line GPR restore. */ ++/* { dg-final { scan-assembler-times {\mb[ \t]*restGPR} 1 { target powerpc*-*-darwin* } } } */ ++/* { dg-final { scan-assembler-not {\mb[ \t]L} { target powerpc*-*-darwin* } } } */ ++/* { dg-final { scan-assembler-not {\mb\M} { target { ! powerpc*-*-darwin* } } } } */ + + /* Check that all computed gotos in this testcase end up unfactored completely. + If some is not there will be a unconditional jump left; if all works fine, Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-9d.c =================================================================== --- a/src/gcc/testsuite/gcc.target/powerpc/vsx-builtin-9d.c (.../tags/gcc_8_3_0_release) @@ -9292,6 +11679,17 @@ + + return 0; +} +Index: gcc/testsuite/gcc.target/powerpc/bmi2-bzhi64-1a.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/bmi2-bzhi64-1a.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/bmi2-bzhi64-1a.c (.../branches/gcc-8-branch) +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O3" } */ ++/* { dg-options "-O3 -maltivec -mvsx" } */ + /* { dg-require-effective-target lp64 } */ + + #define NO_WARN_X86_INTRINSICS 1 Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-15b.c =================================================================== --- a/src/gcc/testsuite/gcc.target/powerpc/vsx-builtin-15b.c (.../tags/gcc_8_3_0_release) @@ -10904,6 +13302,16 @@ + + return 0; +} +Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c (.../branches/gcc-8-branch) +@@ -1,4 +1,5 @@ + /* { dg-do compile } */ ++/* { dg-skip-if "not implemented for Darwin" { powerpc*-*-darwin* } } */ + /* { dg-additional-options "-mno-speculate-indirect-jumps" } */ + /* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */ + Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-19b.c =================================================================== --- a/src/gcc/testsuite/gcc.target/powerpc/vsx-builtin-19b.c (.../tags/gcc_8_3_0_release) @@ -12472,6 +14880,16 @@ + + return 0; +} +Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-7.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-7.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-7.c (.../branches/gcc-8-branch) +@@ -1,4 +1,5 @@ + /* { dg-do compile } */ ++/* { dg-skip-if "not implemented for Darwin" { powerpc*-*-darwin* } } */ + /* { dg-additional-options "-mno-speculate-indirect-jumps" } */ + /* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */ + Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-13a.c =================================================================== --- a/src/gcc/testsuite/gcc.target/powerpc/vsx-builtin-13a.c (.../tags/gcc_8_3_0_release) @@ -12601,6 +15019,18 @@ + + return 0; +} +Index: gcc/testsuite/gcc.target/powerpc/pr79909.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/pr79909.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/pr79909.c (.../branches/gcc-8-branch) +@@ -1,6 +1,7 @@ + /* PR rtl-optimization/79909 */ + /* { dg-do compile } */ + /* { dg-options "-O2 -mxl-compat" } */ ++/* { dg-require-effective-target dfp } */ + /* { dg-skip-if "DFP" { powerpc*-*-aix* } } */ + + typedef float T __attribute__ ((mode (TD))); Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-20d.c =================================================================== --- a/src/gcc/testsuite/gcc.target/powerpc/vsx-builtin-20d.c (.../tags/gcc_8_3_0_release) @@ -13089,6 +15519,17 @@ + + return 0; +} +Index: gcc/testsuite/gcc.target/powerpc/stabs-attrib-vect-darwin.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/stabs-attrib-vect-darwin.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/stabs-attrib-vect-darwin.c (.../branches/gcc-8-branch) +@@ -1,5 +1,6 @@ + /* Test Attribute Vector associated with vector type stabs. */ + /* { dg-do compile { target powerpc*-*-darwin* } } */ ++/* { dg-require-effective-target stabs } */ + /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types -faltivec" } */ + + int main () Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-15a.c =================================================================== --- a/src/gcc/testsuite/gcc.target/powerpc/vsx-builtin-15a.c (.../tags/gcc_8_3_0_release) @@ -14201,6 +16642,16 @@ + + return 0; +} +Index: gcc/testsuite/gcc.target/powerpc/spec-barr-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/spec-barr-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/spec-barr-1.c (.../branches/gcc-8-branch) +@@ -7,4 +7,4 @@ + __builtin_ppc_speculation_barrier (); + } + +-/* { dg-final { scan-assembler "ori 31,31,0" } } */ ++/* { dg-final { scan-assembler {ori\s+r?31,r?31,r?0} } } */ Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-16d.c =================================================================== --- a/src/gcc/testsuite/gcc.target/powerpc/vsx-builtin-16d.c (.../tags/gcc_8_3_0_release) @@ -15136,6 +17587,19 @@ + + return 0; +} +Index: gcc/testsuite/gcc.target/powerpc/darwin-bool-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/powerpc/darwin-bool-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/powerpc/darwin-bool-1.c (.../branches/gcc-8-branch) +@@ -1,6 +1,8 @@ + /* Check that sizeof(bool) is 4 if we don't use special options. */ + /* Matt Austern */ + /* { dg-do run { target { powerpc*-*-darwin* && ilp32 } } } */ ++/* We do need to suppress the ISO C doesn't support _Bool message tho. */ ++/* { dg-options "-Wno-pedantic" } */ + + int dummy1[sizeof(_Bool) - 3]; + int dummy2[5 - sizeof(_Bool)]; Index: gcc/testsuite/gcc.target/powerpc/vsx-builtin-19a.c =================================================================== --- a/src/gcc/testsuite/gcc.target/powerpc/vsx-builtin-19a.c (.../tags/gcc_8_3_0_release) @@ -15860,6 +18324,20 @@ +} +/* { dg-final { scan-assembler "fmsub\\\.d\t\\\$w28,\\\$w29,\\\$w29" } } */ + +Index: gcc/testsuite/gcc.target/mips/get-fcsr-3.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/mips/get-fcsr-3.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/mips/get-fcsr-3.c (.../branches/gcc-8-branch) +@@ -0,0 +1,9 @@ ++/* { dg-options "-mabi=64 -mhard-float" } */ ++ ++NOMIPS16 unsigned int ++foo (void) ++{ ++ return __builtin_mips_get_fcsr () & 0x1; ++} ++ ++/* { dg-final { scan-assembler "cfc1" } } */ Index: gcc/testsuite/gcc.target/mips/dwarfregtable-1.c =================================================================== --- a/src/gcc/testsuite/gcc.target/mips/dwarfregtable-1.c (.../tags/gcc_8_3_0_release) @@ -15984,6 +18462,28 @@ +/* { dg-final { scan-assembler-times {\.arch armv8\.2\-a\+crc} 1 } } */ + +/* Check to see if crc is output by default. */ +Index: gcc/testsuite/gcc.target/aarch64/no-inline-lrint_3.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/aarch64/no-inline-lrint_3.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/aarch64/no-inline-lrint_3.c (.../branches/gcc-8-branch) +@@ -0,0 +1,17 @@ ++/* { dg-do compile } */ ++/* { dg-require-effective-target ilp32 } */ ++/* { dg-options "-O3 -fno-math-errno -fno-fp-int-builtin-inexact" } */ ++ ++#define TEST(name, float_type, int_type, fn) void f_##name (float_type x) \ ++{ \ ++ volatile int_type b = __builtin_##fn (x); \ ++} ++ ++TEST (dld, double, long, lrint) ++TEST (flf, float , long, lrintf) ++ ++TEST (did, double, int, lrint) ++TEST (fif, float , int, lrintf) ++ ++/* { dg-final { scan-assembler-times "fcvtzs\tw\[0-9\]+, \[d,s\]\[0-9\]+" 2 } } */ ++/* { dg-final { scan-assembler-times "bl\tlrint" 2 } } */ Index: gcc/testsuite/gcc.target/aarch64/options_set_2.c =================================================================== --- a/src/gcc/testsuite/gcc.target/aarch64/options_set_2.c (.../tags/gcc_8_3_0_release) @@ -16238,6 +18738,18 @@ +{ + x = _mm_i32gather_pd ((void *) 0, idx, 1); +} +Index: gcc/testsuite/gcc.target/i386/pr66819-4.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr66819-4.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr66819-4.c (.../branches/gcc-8-branch) +@@ -1,6 +1,6 @@ + /* { dg-do compile { target ia32 } } */ + /* { dg-options "-O2 -mregparm=3" } */ +-/* { dg-final { scan-assembler-not "call" } } */ ++/* { dg-final { scan-assembler-not {call[ \t]+_?bar} } } */ + + #include + Index: gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c (.../tags/gcc_8_3_0_release) @@ -16267,6 +18779,26 @@ -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ +Index: gcc/testsuite/gcc.target/i386/pr32219-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr32219-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr32219-1.c (.../branches/gcc-8-branch) +@@ -12,7 +12,11 @@ + return xxx; + } + +-/* { dg-final { scan-assembler "movl\[ \t\]xxx\\(%rip\\), %eax" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler-not "xxx@GOTPCREL" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %eax" { target ia32 } } } */ +-/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %eax" { target ia32 } } } */ ++/* { dg-final { scan-assembler {movl[ \t]_?xxx\(%rip\),[ \t]%eax} { target { ! ia32 } } } } */ ++/* { dg-final { scan-assembler-not "_?xxx@GOTPCREL" { target { ! ia32 } } } } */ ++ ++/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %eax" { target { ia32 && { ! *-*-darwin* } } } } } */ ++/* { dg-final { scan-assembler-not "movl\[ \t\]_?xxx@GOT\\(%\[^,\]*\\), %eax" { target { ia32 && { ! *-*-darwin* } } } } } */ ++ ++/* For Darwin, we default to PIC - but that's needed for Darwin's PIE. */ ++/* { dg-final { scan-assembler {movl[ \t]_xxx-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ Index: gcc/testsuite/gcc.target/i386/indirect-thunk-1.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c (.../tags/gcc_8_3_0_release) @@ -16375,6 +18907,18 @@ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "_?__x86_indirect_thunk_(r|e)ax:" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ +Index: gcc/testsuite/gcc.target/i386/wbnoinvd-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/wbnoinvd-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/wbnoinvd-1.c (.../branches/gcc-8-branch) +@@ -1,6 +1,6 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -mwbnoinvd" } */ +-/* { dg-final { scan-assembler-times "wbnoinvd" 2 } } */ ++/* { dg-final { scan-assembler-times {\twbnoinvd} 1 } } */ + + #include "x86intrin.h" + Index: gcc/testsuite/gcc.target/i386/pr55049-1.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/pr55049-1.c (.../tags/gcc_8_3_0_release) @@ -16396,6 +18940,28 @@ /* { dg-options "-O2 -mx32 -maddress-mode=long -ftree-vectorize" } */ struct s2{ +Index: gcc/testsuite/gcc.target/i386/stack-prot-sym.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/stack-prot-sym.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/stack-prot-sym.c (.../branches/gcc-8-branch) +@@ -1,4 +1,5 @@ + /* { dg-do compile } */ ++/* { dg-require-effective-target tls_native } */ + /* { dg-options "-O2 -fstack-protector-all -mstack-protector-guard=tls -mstack-protector-guard-reg=gs -mstack-protector-guard-symbol=my_guard" } */ + + void f(void) { } +Index: gcc/testsuite/gcc.target/i386/pconfig-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pconfig-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pconfig-1.c (.../branches/gcc-8-branch) +@@ -1,6 +1,6 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -mpconfig" } */ +-/* { dg-final { scan-assembler-times "pconfig" 5 } } */ ++/* { dg-final { scan-assembler-times {\tpconfig} 2 } } */ + + #include + Index: gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c (.../tags/gcc_8_3_0_release) @@ -16424,6 +18990,20 @@ +/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */ /* { dg-final { scan-assembler {\tpause} } } */ /* { dg-final { scan-assembler {\tlfence} } } */ +Index: gcc/testsuite/gcc.target/i386/pr59874-3.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr59874-3.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr59874-3.c (.../branches/gcc-8-branch) +@@ -1,7 +1,8 @@ + /* PR target/59874 */ + /* { dg-do compile } */ + /* { dg-options "-O2 -mpopcnt -masm=att" } */ +-/* { dg-final { scan-assembler "popcntw" } } */ ++/* { dg-final { scan-assembler "\tpopcntw" { target { ! *-*-darwin* } } } } */ ++/* { dg-final { scan-assembler "\tpopcnt" { target *-*-darwin* } } } */ + + unsigned int + foo (unsigned short x) Index: gcc/testsuite/gcc.target/i386/ret-thunk-25.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/ret-thunk-25.c (.../tags/gcc_8_3_0_release) @@ -16435,6 +19015,25 @@ /* { dg-options "-O2 -mfunction-return=thunk -fcheck-pointer-bounds -mmpx -fno-pic" } */ struct s { _Complex unsigned short x; }; +Index: gcc/testsuite/gcc.target/i386/pr91704.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr91704.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr91704.c (.../branches/gcc-8-branch) +@@ -0,0 +1,14 @@ ++/* PR target/91704 */ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -funsigned-char -mavx2 -mavx512f -masm=att" } */ ++/* { dg-final { scan-assembler-times "\tvpcmpgtb\t%ymm" 1 } } */ ++/* { dg-final { scan-assembler-not "\tvpsubusb\t" } } */ ++/* { dg-final { scan-assembler-not "\tvpcmpeqb\t" } } */ ++ ++#include ++ ++__m256i ++foo (__m256i x, __m256i y) ++{ ++ return _mm256_cmpgt_epi8 (x, y); ++} Index: gcc/testsuite/gcc.target/i386/ret-thunk-9.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/ret-thunk-9.c (.../tags/gcc_8_3_0_release) @@ -16468,6 +19067,39 @@ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ +/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ +Index: gcc/testsuite/gcc.target/i386/pr63538.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr63538.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr63538.c (.../branches/gcc-8-branch) +@@ -9,5 +9,5 @@ + { + return str; + } +- +-/* { dg-final { scan-assembler "movabs" } } */ ++/* See PR90698 re. Darwin xfail. */ ++/* { dg-final { scan-assembler "movabs" { xfail { *-*-darwin* } } } } */ +Index: gcc/testsuite/gcc.target/i386/pr49866.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr49866.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr49866.c (.../branches/gcc-8-branch) +@@ -1,5 +1,6 @@ + /* PR target/49866 */ + /* { dg-do assemble { target lp64 } } */ ++/* { dg-xfail-if "PR90698" { *-*-darwin* } } */ + /* { dg-options "-O2 -mcmodel=large" } */ + + void fn (void *, int, int); +Index: gcc/testsuite/gcc.target/i386/pr67985-2.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr67985-2.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr67985-2.c (.../branches/gcc-8-branch) +@@ -10,4 +10,4 @@ + + /* { dg-final { scan-assembler-not "mulss" } } */ + /* { dg-final { scan-assembler-not "movl\[ \t\].*, %eax" } } */ +-/* { dg-final { scan-assembler "call\[ \t\]__mulsf3" } } */ ++/* { dg-final { scan-assembler "call\[ \t\]_?__mulsf3" } } */ Index: gcc/testsuite/gcc.target/i386/pr89523-5.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/pr89523-5.c (.../tags/gcc_8_3_0_release) @@ -16541,6 +19173,26 @@ -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ +Index: gcc/testsuite/gcc.target/i386/pr32219-2.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr32219-2.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr32219-2.c (.../branches/gcc-8-branch) +@@ -12,6 +12,13 @@ + } + + /* { dg-final { scan-assembler-not "movl\[ \t\]xxx\\(%rip\\), %" { target { ! ia32 } } } } */ ++/* For Darwin m64 we are always PIC, but common symbols are indirected, which happens to ++ match the general "ELF" case. */ + /* { dg-final { scan-assembler "xxx@GOTPCREL" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %" { target ia32 } } } */ +-/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target ia32 } } } */ ++ ++/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */ ++/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */ ++ ++/* Darwin m32 defaults to PIC but common symbols need to be indirected. */ ++/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ ++ Index: gcc/testsuite/gcc.target/i386/indirect-thunk-2.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c (.../tags/gcc_8_3_0_release) @@ -16680,6 +19332,22 @@ #include #include +Index: gcc/testsuite/gcc.target/i386/pr39013-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr39013-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr39013-1.c (.../branches/gcc-8-branch) +@@ -12,5 +12,9 @@ + return foo () + bar (); + } + +-/* { dg-final { scan-assembler "foo@PLT" } } */ +-/* { dg-final { scan-assembler "bar@PLT" } } */ ++/* { dg-final { scan-assembler "foo@PLT" { target { ! *-*-darwin* } } } } */ ++/* { dg-final { scan-assembler "bar@PLT" { target { ! *-*-darwin* } } } } */ ++ ++/* Darwin's dynamic linker does PIE without indirection. */ ++/* { dg-final { scan-assembler {call[ \t]_foo} { target *-*-darwin* } } } */ ++/* { dg-final { scan-assembler {call[ \t]_bar} { target *-*-darwin* } } } */ Index: gcc/testsuite/gcc.target/i386/pr89848.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/pr89848.c (.../tags/gcc_8_3_0_release) @@ -16750,6 +19418,30 @@ + } + } +} +Index: gcc/testsuite/gcc.target/i386/pr91131.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr91131.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr91131.c (.../branches/gcc-8-branch) +@@ -0,0 +1,19 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O" } */ ++ ++struct Reg_T { ++ unsigned int a : 3; ++ unsigned int b : 1; ++ unsigned int c : 4; ++}; ++ ++volatile struct Reg_T Reg_A; ++ ++int ++main () ++{ ++ Reg_A = (struct Reg_T){ .a = 0, .b = 0, .c = 0 }; ++ return 0; ++} ++ ++/* { dg-final { scan-assembler-times "mov\[^\r\n\]*Reg_A" 1 } } */ Index: gcc/testsuite/gcc.target/i386/pr89523-6.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/pr89523-6.c (.../tags/gcc_8_3_0_release) @@ -16793,6 +19485,31 @@ + _mm512_prefetch_i32gather_pd (idx, (void *) 0, 8, 3); + _mm512_mask_prefetch_i32gather_pd (idx, m8, (void *) 0, 8, 3); +} +Index: gcc/testsuite/gcc.target/i386/pr32219-3.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr32219-3.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr32219-3.c (.../branches/gcc-8-branch) +@@ -12,7 +12,16 @@ + return xxx; + } + +-/* { dg-final { scan-assembler "movl\[ \t\]xxx\\(%rip\\), %eax" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler-not "xxx@GOTPCREL" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %eax" { target ia32 } } } */ +-/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %eax" { target ia32 } } } */ ++/* { dg-final { scan-assembler {movl[ \t]xxx\(%rip\),[ \t]%eax} { target { { ! ia32 } && { ! *-*-darwin* } } } } } */ ++/* { dg-final { scan-assembler-not "xxx@GOTPCREL" { target { { ! ia32 } && { ! *-*-darwin* } } } } } */ ++ ++/* For Darwin m64, code is always PIC and we need to indirect through the GOT to allow ++ weak symbols to be interposed. The dynamic loader knows how to apply PIE to this. */ ++/* { dg-final { scan-assembler {movq[ \t]_xxx@GOTPCREL\(%rip\),[ \t]%rax} { target { { ! ia32 } && *-*-darwin* } } } } */ ++ ++/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %eax" { target { ia32 && { ! *-*-darwin* } } } } } */ ++/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %eax" { target { ia32 && { ! *-*-darwin* } } } } } */ ++ ++/* For Darwin, we need PIC to allow PIE, but also we must indirect weak symbols so that ++ they can be indirected. Again, dyld knows how to deal with this. */ ++/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ Index: gcc/testsuite/gcc.target/i386/indirect-thunk-3.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c (.../tags/gcc_8_3_0_release) @@ -16940,6 +19657,22 @@ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not "call\[ \t\]*\.?LIND" } } */ +Index: gcc/testsuite/gcc.target/i386/pr39013-2.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr39013-2.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr39013-2.c (.../branches/gcc-8-branch) +@@ -12,5 +12,9 @@ + return foo () + bar (); + } + +-/* { dg-final { scan-assembler "foo@PLT" } } */ +-/* { dg-final { scan-assembler "bar@PLT" } } */ ++/* { dg-final { scan-assembler "foo@PLT" { target { ! *-*-darwin* } } } } */ ++/* { dg-final { scan-assembler "bar@PLT" { target { ! *-*-darwin* } } } } */ ++ ++/* Darwin's dynamic linker does PIE without indirection. */ ++/* { dg-final { scan-assembler {call[ \t]_foo} { target *-*-darwin* } } } */ ++/* { dg-final { scan-assembler {call[ \t]_bar} { target *-*-darwin* } } } */ Index: gcc/testsuite/gcc.target/i386/pr89965.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/pr89965.c (.../tags/gcc_8_3_0_release) @@ -17012,6 +19745,70 @@ /* { dg-final { scan-assembler {\tlfence} } } */ -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ +Index: gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c (.../branches/gcc-8-branch) +@@ -18,14 +18,12 @@ + return y + bar (y); + } + +-/* For !nonpic && ia32 xfails, see PR64895. */ +- + /* Check that no registers are saved/restored. */ +-/* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */ +-/* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */ ++/* { dg-final { scan-assembler-not "push" } } */ ++/* { dg-final { scan-assembler-not "pop" } } */ + + /* Check that addition uses dx. */ +-/* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */ ++/* { dg-final { scan-assembler-times "addl\t%\[re\]?dx, %\[re\]?ax" 1 } } */ + + /* Verify that bar is self-recursive. */ + /* { dg-final { scan-assembler-times "call\t_?bar" 2 } } */ +Index: gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c (.../branches/gcc-8-branch) +@@ -15,14 +15,20 @@ + return y + bar (y); + } + +-/* For !nonpic && ia32 xfails, see PR64895. */ +- + /* Check presence of all insns on xmm registers. These checks are expected to + pass with both -fipa-ra and -fno-ipa-ra. */ +-/* { dg-final { scan-assembler-times "addpd\t\\.?LC0.*, %xmm0" 1 } } */ +-/* { dg-final { scan-assembler-times "addpd\t%xmm1, %xmm0" 1 { xfail { { ! nonpic } && ia32 } } } } */ +-/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm1" 1 { xfail { { ! nonpic } && ia32 } } } } */ + ++/* Darwin local constant symbol is "lC0", ELF targets ".LC0" */ ++/* { dg-final { scan-assembler-times {addpd\t\.?[Ll]C0.*, %xmm0} 1 { target { { ! ia32 } || nonpic } } } } */ ++/* { dg-final { scan-assembler-times {movapd\t\.?[Ll]C0.*, %xmm1} 1 { target { ia32 && { ! nonpic } } } } } */ ++ ++/* We happen to get this for both cases, but in different positions. */ ++/* { dg-final { scan-assembler-times "addpd\t%xmm1, %xmm0" 1 } } */ ++ ++/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm1" 1 { target { { ! ia32 } || nonpic } } } } */ ++/* { dg-final { scan-assembler-times "movapd\t%xmm0, %xmm2" 1 { target { ia32 && { ! nonpic } } } } } */ ++/* { dg-final { scan-assembler-times "addpd\t%xmm2, %xmm0" 1 { target { ia32 && { ! nonpic } } } } } */ ++ + /* Check absence of save/restore of xmm1 register. */ + /* { dg-final { scan-assembler-not "movaps\t%xmm1, \\(%\[re\]?sp\\)" } } */ + /* { dg-final { scan-assembler-not "movapd\t\\(%\[re\]?sp\\), %xmm1" } } */ +Index: gcc/testsuite/gcc.target/i386/pr77881.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr77881.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr77881.c (.../branches/gcc-8-branch) +@@ -8,5 +8,5 @@ + if (a < 0 || b) + baz (); + } +-/* { dg-final { scan-assembler "js\[ \t\]\.L" } } */ +-/* { dg-final { scan-assembler "jne\[ \t\]\.L" } } */ ++/* { dg-final { scan-assembler "js\[ \t\]\.?L" } } */ ++/* { dg-final { scan-assembler "jne\[ \t\]\.?L" } } */ Index: gcc/testsuite/gcc.target/i386/cet-notrack-5a.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/cet-notrack-5a.c (.../tags/gcc_8_3_0_release) @@ -17026,6 +19823,31 @@ /* { dg-final { scan-assembler-times "notrack call\[ \t]+" 1 } } */ int (*fptr) (int) __attribute__ ((nocf_check)); +Index: gcc/testsuite/gcc.target/i386/pr87853.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr87853.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr87853.c (.../branches/gcc-8-branch) +@@ -0,0 +1,20 @@ ++/* PR target/87853 */ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -funsigned-char -msse2 -mno-sse3 -masm=att" } */ ++/* { dg-final { scan-assembler-times "\tpcmpgtb\t%xmm" 2 } } */ ++/* { dg-final { scan-assembler-not "\tpsubusb\t" } } */ ++/* { dg-final { scan-assembler-not "\tpcmpeqb\t" } } */ ++ ++#include ++ ++__m128i ++foo (__m128i x, __m128i y) ++{ ++ return _mm_cmpgt_epi8 (x, y); ++} ++ ++__m128i ++bar (__m128i x, __m128i y) ++{ ++ return _mm_cmplt_epi8 (x, y); ++} Index: gcc/testsuite/gcc.target/i386/pr89523-7.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/pr89523-7.c (.../tags/gcc_8_3_0_release) @@ -17073,6 +19895,25 @@ + _mm512_i32scatter_pd (addr, idx, src, 8); + _mm512_mask_i32scatter_pd (addr, m8, idx, src, 8); +} +Index: gcc/testsuite/gcc.target/i386/pr32219-4.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr32219-4.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr32219-4.c (.../branches/gcc-8-branch) +@@ -13,6 +13,12 @@ + } + + /* { dg-final { scan-assembler-not "movl\[ \t\]xxx\\(%rip\\), %" { target { ! ia32 } } } } */ ++/* Darwin is always PIC for PIE so no change, weak symbols need to be indirect and this ++ happens to match the ELF case. */ + /* { dg-final { scan-assembler "xxx@GOTPCREL" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %" { target ia32 } } } */ +-/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target ia32 } } } */ ++ ++/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */ ++/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */ ++ ++/* Darwin m32 equivalent (indirect and PIC). */ ++/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ Index: gcc/testsuite/gcc.target/i386/indirect-thunk-4.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c (.../tags/gcc_8_3_0_release) @@ -17318,6 +20159,25 @@ /* { dg-final { scan-assembler {\tlfence} } } */ -/* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +/* { dg-final { scan-assembler-not "_?__x86_indirect_thunk" } } */ +Index: gcc/testsuite/gcc.target/i386/pr32219-5.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr32219-5.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr32219-5.c (.../branches/gcc-8-branch) +@@ -11,7 +11,11 @@ + return xxx; + } + +-/* { dg-final { scan-assembler "movl\[ \t\]xxx\\(%rip\\), %eax" { target { ! ia32 } } } } */ ++/* { dg-final { scan-assembler "movl\[ \t\]_?xxx\\(%rip\\), %eax" { target { ! ia32 } } } } */ + /* { dg-final { scan-assembler-not "xxx@GOTPCREL" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %eax" { target ia32 } } } */ +-/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %eax" { target ia32 } } } */ ++ ++/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %eax" { target { ia32 && { ! *-*-darwin* } } } } } */ ++/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %eax" { target { ia32 && { ! *-*-darwin* } } } } } */ ++ ++/* For Darwin m32, we need PIC (the default) to allow PIE. */ ++/* { dg-final { scan-assembler {movl[ \t]_xxx-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ Index: gcc/testsuite/gcc.target/i386/pr89523-1a.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/pr89523-1a.c (.../tags/gcc_8_3_0_release) @@ -17489,6 +20349,28 @@ +{ + return foo (); +} +Index: gcc/testsuite/gcc.target/i386/wbinvd-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/wbinvd-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/wbinvd-1.c (.../branches/gcc-8-branch) +@@ -1,6 +1,6 @@ + /* { dg-do compile } */ + /* { dg-options "-O2" } */ +-/* { dg-final { scan-assembler-times "wbinvd" 2 } } */ ++/* { dg-final { scan-assembler-times {\twbinvd} 1 } } */ + + #include "immintrin.h" + +Index: gcc/testsuite/gcc.target/i386/pr82659-3.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr82659-3.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr82659-3.c (.../branches/gcc-8-branch) +@@ -1,4 +1,5 @@ + /* { dg-do compile } */ ++/* { dg-require-alias "" } */ + /* { dg-options "-O2 -fcf-protection" } */ + /* { dg-final { scan-assembler-times {\mendbr} 2 } } */ + Index: gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c (.../tags/gcc_8_3_0_release) @@ -17618,6 +20500,29 @@ +{ + _mm512_i32scatter_pd ((void *) 0, idx, src, 8); +} +Index: gcc/testsuite/gcc.target/i386/pr32219-6.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr32219-6.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr32219-6.c (.../branches/gcc-8-branch) +@@ -11,7 +11,14 @@ + return xxx; + } + +-/* { dg-final { scan-assembler-not "movl\[ \t\]xxx\\(%rip\\), %" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler "xxx@GOTPCREL" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %" { target ia32 } } } */ +-/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target ia32 } } } */ ++/* { dg-final { scan-assembler-not "movl\[ \t\]xxx\\(%rip\\), %" { target { { ! ia32 } && { ! *-*-darwin* } } } } } */ ++/* { dg-final { scan-assembler "xxx@GOTPCREL" { target { { ! ia32 } && { ! *-*-darwin* } } } } } */ ++ ++/* Darwin m64 is always PIC, and the dynamic linker doesn't need an indirection. */ ++/* { dg-final { scan-assembler {movl[ \t]_xxx\(%rip\),[ \t]%eax} { target { { ! ia32 } && *-*-darwin* } } } } */ ++ ++/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */ ++/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */ ++ ++/* Darwin m32 defaults to PIC, so no change. */ ++/* { dg-final { scan-assembler {movl[ \t]_xxx-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ Index: gcc/testsuite/gcc.target/i386/pr89523-1b.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/pr89523-1b.c (.../tags/gcc_8_3_0_release) @@ -17658,6 +20563,19 @@ + bar (0, foo); + bar (0, foo); +} +Index: gcc/testsuite/gcc.target/i386/pr22076.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr22076.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr22076.c (.../branches/gcc-8-branch) +@@ -1,6 +1,8 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -fomit-frame-pointer -flax-vector-conversions -mmmx" } */ + /* { dg-additional-options "-mno-vect8-ret-in-mem" { target *-*-vxworks* } } */ ++/* { dg-additional-options "-fno-common" { target *-*-darwin* } } */ ++/* { dg-additional-options "-mdynamic-no-pic" { target { ia32 && *-*-darwin* } } } */ + + #include + Index: gcc/testsuite/gcc.target/i386/ret-thunk-22.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/ret-thunk-22.c (.../tags/gcc_8_3_0_release) @@ -17719,6 +20637,17 @@ /* { dg-final { scan-assembler {\tlfence} } } */ -/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*_?__x86_return_thunk" } } */ +Index: gcc/testsuite/gcc.target/i386/pr24414.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr24414.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr24414.c (.../branches/gcc-8-branch) +@@ -1,5 +1,6 @@ + /* { dg-do run } */ + /* { dg-options "-O2" } */ ++/* { dg-skip-if "asm insert mismatches ABI for Darwin" { *-*-darwin* } } */ + int test; + + int Index: gcc/testsuite/gcc.target/i386/ret-thunk-15.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/ret-thunk-15.c (.../tags/gcc_8_3_0_release) @@ -17760,6 +20689,30 @@ /* { dg-options "-O -maddress-mode=long -fcf-protection -mx32" } */ /* { dg-final { scan-assembler-times "endbr64" 2 } } */ /* { dg-final { scan-assembler-times "movq\t.*buf\\+16" 1 } } */ +Index: gcc/testsuite/gcc.target/i386/fuse-caller-save.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/fuse-caller-save.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/fuse-caller-save.c (.../branches/gcc-8-branch) +@@ -16,11 +16,9 @@ + return y + bar (y); + } + +-/* For !nonpic && ia32 xfails, see PR64895. */ +- + /* Check that no registers are saved/restored. */ +-/* { dg-final { scan-assembler-not "push" { xfail { { ! nonpic } && ia32 } } } } */ +-/* { dg-final { scan-assembler-not "pop" { xfail { { ! nonpic } && ia32 } } } } */ ++/* { dg-final { scan-assembler-not "push" } } */ ++/* { dg-final { scan-assembler-not "pop" } } */ + + /* PR61605. If the first argument register and the return register differ, then + bar leaves the first argument register intact. That means in foo that the +@@ -31,4 +29,4 @@ + /* { dg-final { scan-assembler-not "movl" { target { ! ia32 } } } } */ + + /* Check that addition uses di (in case of no copy) or dx (in case of copy). */ +-/* { dg-final { scan-assembler-times "addl\t%\[re\]?d\[ix\], %\[re\]?ax" 1 { xfail { { ! nonpic } && ia32 } } } } */ ++/* { dg-final { scan-assembler-times "addl\t%\[re\]?d\[ix\], %\[re\]?ax" 1 } } */ Index: gcc/testsuite/gcc.target/i386/pr90899.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/pr90899.c (.../tags/gcc_8_3_0_release) @@ -17886,6 +20839,16 @@ + d >>= (short) d; + b = d; +} +Index: gcc/testsuite/gcc.target/i386/pr82662.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr82662.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr82662.c (.../branches/gcc-8-branch) +@@ -23,4 +23,4 @@ + int f10 (S x, S y) { return x < y; } + int f11 (S x, S y) { return x <= y; } + +-/* { dg-final { scan-assembler-times {\mset} 12 } } */ ++/* { dg-final { scan-assembler-times {\tset} 12 } } */ Index: gcc/testsuite/gcc.target/i386/fpprec-1.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/fpprec-1.c (.../tags/gcc_8_3_0_release) @@ -17940,6 +20903,48 @@ -0.0, 0.0, -0.0, 0.0, -1.0, 1.0, -1.0, 1.0, -2.0, 2.0, -2.0, 2.0 }; +Index: gcc/testsuite/gcc.target/i386/avx512bw-pr91150.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/avx512bw-pr91150.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/avx512bw-pr91150.c (.../branches/gcc-8-branch) +@@ -0,0 +1,37 @@ ++/* PR target/91150 */ ++/* { dg-do run } */ ++/* { dg-options "-O2 -mavx512bw" } */ ++/* { dg-require-effective-target avx512bw } */ ++ ++#include "avx512bw-check.h" ++ ++typedef unsigned char V __attribute__((vector_size (64))); ++ ++__attribute__((noipa)) void ++foo (V *x, V *y, V *z) ++{ ++ *x = __builtin_shuffle (*y, *z, (V) { 0, 1, 2, 3, 4, 5, 6, 7, 8, ++ 9, 10, 11, 12, 13, 14, 15, ++ 80, 81, 82, 83, 84, 85, 86, 87, ++ 88, 89, 90, 91, 92, 93, 94, 95, ++ 96, 97, 98, 99, 100, 101, 102, 103, ++ 104, 105, 106, 107, 108, 109, 110, 111, ++ 112, 113, 114, 115, 116, 117, 118, 119, ++ 120, 121, 122, 123, 124, 125, 126, 127 }); ++} ++ ++static void ++avx512bw_test (void) ++{ ++ union U { unsigned char a[64]; V v; } a, b, c; ++ int i; ++ for (i = 0; i < 64; i++) ++ { ++ b.a[i] = i + 1; ++ c.a[i] = i + 65; ++ } ++ foo (&a.v, &b.v, &c.v); ++ for (i = 0; i < 64; i++) ++ if (a.a[i] != (i < 16 ? i + 1 : i + 65)) ++ __builtin_abort (); ++} Index: gcc/testsuite/gcc.target/i386/cet-notrack-icf-1.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/cet-notrack-icf-1.c (.../tags/gcc_8_3_0_release) @@ -17982,6 +20987,61 @@ -/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */ +/* { dg-final { scan-assembler-not {call[ \t]*\.?LIND} } } */ +Index: gcc/testsuite/gcc.target/i386/memset-strategy-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/memset-strategy-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/memset-strategy-1.c (.../branches/gcc-8-branch) +@@ -1,6 +1,9 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -march=atom -mmemset-strategy=libcall:-1:align" } */ +-/* { dg-final { scan-assembler-times "memset" 2 } } */ ++/* On ELF platforms, one hit comes from the .file directive. */ ++/* { dg-final { scan-assembler-times "memset" 2 { target { ! *-*-darwin* } } } } */ ++/* But not on Darwin, which doesn't have a .file directive by default. */ ++/* { dg-final { scan-assembler-times "_memset" 1 { target *-*-darwin* } } } */ + + char a[2048]; + void t (void) +@@ -7,4 +10,3 @@ + { + __builtin_memset (a, 1, 2048); + } +- +Index: gcc/testsuite/gcc.target/i386/pr61599-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr61599-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr61599-1.c (.../branches/gcc-8-branch) +@@ -1,5 +1,6 @@ + /* PR target/61599 */ + /* { dg-do run { target lp64 } } */ ++/* { dg-skip-if "PR90698" { *-*-darwin* } } */ + /* { dg-additional-sources pr61599-2.c } */ + /* { dg-options "-mcmodel=medium -fdata-sections" } */ + +Index: gcc/testsuite/gcc.target/i386/pr32219-7.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr32219-7.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr32219-7.c (.../branches/gcc-8-branch) +@@ -12,7 +12,15 @@ + return xxx; + } + +-/* { dg-final { scan-assembler "movl\[ \t\]xxx\\(%rip\\), %eax" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler-not "xxx@GOTPCREL" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %eax" { target ia32 } } } */ +-/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %eax" { target ia32 } } } */ ++/* { dg-final { scan-assembler "movl\[ \t\]xxx\\(%rip\\), %eax" { target { { ! ia32 } && { ! *-*-darwin* } } } } } */ ++/* { dg-final { scan-assembler-not "xxx@GOTPCREL" { target { { ! ia32 } && { ! *-*-darwin* } } } } } */ ++ ++/* For Darwin m64, code is always PIC but we need to indirect through the GOT to allow ++ weak symbols to be interposed. The dynamic loader knows how to apply PIE to this. */ ++/* { dg-final { scan-assembler {movq[ \t]_xxx@GOTPCREL\(%rip\),[ \t]%rax} { target { { ! ia32 } && *-*-darwin* } } } } */ ++ ++/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %eax" { target { ia32 && { ! *-*-darwin* } } } } } */ ++/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %eax" { target { ia32 && { ! *-*-darwin* } } } } } */ ++ ++/* Darwin m32 equivalent (indirect and PIC). */ ++/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ Index: gcc/testsuite/gcc.target/i386/indirect-thunk-7.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c (.../tags/gcc_8_3_0_release) @@ -18108,6 +21168,21 @@ /* { dg-options "-O2 -mx32 -maddress-mode=long" } */ int glob_int_arr[100]; +Index: gcc/testsuite/gcc.target/i386/memcpy-strategy-3.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/memcpy-strategy-3.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/memcpy-strategy-3.c (.../branches/gcc-8-branch) +@@ -1,6 +1,9 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -march=atom -mmemcpy-strategy=vector_loop:2000:align,libcall:-1:align" } */ +-/* { dg-final { scan-assembler-times "memcpy" 2 } } */ ++/* On ELF platforms, one hit comes from the .file directive. */ ++/* { dg-final { scan-assembler-times "memcpy" 2 { target { ! *-*-darwin* } } } } */ ++/* But not on Darwin, which doesn't have a .file directive by default. */ ++/* { dg-final { scan-assembler-times "_memcpy" 1 { target *-*-darwin* } } } */ + + char a[2048]; + char b[2048]; Index: gcc/testsuite/gcc.target/i386/pr89523-3.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/pr89523-3.c (.../tags/gcc_8_3_0_release) @@ -18149,6 +21224,18 @@ +{ + x = _mm_i64gather_pd (base, idx, 1); +} +Index: gcc/testsuite/gcc.target/i386/pr66819-3.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr66819-3.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr66819-3.c (.../branches/gcc-8-branch) +@@ -1,6 +1,6 @@ + /* { dg-do compile { target ia32 } } */ + /* { dg-options "-O2 -mregparm=3" } */ +-/* { dg-final { scan-assembler-not "call" } } */ ++/* { dg-final { scan-assembler-not {call[ \t]+_?bar} } } */ + + void (*bar)(int, int); + Index: gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c (.../tags/gcc_8_3_0_release) @@ -18215,6 +21302,16 @@ /* { dg-final { scan-assembler-times "notrack call\[ \t]+" 1 } } */ int foo (int arg); +Index: gcc/testsuite/gcc.target/i386/pr70738-7.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr70738-7.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr70738-7.c (.../branches/gcc-8-branch) +@@ -1,4 +1,4 @@ +-/* { dg-do compile { target ia32 } } */ ++/* { dg-do compile { target { ia32 && { ! *-*-darwin* } } } } */ + /* { dg-options "-msse2 -mgeneral-regs-only" } */ + + extern float a, b, c; Index: gcc/testsuite/gcc.target/i386/cet-notrack-icf-2.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/cet-notrack-icf-2.c (.../tags/gcc_8_3_0_release) @@ -18276,6 +21373,48 @@ /* { dg-options "-O2 -fPIC -mx32 -maddress-mode=long" } */ struct initial_sp +Index: gcc/testsuite/gcc.target/i386/pr64317.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr64317.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr64317.c (.../branches/gcc-8-branch) +@@ -2,9 +2,14 @@ + /* { dg-require-effective-target ia32 } */ + /* { dg-require-effective-target pie } */ + /* { dg-options "-O2 -fpie" } */ +-/* { dg-final { scan-assembler "addl\[ \\t\]+\[$\]_GLOBAL_OFFSET_TABLE_, %ebx" } } */ +-/* { dg-final { scan-assembler "movl\[ \\t\]+c@GOTOFF\[(\]%ebx\[)\]" } } */ +-/* { dg-final { scan-assembler-not "movl\[ \\t\]+\[0-9]+\[(\]%esp\[)\], %ebx" } } */ ++/* { dg-final { scan-assembler "addl\[ \\t\]+\[$\]_GLOBAL_OFFSET_TABLE_, %ebx" { target { ! *-*-darwin* } } } } */ ++/* { dg-final { scan-assembler "movl\[ \\t\]+c@GOTOFF\[(\]%ebx\[)\]" { target { ! *-*-darwin* } } } } */ ++/* { dg-final { scan-assembler-not "movl\[ \\t\]+\[0-9]+\[(\]%esp\[)\], %ebx" { target { ! *-*-darwin* } } } } */ ++ ++/* Check PIC access to c and t1 on Darwin (PIC is default, needed for PIE). */ ++/* { dg-final { scan-assembler {_c-L1\$pb\(%} { target *-*-darwin* } } } */ ++/* { dg-final { scan-assembler {_t1.[0-9]+-L1\$pb\(%} { target *-*-darwin* } } } */ ++ + long c = 1; + + int bar(); +Index: gcc/testsuite/gcc.target/i386/pr32219-8.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/i386/pr32219-8.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/i386/pr32219-8.c (.../branches/gcc-8-branch) +@@ -13,6 +13,12 @@ + } + + /* { dg-final { scan-assembler-not "movl\[ \t\]xxx\\(%rip\\), %" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler "xxx@GOTPCREL" { target { ! ia32 } } } } */ +-/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %" { target ia32 } } } */ +-/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target ia32 } } } */ ++/* Darwin is always PIC so no change, weak symbols needs to be indirect and this ++ happens to match the ELF case. */ ++/* { dg-final { scan-assembler "_?xxx@GOTPCREL" { target { ! ia32 } } } } */ ++ ++/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOTOFF\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */ ++/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */ ++ ++/* Darwin m32 default to PIC but needs indirection for the weak symbol. */ ++/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */ Index: gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c =================================================================== --- a/src/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c (.../tags/gcc_8_3_0_release) @@ -18351,6 +21490,116 @@ /* { dg-options "-O2 -mx32 -maddress-mode=long" } */ typedef struct rtx_def *rtx; +Index: gcc/testsuite/gcc.target/x86_64/abi/avx512f/abi-avx512f.exp +=================================================================== +--- a/src/gcc/testsuite/gcc.target/x86_64/abi/avx512f/abi-avx512f.exp (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/x86_64/abi/avx512f/abi-avx512f.exp (.../branches/gcc-8-branch) +@@ -37,7 +37,6 @@ + foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] { + if {[runtest_file_p $runtests $src]} { + if { ([istarget *-*-darwin*]) } then { +- # FIXME: Darwin isn't tested. + c-torture-execute [list $src \ + $srcdir/$subdir/asm-support-darwin.s] \ + $additional_flags +Index: gcc/testsuite/gcc.target/x86_64/abi/avx512f/asm-support-darwin.s +=================================================================== +--- a/src/gcc/testsuite/gcc.target/x86_64/abi/avx512f/asm-support-darwin.s (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.target/x86_64/abi/avx512f/asm-support-darwin.s (.../branches/gcc-8-branch) +@@ -0,0 +1,93 @@ ++ .text ++ .p2align 4,,15 ++ .globl _snapshot ++_snapshot: ++LFB3: ++ movq %rax, _rax(%rip) ++ movq %rbx, _rbx(%rip) ++ movq %rcx, _rcx(%rip) ++ movq %rdx, _rdx(%rip) ++ movq %rdi, _rdi(%rip) ++ movq %rsi, _rsi(%rip) ++ movq %rbp, _rbp(%rip) ++ movq %rsp, _rsp(%rip) ++ movq %r8, _r8(%rip) ++ movq %r9, _r9(%rip) ++ movq %r10, _r10(%rip) ++ movq %r11, _r11(%rip) ++ movq %r12, _r12(%rip) ++ movq %r13, _r13(%rip) ++ movq %r14, _r14(%rip) ++ movq %r15, _r15(%rip) ++ vmovdqu32 %zmm0, _zmm_regs+0(%rip) ++ vmovdqu32 %zmm1, _zmm_regs+64(%rip) ++ vmovdqu32 %zmm2, _zmm_regs+128(%rip) ++ vmovdqu32 %zmm3, _zmm_regs+192(%rip) ++ vmovdqu32 %zmm4, _zmm_regs+256(%rip) ++ vmovdqu32 %zmm5, _zmm_regs+320(%rip) ++ vmovdqu32 %zmm6, _zmm_regs+384(%rip) ++ vmovdqu32 %zmm7, _zmm_regs+448(%rip) ++ vmovdqu32 %zmm8, _zmm_regs+512(%rip) ++ vmovdqu32 %zmm9, _zmm_regs+576(%rip) ++ vmovdqu32 %zmm10, _zmm_regs+640(%rip) ++ vmovdqu32 %zmm11, _zmm_regs+704(%rip) ++ vmovdqu32 %zmm12, _zmm_regs+768(%rip) ++ vmovdqu32 %zmm13, _zmm_regs+832(%rip) ++ vmovdqu32 %zmm14, _zmm_regs+896(%rip) ++ vmovdqu32 %zmm15, _zmm_regs+960(%rip) ++ vmovdqu32 %zmm16, _zmm_regs+1024(%rip) ++ vmovdqu32 %zmm17, _zmm_regs+1088(%rip) ++ vmovdqu32 %zmm18, _zmm_regs+1152(%rip) ++ vmovdqu32 %zmm19, _zmm_regs+1216(%rip) ++ vmovdqu32 %zmm20, _zmm_regs+1280(%rip) ++ vmovdqu32 %zmm21, _zmm_regs+1344(%rip) ++ vmovdqu32 %zmm22, _zmm_regs+1408(%rip) ++ vmovdqu32 %zmm23, _zmm_regs+1472(%rip) ++ vmovdqu32 %zmm24, _zmm_regs+1536(%rip) ++ vmovdqu32 %zmm25, _zmm_regs+1600(%rip) ++ vmovdqu32 %zmm26, _zmm_regs+1664(%rip) ++ vmovdqu32 %zmm27, _zmm_regs+1728(%rip) ++ vmovdqu32 %zmm28, _zmm_regs+1792(%rip) ++ vmovdqu32 %zmm29, _zmm_regs+1856(%rip) ++ vmovdqu32 %zmm30, _zmm_regs+1920(%rip) ++ vmovdqu32 %zmm31, _zmm_regs+1984(%rip) ++ jmp *_callthis(%rip) ++LFE3: ++ ++ .p2align 4,,15 ++ .globl _snapshot_ret ++_snapshot_ret: ++ movq %rdi, _rdi(%rip) ++ subq $8, %rsp ++ call *_callthis(%rip) ++ addq $8, %rsp ++ movq %rax, _rax(%rip) ++ movq %rdx, _rdx(%rip) ++ vmovdqu32 %zmm0, _zmm_regs+0(%rip) ++ vmovdqu32 %zmm1, _zmm_regs+64(%rip) ++ fstpt _x87_regs(%rip) ++ fstpt _x87_regs+16(%rip) ++ fldt _x87_regs+16(%rip) ++ fldt _x87_regs(%rip) ++ ret ++ ++ .comm _callthis,8,8 ++ .comm _rax,8,8 ++ .comm _rbx,8,8 ++ .comm _rcx,8,8 ++ .comm _rdx,8,8 ++ .comm _rsi,8,8 ++ .comm _rdi,8,8 ++ .comm _rsp,8,8 ++ .comm _rbp,8,8 ++ .comm _r8,8,8 ++ .comm _r9,8,8 ++ .comm _r10,8,8 ++ .comm _r11,8,8 ++ .comm _r12,8,8 ++ .comm _r13,8,8 ++ .comm _r14,8,8 ++ .comm _r15,8,8 ++ .comm _zmm_regs,2048,64 ++ .comm _x87_regs,128,32 ++ .comm _volatile_var,8,8 Index: gcc/testsuite/lib/scanasm.exp =================================================================== --- a/src/gcc/testsuite/lib/scanasm.exp (.../tags/gcc_8_3_0_release) @@ -19321,6 +22570,20 @@ return } +Index: gcc/testsuite/gfortran.dg/pr91660_2.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/pr91660_2.f90 (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/pr91660_2.f90 (.../branches/gcc-8-branch) +@@ -0,0 +1,9 @@ ++! { dg-do compile } ++! PR fortran/91660 ++program foo ++ type(doubleprecision :: x ! { dg-error "Malformed type-spec" } ++ type(double precision :: y ! { dg-error "Malformed type-spec" } ++ type(character(len=3) :: a ! { dg-error "Malformed type-spec" } ++ type(doublecomplex :: b ! { dg-error "Malformed type-spec" } ++ type(double complex :: c ! { dg-error "Malformed type-spec" } ++end program foo Index: gcc/testsuite/gfortran.dg/finalize_28.f90 =================================================================== --- a/src/gcc/testsuite/gfortran.dg/finalize_28.f90 (.../tags/gcc_8_3_0_release) @@ -19499,6 +22762,20 @@ + if (size (b) /= 0 .or. any (b /= 0)) stop 7 + if (size (c) /= 0 .or. any (c /= 0)) stop 8 +end program test +Index: gcc/testsuite/gfortran.dg/pr91660_1.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/pr91660_1.f90 (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/pr91660_1.f90 (.../branches/gcc-8-branch) +@@ -0,0 +1,9 @@ ++! { dg-do compile } ++! PR fortran/91660 ++! Code contributed by Gerhard Steinmetz ++program p ++ type t ++ end type ++ type (t x ! { dg-error "Malformed type-spec" } ++ x = t() ! { dg-error "Can't convert" } ++end Index: gcc/testsuite/gfortran.dg/coarray/caf.exp =================================================================== --- a/src/gcc/testsuite/gfortran.dg/coarray/caf.exp (.../tags/gcc_8_3_0_release) @@ -19793,6 +23070,22 @@ + end select + +end program proglen +Index: gcc/testsuite/gfortran.dg/pdt_4.f03 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/pdt_4.f03 (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gfortran.dg/pdt_4.f03 (.../branches/gcc-8-branch) +@@ -97,9 +97,9 @@ + type (mytype(4, *)) :: arg ! OK + end subroutine + subroutine bar(arg) ! { dg-error "is neither allocatable nor a pointer" } +- type (thytype(8, :, 4) :: arg ++ type (thytype(8, :, 4)) :: arg + end subroutine + subroutine foobar(arg) ! OK +- type (thytype(8, *, 4) :: arg ++ type (thytype(8, *, 4)) :: arg + end subroutine + end Index: gcc/testsuite/gfortran.dg/assumed_type_2.f90 =================================================================== --- a/src/gcc/testsuite/gfortran.dg/assumed_type_2.f90 (.../tags/gcc_8_3_0_release) @@ -19836,6 +23129,161 @@ + + return 0; +} +Index: gcc/testsuite/gcc.c-torture/execute/20190820-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/20190820-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.c-torture/execute/20190820-1.c (.../branches/gcc-8-branch) +@@ -0,0 +1,111 @@ ++/* PR rtl-optimization/91347 */ ++/* Reported by John David Anglin */ ++ ++typedef unsigned short __u16; ++typedef __signed__ int __s32; ++typedef unsigned int __u32; ++typedef __signed__ long long __s64; ++typedef unsigned long long __u64; ++typedef __u16 u16; ++typedef __s32 s32; ++typedef __u32 u32; ++typedef __u64 u64; ++typedef _Bool bool; ++typedef s32 int32_t; ++typedef u32 uint32_t; ++typedef u64 uint64_t; ++ ++char hex_asc_upper[16]; ++u16 decpair[100]; ++ ++static __attribute__ ((noipa)) void ++put_dec_full4 (char *buf, unsigned r) ++{ ++ unsigned q; ++ q = (r * 0x147b) >> 19; ++ *((u16 *)buf) = decpair[r - 100*q]; ++ buf += 2; ++ *((u16 *)buf) = decpair[q]; ++} ++ ++static __attribute__ ((noipa)) unsigned ++put_dec_helper4 (char *buf, unsigned x) ++{ ++ uint32_t q = (x * (uint64_t)0x346DC5D7) >> 43; ++ put_dec_full4(buf, x - q * 10000); ++ return q; ++} ++ ++static __attribute__ ((noipa)) char * ++put_dec (char *buf, unsigned long long n) ++{ ++ uint32_t d3, d2, d1, q, h; ++ d1 = ((uint32_t)n >> 16); ++ h = (n >> 32); ++ d2 = (h ) & 0xffff; ++ d3 = (h >> 16); ++ q = 656 * d3 + 7296 * d2 + 5536 * d1 + ((uint32_t)n & 0xffff); ++ q = put_dec_helper4(buf, q); ++ q += 7671 * d3 + 9496 * d2 + 6 * d1; ++ q = put_dec_helper4(buf+4, q); ++ q += 4749 * d3 + 42 * d2; ++ q = put_dec_helper4(buf+8, q); ++ return buf; ++} ++ ++struct printf_spec { ++ unsigned int type:8; ++ signed int field_width:24; ++ unsigned int flags:8; ++ unsigned int base:8; ++ signed int precision:16; ++} __attribute__((__packed__)); ++ ++static __attribute__ ((noipa)) char * ++number (char *buf, char *end, unsigned long long num, struct printf_spec spec) ++{ ++ ++ char tmp[3 * sizeof(num)] __attribute__((__aligned__(2))); ++ char sign; ++ char locase; ++ int need_pfx = ((spec.flags & 64) && spec.base != 10); ++ int i; ++ bool is_zero = num == 0LL; ++ int field_width = spec.field_width; ++ int precision = spec.precision; ++ ++ i = 0; ++ if (num < spec.base) ++ tmp[i++] = hex_asc_upper[num] | locase; ++ else if (spec.base != 10) { ++ int mask = spec.base - 1; ++ int shift = 3; ++ if (spec.base == 16) ++ shift = 4; ++ else ++ __builtin_abort (); ++ do { ++ tmp[i++] = (hex_asc_upper[((unsigned char)num) & mask] | locase); ++ num >>= shift; ++ } while (num); ++ } else { ++ i = put_dec(tmp, num) - tmp; ++ } ++ return buf; ++} ++ ++static __attribute__ ((noipa)) char * ++pointer_string (char *buf, char *end, const void *ptr, struct printf_spec spec) ++{ ++ spec.base = 16; ++ spec.flags = 0; ++ return number(buf, end, 100, spec); ++} ++ ++int ++main (void) ++{ ++ struct printf_spec spec; ++ char *s = pointer_string (0, 0, 0, spec); ++ return 0; ++} +Index: gcc/testsuite/gcc.c-torture/execute/pr91137.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/pr91137.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.c-torture/execute/pr91137.c (.../branches/gcc-8-branch) +@@ -0,0 +1,34 @@ ++long long a; ++unsigned b; ++int c[70]; ++int d[70][70]; ++int e; ++ ++__attribute__ ((noinline)) void f(long long *g, int p2) { ++ *g = p2; ++} ++ ++__attribute__ ((noinline)) void fn2() { ++ for (int j = 0; j < 70; j++) { ++ for (int i = 0; i < 70; i++) { ++ if (b) ++ c[i] = 0; ++ for (int l = 0; l < 70; l++) ++ d[i][1] = d[l][i]; ++ } ++ for (int k = 0; k < 70; k++) ++ e = c[0]; ++ } ++} ++ ++int main() { ++ b = 5; ++ for (int j = 0; j < 70; ++j) ++ c[j] = 2075593088; ++ fn2(); ++ f(&a, e); ++ if (a) ++ __builtin_abort(); ++ return 0; ++} ++ Index: gcc/testsuite/gcc.c-torture/execute/pr90949.c =================================================================== --- a/src/gcc/testsuite/gcc.c-torture/execute/pr90949.c (.../tags/gcc_8_3_0_release) @@ -19896,6 +23344,47 @@ if [istarget "powerpc-*-darwin*"] { lappend additional_flags "-Wl,-multiply_defined,suppress" } +Index: gcc/testsuite/gcc.c-torture/execute/20190901-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/20190901-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.c-torture/execute/20190901-1.c (.../branches/gcc-8-branch) +@@ -0,0 +1,36 @@ ++/* PR target/91472 */ ++/* Reported by John Paul Adrian Glaubitz */ ++ ++typedef unsigned int gmp_uint_least32_t; ++ ++union ieee_double_extract ++{ ++ struct ++ { ++ gmp_uint_least32_t sig:1; ++ gmp_uint_least32_t exp:11; ++ gmp_uint_least32_t manh:20; ++ gmp_uint_least32_t manl:32; ++ } s; ++ double d; ++}; ++ ++double __attribute__((noipa)) ++tests_infinity_d (void) ++{ ++ union ieee_double_extract x; ++ x.s.exp = 2047; ++ x.s.manl = 0; ++ x.s.manh = 0; ++ x.s.sig = 0; ++ return x.d; ++} ++ ++int ++main (void) ++{ ++ double x = tests_infinity_d (); ++ if (x == 0.0) ++ __builtin_abort (); ++ return 0; ++} Index: gcc/testsuite/gcc.c-torture/compile/pr89703-2.c =================================================================== --- a/src/gcc/testsuite/gcc.c-torture/compile/pr89703-2.c (.../tags/gcc_8_3_0_release) @@ -19923,6 +23412,31 @@ +/* { dg-additional-options "-fno-printf-return-value" } */ + +#include "pr89998-1.c" +Index: gcc/testsuite/gcc.c-torture/compile/pr90139.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/compile/pr90139.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.c-torture/compile/pr90139.c (.../branches/gcc-8-branch) +@@ -0,0 +1,20 @@ ++/* PR middle-end/90139 */ ++ ++typedef float __attribute__((vector_size (sizeof (float)))) V; ++void bar (int, V *); ++int l; ++ ++void ++foo (void) ++{ ++ V n, b, o; ++ while (1) ++ switch (l) ++ { ++ case 0: ++ o = n; ++ n = b; ++ b = o; ++ bar (1, &o); ++ } ++} Index: gcc/testsuite/gcc.c-torture/compile/pr89663-1.c =================================================================== --- a/src/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c (.../tags/gcc_8_3_0_release) @@ -20466,17 +23980,86 @@ + type Arr2 is array (Positive range <>) of Rec; + +end Array4; -Index: gcc/testsuite/gcc.dg/gomp/pr89796.c +Index: gcc/testsuite/gcc.dg/darwin-minversion-2.c =================================================================== ---- a/src/gcc/testsuite/gcc.dg/gomp/pr89796.c (.../tags/gcc_8_3_0_release) -+++ b/src/gcc/testsuite/gcc.dg/gomp/pr89796.c (.../branches/gcc-8-branch) -@@ -0,0 +1,23 @@ -+/* PR c++/89796 */ +--- a/src/gcc/testsuite/gcc.dg/darwin-minversion-2.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/darwin-minversion-2.c (.../branches/gcc-8-branch) +@@ -1,6 +1,6 @@ + /* Basic test for -mmacosx-version-min switch on Darwin. */ + /* { dg-options "-mmacosx-version-min=10.1 -mmacosx-version-min=10.5" } */ +-/* { dg-do run { target *-*-darwin* } } */ ++/* { dg-do compile { target *-*-darwin* } } */ + + int + main () +Index: gcc/testsuite/gcc.dg/pr90756.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/pr90756.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/pr90756.c (.../branches/gcc-8-branch) +@@ -0,0 +1,26 @@ ++/* PR rtl-optimization/90756 */ +/* { dg-do compile } */ -+/* { dg-additional-options "-Wunused-value" } */ ++/* { dg-options "-O2 -Wno-psabi" } */ ++/* { dg-additional-options "-mno-sse" { target ia32 } } */ + -+int -+f1 (int *p) ++typedef float B __attribute__((vector_size(4 * sizeof (float)))); ++typedef unsigned long long C __attribute__((vector_size(4 * sizeof (long long)))); ++typedef short D __attribute__((vector_size(4 * sizeof (short)))); ++B z; ++void foo (C); ++C bar (D); ++B baz (); ++D qux (B); ++ ++void ++quux (int x) ++{ ++ B n = z, b = z; ++ while (1) ++ switch (x) ++ { ++ case 0: n = baz (); /* FALLTHRU */ ++ case 1: { B o = n; n = b; b = o; } /* FALLTHRU */ ++ case 2: { D u = qux (b); C v = bar (u); foo (v); } ++ } ++} +Index: gcc/testsuite/gcc.dg/darwin-weakimport-3.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/darwin-weakimport-3.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/darwin-weakimport-3.c (.../branches/gcc-8-branch) +@@ -1,5 +1,20 @@ + /* { dg-do compile { target *-*-darwin* } } */ +-/* { dg-options "-fno-asynchronous-unwind-tables" } */ ++ ++/* Here we want to test if "foo" gets placed into a coalesced ++ section (it should not). ++ ++ However, for i386, and PIC code we have a "get_pc thunk" that ++ is (correctly) placed in a coalesced section when using an older ++ linker - also unwind tables are emitted into coalesced. ++ ++ With modern linkers this is moot, since even weak symbols ++ are emitted into the regular sections. ++ ++ To avoid the unwind tables -fno-asynchronous-unwind-tables. ++ To ensure that we emit code for an older linker -mtarget-linker ++ To avoid the get_pc thunk optimise at least O1. */ ++ ++/* { dg-options "-fno-asynchronous-unwind-tables -O1 -mtarget-linker 85.2" } */ + /* { dg-require-weak "" } */ + + /* { dg-final { scan-assembler-not "coalesced" } } */ +Index: gcc/testsuite/gcc.dg/gomp/pr89796.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/gomp/pr89796.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/gomp/pr89796.c (.../branches/gcc-8-branch) +@@ -0,0 +1,23 @@ ++/* PR c++/89796 */ ++/* { dg-do compile } */ ++/* { dg-additional-options "-Wunused-value" } */ ++ ++int ++f1 (int *p) +{ + int r; + #pragma omp atomic capture /* { dg-bogus "value computed is not used" } */ @@ -20494,6 +24077,43 @@ + r; }); + return s; +} +Index: gcc/testsuite/gcc.dg/gomp/pr90900.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/gomp/pr90900.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/gomp/pr90900.c (.../branches/gcc-8-branch) +@@ -0,0 +1,11 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -fopenmp -g" } */ ++ ++void f (int a) ++{ ++ void *x = &&lab; ++#pragma omp parallel ++ if (a) ++ { lab: __builtin_unreachable(); } ++ x; ++} +Index: gcc/testsuite/gcc.dg/gomp/pr78884.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/gomp/pr78884.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/gomp/pr78884.c (.../branches/gcc-8-branch) +@@ -0,0 +1,16 @@ ++/* PR middle-end/78884 */ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -fopenmp" } */ ++ ++void bar (int *); ++ ++void ++foo (int n) ++{ ++#pragma omp simd ++ for (int i = 0; i < 1024; i++) ++ { ++ int vla[n]; ++ bar (vla); ++ } ++} Index: gcc/testsuite/gcc.dg/pr89521-1.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/pr89521-1.c (.../tags/gcc_8_3_0_release) @@ -20699,6 +24319,61 @@ + union a f[2] = {-1L}; + g(0, d, f[0]); +} +Index: gcc/testsuite/gcc.dg/torture/pr91200.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/torture/pr91200.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/torture/pr91200.c (.../branches/gcc-8-branch) +@@ -0,0 +1,32 @@ ++/* { dg-do compile } */ ++ ++int printf (const char *, ...); ++ ++char a; ++int b, c, **d; ++ ++int main () ++{ ++ int f = -128, *g, *h[2] = {0, 0}, i; ++ printf("0"); ++ if (a) ++ { ++ while (f > a) { ++ int *j = &i; ++ *j |= 0; ++ } ++ h[i] = &c; ++ } ++ if (h[1]) ++ { ++ int **k = &g; ++ *k = &f; ++ while (i) ++ { ++ int **l[] = {&g}; ++ } ++ int **m = &g; ++ *d = *m = &b; ++ } ++ return 0; ++} +Index: gcc/testsuite/gcc.dg/torture/pr90278.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/torture/pr90278.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/torture/pr90278.c (.../branches/gcc-8-branch) +@@ -0,0 +1,13 @@ ++/* { dg-do compile } */ ++/* { dg-additional-options "-fexceptions -fnon-call-exceptions" } */ ++ ++double ++hc (void) ++{ ++ double dp = 0.0; ++ double ek[1]; ++ ++ ek[0] = 1.0 / dp < 0.0; ++ ++ return ek[0]; ++} Index: gcc/testsuite/gcc.dg/torture/pr89572.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/torture/pr89572.c (.../tags/gcc_8_3_0_release) @@ -20761,6 +24436,68 @@ + goto *({ d || e < 0 || e >= 2; }); + &e; +} +Index: gcc/testsuite/gcc.dg/torture/pr91126.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/torture/pr91126.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/torture/pr91126.c (.../branches/gcc-8-branch) +@@ -0,0 +1,28 @@ ++/* { dg-do run } */ ++ ++struct S ++{ ++ __INT32_TYPE__ a : 24; ++ __INT32_TYPE__ b : 8; ++} s; ++ ++int ++main() ++{ ++ s.a = 0xfefefe; ++ s.b = 0xfe; ++ unsigned char c; ++ c = ((unsigned char *)&s)[0]; ++ if (c != 0xfe) ++ __builtin_abort (); ++ c = ((unsigned char *)&s)[1]; ++ if (c != 0xfe) ++ __builtin_abort (); ++ c = ((unsigned char *)&s)[2]; ++ if (c != 0xfe) ++ __builtin_abort (); ++ c = ((unsigned char *)&s)[3]; ++ if (c != 0xfe) ++ __builtin_abort (); ++ return 0; ++} +Index: gcc/testsuite/gcc.dg/torture/pr90328.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/torture/pr90328.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/torture/pr90328.c (.../branches/gcc-8-branch) +@@ -0,0 +1,24 @@ ++/* { dg-do run } */ ++ ++void g(int*__restrict x, int*y) ++{ ++ *x = *y; ++} ++ ++void __attribute__((noipa)) f(int* a,int* b) ++{ ++ for(int i=0;i<1024;++i) ++ g(a+i,b+i); ++} ++ ++int main() ++{ ++ int x[1025]; ++ for (int i = 0; i < 1025; ++i) ++ x[i] = i+1; ++ f(x+1, x); ++ for (int i = 0; i < 1025; ++i) ++ if (x[i] != 1) ++ __builtin_abort (); ++ return 0; ++} Index: gcc/testsuite/gcc.dg/torture/pr89091.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/torture/pr89091.c (.../tags/gcc_8_3_0_release) @@ -20776,6 +24513,38 @@ +{ + return y && x->s; +} +Index: gcc/testsuite/gcc.dg/torture/restrict-7.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/torture/restrict-7.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/torture/restrict-7.c (.../branches/gcc-8-branch) +@@ -0,0 +1,27 @@ ++/* { dg-do run } */ ++ ++extern void abort (void); ++ ++static inline __attribute__((always_inline)) void ++copy(int *restrict a, int *restrict b) ++{ ++ *b = *a; ++ *a = 7; ++} ++ ++void __attribute__((noinline)) ++floppy(int mat[static 2], unsigned idxs[static 3]) ++{ ++ for (int i = 0; i < 3; i++) ++ copy(&mat[i%2], &mat[idxs[i]]); ++} ++ ++int main() ++{ ++ int mat[2] = {10, 20}; ++ unsigned idxs[3] = {1, 0, 1}; ++ floppy(mat, idxs); ++ if (mat[0] != 7 || mat[1] != 10) ++ abort (); ++ return 0; ++} Index: gcc/testsuite/gcc.dg/torture/pr89595.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/torture/pr89595.c (.../tags/gcc_8_3_0_release) @@ -20867,6 +24636,40 @@ + __builtin_abort (); + return 0; +} +Index: gcc/testsuite/gcc.dg/torture/pr90020.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/torture/pr90020.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/torture/pr90020.c (.../branches/gcc-8-branch) +@@ -0,0 +1,29 @@ ++/* { dg-do run } */ ++/* { dg-require-weak "" } */ ++/* { dg-additional-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } } */ ++/* { dg-additional-options "-Wl,-flat_namespace" { target *-*-darwin[89]* } } */ ++ ++void __attribute__((noinline,noclone)) ++check (int i) ++{ ++ if (i == 0) ++ __builtin_exit (0); ++} ++ ++int i; ++extern int x __attribute__((weak)); ++ ++int main(int argc, char **argv) ++{ ++ if (argc) ++ { ++ check (i); ++ return x; ++ } ++ else ++ { ++ check (i); ++ return x-1; ++ } ++ return 0; ++} Index: gcc/testsuite/gcc.dg/torture/pr89710.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/torture/pr89710.c (.../tags/gcc_8_3_0_release) @@ -21036,6 +24839,109 @@ +B (sqrt) +B (fabs) +B (logb) +Index: gcc/testsuite/gcc.dg/vect/pr91293-2.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/vect/pr91293-2.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/vect/pr91293-2.c (.../branches/gcc-8-branch) +@@ -0,0 +1,19 @@ ++/* { dg-do run } */ ++/* { dg-additional-options "-msse4.1" { target { sse4_runtime } } } */ ++ ++long long a; ++unsigned b, c; ++int d = 62; ++void e(long long *f, int p2) { *f = p2; } ++int main() ++{ ++ for (int g = 2; g <= d; g++) ++ { ++ c += 5 - g; ++ b += g + 4; ++ } ++ e(&a, b); ++ if (a != 2196) ++ __builtin_abort (); ++ return 0; ++} +Index: gcc/testsuite/gcc.dg/vect/pr81740-2.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/vect/pr81740-2.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/vect/pr81740-2.c (.../branches/gcc-8-branch) +@@ -0,0 +1,25 @@ ++/* { dg-do run } */ ++/* { dg-require-effective-target vect_int } */ ++/* { dg-require-effective-target vect_hw_misalign } */ ++ ++#include "tree-vect.h" ++ ++int a[8][10] = { [2][5] = 4 }, c; ++ ++int ++main () ++{ ++ short b; ++ int i, d; ++ check_vect (); ++ for (b = 4; b >= 0; b--) ++ for (c = 6; c >= 0; c--) ++ a[c + 1][b + 2] = a[c][b + 1]; ++ for (i = 0; i < 8; i++) ++ for (d = 0; d < 10; d++) ++ if (a[i][d] != (i == 3 && d == 6) * 4) ++ __builtin_abort (); ++ return 0; ++} ++ ++/* { dg-final { scan-tree-dump "OUTER LOOP VECTORIZED" "vect" } } */ +Index: gcc/testsuite/gcc.dg/vect/pr91293-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/vect/pr91293-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/vect/pr91293-1.c (.../branches/gcc-8-branch) +@@ -0,0 +1,19 @@ ++/* { dg-do run } */ ++/* { dg-additional-options "-msse4.1" { target { sse4_runtime } } } */ ++ ++long long a; ++unsigned b, c; ++int d = 62; ++void e(long long *f, int p2) { *f = p2; } ++int main() ++{ ++ for (int g = 2; g <= d; g++) ++ { ++ b += g + 4; ++ c += 5 - g; ++ } ++ e(&a, b); ++ if (a != 2196) ++ __builtin_abort (); ++ return 0; ++} +Index: gcc/testsuite/gcc.dg/vect/pr91293-3.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/vect/pr91293-3.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/vect/pr91293-3.c (.../branches/gcc-8-branch) +@@ -0,0 +1,20 @@ ++/* { dg-do run } */ ++/* { dg-additional-options "-msse4.1" { target { sse4_runtime } } } */ ++ ++long long a; ++unsigned b, c; ++int d = 62; ++void e(long long *f, int p2) { *f = p2; } ++int xx = 5, yy = 4; ++int main() ++{ ++ for (int g = 2; g <= d; g++) ++ { ++ c += xx - g; ++ b += yy + g; ++ } ++ e(&a, b); ++ if (a != 2196) ++ __builtin_abort (); ++ return 0; ++} Index: gcc/testsuite/gcc.dg/vect/pr90018.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/vect/pr90018.c (.../tags/gcc_8_3_0_release) @@ -21088,6 +24994,91 @@ +} + +/* { dg-final { scan-tree-dump "READ_WRITE dependence in interleaving" "vect" } } */ +Index: gcc/testsuite/gcc.dg/vect/slp-reduc-sad.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/vect/slp-reduc-sad.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/vect/slp-reduc-sad.c (.../branches/gcc-8-branch) +@@ -12,7 +12,7 @@ + int __attribute__((noinline,noclone)) + foo (uint8_t *pix1, uint8_t *pix2, int i_stride_pix2) + { +- int i_sum = 0; ++ int i_sum = 5; + for( int y = 0; y < 16; y++ ) + { + i_sum += abs ( pix1[0] - pix2[0] ); +@@ -52,7 +52,7 @@ + __asm__ volatile (""); + } + +- if (foo (X, Y, 16) != 32512) ++ if (foo (X, Y, 16) != 32512 + 5) + abort (); + + return 0; +Index: gcc/testsuite/gcc.dg/vect/pr81740-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/vect/pr81740-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/vect/pr81740-1.c (.../branches/gcc-8-branch) +@@ -0,0 +1,22 @@ ++/* { dg-do run } */ ++/* { dg-require-effective-target vect_int } */ ++ ++#include "tree-vect.h" ++ ++int a[8][10] = { [2][5] = 4 }, c; ++ ++int ++main () ++{ ++ short b; ++ int i, d; ++ check_vect (); ++ for (b = 4; b >= 0; b--) ++ for (c = 0; c <= 6; c++) ++ a[c + 1][b + 2] = a[c][b + 1]; ++ for (i = 0; i < 8; i++) ++ for (d = 0; d < 10; d++) ++ if (a[i][d] != (i == 3 && d == 6) * 4) ++ __builtin_abort (); ++ return 0; ++} +Index: gcc/testsuite/gcc.dg/vect/bb-slp-pr90006.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/vect/bb-slp-pr90006.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/vect/bb-slp-pr90006.c (.../branches/gcc-8-branch) +@@ -0,0 +1,31 @@ ++/* { dg-do compile } */ ++/* { dg-additional-options "-fno-math-errno" } */ ++/* { dg-additional-options "-march=x86-64" { target x86_64-*-* i?86-*-* } } */ ++ ++long int lrint(double x); ++ ++int a, b; ++union c { ++ int d; ++}; ++ ++int e() ++{ ++ int f, g, h; ++ long i, j, k; ++ double l, m = b = lrint(0.3127); ++ a = b >> 16 >> 8 & 255; ++ ((union c *)e)->d = a; ++ k = m; ++ h = k >> 16 >> 8 & 255; ++ ((union c *)(e + 4))->d = h; ++ j = lrint(l); ++ g = j >> 16 >> 8 & 255; ++ ((union c *)(e + 8))->d = g; ++ i = lrint(0.292); ++ f = i >> 16 >> 8 & 255; ++ ((union c *)(e + 12))->d = f; ++ return 0; ++} ++ ++/* { dg-final { scan-tree-dump "basic block vectorized" "slp2" { target { { x86_64-*-* i?86-*-* } && ilp32 } } } } */ Index: gcc/testsuite/gcc.dg/pr89734.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/pr89734.c (.../tags/gcc_8_3_0_release) @@ -21226,6 +25217,92 @@ int g; void bar(); +Index: gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/cpp/usr/include/stdio.h (.../branches/gcc-8-branch) +@@ -1,4 +0,0 @@ +-/* Used by gcc.dg/cpp/isysroot-1.c to test isysroot. */ +-void foo() +-{ +-} +Index: gcc/testsuite/gcc.dg/cpp/usr/include/example.h +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/cpp/usr/include/example.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/cpp/usr/include/example.h (.../branches/gcc-8-branch) +@@ -0,0 +1,4 @@ ++/* Used by gcc.dg/cpp/isysroot-1.c to test isysroot. */ ++void foo() ++{ ++} +Index: gcc/testsuite/gcc.dg/cpp/isysroot-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/cpp/isysroot-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/cpp/isysroot-1.c (.../branches/gcc-8-branch) +@@ -1,10 +1,17 @@ + /* { dg-options "-isysroot ${srcdir}/gcc.dg/cpp" } */ + /* { dg-do compile { target *-*-darwin* } } */ + +-#include ++/* For the test to succeed there needs to be some header that is to be found ++ in the 'expected' place i.e. /usr/include/. It's important that ++ it is not the name of a header for which fixincludes have been applied, ++ since such headers will be found in the gcc include-fixed dir and, in ++ general, reference additional headers. The dummy sysroot will prevent the ++ additional headers from being found, resulting in a failed test. So use ++ a header name we don't expect to see. */ ++#include + int main() + { +- /* Special stdio.h supplies function foo. */ ++ /* Special example.h supplies function foo. */ + void (*x)(void) = foo; + return 0; + } +Index: gcc/testsuite/gcc.dg/pr90760.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/pr90760.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/pr90760.c (.../branches/gcc-8-branch) +@@ -0,0 +1,8 @@ ++/* PR c/90760 */ ++/* { dg-do compile } */ ++/* { dg-require-named-sections "" } */ ++ ++void bar (void) {} ++void foo (void) __attribute__ ((alias ("bar"))); /* { dg-error "section of alias 'foo' must match section of its target" } */ ++void foo (void) __attribute__ ((section ("baz"))); ++void qux (void) __attribute__ ((alias ("bar"), section ("baz"))); /* { dg-error "section of alias 'qux' must match section of its target" } */ +Index: gcc/testsuite/gcc.dg/darwin-minversion-link.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/darwin-minversion-link.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/darwin-minversion-link.c (.../branches/gcc-8-branch) +@@ -0,0 +1,26 @@ ++/* Test that we can handle leading-zeros on mmacosx-version-min for invocations ++ including linking (so that spec processing works). To make sure that any ++ necessary target libs are present we make this specific to the target version ++ being built. */ ++/* { dg-do link { target *-*-darwin* } } */ ++/* { dg-additional-options "-mmacosx-version-min=010.04.11 -DCHECK=1049" { target *-*-darwin8* } } */ ++/* { dg-additional-options "-mmacosx-version-min=010.05.08 -DCHECK=1058" { target *-*-darwin9* } } */ ++/* { dg-additional-options "-mmacosx-version-min=010.06.08 -DCHECK=1068" { target *-*-darwin10* } } */ ++/* { dg-additional-options "-mmacosx-version-min=010.07.05 -DCHECK=1075" { target *-*-darwin11* } } */ ++/* { dg-additional-options "-mmacosx-version-min=010.08.05 -DCHECK=1085" { target *-*-darwin12* } } */ ++/* { dg-additional-options "-mmacosx-version-min=010.09.05 -DCHECK=1095" { target *-*-darwin13* } } */ ++/* { dg-additional-options "-mmacosx-version-min=010.010.03 -DCHECK=101003" { target *-*-darwin14* } } */ ++/* { dg-additional-options "-mmacosx-version-min=010.011.06 -DCHECK=101106" { target *-*-darwin15* } } */ ++/* { dg-additional-options "-mmacosx-version-min=010.012.06 -DCHECK=101206" { target *-*-darwin16* } } */ ++/* { dg-additional-options "-mmacosx-version-min=010.013.06 -DCHECK=101306" { target *-*-darwin17* } } */ ++/* This next test covers 10.18 and (currently unreleased) 10.19 for now. */ ++/* { dg-additional-options "-mmacosx-version-min=010.014.05 -DCHECK=101405" { target *-*-darwin1[89]* } } */ ++ ++int ++main () ++{ ++#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != CHECK ++ fail me; ++#endif ++ return 0; ++} Index: gcc/testsuite/gcc.dg/Wrestrict-5.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/Wrestrict-5.c (.../tags/gcc_8_3_0_release) @@ -21298,6 +25375,36 @@ + for (int i = 0; i < 10; ++i) + m++; +} +Index: gcc/testsuite/gcc.dg/autopar/pr91162.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/autopar/pr91162.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/autopar/pr91162.c (.../branches/gcc-8-branch) +@@ -0,0 +1,25 @@ ++/* { dg-do compile { target int128 } } */ ++/* { dg-options "-O -ftree-parallelize-loops=2 -fno-tree-dominator-opts --param parloops-min-per-thread=30" } */ ++ ++void ++zf (__int128 ct) ++{ ++ __int128 *rk = &ct; ++ ++ if (0) ++ { ++ int jj; ++ ++t9: ++ for (jj = 0; jj < 60; ++jj) ++ { ++ } ++ ++ __builtin_unreachable (); ++ } ++ ++ while (*rk < 1) ++ ++*rk; ++ ++ goto t9; ++} Index: gcc/testsuite/gcc.dg/pr89590.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/pr89590.c (.../tags/gcc_8_3_0_release) @@ -21314,6 +25421,39 @@ +{ + ((void (*)()) free) (); +} +Index: gcc/testsuite/gcc.dg/tree-ssa/pr89725.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/tree-ssa/pr89725.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/tree-ssa/pr89725.c (.../branches/gcc-8-branch) +@@ -0,0 +1,28 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -floop-interchange -fno-tree-dce" } */ ++int abs (int); ++int find_sad_16x16(int *intra_mode) ++{ ++ int current_intra_sad_2,best_intra_sad2; ++ int M1[16][16],M0[4][4][4][4],M3[4],M4[4][4]; ++ int i,j,k; ++ int ii,jj; ++ int up_avail, left_avail, left_up_avail; ++ for (i=0;i<17;i++) ++ if (left_up_avail) ++ { ++ for (jj=0;jj<4;jj++) ++ for (ii=0;ii<4;ii++) ++ for (j=0;j<4;j++) ++ for (i=0;i<4;i++) ++ { ++ M0[i][ii][2][jj]=M3[0]-M3[1]; ++ M0[i][ii][1][jj]=M3[2]+M3[3]; ++ current_intra_sad_2 += abs(M0[i][ii][j][jj]); ++ } ++ ++ if(current_intra_sad_2 < best_intra_sad2) ++ best_intra_sad2=current_intra_sad_2; ++ } ++ return 0; ++} Index: gcc/testsuite/gcc.dg/tree-ssa/reassoc-43.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/tree-ssa/reassoc-43.c (.../tags/gcc_8_3_0_release) @@ -21324,6 +25464,34 @@ } -/* { dg-final { scan-tree-dump-not "0 != 0" "reassoc2"} } */ +/* { dg-final { scan-tree-dump-not "\[ (\]0 != 0" "reassoc2"} } */ +Index: gcc/testsuite/gcc.dg/tree-ssa/pr91091-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/tree-ssa/pr91091-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/tree-ssa/pr91091-1.c (.../branches/gcc-8-branch) +@@ -0,0 +1,23 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -fno-strict-aliasing" } */ ++ ++struct s { int x; } __attribute__((packed)); ++struct t { int x; }; ++ ++void __attribute__((noinline,noipa)) ++swap(struct s* p, struct t* q) ++{ ++ p->x = q->x; ++ q->x = p->x; ++} ++ ++int main() ++{ ++ struct t a[2]; ++ a[0].x = 0x12345678; ++ a[1].x = 0x98765432; ++ swap ((struct s *)((char *)a + 1), a); ++ if (a[0].x != 0x12345678) ++ __builtin_abort (); ++ return 0; ++} Index: gcc/testsuite/gcc.dg/tree-ssa/pr89872.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/tree-ssa/pr89872.c (.../tags/gcc_8_3_0_release) @@ -21356,6 +25524,38 @@ +{ + (volatile int){4} / (volatile int){0}; +} +Index: gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-78.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-78.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-78.c (.../branches/gcc-8-branch) +@@ -0,0 +1,27 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -fstrict-aliasing" } */ ++ ++union U { ++ struct A { int : 2; int x : 8; } a; ++ struct B { int : 6; int x : 8; } b; ++}; ++ ++int __attribute__((noipa)) ++foo (union U *p, union U *q) ++{ ++ p->a.x = 1; ++ q->b.x = 1; ++ return p->a.x; ++} ++ ++int ++main() ++{ ++ union U x; ++ if (foo (&x, &x) != x.a.x) ++ __builtin_abort (); ++ return 0; ++} ++ ++/* We support arbitrary punning through unions when it happens through ++ the union type and thus p == q is valid here. */ Index: gcc/testsuite/gcc.dg/tree-ssa/pr89546.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/tree-ssa/pr89546.c (.../tags/gcc_8_3_0_release) @@ -21461,6 +25661,45 @@ + __builtin_abort (); + return 0; +} +Index: gcc/testsuite/gcc.dg/pr90733.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/pr90733.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/pr90733.c (.../branches/gcc-8-branch) +@@ -0,0 +1,22 @@ ++/* PR debug/90733 */ ++/* { dg-do compile } */ ++/* { dg-options "-g -O2 -w" } */ ++ ++struct S { unsigned a : 1; }; ++union U { struct S b; _Complex unsigned c; }; ++ ++union U ++foo (union U d) ++{ ++ union U e = d; ++ return e; ++} ++ ++int ++bar (void) ++{ ++ union U x, y; ++ x.c = x.b.a; ++ y = foo (x); ++ return x.c != y.c; ++} +Index: gcc/testsuite/gcc.dg/darwin-minversion-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/darwin-minversion-1.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/darwin-minversion-1.c (.../branches/gcc-8-branch) +@@ -1,6 +1,6 @@ + /* Basic test for -mmacosx-version-min switch on Darwin. */ + /* { dg-options "-mmacosx-version-min=10.5" } */ +-/* { dg-do run { target *-*-darwin* } } */ ++/* { dg-do compile { target *-*-darwin* } } */ + + int + main () Index: gcc/testsuite/gcc.dg/Warray-bounds-38.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/Warray-bounds-38.c (.../tags/gcc_8_3_0_release) @@ -21496,6 +25735,26 @@ + + f (s.a, 33 * sizeof s, 1); +} +Index: gcc/testsuite/gcc.dg/uninit-19.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/uninit-19.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/gcc.dg/uninit-19.c (.../branches/gcc-8-branch) +@@ -12,7 +12,7 @@ + { + if (p1 & 8) + b[3] = p10[a]; +- /* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } .-1 } */ ++ /* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* *-*-darwin* } } } .-1 } */ + } + + void +@@ -22,5 +22,5 @@ + if (l & 6) + n = &c + m; + fn1 (l, &d, &e, &g, &i, &h, &k, n); +- /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } .-1 } */ ++ /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* *-*-darwin* } } } } .-1 } */ + } Index: gcc/testsuite/gcc.dg/pr89679.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/pr89679.c (.../tags/gcc_8_3_0_release) @@ -21531,240 +25790,849 @@ =================================================================== --- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_8_3_0_release) +++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-8-branch) -@@ -1,3 +1,1170 @@ -+2019-08-15 Jonathan Wakely +@@ -1,3 +1,1779 @@ ++2019-09-09 Jakub Jelinek ++ ++ PR target/87853 ++ * gcc.target/i386/pr87853.c: New test. ++ ++ PR target/91704 ++ * gcc.target/i386/pr91704.c: New test. ++ ++2019-09-05 Steven G. Kargl ++ ++ PR fortran/91660 ++ * gfortran.dg/pdt_4.f03: Fix invalid code. ++ * gfortran.dg/pr91660_1.f90: New test. ++ * gfortran.dg/pr91660_2.f90: Ditto. ++ ++2019-09-04 Wilco Dijkstra ++ ++ Backport from mainline ++ 2019-08-13 Wilco Dijkstra ++ ++ PR target/81800 ++ * gcc.target/aarch64/no-inline-lrint_3.c: New test. ++ ++2019-09-02 Richard Biener ++ ++ PR testsuite/91619 ++ * gcc.dg/vect/pr81740-2.c: Restrict to vect_hw_misalign. ++ ++2019-09-01 Iain Sandoe + + Backport from mainline. -+ 2019-08-14 Jonathan Wakely ++ 2019-06-15 Iain Sandoe + -+ PR c++/91436 -+ * g++.dg/lookup/missing-std-include-5.C: Limit test to C++14 and up. -+ * g++.dg/lookup/missing-std-include-6.C: Don't check make_unique in -+ test that runs for C++11. -+ * g++.dg/lookup/missing-std-include-8.C: Check make_unique here. ++ PR objc/90709 ++ * obj-c++.dg/proto-lossage-7.mm: Use proxy headers. ++ * obj-c++.dg/strings/const-cfstring-2.mm: Likewise. ++ * obj-c++.dg/strings/const-cfstring-5.mm: Likewise ++ * obj-c++.dg/strings/const-str-12.mm: Likewise. ++ * obj-c++.dg/syntax-error-1.mm: Likewise. ++ * obj-c++.dg/torture/strings/const-cfstring-1.mm: Likewise. ++ * obj-c++.dg/torture/strings/const-str-10.mm: Likewise. ++ * obj-c++.dg/torture/strings/const-str-11.mm: Likewise. ++ * obj-c++.dg/torture/strings/const-str-9.mm: Likewise. ++ * obj-c++.dg/cxx-ivars-3.mm: Skip on later Darwin, where the 10.4 API ++ in no longer supported, also on m64 where there's no meaning to it. ++ * obj-c++.dg/isa-field-1.mm: Suppress unwanted warning, add comment why. ++ * obj-c++.dg/objc-gc-3.mm: Skip for Darwin > 16, the API use is an error ++ there. ++ * obj-c++.dg/qual-types-1.mm: Prune a spurious l64 warning. ++ * obj-c++.dg/stubify-1.mm: Tidy up after better compiler warnings. ++ * obj-c++.dg/stubify-2.mm: Likewise. ++ * obj-c++.dg/try-catch-1.mm: Likewise. ++ * obj-c++.dg/try-catch-3.mm: Likewise. + -+2019-08-14 Iain Sandoe ++ Backport from mainline. ++ 2019-06-15 Iain Sandoe ++ ++ PR objc/90709 ++ * objc.dg/encode-7-next-64bit.m: Use proxy headers. ++ * objc.dg/image-info.m: Likewise. ++ * objc.dg/method-6.m: Likewise. ++ * objc.dg/no-extra-load.m: Likewise. ++ * objc.dg/objc-foreach-4.m: Likewise. ++ * objc.dg/objc-foreach-5.m: Likewise. ++ * objc.dg/proto-lossage-7.m: Likewise. ++ * objc.dg/strings/const-cfstring-2.m: Likewise. ++ * objc.dg/strings/const-cfstring-5.m: Likewise. ++ * objc.dg/strings/const-str-12b.m: Likewise. ++ * objc.dg/symtab-1.m: Likewise. ++ * objc.dg/torture/strings/const-cfstring-1.m: Likewise. ++ * objc.dg/torture/strings/const-str-10.m: Likewise. ++ * objc.dg/torture/strings/const-str-11.m: Likewise. ++ * objc.dg/torture/strings/const-str-9.m: Likewise. ++ * objc.dg/zero-link-1.m: Likewise. ++ * objc.dg/zero-link-2.m: Likewise. ++ * objc.dg/zero-link-3.m: Likewise. ++ * objc.dg/isa-field-1.m: Suppress unwanted warning, add comment why. ++ * objc.dg/headers.m: XFAIL for Darwin14-19. ++ * objc.dg/objc-gc-4.m: Skip for Darwin > 16, the API use is an error ++ there. + + Backport from mainline. -+ 2019-05-02 Iain Sandoe ++ 2019-06-15 Iain Sandoe + -+ * g++.dg/ext/instantiate2.C: Remove special-casing for Darwin. ++ PR objc/90709 ++ * objc-obj-c++-shared/CF-CFString.h: New. ++ * objc-obj-c++-shared/F-NSArray.h: New. ++ * objc-obj-c++-shared/F-NSAutoreleasePool.h: New. ++ * objc-obj-c++-shared/F-NSObject.h: New. ++ * objc-obj-c++-shared/F-NSString.h: New. ++ * objc-obj-c++-shared/F-NSValue.h: New. ++ * objc-obj-c++-shared/GNUStep/CoreFoundation/CFArray.h: New. ++ * objc-obj-c++-shared/GNUStep/CoreFoundation/CFAvailability.h: New. ++ * objc-obj-c++-shared/GNUStep/CoreFoundation/CFBase.h: New. ++ * objc-obj-c++-shared/GNUStep/CoreFoundation/CFCharacterSet.h: New. ++ * objc-obj-c++-shared/GNUStep/CoreFoundation/CFData.h: New. ++ * objc-obj-c++-shared/GNUStep/CoreFoundation/CFDictionary.h: New. ++ * objc-obj-c++-shared/GNUStep/CoreFoundation/CFLocale.h: New. ++ * objc-obj-c++-shared/GNUStep/CoreFoundation/CFString.h: New. ++ * objc-obj-c++-shared/GNUStep/Foundation/NSArray.h: New. ++ * objc-obj-c++-shared/GNUStep/Foundation/NSAutoreleasePool.h: New. ++ * objc-obj-c++-shared/GNUStep/Foundation/NSDate.h: New. ++ * objc-obj-c++-shared/GNUStep/Foundation/NSEnumerator.h: New. ++ * objc-obj-c++-shared/GNUStep/Foundation/NSGeometry.h: New. ++ * objc-obj-c++-shared/GNUStep/Foundation/NSObjCRuntime.h: New. ++ * objc-obj-c++-shared/GNUStep/Foundation/NSObject.h: New. ++ * objc-obj-c++-shared/GNUStep/Foundation/NSRange.h: New. ++ * objc-obj-c++-shared/GNUStep/Foundation/NSString.h: New. ++ * objc-obj-c++-shared/GNUStep/Foundation/NSValue.h: New. ++ * objc-obj-c++-shared/GNUStep/Foundation/NSZone.h: New. ++ * objc-obj-c++-shared/GNUStep/GNUstepBase/GNUstep.h: New. ++ * objc-obj-c++-shared/GNUStep/GNUstepBase/GSBlocks.h: New. ++ * objc-obj-c++-shared/GNUStep/GNUstepBase/GSConfig.h: New. ++ * objc-obj-c++-shared/GNUStep/GNUstepBase/GSObjCRuntime.h: New. ++ * objc-obj-c++-shared/GNUStep/GNUstepBase/GSVersionMacros.h: New. ++ * objc-obj-c++-shared/GNUStep/GNUstepBase/NSArray+GNUstepBase.h: New. ++ * objc-obj-c++-shared/GNUStep/GNUstepBase/NSMutableString+GNUstepBase.h: ++ New. ++ * objc-obj-c++-shared/GNUStep/GNUstepBase/NSNumber+GNUstepBase.h: New. ++ * objc-obj-c++-shared/GNUStep/GNUstepBase/NSObject+GNUstepBase.h: New. ++ * objc-obj-c++-shared/GNUStep/GNUstepBase/NSString+GNUstepBase.h: New. + -+2013-08-13 Thomas Koenig ++2019-09-01 Iain Sandoe + -+ Backport from trunk -+ PR fortran/90563 -+ * gfortran.dg/do_subscript_5.f90: New test. ++ Backport from mainline. ++ 2019-07-27 Iain Sandoe + -+2019-08-05 Kito Cheng ++ * gcc.target/powerpc/bmi2-bzhi64-1a.c: Add options to enable altivec ++ and vsx. + -+ Backport from mainline -+ 2019-08-05 Kito Cheng ++2019-09-01 Iain Sandoe + -+ * gcc.target/riscv/promote-type-for-libcall.c: New. ++ Backport from mainline. ++ 2019-07-25 Iain Sandoe + -+2019-08-02 Thomas Koenig -+ Paul Thomas ++ PR gcov-profile/91087 ++ * g++.dg/gcov/pr16855.C: Xfail the count lines for the DTORs and the ++ "final" line for the failure summaries. Adjust source layout so that ++ dejagnu xfail expressions work. + -+ Backport from trunk -+ PR fortran/90786 -+ PR fortran/90813 -+ * gfortran.dg/proc_ptr_51.f90: New test. ++2019-09-01 Iain Sandoe + -+2019-07-22 Martin Liska ++ Backport from mainline. ++ 2019-07-13 Iain Sandoe + -+ Backport from mainline -+ 2019-07-22 Martin Liska ++ * gcc.target/powerpc/stabs-attrib-vect-darwin.c: Require stabs ++ support. + -+ PR driver/91172 -+ * gcc.dg/pr91172.c: New test. ++2019-09-01 Iain Sandoe + -+2019-07-21 Richard Sandiford ++ Backport from mainline. ++ 2019-06-24 Iain Sandoe + -+ Backport from mainline -+ 2019-07-18 Richard Sandiford ++ * gcc.target/powerpc/safe-indirect-jump-1.c: Skip for Darwin. ++ * gcc.target/powerpc/safe-indirect-jump-7.c: Likewise. + -+ * c-c++-common/pr53633-2.c: New test. ++2019-09-01 Iain Sandoe + -+2019-07-16 Wilco Dijkstra ++ Backport from mainline. ++ 2019-04-15 Dominique d'Humieres + -+ Backport from mainline -+ PR target/89222 -+ * gcc.target/arm/pr89222.c: Add new test. ++ PR tree-optimization/90020 ++ * gcc.dg/torture/pr90020.c: Add linker options for darwin. + -+2019-07-16 Wilco Dijkstra ++2019-09-01 Iain Sandoe + -+ Backport from mainline -+ 2019-02-04 Wilco Dijkstra -+ PR target/89190 -+ * gcc.target/arm/pr89190.c: New test. ++ Backport from mainline. ++ 2019-05-10 Iain Sandoe + -+2019-07-15 Andreas Krebbel ++ * gcc.target/x86_64/abi/avx512f/abi-avx512f.exp: Darwin is ++ now tested. ++ * gcc.target/x86_64/abi/avx512f/asm-support-darwin.s: New. + -+ Backport from mainline -+ 2019-07-01 Andreas Krebbel ++2019-09-01 Eric Botcazou + -+ * gcc.target/s390/vector/vec-shift-2.c: New test. ++ * gcc.c-torture/execute/20190901-1.c: New test. + -+2019-07-12 Wilco Dijkstra ++2019-08-31 Iain Sandoe + -+ PR testsuite/78529 -+ * gcc.c-torture/execute/builtins/builtins.exp: Add -fno-ipa-ra. ++ Backport from mainline. ++ 2019-06-24 Iain Sandoe + -+2019-07-07 Paul Thomas ++ * gcc.target/powerpc/spec-barr-1.c: Adjust scan assembler regex ++ to recognise Darwin's register names. + -+ Backport from trunk -+ PR fortran/91077 -+ * gfortran.dg/pointer_array_11.f90 : New test. ++2019-08-31 Iain Sandoe + -+2019-07-04 Chenghua Xu ++ Backport from mainline. ++ 2019-06-24 Iain Sandoe + -+ Backported from mainline. -+ * gcc.target/mips/mips-fmadd.c: Rename to ... -+ * gcc.target/mips/mips-fmadd-o32.c: ... Here; add abi=32. -+ * gcc.target/mips/mips-fmadd-n64.c: New. ++ * gcc.dg/cpp/isysroot-1.c: Use as the test header. ++ * gcc.dg/cpp/usr/include/stdio.h: Rename... ++ * gcc.dg/cpp/usr/include/example.h: ... to this. + -+2019-07-04 Martin Liska ++2019-08-31 Iain Sandoe + -+ Backport from mainline -+ 2019-07-03 Martin Liska ++ Backport from mainline. ++ 2019-06-23 Iain Sandoe + -+ PR middle-end/90899 -+ * gcc.target/i386/pr90899.c: New test. ++ * gcc.target/powerpc/builtins-2.c: Require VSX hardware support. + -+2019-06-29 Eric Botcazou ++2019-08-31 Iain Sandoe + -+ * gnat.dg/specs/array5.ads: New test. -+ * gnat.dg/specs/array5_pkg1.ads: New helper. -+ * gnat.dg/specs/array5_pkg2.ads: Likewise. -+ * gnat.dg/specs/array5_pkg2-g.ads: Likewise. ++ Backport from mainline. ++ 2019-06-23 Iain Sandoe + -+2019-06-21 Jeff Law ++ * gcc.target/powerpc/pr80125.c (foo): Use an unsigned char ++ vector explicitly for the vec_perm. + -+ Backport fom mainline -+ 2019-06-21 Jeff Law ++2019-08-31 Iain Sandoe + -+ PR tree-optimization/90949 -+ * gcc.c-torture/execute/pr90949.c: New test. ++ Backport from mainline. ++ 2019-06-23 Iain Sandoe + -+2019-06-21 Thomas Koenig ++ * gcc.target/powerpc/pr71785.c: For Darwin, make test non-PIC, ++ expect the out-of-line GPR restore, and test specifically for ++ absence of branches to local labels. + -+ Backport from trunk -+ PR fortran/90937 -+ * gfortran.dg/external_procedure_4.f90: New test. ++2019-08-31 Iain Sandoe + -+2019-06-16 Jeff Law ++ Backport from mainline. ++ 2019-06-22 Iain Sandoe + -+ Backported from mainline -+ 2019-05-31 Dragan Mladjenovic -+ * gcc.target/mips/msa-fmadd.c: New. ++ * gcc.target/powerpc/pr64205.c: Require effective target dfp. ++ * gcc.target/powerpc/pr79909.c: Likewise. + -+2019-06-12 Thomas Koenig -+ Tomáš Trnka ++2019-08-31 Iain Sandoe + -+ Backport from trunk -+ PR fortran/90744 -+ * gfortran.dg/deferred_character_33.f90: New test. -+ * gfortran.dg/deferred_character_33a.f90: New test. ++ Backport from mainline. ++ 2019-06-22 Iain Sandoe + -+2019-06-11 Jakub Jelinek ++ * gcc.target/powerpc/darwin-bool-1.c: Suppress the pedantic ++ warning about _Bool. + -+ PR c++/90810 -+ * g++.dg/ext/vector37.C: New test. ++2019-08-31 Iain Sandoe + -+2019-06-10 Paul Thomas ++ Backport from mainline. ++ 2019-06-13 Iain Sandoe + -+ Backport from trunk -+ PR fortran/90498 -+ * gfortran.dg/associate_48.f90 : New test. ++ * g++.dg/pr71694.C: Use non-PIC codegen for Darwin m32. + -+2019-06-09 Paul Thomas ++2019-08-31 Iain Sandoe + -+ Backport from trunk -+ PR fortran/57284 -+ * gfortran.dg/assign_10.f90: Bump up counts of "atmp". -+ * gfortran.dg/transpose_optimization_2.f90: Ditto ++ Backport from mainline. ++ 2019-06-13 Iain Sandoe + -+2019-06-09 Paul Thomas ++ * gcc.dg/darwin-minversion-1.c: Use compile rather than link/run. ++ * gcc.dg/darwin-minversion-2.c: Likewise. + -+ Backport from trunk -+ PR fortran/57284 -+ * gfortran.dg/class_70.f03 ++2019-08-31 Iain Sandoe + -+2019-06-07 John David Anglin ++ Backport from mainline. ++ 2019-06-11 Iain Sandoe + -+ * lib/scanasm.exp (dg-function-on-line): Add pattern for hppa*-*-linux*. ++ PR testsuite/65364 ++ * gcc.dg/uninit-19.c (fn1): Adjust target condition for Darwin. ++ (fn2): Likewise. + -+2019-06-07 Iain Sandoe ++2019-08-31 Iain Sandoe + -+ PR target/82920 -+ * gcc.target/i386/indirect-thunk-bnd-1.c: Adjust scan-asms for Darwin, -+ do not use -fno-pic on Darwin. -+ * gcc.target/i386/indirect-thunk-bnd-2.c: Likewise. -+ * gcc.target/i386/ret-thunk-25.c: Skip for Darwin, which has a -+ different ABI for returning this category of complex value. ++ Backport from mainline. ++ 2019-06-06 Iain Sandoe + -+2019-06-07 Iain Sandoe ++ * g++.dg/cpp0x/alignas4.C: Amend test to check for zerofill syntax ++ on Darwin. ++ ++2019-08-31 Segher Boessenkool ++ ++ PR target/91481 ++ * gcc.target/powerpc/darn-3.c: Fix testcase. ++ ++2019-08-30 Iain Sandoe + + Backport from mainline. -+ 2019-05-15 Iain Sandoe ++ 2019-06-01 Iain Sandoe + -+ PR target/82920 -+ * g++.dg/cet-notrack-1.C: Adjust scan assembler for Darwin. -+ * gcc.target/i386/cet-notrack-5a.c: Likewise. -+ * gcc.target/i386/cet-notrack-5b.c: Likewise. -+ * gcc.target/i386/cet-notrack-6b.c: Likewise. -+ * gcc.target/i386/cet-notrack-icf-1.c: Likewise. -+ * gcc.target/i386/cet-notrack-icf-2.c: Likewise. -+ * gcc.target/i386/cet-notrack-icf-3.c: Likewise. -+ * gcc.target/i386/cet-notrack-icf-4.c: Likewise. -+ * gcc.target/i386/cet-sjlj-3.c: Likewise. -+ * gcc.target/i386/cet-sjlj-5.c: Likewise. ++ PR target/90698 ++ * gcc.target/i386/pr49866.c: XFAIL for Darwin. ++ * gcc.target/i386/pr63538.c: Likewise. ++ * gcc.target/i386/pr61599-1.c: Skip for Darwin. + -+2019-06-07 Iain Sandoe ++2019-08-30 Iain Sandoe + + Backport from mainline. -+ 2019-05-14 Iain Sandoe ++ 2019-05-31 Iain Sandoe + -+ PR target/82920 -+ * gcc.target/i386/cet-sjlj-6b.c: Require effective target x32. -+ * gcc.target/i386/pr52146.c: Likewise. -+ * gcc.target/i386/pr52698.c: Likewise. -+ * gcc.target/i386/pr52857-1.c: Likewise. -+ * gcc.target/i386/pr52857-2.c: Likewise. -+ * gcc.target/i386/pr52876.c: Likewise. -+ * gcc.target/i386/pr53698.c: Likewise. -+ * gcc.target/i386/pr54157.c: Likewise. -+ * gcc.target/i386/pr55049-1.c: Likewise. -+ * gcc.target/i386/pr55093.c: Likewise. -+ * gcc.target/i386/pr55116-1.c: Likewise. -+ * gcc.target/i386/pr55116-2.c: Likewise. -+ * gcc.target/i386/pr55597.c: Likewise. -+ * gcc.target/i386/pr59929.c: Likewise. -+ * gcc.target/i386/pr66470.c: Likewise. ++ * g++.dg/cpp0x/pr84497.C: Require alias support. + -+2019-06-07 Iain Sandoe ++2019-08-30 Iain Sandoe + + Backport from mainline. -+ 2019-05-12 Iain Sandoe -+ Dominique d'Humieres ++ 2019-05-30 Iain Sandoe + -+ PR target/82920 -+ * gcc.target/i386/indirect-thunk-1.c: Adjust scan-asms for Darwin, -+ do not use -fno-pic on Darwin. -+ * gcc.target/i386/indirect-thunk-2.c: Likewise. -+ * gcc.target/i386/indirect-thunk-3.c: Likewise. -+ * gcc.target/i386/indirect-thunk-4.c: Likewise. -+ * gcc.target/i386/indirect-thunk-7.c: Likewise. -+ * gcc.target/i386/indirect-thunk-attr-1.c: Likewise. -+ * gcc.target/i386/indirect-thunk-attr-2.c: Likewise. -+ * gcc.target/i386/indirect-thunk-attr-3.c: Likewise. -+ * gcc.target/i386/indirect-thunk-attr-4.c: Likewise. -+ * gcc.target/i386/indirect-thunk-attr-5.c: Likewise. -+ * gcc.target/i386/indirect-thunk-attr-6.c: Likewise. -+ * gcc.target/i386/indirect-thunk-attr-7.c: Likewise. -+ * gcc.target/i386/indirect-thunk-attr-8.c: Likewise. -+ * gcc.target/i386/indirect-thunk-extern-1.c: Likewise. ++ * gcc.target/i386/stack-prot-sym.c: Require native TLS support. ++ ++2019-08-30 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-27 Iain Sandoe ++ ++ * gcc.target/i386/pr22076.c: Adjust options to ++ match codegen expected by the scan-asms. ++ ++2019-08-30 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-26 Iain Sandoe ++ ++ * gcc.target/i386/pr39013-1.c: Adjust scan-asms for PIE to ++ account for PIC code on Darwin. ++ * gcc.target/i386/pr39013-2.c: Likewise. ++ * gcc.target/i386/pr64317.c: Likewise. ++ ++2019-08-30 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-25 Iain Sandoe ++ ++ * gcc.target/i386/pr59874-3.c: Use the spelling of popcnt ++ expected for Darwin. ++ ++2019-08-30 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-25 Iain Sandoe ++ ++ * gcc.target/i386/pr82659-3.c: Require alias support. ++ ++2019-08-30 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-24 Iain Sandoe ++ ++ * gcc.target/i386/pconfig-1.c: Scan for the string in the generated ++ code, not in comments or miscellaneous directives. ++ * gcc.target/i386/wbinvd-1.c: Likewise. ++ * gcc.target/i386/wbnoinvd-1.c: Likewise. ++ * gcc.target/i386/pr66819-3.c: Specifically, check that there is no ++ call to "bar". ++ * gcc.target/i386/pr66819-4.c: Likewise. ++ * gcc.target/i386/pr82662.c ++ ++2019-08-30 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-24 Iain Sandoe ++ ++ * gcc.target/i386/pr67985-2.c: Adjust label checks for ++ Darwin. ++ * gcc.target/i386/pr77881.c: Likewise. ++ ++2019-08-30 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-24 Iain Sandoe ++ ++ * gcc.target/i386/pr70738-7.c: Likewise. ++ * gcc.target/i386/pr24414.c: Likewise. ++ ++2019-08-30 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-23 Iain Sandoe ++ ++ PR rtl-optimisation/64895 ++ * gcc.target/i386/fuse-caller-save-rec.c: Remove XFAILs. ++ * gcc.target/i386/fuse-caller-save.c: Likewise. ++ * gcc.target/i386/fuse-caller-save-xmm.c: Adjust tests for ++ PIC cases, remove XFAILs. ++ ++2019-08-30 Richard Biener ++ ++ Backport from mainline ++ 2019-07-08 Richard Biener ++ ++ PR tree-optimization/91108 ++ * gcc.dg/tree-ssa/pr91091-1.c: New testcase. ++ * gcc.dg/tree-ssa/ssa-fre-78.c: Likewise. ++ ++2019-08-30 Segher Boessenkool ++ ++ Backport from trunk ++ 2019-08-23 Segher Boessenkool ++ ++ PR target/91481 ++ * gcc.target/powerpc/darn-3.c: New testcase. ++ ++2019-08-30 Richard Biener ++ ++ Backport from mainline ++ 2018-12-04 Richard Biener ++ ++ PR tree-optimization/88315 ++ * gcc.dg/vect/slp-reduc-sad.c: Adjust to provide non-trivial ++ initial value. ++ ++2019-08-30 Richard Biener ++ ++ Backport from mainline ++ 2019-06-18 Richard Biener ++ ++ PR debug/90900 ++ * gcc.dg/gomp/pr90900.c: New testcase. ++ ++ 2019-04-29 Richard Biener ++ ++ PR tree-optimization/90278 ++ * gcc.dg/torture/pr90278.c: New testcase. ++ ++ 2019-04-25 Richard Biener ++ ++ PR middle-end/90194 ++ * g++.dg/torture/pr90194.C: New testcase. ++ ++2019-08-30 Richard Biener ++ ++ Backport from mainline ++ 2019-07-31 Richard Biener ++ ++ PR tree-optimization/91293 ++ * gcc.dg/vect/pr91293-1.c: New testcase. ++ * gcc.dg/vect/pr91293-2.c: Likewise. ++ * gcc.dg/vect/pr91293-3.c: Likewise. ++ ++ 2019-07-31 Richard Biener ++ ++ PR tree-optimization/91280 ++ * g++.dg/torture/pr91280.C: New testcase. ++ ++ 2019-07-19 Richard Biener ++ ++ PR tree-optimization/91200 ++ * gcc.dg/torture/pr91200.c: New testcase. ++ ++ 2019-07-15 Richard Biener ++ ++ PR middle-end/91162 ++ * gcc.dg/autopar/pr91162.c: New testcase. ++ ++ 2019-07-11 Richard Biener ++ ++ PR middle-end/91131 ++ * gcc.target/i386/pr91131.c: New testcase. ++ ++ 2019-07-10 Richard Biener ++ ++ PR tree-optimization/91126 ++ * gcc.dg/torture/pr91126.c: New testcase. ++ ++2019-08-30 Richard Biener ++ ++ Backport from mainline ++ 2019-05-06 Richard Biener ++ ++ PR tree-optimization/90328 ++ * gcc.dg/torture/pr90328.c: New testcase. ++ ++ 2019-02-22 Richard Biener ++ ++ PR middle-end/87609 ++ * gcc.dg/torture/restrict-7.c: New testcase. ++ ++2019-08-30 Bin Cheng ++ ++ Backport from mainline ++ 2019-07-18 Bin Cheng ++ ++ PR tree-optimization/91137 ++ * gcc.c-torture/execute/pr91137.c: New test. ++ ++2019-08-30 Richard Biener ++ ++ Backport from mainline ++ 2019-04-08 Richard Biener ++ ++ PR tree-optimization/90006 ++ * gcc.dg/vect/bb-slp-pr90006.c: New testcase. ++ ++ 2019-04-01 Bin Cheng ++ ++ PR tree-optimization/89725 ++ * gcc.dg/tree-ssa/pr89725.c: New test. ++ ++ 2019-03-26 Bin Cheng ++ ++ PR tree-optimization/81740 ++ * gcc.dg/vect/pr81740-1.c: New testcase. ++ * gcc.dg/vect/pr81740-2.c: Likewise. ++ ++2019-08-30 Richard Biener ++ ++ Backport from mainline ++ 2019-04-11 Richard Biener ++ ++ PR tree-optimization/90020 ++ * gcc.dg/torture/pr90020.c: New testcase. ++ ++2019-08-29 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-22 Iain Sandoe ++ ++ PR testsuite/27221 ++ * g++.dg/ext/alignof2.C: XFAIL for 32bit Darwin. ++ ++2019-08-29 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-21 Iain Sandoe ++ ++ PR testsuite/67958 ++ * gcc.target/i386/pr32219-1.c: Adjust scan-asms for Darwin, comment ++ the differences. ++ * gcc.target/i386/pr32219-2.c: Likewise. ++ * gcc.target/i386/pr32219-3.c: Likewise. ++ * gcc.target/i386/pr32219-4.c: Likewise. ++ * gcc.target/i386/pr32219-5.c: Likewise. ++ * gcc.target/i386/pr32219-6.c: Likewise. ++ * gcc.target/i386/pr32219-7.c: Likewise. ++ * gcc.target/i386/pr32219-8.c: Likewise. ++ ++2019-08-29 Jakub Jelinek ++ ++ Backported from mainline ++ 2019-07-30 Jakub Jelinek ++ ++ PR target/91150 ++ * gcc.target/i386/avx512bw-pr91150.c: New test. ++ ++ 2019-07-04 Jakub Jelinek ++ ++ PR middle-end/78884 ++ * gcc.dg/gomp/pr78884.c: New test. ++ ++ PR rtl-optimization/90756 ++ * gcc.dg/pr90756.c: New test. ++ ++ 2019-06-25 Jakub Jelinek ++ ++ PR sanitizer/90954 ++ * c-c++-common/gomp/pr90954.c: New test. ++ ++ 2019-06-21 Jakub Jelinek ++ ++ PR c++/90950 ++ * g++.dg/gomp/lastprivate-1.C: New test. ++ ++ 2019-06-12 Jakub Jelinek ++ ++ PR c/90760 ++ * gcc.dg/pr90760.c: New test. ++ ++ 2019-06-05 Jakub Jelinek ++ ++ PR debug/90733 ++ * gcc.dg/pr90733.c: New test. ++ ++ 2019-05-10 Jakub Jelinek ++ ++ PR pch/90326 ++ * g++.dg/pch/pr90326.C: New test. ++ * g++.dg/pch/pr90326.Hs: New file. ++ ++ 2019-04-19 Jakub Jelinek ++ ++ PR middle-end/90139 ++ * gcc.c-torture/compile/pr90139.c: New test. ++ ++2019-08-28 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-21 Iain Sandoe ++ ++ PR target/63891 ++ * gcc.dg/darwin-weakimport-3.c: Adjust options and explain ++ the reasons. ++ ++2019-08-28 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-20 Iain Sandoe ++ ++ PR testsuite/58321 ++ * gcc.target/i386/memcpy-strategy-3.c: Adjust count for Darwin and ++ add a comment as to the reason for the difference. ++ * gcc.target/i386/memset-strategy-1.c: Likewise. ++ ++2019-08-28 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-18 Iain Sandoe ++ ++ * objc.dg/instancetype-0.m: New. ++ ++2019-08-25 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-06-13 Iain Sandoe ++ ++ * gcc.dg/darwin-minversion-link.c: New test. ++ ++2019-08-23 Mihailo Stojanovic ++ ++ * gcc.target/mips/get-fcsr-3.c: New test. ++ ++2019-08-20 Eric Botcazou ++ ++ * gcc.c-torture/execute/20190820-1.c: New test. ++ ++2019-08-15 Jonathan Wakely ++ ++ Backport from mainline. ++ 2019-08-14 Jonathan Wakely ++ ++ PR c++/91436 ++ * g++.dg/lookup/missing-std-include-5.C: Limit test to C++14 and up. ++ * g++.dg/lookup/missing-std-include-6.C: Don't check make_unique in ++ test that runs for C++11. ++ * g++.dg/lookup/missing-std-include-8.C: Check make_unique here. ++ ++2019-08-14 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-02 Iain Sandoe ++ ++ * g++.dg/ext/instantiate2.C: Remove special-casing for Darwin. ++ ++2013-08-13 Thomas Koenig ++ ++ Backport from trunk ++ PR fortran/90563 ++ * gfortran.dg/do_subscript_5.f90: New test. ++ ++2019-08-05 Kito Cheng ++ ++ Backport from mainline ++ 2019-08-05 Kito Cheng ++ ++ * gcc.target/riscv/promote-type-for-libcall.c: New. ++ ++2019-08-02 Thomas Koenig ++ Paul Thomas ++ ++ Backport from trunk ++ PR fortran/90786 ++ PR fortran/90813 ++ * gfortran.dg/proc_ptr_51.f90: New test. ++ ++2019-07-22 Martin Liska ++ ++ Backport from mainline ++ 2019-07-22 Martin Liska ++ ++ PR driver/91172 ++ * gcc.dg/pr91172.c: New test. ++ ++2019-07-21 Richard Sandiford ++ ++ Backport from mainline ++ 2019-07-18 Richard Sandiford ++ ++ * c-c++-common/pr53633-2.c: New test. ++ ++2019-07-16 Wilco Dijkstra ++ ++ Backport from mainline ++ PR target/89222 ++ * gcc.target/arm/pr89222.c: Add new test. ++ ++2019-07-16 Wilco Dijkstra ++ ++ Backport from mainline ++ 2019-02-04 Wilco Dijkstra ++ PR target/89190 ++ * gcc.target/arm/pr89190.c: New test. ++ ++2019-07-15 Andreas Krebbel ++ ++ Backport from mainline ++ 2019-07-01 Andreas Krebbel ++ ++ * gcc.target/s390/vector/vec-shift-2.c: New test. ++ ++2019-07-12 Wilco Dijkstra ++ ++ PR testsuite/78529 ++ * gcc.c-torture/execute/builtins/builtins.exp: Add -fno-ipa-ra. ++ ++2019-07-07 Paul Thomas ++ ++ Backport from trunk ++ PR fortran/91077 ++ * gfortran.dg/pointer_array_11.f90 : New test. ++ ++2019-07-04 Chenghua Xu ++ ++ Backported from mainline. ++ * gcc.target/mips/mips-fmadd.c: Rename to ... ++ * gcc.target/mips/mips-fmadd-o32.c: ... Here; add abi=32. ++ * gcc.target/mips/mips-fmadd-n64.c: New. ++ ++2019-07-04 Martin Liska ++ ++ Backport from mainline ++ 2019-07-03 Martin Liska ++ ++ PR middle-end/90899 ++ * gcc.target/i386/pr90899.c: New test. ++ ++2019-06-29 Eric Botcazou ++ ++ * gnat.dg/specs/array5.ads: New test. ++ * gnat.dg/specs/array5_pkg1.ads: New helper. ++ * gnat.dg/specs/array5_pkg2.ads: Likewise. ++ * gnat.dg/specs/array5_pkg2-g.ads: Likewise. ++ ++2019-06-21 Jeff Law ++ ++ Backport fom mainline ++ 2019-06-21 Jeff Law ++ ++ PR tree-optimization/90949 ++ * gcc.c-torture/execute/pr90949.c: New test. ++ ++2019-06-21 Thomas Koenig ++ ++ Backport from trunk ++ PR fortran/90937 ++ * gfortran.dg/external_procedure_4.f90: New test. ++ ++2019-06-16 Jeff Law ++ ++ Backported from mainline ++ 2019-05-31 Dragan Mladjenovic ++ * gcc.target/mips/msa-fmadd.c: New. ++ ++2019-06-12 Thomas Koenig ++ Tomáš Trnka ++ ++ Backport from trunk ++ PR fortran/90744 ++ * gfortran.dg/deferred_character_33.f90: New test. ++ * gfortran.dg/deferred_character_33a.f90: New test. ++ ++2019-06-11 Jakub Jelinek ++ ++ PR c++/90810 ++ * g++.dg/ext/vector37.C: New test. ++ ++2019-06-10 Paul Thomas ++ ++ Backport from trunk ++ PR fortran/90498 ++ * gfortran.dg/associate_48.f90 : New test. ++ ++2019-06-09 Paul Thomas ++ ++ Backport from trunk ++ PR fortran/57284 ++ * gfortran.dg/assign_10.f90: Bump up counts of "atmp". ++ * gfortran.dg/transpose_optimization_2.f90: Ditto ++ ++2019-06-09 Paul Thomas ++ ++ Backport from trunk ++ PR fortran/57284 ++ * gfortran.dg/class_70.f03 ++ ++2019-06-07 John David Anglin ++ ++ * lib/scanasm.exp (dg-function-on-line): Add pattern for hppa*-*-linux*. ++ ++2019-06-07 Iain Sandoe ++ ++ PR target/82920 ++ * gcc.target/i386/indirect-thunk-bnd-1.c: Adjust scan-asms for Darwin, ++ do not use -fno-pic on Darwin. ++ * gcc.target/i386/indirect-thunk-bnd-2.c: Likewise. ++ * gcc.target/i386/ret-thunk-25.c: Skip for Darwin, which has a ++ different ABI for returning this category of complex value. ++ ++2019-06-07 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-15 Iain Sandoe ++ ++ PR target/82920 ++ * g++.dg/cet-notrack-1.C: Adjust scan assembler for Darwin. ++ * gcc.target/i386/cet-notrack-5a.c: Likewise. ++ * gcc.target/i386/cet-notrack-5b.c: Likewise. ++ * gcc.target/i386/cet-notrack-6b.c: Likewise. ++ * gcc.target/i386/cet-notrack-icf-1.c: Likewise. ++ * gcc.target/i386/cet-notrack-icf-2.c: Likewise. ++ * gcc.target/i386/cet-notrack-icf-3.c: Likewise. ++ * gcc.target/i386/cet-notrack-icf-4.c: Likewise. ++ * gcc.target/i386/cet-sjlj-3.c: Likewise. ++ * gcc.target/i386/cet-sjlj-5.c: Likewise. ++ ++2019-06-07 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-14 Iain Sandoe ++ ++ PR target/82920 ++ * gcc.target/i386/cet-sjlj-6b.c: Require effective target x32. ++ * gcc.target/i386/pr52146.c: Likewise. ++ * gcc.target/i386/pr52698.c: Likewise. ++ * gcc.target/i386/pr52857-1.c: Likewise. ++ * gcc.target/i386/pr52857-2.c: Likewise. ++ * gcc.target/i386/pr52876.c: Likewise. ++ * gcc.target/i386/pr53698.c: Likewise. ++ * gcc.target/i386/pr54157.c: Likewise. ++ * gcc.target/i386/pr55049-1.c: Likewise. ++ * gcc.target/i386/pr55093.c: Likewise. ++ * gcc.target/i386/pr55116-1.c: Likewise. ++ * gcc.target/i386/pr55116-2.c: Likewise. ++ * gcc.target/i386/pr55597.c: Likewise. ++ * gcc.target/i386/pr59929.c: Likewise. ++ * gcc.target/i386/pr66470.c: Likewise. ++ ++2019-06-07 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-05-12 Iain Sandoe ++ Dominique d'Humieres ++ ++ PR target/82920 ++ * gcc.target/i386/indirect-thunk-1.c: Adjust scan-asms for Darwin, ++ do not use -fno-pic on Darwin. ++ * gcc.target/i386/indirect-thunk-2.c: Likewise. ++ * gcc.target/i386/indirect-thunk-3.c: Likewise. ++ * gcc.target/i386/indirect-thunk-4.c: Likewise. ++ * gcc.target/i386/indirect-thunk-7.c: Likewise. ++ * gcc.target/i386/indirect-thunk-attr-1.c: Likewise. ++ * gcc.target/i386/indirect-thunk-attr-2.c: Likewise. ++ * gcc.target/i386/indirect-thunk-attr-3.c: Likewise. ++ * gcc.target/i386/indirect-thunk-attr-4.c: Likewise. ++ * gcc.target/i386/indirect-thunk-attr-5.c: Likewise. ++ * gcc.target/i386/indirect-thunk-attr-6.c: Likewise. ++ * gcc.target/i386/indirect-thunk-attr-7.c: Likewise. ++ * gcc.target/i386/indirect-thunk-attr-8.c: Likewise. ++ * gcc.target/i386/indirect-thunk-extern-1.c: Likewise. + * gcc.target/i386/indirect-thunk-extern-2.c: Likewise. + * gcc.target/i386/indirect-thunk-extern-3.c: Likewise. + * gcc.target/i386/indirect-thunk-extern-4.c: Likewise. @@ -22521,187 +27389,9787 @@ + Backport from mainline + 2019-03-08 Martin Liska + -+ PR target/86952 -+ * gcc.target/i386/indirect-thunk-7.c: Use jump tables to match -+ scanned pattern. -+ * gcc.target/i386/indirect-thunk-inline-7.c: Likewise. ++ PR target/86952 ++ * gcc.target/i386/indirect-thunk-7.c: Use jump tables to match ++ scanned pattern. ++ * gcc.target/i386/indirect-thunk-inline-7.c: Likewise. ++ ++2019-03-10 Thomas Koenig ++ ++ PR fortran/71544 ++ Backport from trunk ++ * gfortran.dg/c_ptr_tests_19.f90: New test. ++ ++2019-03-10 Thomas Koenig ++ ++ PR fortran/87734 ++ Backport from trunk ++ * gfortran.dg/public_private_module_10.f90: New test. ++ ++2019-03-08 Martin Jambor ++ ++ Backport from mainline ++ 2019-03-07 Martin Jambor ++ ++ * g++.dg/ipa/pr88235.C: New test. ++ ++2019-03-07 Jakub Jelinek ++ ++ PR c++/89585 ++ * g++.dg/asm-qual-3.C: Adjust expected diagnostics. ++ ++2019-03-06 Harald Anlauf ++ ++ Backport from trunk ++ PR fortran/71203 ++ * gfortran.dg/substr_8.f90: New test. ++ ++2019-03-06 Thomas Koenig ++ ++ PR fortran/72714 ++ Backport from trunk ++ * gfortran.dg/coarray_allocate_11.f90: New test. ++ ++2019-03-06 Tamar Christina ++ ++ Backport from trunk. ++ 2019-02-25 Tamar Christina ++ ++ PR target/88530 ++ * common/config/aarch64/aarch64-common.c ++ (struct aarch64_option_extension): Add is_synthetic. ++ (all_extensions): Use it. ++ (TARGET_OPTION_INIT_STRUCT): Define hook. ++ (struct gcc_targetm_common): Moved to end. ++ (all_extensions_by_on): New. ++ (opt_ext_cmp, typedef opt_ext): New. ++ (aarch64_option_init_struct): New. ++ (aarch64_contains_opt): New. ++ (aarch64_get_extension_string_for_isa_flags): Output smallest set. ++ * config/aarch64/aarch64-option-extensions.def ++ (AARCH64_OPT_EXTENSION): Explicitly include AES and SHA2 in crypto. ++ (fp, simd, crc, lse, fp16, rcpc, rdma, dotprod, aes, sha2, sha3, ++ sm4, fp16fml, sve): ++ Set is_synthetic to false. ++ (crypto): Set is_synthetic to true. ++ * config/aarch64/driver-aarch64.c (AARCH64_OPT_EXTENSION): Add ++ SYNTHETIC. ++ ++2019-03-06 Tamar Christina ++ ++ Backport from trunk. ++ 2019-02-28 Tamar Christina ++ ++ PR target/88530 ++ * gcc.target/aarch64/options_set_10.c: New test. ++ ++2019-03-06 Xiong Hu Luo ++ ++ Backport of r268834 from mainline to gcc-8-branch. ++ 2019-01-23 Xiong Hu Luo ++ ++ * gcc.target/powerpc/crypto-builtin-1.c ++ (crypto1_be, crypto2_be, crypto3_be, crypto4_be, crypto5_be): ++ New testcases. ++ ++2019-03-05 Richard Biener ++ ++ Backport from mainline ++ 2019-02-26 Richard Biener ++ ++ PR tree-optimization/89505 ++ * gcc.dg/torture/pr89505.c: New testcase. ++ ++2019-03-03 Harald Anlauf ++ ++ Backport from trunk ++ PR fortran/89077 ++ * gfortran.dg/transfer_simplify_12.f90: New test. ++ * gfortran.dg/substr_simplify.f90: New test. ++ ++2019-03-03 Harald Anlauf ++ ++ Backport from trunk ++ PR fortran/77583 ++ * gfortran.dg/pr77583.f90: New test. ++ ++2019-03-03 Thomas Koenig ++ ++ PR fortran/89174 ++ Backport from trunk ++ * gfortran.dg/allocate_with_mold_3.f90: New test. ++ ++2019-03-03 Thomas Koenig ++ ++ PR fortran/87689 ++ Backport from trunk ++ * gfortran.dg/lto/20091028-1_0.f90: Add -Wno-lto-type-mismatch to ++ options. ++ * gfortran.dg/lto/20091028-2_0.f90: Likewise. ++ * gfortran.dg/lto/pr87689_0.f: New file. ++ * gfortran.dg/lto/pr87689_1.f: New file. ++ * gfortran.dg/altreturn_9_0.f90: New file. ++ * gfortran.dg/altreturn_9_1.f90: New file. ++ ++2019-03-02 Jerry DeLisle ++ ++ Backport from trunk ++ PR fortran/84387 ++ * gfortran.dg/dtio_34.f90: New test. ++ ++2019-03-02 Harald Anlauf ++ ++ Backport from trunk ++ PR fortran/89516 ++ * gfortran.dg/pr89492.f90: Adjust testcase. ++ * gfortran.dg/transfer_check_5.f90: New test. ++ ++ PR fortran/89492 ++ * gfortran.dg/pr89492.f90: New test. ++ ++ PR fortran/89266 ++ PR fortran/88326 ++ * gfortran.dg/pr89266.f90: New test. ++ * gfortran.dg/pr88326.f90: New test. ++ ++2019-02-28 Eric Botcazou ++ ++ * gcc.c-torture/execute/20190228-1.c: New test. ++ ++2019-02-28 Li Jia He ++ ++ Backport from trunk ++ 2019-02-20 Li Jia He ++ ++ PR target/88100 ++ * gcc/testsuite/gcc.target/powerpc/pr88100.c: New testcase. ++ ++2019-02-26 Eric Botcazou ++ ++ * gnat.dg/opt77.adb: New test. ++ * gnat.dg/opt77_pkg.ad[sb]: New helper. ++ ++2019-02-23 Thomas Koenig ++ ++ PR fortran/86119 ++ Backport from trunk ++ * gfortran.dg/warn_conversion_11.f90: New test. ++ ++2019-02-23 Paul Thomas ++ ++ Backport from trunk ++ PR fortran/88117 ++ * gfortran.dg/deferred_character_32.f90: New test ++ ++2019-02-12 Thomas Koenig ++ ++ PR fortran/71066 ++ Backport from trunk ++ * gfortran.dg/coarray_data_1.f90: New test. ++ + 2019-02-22 Release Manager + + * GCC 8.3.0 released. +Index: gcc/testsuite/objc-obj-c++-shared/F-NSObject.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/F-NSObject.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/F-NSObject.h (.../branches/gcc-8-branch) +@@ -0,0 +1,33 @@ ++/* Copyright (C) 2019 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#ifndef _OBJC_F_NSOBJECT_H_ ++#define _OBJC_F_NSOBJECT_H_ ++ ++/* This is a workaround to PR90709 for the NeXT runtime. ++ If we're on a system version that has headers with items we can't ++ consume, then use the GNUStep header instead. ++*/ ++ ++#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1090 ++# import "GNUStep/Foundation/NSObject.h" ++#else ++# import ++#endif ++ ++#endif /* _OBJC_F_NSOBJECT_H_ */ +Index: gcc/testsuite/objc-obj-c++-shared/F-NSString.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/F-NSString.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/F-NSString.h (.../branches/gcc-8-branch) +@@ -0,0 +1,33 @@ ++/* Copyright (C) 2019 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#ifndef _OBJC_F_NSSTRING_H_ ++#define _OBJC_F_NSSTRING_H_ ++ ++/* This is a workaround to PR90709 for the NeXT runtime. ++ If we're on a system version that has headers with items we can't ++ consume, then use the GNUStep header instead. ++*/ ++ ++#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1090 ++# import "GNUStep/Foundation/NSString.h" ++#else ++# import ++#endif ++ ++#endif /* _OBJC_F_NSSTRING_H_ */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFDictionary.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFDictionary.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFDictionary.h (.../branches/gcc-8-branch) +@@ -0,0 +1,174 @@ ++/* CFDictionary.h ++ ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ ++ Written by: Stefan Bidigaray ++ Date: January, 2010 ++ ++ This file is part of the GNUstep CoreBase Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; see the file COPYING.LIB. ++ If not, see or write to the ++ Free Software Foundation, 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++#ifndef __COREFOUNDATION_CFDICTIONARY_H__ ++#define __COREFOUNDATION_CFDICTIONARY_H__ 1 ++ ++#include "CFBase.h" ++ ++CF_EXTERN_C_BEGIN ++/** \ingroup CFDictionaryRef */ ++typedef const struct __CFDictionary *CFDictionaryRef; ++/** \ingroup CFMutableDictionaryRef */ ++typedef struct __CFDictionary *CFMutableDictionaryRef; ++ ++/** \defgroup CFDictionaryRef CFDictionary Reference ++ \{ ++ */ ++typedef void (*CFDictionaryApplierFunction) (const void *key, ++ const void *value, void *context); ++ ++typedef CFStringRef (*CFDictionaryCopyDescriptionCallBack) (const void *value); ++typedef Boolean (*CFDictionaryEqualCallBack) (const void *value1, ++ const void *value2); ++typedef CFHashCode (*CFDictionaryHashCallBack) (const void *value); ++typedef void (*CFDictionaryReleaseCallBack) (CFAllocatorRef allocator, ++ const void *value); ++typedef const void *(*CFDictionaryRetainCallBack) (CFAllocatorRef allocator, ++ const void *value); ++ ++typedef struct _CFDictionaryKeyCallBacks CFDictionaryKeyCallBacks; ++struct _CFDictionaryKeyCallBacks ++{ ++ CFIndex version; ++ CFDictionaryRetainCallBack retain; ++ CFDictionaryReleaseCallBack release; ++ CFDictionaryCopyDescriptionCallBack copyDescription; ++ CFDictionaryEqualCallBack equal; ++ CFDictionaryHashCallBack hash; ++}; ++ ++typedef struct _CFDictionaryValueCallBacks CFDictionaryValueCallBacks; ++struct _CFDictionaryValueCallBacks ++{ ++ CFIndex version; ++ CFDictionaryRetainCallBack retain; ++ CFDictionaryReleaseCallBack release; ++ CFDictionaryCopyDescriptionCallBack copyDescription; ++ CFDictionaryEqualCallBack equal; ++}; ++ ++CF_EXPORT const CFDictionaryKeyCallBacks kCFCopyStringDictionaryKeyCallBacks; ++CF_EXPORT const CFDictionaryKeyCallBacks kCFTypeDictionaryKeyCallBacks; ++CF_EXPORT const CFDictionaryValueCallBacks kCFTypeDictionaryValueCallBacks; ++ ++/** \name Creating a dictionary ++ \{ ++ */ ++CF_EXPORT CFDictionaryRef ++CFDictionaryCreate (CFAllocatorRef allocator, const void **keys, ++ const void **values, CFIndex numValues, ++ const CFDictionaryKeyCallBacks * keyCallBacks, ++ const CFDictionaryValueCallBacks * valueCallBacks); ++ ++CF_EXPORT CFDictionaryRef ++CFDictionaryCreateCopy (CFAllocatorRef allocator, CFDictionaryRef theDict); ++/** \} */ ++ ++/** \name Examining a dictionary ++ \{ ++ */ ++CF_EXPORT Boolean ++CFDictionaryContainsKey (CFDictionaryRef theDict, const void *key); ++ ++CF_EXPORT Boolean ++CFDictionaryContainsValue (CFDictionaryRef theDict, const void *value); ++ ++CF_EXPORT CFIndex CFDictionaryGetCount (CFDictionaryRef theDict); ++ ++CF_EXPORT CFIndex ++CFDictionaryGetCountOfKey (CFDictionaryRef theDict, const void *key); ++ ++CF_EXPORT CFIndex ++CFDictionaryGetCountOfValue (CFDictionaryRef theDict, const void *value); ++ ++CF_EXPORT void ++CFDictionaryGetKeysAndValues (CFDictionaryRef theDict, const void **keys, ++ const void **values); ++ ++CF_EXPORT const void *CFDictionaryGetValue (CFDictionaryRef theDict, ++ const void *key); ++ ++CF_EXPORT Boolean ++CFDictionaryGetValueIfPresent (CFDictionaryRef theDict, const void *key, ++ const void **value); ++/** \} */ ++ ++/** \name Applying a funcation to a dictionary ++ \{ ++ */ ++CF_EXPORT void ++CFDictionaryApplyFunction (CFDictionaryRef theDict, ++ CFDictionaryApplierFunction applier, void *context); ++/** \} */ ++ ++/** \name Getting the CFDictionary type ID ++ \{ ++ */ ++CF_EXPORT CFTypeID CFDictionaryGetTypeID (void); ++/** \} */ ++/** \} */ ++ ++/** \defgroup CFMutableDictionaryRef CFMutableDictionary Reference ++ \{ ++ */ ++/** \name Creating a Mutable Dictionary ++ \{ ++ */ ++CF_EXPORT CFMutableDictionaryRef ++CFDictionaryCreateMutable (CFAllocatorRef allocator, CFIndex capacity, ++ const CFDictionaryKeyCallBacks * keyCallBacks, ++ const CFDictionaryValueCallBacks * valueCallBacks); ++ ++CF_EXPORT CFMutableDictionaryRef ++CFDictionaryCreateMutableCopy (CFAllocatorRef allocator, CFIndex capacity, ++ CFDictionaryRef theDict); ++/** \} */ ++ ++/** \name Modifying a Dictionary ++ \{ ++ */ ++CF_EXPORT void ++CFDictionaryAddValue (CFMutableDictionaryRef theDict, const void *key, ++ const void *value); ++ ++CF_EXPORT void CFDictionaryRemoveAllValues (CFMutableDictionaryRef theDict); ++ ++CF_EXPORT void ++CFDictionaryRemoveValue (CFMutableDictionaryRef theDict, const void *key); ++ ++CF_EXPORT void ++CFDictionaryReplaceValue (CFMutableDictionaryRef theDict, const void *key, ++ const void *value); ++ ++CF_EXPORT void ++CFDictionarySetValue (CFMutableDictionaryRef theDict, const void *key, ++ const void *value); ++/** \} */ ++/** \} */ ++ ++CF_EXTERN_C_END ++#endif /* __COREFOUNDATION_CFDICTIONARY_H__ */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFString.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFString.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFString.h (.../branches/gcc-8-branch) +@@ -0,0 +1,593 @@ ++/* CFString.h ++ ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ ++ Written by: Stefan Bidigaray ++ Date: January, 2010 ++ ++ This file is part of CoreBase. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; see the file COPYING.LIB. ++ If not, see or write to the ++ Free Software Foundation, 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++#ifndef __COREFOUNDATION_CFSTRING_H__ ++#define __COREFOUNDATION_CFSTRING_H__ ++ ++#include "CFBase.h" ++#include "CFArray.h" ++#include "CFCharacterSet.h" ++#include "CFData.h" ++#include "CFDictionary.h" ++#include "CFLocale.h" ++ ++#include ++ ++CF_EXTERN_C_BEGIN ++ ++/** \defgroup CFStringRef CFString Reference ++ \brief The CFString type defines opaque objects representing strings. ++ ++ CFString is "toll-free bridged" to NSString. ++ ++ \{ ++ */ ++ ++/* ++ * Data Types ++ */ ++typedef UInt32 CFStringEncoding; ++ ++/* ++ * Constants ++ */ ++typedef enum ++{ ++ kCFCompareCaseInsensitive = 1, ++ kCFCompareBackwards = 4, ++ kCFCompareAnchored = 8, ++ kCFCompareNonliteral = 16, ++ kCFCompareLocalized = 32, ++ kCFCompareNumerically = 64, ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++ kCFCompareDiacriticInsensitive = 128, ++ kCFCompareWidthInsensitive = 256, ++ kCFCompareForcedOrdering = 512 ++#endif ++} CFStringCompareFlags; ++ ++enum CFStringBuiltInEncodings ++{ ++ kCFStringEncodingMacRoman = 0, ++ kCFStringEncodingWindowsLatin1 = 0x0500, ++ kCFStringEncodingISOLatin1 = 0x0201, ++ kCFStringEncodingNextStepLatin = 0x0B01, ++ kCFStringEncodingASCII = 0x0600, ++ kCFStringEncodingUnicode = 0x0100, ++ kCFStringEncodingUTF8 = 0x08000100, ++ kCFStringEncodingNonLossyASCII = 0x0BFF, ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++ kCFStringEncodingUTF16 = 0x0100, ++ kCFStringEncodingUTF16BE = 0x10000100, ++ kCFStringEncodingUTF16LE = 0x14000100, ++ kCFStringEncodingUTF32 = 0x0c000100, ++ kCFStringEncodingUTF32BE = 0x18000100, ++ kCFStringEncodingUTF32LE = 0x1c000100 ++#endif ++}; ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) ++# define kCFStringEncodingInvalidId (0xffffffffU) ++#endif ++ ++/** \def CFSTR(x) ++ \brief Creates a constant string object. ++ ++ \note This macro will create the constant string at runtime. ++ */ ++/* The 'pure' attribute tells the compiler that this function will always ++ return the same result with the same input. If it has any skill, then ++ constant propagation passes will magically make sure that this function is ++ called as few times as possible. */ ++CF_EXPORT CFStringRef ++__CFStringMakeConstantString (const char *str) GS_PURE_FUNCTION; ++//#define CFSTR(x) __CFStringMakeConstantString("" x "") ++ ++#ifdef __CONSTANT_CFSTRINGS__ ++#define CFSTR(x) ((CFStringRef) __builtin___CFStringMakeConstantString ("" x "")) ++#else ++#define CFSTR(x) __CFStringMakeConstantString("" x "") ++#endif ++ ++/** \name Creating a CFString ++ \{ ++ */ ++CF_EXPORT CFArrayRef ++CFStringCreateArrayBySeparatingStrings (CFAllocatorRef alloc, ++ CFStringRef theString, CFStringRef separatorString); ++ ++CF_EXPORT CFStringRef ++CFStringCreateByCombiningStrings (CFAllocatorRef alloc, CFArrayRef theArray, ++ CFStringRef separatorString); ++ ++CF_EXPORT CFStringRef ++CFStringCreateCopy (CFAllocatorRef alloc, CFStringRef theString); ++ ++CF_EXPORT CFStringRef ++CFStringCreateFromExternalRepresentation (CFAllocatorRef alloc, CFDataRef data, ++ CFStringEncoding encoding); ++ ++CF_EXPORT CFStringRef ++CFStringCreateWithBytes (CFAllocatorRef alloc, const UInt8 *bytes, ++ CFIndex numBytes, CFStringEncoding encoding, Boolean isExternalRepresentation); ++ ++CF_EXPORT CFStringRef ++CFStringCreateWithCharacters (CFAllocatorRef alloc, const UniChar *chars, ++ CFIndex numChars); ++ ++CF_EXPORT CFStringRef ++CFStringCreateWithCharactersNoCopy (CFAllocatorRef alloc, const UniChar *chars, ++ CFIndex numChars, CFAllocatorRef contentsDeallocator); ++ ++CF_EXPORT CFStringRef ++CFStringCreateWithCString (CFAllocatorRef alloc, const char *cStr, ++ CFStringEncoding encoding); ++ ++CF_EXPORT CFStringRef ++CFStringCreateWithCStringNoCopy (CFAllocatorRef alloc, const char *cStr, ++ CFStringEncoding encoding, CFAllocatorRef contentsDeallocator); ++ ++CF_EXPORT CFStringRef ++CFStringCreateWithFormat (CFAllocatorRef alloc, CFDictionaryRef formatOptions, ++ CFStringRef format, ...); ++ ++CF_EXPORT CFStringRef ++CFStringCreateWithFormatAndArguments (CFAllocatorRef alloc, ++ CFDictionaryRef formatOptions, CFStringRef format, va_list arguments); ++ ++CF_EXPORT CFStringRef ++CFStringCreateWithSubstring (CFAllocatorRef alloc, CFStringRef str, ++ CFRange range); ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++CF_EXPORT CFStringRef ++CFStringCreateWithFileSystemRepresentation (CFAllocatorRef alloc, ++ const char *buffer); ++#endif ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++CF_EXPORT CFStringRef ++CFStringCreateWithBytesNoCopy (CFAllocatorRef alloc, const UInt8 *bytes, ++ CFIndex numBytes, CFStringEncoding encoding, Boolean isExternalReprentation, ++ CFAllocatorRef contentsDeallocator); ++#endif ++/** \} */ ++ ++/** \name Searching CFStrings ++ \{ ++ */ ++CF_EXPORT CFArrayRef ++CFStringCreateArrayWithFindResults (CFAllocatorRef alloc, CFStringRef theString, ++ CFStringRef stringToFind, CFRange rangeToSearch, ++ CFStringCompareFlags compareOptions); ++ ++CF_EXPORT CFRange ++CFStringFind (CFStringRef theString, CFStringRef stringToFind, ++ CFStringCompareFlags compareOptions); ++ ++CF_EXPORT Boolean ++CFStringFindWithOptions (CFStringRef theString, CFStringRef stringToFind, ++ CFRange rangeToSearch, CFStringCompareFlags searchOptions, CFRange *result); ++ ++CF_EXPORT Boolean ++CFStringFindWithOptionsAndLocale (CFStringRef theString,CFStringRef stringToFind, ++ CFRange rangeToSearch, CFStringCompareFlags searchOptions, ++ CFLocaleRef locale, CFRange *result); ++ ++CF_EXPORT void ++CFStringGetLineBounds (CFStringRef theString, CFRange range, ++ CFIndex *lineBeginIndex, CFIndex *lineEndIndex, CFIndex *contentsEndIndex); ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) ++CF_EXPORT Boolean ++CFStringFindCharacterFromSet (CFStringRef theString, CFCharacterSetRef theSet, ++ CFRange rangeToSearch, CFStringCompareFlags searchOptions, CFRange *result); ++#endif ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++CF_EXPORT void ++CFStringGetParagraphBounds (CFStringRef string, CFRange range, ++ CFIndex *parBeginIndex, CFIndex *parEndIndex, CFIndex *contentsEndIndex); ++#endif ++/** \} */ ++ ++/** \name Comparing String ++ \{ ++ */ ++CF_EXPORT CFComparisonResult ++CFStringCompare (CFStringRef theString1, CFStringRef theString2, ++ CFStringCompareFlags compareOptions); ++ ++CF_EXPORT CFComparisonResult ++CFStringCompareWithOptions (CFStringRef theString1, CFStringRef theString2, ++ CFRange rangeToCOmpare, CFStringCompareFlags compareOptions); ++ ++CF_EXPORT Boolean ++CFStringHasPrefix (CFStringRef theString, CFStringRef prefix); ++ ++CF_EXPORT Boolean ++CFStringHasSuffix (CFStringRef theString, CFStringRef suffix); ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++CF_EXPORT CFComparisonResult ++CFStringCompareWithOptionsAndLocale (CFStringRef theString1, ++ CFStringRef theString2, CFRange rangeToCOmpare, ++ CFStringCompareFlags compareOptions, CFLocaleRef locale); ++#endif ++/** \} */ ++ ++/** \name Accessing Characters ++ \{ ++ */ ++CF_EXPORT CFDataRef ++CFStringCreateExternalRepresentation (CFAllocatorRef alloc, ++ CFStringRef theString, CFStringEncoding encoding, UInt8 lossByte); ++ ++CF_EXPORT CFIndex ++CFStringGetBytes (CFStringRef theString, CFRange range, ++ CFStringEncoding encoding, UInt8 lossByte, Boolean isExternalRepresentation, ++ UInt8 *buffer, CFIndex maxBufLen, CFIndex *usedBufLen); ++ ++CF_EXPORT UniChar ++CFStringGetCharacterAtIndex (CFStringRef theString, CFIndex idx); ++ ++CF_EXPORT void ++CFStringGetCharacters (CFStringRef theString, CFRange range, UniChar *buffer); ++ ++CF_EXPORT const UniChar * ++CFStringGetCharactersPtr (CFStringRef theString); ++ ++CF_EXPORT Boolean ++CFStringGetCString (CFStringRef theString, char *buffer, CFIndex bufferSize, ++ CFStringEncoding encoding); ++ ++CF_EXPORT const char * ++CFStringGetCStringPtr (CFStringRef theString, CFStringEncoding encoding); ++ ++CF_EXPORT CFIndex ++CFStringGetLength (CFStringRef str); ++ ++CF_EXPORT CFRange ++CFStringGetRangeOfComposedCharactersAtIndex (CFStringRef theString, ++ CFIndex theIndex); ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) ++CF_EXPORT UTF32Char ++CFStringGetLongCharacterForSurrogatePair (UniChar surrogateHigh, ++ UniChar surrogateLow); ++ ++CF_EXPORT Boolean ++CFStringGetSurrogatePairForLongCharacter (UTF32Char character, ++ UniChar *surrogates); ++ ++CF_EXPORT Boolean ++CFStringIsSurrogateHighCharacter (UniChar character); ++ ++CF_EXPORT Boolean ++CFStringIsSurrogateLowCharacter (UniChar character); ++#endif ++/** \} */ ++ ++/** \name Working with Encodings ++ \{ ++ */ ++CF_EXPORT CFStringRef ++CFStringConvertEncodingToIANACharSetName (CFStringEncoding encoding); ++ ++CF_EXPORT unsigned long ++CFStringConvertEncodingToNSStringEncoding (CFStringEncoding encoding); ++ ++UInt32 ++CFStringConvertEncodingToWindowsCodepage (CFStringEncoding encoding); ++ ++CF_EXPORT CFStringEncoding ++CFStringConvertIANACharSetNameToEncoding (CFStringRef theString); ++ ++CF_EXPORT CFStringEncoding ++CFStringConvertNSStringEncodingToEncoding (unsigned long encoding); ++ ++CF_EXPORT CFStringEncoding ++CFStringConvertWindowsCodepageToEncoding (UInt32 codepage); ++ ++CF_EXPORT CFStringEncoding ++CFStringGetFastestEncoding (CFStringRef theString); ++ ++CF_EXPORT const CFStringEncoding * ++CFStringGetListOfAvailableEncodings (void); ++ ++CF_EXPORT CFIndex ++CFStringGetMaximumSizeForEncoding (CFIndex length, CFStringEncoding encoding); ++ ++CF_EXPORT CFStringEncoding ++CFStringGetMostCompatibleMacStringEncoding (CFStringEncoding encoding); ++ ++CF_EXPORT CFStringRef ++CFStringGetNameOfEncoding (CFStringEncoding encoding); ++ ++CF_EXPORT CFStringEncoding ++CFStringGetSmallestEncoding (CFStringRef theString); ++ ++CF_EXPORT CFStringEncoding ++CFStringGetSystemEncoding (void); ++ ++CF_EXPORT Boolean ++CFStringIsEncodingAvailable (CFStringEncoding encoding); ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++CF_EXPORT Boolean ++CFStringGetFileSystemRepresentation (CFStringRef string, char *buffer, ++ CFIndex maxBufLen); ++ ++CF_EXPORT CFIndex ++CFStringGetMaximumSizeOfFileSystemRepresentation (CFStringRef string); ++#endif ++/** \} */ ++ ++/** \name Getting Numeric Values ++ \{ ++ */ ++CF_EXPORT double ++CFStringGetDoubleValue (CFStringRef str); ++ ++CF_EXPORT SInt32 ++CFStringGetIntValue (CFStringRef str); ++/** \} */ ++ ++/** \name Getting String Properties ++ \{ ++ */ ++CF_EXPORT void ++CFShow (CFTypeRef obj); ++ ++CF_EXPORT void ++CFShowStr (CFStringRef str); ++ ++CF_EXPORT CFTypeID ++CFStringGetTypeID (void); ++/** \} */ ++ ++ ++ ++/** \name Pascal Strings ++ \{ ++ */ ++CF_EXPORT CFStringRef ++CFStringCreateWithPascalString (CFAllocatorRef alloc, ConstStr255Param pStr, ++ CFStringEncoding encoding); ++ ++CF_EXPORT CFStringRef ++CFStringCreateWithPascalStringNoCopy (CFAllocatorRef alloc, ++ ConstStr255Param pStr, CFStringEncoding encoding, ++ CFAllocatorRef contentsDeallocate); ++ ++CF_EXPORT Boolean ++CFStringGetPascalString (CFStringRef theString, StringPtr buffer, ++ CFIndex bufferSize, CFStringEncoding encoding); ++ ++CF_EXPORT ConstStringPtr ++CFStringGetPascalStringPtr (CFStringRef theString, CFStringEncoding encoding); ++/** \} */ ++/** \} */ ++ ++ ++ ++/** \defgroup CFMutableStringRef CFMutableString Reference ++ * \{ ++ */ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) ++typedef enum ++{ ++ kCFStringNormalizationFormD = 0, ++ kCFStringNormalizationFormKD = 1, ++ kCFStringNormalizationFormC = 2, ++ kCFStringNormalizationFormKC = 3 ++} CFStringNormalizationForm; ++#endif ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++CF_EXPORT const CFStringRef kCFStringTransformStripCombiningMarks; ++CF_EXPORT const CFStringRef kCFStringTransformToLatin; ++CF_EXPORT const CFStringRef kCFStringTransformFullwidthHalfwidth; ++CF_EXPORT const CFStringRef kCFStringTransformLatinKatakana; ++CF_EXPORT const CFStringRef kCFStringTransformLatinHiragana; ++CF_EXPORT const CFStringRef kCFStringTransformHiraganaKatakana; ++CF_EXPORT const CFStringRef kCFStringTransformMandarinLatin; ++CF_EXPORT const CFStringRef kCFStringTransformLatinHangul; ++CF_EXPORT const CFStringRef kCFStringTransformLatinArabic; ++CF_EXPORT const CFStringRef kCFStringTransformLatinHebrew; ++CF_EXPORT const CFStringRef kCFStringTransformLatinThai; ++CF_EXPORT const CFStringRef kCFStringTransformLatinCyrillic; ++CF_EXPORT const CFStringRef kCFStringTransformLatinGreek; ++CF_EXPORT const CFStringRef kCFStringTransformToXMLHex; ++CF_EXPORT const CFStringRef kCFStringTransformToUnicodeName; ++#endif ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++CF_EXPORT const CFStringRef kCFStringTransformStripDiacritics; ++#endif ++ ++CF_EXPORT void ++CFStringAppend (CFMutableStringRef theString, CFStringRef appendedString); ++ ++CF_EXPORT void ++CFStringAppendCharacters (CFMutableStringRef theString, ++ const UniChar *chars, CFIndex numChars); ++ ++CF_EXPORT void ++CFStringAppendCString (CFMutableStringRef theString, const char *cStr, ++ CFStringEncoding encoding); ++ ++CF_EXPORT void ++CFStringAppendFormat (CFMutableStringRef theString, ++ CFDictionaryRef formatOptions, CFStringRef format, ...); ++ ++CF_EXPORT void ++CFStringAppendFormatAndArguments (CFMutableStringRef theString, ++ CFDictionaryRef formatOptions, CFStringRef format, va_list arguments); ++ ++CF_EXPORT void ++CFStringAppendPascalString (CFMutableStringRef theString, ++ ConstStr255Param pStr, CFStringEncoding encoding); ++ ++CF_EXPORT void ++CFStringCapitalize (CFMutableStringRef theString, CFLocaleRef locale); ++ ++CF_EXPORT CFMutableStringRef ++CFStringCreateMutable (CFAllocatorRef alloc, CFIndex maxLength); ++ ++CF_EXPORT CFMutableStringRef ++CFStringCreateMutableCopy (CFAllocatorRef alloc, CFIndex maxLength, ++ CFStringRef theString); ++ ++CF_EXPORT CFMutableStringRef ++CFStringCreateMutableWithExternalCharactersNoCopy (CFAllocatorRef alloc, ++ UniChar *chars, CFIndex numChars, CFIndex capacity, ++ CFAllocatorRef externalCharactersAllocator); ++ ++CF_EXPORT void ++CFStringDelete (CFMutableStringRef theString, CFRange range); ++ ++CF_EXPORT void ++CFStringInsert (CFMutableStringRef str, CFIndex idx, CFStringRef insertedStr); ++ ++CF_EXPORT void ++CFStringLowercase (CFMutableStringRef theString, CFLocaleRef locale); ++ ++CF_EXPORT void ++CFStringPad (CFMutableStringRef theString, CFStringRef padString, ++ CFIndex length, CFIndex indexIntoPad); ++ ++CF_EXPORT void ++CFStringReplace (CFMutableStringRef theString, CFRange range, ++ CFStringRef replacement); ++ ++CF_EXPORT void ++CFStringReplaceAll (CFMutableStringRef theString, CFStringRef replacement); ++ ++CF_EXPORT void ++CFStringSetExternalCharactersNoCopy (CFMutableStringRef theString, ++ UniChar *chars, CFIndex length, CFIndex capacity); ++ ++CF_EXPORT void ++CFStringTrim (CFMutableStringRef theString, CFStringRef trimString); ++ ++CF_EXPORT void ++CFStringTrimWhitespace (CFMutableStringRef theString); ++ ++CF_EXPORT void ++CFStringUppercase (CFMutableStringRef theString, CFLocaleRef locale); ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) ++CF_EXPORT CFIndex ++CFStringFindAndReplace (CFMutableStringRef theString, ++ CFStringRef stringToFind, CFStringRef replacementString, ++ CFRange rangeToSearch, CFOptionFlags compareOptions); ++ ++CF_EXPORT void ++CFStringNormalize (CFMutableStringRef theString, ++ CFStringNormalizationForm theForm); ++#endif ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++CF_EXPORT Boolean ++CFStringTransform (CFMutableStringRef string, CFRange *range, ++ CFStringRef transform, Boolean reverse); ++#endif ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++CF_EXPORT void ++CFStringFold (CFMutableStringRef theString, CFOptionFlags theFlags, ++ CFLocaleRef theLocale); ++#endif ++/** \} */ ++ ++ ++ ++/** \ingroup CFStringRef ++ \name CFStringInlineBuffer ++ \{ ++ */ ++#define __kCFStringInlineBufferLength 64 ++struct CFStringInlineBuffer ++{ ++ UniChar buffer[__kCFStringInlineBufferLength]; ++ CFStringRef theString; ++ const UniChar *directBuffer; ++ CFRange rangeToBuffer; ++ CFIndex bufferedRangeStart; ++ CFIndex bufferedRangeEnd; ++}; ++typedef struct CFStringInlineBuffer CFStringInlineBuffer; ++ ++CF_INLINE void ++CFStringInitInlineBuffer (CFStringRef str, CFStringInlineBuffer *buf, ++ CFRange range) ++{ ++ buf->theString = str; ++ buf->rangeToBuffer = range; ++ buf->directBuffer = CFStringGetCharactersPtr (str); ++ buf->bufferedRangeStart = 0; ++ buf->bufferedRangeEnd = 0; ++} ++ ++CF_INLINE UniChar ++CFStringGetCharacterFromInlineBuffer (CFStringInlineBuffer *buf, CFIndex idx) ++{ ++ if (buf->directBuffer) ++ { ++ if (idx < 0 || idx >= buf->rangeToBuffer.length) ++ return 0; ++ return buf->directBuffer[idx + buf->rangeToBuffer.location]; ++ } ++ else if (idx >= buf->bufferedRangeEnd || idx < buf->bufferedRangeStart) ++ { ++ CFRange range; ++ ++ if (idx < 0 || idx >= buf->rangeToBuffer.length) ++ return 0; ++ ++ /* Use 16 here so it's efficient to go backwards, too */ ++ buf->bufferedRangeStart = idx - 16; ++ if (buf->bufferedRangeStart < 0) ++ buf->bufferedRangeStart = 0; ++ buf->bufferedRangeEnd = ++ buf->bufferedRangeStart + __kCFStringInlineBufferLength; ++ if (buf->bufferedRangeEnd > buf->rangeToBuffer.length) ++ buf->bufferedRangeEnd = buf->rangeToBuffer.length; ++ ++ range = CFRangeMake (buf->rangeToBuffer.location + buf->bufferedRangeStart, ++ buf->bufferedRangeEnd - buf->bufferedRangeStart); ++ ++ CFStringGetCharacters (buf->theString, range, buf->buffer); ++ } ++ ++ return buf->buffer[(idx - buf->bufferedRangeStart)]; ++} ++/** \} */ ++ ++CF_EXTERN_C_END ++ ++#endif /* __COREFOUNDATION_CFSTRING_H__ */ ++ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFCharacterSet.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFCharacterSet.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFCharacterSet.h (.../branches/gcc-8-branch) +@@ -0,0 +1,173 @@ ++/* CFCharacterSet.h ++ ++ Copyright (C) 2012 Free Software Foundation, Inc. ++ ++ Written by: Stefan Bidigaray ++ Date: January, 2012 ++ ++ This file is part of the GNUstep CoreBase Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; see the file COPYING.LIB. ++ If not, see or write to the ++ Free Software Foundation, 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++#ifndef __COREFOUNDATION_CFCHARACTERSET_H__ ++#define __COREFOUNDATION_CFCHARACTERSET_H__ ++ ++#include "CFBase.h" ++#include "CFData.h" ++ ++CF_EXTERN_C_BEGIN ++ ++/** \ingroup CFCharacterSetRef */ ++typedef const struct __CFCharacterSet * CFCharacterSetRef; ++/** \ingroup CFMutableCharacterSetRef */ ++typedef struct __CFCharacterSet * CFMutableCharacterSetRef; ++ ++/** \defgroup CFCharacterSetRef CFCharacterSet Reference ++ \{ ++ */ ++typedef enum ++{ ++ kCFCharacterSetControl = 1, ++ kCFCharacterSetWhitespace, ++ kCFCharacterSetWhitespaceAndNewline, ++ kCFCharacterSetDecimalDigit, ++ kCFCharacterSetLetter, ++ kCFCharacterSetLowercaseLetter, ++ kCFCharacterSetUppercaseLetter, ++ kCFCharacterSetNonBase, ++ kCFCharacterSetDecomposable, ++ kCFCharacterSetAlphaNumeric, ++ kCFCharacterSetPunctuation, ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) ++ kCFCharacterSetCapitalizedLetter = 13, ++#endif ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) ++ kCFCharacterSetSymbol = 14, ++#endif ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++ kCFCharacterSetNewline = 15, ++#endif ++ kCFCharacterSetIllegal = 12 ++} CFCharacterSetPredefinedSet; ++ ++ ++ ++/** \name Creating Character Sets ++ \{ ++ */ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) ++CF_EXPORT CFCharacterSetRef ++CFCharacterSetCreateCopy (CFAllocatorRef alloc, CFCharacterSetRef set); ++#endif ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) ++CF_EXPORT CFCharacterSetRef ++CFCharacterSetCreateInvertedSet (CFAllocatorRef alloc, CFCharacterSetRef set); ++#endif ++ ++CF_EXPORT CFCharacterSetRef ++CFCharacterSetCreateWithCharactersInRange (CFAllocatorRef alloc, ++ CFRange range); ++ ++CF_EXPORT CFCharacterSetRef ++CFCharacterSetCreateWithCharactersInString (CFAllocatorRef alloc, ++ CFStringRef string); ++ ++CF_EXPORT CFCharacterSetRef ++CFCharacterSetCreateWithBitmapRepresentation (CFAllocatorRef alloc, ++ CFDataRef data); ++/** \} */ ++ ++/** \name Getting Predefined Character Sets ++ \{ ++ */ ++CF_EXPORT CFCharacterSetRef ++CFCharacterSetGetPredefined (CFCharacterSetPredefinedSet setIdentifier); ++/** \} */ ++ ++/** \name Querying Character Sets ++ \{ ++ */ ++CF_EXPORT CFDataRef ++CFCharacterSetCreateBitmapRepresentation (CFAllocatorRef alloc, ++ CFCharacterSetRef set); ++ ++CF_EXPORT Boolean ++CFCharacterSetIsCharacterMember (CFCharacterSetRef set, UniChar c); ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) ++CF_EXPORT Boolean ++CFCharacterSetHasMemberInPlane (CFCharacterSetRef set, CFIndex plane); ++ ++CF_EXPORT Boolean ++CFCharacterSetIsLongCharacterMember (CFCharacterSetRef set, UTF32Char c); ++ ++CF_EXPORT Boolean ++CFCharacterSetIsSupersetOfSet (CFCharacterSetRef set, ++ CFCharacterSetRef otherSet); ++#endif ++/** \} */ ++ ++/** \name Getting the Character Set Type Identifier ++ \{ ++ */ ++CF_EXPORT CFTypeID ++CFCharacterSetGetTypeID (void); ++/** \} */ ++/** \} */ ++ ++/** \defgroup CFMutableCharacterSetRef CFMutableCharacterSet Reference ++ \{ ++ */ ++CF_EXPORT CFMutableCharacterSetRef ++CFCharacterSetCreateMutable (CFAllocatorRef alloc); ++ ++CF_EXPORT CFMutableCharacterSetRef ++CFCharacterSetCreateMutableCopy (CFAllocatorRef alloc, CFCharacterSetRef set); ++ ++CF_EXPORT void ++CFCharacterSetAddCharactersInRange (CFMutableCharacterSetRef set, ++ CFRange range); ++ ++CF_EXPORT void ++CFCharacterSetAddCharactersInString (CFMutableCharacterSetRef set, ++ CFStringRef string); ++ ++CF_EXPORT void ++CFCharacterSetRemoveCharactersInRange (CFMutableCharacterSetRef set, ++ CFRange range); ++ ++CF_EXPORT void ++CFCharacterSetRemoveCharactersInString (CFMutableCharacterSetRef set, ++ CFStringRef string); ++ ++CF_EXPORT void ++CFCharacterSetIntersect (CFMutableCharacterSetRef set, ++ CFCharacterSetRef otherSet); ++ ++CF_EXPORT void ++CFCharacterSetInvert (CFMutableCharacterSetRef set); ++ ++CF_EXPORT void ++CFCharacterSetUnion (CFMutableCharacterSetRef set, CFCharacterSetRef otherSet); ++/** \} */ ++ ++CF_EXTERN_C_END ++ ++#endif /* __COREFOUNDATION_CFCHARACTERSET_H__ */ ++ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFData.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFData.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFData.h (.../branches/gcc-8-branch) +@@ -0,0 +1,114 @@ ++/* CFData.h ++ ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ ++ Written by: Stefan Bidigaray ++ Date: January, 2010 ++ ++ This file is part of CoreBase. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; see the file COPYING.LIB. ++ If not, see or write to the ++ Free Software Foundation, 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++#ifndef __COREFOUNDATION_CFDATA_H__ ++#define __COREFOUNDATION_CFDATA_H__ ++ ++#include "CFBase.h" ++ ++CF_EXTERN_C_BEGIN ++/** \ingroup CFDataRef */ ++typedef const struct __CFData *CFDataRef; ++/** \ingroup CFMutableDataRef */ ++typedef struct __CFData *CFMutableDataRef; ++ ++/** \defgroup CFDataRef CFData Reference ++ \{ ++ */ ++/** \name Creating a CFData Object ++ \{ ++ */ ++CF_EXPORT CFDataRef ++CFDataCreate (CFAllocatorRef allocator, const UInt8 * bytes, CFIndex length); ++ ++CF_EXPORT CFDataRef ++CFDataCreateCopy (CFAllocatorRef allocator, CFDataRef theData); ++ ++CF_EXPORT CFDataRef ++CFDataCreateWithBytesNoCopy (CFAllocatorRef allocator, const UInt8 * bytes, ++ CFIndex length, CFAllocatorRef bytesDeallocator); ++/** \} */ ++ ++/** \name Examining a CFData Object ++ \{ ++ */ ++CF_EXPORT const UInt8 *CFDataGetBytePtr (CFDataRef theData); ++ ++CF_EXPORT void ++CFDataGetBytes (CFDataRef theData, CFRange range, UInt8 * buffer); ++ ++CF_EXPORT CFIndex CFDataGetLength (CFDataRef theData); ++/** \} */ ++ ++/** \name Getting the CFData Type ID ++ \{ ++ */ ++CF_EXPORT CFTypeID CFDataGetTypeID (void); ++/** \} */ ++/** \} */ ++ ++/** \defgroup CFMutableDataRef CFMutableData Reference ++ \{ ++ */ ++/** \name Creating a Mutable Data Object ++ \{ ++ */ ++CF_EXPORT CFMutableDataRef ++CFDataCreateMutable (CFAllocatorRef allocator, CFIndex capacity); ++ ++CF_EXPORT CFMutableDataRef ++CFDataCreateMutableCopy (CFAllocatorRef allocator, CFIndex capacity, ++ CFDataRef theData); ++/** \} */ ++ ++/** \name Accessing Mutable Data ++ \{ ++ */ ++CF_EXPORT UInt8 *CFDataGetMutableBytePtr (CFMutableDataRef theData); ++/** \} */ ++ ++/** \name Modifying a Mutable Data Object ++ \{ ++ */ ++CF_EXPORT void ++CFDataAppendBytes (CFMutableDataRef theData, const UInt8 * bytes, ++ CFIndex length); ++ ++CF_EXPORT void CFDataDeleteBytes (CFMutableDataRef theData, CFRange range); ++ ++CF_EXPORT void ++CFDataReplaceBytes (CFMutableDataRef theData, CFRange range, ++ const UInt8 * newBytes, CFIndex newLength); ++ ++CF_EXPORT void ++CFDataIncreaseLength (CFMutableDataRef theData, CFIndex extraLength); ++ ++CF_EXPORT void CFDataSetLength (CFMutableDataRef theData, CFIndex length); ++/** \} */ ++/** \} */ ++ ++CF_EXTERN_C_END ++#endif /* __COREFOUNDATION_CFDATA_H__ */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFAvailability.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFAvailability.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFAvailability.h (.../branches/gcc-8-branch) +@@ -0,0 +1,52 @@ ++/* CFAvailability.h ++ ++ Copyright (C) 2017 Free Software Foundation, Inc. ++ ++ Written by: Stefan Bidigaray ++ Date: August, 2017 ++ ++ This file is part of the GNUstep CoreBase Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; see the file COPYING.LIB. ++ If not, see or write to the ++ Free Software Foundation, 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++ ++#ifndef __COREFOUNDATION_CFAVAILABILITY_H__ ++#define __COREFOUNDATION_CFAVAILABILITY_H__ ++ ++/* Compiler features */ ++#ifndef __has_feature ++#define __has_feature(x) 0 ++#endif ++#ifndef __has_attribute ++#define __has_attribute(x) 0 ++#endif ++#ifndef __has_extension ++#define __has_extension(x) __has_feature ++#endif ++ ++/* CFEnum macro for type definitions */ ++#if (__cplusplus && __cplusplus >= 201103L) ++#define CF_ENUM(_type, _name) _type _name; enum : _type ++#define CF_OPTIONS(_type, _name) _type _name; enum : _type ++#else ++#define CF_ENUM(_type, _name) _type _name; enum ++#define CF_OPTIONS(_type, _name) _type _name; enum ++#endif ++ ++#endif /* __COREFOUNDATION_CFAVAILABILITY_H__ */ ++ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFBase.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFBase.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFBase.h (.../branches/gcc-8-branch) +@@ -0,0 +1,464 @@ ++/* CFBase.h ++ ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ ++ Written by: Stefan Bidigaray ++ Date: January, 2010 ++ ++ This file is part of the GNUstep CoreBase Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; see the file COPYING.LIB. ++ If not, see or write to the ++ Free Software Foundation, 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++ ++#ifndef __COREFOUNDATION_CFBASE_H__ ++#define __COREFOUNDATION_CFBASE_H__ ++ ++/* CoreFoundation defines __LITTLE_ENDIAN__ or __BIG_ENDIAN__ so we'll ++ * do the same here for compatibility. ++ */ ++#if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) ++#define __LITTLE_ENDIAN__ 1 ++#endif ++ ++#include "CFAvailability.h" ++#include "../GNUstepBase/GSVersionMacros.h" ++ ++/* ++ * CoreFoundation types ++ */ ++typedef unsigned char Boolean; ++typedef unsigned char UInt8; ++typedef signed char SInt8; ++typedef unsigned short UInt16; ++typedef signed short SInt16; ++typedef unsigned int UInt32; ++typedef signed int SInt32; ++typedef unsigned long long UInt64; ++typedef signed long long SInt64; ++typedef SInt32 OSStatus; ++ ++typedef float Float32; ++typedef double Float64; ++typedef UInt16 UniChar; ++typedef UInt8 *StringPtr; ++typedef const StringPtr *ConstStringPtr; ++typedef UInt8 Str255[256]; ++typedef const Str255 *ConstStr255Param; ++typedef SInt16 OSErr; ++typedef SInt16 RegionCode; ++typedef SInt16 LangCode; ++typedef SInt16 ScriptCode; ++typedef UInt32 FourCharCode; ++#ifndef OSTYPE_DECLARED ++typedef FourCharCode OSType; ++#define OSTYPE_DECLARED ++#endif ++typedef UInt8 Byte; ++typedef SInt8 SignedByte; ++ ++#ifndef UTF32Char /* UTF32Char is also defined in GSConfig.h */ ++typedef UInt32 UTF32Char; ++#endif ++typedef UInt16 UTF16Char; ++typedef UInt8 UTF8Char; ++ ++#if !defined(CF_EXTERN_C_BEGIN) ++#if defined(__cplusplus) ++#define CF_EXTERN_C_BEGIN extern "C" { ++#define CF_EXTERN_C_END } ++#else ++#define CF_EXTERN_C_BEGIN ++#define CF_EXTERN_C_END ++#endif ++#endif ++ ++#if defined(_WIN32) ++#if defined(BUILDING_SELF) ++#if defined(__cplusplus) ++#define CF_EXPORT extern "C" __declspec(dllexport) ++#else ++#define CF_EXPORT extern __declspec(dllexport) ++#endif ++#else ++#if defined(__cplusplus) ++#define CF_EXPORT extern "C" __declspec(dllimport) ++#else ++#define CF_EXPORT extern __declspec(dllimport) ++#endif ++#endif ++#else ++#if defined(__cplusplus) ++#define CF_EXPORT extern "C" ++#else ++#define CF_EXPORT extern ++#endif ++#endif ++ ++#if !defined(__bool_true_false_are_defined) ++#define true 1 ++#define false 0 ++#endif ++ ++#ifndef TRUE ++#define TRUE 1 ++#endif ++#ifndef FALSE ++#define FALSE 0 ++#endif ++ ++#if !defined(CF_INLINE) ++#if defined(__GNUC__) && (__GNUC__ >= 4) ++#define CF_INLINE static __inline__ __attribute__((always_inline)) ++#elif defined(__GNUC__) ++#define CF_INLINE static __inline__ ++#elif defined(__MWERKS__) || defined(__cplusplus) ++#define CF_INLINE static inline ++#elif defined(_MSC_VER) ++#define CF_INLINE static __inline ++#elif _WIN32 ++#define CF_INLINE static __inline__ ++#else ++#define CF_INLINE static inline ++#endif ++#endif ++ ++#if defined(__GNUC__) || defined(__llvm__) ++#define GS_PURE_FUNCTION __attribute__((pure)) ++#else ++#define GS_PURE_FUNCTION ++#endif ++ ++CF_EXTERN_C_BEGIN ++/** \defgroup CFTypeRef CFType Reference ++ \{ ++ */ ++typedef unsigned long CFTypeID; ++typedef const void *CFTypeRef; ++/** @} ++ */ ++ ++/** \defgroup BaseUtils Base Utilities ++ \{ ++ */ ++/** An integer value to store a hash code. */ ++typedef unsigned long CFHashCode; ++/** A bitfield for passing information to functions. Can hold as many bits ++ as a word. ++ */ ++typedef unsigned long CFOptionFlags; ++/** A signed integer representing an index, size, length or count. */ ++typedef signed long CFIndex; ++ ++/** A structure that represents a range of items in a container, such as ++ an array. ++ */ ++typedef struct CFRange CFRange; ++struct CFRange ++{ ++ CFIndex location; ++ /**< An integer representing the start location of the range, inclusive. */ ++ CFIndex length; ++ /**< An integer representing the total number of items in the range */ ++}; ++ ++/** Creates a CFRange structure. ++ \param location The starting location. ++ \param length The length. ++ \return An initialized CFRange structure. ++ */ ++CF_INLINE CFRange ++CFRangeMake (CFIndex location, CFIndex length) ++{ ++ CFRange range; ++ ++ range.location = location; ++ range.length = length; ++ return range; ++} ++ ++/* Returned by comparison functions */ ++typedef enum ++{ ++ kCFCompareLessThan = -1, ++ kCFCompareEqualTo = 0, ++ kCFCompareGreaterThan = 1 ++} CFComparisonResult; ++ ++/* Return when a value is not found */ ++enum ++{ ++ kCFNotFound = -1 ++}; ++ ++/* Definition for standard comparison function callback. */ ++typedef CFComparisonResult (*CFComparatorFunction) (const void *val1, ++ const void *val2, ++ void *context); ++ ++/* CoreFoundation version numbers */ ++/** \name Library Version Numbers ++ \{ ++ */ ++CF_EXPORT const double kCFCoreFoundationVersionNumber; ++#define kCFCoreFoundationVersionNumber10_0 196.40 ++#define kCFCoreFoundationVersionNumber10_0_3 196.50 ++#define kCFCoreFoundationVersionNumber10_1 226.00 ++#define kCFCoreFoundationVersionNumber10_1_1 226.00 ++#define kCFCoreFoundationVersionNumber10_1_2 227.20 ++#define kCFCoreFoundationVersionNumber10_1_3 227.20 ++#define kCFCoreFoundationVersionNumber10_1_4 227.30 ++#define kCFCoreFoundationVersionNumber10_2 263.00 ++#define kCFCoreFoundationVersionNumber10_2_1 263.10 ++#define kCFCoreFoundationVersionNumber10_2_2 263.10 ++#define kCFCoreFoundationVersionNumber10_2_3 263.30 ++#define kCFCoreFoundationVersionNumber10_2_4 263.30 ++#define kCFCoreFoundationVersionNumber10_2_5 263.50 ++#define kCFCoreFoundationVersionNumber10_2_6 263.50 ++#define kCFCoreFoundationVersionNumber10_2_7 263.50 ++#define kCFCoreFoundationVersionNumber10_2_8 263.50 ++#define kCFCoreFoundationVersionNumber10_3 299.00 ++#define kCFCoreFoundationVersionNumber10_3_1 299.00 ++#define kCFCoreFoundationVersionNumber10_3_2 299.00 ++#define kCFCoreFoundationVersionNumber10_3_3 299.30 ++#define kCFCoreFoundationVersionNumber10_3_4 299.31 ++#define kCFCoreFoundationVersionNumber10_3_5 299.31 ++#define kCFCoreFoundationVersionNumber10_3_6 299.32 ++#define kCFCoreFoundationVersionNumber10_3_7 299.33 ++#define kCFCoreFoundationVersionNumber10_3_8 299.33 ++#define kCFCoreFoundationVersionNumber10_3_9 299.35 ++#define kCFCoreFoundationVersionNumber10_4 368.00 ++#define kCFCoreFoundationVersionNumber10_4_1 368.10 ++#define kCFCoreFoundationVersionNumber10_4_2 368.11 ++#define kCFCoreFoundationVersionNumber10_4_3 368.18 ++#define kCFCoreFoundationVersionNumber10_4_4_Intel 368.26 ++#define kCFCoreFoundationVersionNumber10_4_4_PowerPC 368.25 ++#define kCFCoreFoundationVersionNumber10_4_5_Intel 368.26 ++#define kCFCoreFoundationVersionNumber10_4_5_PowerPC 368.25 ++#define kCFCoreFoundationVersionNumber10_4_6_Intel 368.26 ++#define kCFCoreFoundationVersionNumber10_4_6_PowerPC 368.25 ++#define kCFCoreFoundationVersionNumber10_4_7 368.27 ++#define kCFCoreFoundationVersionNumber10_4_8 368.27 ++#define kCFCoreFoundationVersionNumber10_4_9 368.28 ++#define kCFCoreFoundationVersionNumber10_4_10 368.28 ++#define kCFCoreFoundationVersionNumber10_4_11 368.31 ++#define kCFCoreFoundationVersionNumber10_5 476.00 ++#define kCFCoreFoundationVersionNumber10_5_1 476.00 ++#define kCFCoreFoundationVersionNumber10_5_2 476.10 ++#define kCFCoreFoundationVersionNumber10_5_3 476.13 ++#define kCFCoreFoundationVersionNumber10_5_4 476.14 ++#define kCFCoreFoundationVersionNumber10_5_5 476.15 ++#define kCFCoreFoundationVersionNumber10_5_6 476.17 ++/** \} */ ++/** \} */ ++ ++#if __has_feature(attribute_cf_returns_retained) ++#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained)) ++#else ++#define CF_RETURNS_RETAINED ++#endif ++ ++#if __has_feature(attribute_cf_returns_not_retained) ++#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained)) ++#else ++#define CF_RETURNS_NOT_RETAINED ++#endif ++ ++/** \ingroup CFPropertyListRef ++ */ ++typedef CFTypeRef CFPropertyListRef; ++ ++/** \ingroup CFStringRef ++ */ ++typedef const struct __CFString *CFStringRef; ++/** \ingroup CFMutableStringRef ++ */ ++typedef struct __CFString *CFMutableStringRef; ++ ++ ++ ++/** \defgroup CFAllocatorRef CFAllocator Reference ++ \brief CFAllocator is an opaque type used to allocate and deallocate ++ memory. ++ \{ ++ */ ++/** \brief A reference to a CFAllocator object. ++ */ ++typedef const struct __CFAllocator *CFAllocatorRef; ++ ++typedef void *(*CFAllocatorAllocateCallBack) (CFIndex allocSize, ++ CFOptionFlags hint, void *info); ++typedef void (*CFAllocatorDeallocateCallBack) (void *ptr, void *info); ++typedef void *(*CFAllocatorReallocateCallBack) (void *ptr, ++ CFIndex newsize, ++ CFOptionFlags hint, void *info); ++typedef CFIndex (*CFAllocatorPreferredSizeCallBack) (CFIndex size, ++ CFOptionFlags hint, ++ void *info); ++typedef const void *(*CFAllocatorRetainCallBack) (const void *info); ++typedef void (*CFAllocatorReleaseCallBack) (const void *info); ++typedef CFStringRef (*CFAllocatorCopyDescriptionCallBack) (const void *info); ++ ++struct _CFAllocatorContext ++{ ++ CFIndex version; ++ void *info; ++ CFAllocatorRetainCallBack retain; ++ CFAllocatorReleaseCallBack release; ++ CFAllocatorCopyDescriptionCallBack copyDescription; ++ CFAllocatorAllocateCallBack allocate; ++ CFAllocatorReallocateCallBack reallocate; ++ CFAllocatorDeallocateCallBack deallocate; ++ CFAllocatorPreferredSizeCallBack preferredSize; ++}; ++typedef struct _CFAllocatorContext CFAllocatorContext; ++ ++/** The default allocator and is equivalent to NULL. ++ \see CFAllocatorGetDefault() ++ \see CFAllocatorSetDefault() ++ */ ++CF_EXPORT CFAllocatorRef kCFAllocatorDefault; ++/** The default system allocator is used internally by GNUstep and is the ++ default allocator if none is been defined. ++ \see CFAllocatorSetDefault() ++ */ ++CF_EXPORT CFAllocatorRef kCFAllocatorSystemDefault; ++/** An allocator that uses the system's malloc, realloc and free functions. ++ */ ++CF_EXPORT CFAllocatorRef kCFAllocatorMalloc; ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++/** Equivalent to kCFAllocatorSystemDefault ++ */ ++CF_EXPORT CFAllocatorRef kCFAllocatorMallocZone; ++#endif ++/** The NULL allocator does perform any operations. Can be passed as ++ a deallocator if you do not want GNUstep to deallocate the data. ++ */ ++CF_EXPORT CFAllocatorRef kCFAllocatorNull; ++/** This is a special case allocator directing CFAllocatorCreate() to use ++ the given CFAllocatorContext structure to allocate the new allocator. ++ */ ++CF_EXPORT CFAllocatorRef kCFAllocatorUseContext; ++ ++/** Create a new CFAllocator. ++ \param allocator The allocator used to create this allocator or ++ kCFAllocatorUseContext to use the functions in \b context. ++ \param context The new allocator's context functions. ++ \return A new CFAllocator or NULL in case of failure. ++ \see CFAllocatorContext ++ */ ++CF_EXPORT CFAllocatorRef ++CFAllocatorCreate (CFAllocatorRef allocator, CFAllocatorContext * context); ++ ++/** Allocate new memory. ++ \param allocator The CFAllocator to use. ++ \param size The number of bytes to allocate. ++ \param hint Option flags. Currently unused and should be 0. ++ \return Newly allocated memory of NULL in case of failure. ++ \see CFAllocatorDeallocate() ++ */ ++CF_EXPORT void *CFAllocatorAllocate (CFAllocatorRef allocator, CFIndex size, ++ CFOptionFlags hint); ++ ++/** Deallocate the memory pointed to by \b ptr. ++ \param allocator The CFAllocator to use. ++ \param ptr A pointer previously allocated by CFAllocatorAllocate(). ++ \see CFAllocatorAllocate() ++ */ ++CF_EXPORT void CFAllocatorDeallocate (CFAllocatorRef allocator, void *ptr); ++ ++CF_EXPORT CFIndex ++CFAllocatorGetPreferredSizeForSize (CFAllocatorRef allocator, CFIndex size, ++ CFOptionFlags hint); ++ ++CF_EXPORT void *CFAllocatorReallocate (CFAllocatorRef allocator, void *ptr, ++ CFIndex newsize, CFOptionFlags hint); ++ ++CF_EXPORT CFAllocatorRef CFAllocatorGetDefault (void); ++ ++CF_EXPORT void CFAllocatorSetDefault (CFAllocatorRef allocator); ++ ++CF_EXPORT void ++CFAllocatorGetContext (CFAllocatorRef allocator, CFAllocatorContext * context); ++ ++CF_EXPORT CFTypeID CFAllocatorGetTypeID (void); ++/** \} */ ++ ++ ++ ++/** \ingroup CFTypeRef ++ \{ ++ */ ++/* These function will be implemented in CFRuntime.c since they ++ require runtime support. */ ++CF_EXPORT CFStringRef CFCopyDescription (CFTypeRef cf); ++ ++CF_EXPORT CFStringRef CFCopyTypeIDDescription (CFTypeID typeID); ++ ++CF_EXPORT Boolean CFEqual (CFTypeRef cf1, CFTypeRef cf2); ++ ++CF_EXPORT CFAllocatorRef CFGetAllocator (CFTypeRef cf); ++ ++CF_EXPORT CFIndex CFGetRetainCount (CFTypeRef cf); ++ ++CF_EXPORT CFTypeID CFGetTypeID (CFTypeRef cf); ++ ++CF_EXPORT CFHashCode CFHash (CFTypeRef cf); ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++CF_EXPORT CFTypeRef CFMakeCollectable (CFTypeRef cf); ++#endif ++ ++CF_EXPORT void CFRelease (CFTypeRef cf); ++ ++CF_EXPORT CFTypeRef CFRetain (CFTypeRef cf); ++ ++CF_EXPORT CFTypeRef CFAutorelease(CFTypeRef arg); ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST) ++CF_EXPORT void *_CFBridgingRelease (CFTypeRef cf); ++CF_EXPORT CFTypeRef _CFBridgingRetain (void *obj); ++ ++#if __has_feature(objc_arc) ++#define CFBridgingRetain(x) (__bridge_retained CFTypeRef)(x) ++#define CFBridgingRelease(x) (__bridge_transfer id)(x) ++#elif __OBJC__ ++#define CFBridgingRetain(x) _CFBridgingRetain((void *)(x)) ++#define CFBridgingRelease(x) (id)_CFBridgingRelease((x)) ++#else ++#define CFBridgingRetain(x) _CFBridgingRetain((void *)(x)) ++#define CFBridgingRelease(x) _CFBridgingRelease((x)) ++#endif ++#endif ++/** \} */ ++ ++ ++ ++/** \defgroup CFNullRef CFNull Reference ++ \{ ++ */ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) ++typedef struct __CFNull *CFNullRef; ++ ++CF_EXPORT CFNullRef kCFNull; ++ ++CFTypeID CFNullGetTypeID (void); ++#endif ++/** \} */ ++ ++CF_EXTERN_C_END ++#endif /* __COREFOUNDATION_CFBASE_H__ */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFArray.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFArray.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFArray.h (.../branches/gcc-8-branch) +@@ -0,0 +1,191 @@ ++/* CFArray.h ++ ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ ++ Written by: Stefan Bidigaray ++ Date: January, 2010 ++ ++ This file is part of CoreBase. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; see the file COPYING.LIB. ++ If not, see or write to the ++ Free Software Foundation, 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++ ++#ifndef __COREFOUNDATION_CFARRAY_H__ ++#define __COREFOUNDATION_CFARRAY_H__ ++ ++#include "CFBase.h" ++ ++CF_EXTERN_C_BEGIN ++/** \ingroup CFArrayRef ++ \brief Reference to an immutable array object. ++ */ ++typedef const struct __CFArray *CFArrayRef; ++/** ++ \ingroup CFMutableArrayRef ++ \brief Reference to a mutable array object. ++ */ ++typedef struct __CFArray *CFMutableArrayRef; ++ ++/** \defgroup CFArrayRef CFArray Reference ++ \brief A CFArray and its mutable type, \ref CFMutableArrayRef ++ "CFMutableArray", are simple, low overhead, ordered containers for ++ objects. ++ \details ++ \#include ++ \{ ++ */ ++ ++/** \name Callbacks ++ \{ ++ */ ++typedef void (*CFArrayApplierFunction) (const void *value, void *context); ++typedef CFStringRef (*CFArrayCopyDescriptionCallBack) (const void *value); ++typedef void (*CFArrayReleaseCallBack) (CFAllocatorRef allocator, ++ const void *value); ++typedef const void *(*CFArrayRetainCallBack) (CFAllocatorRef allocator, ++ const void *value); ++typedef Boolean (*CFArrayEqualCallBack) (const void *value1, ++ const void *value2); ++/** \} */ ++ ++/** \brief Structure with CFArray callbacks. ++ */ ++typedef struct _CFArrayCallBacks CFArrayCallBacks; ++struct _CFArrayCallBacks ++{ ++ CFIndex version; /**< Structure's version number. Current version is 0. */ ++ CFArrayRetainCallBack retain; ++ /**< The callback used to retain values added to the array. If NULL, ++ values are not retained. */ ++ CFArrayReleaseCallBack release; ++ CFArrayCopyDescriptionCallBack copyDescription; ++ CFArrayEqualCallBack equal; ++}; ++ ++/** \name Predefined Callback Structures ++ \{ ++ */ ++CF_EXPORT const CFArrayCallBacks kCFTypeArrayCallBacks; ++/** \} */ ++ ++ ++ ++/** \name Creating an Array ++ \{ ++ */ ++CF_EXPORT CFArrayRef ++CFArrayCreate (CFAllocatorRef allocator, const void **values, ++ CFIndex numValues, const CFArrayCallBacks * callBacks); ++ ++CF_EXPORT CFArrayRef ++CFArrayCreateCopy (CFAllocatorRef allocator, CFArrayRef theArray); ++/** \} */ ++ ++/** \name Examining an Array ++ \{ ++ */ ++CF_EXPORT CFIndex ++CFArrayBSearchValues (CFArrayRef theArray, CFRange range, const void *value, ++ CFComparatorFunction comparator, void *context); ++ ++CF_EXPORT Boolean ++CFArrayContainsValue (CFArrayRef theArray, CFRange range, const void *value); ++ ++CF_EXPORT CFIndex CFArrayGetCount (CFArrayRef theArray); ++ ++CF_EXPORT CFIndex ++CFArrayGetCountOfValue (CFArrayRef theArray, CFRange range, const void *value); ++ ++CF_EXPORT CFIndex ++CFArrayGetFirstIndexOfValue (CFArrayRef theArray, CFRange range, ++ const void *value); ++ ++CF_EXPORT CFIndex ++CFArrayGetLastIndexOfValue (CFArrayRef theArray, CFRange range, ++ const void *value); ++ ++CF_EXPORT void ++CFArrayGetValues (CFArrayRef theArray, CFRange range, const void **values); ++ ++CF_EXPORT const void *CFArrayGetValueAtIndex (CFArrayRef theArray, CFIndex idx); ++/** \} */ ++ ++/** \name Applying a Function to Elements ++ \{ ++ */ ++CF_EXPORT void ++CFArrayApplyFunction (CFArrayRef theArray, CFRange range, ++ CFArrayApplierFunction applier, void *context); ++/** \} */ ++ ++/** \name Getting the CFArray Type ID ++ \{ ++ */ ++CF_EXPORT CFTypeID CFArrayGetTypeID (void); ++/** \} */ ++ ++/** \} */ ++ ++/** \defgroup CFMutableArrayRef CFMutableArray Reference ++ \details \#include ++ \{ ++ */ ++CF_EXPORT void ++CFArrayAppendArray (CFMutableArrayRef theArray, CFArrayRef otherArray, ++ CFRange otherRange); ++ ++CF_EXPORT void ++CFArrayAppendValue (CFMutableArrayRef theArray, const void *value); ++ ++CF_EXPORT CFMutableArrayRef ++CFArrayCreateMutable (CFAllocatorRef allocator, CFIndex capacity, ++ const CFArrayCallBacks * callBacks); ++ ++CF_EXPORT CFMutableArrayRef ++CFArrayCreateMutableCopy (CFAllocatorRef allocator, CFIndex capacity, ++ CFArrayRef theArray); ++ ++CF_EXPORT void ++CFArrayExchangeValuesAtIndices (CFMutableArrayRef theArray, CFIndex idx1, ++ CFIndex idx2); ++ ++CF_EXPORT void ++CFArrayInsertValueAtIndex (CFMutableArrayRef theArray, CFIndex idx, ++ const void *value); ++ ++CF_EXPORT void CFArrayRemoveAllValues (CFMutableArrayRef theArray); ++ ++CF_EXPORT void ++CFArrayRemoveValueAtIndex (CFMutableArrayRef theArray, CFIndex idx); ++ ++CF_EXPORT void ++CFArrayReplaceValues (CFMutableArrayRef theArray, CFRange range, ++ const void **newValues, CFIndex newCount); ++ ++CF_EXPORT void ++CFArraySetValueAtIndex (CFMutableArrayRef theArray, CFIndex idx, ++ const void *value); ++ ++CF_EXPORT void ++CFArraySortValues (CFMutableArrayRef theArray, CFRange range, ++ CFComparatorFunction comparator, void *context); ++ ++/** \} */ ++ ++CF_EXTERN_C_END ++#endif /* __COREFOUNDATION_CFARRAY_H__ */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFLocale.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFLocale.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/CoreFoundation/CFLocale.h (.../branches/gcc-8-branch) +@@ -0,0 +1,249 @@ ++/* CFLocale.h ++ ++ Copyright (C) 2010 Free Software Foundation, Inc. ++ ++ Written by: Stefan Bidigaray ++ Date: March, 2011 ++ ++ This file is part of the GNUstep CoreBase Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; see the file COPYING.LIB. ++ If not, see or write to the ++ Free Software Foundation, 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++#ifndef __COREFOUNDATION_CFLOCALE__ ++#define __COREFOUNDATION_CFLOCALE__ 1 ++ ++#include "CFBase.h" ++ ++#include "CFArray.h" ++#include "CFDictionary.h" ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) ++ ++CF_EXTERN_C_BEGIN ++ ++/** \defgroup CFLocaleRef CFLocale Reference ++ \brief CFLocale provides basic functionality for language and/or region ++ specific operations. ++ ++ Locale-sensitive operations, such as collation, calendars and ++ capitalization, may use CFLocale objects to provide language and/or region ++ specific functionality. ++ ++ CFLocale is "toll-free bridged" to NSLocale. ++ ++ \{ ++ */ ++typedef const struct __CFLocale *CFLocaleRef; ++ ++/** ++ */ ++enum ++{ ++ kCFLocaleLanguageDirectionUnknown = 0, ++ kCFLocaleLanguageDirectionLeftToRight = 1, ++ kCFLocaleLanguageDirectionRightToLeft = 2, ++ kCFLocaleLanguageDirectionTopToBottom = 3, ++ kCFLocaleLanguageDirectionBottomToTop = 4 ++}; ++typedef CFIndex CFLocaleLanguageDirection; ++ ++/** \name CFLocale Property Keys ++ \{ ++ */ ++CF_EXPORT const CFStringRef kCFLocaleMeasurementSystem; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleDecimalSeparator; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleGroupingSeparator; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleCurrencySymbol; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleCurrencyCode; /* CFString */ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++CF_EXPORT const CFStringRef kCFLocaleIdentifier; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleLanguageCode; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleCountryCode; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleScriptCode; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleVariantCode; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleExemplarCharacterSet; /* CFCharacterSet */ ++CF_EXPORT const CFStringRef kCFLocaleCalendarIdentifier; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleCalendar; /* CFCalendar */ ++CF_EXPORT const CFStringRef kCFLocaleCollationIdentifier; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleUsesMetricSystem; /* CFBoolean */ ++#endif ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) ++CF_EXPORT const CFStringRef kCFLocaleCollatorIdentifier; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleQuotationBeginDelimiterKey; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleQuotationEndDelimiterKey; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleAlternateQuotationBeginDelimiterKey; /* CFString */ ++CF_EXPORT const CFStringRef kCFLocaleAlternateQuotationEndDelimiterKey; /* CFString */ ++#endif ++/** \} */ ++ ++/** \name CFCalendar Identifiers ++ \{ ++ */ ++CF_EXPORT const CFStringRef kCFGregorianCalendar; ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++CF_EXPORT const CFStringRef kCFBuddhistCalendar; ++CF_EXPORT const CFStringRef kCFChineseCalendar; ++CF_EXPORT const CFStringRef kCFHebrewCalendar; ++CF_EXPORT const CFStringRef kCFIslamicCalendar; ++CF_EXPORT const CFStringRef kCFIslamicCivilCalendar; ++CF_EXPORT const CFStringRef kCFJapaneseCalendar; ++#endif ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) ++CF_EXPORT const CFStringRef kCFRepublicOfChinaCalendar; ++CF_EXPORT const CFStringRef kCFPersianCalendar; ++CF_EXPORT const CFStringRef kCFIndianCalendar; ++CF_EXPORT const CFStringRef kCFISO8601Calendar; ++#endif ++/** \} */ ++ ++/** CFLocale Change Notification ++ */ ++CF_EXPORT const CFStringRef kCFLocaleCurrentLocaleDidChangeNotification; ++ ++ ++ ++/** \name Creating a Locale ++ \{ ++ */ ++CF_EXPORT CFLocaleRef ++CFLocaleCopyCurrent (void); ++ ++CF_EXPORT CFLocaleRef ++CFLocaleCreate (CFAllocatorRef allocator, ++ CFStringRef localeIdent); ++ ++CF_EXPORT CFLocaleRef ++CFLocaleCreateCopy (CFAllocatorRef allocator, ++ CFLocaleRef locale); ++ ++CF_EXPORT CFLocaleRef ++CFLocaleGetSystem (void); ++/** \} */ ++ ++/** \name Getting System Locale Information ++ \{ ++ */ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++CF_EXPORT CFArrayRef ++CFLocaleCopyAvailableLocaleIdentifiers (void); ++#endif ++/** \} */ ++ ++/** \name Getting ISO Information ++ \{ ++ */ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++CF_EXPORT CFArrayRef ++CFLocaleCopyISOCountryCodes (void); ++ ++CF_EXPORT CFArrayRef ++CFLocaleCopyISOLanguageCodes (void); ++ ++CF_EXPORT CFArrayRef ++CFLocaleCopyISOCurrencyCodes (void); ++#endif ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++CF_EXPORT CFArrayRef ++CFLocaleCopyCommonISOCurrencyCodes (void); ++#endif ++/** \{ */ ++ ++/** \name Accessing Language Information ++ \{ ++ */ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++CF_EXPORT CFArrayRef ++CFLocaleCopyPreferredLanguages (void); ++#endif ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) ++CF_EXPORT CFLocaleLanguageDirection ++CFLocaleGetLanguageCharacterDirection (CFStringRef isoLangCode); ++ ++CF_EXPORT CFLocaleLanguageDirection ++CFLocaleGetLanguageLineDirection (CFStringRef isoLangCode); ++#endif ++/** \} */ ++ ++/** \name Getting Information About a Locale ++ \{ ++ */ ++CF_EXPORT CFStringRef ++CFLocaleCopyDisplayNameForPropertyValue (CFLocaleRef displayLocale, ++ CFStringRef key, ++ CFStringRef value); ++ ++CF_EXPORT CFTypeRef ++CFLocaleGetValue (CFLocaleRef locale, ++ CFStringRef key); ++ ++CF_EXPORT CFStringRef ++CFLocaleGetIdentifier (CFLocaleRef locale); ++/** \} */ ++ ++/** \name Getting and Creating Locale Identifiers ++ \{ ++ */ ++CF_EXPORT CFStringRef ++CFLocaleCreateCanonicalLocaleIdentifierFromString (CFAllocatorRef allocator, ++ CFStringRef localeIdent); ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++CF_EXPORT CFStringRef ++CFLocaleCreateCanonicalLanguageIdentifierFromString (CFAllocatorRef allocator, ++ CFStringRef localeIdent); ++ ++CF_EXPORT CFDictionaryRef ++CFLocaleCreateComponentsFromLocaleIdentifier (CFAllocatorRef allocator, ++ CFStringRef localeIdent); ++ ++CF_EXPORT CFStringRef ++CFLocaleCreateLocaleIdentifierFromComponents (CFAllocatorRef allocator, ++ CFDictionaryRef dictionary); ++#endif ++/** \} */ ++ ++/** \name Windows Locale Codes ++ \{ ++ */ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) ++CF_EXPORT CFStringRef ++CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode (CFAllocatorRef allocator, ++ UInt32 lcid); ++ ++CF_EXPORT UInt32 ++CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier (CFStringRef localeIdent); ++#endif ++/** \} */ ++ ++/** \name Getting the CFLocale Type ID ++ \{ ++ */ ++CF_EXPORT CFTypeID ++CFLocaleGetTypeID (void); ++/** \} */ ++ ++/** \} */ ++ ++CF_EXTERN_C_END ++ ++#endif /* OS_API_VERSION >= MAC_OS_X_VERSION_10_3 */ ++ ++#endif /* __COREFOUNDATION_CFLOCALE__ */ ++ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSObjCRuntime.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSObjCRuntime.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSObjCRuntime.h (.../branches/gcc-8-branch) +@@ -0,0 +1,631 @@ ++/** Interface to ObjC runtime for GNUStep ++ Copyright (C) 1995, 1997, 2000, 2002, 2003 Free Software Foundation, Inc. ++ ++ Written by: Andrew Kachites McCallum ++ Date: 1995 ++ Written by: Richard Frith-Macdonald ++ Date: 2002 ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ ++ AutogsdocSource: Additions/GSObjCRuntime.m ++ ++ */ ++ ++#ifndef __GSObjCRuntime_h_GNUSTEP_BASE_INCLUDE ++#define __GSObjCRuntime_h_GNUSTEP_BASE_INCLUDE ++ ++#import "GSVersionMacros.h" ++#import "GSConfig.h" ++ ++#include ++ ++#if 1 || NeXT_RUNTIME ++ #include ++ #include ++ #include ++ #ifndef _C_ATOM ++ #define _C_ATOM '%' ++ #endif ++ #define _F_CONST 0x01 ++ #define _F_IN 0x01 ++ #define _F_OUT 0x02 ++ #define _F_INOUT 0x03 ++ #define _F_BYCOPY 0x04 ++ #define _F_ONEWAY 0x08 ++ #define _C_CONST 'r' ++ #define _C_IN 'n' ++ #define _C_INOUT 'N' ++ #define _C_OUT 'o' ++ #define _C_BYCOPY 'O' ++ #define _C_ONEWAY 'V' ++#else /* GNU Objective C Runtime */ ++ #include ++ #if defined (__GNU_LIBOBJC__) ++ #include ++ #else ++ #include ++ #include ++ #endif ++#endif ++ ++/* ++ * Hack for older compiler versions that don't have all defines ++ * needed in objc-api.h ++ */ ++#ifndef _C_LNG_LNG ++#define _C_LNG_LNG 'q' ++#endif ++#ifndef _C_ULNG_LNG ++#define _C_ULNG_LNG 'Q' ++#endif ++ ++#if OBJC2RUNTIME ++/* We have a real ObjC2 runtime. ++ */ ++#include ++#else ++/* We emulate an ObjC2 runtime. ++ */ ++#include ++#endif ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++@class NSArray; ++@class NSDictionary; ++@class NSObject; ++@class NSString; ++@class NSValue; ++ ++#ifndef YES ++#define YES 1 ++#endif ++#ifndef NO ++#define NO 0 ++#endif ++#ifndef nil ++#define nil 0 ++#endif ++ ++#if !defined(_C_CONST) ++#define _C_CONST 'r' ++#endif ++#if !defined(_C_IN) ++#define _C_IN 'n' ++#endif ++#if !defined(_C_INOUT) ++#define _C_INOUT 'N' ++#endif ++#if !defined(_C_OUT) ++#define _C_OUT 'o' ++#endif ++#if !defined(_C_BYCOPY) ++#define _C_BYCOPY 'O' ++#endif ++#if !defined(_C_BYREF) ++#define _C_BYREF 'R' ++#endif ++#if !defined(_C_ONEWAY) ++#define _C_ONEWAY 'V' ++#endif ++#if !defined(_C_GCINVISIBLE) ++#define _C_GCINVISIBLE '!' ++#endif ++ ++/* ++ * Functions for accessing instance variables directly - ++ * We can copy an ivar into arbitrary data, ++ * Get the type encoding for a named ivar, ++ * and copy a value into an ivar. ++ */ ++GS_EXPORT BOOL ++GSObjCFindVariable(id obj, const char *name, ++ const char **type, unsigned int *size, int *offset); ++ ++GS_EXPORT void ++GSObjCGetVariable(id obj, int offset, unsigned int size, void *data); ++ ++GS_EXPORT void ++GSObjCSetVariable(id obj, int offset, unsigned int size, const void *data); ++ ++GS_EXPORT NSArray * ++GSObjCMethodNames(id obj, BOOL recurse); ++ ++GS_EXPORT NSArray * ++GSObjCVariableNames(id obj, BOOL recurse); ++ ++/** ++ *

    A Behavior can be seen as a "Protocol with an implementation" or a ++ * "Class without any instance variables". A key feature of behaviors ++ * is that they give a degree of multiple inheritance. ++ *

    ++ *

    Behavior methods, when added to a class, override the class's ++ * superclass methods, but not the class's methods. ++ *

    ++ *

    Whan a behavior class is added to a receiver class, not only are the ++ * methods defined in the behavior class added, but the methods from the ++ * behavior's class hierarchy are also added (unless already present). ++ *

    ++ *

    It's not the case that a class adding behaviors from another class ++ * must have "no instance vars". The receiver class just has to have the ++ * same layout as the behavior class (optionally with some additional ++ * ivars after those of the behavior class). ++ *

    ++ *

    This function provides Behaviors without adding any new syntax to ++ * the Objective C language. Simply define a class with the methods you ++ * want to add, then call this function with that class as the behavior ++ * argument. ++ *

    ++ *

    This function should be called in the +initialize method of the receiver. ++ *

    ++ *

    If you add several behaviors to a class, be aware that the order of ++ * the additions is significant. ++ *

    ++ */ ++GS_EXPORT void ++GSObjCAddClassBehavior(Class receiver, Class behavior); ++ ++/** ++ *

    An Override can be seen as a "category implemented as a separate class ++ * and manually added to the receiver class under program control, rather ++ * than automatically added by the compiler/runtime. ++ *

    ++ *

    Override methods, when added to a receiver class, replace the class's ++ * class's methods of the same name (or are added if the class did not define ++ * methods with that name). ++ *

    ++ *

    It's not the case that a class adding overrides from another class ++ * must have "no instance vars". The receiver class just has to have the ++ * same layout as the override class (optionally with some additional ++ * ivars after those of the override class). ++ *

    ++ *

    This function provides overrides without adding any new syntax to ++ * the Objective C language. Simply define a class with the methods you ++ * want to add, then call this function with that class as the override ++ * argument. ++ *

    ++ *

    This function should usually be called in the +initialize method ++ * of the receiver. ++ *

    ++ *

    If you add several overrides to a class, be aware that the order of ++ * the additions is significant. ++ *

    ++ */ ++GS_EXPORT void ++GSObjCAddClassOverride(Class receiver, Class override); ++ ++/** Turn on (YES), off (NO) or test (-1) behavior debugging. ++ */ ++GS_EXPORT BOOL GSObjCBehaviorDebug(int setget); ++ ++GS_EXPORT NSValue * ++GSObjCMakeClass(NSString *name, NSString *superName, NSDictionary *iVars); ++ ++GS_EXPORT void ++GSObjCAddClasses(NSArray *classes); ++ ++/** ++ * Given a NULL terminated list of methods, add them to the class.
    ++ * If the method already exists in a superclass, the new version overrides ++ * that one, but if the method already exists in the class itsself, the ++ * new one is quietly ignored (replace==NO) or replaced with the new ++ * version (if replace==YES).
    ++ * To add class methods, cls should be the metaclass of the class to ++ * which the methods are being added. ++ */ ++GS_EXPORT void ++GSObjCAddMethods(Class cls, Method *list, BOOL replace); ++ ++/* ++ * Functions for key-value encoding ... they access values in an object ++ * either by selector or directly, but do so using NSNumber for the ++ * scalar types of data. ++ */ ++GS_EXPORT id ++GSObjCGetVal(NSObject *self, const char *key, SEL sel, ++ const char *type, unsigned size, int offset); ++ ++GS_EXPORT void ++GSObjCSetVal(NSObject *self, const char *key, id val, SEL sel, ++ const char *type, unsigned size, int offset); ++ ++/* ++ * This section includes runtime functions ++ * to query and manipulate the ObjC runtime structures. ++ * These functions take care to not use ObjC code so ++ * that they can safely be used in +(void)load implementations ++ * where applicable. ++ */ ++ ++/** ++ * Deprecated ... use objc_getClassList() ++ */ ++GS_EXPORT unsigned int ++GSClassList(Class *buffer, unsigned int max, BOOL clearCache); ++ ++/** ++ * GSObjCClass() is deprecated ... use object_getClass() ++ */ ++GS_EXPORT Class GSObjCClass(id obj); ++ ++/** ++ * GSObjCSuper() is deprecated ... use class_getSuperclass() ++ */ ++GS_EXPORT Class GSObjCSuper(Class cls); ++ ++/** ++ * GSObjCIsInstance() is deprecated ... use object_getClass() ++ * in conjunction with class_isMetaClass() ++ */ ++GS_EXPORT BOOL GSObjCIsInstance(id obj); ++ ++/** ++ * GSObjCIsClass() is deprecated ... use object_getClass() ++ * in conjunction with class_isMetaClass() ++ */ ++GS_EXPORT BOOL GSObjCIsClass(Class cls); ++ ++/** ++ * Test to see if class inherits from another class ++ * The argument to this function must NOT be nil. ++ */ ++GS_EXPORT BOOL GSObjCIsKindOf(Class cls, Class other); ++ ++/** ++ * GSClassFromName() is deprecated ... use objc_lookUpClass() ++ */ ++GS_EXPORT Class GSClassFromName(const char *name); ++ ++/** ++ * GSNameFromClass() is deprecated ... use class_getName() ++ */ ++GS_EXPORT const char *GSNameFromClass(Class cls); ++ ++/** ++ * GSClassNameFromObject() is deprecated ... use object_getClass() ++ * in conjunction with class_getName() ++ */ ++GS_EXPORT const char *GSClassNameFromObject(id obj); ++ ++/** ++ * GSNameFromSelector() is deprecated ... use sel_getName() ++ */ ++GS_EXPORT const char *GSNameFromSelector(SEL sel); ++ ++/** ++ * GSSelectorFromName() is deprecated ... use sel_getUid() ++ */ ++GS_EXPORT SEL ++GSSelectorFromName(const char *name); ++ ++/** ++ * Return the selector for the specified name and types.
    ++ * Returns a nul pointer if the name is nul.
    ++ * Creates a new selector if necessary.
    ++ * Code must NOT rely on this providing a selector with type information. ++ */ ++GS_EXPORT SEL ++GSSelectorFromNameAndTypes(const char *name, const char *types); ++ ++/** ++ * Return the type information from the specified selector.
    ++ * May return a nul pointer if the selector was a nul pointer or if it ++ * was not typed (or if the runtime does not support typed selectors).
    ++ * Code must NOT rely on this providing any type information. ++ */ ++GS_EXPORT const char * ++GSTypesFromSelector(SEL sel); ++ ++/** ++ * Compare only the type information ignoring qualifiers, the frame layout ++ * and register markers. Unlike sel_types_match, this function also ++ * handles comparisons of types with and without any layout information. ++ */ ++GS_EXPORT BOOL ++GSSelectorTypesMatch(const char *types1, const char *types2); ++ ++/** Takes full type information and skips forward to the actual type ++ * as specified in the _C_... constants. ++ */ ++GS_EXPORT const char * ++GSSkipTypeQualifierAndLayoutInfo(const char *types); ++ ++/** ++ * Returns a protocol object with the corresponding name. ++ * This function searches the registered classes for any protocol ++ * with the supplied name. If one is found, it is cached in ++ * for future requests. If efficiency is a factor then use ++ * GSRegisterProtocol() to insert a protocol explicitly into the cache ++ * used by this function. If no protocol is found this function returns ++ * nil. ++ */ ++GS_EXPORT Protocol * ++GSProtocolFromName(const char *name); ++ ++/** ++ * Registers proto in the cache used by GSProtocolFromName(). ++ */ ++GS_EXPORT void ++GSRegisterProtocol(Protocol *proto); ++ ++/** ++ * A variant of protocol_getMethodDescription which recursively searches ++ * parent protocols if the requested selector isn't found in the given ++ * protocol. ++ * ++ * Returns a {NULL, NULL} structure if the requested selector couldn't be ++ * found. ++ */ ++GS_EXPORT struct objc_method_description ++GSProtocolGetMethodDescriptionRecursive(Protocol *aProtocol, SEL aSel, BOOL isRequired, BOOL isInstance); ++ ++/* ++ * Unfortunately the definition of the symbols ++ * 'Method(_t)', 'MethodList(_t)' and 'IVar(_t)' ++ * are incompatible between the GNU and NeXT/Apple runtimes. ++ * We introduce GSMethod, GSMethodList and GSIVar to allow portability. ++ */ ++typedef Method GSMethod; ++typedef Ivar GSIVar; ++ ++/** ++ * Returns the pointer to the method structure ++ * for the selector in the specified class. ++ * Depending on searchInstanceMethods, this function searches ++ * either instance or class methods. ++ * Depending on searchSuperClassesm this function searches ++ * either the specified class only or also its superclasses.
    ++ * To obtain the implementation pointer IMP use returnValue->method_imp ++ * which should be safe across all runtimes.
    ++ * It should be safe to use this function in +load implementations.
    ++ * This function should currently (June 2004) be considered WIP. ++ * Please follow potential changes (Name, parameters, ...) closely until ++ * it stabilizes. ++ */ ++GS_EXPORT GSMethod ++GSGetMethod(Class cls, SEL sel, ++ BOOL searchInstanceMethods, ++ BOOL searchSuperClasses); ++ ++/** ++ * Deprecated .. does nothing. ++ */ ++GS_EXPORT void ++GSFlushMethodCacheForClass (Class cls); ++ ++/** ++ * Deprecated .. use class_getInstanceVariable() ++ */ ++GS_EXPORT GSIVar ++GSCGetInstanceVariableDefinition(Class cls, const char *name); ++ ++/** ++ * Deprecated .. use class_getInstanceVariable() ++ */ ++GS_EXPORT GSIVar ++GSObjCGetInstanceVariableDefinition(Class cls, NSString *name); ++ ++/** ++ * GSObjCVersion() is deprecated ... use class_getVersion() ++ */ ++GS_EXPORT int GSObjCVersion(Class cls); ++ ++/** ++ * Quickly return autoreleased data storage area. ++ */ ++GS_EXPORT void * ++GSAutoreleasedBuffer(unsigned size); ++ ++/** ++ *

    Prints a message to fptr using the format string provided and any ++ * additional arguments. The format string is interpreted as by ++ * the NSString formatted initialisers, and understands the '%@' syntax ++ * for printing an object. ++ *

    ++ *

    The data is written to the file pointer in the default CString ++ * encoding if possible, as a UTF8 string otherwise. ++ *

    ++ *

    This function is recommended for printing general log messages. ++ * For debug messages use NSDebugLog() and friends. For error logging ++ * use NSLog(), and for warnings you might consider NSWarnLog(). ++ *

    ++ */ ++GS_EXPORT BOOL ++GSPrintf (FILE *fptr, NSString *format, ...); ++ ++ ++ ++GS_EXPORT NSArray * ++GSObjCAllSubclassesOfClass(Class cls); ++ ++GS_EXPORT NSArray * ++GSObjCDirectSubclassesOfClass(Class cls); ++ ++/** Function to change the class of the specified instance to newClass. ++ * This handles memory debugging issues in GNUstep-base and also ++ * deals with class finalisation issues in a garbage collecting ++ * environment, so you should use this function rather than attempting ++ * to swizzle class pointers directly. ++ */ ++GS_EXPORT void ++GSClassSwizzle(id instance, Class newClass); ++ ++#if !defined(GS_GNUSTEP_V) || (GS_GNUSTEP_V >= GS_API_ANY && GS_GNUSTEP_V < 011500) ++//GS_API_VERSION(GS_API_ANY,011500) ++ ++GS_EXPORT const char * ++GSLastErrorStr(long error_id) GS_DEPRECATED_FUNC; ++ ++#endif ++ ++ ++ ++#ifndef GS_MAX_OBJECTS_FROM_STACK ++/** ++ * The number of objects to try to get from varargs into an array on ++ * the stack ... if there are more than this, use the heap. ++ * NB. This MUST be a multiple of 2 ++ */ ++#define GS_MAX_OBJECTS_FROM_STACK 128 ++#endif ++ ++/** ++ *

    This is a macro designed to minimise the use of memory allocation and ++ * deallocation when you need to work with a vararg list of objects.
    ++ * The objects are unpacked from the vararg list into two 'C' arrays and ++ * then a code fragment you specify is able to make use of them before ++ * that 'C' array is destroyed. ++ *

    ++ *

    The firstObject argument is the name of the formal parameter in your ++ * method or function which precedes the ', ...' denoting variable args. ++ *

    ++ *

    The code argument is a piece of objective-c code to be executed to ++ * make use of the objects stored in the 'C' arrays.
    ++ * When this code is called the unsigned integer '__count' will contain the ++ * number of objects unpacked, the pointer '__objects' will point to ++ * the first object in each pair, and the pointer '__pairs' will point ++ * to an array containing the second halves of the pairs of objects ++ * whose first halves are in '__objects'.
    ++ * This lets you pack a list of the form 'key, value, key, value, ...' ++ * into an array of keys and an array of values. ++ *

    ++ */ ++#define GS_USEIDPAIRLIST(firstObject, code...) ({\ ++ va_list __ap; \ ++ unsigned int __max = GS_MAX_OBJECTS_FROM_STACK; \ ++ unsigned int __count = 0; \ ++ id __buf[__max]; \ ++ id *__objects = __buf; \ ++ id *__pairs = &__objects[__max/2]; \ ++ id __obj = firstObject; \ ++ va_start(__ap, firstObject); \ ++ while (__obj != nil && __count < __max) \ ++ { \ ++ if ((__count % 2) == 0) \ ++ { \ ++ __objects[__count/2] = __obj; \ ++ } \ ++ else \ ++ { \ ++ __pairs[__count/2] = __obj; \ ++ } \ ++ __obj = va_arg(__ap, id); \ ++ if (++__count == __max) \ ++ { \ ++ while (__obj != nil) \ ++ { \ ++ __count++; \ ++ __obj = va_arg(__ap, id); \ ++ } \ ++ } \ ++ } \ ++ if ((__count % 2) == 1) \ ++ { \ ++ __pairs[__count/2] = nil; \ ++ __count++; \ ++ } \ ++ va_end(__ap); \ ++ if (__count > __max) \ ++ { \ ++ unsigned int __tmp; \ ++ __objects = (id*)malloc(__count*sizeof(id)); \ ++ __pairs = &__objects[__count/2]; \ ++ __objects[0] = firstObject; \ ++ va_start(__ap, firstObject); \ ++ for (__tmp = 1; __tmp < __count; __tmp++) \ ++ { \ ++ if ((__tmp % 2) == 0) \ ++ { \ ++ __objects[__tmp/2] = va_arg(__ap, id); \ ++ } \ ++ else \ ++ { \ ++ __pairs[__tmp/2] = va_arg(__ap, id); \ ++ } \ ++ } \ ++ va_end(__ap); \ ++ } \ ++ code; \ ++ if (__objects != __buf) free(__objects); \ ++}) ++ ++/** ++ *

    This is a macro designed to minimise the use of memory allocation and ++ * deallocation when you need to work with a vararg list of objects.
    ++ * The objects are unpacked from the vararg list into a 'C' array and ++ * then a code fragment you specify is able to make use of them before ++ * that 'C' array is destroyed. ++ *

    ++ *

    The firstObject argument is the name of the formal parameter in your ++ * method or function which precedes the ', ...' denoting variable args. ++ *

    ++ *

    The code argument is a piece of objective-c code to be executed to ++ * make use of the objects stored in the 'C' array.
    ++ * When this code is called the unsigned integer '__count' will contain the ++ * number of objects unpacked, and the pointer '__objects' will point to ++ * the unpacked objects, ie. firstObject followed by the vararg arguments ++ * up to (but not including) the first nil. ++ *

    ++ */ ++#define GS_USEIDLIST(firstObject, code...) ({\ ++ va_list __ap; \ ++ unsigned int __max = GS_MAX_OBJECTS_FROM_STACK; \ ++ unsigned int __count = 0; \ ++ id __buf[__max]; \ ++ id *__objects = __buf; \ ++ id __obj = firstObject; \ ++ va_start(__ap, firstObject); \ ++ while (__obj != nil && __count < __max) \ ++ { \ ++ __objects[__count] = __obj; \ ++ __obj = va_arg(__ap, id); \ ++ if (++__count == __max) \ ++ { \ ++ while (__obj != nil) \ ++ { \ ++ __count++; \ ++ __obj = va_arg(__ap, id); \ ++ } \ ++ } \ ++ } \ ++ va_end(__ap); \ ++ if (__count > __max) \ ++ { \ ++ unsigned int __tmp; \ ++ __objects = (id*)NSZoneMalloc(NSDefaultMallocZone(),__count*sizeof(id)); \ ++ va_start(__ap, firstObject); \ ++ __objects[0] = firstObject; \ ++ for (__tmp = 1; __tmp < __count; __tmp++) \ ++ { \ ++ __objects[__tmp] = va_arg(__ap, id); \ ++ } \ ++ va_end(__ap); \ ++ } \ ++ code; \ ++ if (__objects != __buf) NSZoneFree (NSDefaultMallocZone(),__objects); \ ++}) ++ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* __GSObjCRuntime_h_GNUSTEP_BASE_INCLUDE */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSArray+GNUstepBase.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSArray+GNUstepBase.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSArray+GNUstepBase.h (.../branches/gcc-8-branch) +@@ -0,0 +1,78 @@ ++/** Declaration of extension methods for base additions ++ ++ Copyright (C) 2003-2010 Free Software Foundation, Inc. ++ ++ Written by: Richard Frith-Macdonald ++ and: Adam Fedor ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ ++*/ ++ ++#ifndef INCLUDED_NSArray_GNUstepBase_h ++#define INCLUDED_NSArray_GNUstepBase_h ++ ++#import "../GNUstepBase/GSVersionMacros.h" ++#import "../Foundation/NSArray.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#if OS_API_VERSION(GS_API_NONE,GS_API_LATEST) ++ ++@interface NSArray (GNUstepBase) ++ ++/**

    Method for working with sorted arrays - use a binary chop ++ * to determine the insertion location for an object. If equal objects ++ * already exist in the array, they will be located immediately before ++ * the insertion position. ++ *

    ++ *

    The comparator function takes two items as arguments, the first is the ++ * item to be added, the second is the item already in the array. ++ * The function should return NSOrderedAscending if the item to be ++ * added is 'less than' the item in the array, NSOrderedDescending ++ * if it is greater, and NSOrderedSame if it is equal. ++ *

    ++ */ ++- (NSUInteger) insertionPosition: (id)item ++ usingFunction: (NSComparisonResult (*)(id, id, void *))sorter ++ context: (void *)context; ++ ++/*

    Method for working with sorted arrays - use a binary chop ++ * to determine the insertion location for an object. If equal objects ++ * already exist in the array, they will be located immediately before ++ * the insertion position. ++ *

    ++ *

    The selector identifies a method returning NSOrderedAscending if ++ * the receiver is 'less than' the argument, and NSOrderedDescending if ++ * it is greate. ++ *

    ++ */ ++- (NSUInteger) insertionPosition: (id)item ++ usingSelector: (SEL)comp; ++@end ++ ++#endif /* OS_API_VERSION */ ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* INCLUDED_NSArray_GNUstepBase_h */ ++ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSMutableString+GNUstepBase.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSMutableString+GNUstepBase.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSMutableString+GNUstepBase.h (.../branches/gcc-8-branch) +@@ -0,0 +1,57 @@ ++/** Declaration of extension methods for base additions ++ ++ Copyright (C) 2003-2010 Free Software Foundation, Inc. ++ ++ Written by: Richard Frith-Macdonald ++ and: Adam Fedor ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ ++*/ ++ ++#ifndef INCLUDED_NSMutableString_GNUstepBase_h ++#define INCLUDED_NSMutableString_GNUstepBase_h ++ ++#import "GSVersionMacros.h" ++#import "../Foundation/NSString.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#if OS_API_VERSION(GS_API_NONE,GS_API_LATEST) ++ ++@interface NSMutableString (GNUstepBase) ++- (void) deleteSuffix: (NSString*)suffix; ++- (void) deletePrefix: (NSString*)prefix; ++- (NSString*) immutableProxy; ++- (void) replaceString: (NSString*)replace ++ withString: (NSString*)by; ++- (void) trimLeadSpaces; ++- (void) trimTailSpaces; ++- (void) trimSpaces; ++@end ++ ++#endif /* OS_API_VERSION */ ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* INCLUDED_NSMutableString_GNUstepBase_h */ ++ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSConfig.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSConfig.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSConfig.h (.../branches/gcc-8-branch) +@@ -0,0 +1,462 @@ ++/* Machine/OS specific configuration information for GNUstep ++ ++ Please NOTE - GSConfig.h is generated by the configure script from the ++ file GSConfig.h.in - changes/fixes need to be made to the original file, ++ not to the GSConfig.h generated from it. ++ ++ Copyright (C) 1998-2010 Free Software Foundation, Inc. ++ ++ Written by: Richard frith-Macdonald ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ */ ++ ++#ifndef included_GSConfig_h ++#define included_GSConfig_h ++ ++/* Check the compiler to see if we are building on/for ms-windows. ++ * Whatever the compiler uses, we want a standard setting of _WIN64 ++ * to indicate 64bit AND _WIN32 to indicate ms-windows. ++ * These are defined by gcc, clang, and microsoft compilers anyway. ++ */ ++#if defined(__WIN32__) \ ++ || defined(__MS_WIN32__) \ ++ || defined(__MINGW32__) ++# if !defined(_WIN32) ++# define _WIN32 ++# endif ++#endif ++#if defined(__WIN64__) \ ++ || defined(__MS_WIN64__) \ ++ || defined(__MINGW64__) ++# if !defined(__WIN64__) ++# define __WIN64__ ++# endif ++# if !defined(_WIN32) ++# define _WIN32 ++# endif ++#endif ++ ++/* Check to see if this is a MINGW build (all we currently support) ++ */ ++#if defined(__MINGW32__) || defined(__MINGW64__) ++# if !defined(__MINGW__) ++# define __MINGW__ ++# endif ++#endif ++ ++// Make sure we expose the constants that we use in ObjC++ mode ++#ifndef __STDC_CONSTANT_MACROS ++#define __STDC_CONSTANT_MACROS 1 ++#endif ++#ifndef __STDC_LIMIT_MACROS ++#define __STDC_LIMIT_MACROS 1 ++#endif ++ ++#if !defined(NeXT_Foundation_LIBRARY) ++ ++/* An alternate to GS_FAKE_MAIN which forces the user to call the ++ NSProcessInfo initialization in 'main', GS_FAKE_MAIN must also ++ be undefined. */ ++#if 0 ++#define GS_PASS_ARGUMENTS 0 ++#endif ++ ++#define GS_FAKE_MAIN 0 ++#if GS_FAKE_MAIN ++ ++/* ++ * NOTE - if GS_FAKE_MAIN (above) is set to 1, this hack applies - and you ++ * must make sure that this file is included in any file that implements ++ * the 'main()' function and links with the GNUstep base libarary. ++ * You should NOT include this file in a program that does not link with ++ * the base library. ++ * This file is included automatically in NSObject.h and Foundation.h ++ * ++ * The Foundation classe NSProcessInfo need access to the argc, argv, ++ * and env variables of the main() function. The purpose of this (ugly hack) ++ * definition is to give the gstep-base library the opportunity to implement ++ * its own main function with private access to the global vars. The private ++ * main() implementation (in NSProcessInfo.m) will then call the user defined ++ * gnustep_base_user_main() function. ++ * ++ * The original hack was - ++ ** Written by: Georg Tuparev, EMBL & Academia Naturalis, ++ ** Heidelberg, Germany ++ ** Tuparev@EMBL-Heidelberg.de ++ ** ++ ** NOTE! This is very dirty and dangerous trick. I spend several hours ++ ** on thinking and man pages browsing, but couldn't find better solution. ++ ** I know that I will spend 666 years in the Computer Hell for writing ++ ** this hack, and the master devil (Bully Boy) will send me to write ++ ** Windowz software. ++ ** BTW, for writing this hack I got personal congratulations from Dennis ++ ** Ritchie and Bjarne Stroustrup sent me a bunch of flowers and asked me ++ ** to participate in the standardization committee for C-- v.6.0 as ++ ** responsible for the new Tab-Overriding-Operator and Scope-Sensitive- ++ ** Comments ... but this makes my situation even worse ;-) ++ ** - Georg ++ * ++ * On some systems, there are other relatively clean workarounds, if this ++ * applies to the system you are running on, your configuration script ++ * should have set GS_FAKE_MAIN to zero, so that this define hack will ++ * not be used. ++ */ ++ ++#define main gnustep_base_user_main ++ ++#endif /* GS_FAKE_MAIN */ ++#endif ++ ++/* ++ * Definition to specify if your processor stores words with the most ++ * significant byte first (like Motorola and SPARC, unlike Intel and VAX). ++ */ ++#define GS_WORDS_BIGENDIAN 0 ++ ++/* ++ * Size definitions for standard types ++ */ ++#define GS_SIZEOF_SHORT 2 ++#define GS_SIZEOF_INT 4 ++#define GS_SIZEOF_LONG 8 ++#define GS_SIZEOF_LONG_LONG 8 ++#define GS_SIZEOF_FLOAT 4 ++#define GS_SIZEOF_DOUBLE 8 ++#define GS_SIZEOF_VOIDP 8 ++ ++/* ++ * Size information to be places in bits 5 and 6 of type encoding bytes ++ * in archives (bits 0 to 4 are used for basic type info and bit 7 is ++ * used to mark cross-references to previously encoded objects). ++ */ ++#define _GSC_S_SHT _GSC_I16 ++#define _GSC_S_INT _GSC_I32 ++#define _GSC_S_LNG _GSC_I64 ++#define _GSC_S_LNG_LNG _GSC_I64 ++ ++/* ++ * Type definitions for types with known sizes. ++ */ ++typedef signed char gss8; ++typedef unsigned char gsu8; ++typedef signed short gss16; ++typedef unsigned short gsu16; ++typedef signed int gss32; ++typedef unsigned int gsu32; ++typedef signed long gss64; ++typedef unsigned long gsu64; ++typedef struct { gsu8 a[16]; } gss128; ++typedef struct { gsu8 a[16]; } gsu128; ++typedef float gsf32; ++typedef double gsf64; ++ ++/* ++ * Integer type with same size as a pointer ++ */ ++typedef unsigned long gsuaddr; ++typedef long gssaddr; ++typedef gsuaddr gsaddr; ++ ++/* ++ * Do we have real 64-bit and 128-bit integers or are we just pretending. ++ */ ++#define GS_HAVE_I64 1 ++#define GS_HAVE_I128 0 ++ ++/* ++ * Ensure some standard types are defined. ++ */ ++#include ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++/* ++ * PTR Limit information replacements for buggy headers ++ */ ++#if 0 ++#undef INTPTR_MAX ++#define INTPTR_MAX ++#undef INTPTR_MIN ++#define INTPTR_MIN ++#undef UINTPTR_MAX ++#define UINTPTR_MAX ++#endif ++ ++ ++/* ++ * Do we have zlib for file handle compression? ++ */ ++#define USE_ZLIB 1 ++ ++/* ++ * Do we have the GNU Multiple-precision library for NSDecimal? ++ */ ++//#define USE_GMP 1 ++#define USE_GMP 0 ++ ++#ifdef GS_WITH_GC ++#undef GS_WITH_GC ++#endif ++#define GS_WITH_GC 0 ++ ++/* ++ * Define to say if we use NXConstantString or NSConstantString ++ */ ++#define NXConstantString NSConstantString ++ ++ ++/* ++ * Wide unicode character type. ++ */ ++#ifndef UTF32Char ++#define UTF32Char uint32_t ++#endif ++ ++/* ++ * Native character type for use in systemcalls etc. ++ */ ++ ++#if defined(__MINGW__) ++# define GSNativeChar uint16_t ++#else ++# define GSNativeChar char ++#endif ++ ++/* ++ * Types used to avoid exposing pthread header in NSLock.h ++ * NB. These types should *never* be used except to provide enough space ++ * in a class layout for the type of data actually used by the pthread ++ * implementation of the current platform. ++ */ ++typedef struct { ++ uint8_t dummy[48]; ++} gs_cond_t __attribute__((aligned (8))); ++typedef struct { ++ uint8_t dummy[40]; ++} gs_mutex_t __attribute__((aligned (8))); ++ ++#define OBJC2RUNTIME 1 ++#define BASE_NATIVE_OBJC_EXCEPTIONS 1 ++#define GS_NONFRAGILE 0 ++#define GS_MIXEDABI 0 ++#define GS_USE_LIBXML 0 ++#define GS_USE_GNUTLS 0 ++#define GS_USE_AVAHI 0 ++#define GS_USE_MDNS 0 ++#define GS_USE_ICU 0 ++#define GS_USE_LIBDISPATCH 0 ++#define GS_USE_LIBDISPATCH_RUNLOOP 0 ++#define GS_HAVE_OBJC_ROOT_CLASS_ATTR 0 ++ ++#ifndef __has_include ++# define __has_include(x) 0 ++#endif ++#ifndef __has_feature ++# define __has_feature(x) 0 ++#endif ++#ifndef __has_builtin ++# define __has_builtin(x) 0 ++#endif ++ ++/* ++ * __has_extension has slightly different semantics from __has_feature. ++ * It evaluates to true if the feature is supported by by clang for the ++ * current compilation unit (language and -f switches), regardless of ++ * whether it is part of the language standard or just a (non-standard) ++ * extension. ++ */ ++#ifndef __has_extension ++# define __has_extension(x) __has_feature(x) ++#endif ++ ++#if defined(_WIN32) ++#define BOOL WinBOOL ++#define __OBJC_BOOL 1 ++#include ++#ifndef _WIN32_WINNT ++#define _WIN32_WINNT Windows2000 ++#endif ++#if !defined(WINVER) ++#define WINVER Windows2000 ++#elif (WINVER < Windows2000) ++#undef WINVER ++#define WINVER Windows2000 ++#endif ++ ++#if defined(__WIN64__) ++#include ++#include ++#else ++#include ++#include ++#endif ++ ++#undef __OBJC_BOOL ++#undef BOOL ++#endif ++ ++/* Include the blocks runtime header if it's available (It shouldn't matter ++ * that this doesn't work on compilers that don't support __has_include(), ++ * because they also don't support blocks). ++ */ ++#if __has_include() ++# include ++#endif ++ ++#ifndef _WIN32 ++#include /* Hack to get rid of warning in GNU libc 2.0.3. */ ++#endif ++ ++/* The following group of lines maintained by the gstep-base configure */ ++#define GNUSTEP_BASE_VERSION 1.26.0 ++#define GNUSTEP_BASE_MAJOR_VERSION 1 ++#define GNUSTEP_BASE_MINOR_VERSION 26 ++#define GNUSTEP_BASE_SUBMINOR_VERSION 0 ++#define GNUSTEP_BASE_GCC_VERSION 4.0.0 ++ ++/* Do not use the following macros! ++ */ ++#define OBJC_DEP(M) \ ++ ({ static BOOL beenHere = NO; if (beenHere == NO) {\ ++ beenHere = YES; fprintf(stderr, "%s:%d %s", __FILE__, __LINE__, (M));}}) ++ ++#define OBJC_MALLOC(VAR, TYPE, NUM) \ ++ (OBJC_DEP("OBJC_MALLOC is deprecated ... use malloc\n"),(VAR) = (TYPE *) malloc ((unsigned)(NUM)*sizeof(TYPE))) ++#define OBJC_VALLOC(VAR, TYPE, NUM) \ ++ (OBJC_DEP("OBJC_VALLOC is deprecated\n"),(VAR) = (TYPE *) valloc ((unsigned)(NUM)*sizeof(TYPE))) ++#define OBJC_ATOMIC_MALLOC(VAR, TYPE, NUM) \ ++ (OBJC_DEP("OBJC_ATOMIC_MALLOC is deprecated\n"),(VAR) = (TYPE *) malloc ((unsigned)(NUM)*sizeof(TYPE))) ++#define OBJC_REALLOC(VAR, TYPE, NUM) \ ++ (OBJC_DEP("OBJC_REALLOC is deprecated ... use realloc\n"),(VAR) = (TYPE *) realloc ((VAR), (unsigned)(NUM)*sizeof(TYPE))) ++#define OBJC_CALLOC(VAR, TYPE, NUM) \ ++ (OBJC_DEP("OBJC_CALLOC is deprecated ... use calloc\n"),(VAR) = (TYPE *) calloc ((unsigned)(NUM), sizeof(TYPE))) ++#define OBJC_FREE(PTR) (OBJC_DEP("OBJC_FREE is deprecated ... use free\n"), free (PTR)) ++ ++#ifndef MAX ++#define MAX(a,b) \ ++ ({__typeof__(a) _MAX_a = (a); __typeof__(b) _MAX_b = (b); \ ++ _MAX_a > _MAX_b ? _MAX_a : _MAX_b; }) ++#endif ++ ++#ifndef MIN ++#define MIN(a,b) \ ++ ({__typeof__(a) _MIN_a = (a); __typeof__(b) _MIN_b = (b); \ ++ _MIN_a < _MIN_b ? _MIN_a : _MIN_b; }) ++#endif ++ ++#ifndef ABS ++#define ABS(a) \ ++ ({__typeof__(a) _ABS_a = (a); \ ++ _ABS_a < 0 ? -_ABS_a : _ABS_a; }) ++#endif ++ ++#ifndef STRINGIFY ++#define STRINGIFY(s) XSTRINGIFY(s) ++#define XSTRINGIFY(s) #s ++#endif ++ ++#ifndef OBJC_STRINGIFY ++#define OBJC_STRINGIFY(s) OBJC_XSTRINGIFY(s) ++#define OBJC_XSTRINGIFY(s) @#s ++#endif ++ ++#ifndef PTR2LONG ++#define PTR2LONG(P) (((char*)(P))-(char*)0) ++#endif ++#ifndef LONG2PTR ++#define LONG2PTR(L) (((char*)0)+(L)) ++#endif ++ ++#if VSPRINTF_RETURNS_LENGTH ++#define VSPRINTF_LENGTH(VSPF_CALL) (VSPF_CALL) ++#else ++#define VSPRINTF_LENGTH(VSPF_CALL) strlen((VSPF_CALL)) ++#endif /* VSPRINTF_RETURNS_LENGTH */ ++ ++#if VASPRINTF_RETURNS_LENGTH ++#define VASPRINTF_LENGTH(VASPF_CALL) (VASPF_CALL) ++#else ++#define VASPRINTF_LENGTH(VASPF_CALL) strlen((VASPF_CALL)) ++#endif /* VSPRINTF_RETURNS_LENGTH */ ++ ++/* Evil hack to stop gcc-4.1 complaining about a dealloc method which ++ * does not call the superclass implementation. ++ */ ++#define GSNOSUPERDEALLOC if (0) [super dealloc] ++ ++#ifndef CF_EXCLUDE_CSTD_HEADERS ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#endif ++ ++#if !__has_feature(objc_arc) ++// NetBSD > 6 defines __weak in cdefs_elf.h ++#ifdef __NetBSD__ ++#undef __weak ++#endif ++# if !defined(__weak) ++# define __weak ++# endif ++# if !defined(__strong) ++# define __strong ++# endif ++#endif ++ ++#ifndef __unsafe_unretained ++# if !__has_feature(objc_arc) ++# define __unsafe_unretained ++# endif ++#endif ++#ifndef __bridge ++# if !__has_feature(objc_arc) ++# define __bridge ++# endif ++#endif ++ ++#if __has_builtin(__builtin_unreachable) ++# define GS_UNREACHABLE() __builtin_unreachable() ++#else ++# define GS_UNREACHABLE() abort() ++#endif ++ ++#endif /* included_GSConfig_h */ ++ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSObject+GNUstepBase.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSObject+GNUstepBase.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSObject+GNUstepBase.h (.../branches/gcc-8-branch) +@@ -0,0 +1,242 @@ ++/** Declaration of extension methods for base additions ++ ++ Copyright (C) 2003-2010 Free Software Foundation, Inc. ++ ++ Written by: Richard Frith-Macdonald ++ and: Adam Fedor ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ ++*/ ++ ++#ifndef INCLUDED_NSObject_GNUstepBase_h ++#define INCLUDED_NSObject_GNUstepBase_h ++ ++#import "GSVersionMacros.h" ++#import "../Foundation/NSObject.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#if OS_API_VERSION(GS_API_NONE,GS_API_LATEST) ++ ++@class NSHashTable; ++ ++@interface NSObject (GNUstepBase) ++ ++/** ++ WARNING: The -compare: method for NSObject is deprecated ++ due to subclasses declaring the same selector with ++ conflicting signatures. ++ Comparision of arbitrary objects is not just meaningless ++ but also dangerous as most concrete implementations ++ expect comparable objects as arguments often accessing ++ instance variables directly. ++ This method will be removed in a future release. ++*/ ++- (NSComparisonResult) compare: (id)anObject; ++ ++/** For backward compatibility only ... use class_isMetaClass() on the ++ * class of the receiver instead. ++ */ ++- (BOOL) isInstance; ++ ++/** DEPRECATED ... do not use. ++ * Transmutes the receiver into an immutable version of the same object ++ * and returns the result.
    ++ * If the receiver is not a mutable object or cannot be simply transmuted, ++ * then this method either returns the receiver unchanged or, ++ * if the force flag is set to YES, returns an autoreleased copy of the ++ * receiver.
    ++ * Mutable classes should override this default implementation.
    ++ * This method is used in methods which are declared to return immutable ++ * objects (eg. an NSArray), but which create and build mutable ones ++ * internally. ++ */ ++- (id) makeImmutableCopyOnFail: (BOOL)force; ++ ++/** Transmutes the receiver into an immutable version of the same object. ++ * Returns YES if the receiver has become immutable, NO otherwise.
    ++ * The default implementation returns NO.
    ++ * Mutable classes which have an immutable counterpart they can efficiently ++ * change into, should override to transmute themselves and return YES.
    ++ * Immutable classes should override this to simply return YES with no ++ * further action.
    ++ * This method is used in methods which are declared to return immutable ++ * objects (eg. an NSArray), but which create and build mutable ones ++ * internally. ++ */ ++- (BOOL) makeImmutable; ++ ++/** ++ * Message sent when an implementation wants to explicitly exclude a method ++ * (but cannot due to compiler constraint), and wants to make sure it is not ++ * called by mistake. Default implementation raises an exception at runtime. ++ */ ++- (id) notImplemented: (SEL)aSel GS_NORETURN_METHOD; ++ ++/** ++ * Message sent when an implementation wants to explicitly require a subclass ++ * to implement a method (but cannot at compile time since there is no ++ * abstract keyword in Objective-C). Default implementation ++ * raises an exception at runtime to alert developer that he/she forgot to ++ * override a method. ++ */ ++- (id) subclassResponsibility: (SEL)aSel GS_NORETURN_METHOD; ++ ++/** ++ * Message sent when an implementation wants to explicitly exclude a method ++ * (but cannot due to compiler constraint) and forbid that subclasses ++ * implement it. Default implementation raises an exception at runtime. If a ++ * subclass does implement this method, however, the superclass's ++ * implementation will not be called, so this is not a perfect mechanism. ++ */ ++- (id) shouldNotImplement: (SEL)aSel GS_NORETURN_METHOD; ++ ++@end ++ ++/** This is an informal protocol ... classes may implement the method to ++ * report how much memory is used by the instance and any objects it acts ++ * as a container for. ++ */ ++@interface NSObject(MemoryFootprint) ++/* This method returns the memory usage of the receiver, excluding any ++ * objects already present in the exclude table.
    ++ * The argument is a hash table configured to hold non-retained pointer ++ * objects and is used to inform the receiver that its size should not ++ * be counted again if it's already in the table.
    ++ * The NSObject implementation returns zero if the receiver is in the ++ * table, but otherwise adds itself to the table and returns its memory ++ * footprint (the sum of all of its instance variables, but not any ++ * memory pointed to by those variables).
    ++ * Subclasses should override this method by calling the superclass ++ * implementation, and either return the result (if it was zero) or ++ * return that value plus the sizes of any memory owned by the receiver ++ * (eg found by calling the same method on objects pointed to by the ++ * receiver's instance variables). ++ */ ++- (NSUInteger) sizeInBytesExcluding: (NSHashTable*)exclude; ++@end ++ ++/** This is an informal protocol ... classes may implement the method and ++ * register themselves to have it called on process exit. ++ */ ++@interface NSObject(GSAtExit) ++/** This method is called on exit for any class which implements it and which ++ * has called +registerAtExit to register it to be called.
    ++ * The order in which methods for different classes is called is the reverse ++ * of the order in which the classes were registered, but it's best to assume ++ * the method can not depend on any other class being in a usable state ++ * at the point when the method is called (rather like +load).
    ++ * Typical use would be to release memory occupied by class data structures ++ * so that memory usage analysis software will not think the memory has ++ * been leaked. ++ */ +++ (void) atExit; ++@end ++ ++/** Category for methods handling leaked memory cleanup on exit of process ++ * (for use when debugging memory leaks).
    ++ * You enable this by calling the +setShouldCleanUp: method (done implicitly ++ * by gnustep-base if the GNUSTEP_SHOULD_CLEAN_UP environment variable is ++ * set to YES).
    ++ * Your class then has two options for performing cleanup when the process ++ * ends: ++ *

    1. Use the +leak: method to register objects which are simply to be ++ * retained until the process ends, and then either ignored or released ++ * depending on the cleanup setting in force. This mechanism is simple ++ * and should be sufficient for many classes. ++ *

    ++ *

    2. Implement a +atExit method to be run when the process ends and, ++ * within your +initialize implementation, call +shouldCleanUp to determine ++ * whether cleanup should be done, and if it returns YES then call ++ * +registerAtExit to have your +atExit method called when the process ++ * terminates. ++ *

    ++ *

    The order in which 'leaked' objects are released and +atExit methods ++ * are called on process exist is the reverse of the order in which they ++ * werse set up suing this API. ++ *

    ++ */ ++@interface NSObject(GSCleanup) ++ ++ ++/** This method simply retains its argument so that it will never be ++ * deallocated during normal operation, but keeps track of it so that ++ * it is released during process exit if cleanup is enabled.
    ++ * Returns its argument. ++ */ +++ (id) NS_RETURNS_RETAINED leak: (id)anObject; ++ ++/** This method retains the object at *anAddress so that it will never be ++ * deallocated during normal operation, but keeps track of the address ++ * so that the object is released and the address is zeroed during process ++ * exit if cleanup is enabled.
    ++ * Returns the object at *anAddress. ++ */ +++ (id) NS_RETURNS_RETAINED leakAt: (id*)anAddress; ++ ++/** Sets the receiver to have its +atExit method called at the point when ++ * the process terminates.
    ++ * Returns YES on success and NO on failure (if the class does not implement ++ * the method or if it is already registered to call it).
    ++ * Implemented as a call to +registerAtExit: with the selector for the +atExit ++ * method as its argument. ++ */ +++ (BOOL) registerAtExit; ++ ++/** Sets the receiver to have the specified method called at the point when ++ * the process terminates.
    ++ * Returns YES on success and NO on failure (if the class does not implement ++ * the method ir if it is already registered to call it). ++ */ +++ (BOOL) registerAtExit: (SEL)aSelector; ++ ++/** Specifies the default cleanup behavior on process exit ... the value ++ * returned by the NSObject implementation of the +shouldClanUp method.
    ++ * Calling this method with a YES argument implicitly calls the +enableAtExit ++ * method as well.
    ++ * The GNUstep Base library calls this method with the value obtained from ++ * the GNUSTEP_SHOULD_CLEAN_UP environment variable when NSObject is ++ * initialised. ++ */ +++ (void) setShouldCleanUp: (BOOL)aFlag; ++ ++/** Returns a flag indicating whether the receiver should clean up ++ * its data structures etc at process exit.
    ++ * The NSObject implementation returns the value set by the +setShouldCleanUp: ++ * method but subclasses may override this. ++ */ +++ (BOOL) shouldCleanUp; ++ ++@end ++ ++/* Macro to take an autoreleased object and either make it immutable or ++ * create an autoreleased copy of the original. ++ */ ++#define GS_IMMUTABLE(O) ([O makeImmutable] == YES ? O : AUTORELEASE([O copy])) ++ ++#endif /* OS_API_VERSION */ ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* INCLUDED_NSObject_GNUstepBase_h */ ++ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSString+GNUstepBase.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSString+GNUstepBase.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSString+GNUstepBase.h (.../branches/gcc-8-branch) +@@ -0,0 +1,105 @@ ++/** Declaration of extension methods for base additions ++ ++ Copyright (C) 2003-2010 Free Software Foundation, Inc. ++ ++ Written by: Richard Frith-Macdonald ++ and: Adam Fedor ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ ++*/ ++ ++#ifndef INCLUDED_NSString_GNUstepBase_h ++#define INCLUDED_NSString_GNUstepBase_h ++ ++#import "GSVersionMacros.h" ++#import "../Foundation/NSString.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#if OS_API_VERSION(GS_API_NONE,GS_API_LATEST) ++ ++/** ++ * Provides some additional (non-standard) utility methods. ++ */ ++@interface NSString (GNUstepBase) ++ ++/** ++ * Alternate way to invoke stringWithFormat if you have or wish ++ * to build an explicit va_list structure. ++ */ +++ (id) stringWithFormat: (NSString*)format ++ arguments: (va_list)argList NS_FORMAT_FUNCTION(1,0); ++ ++/** ++ * Returns a string formed by removing the prefix string from the ++ * receiver. Raises an exception if the prefix is not present. ++ */ ++- (NSString*) stringByDeletingPrefix: (NSString*)prefix; ++ ++/** ++ * Returns a string formed by removing the suffix string from the ++ * receiver. Raises an exception if the suffix is not present. ++ */ ++- (NSString*) stringByDeletingSuffix: (NSString*)suffix; ++ ++/** ++ * Returns a string formed by removing leading white space from the ++ * receiver. ++ */ ++- (NSString*) stringByTrimmingLeadSpaces; ++ ++/** ++ * Returns a string formed by removing trailing white space from the ++ * receiver. ++ */ ++- (NSString*) stringByTrimmingTailSpaces; ++ ++/** ++ * Returns a string formed by removing both leading and trailing ++ * white space from the receiver. ++ */ ++- (NSString*) stringByTrimmingSpaces; ++ ++/** ++ * Returns a string in which any (and all) occurrences of ++ * replace in the receiver have been replaced with by. ++ * Returns the receiver if replace ++ * does not occur within the receiver. NB. an empty string is ++ * not considered to exist within the receiver. ++ */ ++- (NSString*) stringByReplacingString: (NSString*)replace ++ withString: (NSString*)by; ++ ++/** ++ * An obsolete name for -substringWithRange: ... deprecated. ++ */ ++- (NSString*) substringFromRange: (NSRange)aRange; ++ ++@end ++ ++#endif /* OS_API_VERSION */ ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* INCLUDED_NSString_GNUstepBase_h */ ++ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSVersionMacros.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSVersionMacros.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSVersionMacros.h (.../branches/gcc-8-branch) +@@ -0,0 +1,460 @@ ++/* GSVersionMacros.h - macros for managing API versioning and visibility ++ Copyright (C) 2006-2014 Free Software Foundation, Inc. ++ ++ Written by: Richard Frith-Macdonald ++ Date: Oct, October 2006 ++ ++ This file is part of GNUstep. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++#ifndef __GNUSTEP_GSVERSIONMACROS_H_INCLUDED_ ++#define __GNUSTEP_GSVERSIONMACROS_H_INCLUDED_ ++ ++/* By default we defined NO_GNUSTEP to 0 so that we will include extensions. ++ */ ++#if !defined(NO_GNUSTEP) ++# define NO_GNUSTEP 0 ++#endif ++ ++/* Check consistency of definitions for system compatibility. ++ */ ++#if defined(STRICT_OPENSTEP) ++# define GS_OPENSTEP_V 10000 ++# undef NO_GNUSTEP ++# define NO_GNUSTEP 1 ++#elif defined(STRICT_MACOS_X) ++# define GS_OPENSTEP_V 100600 ++# undef NO_GNUSTEP ++# define NO_GNUSTEP 1 ++#endif ++ ++/* Define the GS_OSX_ADJUST() macro to adjust OSX style version macros ++ * to GNUstep style version macros. ++ */ ++#define GS_OSX_ADJUST(V) ((V) >= 10000 ? (V) : ((V)/100*10000 + (V)%100*10)) ++ ++/* Define OSX compatibility version macros if necessary. ++ */ ++#if !defined(MAC_OS_X_VERSION_10_0) ++#define MAC_OS_X_VERSION_10_0 1000 ++#define MAC_OS_X_VERSION_10_1 1010 ++#define MAC_OS_X_VERSION_10_2 1020 ++#define MAC_OS_X_VERSION_10_3 1030 ++#define MAC_OS_X_VERSION_10_4 1040 ++#define MAC_OS_X_VERSION_10_5 1050 ++#define MAC_OS_X_VERSION_10_6 1060 ++#define MAC_OS_X_VERSION_10_7 1070 ++#define MAC_OS_X_VERSION_10_8 1080 ++#define MAC_OS_X_VERSION_10_9 1090 ++#define MAC_OS_X_VERSION_10_10 1100 ++#define MAC_OS_X_VERSION_10_11 1110 ++#define MAC_OS_X_VERSION_10_12 1120 ++#define MAC_OS_X_VERSION_10_13 1130 ++#define MAC_OS_X_VERSION_10_14 1140 ++#endif /* MAC_OS_X_VERSION_10_0 */ ++ ++/* Allow MAC_OS_X_VERSION_MAX_ALLOWED to be used in place of GS_OPENSTEP_V ++ * if GS_OPENSTEP_V is not defined. ++ */ ++#ifndef GS_OPENSTEP_V ++#ifdef MAC_OS_X_VERSION_MAX_ALLOWED ++#define GS_OPENSTEP_V GS_OSX_ADJUST(MAC_OS_X_VERSION_MAX_ALLOWED) ++#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */ ++#endif /* GS_OPENSTEP_V */ ++ ++/* ++ * NB. The version values below must be integers ... by convention these are ++ * made up of two digits each for major, minor and subminor version numbers ++ * (ie each is in the range 00 to 99 though a leading zero in the major ++ * number is not permitted). ++ * So for a MacOS-X 10.3.9 release the version number would be 100309 ++ * ++ * You may define GS_GNUSTEP_V or GS_OPENSTEP_V to ensure that your ++ * program only 'sees' the specified varsion of the API. ++ */ ++ ++/** ++ *

    Macro to check a defined GNUstep version number (GS_GNUSTEP_V) against ++ * the supplied arguments. Returns true if no GNUstep version is specified, ++ * or if ADD <= version < REM, where ADD is the version ++ * number at which a feature guarded by the macro was introduced and ++ * REM is the version number at which it was removed. ++ *

    ++ *

    The version number arguments are six digit integers where the first ++ * two digits are the major version number, the second two are the minor ++ * version number and the last two are the subminor number (all left padded ++ * with a zero where necessary). However, for convenience you can also ++ * use the predefined constants ... ++ * GS_API_NONE, ++ * GS_API_LATEST, ++ *

    ++ *

    Also see OS_API_VERSION ++ *

    ++ *

    NB. If you are changing the API (eg adding a new feature) you need ++ * to control the visibility io the new header file code using
    ++ * #if GS_API_VERSION(ADD,GS_API_LATEST)
    ++ * where ADD is the version number of the next minor ++ * release after the most recent one.
    ++ * As a general principle you should not change the API with ++ * changing subminor version numbers ... as that tends to confuse ++ * people (though Apple has sometimes done it). ++ *

    ++ */ ++#define GS_API_VERSION(ADD,REM) \ ++ (!defined(GS_GNUSTEP_V) || (GS_GNUSTEP_V >= ADD && GS_GNUSTEP_V < REM)) ++ ++/** ++ *

    Macro to check a defined OpenStep/OPENSTEP/MacOS-X version against the ++ * supplied arguments. Returns true if no version is specified, or if ++ * ADD <= version < REM, where ADD is the version ++ * number at which a feature guarded by the macro was introduced and ++ * REM is the version number at which it was removed. ++ *

    ++ *

    The version number arguments are six digit integers where the first ++ * two digits are the major version number, the second two are the minor ++ * version number and the last two are the subminor number (all left padded ++ * with a zero where necessary). However, for convenience you can also ++ * use any of several predefined constants ... ++ * GS_API_NONE, ++ * GS_API_LATEST, ++ * GS_API_OSSPEC, ++ * GS_API_OPENSTEP, ++ * GS_API_MACOSX ++ *

    ++ *

    Also see GS_API_VERSION ++ *

    ++ *

    For OSX compatibility, this macro also supports the use of Apple's ++ * symbolic constants for version numbering. Their contants are currently ++ * four digit values (two digits for the major version, one for the minor, ++ * and one for the subminor). ++ *

    ++ *

    The Apple compatibility version macros are currently: ++ * MAC_OS_X_VERSION_10_0, ++ * MAC_OS_X_VERSION_10_1, ++ * MAC_OS_X_VERSION_10_2, ++ * MAC_OS_X_VERSION_10_3, ++ * MAC_OS_X_VERSION_10_4, ++ * MAC_OS_X_VERSION_10_5, ++ * MAC_OS_X_VERSION_10_6, ++ * MAC_OS_X_VERSION_10_7, ++ * MAC_OS_X_VERSION_10_8 ++ * MAC_OS_X_VERSION_10_9 ++ *

    ++ */ ++#define OS_API_VERSION(ADD,REM) \ ++ (!defined(GS_OPENSTEP_V) \ ++ || (GS_OPENSTEP_V>=GS_OSX_ADJUST(ADD) && GS_OPENSTEP_V ++ * eg.
    ++ * #if OS_API_VERSION ++ * (GS_API_NONE, GS_API_NONE)
    ++ * denotes code not present in OpenStep/OPENSTEP/MacOS-X ++ */ ++#define GS_API_NONE 0 ++ ++/** ++ * A constant to represent a feature which is still present in the latest ++ * version. This is the highest possible version number.
    ++ * eg.
    ++ * #if OS_API_VERSION ++ * (GS_API_MACOSX, GS_API_LATEST)
    ++ * denotes code present from the initial MacOS-X version onwards. ++ */ ++#define GS_API_LATEST 999999 ++ ++/** ++ * The version number of the initial OpenStep specification.
    ++ * eg.
    ++ * #if OS_API_VERSION ++ * (GS_API_OSSPEC, GS_API_LATEST)
    ++ * denotes code present from the OpenStep specification onwards. ++ */ ++#define GS_API_OSSPEC 10000 ++ ++/** ++ * The version number of the first OPENSTEP implementation.
    ++ * eg.
    ++ * #if OS_API_VERSION ++ * (GS_API_OPENSTEP, GS_API_LATEST)
    ++ * denotes code present from the initial OPENSTEP version onwards. ++ */ ++#define GS_API_OPENSTEP 40000 ++ ++/** ++ * The version number of the first MacOS-X implementation.
    ++ * eg.
    ++ * #if OS_API_VERSION ++ * (GS_API_MACOSX, GS_API_LATEST)
    ++ * denotes code present from the initial MacOS-X version onwards. ++ */ ++#define GS_API_MACOSX 100000 ++ ++/* Allow OSX code comparing MAC_OS_X_VERSION_MAX_ALLOWED with a specific ++ * version to see if that version is allowed, to always have it allowed ++ * on GNUstep. ++ */ ++#ifndef MAC_OS_X_VERSION_MAX_ALLOWED ++#define MAC_OS_X_VERSION_MAX_ALLOWED GS_API_LATEST ++#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */ ++ ++ ++#if defined(GNUSTEP_BASE_INTERNAL) ++#include "GNUstepBase/GSConfig.h" ++#else ++#include "GSConfig.h" ++#endif ++ ++ ++#if defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__clang__) ++# define GS_GCC_MINREQ(maj, min) \ ++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) ++#else ++# define GS_GCC_MINREQ(maj, min) 0 ++#endif ++ ++#if defined(__clang__) ++# define GS_CLANG_MINREQ(maj, min) \ ++ ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min)) ++#else ++# define GS_CLANG_MINREQ(maj, min) 0 ++#endif ++ ++/* Attribute definitions for attributes which may or may not be supported ++ * depending on the compiler being used. ++ * NB we currently expect gcc to be version 4 or later. ++ * ++ * The definition should be of the form GS_XXX_CONTEXT where XXX is the ++ * name of the attribute and CONTEXT is one of FUNC, METH, or IVAR ++ * depending on where the attribute can be applied. ++ */ ++ ++#if defined(__clang__) || GS_GCC_MINREQ(3,1) ++# define GS_DEPRECATED_FUNC __attribute__ ((deprecated)) ++#else ++# define GS_DEPRECATED_FUNC ++#endif ++ ++#define GS_UNUSED_ARG __attribute__((unused)) ++ ++#define GS_UNUSED_FUNC __attribute__((unused)) ++ ++// FIXME ... what version of gcc? ++#if __clang__ ++# define GS_UNUSED_IVAR __attribute__((unused)) ++#else ++# define GS_UNUSED_IVAR ++#endif ++ ++ ++ ++#ifndef __has_feature ++#define __has_feature(x) 0 ++#endif ++ ++/* The following is for deciding whether private instance variables ++ * should be visible ... if we are building with a compiler which ++ * does not define __has_feature then we know we don't have non-fragile ++ * ivar support. ++ * In the header we bracket instance variable declarations in a ++ * '#if GS_EXPOSE(classname) ... #endif' sequence, so that the variables ++ * will not be visible to code which uses the library. ++ * In the source file we define EXPOSE_classname_IVARS to be 1 ++ * before including the header, so that the ivars are always available ++ * in the class source itsself ++ */ ++ ++#if GS_MIXEDABI ++# undef GS_NONFRAGILE ++# define GS_NONFRAGILE 0 /* Mixed is treated as fragile */ ++#else ++# if (__has_feature(objc_nonfragile_abi)) ++# if !GS_NONFRAGILE ++# if defined(GNUSTEP_BASE_INTERNAL) ++# error "You are building gnustep-base using the objc-nonfragile-abi but your gnustep-base was not configured to use it." ++# endif ++# endif ++# else ++# if GS_NONFRAGILE ++# error "Your gnustep-base was configured for the objc-nonfragile-abi but you are not using it now." ++# endif ++# endif ++#endif ++ ++#define GS_EXPOSE(X) (!GS_NONFRAGILE || defined(EXPOSE_##X##_IVARS)) ++ ++/* Static analyser macros: Provide annotations to help the analyser */ ++#ifdef __clang__ ++# define GS_NORETURN_METHOD __attribute__((__noreturn__)) ++#else ++# define GS_NORETURN_METHOD ++#endif ++ ++#ifndef NS_RETURNS_RETAINED ++# if __has_feature(attribute_ns_returns_retained) ++# define NS_RETURNS_RETAINED __attribute__((ns_returns_retained)) ++# else ++# define NS_RETURNS_RETAINED ++# endif ++#endif ++ ++#ifndef NS_RETURNS_NOT_RETAINED ++# if __has_feature(attribute_ns_returns_not_retained) ++# define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) ++# else ++# define NS_RETURNS_NOT_RETAINED ++# endif ++#endif ++ ++#ifndef NS_CONSUMED ++# if __has_feature(attribute_ns_consumed) ++# define NS_CONSUMED __attribute__((ns_consumed)) ++# else ++# define NS_CONSUMED ++# endif ++#endif ++ ++ ++#ifndef NS_CONSUMES_SELF ++# if __has_feature(attribute_ns_consumes_self) ++# define NS_CONSUMES_SELF __attribute__((ns_consumes_self)) ++# else ++# define NS_CONSUMES_SELF ++# endif ++#endif ++ ++#if defined(__clang__) && defined(__OBJC__) ++static inline void gs_consumed(id NS_CONSUMED o) GS_UNUSED_FUNC; ++static inline void gs_consumed(id NS_CONSUMED GS_UNUSED_ARG o) { return; } ++#define GS_CONSUMED(O) gs_consumed(O); ++#else ++#define GS_CONSUMED(O) ++#endif ++ ++/* Include the appropriate header for ObjC2 blocks support if it is in use. ++ * ++ * FIXME: "OBJC2RUNTIME" is set to "1" if the runtime supports the ObjC2 ++ * runtime API, which is unrelated to whether the compiler has blocks ++ * support or not. ++ */ ++#if __has_feature(blocks) ++# if OBJC2RUNTIME ++# if defined(__APPLE__) ++# include ++# else ++# include ++# endif ++# else ++# include ++# endif ++#endif ++ ++/* Attribute definition for root classes, annotates the interface declaration ++ * of the class. ++ */ ++#ifndef GS_ROOT_CLASS ++# if GS_HAVE_OBJC_ROOT_CLASS_ATTR || __has_feature(attribute_objc_root_class) ++# define GS_ROOT_CLASS __attribute__((objc_root_class)) ++# else ++# define GS_ROOT_CLASS ++# endif ++#endif ++ ++ ++ ++#if defined(GNUSTEP_WITH_DLL) ++ ++#if BUILD_libgnustep_base_DLL ++# ++# if defined(__MINGW__) ++ /* On Mingw, the compiler will export all symbols automatically, so ++ * __declspec(dllexport) is not needed. ++ */ ++# define GS_EXPORT extern ++# define GS_DECLARE ++# else ++# define GS_EXPORT __declspec(dllexport) ++# define GS_DECLARE __declspec(dllexport) ++# endif ++#else ++# define GS_EXPORT extern __declspec(dllimport) ++# define GS_DECLARE __declspec(dllimport) ++#endif ++ ++#else /* GNUSTEP_WITH[OUT]_DLL */ ++ ++# define GS_EXPORT extern ++# define GS_DECLARE ++ ++#endif ++ ++ ++/* Attribute macros compatible with Apple. ++ */ ++ ++#ifndef NS_FORMAT_ARGUMENT ++#if defined(__clang__) || GS_GCC_MINREQ(4,2) ++# define NS_FORMAT_ARGUMENT(A) __attribute__((format_arg(A))) ++#else ++# define NS_FORMAT_ARGUMENT(F,A) ++#endif ++#endif ++ ++// FIXME ... what version of gcc? ++#ifndef NS_FORMAT_FUNCTION ++#if __clang__ ++# define NS_FORMAT_FUNCTION(F,A) __attribute__((format(__NSString__, F, A))) ++#else ++# define NS_FORMAT_FUNCTION(F,A) ++#endif ++#endif ++ ++#ifndef NS_REQUIRES_NIL_TERMINATION ++#define NS_REQUIRES_NIL_TERMINATION __attribute__((sentinel)) ++#endif ++ ++// FIXME ... what exact version of clang and gcc? ++#ifndef UNAVAILABLE_ATTRIBUTE ++#if defined(__clang__) || GS_GCC_MINREQ(4,0) ++# define UNAVAILABLE_ATTRIBUTE __attribute__((unavailable)) ++#else ++# define UNAVAILABLE_ATTRIBUTE ++#endif ++#endif ++ ++/* Check if compiler supports @optional in protocols ++ */ ++#if defined(__clang__) || GS_GCC_MINREQ(4,6) ++# define GS_PROTOCOLS_HAVE_OPTIONAL 1 ++#else ++# define GS_PROTOCOLS_HAVE_OPTIONAL 0 ++#endif ++ ++/* Check if compiler supports declared properties ++ */ ++#if defined(__clang__) || GS_GCC_MINREQ(4,6) ++# define GS_HAS_DECLARED_PROPERTIES 1 ++#else ++# define GS_HAS_DECLARED_PROPERTIES 0 ++#endif ++ ++#endif /* __GNUSTEP_GSVERSIONMACROS_H_INCLUDED_ */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GNUstep.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GNUstep.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GNUstep.h (.../branches/gcc-8-branch) +@@ -0,0 +1,418 @@ ++/* GNUstep.h - macros to make easier to port gnustep apps to macos-x ++ Copyright (C) 2001 Free Software Foundation, Inc. ++ ++ Written by: Nicola Pero ++ Date: March, October 2001 ++ ++ This file is part of GNUstep. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. ++*/ ++ ++#ifndef __GNUSTEP_GNUSTEP_H_INCLUDED_ ++#define __GNUSTEP_GNUSTEP_H_INCLUDED_ ++ ++/* The contents of this file are designed to be usable with either ++ * GNUstep-base or MacOS-X Foundation. ++ */ ++ ++#ifndef __has_feature ++# define __has_feature(x) 0 ++#endif ++ ++/* ++ * __has_extension has slightly different semantics from __has_feature. ++ * It evaluates to true if the feature is supported by by clang for the ++ * current compilation unit (language and -f switches), regardless of ++ * whether it is part of the language standard or just a (non-standard) ++ * extension. ++ */ ++#ifndef __has_extension ++# define __has_extension(x) __has_feature(x) ++#endif ++ ++/* ++ * __has_attribute is the equivalent to __has_feature and __has_extension ++ * for GNU-style attributes. ++ */ ++#ifndef __has_attribute ++# define __has_attribute(x) 0 ++#endif ++ ++#if __has_feature(objc_arc) ++ ++#ifndef RETAIN ++#define RETAIN(object) (object) ++#endif ++#ifndef RELEASE ++#define RELEASE(object) ++#endif ++#ifndef AUTORELEASE ++#define AUTORELEASE(object) (object) ++#endif ++ ++#ifndef TEST_RETAIN ++#define TEST_RETAIN(object) (object) ++#endif ++#ifndef TEST_RELEASE ++#define TEST_RELEASE(object) ++#endif ++#ifndef TEST_AUTORELEASE ++#define TEST_AUTORELEASE(object) (object) ++#endif ++ ++#ifndef ASSIGN ++#define ASSIGN(object,value) object = (value) ++#endif ++#ifndef ASSIGNCOPY ++#define ASSIGNCOPY(object,value) object = [(value) copy] ++#endif ++#ifndef DESTROY ++#define DESTROY(object) object = nil ++#endif ++ ++#define IF_NO_GC(X) ++ ++#ifndef ENTER_POOL ++#define ENTER_POOL @autoreleasepool{do{ ++#endif ++ ++#ifndef LEAVE_POOL ++#define LEAVE_POOL }while(0);} ++#endif ++ ++#ifndef DEALLOC ++#define DEALLOC ++#endif ++ ++#else ++ ++#ifndef RETAIN ++/** ++ * Basic retain operation ... calls [NSObject-retain]
    ++ * Deprecated ... pointless on modern processors. ++ * Simply call the -retain method. ++ */ ++#define RETAIN(object) [(object) retain] ++#endif ++ ++#ifndef RELEASE ++/** ++ * Basic release operation ... calls [NSObject-release]
    ++ * Deprecated ... pointless on modern processors. ++ * Simply call the -release method. ++ */ ++#define RELEASE(object) [(object) release] ++#endif ++ ++#ifndef AUTORELEASE ++/** ++ * Basic autorelease operation ... calls [NSObject-autorelease]
    ++ * Deprecated ... pointless on modern processors. ++ * Simply call the -autorelease method. ++ */ ++#define AUTORELEASE(object) [(object) autorelease] ++#endif ++ ++#ifndef TEST_RETAIN ++/** ++ * Tested retain - only invoke the ++ * objective-c method if the receiver is not nil.
    ++ * Deprecated ... pointless on modern processors. ++ * Simply call the -retain method. ++ */ ++#define TEST_RETAIN(object) ({\ ++id __object = (object); (__object != nil) ? [__object retain] : nil; }) ++#endif ++ ++#ifndef TEST_RELEASE ++/** ++ * Tested release - only invoke the ++ * objective-c method if the receiver is not nil.
    ++ * Deprecated ... pointless on modern processors. ++ * Simply call the -release method. ++ */ ++#define TEST_RELEASE(object) ({\ ++id __object = (object); if (__object != nil) [__object release]; }) ++#endif ++ ++#ifndef TEST_AUTORELEASE ++/** ++ * Tested autorelease - only invoke the ++ * objective-c method if the receiver is not nil.
    ++ * Deprecated ... pointless on modern processors. ++ * Simply call the -autorelease method. ++ */ ++#define TEST_AUTORELEASE(object) ({\ ++id __object = (object); (__object != nil) ? [__object autorelease] : nil; }) ++#endif ++ ++#ifndef ASSIGN ++/** ++ * ASSIGN(object,value) assigns the value to the object with ++ * appropriate retain and release operations.
    ++ * Use this to avoid retain/release errors. ++ */ ++#define ASSIGN(object,value) ({\ ++ id __object = object; \ ++ object = [(value) retain]; \ ++ [__object release]; \ ++}) ++#endif ++ ++#ifndef ASSIGNCOPY ++/** ++ * ASSIGNCOPY(object,value) assigns a copy of the value to the object ++ * with release of the original.
    ++ * Use this to avoid retain/release errors. ++ */ ++#define ASSIGNCOPY(object,value) ({\ ++ id __object = object; \ ++ object = [(value) copy];\ ++ [__object release]; \ ++}) ++#endif ++ ++#ifndef DESTROY ++/** ++ * DESTROY() is a release operation which also sets the variable to be ++ * a nil pointer for tidiness - we can't accidentally use a DESTROYED ++ * object later. It also makes sure to set the variable to nil before ++ * releasing the object - to avoid side-effects of the release trying ++ * to reference the object being released through the variable. ++ */ ++#define DESTROY(object) ({ \ ++ id __o = object; \ ++ object = nil; \ ++ [__o release]; \ ++}) ++#endif ++ ++#define IF_NO_GC(X) X ++ ++#ifndef ENTER_POOL ++/** ++ * ENTER_POOL creates an autorelease pool and places subsequent code ++ * in a do/while loop (executed only once) which can be broken out of ++ * to reach the point when the pool is drained.
    ++ * The block must be terminated with a corresponding LEAVE_POOL.
    ++ * You should not return from such a block of code (to do so could ++ * leak an autorelease pool and give objects a longer lifetime than ++ * they ought to have. If you wish to leave the block of code early, ++ * you may do so using a 'break' statement. ++ */ ++#define ENTER_POOL {NSAutoreleasePool *_lARP=[NSAutoreleasePool new];do{ ++#endif ++ ++#ifndef LEAVE_POOL ++/** ++ * LEAVE_POOL terminates a block of code started with ENTER_POOL. ++ */ ++#define LEAVE_POOL }while(0);[_lARP drain];} ++#endif ++ ++#ifndef DEALLOC ++/** ++ * DEALLOC calls the superclass implementation of dealloc, unless ++ * ARC is in use (in which case it does nothing). ++ */ ++#define DEALLOC [super dealloc]; ++#endif ++#endif ++ ++#ifndef CREATE_AUTORELEASE_POOL ++/** DEPRECATED ... use ENTER_POOL and LEAVE_POOL ++ */ ++#define CREATE_AUTORELEASE_POOL(X) \ ++ NSAutoreleasePool *X = [NSAutoreleasePool new] ++#endif ++ ++#ifndef RECREATE_AUTORELEASE_POOL ++/** DEPRECATED ... use ENTER_POOL and LEAVE_POOL ++ */ ++#define RECREATE_AUTORELEASE_POOL(X) \ ++ DESTROY(X);\ ++ X = [NSAutoreleasePool new] ++#endif ++ ++ ++/** ++ *

    ++ * This function (macro) is a GNUstep extension. ++ *

    ++ *

    ++ * _(@"My string to translate") ++ *

    ++ *

    ++ * is basically equivalent to ++ *

    ++ *

    ++ * NSLocalizedString(@"My string to translate", @"") ++ *

    ++ *

    ++ * It is useful when you need to translate an application ++ * very quickly, as you just need to enclose all strings ++ * inside _(). But please note that when you ++ * use this macro, you are not taking advantage of comments ++ * for the translator, so consider using ++ * NSLocalizedString instead when you need a ++ * comment. ++ *

    ++ *

    You may define GS_LOCALISATION_BUNDLE_ID to the bundle identifier ++ * of the bundle which is to provide the localisation information.
    ++ * This can be used when compiling a single file by specifying something like ++ * '-D GS_LOCALISATION_BUNDLE_ID=$(FRAMEWORK_NAME)' in your make file.
    ++ * If this is not defined, the localisation is provided by your application's ++ * main bundle exactly like the NSLocalizedString function. ++ *

    ++ *

    Alternatively you may define GS_LOCALISATION_BUNDLE to be the bundle ++ * to be used to prvide the localisation information. ++ *

    ++ */ ++# define _(X) \ ++ [GS_LOCALISATION_BUNDLE localizedStringForKey: (X) value: @"" table: nil] ++ ++#if !defined(GS_LOCALISATION_BUNDLE) ++# if defined(GS_LOCALISATION_BUNDLE_ID) ++# define GS_LOCALISATION_BUNDLE [NSBundle bundleWithIdentifier: \ ++ GS_LOCALISATION_BUNDLE_ID] ++# else ++# define GS_LOCALISATION_BUNDLE [NSBundle mainBundle] ++# endif ++#endif ++ ++ ++ ++/** ++ *

    ++ * This function (macro) is a GNUstep extension. ++ *

    ++ *

    ++ * __(@"My string to translate") ++ *

    ++ *

    ++ * is exactly the same as ++ *

    ++ *

    ++ * GSLocalizedStaticString(@"My string to translate", @"") ++ *

    ++ *

    ++ * It is useful when you need to translate an application very ++ * quickly. You would use it as follows for static strings: ++ *

    ++ *

    ++ * ++ * NSString *message = __(@"Hello there"); ++ * ... more code ... ++ * NSLog (_(messages)); ++ * ++ *

    ++ *

    ++ * But please note that when you use this macro, you are not ++ * taking advantage of comments for the translator, so ++ * consider using GSLocalizedStaticString ++ * instead when you need a comment. ++ *

    ++ */ ++#define __(X) X ++ ++/* The better way for a static string, with a comment - use as follows - ++ * ++ * static NSString *string = GSLocalizedStaticString (@"New Game", ++ * @"Menu Option"); ++ * ++ * NSLog (_(string)); ++ * ++ * If you need anything more complicated than this, please initialize ++ * the static strings manually. ++ */ ++ ++/** ++ *

    ++ * This function (macro) is a GNUstep extensions, and it is used ++ * to localize static strings. Here is an example of a static ++ * string: ++ *

    ++ *

    ++ * ++ * NSString *message = @"Hi there"; ++ * ... some code ... ++ * NSLog (message); ++ * ++ *

    ++ *

    ++ * This string can not be localized using the standard ++ * openstep functions/macros. By using this gnustep extension, ++ * you can localize it as follows: ++ *

    ++ *

    ++ * ++ * NSString *message = GSLocalizedStaticString (@"Hi there", ++ * @"Greeting"); ++ * ++ * ... some code ... ++ * ++ * NSLog (NSLocalizedString (message, @"")); ++ * ++ *

    ++ *

    ++ * When the tools generate the ++ * Localizable.strings file from the source ++ * code, they will ignore the NSLocalizedString ++ * call while they will extract the string (and the comment) ++ * to localize from the GSLocalizedStaticString ++ * call. ++ *

    ++ *

    ++ * When the code is compiled, instead, the ++ * GSLocalizedStaticString call is ignored (discarded, ++ * it is a macro which simply expands to key), while ++ * the NSLocalizedString will actually look up the ++ * string for translation in the Localizable.strings ++ * file. ++ *

    ++ *

    ++ * Please note that there is currently no macro/function to ++ * localize static strings using different tables. If you ++ * need that functionality, you have either to prepare the ++ * localization tables by hand, or to rewrite your code in ++ * such a way as not to use static strings. ++ *

    ++ */ ++#define GSLocalizedStaticString(key, comment) key ++ ++/** ++ * To be used inside a method for making sure that a range does not specify ++ * anything outside the size of an array/string. Raises exception if range ++ * extends beyond [0,size]. Size must be an unsigned integer (NSUInteger). ++ */ ++#define GS_RANGE_CHECK(RANGE, SIZE) \ ++ if (RANGE.location > (NSUInteger)SIZE \ ++ || RANGE.length > ((NSUInteger)SIZE - RANGE.location)) \ ++ [NSException raise: NSRangeException format: @"in %s, range { %"\ ++ PRIuPTR ", %" PRIuPTR " } extends beyond size (%" PRIuPTR ")", \ ++ GSNameFromSelector(_cmd), RANGE.location, RANGE.length, (NSUInteger)SIZE] ++ ++/** Checks whether INDEX is strictly less than OVER (within C array space). ++ * INDEX and OVER must be unsigned integers (NSUInteger). ++ */ ++#define CHECK_INDEX_RANGE_ERROR(INDEX, OVER) \ ++if ((NSUInteger)INDEX >= (NSUInteger)OVER) \ ++ [NSException raise: NSRangeException \ ++ format: @"in %s, index %" PRIuPTR " is out of range", \ ++ GSNameFromSelector(_cmd), (NSUInteger)INDEX] ++ ++#endif /* __GNUSTEP_GNUSTEP_H_INCLUDED_ */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSNumber+GNUstepBase.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSNumber+GNUstepBase.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/NSNumber+GNUstepBase.h (.../branches/gcc-8-branch) +@@ -0,0 +1,56 @@ ++/** Declaration of extension methods for base additions ++ ++ Copyright (C) 2003-2010 Free Software Foundation, Inc. ++ ++ Written by: Richard Frith-Macdonald ++ and: Adam Fedor ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ ++*/ ++ ++#ifndef INCLUDED_NSNumber_GNUstepBase_h ++#define INCLUDED_NSNumber_GNUstepBase_h ++ ++#import "GSVersionMacros.h" ++#import "../Foundation/NSValue.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#if OS_API_VERSION(GS_API_NONE,GS_API_LATEST) ++ ++@interface NSNumber(GNUstepBase) ++/** ++ * Parses string as a double, int, or unsigned ++ * int depending on what characters are present. Uses ++ * atof and atoi which don't report errors, so be ++ * careful if the string might contain an invalid value. ++ */ +++ (NSValue*) valueFromString: (NSString *)string; ++@end ++ ++#endif /* OS_API_VERSION */ ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* INCLUDED_NSNumber_GNUstepBase_h */ ++ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSBlocks.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSBlocks.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSBlocks.h (.../branches/gcc-8-branch) +@@ -0,0 +1,145 @@ ++/** Definitions for block support for GNUStep ++ Copyright (C) 2011 Free Software Foundation, Inc. ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ ++ */ ++ ++#ifndef __GSBlocks_h_GNUSTEP_BASE_INCLUDE ++#define __GSBlocks_h_GNUSTEP_BASE_INCLUDE ++ ++/* Define the has_feature pseudo-macro for GCC. */ ++#ifndef __has_feature ++#define __has_feature(x) 0 ++#endif ++ ++#ifndef GCC_VERSION ++#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) ++#endif ++ ++#if __has_feature(blocks) ++ ++#define BLOCK_SCOPE __block ++/** ++ * Defines a block type. Will work whether or not the compiler natively ++ * supports blocks. ++ */ ++#define DEFINE_BLOCK_TYPE(name, retTy, argTys, ...) \ ++typedef retTy(^name)(argTys, ## __VA_ARGS__) ++ ++#define DEFINE_BLOCK_TYPE_NO_ARGS(name, retTy) \ ++typedef retTy(^name)() ++ ++/** ++ * Calls a block. Works irrespective of whether the compiler supports blocks. ++ */ ++#define CALL_BLOCK(block, args, ...) block(args, ## __VA_ARGS__) ++ ++/** ++ * Calls a block without arguments. ++ */ ++#define CALL_BLOCK_NO_ARGS(block) block() ++#else ++ ++/* Fall-back versions for when the compiler doesn't have native blocks support. ++ */ ++#if (GCC_VERSION >= 3000) ++ ++#define DEFINE_BLOCK_TYPE(name, retTy, argTys, ...) \ ++ typedef struct {\ ++ void *isa;\ ++ int flags;\ ++ int reserved;\ ++ retTy (*invoke)(void*, argTys, ## __VA_ARGS__);\ ++ } *name ++ ++#define DEFINE_BLOCK_TYPE_NO_ARGS(name, retTy) \ ++ typedef struct {\ ++ void *isa;\ ++ int flags;\ ++ int reserved;\ ++ retTy (*invoke)(void*);\ ++ } *name ++ ++#define CALL_BLOCK(block, args, ...) block->invoke(block, args, ## __VA_ARGS__) ++ ++#define CALL_BLOCK_NO_ARGS(block) block->invoke(block) ++#define BLOCK_SCOPE ++ ++#else /* GCC_VERSION >= 3000 */ ++ ++#define DEFINE_BLOCK_TYPE(name, retTy, argTys...) \ ++ typedef struct {\ ++ void *isa;\ ++ int flags;\ ++ int reserved;\ ++ retTy (*invoke)(void*, argTys);\ ++ } *name ++ ++#define DEFINE_BLOCK_TYPE_NO_ARGS(name, retTy) \ ++ typedef struct {\ ++ void *isa;\ ++ int flags;\ ++ int reserved;\ ++ retTy (*invoke)(void*);\ ++ } *name ++ ++ ++#define CALL_BLOCK(block, args...) block->invoke(block, args) ++#define CALL_BLOCK_NO_ARGS(block) block->invoke(block) ++#define BLOCK_SCOPE ++#endif /* GCC_VERSION >= 3000 */ ++ ++#endif /* __has_feature(blocks) */ ++ ++#if __has_include() ++# include ++#else ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/** ++ * _Block_copy and _Block_release are weakly imported, but can be assumed ++ * to be available whenever a feature using blocks is accessed ++ * by an application. ++ */ ++ ++/* weak attributed supported only with ELF, MINGW is COFF */ ++#ifndef __MINGW32__ ++ ++void *_Block_copy(const void *) __attribute__((weak)); ++void _Block_release(const void *) __attribute__((weak)); ++ ++#endif /* __MINGW32__ */ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#ifndef Block_copy ++# define Block_copy(x) ((__typeof(x))_Block_copy((const void *)(x))) ++#endif ++#ifndef Block_release ++# define Block_release(x) _Block_release((const void *)(x)) ++#endif ++ ++#endif /* __has_include() */ ++#endif /* __GSBlocks_h_GNUSTEP_BASE_INCLUDE */ ++ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSGeometry.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSGeometry.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSGeometry.h (.../branches/gcc-8-branch) +@@ -0,0 +1,609 @@ ++/* Interface for NSGeometry routines for GNUStep ++ * Copyright (C) 1995 Free Software Foundation, Inc. ++ * ++ * Written by: Adam Fedor ++ * Date: 1995,199 ++ * ++ * This file is part of the GNUstep Base Library. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02111 USA. ++ */ ++ ++#ifndef __NSGeometry_h_GNUSTEP_BASE_INCLUDE ++#define __NSGeometry_h_GNUSTEP_BASE_INCLUDE ++#import "../GNUstepBase/GSVersionMacros.h" ++ ++#import ++ ++#import "NSString.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++/**** Type, Constant, and Macro Definitions **********************************/ ++ ++#ifndef MAX ++#define MAX(a,b) \ ++ ({__typeof__(a) _MAX_a = (a); __typeof__(b) _MAX_b = (b); \ ++ _MAX_a > _MAX_b ? _MAX_a : _MAX_b; }) ++#define GS_DEFINED_MAX ++#endif ++ ++#ifndef MIN ++#define MIN(a,b) \ ++ ({__typeof__(a) _MIN_a = (a); __typeof__(b) _MIN_b = (b); \ ++ _MIN_a < _MIN_b ? _MIN_a : _MIN_b; }) ++#define GS_DEFINED_MIN ++#endif ++ ++/** ++{ ++ CGFloat x; ++ CGFloat y; ++} ++

    Represents a 2-d cartesian position.

    */ ++typedef struct _NSPoint NSPoint; ++struct _NSPoint ++{ ++ CGFloat x; ++ CGFloat y; ++}; ++ ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++/** Array of NSPoint structs. */ ++typedef NSPoint *NSPointArray; ++/** Pointer to NSPoint struct. */ ++typedef NSPoint *NSPointPointer; ++#endif ++ ++/** ++{ ++ CGFloat width; ++ CGFloat height; ++} ++

    Floating point rectangle size.

    */ ++typedef struct _NSSize NSSize; ++struct _NSSize ++{ ++ CGFloat width; ++ CGFloat height; ++}; ++ ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++/** Array of NSSize structs. */ ++typedef NSSize *NSSizeArray; ++/** Pointer to NSSize struct. */ ++typedef NSSize *NSSizePointer; ++#endif ++ ++/** ++{ ++ NSPoint origin; ++ NSSize size; ++} ++ ++

    Rectangle.

    */ ++typedef struct _NSRect NSRect; ++struct _NSRect ++{ ++ NSPoint origin; ++ NSSize size; ++}; ++ ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++/** Array of NSRect structs. */ ++typedef NSRect *NSRectArray; ++/** Pointer to NSRect struct. */ ++typedef NSRect *NSRectPointer; ++#endif ++ ++enum ++{ ++ NSMinXEdge = 0, ++ NSMinYEdge = 1, ++ NSMaxXEdge = 2, ++ NSMaxYEdge = 3 ++}; ++/** Sides of a rectangle. ++ ++{ ++ NSMinXEdge, ++ NSMinYEdge, ++ NSMaxXEdge, ++ NSMaxYEdge ++} ++ ++ */ ++typedef NSUInteger NSRectEdge; ++ ++/** ++{ ++ CGFloat top; ++ CGFloat left; ++ CGFloat bottom; ++ CGFloat right; ++} ++ ++

    A description of the distance between the edges of two rectangles.

    */ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST) ++typedef struct NSEdgeInsets { ++ CGFloat top; ++ CGFloat left; ++ CGFloat bottom; ++ CGFloat right; ++} NSEdgeInsets; ++#endif ++ ++/** Point at 0,0 */ ++static const NSPoint NSZeroPoint __attribute__((unused)) = {0.0,0.0}; ++/** Zero-size rectangle at 0,0 */ ++static const NSRect NSZeroRect __attribute__((unused)) = {{0.0,0.0},{0.0,0.0}}; ++/** Zero size */ ++static const NSSize NSZeroSize __attribute__((unused)) = {0.0,0.0}; ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST) ++/** Zero edge insets **/ ++static const NSEdgeInsets NSEdgeInsetsZero __attribute__((unused)) = {0.0,0.0,0.0,0.0}; ++#endif ++ ++/**** Function Prototypes ****************************************************/ ++ ++/* ++ * All but the most complex functions are declared static inline in this ++ * header file so that they are maximally efficient. In order to provide ++ * true functions (for code modules that don't have this header) this ++ * header is included in NSGeometry.m where the functions are no longer ++ * declared inline. ++ */ ++#ifdef IN_NSGEOMETRY_M ++#define GS_GEOM_SCOPE extern ++#define GS_GEOM_ATTR ++#else ++#define GS_GEOM_SCOPE static inline ++#define GS_GEOM_ATTR __attribute__((unused)) ++#endif ++ ++/** Create Basic Structures... **/ ++ ++GS_GEOM_SCOPE NSPoint ++NSMakePoint(CGFloat x, CGFloat y) GS_GEOM_ATTR; ++ ++/** Returns an NSPoint having x-coordinate X and y-coordinate Y. */ ++GS_GEOM_SCOPE NSPoint ++NSMakePoint(CGFloat x, CGFloat y) ++{ ++ NSPoint point; ++ ++ point.x = x; ++ point.y = y; ++ return point; ++} ++ ++GS_GEOM_SCOPE NSSize ++NSMakeSize(CGFloat w, CGFloat h) GS_GEOM_ATTR; ++ ++/** Returns an NSSize having width w and height h. */ ++GS_GEOM_SCOPE NSSize ++NSMakeSize(CGFloat w, CGFloat h) ++{ ++ NSSize size; ++ ++ size.width = w; ++ size.height = h; ++ return size; ++} ++ ++GS_GEOM_SCOPE NSRect ++NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h) GS_GEOM_ATTR; ++ ++/** Returns an NSRect having point of origin (x, y) and size {w, h}. */ ++GS_GEOM_SCOPE NSRect ++NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h) ++{ ++ NSRect rect; ++ ++ rect.origin.x = x; ++ rect.origin.y = y; ++ rect.size.width = w; ++ rect.size.height = h; ++ return rect; ++} ++ ++/** Constructs NSEdgeInsets. **/ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST) ++GS_GEOM_SCOPE NSEdgeInsets ++NSEdgeInsetsMake(CGFloat top, CGFloat left, ++ CGFloat bottom, CGFloat right) GS_GEOM_ATTR; ++ ++GS_GEOM_SCOPE NSEdgeInsets ++NSEdgeInsetsMake(CGFloat top, CGFloat left, CGFloat bottom, CGFloat right) ++{ ++ NSEdgeInsets edgeInsets; ++ ++ edgeInsets.top = top; ++ edgeInsets.left = left; ++ edgeInsets.bottom = bottom; ++ edgeInsets.right = right; ++ ++ return edgeInsets; ++} ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST) ++/** Compares two edge insets for equality. **/ ++GS_EXPORT BOOL ++NSEdgeInsetsEqual(NSEdgeInsets e1, NSEdgeInsets e2); ++#endif ++ ++#endif ++ ++/** Get a Rectangle's Coordinates... **/ ++ ++GS_GEOM_SCOPE CGFloat ++NSMaxX(NSRect aRect) GS_GEOM_ATTR; ++ ++/** Returns the greatest x-coordinate value still inside aRect. */ ++GS_GEOM_SCOPE CGFloat ++NSMaxX(NSRect aRect) ++{ ++ return aRect.origin.x + aRect.size.width; ++} ++ ++GS_GEOM_SCOPE CGFloat ++NSMaxY(NSRect aRect) GS_GEOM_ATTR; ++ ++/** Returns the greatest y-coordinate value still inside aRect. */ ++GS_GEOM_SCOPE CGFloat ++NSMaxY(NSRect aRect) ++{ ++ return aRect.origin.y + aRect.size.height; ++} ++ ++GS_GEOM_SCOPE CGFloat ++NSMidX(NSRect aRect) GS_GEOM_ATTR; ++ ++/** Returns the x-coordinate of aRect's middle point. */ ++GS_GEOM_SCOPE CGFloat ++NSMidX(NSRect aRect) ++{ ++ return aRect.origin.x + (aRect.size.width / 2.0); ++} ++ ++GS_GEOM_SCOPE CGFloat ++NSMidY(NSRect aRect) GS_GEOM_ATTR; ++ ++/** Returns the y-coordinate of aRect's middle point. */ ++GS_GEOM_SCOPE CGFloat ++NSMidY(NSRect aRect) ++{ ++ return aRect.origin.y + (aRect.size.height / 2.0); ++} ++ ++GS_GEOM_SCOPE CGFloat ++NSMinX(NSRect aRect) GS_GEOM_ATTR; ++ ++/** Returns the least x-coordinate value still inside aRect. */ ++GS_GEOM_SCOPE CGFloat ++NSMinX(NSRect aRect) ++{ ++ return aRect.origin.x; ++} ++ ++GS_GEOM_SCOPE CGFloat ++NSMinY(NSRect aRect) GS_GEOM_ATTR; ++ ++/** Returns the least y-coordinate value still inside aRect. */ ++GS_GEOM_SCOPE CGFloat ++NSMinY(NSRect aRect) ++{ ++ return aRect.origin.y; ++} ++ ++GS_GEOM_SCOPE CGFloat ++NSWidth(NSRect aRect) GS_GEOM_ATTR; ++ ++/** Returns aRect's width. */ ++GS_GEOM_SCOPE CGFloat ++NSWidth(NSRect aRect) ++{ ++ return aRect.size.width; ++} ++ ++GS_GEOM_SCOPE CGFloat ++NSHeight(NSRect aRect) GS_GEOM_ATTR; ++ ++/** Returns aRect's height. */ ++GS_GEOM_SCOPE CGFloat ++NSHeight(NSRect aRect) ++{ ++ return aRect.size.height; ++} ++ ++GS_GEOM_SCOPE BOOL ++NSIsEmptyRect(NSRect aRect) GS_GEOM_ATTR; ++ ++/** Returns 'YES' iff the area of aRect is zero (i.e., iff either ++ * of aRect's width or height is negative or zero). */ ++GS_GEOM_SCOPE BOOL ++NSIsEmptyRect(NSRect aRect) ++{ ++ return ((NSWidth(aRect) > 0) && (NSHeight(aRect) > 0)) ? NO : YES; ++} ++ ++/** Modify a Copy of a Rectangle... **/ ++ ++GS_GEOM_SCOPE NSRect ++NSOffsetRect(NSRect aRect, CGFloat dx, CGFloat dy) GS_GEOM_ATTR; ++ ++/** Returns the rectangle obtained by translating aRect ++ * horizontally by dx and vertically by dy. */ ++GS_GEOM_SCOPE NSRect ++NSOffsetRect(NSRect aRect, CGFloat dx, CGFloat dy) ++{ ++ NSRect rect = aRect; ++ ++ rect.origin.x += dx; ++ rect.origin.y += dy; ++ return rect; ++} ++ ++GS_GEOM_SCOPE NSRect ++NSInsetRect(NSRect aRect, CGFloat dX, CGFloat dY) GS_GEOM_ATTR; ++ ++/** Returns the rectangle obtained by moving each of aRect's ++ * horizontal sides inward by dy and each of aRect's vertical ++ * sides inward by dx.
    ++ * NB. For MacOS-X compatability, this is permitted to return ++ * a rectanglew with nagative width or height, strange as that seems. ++ */ ++GS_GEOM_SCOPE NSRect ++NSInsetRect(NSRect aRect, CGFloat dX, CGFloat dY) ++{ ++ NSRect rect; ++ ++ rect = NSOffsetRect(aRect, dX, dY); ++ rect.size.width -= (2 * dX); ++ rect.size.height -= (2 * dY); ++ return rect; ++} ++ ++/** Divides aRect into two rectangles (namely slice and remainder) by ++ * "cutting" aRect---parallel to, and a distance amount from the given edge ++ * of aRect. You may pass 0 in as either of slice or ++ * remainder to avoid obtaining either of the created rectangles. */ ++GS_EXPORT void ++NSDivideRect(NSRect aRect, ++ NSRect *slice, ++ NSRect *remainder, ++ CGFloat amount, ++ NSRectEdge edge); ++ ++/** Returns a rectangle obtained by expanding aRect minimally ++ * so that all four of its defining components are integers. */ ++GS_EXPORT NSRect ++NSIntegralRect(NSRect aRect); ++ ++/** Compute a Third Rectangle from Two Rectangles... **/ ++ ++GS_GEOM_SCOPE NSRect ++NSUnionRect(NSRect aRect, NSRect bRect) GS_GEOM_ATTR; ++ ++/** Returns the smallest rectangle which contains both aRect ++ * and bRect (modulo a set of measure zero). If either of aRect ++ * or bRect is an empty rectangle, then the other rectangle is ++ * returned. If both are empty, then the empty rectangle is returned. */ ++GS_GEOM_SCOPE NSRect ++NSUnionRect(NSRect aRect, NSRect bRect) ++{ ++ NSRect rect; ++ ++ if (NSIsEmptyRect(aRect) && NSIsEmptyRect(bRect)) ++ return NSMakeRect(0.0,0.0,0.0,0.0); ++ else if (NSIsEmptyRect(aRect)) ++ return bRect; ++ else if (NSIsEmptyRect(bRect)) ++ return aRect; ++ ++ rect = NSMakeRect(MIN(NSMinX(aRect), NSMinX(bRect)), ++ MIN(NSMinY(aRect), NSMinY(bRect)), 0.0, 0.0); ++ ++ rect = NSMakeRect(NSMinX(rect), ++ NSMinY(rect), ++ MAX(NSMaxX(aRect), NSMaxX(bRect)) - NSMinX(rect), ++ MAX(NSMaxY(aRect), NSMaxY(bRect)) - NSMinY(rect)); ++ ++ return rect; ++} ++ ++GS_GEOM_SCOPE NSRect ++NSIntersectionRect(NSRect aRect, NSRect bRect) GS_GEOM_ATTR; ++ ++/** Returns the largest rectangle which lies in both aRect and ++ * bRect. If aRect and bRect have empty intersection (or, rather, ++ * intersection of measure zero, since this includes having their ++ * intersection be only a point or a line), then the empty ++ * rectangle is returned. */ ++GS_GEOM_SCOPE NSRect ++NSIntersectionRect (NSRect aRect, NSRect bRect) ++{ ++ if (NSMaxX(aRect) <= NSMinX(bRect) || NSMaxX(bRect) <= NSMinX(aRect) ++ || NSMaxY(aRect) <= NSMinY(bRect) || NSMaxY(bRect) <= NSMinY(aRect)) ++ { ++ return NSMakeRect(0.0, 0.0, 0.0, 0.0); ++ } ++ else ++ { ++ NSRect rect; ++ ++ if (NSMinX(aRect) <= NSMinX(bRect)) ++ rect.origin.x = bRect.origin.x; ++ else ++ rect.origin.x = aRect.origin.x; ++ ++ if (NSMinY(aRect) <= NSMinY(bRect)) ++ rect.origin.y = bRect.origin.y; ++ else ++ rect.origin.y = aRect.origin.y; ++ ++ if (NSMaxX(aRect) >= NSMaxX(bRect)) ++ rect.size.width = NSMaxX(bRect) - rect.origin.x; ++ else ++ rect.size.width = NSMaxX(aRect) - rect.origin.x; ++ ++ if (NSMaxY(aRect) >= NSMaxY(bRect)) ++ rect.size.height = NSMaxY(bRect) - rect.origin.y; ++ else ++ rect.size.height = NSMaxY(aRect) - rect.origin.y; ++ ++ return rect; ++ } ++} ++ ++/** Test geometric relationships... **/ ++ ++/** Returns 'YES' iff aRect's and bRect's origin and size are the same. */ ++GS_EXPORT BOOL ++NSEqualRects(NSRect aRect, NSRect bRect) GS_GEOM_ATTR; ++ ++/** Returns 'YES' iff aSize's and bSize's width and height are the same. */ ++GS_EXPORT BOOL ++NSEqualSizes(NSSize aSize, NSSize bSize) GS_GEOM_ATTR; ++ ++/** Returns 'YES' iff aPoint's and bPoint's x- and y-coordinates ++ * are the same. */ ++GS_EXPORT BOOL ++NSEqualPoints(NSPoint aPoint, NSPoint bPoint) GS_GEOM_ATTR; ++ ++GS_GEOM_SCOPE BOOL ++NSMouseInRect(NSPoint aPoint, NSRect aRect, BOOL flipped) GS_GEOM_ATTR; ++ ++/** Returns 'YES' iff aPoint is inside aRect. */ ++GS_GEOM_SCOPE BOOL ++NSMouseInRect(NSPoint aPoint, NSRect aRect, BOOL flipped) ++{ ++ if (flipped) ++ { ++ return ((aPoint.x >= NSMinX(aRect)) ++ && (aPoint.y >= NSMinY(aRect)) ++ && (aPoint.x < NSMaxX(aRect)) ++ && (aPoint.y < NSMaxY(aRect))) ? YES : NO; ++ } ++ else ++ { ++ return ((aPoint.x >= NSMinX(aRect)) ++ && (aPoint.y > NSMinY(aRect)) ++ && (aPoint.x < NSMaxX(aRect)) ++ && (aPoint.y <= NSMaxY(aRect))) ? YES : NO; ++ } ++} ++ ++GS_GEOM_SCOPE BOOL ++NSPointInRect(NSPoint aPoint, NSRect aRect) GS_GEOM_ATTR; ++ ++/** Just like 'NSMouseInRect(aPoint, aRect, YES)'. */ ++GS_GEOM_SCOPE BOOL ++NSPointInRect(NSPoint aPoint, NSRect aRect) ++{ ++ return NSMouseInRect(aPoint, aRect, YES); ++} ++ ++GS_GEOM_SCOPE BOOL ++NSContainsRect(NSRect aRect, NSRect bRect) GS_GEOM_ATTR; ++ ++/** Returns 'YES' iff aRect totally encloses bRect. NOTE: For ++ * this to be the case, aRect cannot be empty, nor can any side ++ * of bRect go beyond any side of aRect. Note that this behavior ++ * is different than the original OpenStep behavior, where the sides ++ * of bRect could not touch aRect. */ ++GS_GEOM_SCOPE BOOL ++NSContainsRect(NSRect aRect, NSRect bRect) ++{ ++ return (!NSIsEmptyRect(bRect) ++ && (NSMinX(aRect) <= NSMinX(bRect)) ++ && (NSMinY(aRect) <= NSMinY(bRect)) ++ && (NSMaxX(aRect) >= NSMaxX(bRect)) ++ && (NSMaxY(aRect) >= NSMaxY(bRect))) ? YES : NO; ++} ++ ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++GS_GEOM_SCOPE BOOL ++NSIntersectsRect(NSRect aRect, NSRect bRect) GS_GEOM_ATTR; ++ ++/** Returns YES if aRect and bRect have non-zero intersection area ++ (intersecting at a line or a point doesn't count). */ ++GS_GEOM_SCOPE BOOL ++NSIntersectsRect(NSRect aRect, NSRect bRect) ++{ ++ /* Note that intersecting at a line or a point doesn't count */ ++ return (NSMaxX(aRect) <= NSMinX(bRect) ++ || NSMaxX(bRect) <= NSMinX(aRect) ++ || NSMaxY(aRect) <= NSMinY(bRect) ++ || NSMaxY(bRect) <= NSMinY(aRect) ++ || NSIsEmptyRect(aRect) ++ || NSIsEmptyRect(bRect)) ? NO : YES; ++} ++#endif ++ ++/** Get a String Representation... **/ ++ ++#ifdef __OBJC__ ++/** Returns an NSString of the form "{x=X; y=Y}", where ++ * X and Y are the x- and y-coordinates of aPoint, respectively. */ ++GS_EXPORT NSString * ++NSStringFromPoint(NSPoint aPoint); ++ ++/** Returns an NSString of the form "{x=X; y=Y; width=W; height=H}", ++ * where X, Y, W, and H are the x-coordinate, y-coordinate, ++ * width, and height of aRect, respectively. */ ++GS_EXPORT NSString * ++NSStringFromRect(NSRect aRect); ++ ++/** Returns an NSString of the form "{width=W; height=H}", where ++ * W and H are the width and height of aSize, respectively. */ ++GS_EXPORT NSString * ++NSStringFromSize(NSSize aSize); ++ ++/** Parses point from string of form "{x=a; y=b}". (0,0) returned ++ if parsing fails. */ ++GS_EXPORT NSPoint NSPointFromString(NSString* string); ++ ++/** Parses size from string of form "{width=a; height=b}". Size of ++ 0,0 returned if parsing fails. */ ++GS_EXPORT NSSize NSSizeFromString(NSString* string); ++ ++/** Parses point from string of form "{x=a; y=b; width=c; ++ height=d}". Rectangle of 0 size at origin returned if parsing ++ fails. ++*/ ++GS_EXPORT NSRect NSRectFromString(NSString* string); ++ ++#endif /* __OBJC__ */ ++ ++#ifdef GS_DEFINED_MAX ++#undef GS_DEFINED_MAX ++#undef MAX ++#endif ++ ++#ifdef GS_DEFINED_MIN ++#undef GS_DEFINED_MIN ++#undef MIN ++#endif ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* __NSGeometry_h_GNUSTEP_BASE_INCLUDE */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSZone.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSZone.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSZone.h (.../branches/gcc-8-branch) +@@ -0,0 +1,335 @@ ++/** Zone memory management. -*- Mode: ObjC -*- ++ Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. ++ ++ Written by: Yoo C. Chung ++ Date: January 1997 ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ ++ AutogsdocSource: NSZone.m ++ AutogsdocSource: NSPage.m ++ ++ */ ++ ++#ifndef __NSZone_h_GNUSTEP_BASE_INCLUDE ++#define __NSZone_h_GNUSTEP_BASE_INCLUDE ++#import "../GNUstepBase/GSVersionMacros.h" ++ ++/** ++ * Primary structure representing an NSZone. Technically it ++ * consists of a set of function pointers for zone upkeep functions plus some ++ * other things- ++ ++{ ++ // Functions for zone. ++ void *(*malloc)(struct _NSZone *zone, size_t size); ++ void *(*realloc)(struct _NSZone *zone, void *ptr, size_t size); ++ void (*free)(struct _NSZone *zone, void *ptr); ++ void (*recycle)(struct _NSZone *zone); ++ BOOL (*check)(struct _NSZone *zone); ++ BOOL (*lookup)(struct _NSZone *zone, void *ptr); ++ ++ // Zone statistics (not always maintained). ++ struct NSZoneStats (*stats)(struct _NSZone *zone); ++ ++ size_t gran; // Zone granularity (passed in on initialization) ++ NSString *name; // Name of zone (default is 'nil') ++ NSZone *next; // Pointer used for internal management of multiple zones. ++} ++ */ ++typedef struct _NSZone NSZone; ++ ++#import "NSObjCRuntime.h" ++ ++@class NSString; ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++struct _NSZone ++{ ++ /* Functions for zone. */ ++ void *(*malloc)(struct _NSZone *zone, size_t size); ++ void *(*realloc)(struct _NSZone *zone, void *ptr, size_t size); ++ void (*free)(struct _NSZone *zone, void *ptr); ++ void (*recycle)(struct _NSZone *zone); ++ BOOL (*check)(struct _NSZone *zone); ++ BOOL (*lookup)(struct _NSZone *zone, void *ptr); ++ struct NSZoneStats (*stats)(struct _NSZone *zone); ++ ++ size_t gran; // Zone granularity ++ __unsafe_unretained NSString *name; // Name of zone (default is 'nil') ++ NSZone *next; ++}; ++ ++/** ++ * Creates a new zone of start bytes, which will grow and shrink by ++ * granularity bytes. If canFree is 0, memory in zone is allocated but ++ * never freed, meaning allocation will be very fast. The whole zone can ++ * still be freed with NSRecycleZone(), and you should still call NSZoneFree ++ * on memory in the zone that is no longer needed, since a count of allocated ++ * pointers is kept and must reach zero before freeing the zone.
    ++ * If Garbage Collection is enabled, this function does nothing other than ++ * log a warning and return the same value as the NSDefaultMallocZone() ++ * function. ++ */ ++GS_EXPORT NSZone* ++NSCreateZone (NSUInteger start, NSUInteger gran, BOOL canFree); ++ ++/** Returns the default zone for memory allocation. Memory created in this ++ * zone is the same as memory allocates using the system malloc() function. ++ */ ++GS_EXPORT NSZone* ++NSDefaultMallocZone (void); ++ ++/** ++ * Searches and finds the zone ptr was allocated from. The speed depends ++ * upon the number of zones and their size.
    ++ * If Garbage Collection is enabled, this function always returns the ++ * same as the NSDefaultMallocZone() function. ++ */ ++GS_EXPORT NSZone* ++NSZoneFromPointer (void *ptr); ++ ++/** ++ * Allocates and returns memory for elems items of size bytes, in the ++ * given zone. Returns NULL if allocation of size 0 requested. Raises ++ * NSMallocException if not enough free memory in zone to ++ * allocate and no more can be obtained from system, unless using the ++ * default zone, in which case NULL is returned.
    ++ * If Garbage Collection is enabled, this function always allocates ++ * non-scanned, non-collectable memory in the NSDefaultMallocZone() and ++ * the zone argument is ignored. ++ */ ++GS_EXPORT void* ++NSZoneMalloc (NSZone *zone, NSUInteger size); ++ ++/** ++ * Allocates and returns cleared memory for elems items of size bytes, in the ++ * given zone. Returns NULL if allocation of size 0 requested. Raises ++ * NSMallocException if not enough free memory in zone to ++ * allocate and no more can be obtained from system, unless using the ++ * default zone, in which case NULL is returned.
    ++ * If Garbage Collection is enabled, this function always allocates ++ * non-scanned, non-collectable memory in the NSDefaultMallocZone() and ++ * the zone argument is ignored. ++ */ ++GS_EXPORT void* ++NSZoneCalloc (NSZone *zone, NSUInteger elems, NSUInteger bytes); ++ ++/** ++ * Reallocates the chunk of memory in zone pointed to by ptr to a new one of ++ * size bytes. Existing contents in ptr are copied over. Raises an ++ * NSMallocException if insufficient memory is available in the ++ * zone and no more memory can be obtained from the system, unless using the ++ * default zone, in which case NULL is returned.
    ++ * If Garbage Collection is enabled, the zone argument is ignored. ++ */ ++GS_EXPORT void* ++NSZoneRealloc (NSZone *zone, void *ptr, NSUInteger size); ++ ++/** ++ * Return memory for an entire zone to system. In fact, this will not be done ++ * unless all memory in the zone has been explicitly freed (by calls to ++ * NSZoneFree()). For "non-freeable" zones, the number of NSZoneFree() calls ++ * must simply equal the number of allocation calls. The default zone, on the ++ * other hand, cannot be recycled.
    ++ * If Garbage Collection is enabled, this function has not effect. ++ */ ++GS_EXPORT void ++NSRecycleZone (NSZone *zone); ++ ++/** ++ * Frees memory pointed to by ptr (which should have been allocated by a ++ * previous call to NSZoneMalloc(), NSZoneCalloc(), or NSZoneRealloc()) and ++ * returns it to zone. Note, if this is a nonfreeable zone, the memory is ++ * not actually freed, but the count of number of free()s is updated.
    ++ * If Garbage Collection is enabled, the zone argument is ignored and this ++ * function causes ptr to be deallocated immediately. ++ */ ++GS_EXPORT void ++NSZoneFree (NSZone *zone, void *ptr); ++ ++/** ++ * Sets name of the given zone (useful for debugging and logging). ++ */ ++GS_EXPORT void ++NSSetZoneName (NSZone *zone, NSString *name); ++ ++/** ++ * Returns the name of the given zone (useful for debugging and logging). ++ */ ++GS_EXPORT NSString* ++NSZoneName (NSZone *zone); ++ ++#if OS_API_VERSION(GS_API_NONE, GS_API_NONE) ++ ++/** Deprecated ...
    ++ * Checks integrity of a zone. Not defined by OpenStep or OS X. ++ */ ++BOOL ++NSZoneCheck (NSZone *zone); ++ ++/** ++ * NSZoneStats is the structure returned by the NSZoneStats() ++ * function that summarizes the current usage of a zone. It is similar to ++ * the structure mstats in the GNU C library. It has 5 fields of ++ * type size_t- ++ * ++ * bytes_total ++ * ++ * This is the total size of memory managed by the zone, in bytes. ++ * chunks_used ++ * This is the number of memory chunks in use in the zone. ++ * bytes_used ++ * This is the number of bytes in use. ++ * chunks_free ++ * This is the number of memory chunks that are not in use. ++ * bytes_free ++ * ++ * This is the number of bytes managed by the zone that are not in use. ++ * ++ * ++ */ ++struct NSZoneStats ++{ ++ size_t bytes_total; ++ size_t chunks_used; ++ size_t bytes_used; ++ size_t chunks_free; ++ size_t bytes_free; ++}; ++ ++/** Deprecated ...
    ++ * Obtain statistics about the zone. Implementation emphasis is on ++ * correctness, not speed. Not defined by OpenStep or OS X. ++ */ ++struct NSZoneStats ++NSZoneStats (NSZone *zone); ++ ++/** ++ * Try to get more memory - the normal process has failed. ++ * If we can't do anything, just return a null pointer. ++ * Try to do some logging if possible. ++ */ ++void* ++GSOutOfMemory(NSUInteger size, BOOL retry); ++ ++/** ++ * Called during +initialize to tell the class that instances created ++ * in future should have the specified instance variable as a weak ++ * pointer for garbage collection.
    ++ * NB. making a pointer weak does not mean that it is automatically ++ * zeroed when the object it points to is garbage collected. To get that ++ * behavior you must asign values to the pointer using the ++ * GSAssignZeroingWeakPointer() function.
    ++ * This function has no effect if the system is ++ * not built for garbage collection. ++ */ ++GS_EXPORT void ++GSMakeWeakPointer(Class theClass, const char *iVarName); ++ ++/** ++ * This function must be used to assign a value to a zeroing weak pointer.
    ++ * A zeroing weak pointer is one where, when the garbage collector collects ++ * the object pointed to, it also clears the weak pointer.
    ++ * Assigning zero (nil) will always succeed and has the effect of telling the ++ * garbage collector that it no longer needs to track the previously assigned ++ * object. Apart from that case, a source needs to be garbage collectable for ++ * this function to work, and using a non-garbage collectable value will ++ * cause the function to return NO.
    ++ * If the destination object (the weak pointer watching the source object) ++ * belongs to a chunk of memory which may be collected before the source ++ * object is collected, it is important that it is finalised and the ++ * finalisation code assigns zero to the pointer.
    ++ * If garbage collection is not in use, this function performs a simple ++ * assignment returning YES, unless destination is null in which case it ++ * returns NO. ++ */ ++GS_EXPORT BOOL ++GSAssignZeroingWeakPointer(void **destination, void *source); ++ ++#endif ++ ++GS_EXPORT NSUInteger ++NSPageSize (void) __attribute__ ((const)); ++ ++GS_EXPORT NSUInteger ++NSLogPageSize (void) __attribute__ ((const)); ++ ++GS_EXPORT NSUInteger ++NSRoundDownToMultipleOfPageSize (NSUInteger bytes) __attribute__ ((const)); ++ ++GS_EXPORT NSUInteger ++NSRoundUpToMultipleOfPageSize (NSUInteger bytes) __attribute__ ((const)); ++ ++GS_EXPORT NSUInteger ++NSRealMemoryAvailable (void); ++ ++GS_EXPORT void* ++NSAllocateMemoryPages (NSUInteger bytes); ++ ++GS_EXPORT void ++NSDeallocateMemoryPages (void *ptr, NSUInteger bytes); ++ ++GS_EXPORT void ++NSCopyMemoryPages (const void *src, void *dest, NSUInteger bytes); ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, OS_API_LATEST) ++ ++enum { ++ NSScannedOption = (1<<0), ++ NSCollectorDisabledOption = (1<<1) ++}; ++ ++/** Allocate memory. If garbage collection is not enabled this uses the ++ * default malloc zone and the options are ignored.
    ++ * If garbage collection is enabled, the allocate memory is normally not ++ * scanned for pointers but is itsself garbage collectable. The options ++ * argument is a bitmask in which NSScannedOption sets the memory to be ++ * scanned for pointers by the garbage collector, and ++ * NSCollectorDisabledOption causes the memory to be excempt from being ++ * garbage collected itsself.
    ++ * In any case the memory returned is zero'ed. ++ */ ++GS_EXPORT void * ++NSAllocateCollectable(NSUInteger size, NSUInteger options); ++ ++/** Reallocate memory to be of a different size and/or to have different ++ * options settings. The behavior of options is as for ++ * the NSAllocateCollectable() function. ++ */ ++GS_EXPORT void * ++NSReallocateCollectable(void *ptr, NSUInteger size, NSUInteger options); ++ ++#endif ++ ++static inline id NSMakeCollectable(const void *cf) { ++#if __has_feature(objc_arc) ++ return nil; ++#else ++ return (id)cf; // Unimplemented; garbage collection is deprecated. ++#endif ++} ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* not __NSZone_h_GNUSTEP_BASE_INCLUDE */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSRange.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSRange.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSRange.h (.../branches/gcc-8-branch) +@@ -0,0 +1,235 @@ ++/* ++ * Copyright (C) 1995,1999 Free Software Foundation, Inc. ++ * ++ * Written by: Adam Fedor ++ * Date: 1995 ++ * ++ * This file is part of the GNUstep Base Library. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02111 USA. ++ */ ++ ++#ifndef __NSRange_h_GNUSTEP_BASE_INCLUDE ++#define __NSRange_h_GNUSTEP_BASE_INCLUDE ++#import "../GNUstepBase/GSVersionMacros.h" ++ ++/**** Included Headers *******************************************************/ ++ ++#import "NSObject.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++@class NSException; ++@class NXConstantString; ++ ++/**** Type, Constant, and Macro Definitions **********************************/ ++ ++#ifndef MAX ++#define MAX(a,b) \ ++ ({__typeof__(a) _MAX_a = (a); __typeof__(b) _MAX_b = (b); \ ++ _MAX_a > _MAX_b ? _MAX_a : _MAX_b; }) ++#define GS_DEFINED_MAX ++#endif ++ ++#ifndef MIN ++#define MIN(a,b) \ ++ ({__typeof__(a) _MIN_a = (a); __typeof__(b) _MIN_b = (b); \ ++ _MIN_a < _MIN_b ? _MIN_a : _MIN_b; }) ++#define GS_DEFINED_MIN ++#endif ++ ++/** ++ * ++{ ++ NSUInteger location; ++ NSUInteger length; ++} ++ *

    ++ * The NSRange type is used to specify ranges of locations, ++ * typically items in an array, characters in a string, and bytes ++ * in a data object. ++ *

    ++ *

    ++ * As 'boundary' or 'fencepost' errors are a particularly common ++ * problem in programming, it is important that you understand ++ * how an NSRange works. ++ *

    ++ *

    ++ * An NSRange consists of a location and a length. The ++ * points that are considered to lie in a range are the integers from ++ * the location to the location plus the length, so the number ++ * of points in a range is the length of the range plus one.
    ++ * However, if you consider these points like the marks on a ++ * ruler, you can only store information between ++ * points. So the number of items that can be stored in a range ++ * is the length of the range. ++ *

    ++ */ ++typedef struct _NSRange NSRange; ++struct _NSRange ++{ ++ NSUInteger location; ++ NSUInteger length; ++}; ++ ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++/** Pointer to an NSRange structure. */ ++typedef NSRange *NSRangePointer; ++#endif ++ ++/**** Function Prototypes ****************************************************/ ++ ++/* ++ * All but the most complex functions are declared static inline in this ++ * header file so that they are maximally efficient. In order to provide ++ * true functions (for code modules that don't have this header) this ++ * header is included in NSRange.m where the functions are no longer ++ * declared inline. ++ */ ++#ifdef IN_NSRANGE_M ++#define GS_RANGE_SCOPE extern ++#define GS_RANGE_ATTR ++#else ++#define GS_RANGE_SCOPE static inline ++#define GS_RANGE_ATTR __attribute__((unused)) ++#endif ++ ++GS_RANGE_SCOPE NSUInteger ++NSMaxRange(NSRange range) GS_RANGE_ATTR; ++ ++/** Returns top end of range (location + length). */ ++GS_RANGE_SCOPE NSUInteger ++NSMaxRange(NSRange range) ++{ ++ return range.location + range.length; ++} ++ ++GS_RANGE_SCOPE BOOL ++NSLocationInRange(NSUInteger location, NSRange range) GS_RANGE_ATTR; ++ ++/** Returns whether location is greater than or equal to range's location ++ * and less than its max. ++ */ ++GS_RANGE_SCOPE BOOL ++NSLocationInRange(NSUInteger location, NSRange range) ++{ ++ return (location >= range.location) && (location < NSMaxRange(range)); ++} ++ ++/** Convenience method for raising an NSRangeException. */ ++GS_EXPORT void _NSRangeExceptionRaise (void); ++/* NB: The implementation of _NSRangeExceptionRaise is: ++ [NSException raise: NSRangeException ++ format: @"Range location + length too great"]; ++ ++ _NSRangeExceptionRaise is defined in NSRange.m so that this ++ file (NSRange.h) can be included without problems in the ++ implementation of the base classes themselves. */ ++ ++GS_RANGE_SCOPE NSRange ++NSMakeRange(NSUInteger location, NSUInteger length) GS_RANGE_ATTR; ++ ++/** Creates new range starting at location and of given length. */ ++GS_RANGE_SCOPE NSRange ++NSMakeRange(NSUInteger location, NSUInteger length) ++{ ++ NSRange range; ++ NSUInteger end = location + length; ++ ++ if (end < location || end < length) ++ { ++ _NSRangeExceptionRaise (); ++ } ++ range.location = location; ++ range.length = length; ++ return range; ++} ++ ++GS_RANGE_SCOPE BOOL ++NSEqualRanges(NSRange range1, NSRange range2) GS_RANGE_ATTR; ++ ++/** Returns whether range1 and range2 have same location and length. */ ++GS_RANGE_SCOPE BOOL ++NSEqualRanges(NSRange range1, NSRange range2) ++{ ++ return ((range1.location == range2.location) ++ && (range1.length == range2.length)); ++} ++ ++GS_RANGE_SCOPE NSRange ++NSUnionRange(NSRange range1, NSRange range2) GS_RANGE_ATTR; ++ ++/** Returns range going from minimum of aRange's and bRange's locations to ++ maximum of their two max's. */ ++GS_RANGE_SCOPE NSRange ++NSUnionRange(NSRange aRange, NSRange bRange) ++{ ++ NSRange range; ++ ++ range.location = MIN(aRange.location, bRange.location); ++ range.length = MAX(NSMaxRange(aRange), NSMaxRange(bRange)) ++ - range.location; ++ return range; ++} ++ ++GS_RANGE_SCOPE NSRange ++NSIntersectionRange(NSRange range1, NSRange range2) GS_RANGE_ATTR; ++ ++/** Returns range containing indices existing in both aRange and bRange. If ++ * the returned length is 0, the location is undefined and should be ignored. ++ */ ++GS_RANGE_SCOPE NSRange ++NSIntersectionRange (NSRange aRange, NSRange bRange) ++{ ++ NSRange range; ++ ++ if (NSMaxRange(aRange) < bRange.location ++ || NSMaxRange(bRange) < aRange.location) ++ return NSMakeRange(0, 0); ++ ++ range.location = MAX(aRange.location, bRange.location); ++ range.length = MIN(NSMaxRange(aRange), NSMaxRange(bRange)) ++ - range.location; ++ return range; ++} ++ ++ ++@class NSString; ++ ++/** Returns string of form {location=a, length=b}. */ ++GS_EXPORT NSString *NSStringFromRange(NSRange range); ++ ++/** Parses range from string of form {location=a, length=b}; returns range ++ with 0 location and length if this fails. */ ++GS_EXPORT NSRange NSRangeFromString(NSString *aString); ++ ++#ifdef GS_DEFINED_MAX ++#undef GS_DEFINED_MAX ++#undef MAX ++#endif ++ ++#ifdef GS_DEFINED_MIN ++#undef GS_DEFINED_MIN ++#undef MIN ++#endif ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* __NSRange_h_GNUSTEP_BASE_INCLUDE */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSValue.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSValue.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSValue.h (.../branches/gcc-8-branch) +@@ -0,0 +1,370 @@ ++/* Interface for NSValue for GNUStep ++ Copyright (C) 1995, 1996 Free Software Foundation, Inc. ++ ++ Written by: Adam Fedor ++ Created: 1995 ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ */ ++ ++#ifndef __NSValue_h_GNUSTEP_BASE_INCLUDE ++#define __NSValue_h_GNUSTEP_BASE_INCLUDE ++#import "../GNUstepBase/GSVersionMacros.h" ++ ++#import "NSObject.h" ++#import "NSGeometry.h" ++#import "NSRange.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++@class NSString; ++ ++/** ++ * The NSValue class can wrap a single primitive value as an ++ * object so it can be used in the containers and other places where an object ++ * reference is needed. Once initialized, an NSValue is ++ * immutable, and there is no NSMutableValue class. You ++ * initialize it by giving it a pointer to the primitive value, and you should ++ * be careful this does not get freed until after the NSValue is ++ * no longer used. ++ */ ++@interface NSValue : NSObject ++ ++// Allocating and Initializing ++ ++/** ++ * Create new instance with specified value (a pointer) of given type, which ++ * is a string code obtainable through the compile-time operator ++ * @encode(...). For example: ++ ++ NSValue *theValue = [NSValue value: &n withObjCType: @encode(int)]; ++ ++ */ +++ (NSValue*) value: (const void*)value withObjCType: (const char*)type; ++ ++/** ++ * Create new instance holding anObject. This is useful if you want to add ++ * anObject to a collection such as [NSArray] but don't want it to be retained ++ * (a weak reference). ++ */ +++ (NSValue*) valueWithNonretainedObject: (id)anObject; ++ ++/** ++ * Convenience method to create instance holding an NSPoint ++ * structure. ++ */ +++ (NSValue*) valueWithPoint: (NSPoint)point; ++ ++/** ++ * Convenience method to create instance holding a pointer. Same as ++ * using @encode(void *) in +value:withObjCType: . ++ */ +++ (NSValue*) valueWithPointer: (const void*)pointer; ++ ++/** ++ * Convenience method to create instance holding an NSRange ++ * structure. ++ */ +++ (NSValue*) valueWithRange: (NSRange)range; ++ ++/** ++ * Convenience method to create instance holding an NSRect ++ * structure. ++ */ +++ (NSValue*) valueWithRect: (NSRect)rect; ++ ++/** ++ * Convenience method to create instance holding an NSSize ++ * structure. ++ */ +++ (NSValue*) valueWithSize: (NSSize)size; ++ ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++/** ++ * Synonym for value:withObjCType: . ++ */ +++ (NSValue*) valueWithBytes: (const void*)value objCType: (const char*)type; ++ ++/** ++ * Initialize with value of type, parallel to value:withObjCType: . ++ */ ++- (id) initWithBytes: (const void*)data objCType: (const char*)type; ++ ++/** ++ * Compares this instance to another NSValue. For equality, ++ * both contents and declared type of the two values must match. ++ */ ++- (BOOL) isEqualToValue: (NSValue*)other; ++#endif /* GS_API_MACOSX */ ++ ++// Accessing Data ++ ++/** ++ * Copies bytes from the pointer receiver was initialized with into buffer ++ * pointed to by value. Number of bytes copied is determined by the type. If ++ * type was a void * pointer or object id, the memory address itself is ++ * copied. ++ */ ++- (void) getValue: (void*)value; ++ ++/** ++ * Returns the string @encode(...) compatible type the receiver ++ * was initialized with. ++ */ ++- (const char*) objCType; ++ ++/** ++ * If receiver was initialized with an object ID, return it, else raises ++ * NSInternalInconsistencyException. ++ */ ++- (id) nonretainedObjectValue; ++ ++/** ++ * If receiver was initialized with a void * pointer, return it, else raises ++ * NSInternalInconsistencyException. ++ */ ++- (void*) pointerValue; ++ ++/** ++ * If receiver was initialized with an NSRange value, return it, ++ * else raises NSInternalInconsistencyException. ++ */ ++- (NSRange) rangeValue; ++ ++/** ++ * If receiver was initialized with an NSRect value, return it, ++ * else raises NSInternalInconsistencyException. ++ */ ++- (NSRect) rectValue; ++ ++/** ++ * If receiver was initialized with an NSSize value, return it, ++ * else raises NSInternalInconsistencyException. ++ */ ++- (NSSize) sizeValue; ++ ++/** ++ * If receiver was initialized with an NSPoint value, return it, ++ * else raises NSInternalInconsistencyException. ++ */ ++- (NSPoint) pointValue; ++ ++@end ++ ++/** ++ * Subclass of [NSValue] offering convenience methods for initializing from ++ * and accessing as any C primitive numeric type. On access, the value will ++ * be type-converted if necessary, using standard C conversion rules. ++ */ ++@interface NSNumber : NSValue ++ ++// Allocating and Initializing ++ ++/** New instance from boolean value. */ +++ (NSNumber*) numberWithBool: (BOOL)value; ++/** New instance from signed char value. */ +++ (NSNumber*) numberWithChar: (signed char)value; ++/** New instance from double value. */ +++ (NSNumber*) numberWithDouble: (double)value; ++/** New instance from float value. */ +++ (NSNumber*) numberWithFloat: (float)value; ++/** New instance from (signed) int value. */ +++ (NSNumber*) numberWithInt: (signed int)value; ++/** New instance from (signed) long value. */ +++ (NSNumber*) numberWithLong: (signed long)value; ++/** New instance from (signed) long long value. */ +++ (NSNumber*) numberWithLongLong: (signed long long)value; ++/** New instance from (signed) short value. */ +++ (NSNumber*) numberWithShort: (signed short)value; ++/** New instance from unsigned char value. */ +++ (NSNumber*) numberWithUnsignedChar: (unsigned char)value; ++/** New instance from unsigned int value. */ +++ (NSNumber*) numberWithUnsignedInt: (unsigned int)value; ++/** New instance from unsigned long value. */ +++ (NSNumber*) numberWithUnsignedLong: (unsigned long)value; ++/** New instance from unsigned long long value. */ +++ (NSNumber*) numberWithUnsignedLongLong: (unsigned long long)value; ++/** New instance from unsigned short value. */ +++ (NSNumber*) numberWithUnsignedShort: (unsigned short)value; ++ ++/** Initialize from boolean value. */ ++- (id) initWithBool: (BOOL)value; ++/** Initialize from signed char value. */ ++- (id) initWithChar: (signed char)value; ++/** Initialize from double value. */ ++- (id) initWithDouble: (double)value; ++/** Initialize from float value. */ ++- (id) initWithFloat: (float)value; ++/** Initialize from (signed) int value. */ ++- (id) initWithInt: (signed int)value; ++/** Initialize from (signed) long value. */ ++- (id) initWithLong: (signed long)value; ++/** Initialize from (signed) long long value. */ ++- (id) initWithLongLong: (signed long long)value; ++/** Initialize from (signed) short value. */ ++- (id) initWithShort: (signed short)value; ++/** Initialize from unsigned char value. */ ++- (id) initWithUnsignedChar: (unsigned char)value; ++/** Initialize from unsigned int value. */ ++- (id) initWithUnsignedInt: (unsigned int)value; ++/** Initialize from unsigned long value. */ ++- (id) initWithUnsignedLong: (unsigned long)value; ++/** Initialize from unsigned long long value. */ ++- (id) initWithUnsignedLongLong: (unsigned long long)value; ++/** Initialize from unsigned short value. */ ++- (id) initWithUnsignedShort: (unsigned short)value; ++ ++// Accessing Data ++ ++/** ++ * Return value as a BOOL; this will in fact be a char value converted ++ * if necessary from type initialized with; if you wish to consider anything ++ * nonzero TRUE do not compare directly to YES, but use '!= NO'. ++ */ ++- (BOOL) boolValue; ++/** Returns value as a signed char, converting if necessary. */ ++- (signed char) charValue; ++/** Returns value as a double, converting if necessary. */ ++- (double) doubleValue; ++/** Returns value as a float, converting if necessary. */ ++- (float) floatValue; ++/** Returns value as a (signed) int, converting if necessary. */ ++- (signed int) intValue; ++/** Returns value as a (signed) long, converting if necessary. */ ++- (signed long) longValue; ++/** Returns value as a (signed) long long, converting if necessary. */ ++- (signed long long) longLongValue; ++/** Returns value as a (signed) short, converting if necessary. */ ++- (signed short) shortValue; ++/** Returns value as an unsigned char, converting if necessary. */ ++- (unsigned char) unsignedCharValue; ++/** Returns value as an unsigned int, converting if necessary. */ ++- (unsigned int) unsignedIntValue; ++/** Returns value as an unsigned long, converting if necessary. */ ++- (unsigned long) unsignedLongValue; ++/** Returns value as an unsigned long long, converting if necessary. */ ++- (unsigned long long) unsignedLongLongValue; ++/** Returns value as an unsigned short, converting if necessary. */ ++- (unsigned short) unsignedShortValue; ++ ++/** Returns -description . */ ++- (NSString*) stringValue; ++ ++/** ++ * Returns the string representation of this number using a non-localised ++ * conversion (decimal point is '.' irrespective of the locale). ++ */ ++- (NSString*) description; ++ ++/** ++ *

    ++ * Produces a string representation of the number. For a boolean ++ * this will be either 'true' or 'false'. For other numbers the ++ * format is produced using the initWithFormat:locale:... method ++ * of NSString, and the format depends on the type of number as ++ * follows - ++ *

    ++ * ++ * char ++ * %i ++ * short ++ * %hi ++ * int ++ * %i ++ * long ++ * %li ++ * long long ++ * %lli ++ * unsigned char ++ * %u ++ * unsigned short ++ * %hu ++ * unsigned int ++ * %u ++ * unsigned long ++ * %lu ++ * unsigned long long ++ * %llu ++ * float ++ * %0.7g ++ * double ++ * %0.16g ++ * ++ */ ++- (NSString*) descriptionWithLocale: (id)locale; ++ ++/** ++ * Compares receiver with otherNumber, using C type conversion if necessary, ++ * and returns NSOrderedAscending, ++ * NSOrderedDescending, or NSOrderedSame depending ++ * on whether it is less than, greater than, or equal to otherNumber. ++ */ ++- (NSComparisonResult) compare: (NSNumber*)otherNumber; ++ ++/** ++ * Returns whether receiver and otherNumber represent the same numerical value. ++ */ ++- (BOOL) isEqualToNumber: (NSNumber*)otherNumber; ++ ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++/** Return a number intialised with NSInteger. ++ */ +++ (NSNumber*) numberWithInteger: (NSInteger)value; ++/** Return a number intialised with NSUInteger. ++ */ +++ (NSNumber*) numberWithUnsignedInteger: (NSUInteger)value; ++/** Initialise the receiver with NSInteger content. ++ */ ++- (id) initWithInteger: (NSInteger)value; ++/** Initialise the receiver with NSUInteger content. ++ */ ++- (id) initWithUnsignedInteger: (NSUInteger)value; ++/** Return the contents of the receiver as NSInteger. ++ */ ++- (NSInteger) integerValue; ++/** Return the contents of the receiver as NSUInteger. ++ */ ++- (NSUInteger) unsignedIntegerValue; ++#endif ++ ++@end ++ ++#if OS_API_VERSION(GS_API_NONE, GS_API_NONE) ++ ++/** Note: Defines a method that is not in the OpenStep spec, but makes ++ subclassing easier. */ ++@interface NSValue (Subclassing) ++ ++/** Used by value: withObjCType: to determine the concrete subclass to alloc. */ +++ (Class) valueClassWithObjCType: (const char*)type; ++ ++@end ++#endif ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#if !NO_GNUSTEP && !defined(GNUSTEP_BASE_INTERNAL) ++#import "../GNUstepBase/NSNumber+GNUstepBase.h" ++#endif ++ ++#endif /* __NSValue_h_GNUSTEP_BASE_INCLUDE */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSDate.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSDate.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSDate.h (.../branches/gcc-8-branch) +@@ -0,0 +1,300 @@ ++/* Interface for NSDate for GNUStep ++ Copyright (C) 1994, 1996, 1999 Free Software Foundation, Inc. ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ */ ++ ++#ifndef __NSDate_h_GNUSTEP_BASE_INCLUDE ++#define __NSDate_h_GNUSTEP_BASE_INCLUDE ++#import "../GNUstepBase/GSVersionMacros.h" ++ ++#import "NSObjCRuntime.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++GS_EXPORT NSString * const NSSystemClockDidChangeNotification; ++ ++/** ++ * Time interval difference between two dates, in seconds. ++ */ ++typedef double NSTimeInterval; ++ ++/** ++ * Time interval between the unix standard reference date of 1 January 1970 ++ * and the OpenStep reference date of 1 January 2001
    ++ * This number comes from:
    ++ * (((31 years * 365 days) + 8 days for leap years) = total number of days
    ++ * 24 hours * 60 minutes * 60 seconds)
    ++ * This ignores leap-seconds. ++ */ ++GS_EXPORT const NSTimeInterval NSTimeIntervalSince1970; ++ ++#import "NSObject.h" ++ ++@class NSArray; ++@class NSCalendarDate; ++@class NSData; ++@class NSDictionary; ++@class NSString; ++@class NSTimeZone; ++@class NSTimeZoneDetail; ++ ++@interface NSDate : NSObject ++{ ++} ++ ++/** Returns an autoreleased instance with the current date/time. ++ */ +++ (id) date; ++ ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++/** Returns an autoreleased instance representing the date and time given ++ * by string. The value of string may be a 'natural' specification as ++ * specified by the preferences in the user defaults database, allowing ++ * phrases like 'last tuesday' ++ */ +++ (id) dateWithNaturalLanguageString: (NSString*)string; ++ ++/** ++ *

    Returns an autoreleased instance representing the date and time given ++ * by string. The value of string may be a 'natural' specification as ++ * specified by the preferences in the user defaults database, allowing ++ * phrases like 'last tuesday' ++ *

    ++ * The locale contains keys such as - ++ * ++ * NSDateTimeOrdering ++ * Controls the use of ambiguous numbers. This is done as a ++ * sequence of the letters D(ay), M(onth), Y(ear), and H(our). ++ * YMDH means that the first number encountered is assumed to be a ++ * year, the second a month, the third a day, and the last an hour. ++ * ++ * NSEarlierTimeDesignations ++ * An array of strings for times in the past.
    ++ * Defaults are ago, last, past, prior ++ *
    ++ * NSHourNameDesignations ++ * An array of arrays of strings identifying the time of day. ++ * Each array has an hour as its first value, and one or more words ++ * as subsequent values.
    ++ * Defaults are: (0, midnight), (10, morning), (12, noon, lunch), ++ * (14, afternoon), (19, dinner). ++ *
    ++ * NSLaterTimeDesignations ++ * An array of strings for times in the future.
    ++ * Default is next ++ *
    ++ * NSNextDayDesignations ++ * The day after today. Default is tomorrow. ++ * ++ * NSNextNextDayDesignations ++ * The day after tomorrow. Default is nextday. ++ * ++ * NSPriorDayDesignations ++ * The day before today. Default is yesterday. ++ * ++ * NSThisDayDesignations ++ * Identifies the current day. Default is today. ++ * ++ * NSYearMonthWeekDesignations ++ * An array giving the word for year, month, and week.
    ++ * Defaults are year, month and week. ++ *
    ++ *
    ++ */ +++ (id) dateWithNaturalLanguageString: (NSString*)string ++ locale: (NSDictionary*)locale; ++#endif ++ ++/** Returns an autoreleased instance with the date and time value given ++ * by the string using the ISO standard format YYYY-MM-DD HH:MM:SS +/-HHHMM ++ * (all the fields of which must be present). ++ */ +++ (id) dateWithString: (NSString*)description; ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6,GS_API_LATEST) ++/** Returns an autoreleased NSDate instance whose value is offset from ++ * that of the given date by the specified interval in seconds. ++ */ +++ (id) dateWithTimeInterval: (NSTimeInterval)seconds sinceDate: (NSDate*)date; ++#endif ++ ++/** Returns an autoreleased instance with the offset from the unix system ++ * reference date of 1 January 1970, GMT. ++ */ +++ (id) dateWithTimeIntervalSince1970: (NSTimeInterval)seconds; ++ ++/** Returns an autoreleased instance with the offset from the current ++ * date/time given by seconds (which may be fractional). ++ */ +++ (id) dateWithTimeIntervalSinceNow: (NSTimeInterval)seconds; ++ ++/** Returns an autoreleased instance with the offset from the OpenStep ++ * reference date of 1 January 2001, GMT. ++ */ +++ (id) dateWithTimeIntervalSinceReferenceDate: (NSTimeInterval)seconds; ++ ++/** Returns an autoreleased instance with the date/time set in the far ++ * past. ++ */ +++ (id) distantPast; ++ ++/** Returns an autoreleased instance with the date/time set in the far ++ * future. ++ */ +++ (id) distantFuture; ++ ++/** Returns the time interval between the reference date and the current ++ * time. ++ */ +++ (NSTimeInterval) timeIntervalSinceReferenceDate; ++ ++/** Returns an autorelease date instance formed by adding the specified ++ * time interval in seconds to the receiver's time interval. ++ */ ++- (id) addTimeInterval: (NSTimeInterval)seconds; ++ ++/** Returns the time interval between the receivers value and the ++ * OpenStep reference date of 1 Jan 2001 GMT. ++ */ ++- (NSComparisonResult) compare: (NSDate*)otherDate; ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6,GS_API_LATEST) ++/** Returns an autoreleased NSDate instance whose value is offset from ++ * that of the receiver by the specified interval. ++ */ ++- (id) dateByAddingTimeInterval: (NSTimeInterval)ti; ++#endif ++ ++/** Returns an autoreleased instance of the [NSCalendarDate] class whose ++ * date/time value is the same as that of the receiver, and which uses ++ * the formatString and timeZone specified. ++ */ ++- (NSCalendarDate*) dateWithCalendarFormat: (NSString*)formatString ++ timeZone: (NSTimeZone*)timeZone; ++ ++/** Returns a string representation of the receiver formatted according ++ * to the default format string, time zone, and locale. ++ */ ++- (NSString*) description; ++ ++/** Returns a string representation of the receiver formatted according ++ * to the specified format string, time zone, and locale. ++ */ ++- (NSString*) descriptionWithCalendarFormat: (NSString*)format ++ timeZone: (NSTimeZone*)aTimeZone ++ locale: (NSDictionary*)l; ++ ++/** Returns a string representation of the receiver formatted according ++ * to the default format string and time zone, but using the given locale. ++ */ ++- (NSString*) descriptionWithLocale: (id)locale; ++ ++/** Returns the earlier of the receiver and otherDate.
    ++ * If the two represent identical date/time values, returns the receiver. ++ */ ++- (NSDate*) earlierDate: (NSDate*)otherDate; ++ ++/** Returns an instance initialised with the current date/time. ++ */ ++- (id) init; ++ ++/** Returns an instance with the date and time value given ++ * by the string using the ISO standard format YYYY-MM-DD HH:MM:SS +/-HHHMM ++ * (all the fields of which must be present). ++ */ ++- (id) initWithString: (NSString*)description; ++ ++/** Returns an instance with the given offset from anotherDate. ++ */ ++- (id) initWithTimeInterval: (NSTimeInterval)secsToBeAdded ++ sinceDate: (NSDate*)anotherDate; ++ ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++/** Returns an instance with the offset from the unix system ++ * reference date of 1 January 1970, GMT. ++ */ ++- (id) initWithTimeIntervalSince1970: (NSTimeInterval)seconds; ++#endif ++ ++/** Returns an instance with the offset from the current date/time. ++ */ ++- (id) initWithTimeIntervalSinceNow: (NSTimeInterval)secsToBeAdded; ++ ++/** ++ * Returns an instance with the given offset from the OpenStep ++ * reference date of 1 January 2001, GMT. ++ */ ++- (id) initWithTimeIntervalSinceReferenceDate: (NSTimeInterval)secs; ++ ++/** Returns NO if other is not a date, otherwise returns the result of ++ * calling the -isEqualtoDate: method. ++ */ ++- (BOOL) isEqual: (id)other; ++ ++/** Returns whether the receiver is exactly equal to other, to the limit ++ * of the NSTimeInterval precision.
    ++ * This is the behavior of the current MacOS-X system, not that of the ++ * OpenStep specification (which counted two dates within a second of ++ * each other as being equal).
    ++ * The old behavior meant that two dates equal to a third date were not ++ * necessarily equal to each other (confusing), and meant that there was ++ * no reasonable way to use a date as a dictionary key or store dates ++ * in a set. ++ */ ++- (BOOL) isEqualToDate: (NSDate*)other; ++ ++/** Returns the earlier of the receiver and otherDate.
    ++ * If the two represent identical date/time values, returns the receiver. ++ */ ++- (NSDate*) laterDate: (NSDate*)otherDate; ++ ++/** Returns the time interval between the receivers value and the ++ * unix system reference date of 1 January 1970, GMT. ++ */ ++- (NSTimeInterval) timeIntervalSince1970; ++ ++/** Returns the time interval between the receivers value and that of the ++ * otherDate argument. If otherDate is earlier than the receiver, the ++ * returned value will be positive, if it is later it will be negative.
    ++ * For current (2011) OSX compatibility, this method returns NaN if otherDate ++ * is nil ... do not write code depending on that behavior. ++ */ ++- (NSTimeInterval) timeIntervalSinceDate: (NSDate*)otherDate; ++ ++/** Returns the time interval between the receivers value and the ++ * current date/time. If the receiver represents a date/time in ++ * the past this will be negative, if it is in the future the ++ * returned value will be positive. ++ */ ++- (NSTimeInterval) timeIntervalSinceNow; ++ ++/** Returns the time interval between the receivers value and the ++ * OpenStep reference date of 1 Jan 2001 GMT. ++ */ ++- (NSTimeInterval) timeIntervalSinceReferenceDate; ++ ++@end ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* __NSDate_h_GNUSTEP_BASE_INCLUDE*/ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSArray.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSArray.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSArray.h (.../branches/gcc-8-branch) +@@ -0,0 +1,430 @@ ++/* Interface for NSArray for GNUStep ++ Copyright (C) 1995-2015 Free Software Foundation, Inc. ++ ++ Written by: Andrew Kachites McCallum ++ Created: 1995 ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ */ ++ ++#ifndef __NSArray_h_GNUSTEP_BASE_INCLUDE ++#define __NSArray_h_GNUSTEP_BASE_INCLUDE ++#import "../GNUstepBase/GSVersionMacros.h" ++ ++#import "NSObject.h" ++#import "NSRange.h" ++#import "NSEnumerator.h" ++#if __BLOCKS__ ++#import "../GNUstepBase/GSBlocks.h" ++#endif ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++@class NSString; ++@class NSURL; ++@class NSIndexSet; ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) ++enum ++{ ++ NSBinarySearchingFirstEqual = (1UL << 8), /** Specifies that the binary ++ * search should find the first object equal in the array. ++ */ ++ NSBinarySearchingLastEqual = (1UL << 9), /** Specifies that the binary ++ * search should find the last object equal in the array. ++ */ ++ NSBinarySearchingInsertionIndex = (1UL << 10), /** Specifies that the binary ++ * search should find the index at which an equal object should be inserted ++ * in order to keep the array sorted ++ */ ++}; ++ ++typedef NSUInteger NSBinarySearchingOptions; ++#endif ++ ++@interface GS_GENERIC_CLASS(NSArray, __covariant ElementT) : NSObject ++ ++ +++ (instancetype) array; +++ (instancetype) arrayWithArray: (GS_GENERIC_CLASS(NSArray, ElementT) *)array; +++ (instancetype) arrayWithContentsOfFile: (NSString*)file; ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) +++ (instancetype) arrayWithContentsOfURL: (NSURL*)aURL; ++#endif +++ (instancetype) arrayWithObject: (id)anObject; +++ (instancetype) arrayWithObjects: (id)firstObject, ...; +++ (instancetype) arrayWithObjects: (const id[])objects count: (NSUInteger)count; ++ ++- (GS_GENERIC_CLASS(NSArray, ElementT) *) arrayByAddingObject: ++ (GS_GENERIC_TYPE(ElementT))anObject; ++- (GS_GENERIC_CLASS(NSArray, ElementT) *) arrayByAddingObjectsFromArray: ++ (GS_GENERIC_CLASS(NSArray, ElementT)*)anotherArray; ++- (BOOL) containsObject: (GS_GENERIC_TYPE(ElementT))anObject; ++ ++/** ++ * Returns the number of elements contained in the receiver. ++ */ ++- (NSUInteger) count; ++- (void) getObjects: (__unsafe_unretained GS_GENERIC_TYPE(ElementT)[])aBuffer; ++- (void) getObjects: (__unsafe_unretained GS_GENERIC_TYPE(ElementT)[])aBuffer ++ range: (NSRange)aRange; ++- (NSUInteger) indexOfObject: (GS_GENERIC_TYPE(ElementT))anObject; ++- (NSUInteger) indexOfObject: (GS_GENERIC_TYPE(ElementT))anObject ++ inRange: (NSRange)aRange; ++- (NSUInteger) indexOfObjectIdenticalTo: (GS_GENERIC_TYPE(ElementT))anObject; ++- (NSUInteger) indexOfObjectIdenticalTo: (GS_GENERIC_TYPE(ElementT))anObject ++ inRange: (NSRange)aRange; ++- (instancetype) init; ++- (instancetype) initWithArray: (GS_GENERIC_CLASS(NSArray, ElementT)*)array; ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++- (instancetype) initWithArray: (GS_GENERIC_CLASS(NSArray, ElementT)*)array ++ copyItems: (BOOL)shouldCopy; ++#endif ++- (instancetype) initWithContentsOfFile: (NSString*)file; ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++- (instancetype) initWithContentsOfURL: (NSURL*)aURL; ++#endif ++- (instancetype) initWithObjects: (GS_GENERIC_TYPE(ElementT)) firstObject, ...; ++ ++/** ++ * This should initialize the array with count (may be zero) objects.
    ++ * Retains each object placed in the array.
    ++ * Calls -init (which does nothing but maintain MacOS-X compatibility), ++ * and needs to be re-implemented in subclasses in order to have all ++ * other initialisers work. ++ */ ++- (instancetype) initWithObjects: (const GS_GENERIC_TYPE(ElementT)[])objects ++ count: (NSUInteger)count; ++- (GS_GENERIC_TYPE(ElementT)) lastObject; ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) ++- (GS_GENERIC_TYPE(ElementT)) firstObject; ++#endif ++ ++/** ++ * Returns the object at the specified index. ++ * Raises an exception of the index is beyond the array. ++ */ ++- (GS_GENERIC_TYPE(ElementT)) objectAtIndex: (NSUInteger)index; ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++- (GS_GENERIC_CLASS(NSArray, ElementT) *) objectsAtIndexes: ++ (NSIndexSet *)indexes; ++#endif ++ ++- (GS_GENERIC_TYPE(ElementT)) firstObjectCommonWithArray: ++ (GS_GENERIC_CLASS(NSArray, ElementT) *)otherArray; ++- (BOOL) isEqualToArray: (NSArray*)otherArray; ++ ++#if OS_API_VERSION(GS_API_OPENSTEP, GS_API_MACOSX) ++- (void) makeObjectsPerform: (SEL)aSelector; ++- (void) makeObjectsPerform: (SEL)aSelector withObject: (id)argument; ++#endif ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++- (void) makeObjectsPerformSelector: (SEL)aSelector; ++- (void) makeObjectsPerformSelector: (SEL)aSelector withObject: (id)arg; ++#endif ++ ++- (NSData*) sortedArrayHint; ++- (GS_GENERIC_CLASS(NSArray, ElementT)*) sortedArrayUsingFunction: ++ (NSComparisonResult (*)(id, id, void*))comparator ++ context: (void*)context; ++- (GS_GENERIC_CLASS(NSArray, ElementT)*) sortedArrayUsingFunction: ++ (NSComparisonResult (*)(id, id, void*))comparator ++ context: (void*)context ++ hint: (NSData*)hint; ++- (GS_GENERIC_CLASS(NSArray, ElementT)*) sortedArrayUsingSelector: ++ (SEL)comparator; ++- (GS_GENERIC_CLASS(NSArray, ElementT)*) subarrayWithRange: (NSRange)aRange; ++ ++- (NSString*) componentsJoinedByString: (NSString*)separator; ++- (GS_GENERIC_CLASS(NSArray, NSString*)*) pathsMatchingExtensions: ++ (GS_GENERIC_CLASS(NSArray, NSString*)*)extensions; ++ ++- (GS_GENERIC_CLASS(NSEnumerator, ElementT)*) objectEnumerator; ++- (GS_GENERIC_CLASS(NSEnumerator, ElementT)*) reverseObjectEnumerator; ++ ++- (NSString*) description; ++- (NSString*) descriptionWithLocale: (id)locale; ++- (NSString*) descriptionWithLocale: (id)locale ++ indent: (NSUInteger)level; ++ ++- (BOOL) writeToFile: (NSString*)path atomically: (BOOL)useAuxiliaryFile; ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++- (BOOL) writeToURL: (NSURL*)url atomically: (BOOL)useAuxiliaryFile; ++- (GS_GENERIC_TYPE(ElementT)) valueForKey: (NSString*)key; ++- (void) setValue: (GS_GENERIC_TYPE(ElementT))value forKey: (NSString*)key; ++#endif ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) ++ ++#if __BLOCKS__ ++DEFINE_BLOCK_TYPE(GSEnumeratorBlock, void, GS_GENERIC_TYPE(ElementT), ++ NSUInteger, BOOL*); ++DEFINE_BLOCK_TYPE(GSPredicateBlock, BOOL, GS_GENERIC_TYPE(ElementT), ++ NSUInteger, BOOL*); ++/** ++ * Enumerate over the collection using the given block. The first argument is ++ * the object and the second is the index in the array. The final argument is ++ * a pointer to a BOOL indicating whether the enumeration should stop. Setting ++ * this to YES will interrupt the enumeration. ++ */ ++- (void) enumerateObjectsUsingBlock: (GSEnumeratorBlock)aBlock; ++ ++/** ++ * Enumerate over the collection using the given block. The first argument is ++ * the object and the second is the index in the array. The final argument is ++ * a pointer to a BOOL indicating whether the enumeration should stop. Setting ++ * this to YES will interrupt the enumeration. ++ * ++ * The opts argument is a bitfield. Setting the NSNSEnumerationConcurrent flag ++ * specifies that it is thread-safe. The NSEnumerationReverse bit specifies ++ * that it should be enumerated in reverse order. ++ */ ++- (void) enumerateObjectsWithOptions: (NSEnumerationOptions)opts ++ usingBlock: (GSEnumeratorBlock)aBlock; ++/** ++ * Enumerate over the specified indexes in the collection using the given ++ * block. The first argument is the object and the second is the index in the ++ * array. The final argument is a pointer to a BOOL indicating whether the ++ * enumeration should stop. Setting this to YES will interrupt the ++ * enumeration. ++ * ++ * The opts argument is a bitfield. Setting the NSNSEnumerationConcurrent flag ++ * specifies that it is thread-safe. The NSEnumerationReverse bit specifies ++ * that it should be enumerated in reverse order. ++ */ ++- (void) enumerateObjectsAtIndexes: (NSIndexSet*)indexSet ++ options: (NSEnumerationOptions)opts ++ usingBlock: (GSEnumeratorBlock)block; ++/** ++ * Returns the indexes of the objects in a collection that match the condition ++ * specified by the block. ++ * ++ * The opts argument is a bitfield. Setting the NSNSEnumerationConcurrent flag ++ * specifies that it is thread-safe. The NSEnumerationReverse bit specifies ++ * that it should be enumerated in reverse order. ++ */ ++- (NSIndexSet *) indexesOfObjectsWithOptions: (NSEnumerationOptions)opts ++ passingTest: (GSPredicateBlock)predicate; ++ ++/** ++ * Returns the indexes of the objects in a collection that match the condition ++ * specified by the block. ++ */ ++- (NSIndexSet*) indexesOfObjectsPassingTest: (GSPredicateBlock)predicate; ++ ++/** ++ * Returns the indexes of the objects in a collection that match the condition ++ * specified by the block and are in the range specified by the index set. ++ * ++ * The opts argument is a bitfield. Setting the NSNSEnumerationConcurrent flag ++ * specifies that it is thread-safe. The NSEnumerationReverse bit specifies ++ * that it should be enumerated in reverse order. ++ */ ++- (NSIndexSet*) indexesOfObjectsAtIndexes: (NSIndexSet*)indexSet ++ options: (NSEnumerationOptions)opts ++ passingTest: (GSPredicateBlock)predicate; ++ ++/** ++ * Returns the index of the first object in the array that matches the ++ * condition specified by the block. ++ * ++ * The opts argument is a bitfield. Setting the NSNSEnumerationConcurrent flag ++ * specifies that it is thread-safe. The NSEnumerationReverse bit specifies ++ * that it should be enumerated in reverse order. ++ */ ++- (NSUInteger) indexOfObjectWithOptions: (NSEnumerationOptions)opts ++ passingTest: (GSPredicateBlock)predicate; ++ ++/** ++ * Returns the index of the first object in the array that matches the ++ * condition specified by the block. ++ */ ++- (NSUInteger) indexOfObjectPassingTest: (GSPredicateBlock)predicate; ++ ++/** ++ * Returns the index of the first object in the specified range in a collection ++ * that matches the condition specified by the block. ++ * ++ * The opts argument is a bitfield. Setting the NSNSEnumerationConcurrent flag ++ * specifies that it is thread-safe. The NSEnumerationReverse bit specifies ++ * that it should be enumerated in reverse order. ++ */ ++- (NSUInteger) indexOfObjectAtIndexes: (NSIndexSet*)indexSet ++ options: (NSEnumerationOptions)opts ++ passingTest: (GSPredicateBlock)predicate; ++ ++/** Returns a sorted array using the comparator to determine the ++ * order of objects. ++ */ ++- (GS_GENERIC_CLASS(NSArray, ElementT) *) sortedArrayUsingComparator: ++ (NSComparator)comparator; ++ ++/** Returns a sorted array using the block to determine the order of objects. ++ * ++ * The opts argument is a bitfield. Setting the NSSortConcurrent flag ++ * specifies that it is thread-safe. The NSSortStable bit specifies that ++ * it should keep equal objects in the same order. ++ */ ++- (GS_GENERIC_CLASS(NSArray, ElementT) *) ++ sortedArrayWithOptions: (NSSortOptions)options ++ usingComparator: (NSComparator)comparator; ++ ++/** ++ * Performs a binary search of the array within the specified range for the ++ * index of an object equal to obj according to cmp. ++ * If NSBinarySearchingInsertionIndex is specified, searches for the index ++ * at which such an object should be inserted. ++ */ ++- (NSUInteger) indexOfObject: (id)key ++ inSortedRange: (NSRange)range ++ options: (NSBinarySearchingOptions)options ++ usingComparator: (NSComparator)comparator; ++#endif ++#endif ++/** ++ * Accessor for subscripting. This is called by the compiler when you write ++ * code like anArray[12]. It should not be called directly. ++ */ ++- (GS_GENERIC_TYPE(ElementT)) objectAtIndexedSubscript: (NSUInteger)anIndex; ++@end ++ ++ ++@interface GS_GENERIC_CLASS(NSMutableArray, ElementT) : NSArray ++ +++ (instancetype) arrayWithCapacity: (NSUInteger)numItems; ++ ++/** ++ * Adds anObject at the end of the array, thus increasing the size of ++ * the array. The object is retained upon addition. ++ */ ++- (void) addObject: (GS_GENERIC_TYPE(ElementT))anObject; ++- (void) addObjectsFromArray: (GS_GENERIC_CLASS(NSArray, ElementT)*)otherArray; ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++- (void) exchangeObjectAtIndex: (NSUInteger)i1 ++ withObjectAtIndex: (NSUInteger)i2; ++#endif ++ ++/** ++ * Initialise the array with the specified capacity ... this ++ * should ensure that the array can have numItems added efficiently.
    ++ * Calls -init (which does nothing but maintain MacOS-X compatibility), ++ * and needs to be re-implemented in subclasses in order to have all ++ * other initialisers work. ++ */ ++- (instancetype) initWithCapacity: (NSUInteger)numItems; ++ ++/** ++ * Inserts an object into the receiver at the specified location.
    ++ * Raises an exception if given an array index which is too large.
    ++ * The size of the array increases by one.
    ++ * The object is retained by the array. ++ */ ++- (void) insertObject: (GS_GENERIC_TYPE(ElementT))anObject ++ atIndex: (NSUInteger)index; ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++- (void) insertObjects: (GS_GENERIC_CLASS(NSArray, ElementT) *)objects ++ atIndexes: (NSIndexSet *)indexes; ++#endif ++ ++/** ++ * Removes an object from the receiver at the specified location.
    ++ * The size of the array decreases by one.
    ++ * Raises an exception if given an array index which is too large.
    ++ */ ++- (void) removeObjectAtIndex: (NSUInteger)index; ++ ++- (void) removeObjectsAtIndexes: (NSIndexSet *)indexes; ++ ++/** ++ * Places an object into the receiver at the specified location.
    ++ * Raises an exception if given an array index which is too large.
    ++ * The object is retained by the array. ++ */ ++- (void) replaceObjectAtIndex: (NSUInteger)index ++ withObject: (GS_GENERIC_TYPE(ElementT))anObject; ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++- (void) replaceObjectsAtIndexes: (NSIndexSet *)indexes ++ withObjects: (GS_GENERIC_CLASS(NSArray, ElementT)*)objects; ++#endif ++ ++- (void) replaceObjectsInRange: (NSRange)aRange ++ withObjectsFromArray: (GS_GENERIC_CLASS(NSArray, ElementT)*)anArray; ++ ++- (void) replaceObjectsInRange: (NSRange)aRange ++ withObjectsFromArray: (GS_GENERIC_CLASS(NSArray, ElementT)*)anArray ++ range: (NSRange)anotherRange; ++ ++- (void) setArray: (GS_GENERIC_CLASS(NSArray, ElementT) *)otherArray; ++ ++- (void) removeAllObjects; ++- (void) removeLastObject; ++- (void) removeObject: (GS_GENERIC_TYPE(ElementT))anObject; ++- (void) removeObject: (GS_GENERIC_TYPE(ElementT))anObject ++ inRange: (NSRange)aRange; ++- (void) removeObjectIdenticalTo: (GS_GENERIC_TYPE(ElementT))anObject; ++- (void) removeObjectIdenticalTo: (GS_GENERIC_TYPE(ElementT))anObject ++ inRange: (NSRange)aRange; ++- (void) removeObjectsInArray: (GS_GENERIC_CLASS(NSArray, ElementT)*)otherArray; ++- (void) removeObjectsInRange: (NSRange)aRange; ++- (void) removeObjectsFromIndices: (NSUInteger*)indices ++ numIndices: (NSUInteger)count; ++ ++- (void) sortUsingFunction: ++ (NSComparisonResult (*)(GS_GENERIC_TYPE(ElementT), ++ GS_GENERIC_TYPE(ElementT),void*))compare ++ context: (void*)context; ++- (void) sortUsingSelector: (SEL)comparator; ++ ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) ++#if __BLOCKS__ ++/** ++ * Sorts the array using the specified comparator block. ++ */ ++- (void) sortUsingComparator: (NSComparator)comparator; ++ ++/** ++ * Sorts the array using the specified comparator block and options. ++ */ ++- (void) sortWithOptions: (NSSortOptions)options ++ usingComparator: (NSComparator)comparator; ++#endif ++#endif ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_8, GS_API_LATEST) ++/** Set method called by the compiler with array subscripting.
    ++ * Replaces the object at anIndex or, if anIndex is the length of the array, ++ * this method appends abObject to the array. ++ */ ++- (void) setObject: (GS_GENERIC_TYPE(ElementT))anObject ++atIndexedSubscript: (NSUInteger)anIndex; ++#endif ++@end ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#if !NO_GNUSTEP && !defined(GNUSTEP_BASE_INTERNAL) ++#import "../GNUstepBase/NSArray+GNUstepBase.h" ++#endif ++ ++#endif /* __NSArray_h_GNUSTEP_BASE_INCLUDE */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSEnumerator.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSEnumerator.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSEnumerator.h (.../branches/gcc-8-branch) +@@ -0,0 +1,63 @@ ++/* ++ NSEnumerator.h ++ ++ Copyright (C) 1998 Free Software Foundation, Inc. ++ ++ Author: Scott Christley ++ Date: January 1998 ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++*/ ++ ++#ifndef __NSEnumerator_h_GNUSTEP_BASE_INCLUDE ++#define __NSEnumerator_h_GNUSTEP_BASE_INCLUDE ++#import "../GNUstepBase/GSVersionMacros.h" ++ ++#import "NSObject.h" ++ ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++@class GS_GENERIC_CLASS(NSArray, ElementT); ++ ++typedef struct ++{ ++ unsigned long state; ++ __unsafe_unretained id *itemsPtr; ++ unsigned long *mutationsPtr; ++ unsigned long extra[5]; ++} NSFastEnumerationState; ++ ++@protocol NSFastEnumeration ++- (NSUInteger) countByEnumeratingWithState: (NSFastEnumerationState *)state ++ objects: (__unsafe_unretained id[])stackbuf ++ count: (NSUInteger)len; ++@end ++ ++@interface GS_GENERIC_CLASS(NSEnumerator, IterT) : NSObject ++- (GS_GENERIC_CLASS(NSArray, IterT) *) allObjects; ++- (GS_GENERIC_TYPE(IterT)) nextObject; ++@end ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* __NSEnumerator_h_GNUSTEP_BASE_INCLUDE */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSObjCRuntime.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSObjCRuntime.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSObjCRuntime.h (.../branches/gcc-8-branch) +@@ -0,0 +1,317 @@ ++/** Interface to ObjC runtime for GNUStep ++ Copyright (C) 1995, 1997, 2000 Free Software Foundation, Inc. ++ ++ Written by: Andrew Kachites McCallum ++ Date: 1995 ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ ++ AutogsdocSource: NSObjCRuntime.m ++ AutogsdocSource: NSLog.m ++ ++ */ ++ ++#ifndef __NSObjCRuntime_h_GNUSTEP_BASE_INCLUDE ++#define __NSObjCRuntime_h_GNUSTEP_BASE_INCLUDE ++ ++#ifdef __cplusplus ++#ifndef __STDC_LIMIT_MACROS ++#define __STDC_LIMIT_MACROS 1 ++#endif ++#endif ++ ++#import "../GNUstepBase/GSVersionMacros.h" ++#import "../GNUstepBase/GSConfig.h" ++#import "../GNUstepBase/GNUstep.h" ++#if __BLOCKS__ ++#import "../GNUstepBase/GSBlocks.h" ++#endif ++ ++#include ++#include ++#include ++ ++/* PA HP-UX kludge. */ ++#if defined(__hppa__) && defined(__hpux__) && !defined(PRIuPTR) ++#define PRIuPTR "lu" ++#endif ++ ++/* IRIX kludge. */ ++#if defined(__sgi) ++/* IRIX 6.5 provides all definitions, but only for C99 ++ compilations. */ ++#define PRId8 "hhd" ++#define PRIu8 "hhu" ++#if (_MIPS_SZLONG == 32) ++#define PRId64 "lld" ++#define PRIu64 "llu" ++#endif ++/* This doesn't match , which always has "lld" here, but the ++ arguments are uint64_t, int64_t, which are unsigned long, long for ++ 64-bit in . */ ++#if (_MIPS_SZLONG == 64) ++#define PRId64 "ld" ++#define PRIu64 "lu" ++#endif ++/* This doesn't match , which has "u" here, but the arguments ++ are uintptr_t, which is always unsigned long. */ ++#define PRIuPTR "lu" ++#endif ++ ++/* Solaris < 10 kludge. */ ++#if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR) ++#if defined(__arch64__) || defined (__x86_64__) ++#define PRIuPTR "lu" ++#define PRIdPTR "ld" ++#define PRIxPTR "lx" ++#else ++#define PRIuPTR "u" ++#define PRIdPTR "d" ++#define PRIxPTR "x" ++#endif ++#endif ++ ++ ++/* These typedefs must be in place before GSObjCRuntime.h is imported. ++ */ ++ ++#if !defined(NSINTEGER_DEFINED) ++typedef intptr_t NSInteger; ++typedef uintptr_t NSUInteger; ++# define NSIntegerMax INTPTR_MAX ++# define NSIntegerMin INTPTR_MIN ++# define NSUIntegerMax UINTPTR_MAX ++#endif /* !defined(NSINTEGER_DEFINED) */ ++ ++#if !defined(CGFLOAT_DEFINED) ++#if GS_SIZEOF_VOIDP == 8 ++#define CGFLOAT_IS_DBL 1 ++typedef double CGFloat; ++#define CGFLOAT_MIN DBL_MIN ++#define CGFLOAT_MAX DBL_MAX ++#else ++typedef float CGFloat; ++#define CGFLOAT_MIN FLT_MIN ++#define CGFLOAT_MAX FLT_MAX ++#endif ++#endif /* !defined(CGFLOAT_DEFINED) */ ++ ++#define NSINTEGER_DEFINED 1 ++#define CGFLOAT_DEFINED 1 ++#ifndef NS_AUTOMATED_REFCOUNT_UNAVAILABLE ++# if __has_feature(objc_arc) ++# define NS_AUTOMATED_REFCOUNT_UNAVAILABLE \ ++ __attribute__((unavailable("Not available with automatic reference counting"))) ++# else ++# define NS_AUTOMATED_REFCOUNT_UNAVAILABLE ++# endif ++#endif ++ ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++ ++/* ++ * We can have strongly typed enums in C++11 mode or when the objc_fixed_enum ++ * feature is availble. ++ */ ++#if (__has_feature(objc_fixed_enum) || (__cplusplus && (__cplusplus > 199711L) && __has_extension(cxx_strong_enums))) ++# define _GS_NAMED_ENUM(ty, name) enum name : ty name; enum name : ty ++# define _GS_ANON_ENUM(ty) enum : ty ++# if __cplusplus ++# define NS_OPTIONS(ty,name) ty name; enum : ty ++# else ++# define NS_OPTIONS(ty,name) NS_ENUM(ty,name) ++# endif ++#else // this provides less information, but works with older compilers ++# define _GS_NAMED_ENUM(ty, name) ty name; enum ++# define _GS_ANON_ENUM(ty) enum ++# define NS_OPTIONS(ty, name) NS_ENUM(ty, name) ++#endif ++// A bit of fairy dust to expand NS_ENUM to the correct variant ++#define _GS_GET_ENUM_MACRO(_first,_second,NAME,...) NAME ++/* The trick here is that placing the variadic args first will push the name ++ * that the _GS_GET_ENUM_MACRO expands to into the correct position. ++ */ ++#define NS_ENUM(...) _GS_GET_ENUM_MACRO(__VA_ARGS__,_GS_NAMED_ENUM,_GS_ANON_ENUM)(__VA_ARGS__) ++ ++/* ++ * If the compiler supports nullability qualifiers, we define the macros for ++ * non-null sections. ++ */ ++#if __has_feature(nullability) ++# define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") ++# define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") ++#else ++# define NS_ASSUME_NONNULL_BEGIN ++# define NS_ASSUME_NONNULL_END ++#endif ++ ++/* ++ * Backwards compatibility macro for instance type. ++ */ ++#if !__has_feature(objc_instancetype) ++# define instancetype id ++#endif ++ ++/* ++ * Backwards compatibility macros for Objective-C lightweight generics. ++ */ ++#if __has_feature(objc_generics) ++# define GS_GENERIC_CLASS(clz, ...) clz<__VA_ARGS__> ++# define GS_GENERIC_TYPE_F(typeRef, fallback) typeRef ++#else ++# define GS_GENERIC_CLASS(clz, ...) clz ++# define GS_GENERIC_TYPE_F(typeRef, fallback) fallback ++#endif ++#define GS_GENERIC_TYPE(typeRef) GS_GENERIC_TYPE_F(typeRef, id) ++ ++/** ++ * Backwards compatibility macro for the objc_designated_initializer attribute ++ */ ++#if __has_attribute(objc_designated_initializer) ++# define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) ++#else ++# define NS_DESIGNATED_INITIALIZER ++#endif ++ ++/** Bitfield used to specify options to control enumeration over collections. ++ */ ++typedef NS_OPTIONS(NSUInteger, NSEnumerationOptions) ++{ ++ NSEnumerationConcurrent = (1UL << 0), /** Specifies that the enumeration ++ * is concurrency-safe. Note that this does not mean that it will be ++ * carried out in a concurrent manner, only that it can be. ++ */ ++ ++ NSEnumerationReverse = (1UL << 1) /** Specifies that the enumeration should ++ * happen in the opposite of the natural order of the collection. ++ */ ++}; ++ ++ ++/** Bitfield used to specify options to control the sorting of collections. ++ */ ++typedef NS_OPTIONS(NSUInteger, NSSortOptions) ++{ ++ NSSortConcurrent = (1UL << 0), /** Specifies that the sort ++ * is concurrency-safe. Note that this does not mean that it will be ++ * carried out in a concurrent manner, only that it can be. ++ */ ++ NSSortStable = (1UL << 4) /** Specifies that the sort should keep ++ * equal objects in the same order in the collection. ++ */ ++}; ++ ++ ++#import "../GNUstepBase/GSObjCRuntime.h" ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5,GS_API_LATEST) ++GS_EXPORT NSString *NSStringFromProtocol(Protocol *aProtocol); ++GS_EXPORT Protocol *NSProtocolFromString(NSString *aProtocolName); ++#endif ++GS_EXPORT SEL NSSelectorFromString(NSString *aSelectorName); ++GS_EXPORT NSString *NSStringFromSelector(SEL aSelector); ++GS_EXPORT SEL NSSelectorFromString(NSString *aSelectorName); ++GS_EXPORT Class NSClassFromString(NSString *aClassName); ++GS_EXPORT NSString *NSStringFromClass(Class aClass); ++GS_EXPORT const char *NSGetSizeAndAlignment(const char *typePtr, ++ NSUInteger *sizep, NSUInteger *alignp); ++ ++#if OS_API_VERSION(GS_API_NONE, GS_API_NONE) ++/* Logging */ ++/** ++ * OpenStep spec states that log messages go to stderr, but just in case ++ * someone wants them to go somewhere else, they can implement a function ++ * like this and assign a pointer to it to _NSLog_printf_handler. ++ */ ++typedef void NSLog_printf_handler (NSString* message); ++GS_EXPORT NSLog_printf_handler *_NSLog_printf_handler; ++GS_EXPORT int _NSLogDescriptor; ++@class NSRecursiveLock; ++GS_EXPORT NSRecursiveLock *GSLogLock(void); ++#endif ++ ++GS_EXPORT void NSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2); ++GS_EXPORT void NSLogv(NSString *format, va_list args) NS_FORMAT_FUNCTION(1,0); ++ ++#ifndef YES ++#define YES 1 ++#endif ++#ifndef NO ++#define NO 0 ++#endif ++#ifndef nil ++#define nil 0 ++#endif ++ ++/** ++ * Contains values NSOrderedSame, NSOrderedAscending ++ * NSOrderedDescending, for left hand side equals, less than, or ++ * greater than right hand side. ++ */ ++typedef NS_ENUM(NSInteger, NSComparisonResult) ++{ ++ NSOrderedAscending = (NSInteger)-1, NSOrderedSame, NSOrderedDescending ++}; ++ ++enum {NSNotFound = NSIntegerMax}; ++ ++#if __BLOCKS__ ++DEFINE_BLOCK_TYPE(NSComparator, NSComparisonResult, id, id); ++#endif ++ ++/** ++ * Declare the foundation export macro as an alias to GS_EXPORT ++ */ ++#define FOUNDATION_EXPORT GS_EXPORT ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++/** ++ * Declare Apple availability macros for compatibility purposes as no-ops. ++ */ ++#define NS_CLASS_AVAILABLE(...) ++#define NS_AVAILABLE(...) ++#define NS_AVAILABLE_MAC(...) ++#define NS_DEPRECATED(...) ++#define NS_DEPRECATED_MAC(...) ++#define NS_ENUM_AVAILABLE(...) ++#define NS_ENUM_AVAILABLE_MAC(...) ++#define NS_ENUM_DEPRECATED(...) ++#define NS_ENUM_DEPRECATED_MAC(...) ++#define NS_CLASS_AVAILABLE(...) ++#define NS_CLASS_DEPRECATED(...) ++#define NS_CLASS_AVAILABLE_MAC(...) ++#define NS_CLASS_DEPRECATED_MAC(...) ++#define NS_UNAVAILABLE ++ ++/* Define root class NS macro */ ++#ifndef NS_ROOT_CLASS ++#if __has_attribute(objc_root_class) ++#define NS_ROOT_CLASS __attribute__((objc_root_class)) ++#else ++#define NS_ROOT_CLASS ++#endif ++#endif ++ ++#endif /* __NSObjCRuntime_h_GNUSTEP_BASE_INCLUDE */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSAutoreleasePool.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSAutoreleasePool.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSAutoreleasePool.h (.../branches/gcc-8-branch) +@@ -0,0 +1,333 @@ ++/* Interface for NSAutoreleasePool for GNUStep ++ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. ++ ++ Written by: Andrew Kachites McCallum ++ Date: 1995 ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ */ ++ ++#ifndef __NSAutoreleasePool_h_GNUSTEP_BASE_INCLUDE ++#define __NSAutoreleasePool_h_GNUSTEP_BASE_INCLUDE ++#import "../GNUstepBase/GSVersionMacros.h" ++ ++#import "NSObject.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++@class NSAutoreleasePool; ++@class NSThread; ++ ++ ++/** ++ * Each thread has its own copy of these variables. ++ ++{ ++ NSAutoreleasePool *current_pool; // current pool for thread ++ unsigned total_objects_count; // total #/autoreleased objects over thread's lifetime ++ id *pool_cache; // cache of previously-allocated pools, ++ int pool_cache_size; // used internally for recycling ++ int pool_cache_count; ++} ++ ++*/ ++typedef struct autorelease_thread_vars ++{ ++ /* The current, default NSAutoreleasePool for the calling thread; ++ the one that will hold objects that are arguments to ++ [NSAutoreleasePool +addObject:]. */ ++ __unsafe_unretained NSAutoreleasePool *current_pool; ++ ++ /* The total number of objects autoreleased since the thread was ++ started, or since -resetTotalAutoreleasedObjects was called ++ in this thread. (if compiled in) */ ++ unsigned total_objects_count; ++ ++ /* A cache of NSAutoreleasePool's already alloc'ed. Caching old pools ++ instead of deallocating and re-allocating them will save time. */ ++ __unsafe_unretained id *pool_cache; ++ int pool_cache_size; ++ int pool_cache_count; ++} thread_vars_struct; ++ ++/* Initialize an autorelease_thread_vars structure for a new thread. ++ This function is called in NSThread each time an NSThread is created. ++ TV should be of type `struct autorelease_thread_vars *' */ ++#define init_autorelease_thread_vars(TV) \ ++memset (TV, 0, sizeof (__typeof__ (*TV))) ++ ++ ++ ++/** ++ * Each pool holds its objects-to-be-released in a linked-list of ++ these structures. ++ ++{ ++ struct autorelease_array_list *next; ++ unsigned size; ++ unsigned count; ++ id objects[0]; ++} ++ ++ */ ++typedef struct autorelease_array_list ++{ ++ struct autorelease_array_list *next; ++ unsigned size; ++ unsigned count; ++ __unsafe_unretained id objects[0]; ++} array_list_struct; ++ ++ ++ ++/** ++ *

    ++ * The standard OpenStep system of memory management employs retain counts. ++ * When an object is created, it has a retain count of 1. When an object ++ * is retained, the retain count is incremented. When it is released the ++ * retain count is decremented, and when the retain count goes to zero the ++ * object gets deallocated. ++ *

    ++ *

    ++ * A simple retain/release mechanism has problems with passing objects ++ * from one scope to another, ++ * so it's augmented with autorelease pools. You can use the ++ * AUTORELEASE() macro to call the [NSObject-autorelease] ++ * method, which adds an object to the current autorelease pool by ++ * calling [NSAutoreleasePool+addObject:].
    ++ * An autorelease pool simply maintains a reference to each object ++ * added to it, and for each addition, the autorelease pool will ++ * call the [NSObject-release] method of the object when the pool ++ * is released. So doing an AUTORELEASE() is just the same as ++ * doing a RELEASE(), but deferred until the current autorelease ++ * pool is deallocated. ++ *

    ++ *

    ++ * The NSAutoreleasePool class maintains a separate stack of ++ * autorelease pools objects in each thread. ++ *

    ++ *

    ++ * When an autorelease pool is created, it is automatically ++ * added to the stack of pools in the thread. ++ *

    ++ *

    ++ * When a pool is destroyed, it (and any pool later in ++ * the stack) is removed from the stack. ++ *

    ++ *

    ++ * This mechanism provides a simple but controllable and reasonably ++ * efficient way of managing temporary objects. An object can be ++ * autoreleased and then passed around and used until the topmost ++ * pool in the stack is destroyed. ++ *

    ++ *

    ++ * Most methods return objects which are either owned by autorelease ++ * pools or by the receiver of the method, so the lifetime of the ++ * returned object can be assumed to be the shorter of the lifetime ++ * of the current autorelease pool, or that of the receiver on which ++ * the method was called.
    ++ * The exceptions to this are those object returned by - ++ *

    ++ * ++ * [NSObject+alloc], [NSObject+allocWithZone:] ++ * ++ * Methods whose names begin with alloc return an uninitialised ++ * object, owned by the caller. ++ * ++ * [NSObject-init] ++ * ++ * Methods whose names begin with init return an initialised ++ * version of the receiving object, owned by the caller.
    ++ * NB. The returned object may not actually be the same as the ++ * receiver ... sometimes an init method releases the original ++ * receiver and returns an alternative. ++ *
    ++ * [NSObject+new] ++ * ++ * Methods whose names begin with new combine the effects of ++ * allocation and initialisation. ++ * ++ * [NSObject-copy], [(NSCopying)-copyWithZone:] ++ * ++ * Methods whose names begin with copy create a copy of the receiver ++ * which is owned by the caller. ++ * ++ * ++ * [NSObject-mutableCopy], [(NSMutableCopying)-mutableCopyWithZone:] ++ * ++ * ++ * Methods whose names begin with mutableCopy create a copy of the receiver ++ * which is owned by the caller. ++ * ++ *
    ++ */ ++NS_AUTOMATED_REFCOUNT_UNAVAILABLE ++@interface NSAutoreleasePool : NSObject ++{ ++#if GS_EXPOSE(NSAutoreleasePool) && !__has_feature(objc_arc) ++ /* For re-setting the current pool when we are dealloc'ed. */ ++ NSAutoreleasePool *_parent; ++ /* This pointer to our child pool is necessary for co-existing ++ with exceptions. */ ++ NSAutoreleasePool *_child; ++ /* A collection of the objects to be released. */ ++ struct autorelease_array_list *_released; ++ struct autorelease_array_list *_released_head; ++ /* The total number of objects autoreleased in this pool. */ ++ unsigned _released_count; ++ /* The method to add an object to this pool */ ++ void (*_addImp)(id, SEL, id); ++#endif ++#if GS_NONFRAGILE ++#else ++ /* Pointer to private additional data used to avoid breaking ABI ++ * when we don't have the non-fragile ABI available. ++ * Use this mechanism rather than changing the instance variable ++ * layout (see Source/GSInternal.h for details). ++ */ ++ @private id _internal GS_UNUSED_IVAR; ++#endif ++} ++ ++/** ++ * Adds anObj to the current autorelease pool.
    ++ * If there is no autorelease pool in the thread, ++ * a warning is logged and the object is leaked (ie it will not be released). ++ */ +++ (void) addObject: (id)anObj; ++ ++/** ++ * Allocate and return an autorelease pool instance.
    ++ * If there is an already-allocated NSAutoreleasePool available, ++ * save time by just returning that, rather than allocating a new one.
    ++ * The pool instance becomes the current autorelease pool for this thread. ++ */ +++ (id) allocWithZone: (NSZone*)zone; ++ ++/** ++ * Adds anObj to this autorelease pool. ++ */ ++- (void) addObject: (id)anObj; ++ ++/** ++ * Raises an exception - pools should not be autoreleased. ++ */ ++- (id) autorelease; ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) ++/** ++ * Intended to trigger a garbage collection run (if needed) when called in ++ * a garbage collected environment.
    ++ * In a non-garbage collected environment, this method implements the ++ * undocumented MacOS-X behavior, and releases the receiver. ++ */ ++- (void) drain; ++#endif ++ ++/** ++ * Destroys the receiver (calls -dealloc). ++ */ ++- (oneway void) release; ++ ++/** ++ * Raises an exception ... pools should not be retained. ++ */ ++- (id) retain; ++ ++#if OS_API_VERSION(GS_API_NONE, GS_API_NONE) ++/** ++ *

    ++ * Counts the number of times that the specified object occurs ++ * in autorelease pools in the current thread. ++ *

    ++ *

    ++ * This method is slow and should probably only be ++ * used for debugging purposes. ++ *

    ++ */ +++ (unsigned) autoreleaseCountForObject: (id)anObject; ++ ++/** ++ * Return the currently active autorelease pool. ++ */ +++ (id) currentPool; ++ ++/** ++ *

    ++ * Specifies whether objects contained in autorelease pools are to ++ * be released when the pools are deallocated (by default YES). ++ *

    ++ *

    ++ * You can set this to NO for debugging purposes. ++ *

    ++ */ +++ (void) enableRelease: (BOOL)enable; ++ ++/** ++ *

    ++ * When autorelease pools are deallocated, the memory they used ++ * is retained in a cache for re-use so that new polls can be ++ * created very quickly. ++ *

    ++ *

    ++ * This method may be used to empty that cache, ensuring that ++ * the minimum memory is used by the application. ++ *

    ++ */ +++ (void) freeCache; ++ ++/** ++ *

    ++ * Specifies a limit to the number of objects that may be added to ++ * an autorelease pool. When this limit is reached an exception is ++ * raised. ++ *

    ++ *

    ++ * You can set this to a smallish value to catch problems with code ++ * that autoreleases too many objects to operate efficiently. ++ *

    ++ *

    ++ * Default value is maxint. ++ *

    ++ */ +++ (void) setPoolCountThreshold: (unsigned)c; ++ ++/** ++ * Return the number of objects in this pool. ++ */ ++- (unsigned) autoreleaseCount; ++ ++/** ++ * Empties the current pool by releasing all the autoreleased objects ++ * in it. Also destroys any child pools (ones created after ++ * the receiver in the same thread) causing any objects in those pools ++ * to be released.
    ++ * This is a low cost (efficient) method which may be used to get rid of ++ * autoreleased objects in the pool, but carry on using the pool. ++ */ ++- (void) emptyPool; ++#endif ++@end ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* __NSAutoreleasePool_h_GNUSTEP_BASE_INCLUDE */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSObject.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSObject.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSObject.h (.../branches/gcc-8-branch) +@@ -0,0 +1,594 @@ ++/**Interface for NSObject for GNUStep ++ Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc. ++ ++ Written by: Andrew Kachites McCallum ++ Date: 1995 ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ ++ AutogsdocSource: NSObject.m ++ */ ++ ++#ifndef __NSObject_h_GNUSTEP_BASE_INCLUDE ++#define __NSObject_h_GNUSTEP_BASE_INCLUDE ++ ++#import "NSObjCRuntime.h" ++#import ++#import "NSZone.h" ++ ++#ifdef GS_WITH_GC ++#undef GS_WITH_GC ++#endif ++#define GS_WITH_GC 0 ++ ++#import "../GNUstepBase/GNUstep.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++@class NSArchiver; ++@class NSArray; ++@class NSCoder; ++@class NSDictionary; ++@class NSPortCoder; ++@class NSMethodSignature; ++@class NSMutableString; ++@class NSRecursiveLock; ++@class NSString; ++@class NSInvocation; ++@class Protocol; ++ ++/** ++ * The NSObject protocol describes a minimal set of methods that all ++ * objects are expected to support. You should be able to send any ++ * of the messages listed in this protocol to an object, and be safe ++ * in assuming that the receiver can handle it. ++ */ ++@protocol NSObject ++/** ++ * Returns the class of the receiver. If the receiver is a proxy, then this ++ * may return the class of the proxy target. Use -isProxy to determine whether ++ * the receiver is a proxy. If you wish to find the real class of the ++ * receiver, ignoring proxies, then use object_getClass(). ++ */ ++- (Class) class; ++/** ++ * Returns the superclass of receiver's class. If the receiver is a proxy, ++ * then this may return the class of the proxy target. Use -isProxy to ++ * determine whether the receiver is a proxy. If you wish to find the real ++ * superclass of the receiver's class, ignoring proxies, then use ++ * class_getSuperclass(object_getClass()). ++ */ ++- (Class) superclass; ++/** ++ * Returns whether the receiver is equal to the argument. Defining equality is ++ * complex, so be careful when implementing this method. Collections such as ++ * NSSet depend on the behaviour of this method. In particular, this method ++ * must be commutative, so for any objects a and b: ++ * ++ * [a isEqual: b] == [b isEqual: a] ++ * ++ * This means that you must be very careful when returning YES if the argument ++ * is of another class. For example, if you define a number class that returns ++ * YES if the argument is a string representation of the number, then this will ++ * break because the string will not recognise your object as being equal to ++ * itself. ++ * ++ * If two objects are equal, then they must have the same hash value, however ++ * equal hash values do not imply equality. ++ */ ++- (BOOL) isEqual: (id)anObject; ++/** ++ * Returns YES if the receiver is an instance of the class, an instance of the ++ * subclass, or (in the case of proxies), an instance of something that can be ++ * treated as an instance of the class. ++ */ ++- (BOOL) isKindOfClass: (Class)aClass; ++/** ++ * Returns YES if the receiver is an instance of the class or (in the case of ++ * proxies), an instance of something that can be treated as an instance of the ++ * class. ++ * ++ * Calling this method is rarely the correct thing to do. In most cases, a ++ * subclass can be substituted for a superclass, so you should never need to ++ * check that an object is really an instance of a specific class and not a ++ * subclass. ++ */ ++- (BOOL) isMemberOfClass: (Class)aClass; ++/** ++ * Returns YES if the receiver is a proxy, NO otherwise. The default ++ * implementation of this method in NSObject returns NO, while the ++ * implementation in NSProxy returns YES. ++ */ ++- (BOOL) isProxy; ++/** ++ * Returns a hash value for the object. All objects that are equal *MUST* ++ * return the same hash value. For efficient storage in sets, or as keys in ++ * dictionaries, different objects should return hashes spread evenly over the ++ * range of an integer. ++ * ++ * An object may not return different values from this method after being ++ * stored in a collection. This typically means that ether the hash value must ++ * be constant after the object's creation, or that the object may not be ++ * modified while stored in an unordered collection. ++ */ ++- (NSUInteger) hash; ++/** ++ * Returns the receiver. In a proxy, this may (but is not required to) return ++ * the proxied object. ++ */ ++- (id) self; ++/** ++ * Performs the specified selector. The selector must correspond to a method ++ * that takes no arguments. ++ */ ++- (id) performSelector: (SEL)aSelector; ++/** ++ * Performs the specified selector, with the object as the argument. This ++ * method does not perform any automatic unboxing, so the selector must ++ * correspond to a method that takes one object argument. ++ */ ++- (id) performSelector: (SEL)aSelector ++ withObject: (id)anObject; ++/** ++ * Performs the specified selector, with the objects as the arguments. This ++ * method does not perform any automatic unboxing, so the selector must ++ * correspond to a method that takes two object arguments. ++ */ ++- (id) performSelector: (SEL)aSelector ++ withObject: (id)object1 ++ withObject: (id)object2; ++/** ++ * Returns YES if the object can respond to messages with the specified ++ * selector. The default implementation in NSObject returns YES if the ++ * receiver has a method corresponding to the method, but other classes may ++ * return YES if they can respond to a selector using one of the various ++ * forwarding mechanisms. ++ */ ++- (BOOL) respondsToSelector: (SEL)aSelector; ++/** ++ * Returns YES if the receiver conforms to the specified protocol. ++ */ ++- (BOOL) conformsToProtocol: (Protocol*)aProtocol; ++/** ++ * Increments the reference count of the object and returns the receiver. In ++ * garbage collected mode, this method does nothing. In automated reference ++ * counting mode, you may neither implement this method nor call it directly. ++ */ ++- (id) retain NS_AUTOMATED_REFCOUNT_UNAVAILABLE; ++/** ++ * Decrements the reference count of the object and destroys if it there are no ++ * remaining references. In garbage collected mode, this method does nothing. ++ * In automated reference counting mode, you may neither implement this method ++ * nor call it directly. ++ */ ++- (oneway void) release NS_AUTOMATED_REFCOUNT_UNAVAILABLE; ++/** ++ * Performs a deferred -release operation. The object's reference count is ++ * decremented at the end of the scope of the current autorelease pool, ++ * identified either by a -drain message sent to the current NSAutoreleasePool ++ * instance, or in more recent versions of Objective-C by the end of an ++ * @autorelease_pool scope. ++ * ++ * In garbage collected mode, this method does nothing. In automated reference ++ * counting mode, you may neither implement this method nor call it directly. ++ */ ++- (id) autorelease NS_AUTOMATED_REFCOUNT_UNAVAILABLE; ++/** ++ * Returns the current retain count of an object. This does not include the ++ * result of any pending autorelease operations. ++ * ++ * Code that relies on this method returning a sane value is broken. For ++ * singletons, it may return NSUIntegerMax. Even when it is tracking a retain ++ * count, it will not include on-stack pointers in manual retain/release mode, ++ * pointers marked as __unsafe_unretain or __weak in ARC mode, or pending ++ * autorelease operations. Its value is therefore largely meaningless. It can ++ * occasionally be useful for debugging. ++ */ ++- (NSUInteger) retainCount NS_AUTOMATED_REFCOUNT_UNAVAILABLE; ++/** ++ * Returns the description of the object. This is used by the %@ format ++ * specifier in strings. ++ */ ++- (NSString*) description; ++/** ++ * Returns the zone of the object. ++ */ ++- (NSZone*) zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE; ++@end ++ ++/** ++ * This protocol must be adopted by any class wishing to support copying - ++ * ie where instances of the class should be able to create new instances ++ * which are copies of the original and, where a class has mutable and ++ * immutable versions, where the copies are immutable. ++ */ ++@protocol NSCopying ++/** ++ * Called by [NSObject-copy] passing NSDefaultMallocZone() as zone.
    ++ * This method returns a copy of the receiver and, where the receiver is a ++ * mutable variant of a class which has an immutable partner class, the ++ * object returned is an instance of that immutable class.
    ++ * The new object is not autoreleased, and is considered to be ++ * 'owned' by the calling code ... which is therefore responsible for ++ * releasing it.
    ++ * In the case where the receiver is an instance of a container class, ++ * it is undefined whether contained objects are merely retained in the ++ * new copy, or are themselves copied, or whether some other mechanism ++ * entirely is used. ++ */ ++- (id) copyWithZone: (NSZone*)zone; ++@end ++ ++/** ++ * This protocol must be adopted by any class wishing to support ++ * mutable copying - ie where instances of the class should be able ++ * to create mutable copies of themselves. ++ */ ++@protocol NSMutableCopying ++/** ++ * Called by [NSObject-mutableCopy] passing NSDefaultMallocZone() as zone.
    ++ * This method returns a copy of the receiver and, where the receiver is an ++ * immutable variant of a class which has a mutable partner class, the ++ * object returned is an instance of that mutable class. ++ * The new object is not autoreleased, and is considered to be ++ * 'owned' by the calling code ... which is therefore responsible for ++ * releasing it.
    ++ * In the case where the receiver is an instance of a container class, ++ * it is undefined whether contained objects are merely retained in the ++ * new copy, or are themselves copied, or whether some other mechanism ++ * entirely is used. ++ */ ++- (id) mutableCopyWithZone: (NSZone*)zone; ++@end ++ ++/** ++ * This protocol must be adopted by any class wishing to support ++ * saving and restoring instances to an archive, or copying them ++ * to remote processes via the Distributed Objects mechanism. ++ */ ++@protocol NSCoding ++ ++/** ++ * Called when it is time for receiver to be serialized for writing to an ++ * archive or network connection. Receiver should record all of its instance ++ * variables using methods on aCoder. See documentation for [NSCoder], ++ * [NSArchiver], [NSKeyedArchiver], and/or [NSPortCoder] for more information. ++ */ ++- (void) encodeWithCoder: (NSCoder*)aCoder; ++ ++/** ++ * Called on a freshly allocated receiver when it is time to reconstitute from ++ * serialized bytes in an archive or from a network connection. Receiver ++ * should load all of its instance variables using methods on aCoder. See ++ * documentation for [NSCoder], [NSUnarchiver], [NSKeyedUnarchiver], and/or ++ * [NSPortCoder] for more information. ++ */ ++- (id) initWithCoder: (NSCoder*)aDecoder; ++@end ++ ++@protocol NSSecureCoding +++ (BOOL)supportsSecureCoding; ++@end ++ ++ ++GS_ROOT_CLASS @interface NSObject ++{ ++ /** ++ * Points to instance's class. Used by runtime to access method ++ * implementations, etc.. Set in +alloc, Unlike other instance variables, ++ * which are cleared there. ++ */ ++ Class isa; ++} ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++/** On a system which performs garbage collection, you should implement ++ * this method to execute code when the receiver is collected.
    ++ * You must not call this method yourself (except when a subclass ++ * calls the superclass method within its own implementation). ++ */ ++- (void) finalize; ++#endif ++ ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++- (NSString*) className; ++#endif ++ +++ (id) allocWithZone: (NSZone*)z; +++ (id) alloc; +++ (Class) class; ++ ++/** ++ * This method is automatically invoked on any class which implements it ++ * when the class is loaded into the runtime.
    ++ * It is also invoked on any category where the method is implemented ++ * when that category is loaded into the runtime.
    ++ * The +load method is called directly by the runtime and you should never ++ * send a +load message to a class yourself.
    ++ * This method is called before the +initialize message is sent ++ * to the class, so you cannot depend on class initialisation having been ++ * performed, or upon other classes existing (apart from superclasses of ++ * the receiver, since +load is called on superclasses before it is called ++ * on their subclasses).
    ++ * As a gross generalisation, it is safe to use C code, including ++ * most ObjectiveC runtime functions within +load, but attempting to send ++ * messages to ObjectiveC objects is likely to fail.
    ++ * In GNUstep, this method is implemented for NSObject to perform some ++ * initialisation for the base library.
    ++ * If you implement +load for a class, don't call [super load] in your ++ * implementation. ++ */ +++ (void) load; ++ ++/** ++ * This message is automatically sent to a class by the runtime. It is ++ * sent once for each class, just before the class is used for the first ++ * time (excluding any automatic call to +load by the runtime).
    ++ * The message is sent in a thread-safe manner ... other threads may not ++ * call methods of the class until +initialize has finished executing.
    ++ * If the class has a superclass, its implementation of +initialize is ++ * called first.
    ++ * If the class does not implement +initialize then the implementation ++ * in the closest superclass may be called. This means that +initialize may ++ * be called more than once, and the recommended way to handle this by ++ * using the ++ * ++ * if (self == [classname class]) ++ * ++ * conditional to check whether the method is being called for a subclass.
    ++ * You should never call +initialize yourself ... let the runtime do it.
    ++ * You can implement +initialize in your own class if you need to. ++ * NSObject's implementation handles essential root object and base ++ * library initialization.
    ++ * It should be safe to call [super initialize] in your implementation ++ * of +initialize. ++ */ +++ (void) initialize; +++ (IMP) instanceMethodForSelector: (SEL)aSelector; +++ (NSMethodSignature*) instanceMethodSignatureForSelector: (SEL)aSelector; +++ (BOOL) instancesRespondToSelector: (SEL)aSelector; +++ (BOOL) isSubclassOfClass: (Class)aClass; +++ (id) new; +++ (void) poseAsClass: (Class)aClassObject; +++ (id) setVersion: (NSInteger)aVersion; +++ (NSInteger) version; ++ ++- (id) awakeAfterUsingCoder: (NSCoder*)aDecoder; ++- (Class) classForArchiver; ++- (Class) classForCoder; ++- (id) copy; ++- (void) dealloc; ++- (void) doesNotRecognizeSelector: (SEL)aSelector; ++- (void) forwardInvocation: (NSInvocation*)anInvocation; ++- (id) init; ++- (IMP) methodForSelector: (SEL)aSelector; ++- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector; ++- (id) mutableCopy; ++- (id) replacementObjectForArchiver: (NSArchiver*)anArchiver; ++- (id) replacementObjectForCoder: (NSCoder*)anEncoder; ++- (Class) superclass; ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) ++/** ++ * This method will be called when attempting to send a message a class that ++ * does not understand it. The class may install a new method for the given ++ * selector and return YES, otherwise it should return NO. ++ * ++ * Note: This method is only reliable when using the GNUstep runtime. If you ++ * require compatibility with the GCC runtime, you must also implement ++ * -forwardInvocation: with equivalent semantics. This will be considerably ++ * slower, but more portable. ++ */ +++ (BOOL) resolveClassMethod: (SEL)name; ++ ++/** ++ * This method will be called when attempting to send a message an instance ++ * that does not understand it. The class may install a new method for the ++ * given selector and return YES, otherwise it should return NO. ++ * ++ * Note: This method is only reliable when using the GNUstep runtime. If you ++ * require compatibility with the GCC runtime, you must also implement ++ * -forwardInvocation: with equivalent semantics. This will be considerably ++ * slower, but more portable. ++ */ +++ (BOOL) resolveInstanceMethod: (SEL)name; ++#endif ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) ++/** ++ * Returns an auto-accessing proxy for the given object. This proxy sends a ++ * -beginContentAccess message to the receiver when it is created and an ++ * -endContentAccess message when it is destroyed. This prevents an object ++ * that implements the NSDiscardableContent protocol from having its contents ++ * discarded for as long as the proxy exists. ++ * ++ * On systems using the GNUstep runtime, messages send to the proxy will be ++ * slightly slower than direct messages. With the GCC runtime, they will be ++ * approximately two orders of magnitude slower. The GNUstep runtime, ++ * therefore, is strongly recommended for code calling this method. ++ */ ++- (id) autoContentAccessingProxy; ++ ++/** ++ * If an object does not understand a message, it may delegate it to another ++ * object. Returning nil indicates that forwarding should not take place. The ++ * default implementation of this returns nil, but care should be taken when ++ * subclassing NSObject subclasses and overriding this method that ++ * the superclass implementation is called if returning nil. ++ * ++ * Note: This method is only reliable when using the GNUstep runtime and code ++ * compiled with clang. If you require compatibility with GCC and the GCC ++ * runtime, you must also implement -forwardInvocation: with equivalent ++ * semantics. This will be considerably slower, but more portable. ++ */ ++- (id) forwardingTargetForSelector: (SEL)aSelector; ++ ++#endif ++@end ++ ++/** ++ * Used to allocate memory to hold an object, and initialise the ++ * class of the object to be aClass etc. The allocated memory will ++ * be extraBytes larger than the space actually needed to hold the ++ * instance variables of the object.
    ++ * This function is used by the [NSObject+allocWithZone:] method. ++ */ ++GS_EXPORT id ++NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); ++ ++/** ++ * Used to release the memory used by an object.
    ++ * This function is used by the [NSObject-dealloc] method. ++ */ ++GS_EXPORT void ++NSDeallocateObject(id anObject); ++ ++/** ++ * Used to copy anObject. This makes a bitwise copy of anObject to ++ * memory allocated from zone. The allocated memory will be extraBytes ++ * longer than that necessary to actually store the instance variables ++ * of the copied object.
    ++ */ ++GS_EXPORT NSObject * ++NSCopyObject(NSObject *anObject, NSUInteger extraBytes, NSZone *zone); ++ ++/** ++ * Returns a flag to indicate whether anObject should be retained or ++ * copied in order to make a copy in the specified zone.
    ++ * Basically, this tests to see if anObject was allocated from ++ * requestedZone and returns YES if it was. ++ */ ++GS_EXPORT BOOL ++NSShouldRetainWithZone(NSObject *anObject, NSZone *requestedZone); ++ ++GS_EXPORT BOOL ++NSDecrementExtraRefCountWasZero(id anObject); ++ ++GS_EXPORT NSUInteger ++NSExtraRefCount(id anObject); ++ ++GS_EXPORT void ++NSIncrementExtraRefCount(id anObject); ++ ++#if OS_API_VERSION(GS_API_NONE, GS_API_NONE) ++ ++/** Global lock to be used by classes when operating on any global ++ data that invoke other methods which also access global; thus, ++ creating the potential for deadlock. */ ++GS_EXPORT NSRecursiveLock *gnustep_global_lock; ++ ++@interface NSObject (NEXTSTEP) ++- (id) error:(const char *)aString, ...; ++/* - (const char *) name; ++ Removed because OpenStep has -(NSString*)name; */ ++@end ++ ++#if GS_API_VERSION(GS_API_NONE, 011700) ++@interface NSObject (GNUstep) +++ (void) enableDoubleReleaseCheck: (BOOL)enable; ++@end ++#endif ++ ++#endif ++ ++#import "NSDate.h" ++/** ++ * Declares some methods for sending messages to self after a fixed delay. ++ * (These methods are in OpenStep and OS X.) ++ */ ++@interface NSObject (TimedPerformers) ++ ++/** ++ * Cancels any perform operations set up for the specified target ++ * in the current run loop. ++ */ +++ (void) cancelPreviousPerformRequestsWithTarget: (id)obj; ++ ++/** ++ * Cancels any perform operations set up for the specified target ++ * in the current loop, but only if the value of aSelector and argument ++ * with which the performs were set up match those supplied.
    ++ * Matching of the argument may be either by pointer equality or by ++ * use of the [NSObject-isEqual:] method. ++ */ +++ (void) cancelPreviousPerformRequestsWithTarget: (id)obj ++ selector: (SEL)s ++ object: (id)arg; ++/** ++ * Sets given message to be sent to this instance after given delay, ++ * in any run loop mode. See [NSRunLoop]. ++ */ ++- (void) performSelector: (SEL)s ++ withObject: (id)arg ++ afterDelay: (NSTimeInterval)seconds; ++ ++/** ++ * Sets given message to be sent to this instance after given delay, ++ * in given run loop modes. See [NSRunLoop]. ++ */ ++- (void) performSelector: (SEL)s ++ withObject: (id)arg ++ afterDelay: (NSTimeInterval)seconds ++ inModes: (NSArray*)modes; ++@end ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) ++/** ++ * The NSDiscardableContent protocol is used by objects which encapsulate data ++ * which may be discarded if resource constraints are exceeded. These ++ * constraints are typically, but not always, related memory. ++ */ ++@protocol NSDiscardableContent ++ ++/** ++ * This method is called before any access to the object. It returns YES if ++ * the object's content is still valid. The caller must call -endContentAccess ++ * once for every call to -beginContentAccess; ++ */ ++- (BOOL) beginContentAccess; ++ ++/** ++ * Discards the contents of the object if it is not currently being edited. ++ */ ++- (void) discardContentIfPossible; ++ ++/** ++ * This method indicates that the caller has finished accessing the contents of ++ * the object adopting this protocol. Every call to -beginContentAccess must ++ * be be paired with a call to this method after the caller has finished ++ * accessing the contents. ++ */ ++- (void) endContentAccess; ++ ++/** ++ * Returns YES if the contents of the object have been discarded, either via a ++ * call to -discardContentIfPossible while the object is not in use, or by some ++ * implementation dependent mechanism. ++ */ ++- (BOOL) isContentDiscarded; ++@end ++#endif ++#if defined(__cplusplus) ++} ++#endif ++ ++#if !NO_GNUSTEP && !defined(GNUSTEP_BASE_INTERNAL) ++#import "../GNUstepBase/NSObject+GNUstepBase.h" ++#endif ++ ++#endif /* __NSObject_h_GNUSTEP_BASE_INCLUDE */ +Index: gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSString.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSString.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/GNUStep/Foundation/NSString.h (.../branches/gcc-8-branch) +@@ -0,0 +1,977 @@ ++/* Interface for NSString for GNUstep ++ Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. ++ ++ Written by: Andrew Kachites McCallum ++ Date: 1995 ++ ++ This file is part of the GNUstep Base Library. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free ++ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02111 USA. ++ */ ++ ++/** ++ ++ Portable path handling ++

    Portable path handling (across both unix-like and mswindows operating ++ systems) requires some care. A modern operating system uses the concept ++ of a single root to the filesystem, but mswindows has multiple filesystems ++ with no common root, so code must be aware of this. There is also the ++ more minor issue that windows often uses a backslash as a separator between ++ the components of a path and unix-like systems always use forward slash.
    ++ On windows there is also the issue that two styles of path are used, ++ most commonly with a drive letter and a path on that drive ++ (eg. 'C:\directory\file') but also UNC paths ++ (eg. '//host/share/directory/file') so path handling functions must deal ++ with both formats. ++

    ++

    GNUstep has three path handling modes, 'gnustep', 'unix', and 'windows'. ++ The mode defaults to 'gnustep' but may be set using the GSPathHandling() ++ function.
    ++ You should probably stick to using the default 'gnustep' mode in which the ++ path handling methods cope with both 'unix' and 'windows' style paths in ++ portable and tolerant manner:
    ++ Paths are read in literally so they can be in the native format provided ++ by the operating system or in a non-native format. See ++ [NSFileManager-stringWithFileSystemRepresentation:length:].
    ++ Paths are written out using the native format of the system the application ++ is running on (eg on windows slashes are converted to backslashes). ++ See [NSFileManager-fileSystemRepresentationWithPath:].
    ++ The path handling methods accept either a forward or backward slash as a ++ path separator when parsing any path.
    ++ Unless operating in 'unix' mode, a leading letter followed by a colon is ++ considered the start of a windows style path (the drive specifier), and a ++ path beginning with something of the form '//host/share/' is considered ++ the start of a UNC style path.
    ++ The path handling methods add forward slashes when building new paths ++ internally or when standardising paths, so those path strings provide ++ a portable representation (as long as they are relative paths, not including ++ system specific roots).
    ++ An important case to note is that on windows a path which looks at first ++ glance like an absolute path may actually be a relative one.
    ++ 'C:file' is a relative path because it specifies a file on the C drive ++ but does not say what directory it is in.
    ++Similarly, '/dir/file' is a relative path because it specifies the full ++location fo a file on a drive, but does not specify which drive it is on. ++

    ++

    As a consequence of this path handling, you are able to work completely ++portably using relative paths (adding components, extensions and ++relative paths to a pth, or removing components, extensions and relative ++paths from a path etc), and when you save paths as strings in files ++which may be transferred to another platform, you should save a relative ++path.
    ++When you need to know absolute paths of various points in the filesystem, ++you can use various path utility functions to obtain those absolute paths. ++For instance, instead of saving an absolute path to a file, you might want ++to save a path relative to a user's home directory. You could do that by ++calling NSHomeDirectory() to get the home directory, and only saving the ++part of the full path after that prefix. ++

    ++
    ++ */ ++ ++#ifndef __NSString_h_GNUSTEP_BASE_INCLUDE ++#define __NSString_h_GNUSTEP_BASE_INCLUDE ++#import "../GNUstepBase/GSVersionMacros.h" ++ ++#import "NSObject.h" ++#import "NSRange.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++/** ++ * Type for representing unicode characters. (16-bit) ++ */ ++typedef uint16_t unichar; ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5,GS_API_LATEST) ++#define NSMaximumStringLength (INT_MAX-1) ++#endif ++ ++@class NSArray; ++@class NSCharacterSet; ++@class NSData; ++@class NSDictionary; ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++@class NSError; ++@class NSLocale; ++@class NSURL; ++#endif ++ ++#define NSMaximumStringLength (INT_MAX-1) ++ ++enum ++{ ++ NSCaseInsensitiveSearch = 1, ++ NSLiteralSearch = 2, ++ NSBackwardsSearch = 4, ++ NSAnchoredSearch = 8, ++ NSNumericSearch = 64 /* MacOS-X 10.2 */ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5,GS_API_LATEST) ++ , ++ NSDiacriticInsensitiveSearch = 128, ++ NSWidthInsensitiveSearch = 256, ++ NSForcedOrderingSearch = 512 ++#endif ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_7,GS_API_LATEST) ++ , ++ /** ++ * Treats the search string as a regular expression. This option may be ++ * combined with NSCaseInsensitiveSearch and NSAnchoredSearch, but no other ++ * search options. ++ * ++ * This option may only be used with the -rangeOfString: family of methods. ++ */ ++ NSRegularExpressionSearch = 1024 ++#endif ++}; ++typedef NSUInteger NSStringCompareOptions; ++ ++/** ++ *

    Enumeration of available encodings for converting between bytes and ++ * characters (in [NSString]s). The ones that are shared with OpenStep and ++ * Cocoa are: NSASCIIStringEncoding, NSNEXTSTEPStringEncoding, ++ * NSJapaneseEUCStringEncoding, NSUTF8StringEncoding, ++ * NSISOLatin1StringEncoding, NSSymbolStringEncoding, ++ * NSNonLossyASCIIStringEncoding, NSShiftJISStringEncoding, ++ * NSISOLatin2StringEncoding, NSUnicodeStringEncoding, ++ * NSWindowsCP1251StringEncoding, NSWindowsCP1252StringEncoding, ++ * NSWindowsCP1253StringEncoding, NSWindowsCP1254StringEncoding, ++ * NSWindowsCP1250StringEncoding, NSISO2022JPStringEncoding, ++ * NSMacOSRomanStringEncoding, NSProprietaryStringEncoding.

    ++ * ++ *

    Additional encodings available under GNUstep are: ++ * NSKOI8RStringEncoding, NSISOLatin3StringEncoding, ++ * NSISOLatin4StringEncoding, NSISOCyrillicStringEncoding, ++ * NSISOArabicStringEncoding, NSISOGreekStringEncoding, ++ * NSISOHebrewStringEncoding, NSISOLatin5StringEncoding, ++ * NSISOLatin6StringEncoding, NSISOThaiStringEncoding, ++ * NSISOLatin7StringEncoding, NSISOLatin8StringEncoding, ++ * NSISOLatin9StringEncoding, NSGB2312StringEncoding, NSUTF7StringEncoding, ++ * NSGSM0338StringEncoding, NSBIG5StringEncoding, ++ * NSKoreanEUCStringEncoding.

    ++ */ ++typedef enum _NSStringEncoding ++{ ++/* NB. Must not have an encoding with value zero - so we can use zero to ++ tell that a variable that should contain an encoding has not yet been ++ initialised */ ++ GSUndefinedEncoding = 0, ++ NSASCIIStringEncoding = 1, ++ NSNEXTSTEPStringEncoding = 2, ++ NSJapaneseEUCStringEncoding = 3, ++ NSUTF8StringEncoding = 4, ++ NSISOLatin1StringEncoding = 5, // ISO-8859-1; West European ++ NSSymbolStringEncoding = 6, ++ NSNonLossyASCIIStringEncoding = 7, ++ NSShiftJISStringEncoding = 8, ++ NSISOLatin2StringEncoding = 9, // ISO-8859-2; East European ++ NSUnicodeStringEncoding = 10, ++ NSUTF16StringEncoding = NSUnicodeStringEncoding, // An alias ++ NSWindowsCP1251StringEncoding = 11, ++ NSWindowsCP1252StringEncoding = 12, // WinLatin1 ++ NSWindowsCP1253StringEncoding = 13, // Greek ++ NSWindowsCP1254StringEncoding = 14, // Turkish ++ NSWindowsCP1250StringEncoding = 15, // WinLatin2 ++ NSISO2022JPStringEncoding = 21, ++ NSMacOSRomanStringEncoding = 30, ++ NSProprietaryStringEncoding = 31, ++ ++ NSKOI8RStringEncoding = 50, // Russian/Cyrillic ++ NSISOLatin3StringEncoding = 51, // ISO-8859-3; South European ++ NSISOLatin4StringEncoding = 52, // ISO-8859-4; North European ++ NSISOCyrillicStringEncoding = 22, // ISO-8859-5 ++ NSISOArabicStringEncoding = 53, // ISO-8859-6 ++ NSISOGreekStringEncoding = 54, // ISO-8859-7 ++ NSISOHebrewStringEncoding = 55, // ISO-8859-8 ++ NSISOLatin5StringEncoding = 57, // ISO-8859-9; Turkish ++ NSISOLatin6StringEncoding = 58, // ISO-8859-10; Nordic ++ NSISOThaiStringEncoding = 59, // ISO-8859-11 ++/* Possible future ISO-8859 additions ++ // ISO-8859-12 ++*/ ++ NSISOLatin7StringEncoding = 61, // ISO-8859-13 ++ NSISOLatin8StringEncoding = 62, // ISO-8859-14 ++ NSISOLatin9StringEncoding = 63, // ISO-8859-15; Replaces ISOLatin1 ++ NSGB2312StringEncoding = 56, ++ NSUTF7StringEncoding = 64, // RFC 2152 ++ NSGSM0338StringEncoding, // GSM (mobile phone) default alphabet ++ NSBIG5StringEncoding, // Traditional chinese ++ NSKoreanEUCStringEncoding // Korean ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4,GS_API_LATEST) ++ , ++ NSUTF16BigEndianStringEncoding = 0x90000100, ++ NSUTF16LittleEndianStringEncoding = 0x94000100, ++ NSUTF32StringEncoding = 0x8c000100, ++ NSUTF32BigEndianStringEncoding = 0x98000100, ++ NSUTF32LittleEndianStringEncoding = 0x9c000100 ++#endif ++} NSStringEncoding; ++ ++enum { ++ NSOpenStepUnicodeReservedBase = 0xF400 ++}; ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4,GS_API_LATEST) ++enum { ++ NSStringEncodingConversionAllowLossy = 1, ++ NSStringEncodingConversionExternalRepresentation = 2 ++}; ++typedef NSUInteger NSStringEncodingConversionOptions; ++#endif ++ ++/** ++ *

    ++ * NSString objects represent an immutable string of Unicode 3.0 ++ * characters. These may be accessed individually as type ++ * unichar, an unsigned short.
    ++ * The [NSMutableString] subclass represents a modifiable string. Both are ++ * implemented as part of a class cluster and the instances you receive may ++ * actually be of unspecified concrete subclasses. ++ *

    ++ *

    ++ * A constant NSString can be created using the following syntax: ++ * @"...", where the contents of the quotes are the ++ * string, using only ASCII characters. ++ *

    ++ *

    ++ * A variable string can be created using a C printf-like format, ++ * as in [NSString stringWithFormat: @"Total is %f", t]. ++ *

    ++ *

    ++ * To create a concrete subclass of NSString, you must have your ++ * class inherit from NSString and override at least the two ++ * primitive methods - -length and -characterAtIndex: ++ *

    ++ *

    ++ * In general the rule is that your subclass must override any ++ * initialiser that you want to use with it. The GNUstep ++ * implementation relaxes that to say that, you may override ++ * only the designated initialiser and the other ++ * initialisation methods should work. ++ *

    ++ *

    ++ * Where an NSString instance method returns an NSString object, ++ * the class of the actual object returned may be any subclass ++ * of NSString. The actual value returned may be a new ++ * autoreleased object, an autoreleased copy of the receiver, ++ * or the receiver itsself. While the abstract base class ++ * implementations of methods (other than initialisers) will ++ * avoid returning mutable strings by returning an autoreleased ++ * copy of a mutable receiver, concrete subclasses may behave ++ * differently, so code should not rely upon the mutability of ++ * returned strings nor upon their lifetime being greater than ++ * that of the receiver which returned them. ++ *

    ++ */ ++@interface NSString :NSObject ++ +++ (id) string; +++ (id) stringWithCharacters: (const unichar*)chars ++ length: (NSUInteger)length; ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4,GS_API_LATEST) && GS_API_VERSION( 10200,GS_API_LATEST) +++ (id) stringWithCString: (const char*)byteString ++ encoding: (NSStringEncoding)encoding; ++#endif +++ (id) stringWithCString: (const char*)byteString ++ length: (NSUInteger)length; +++ (id) stringWithCString: (const char*)byteString; +++ (id) stringWithFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2); +++ (id) stringWithContentsOfFile:(NSString *)path; ++ ++// Initializing Newly Allocated Strings ++- (id) init; ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4,GS_API_LATEST) && GS_API_VERSION( 10200,GS_API_LATEST) ++- (id) initWithBytes: (const void*)bytes ++ length: (NSUInteger)length ++ encoding: (NSStringEncoding)encoding; ++- (id) initWithBytesNoCopy: (void*)bytes ++ length: (NSUInteger)length ++ encoding: (NSStringEncoding)encoding ++ freeWhenDone: (BOOL)flag; ++#endif ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4,GS_API_LATEST) +++ (id) stringWithContentsOfFile: (NSString*)path ++ usedEncoding: (NSStringEncoding*)enc ++ error: (NSError**)error; ++- (id) initWithContentsOfFile: (NSString*)path ++ usedEncoding: (NSStringEncoding*)enc ++ error: (NSError**)error; +++ (id) stringWithContentsOfFile: (NSString*)path ++ encoding: (NSStringEncoding)enc ++ error: (NSError**)error; ++- (id) initWithContentsOfFile: (NSString*)path ++ encoding: (NSStringEncoding)enc ++ error: (NSError**)error; +++ (id) stringWithContentsOfURL: (NSURL*)url ++ usedEncoding: (NSStringEncoding*)enc ++ error: (NSError**)error; ++- (id) initWithContentsOfURL: (NSURL*)url ++ usedEncoding: (NSStringEncoding*)enc ++ error: (NSError**)error; +++ (id) stringWithContentsOfURL: (NSURL*)url ++ encoding: (NSStringEncoding)enc ++ error: (NSError**)error; ++- (id) initWithContentsOfURL: (NSURL*)url ++ encoding: (NSStringEncoding)enc ++ error: (NSError**)error; ++- (BOOL) writeToFile: (NSString*)path ++ atomically: (BOOL)atomically ++ encoding: (NSStringEncoding)enc ++ error: (NSError**)error; ++- (BOOL) writeToURL: (NSURL*)url ++ atomically: (BOOL)atomically ++ encoding: (NSStringEncoding)enc ++ error: (NSError**)error; ++#endif ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5,GS_API_LATEST) ++- (NSString*)stringByReplacingOccurrencesOfString: (NSString*)replace ++ withString: (NSString*)by ++ options: (NSStringCompareOptions)opts ++ range: (NSRange)searchRange; ++- (NSString*)stringByReplacingOccurrencesOfString: (NSString*)replace ++ withString: (NSString*)by; ++- (NSString*) stringByReplacingCharactersInRange: (NSRange)aRange ++ withString: (NSString*)by; ++#endif ++- (id) initWithCharactersNoCopy: (unichar*)chars ++ length: (NSUInteger)length ++ freeWhenDone: (BOOL)flag; ++- (id) initWithCharacters: (const unichar*)chars ++ length: (NSUInteger)length; ++- (id) initWithCStringNoCopy: (char*)byteString ++ length: (NSUInteger)length ++ freeWhenDone: (BOOL)flag; ++- (id) initWithCString: (const char*)byteString ++ length: (NSUInteger)length; ++- (id) initWithCString: (const char*)byteString; ++- (id) initWithString: (NSString*)string; ++- (id) initWithFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2); ++- (id) initWithFormat: (NSString*)format ++ arguments: (va_list)argList NS_FORMAT_FUNCTION(1,0); ++- (id) initWithData: (NSData*)data ++ encoding: (NSStringEncoding)encoding; ++- (id) initWithContentsOfFile: (NSString*)path; ++ ++// Getting a String's Length ++- (NSUInteger) length; ++ ++// Accessing Characters ++- (unichar) characterAtIndex: (NSUInteger)index; ++- (void) getCharacters: (unichar*)buffer; ++- (void) getCharacters: (unichar*)buffer ++ range: (NSRange)aRange; ++ ++// Combining Strings ++- (NSString*) stringByAppendingFormat: (NSString*)format, ... ++ NS_FORMAT_FUNCTION(1,2); ++- (NSString*) stringByAppendingString: (NSString*)aString; ++ ++// Dividing Strings into Substrings ++- (NSArray*) componentsSeparatedByString: (NSString*)separator; ++- (NSString*) substringFromIndex: (NSUInteger)index; ++- (NSString*) substringToIndex: (NSUInteger)index; ++ ++// Finding Ranges of Characters and Substrings ++- (NSRange) rangeOfCharacterFromSet: (NSCharacterSet*)aSet; ++- (NSRange) rangeOfCharacterFromSet: (NSCharacterSet*)aSet ++ options: (NSUInteger)mask; ++- (NSRange) rangeOfCharacterFromSet: (NSCharacterSet*)aSet ++ options: (NSUInteger)mask ++ range: (NSRange)aRange; ++- (NSRange) rangeOfString: (NSString*)string; ++- (NSRange) rangeOfString: (NSString*)string ++ options: (NSUInteger)mask; ++- (NSRange) rangeOfString: (NSString*)aString ++ options: (NSUInteger)mask ++ range: (NSRange)aRange; ++ ++// Determining Composed Character Sequences ++- (NSRange) rangeOfComposedCharacterSequenceAtIndex: (NSUInteger)anIndex; ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_2,GS_API_LATEST) ++/** Returns a copy of the receiver normalised using the KD form. ++ */ ++- (NSString *) decomposedStringWithCompatibilityMapping; + -+2019-03-10 Thomas Koenig ++/** Returns a copy of the receiver normalised using the D form. ++ */ ++- (NSString *) decomposedStringWithCanonicalMapping; + -+ PR fortran/71544 -+ Backport from trunk -+ * gfortran.dg/c_ptr_tests_19.f90: New test. ++/** Returns a copy of the receiver normalised using the KC form. ++ */ ++- (NSString *) precomposedStringWithCompatibilityMapping; + -+2019-03-10 Thomas Koenig ++/** Returns a copy of the receiver normalised using the C form. ++ */ ++- (NSString *) precomposedStringWithCanonicalMapping; ++#endif + -+ PR fortran/87734 -+ Backport from trunk -+ * gfortran.dg/public_private_module_10.f90: New test. ++// Converting String Contents into a Property List ++- (id) propertyList; ++- (NSDictionary*) propertyListFromStringsFileFormat; ++ ++// Identifying and Comparing Strings ++- (NSComparisonResult) compare: (NSString*)aString; ++- (NSComparisonResult) compare: (NSString*)aString ++ options: (NSUInteger)mask; ++- (NSComparisonResult) compare: (NSString*)aString ++ options: (NSUInteger)mask ++ range: (NSRange)aRange; ++- (BOOL) hasPrefix: (NSString*)aString; ++- (BOOL) hasSuffix: (NSString*)aString; ++- (BOOL) isEqual: (id)anObject; ++- (BOOL) isEqualToString: (NSString*)aString; ++- (NSUInteger) hash; ++ ++// Getting a Shared Prefix ++- (NSString*) commonPrefixWithString: (NSString*)aString ++ options: (NSUInteger)mask; ++ ++// Changing Case ++- (NSString*) capitalizedString; ++- (NSString*) lowercaseString; ++- (NSString*) uppercaseString; ++ ++// Getting C Strings ++- (const char*) cString; ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++ ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_4,GS_API_LATEST) && GS_API_VERSION( 10200,GS_API_LATEST) ++- (const char*) cStringUsingEncoding: (NSStringEncoding)encoding; ++- (BOOL) getCString: (char*)buffer ++ maxLength: (NSUInteger)maxLength ++ encoding: (NSStringEncoding)encoding; ++- (id) initWithCString: (const char*)byteString ++ encoding: (NSStringEncoding)encoding; ++- (NSUInteger) lengthOfBytesUsingEncoding: (NSStringEncoding)encoding; ++- (NSUInteger) maximumLengthOfBytesUsingEncoding: (NSStringEncoding)encoding; ++#endif + -+2019-03-08 Martin Jambor ++#endif ++- (NSUInteger) cStringLength; ++- (void) getCString: (char*)buffer; ++- (void) getCString: (char*)buffer ++ maxLength: (NSUInteger)maxLength; ++- (void) getCString: (char*)buffer ++ maxLength: (NSUInteger)maxLength ++ range: (NSRange)aRange ++ remainingRange: (NSRange*)leftoverRange; ++ ++// Getting Numeric Values ++- (float) floatValue; ++- (int) intValue; ++ ++// Working With Encodings ++- (BOOL) canBeConvertedToEncoding: (NSStringEncoding)encoding; ++- (NSData*) dataUsingEncoding: (NSStringEncoding)encoding; ++- (NSData*) dataUsingEncoding: (NSStringEncoding)encoding ++ allowLossyConversion: (BOOL)flag; +++ (NSStringEncoding) defaultCStringEncoding; ++- (NSString*) description; ++- (NSStringEncoding) fastestEncoding; ++- (NSStringEncoding) smallestEncoding; ++ ++/** ++ * Attempts to complete this string as a path in the filesystem by finding ++ * a unique completion if one exists and returning it by reference in ++ * outputName (which must be a non-nil pointer), or if it finds a set of ++ * completions they are returned by reference in outputArray, if it is non-nil. ++ * filterTypes can be an array of strings specifying extensions to consider; ++ * files without these extensions will be ignored and will not constitute ++ * completions. Returns 0 if no match found, else a positive number that is ++ * only accurate if outputArray was non-nil. ++ */ ++- (NSUInteger) completePathIntoString: (NSString**)outputName ++ caseSensitive: (BOOL)flag ++ matchesIntoArray: (NSArray**)outputArray ++ filterTypes: (NSArray*)filterTypes; ++ ++/** ++ * Converts the receiver to a C string path expressed in the character ++ * encoding appropriate for the local host file system. This string will be ++ * automatically freed soon after it is returned, so copy it if you need it ++ * for long.
    ++ * NB. On mingw32 systems the filesystem representation of a path is a 16-bit ++ * unicode character string, so you should only pass the value returned by ++ * this method to functions expecting wide characters.
    ++ * This method uses [NSFileManager-fileSystemRepresentationWithPath:] to ++ * perform the conversion. ++ */ ++- (const GSNativeChar*) fileSystemRepresentation; + -+ Backport from mainline -+ 2019-03-07 Martin Jambor ++/** ++ * Converts the receiver to a C string path using the character encoding ++ * appropriate to the local file system. This string will be stored ++ * into buffer if it is shorter (number of characters) than size, ++ * otherwise NO is returned.
    ++ * NB. On mingw32 systems the filesystem representation of a path is a 16-bit ++ * unicode character string, so the buffer you pass to this method must be ++ * twice as many bytes as the size (number of characters) you expect to ++ * receive.
    ++ * This method uses [NSFileManager-fileSystemRepresentationWithPath:] to ++ * perform the conversion. ++ */ ++- (BOOL) getFileSystemRepresentation: (GSNativeChar*)buffer ++ maxLength: (NSUInteger)size; + -+ * g++.dg/ipa/pr88235.C: New test. ++/** ++ * Returns a string containing the last path component of the receiver.
    ++ * The path component is the last non-empty substring delimited by the ends ++ * of the string, or by path separator characters.
    ++ * If the receiver only contains a root part, this method returns it.
    ++ * If there are no non-empty substrings, this returns an empty string.
    ++ * NB. In a windows UNC path, the host and share specification is treated as ++ * a single path component, even though it contains separators. ++ * So a string of the form '//host/share' may be returned.
    ++ * Other special cases are apply when the string is the root. ++ * ++ * @"foo/bar" produces @"bar" ++ * @"foo/bar/" produces @"bar" ++ * @"/foo/bar" produces @"bar" ++ * @"/foo" produces @"foo" ++ * @"/" produces @"/" (root is a special case) ++ * @"" produces @"" ++ * @"C:/" produces @"C:/" (root is a special case) ++ * @"C:" produces @"C:" ++ * @"//host/share/" produces @"//host/share/" (root is a special case) ++ * @"//host/share" produces @"//host/share" ++ * ++ */ ++- (NSString*) lastPathComponent; + -+2019-03-07 Jakub Jelinek ++/** ++ * Returns a new string containing the path extension of the receiver.
    ++ * The path extension is a suffix on the last path component which starts ++ * with the extension separator (a '.') (for example .tiff is the ++ * pathExtension for /foo/bar.tiff).
    ++ * Returns an empty string if no such extension exists. ++ * ++ * @"a.b" produces @"b" ++ * @"a.b/" produces @"b" ++ * @"/path/a.ext" produces @"ext" ++ * @"/path/a." produces @"" ++ * @"/path/.a" produces @"" (.a is not an extension to a file) ++ * @".a" produces @"" (.a is not an extension to a file) ++ * ++ */ ++- (NSString*) pathExtension; + -+ PR c++/89585 -+ * g++.dg/asm-qual-3.C: Adjust expected diagnostics. ++/** ++ * Returns a string where a prefix of the current user's home directory is ++ * abbreviated by '~', or returns the receiver (or an immutable copy) if ++ * it was not found to have the home directory as a prefix. ++ */ ++- (NSString*) stringByAbbreviatingWithTildeInPath; + -+2019-03-06 Harald Anlauf ++/** ++ * Returns a new string with the path component given in aString ++ * appended to the receiver.
    ++ * This removes trailing path separators from the receiver and the root ++ * part from aString and replaces them with a single slash as a path ++ * separator.
    ++ * Also condenses any multiple separator sequences in the result into ++ * single path separators. ++ * ++ * @"" with @"file" produces @"file" ++ * @"path" with @"file" produces @"path/file" ++ * @"/" with @"file" produces @"/file" ++ * @"/" with @"file" produces @"/file" ++ * @"/" with @"/file" produces @"/file" ++ * @"path with @"C:/file" produces @"path/file" ++ * ++ * NB. Do not use this method to modify strings other than filesystem ++ * paths as the behavior in such cases is undefined ... for instance ++ * the string may have repeated slashes or slash-dot-slash sequences ++ * removed. ++ */ ++- (NSString*) stringByAppendingPathComponent: (NSString*)aString; + -+ Backport from trunk -+ PR fortran/71203 -+ * gfortran.dg/substr_8.f90: New test. ++/** ++ * Returns a new string with the path extension given in aString ++ * appended to the receiver after an extensionSeparator ('.').
    ++ * If the receiver has trailing path separator characters, they are ++ * stripped before the extension separator is added.
    ++ * If the receiver contains no components after the root, the extension ++ * cannot be appended (an extension can only be appended to a file name), ++ * so a copy of the unmodified receiver is returned.
    ++ * An empty string may be used as an extension ... in which case the extension ++ * separator is appended.
    ++ * This behavior mirrors that of the -stringByDeletingPathExtension method. ++ * ++ * @"Mail" with @"app" produces @"Mail.app" ++ * @"Mail.app" with @"old" produces @"Mail.app.old" ++ * @"file" with @"" produces @"file." ++ * @"/" with @"app" produces @"/" (no file name to append to) ++ * @"" with @"app" produces @"" (no file name to append to) ++ * ++ * NB. Do not use this method to modify strings other than filesystem ++ * paths as the behavior in such cases is undefined ... for instance ++ * the string may have repeated slashes or slash-dot-slash sequences ++ * removed. ++ */ ++- (NSString*) stringByAppendingPathExtension: (NSString*)aString; + -+2019-03-06 Thomas Koenig ++/** ++ * Returns a new string with the last path component (including any final ++ * path separators) removed from the receiver.
    ++ * A string without a path component other than the root is returned ++ * without alteration.
    ++ * See -lastPathComponent for a definition of a path component. ++ * ++ * @"hello/there" produces @"hello" (a relative path) ++ * @"hello" produces @"" (a relative path) ++ * @"/hello" produces @"/" (an absolute unix path) ++ * @"/" produces @"/" (an absolute unix path) ++ * @"C:file" produces @"C:" (a relative windows path) ++ * @"C:" produces @"C:" (a relative windows path) ++ * @"C:/file" produces @"C:/" (an absolute windows path) ++ * @"C:/" produces @"C:/" (an absolute windows path) ++ * @"//host/share/file" produces @"//host/share/" (a UNC path) ++ * @"//host/share/" produces @"//host/share/" (a UNC path) ++ * @"//path/file" produces @"//path" (an absolute Unix path) ++ * ++ * NB. Do not use this method to modify strings other than filesystem ++ * paths as the behavior in such cases is undefined ... for instance ++ * the string may have repeated slashes or slash-dot-slash sequences ++ * removed. ++ */ ++- (NSString*) stringByDeletingLastPathComponent; + -+ PR fortran/72714 -+ Backport from trunk -+ * gfortran.dg/coarray_allocate_11.f90: New test. ++/** ++ * Returns a new string with the path extension removed from the receiver.
    ++ * Strips any trailing path separators before checking for the extension ++ * separator.
    ++ * NB. This method does not consider a string which contains nothing ++ * between the root part and the extension separator ('.') to be a path ++ * extension. This mirrors the behavior of the -stringByAppendingPathExtension: ++ * method. ++ * ++ * @"file.ext" produces @"file" ++ * @"/file.ext" produces @"/file" ++ * @"/file.ext/" produces @"/file" (trailing path separators are ignored) ++ * @"/file..ext" produces @"/file." ++ * @"/file." produces @"/file" ++ * @"/.ext" produces @"/.ext" (there is no file to strip from) ++ * @".ext" produces @".ext" (there is no file to strip from) ++ * ++ * NB. Do not use this method to modify strings other than filesystem ++ * paths as the behavior in such cases is undefined ... for instance ++ * the string may have repeated slashes or slash-dot-slash sequences ++ * removed. ++ */ ++- (NSString*) stringByDeletingPathExtension; + -+2019-03-06 Tamar Christina ++/** ++ * Returns a string created by expanding the initial tilde ('~') and any ++ * following username to be the home directory of the current user or the ++ * named user.
    ++ * Returns the receiver or an immutable copy if it was not possible to ++ * expand it. ++ */ ++- (NSString*) stringByExpandingTildeInPath; + -+ Backport from trunk. -+ 2019-02-25 Tamar Christina ++/** ++ * First calls -stringByExpandingTildeInPath if necessary.
    ++ * Replaces path string by one in which path components representing symbolic ++ * links have been replaced by their referents.
    ++ * Removes a leading '/private' if the result is valid.
    ++ * If links cannot be resolved, returns an unmodified copy of the receiver. ++ */ ++- (NSString*) stringByResolvingSymlinksInPath; + -+ PR target/88530 -+ * common/config/aarch64/aarch64-common.c -+ (struct aarch64_option_extension): Add is_synthetic. -+ (all_extensions): Use it. -+ (TARGET_OPTION_INIT_STRUCT): Define hook. -+ (struct gcc_targetm_common): Moved to end. -+ (all_extensions_by_on): New. -+ (opt_ext_cmp, typedef opt_ext): New. -+ (aarch64_option_init_struct): New. -+ (aarch64_contains_opt): New. -+ (aarch64_get_extension_string_for_isa_flags): Output smallest set. -+ * config/aarch64/aarch64-option-extensions.def -+ (AARCH64_OPT_EXTENSION): Explicitly include AES and SHA2 in crypto. -+ (fp, simd, crc, lse, fp16, rcpc, rdma, dotprod, aes, sha2, sha3, -+ sm4, fp16fml, sve): -+ Set is_synthetic to false. -+ (crypto): Set is_synthetic to true. -+ * config/aarch64/driver-aarch64.c (AARCH64_OPT_EXTENSION): Add -+ SYNTHETIC. ++/** ++ * Returns a standardised form of the receiver, with unnecessary parts ++ * removed, tilde characters expanded, and symbolic links resolved ++ * where possible.
    ++ * NB. Refers to the local filesystem to resolve symbolic links in ++ * absolute paths, and to expand tildes ... so this can't be used for ++ * general path manipulation.
    ++ * If the string is an invalid path, the unmodified receiver is returned.
    ++ *

    ++ * Uses -stringByExpandingTildeInPath to expand tilde expressions.
    ++ * Simplifies '//' and '/./' sequences and removes trailing '/' or '.'.
    ++ *

    ++ *

    ++ * For absolute paths, uses -stringByResolvingSymlinksInPath to resolve ++ * any links, then gets rid of '/../' sequences and removes any '/private' ++ * prefix. ++ *

    ++ */ ++- (NSString*) stringByStandardizingPath; + -+2019-03-06 Tamar Christina + -+ Backport from trunk. -+ 2019-02-28 Tamar Christina ++// for methods working with decomposed strings ++- (int) _baseLength; + -+ PR target/88530 -+ * gcc.target/aarch64/options_set_10.c: New test. ++#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) ++/** ++ * Concatenates the path components in the array and returns the result.
    ++ * This method does not remove empty path components, but does recognize an ++ * empty initial component as a special case meaning that the string ++ * returned will begin with a slash. ++ */ +++ (NSString*) pathWithComponents: (NSArray*)components; + -+2019-03-06 Xiong Hu Luo ++/** ++ * Returns YES if the receiver represents an absolute path ...
    ++ * Returns NO otherwise.
    ++ * An absolute path in unix mode is one which begins ++ * with a slash or tilde.
    ++ * In windows mode a drive specification (eg C:) followed by a slash or ++ * backslash, is an absolute path, as is any path beginning with a tilde.
    ++ * In any mode a UNC path (//host/share...) is always absolute.
    ++ * In the default gnustep path handling mode, ++ * the rules are the same as for windows, ++ * except that a path whose root is a slash denotes an absolute path ++ * when running on unix and a relative path when running under windows. ++ */ ++- (BOOL) isAbsolutePath; + -+ Backport of r268834 from mainline to gcc-8-branch. -+ 2019-01-23 Xiong Hu Luo ++/** ++ * Returns the path components of the receiver separated into an array.
    ++ * If the receiver begins with a root sequence such as the path separator ++ * character (or a drive specification in windows) then that is used as the ++ * first element in the array.
    ++ * Empty components are removed.
    ++ * If a trailing path separator (which was not part of the root) was present, ++ * it is added as the last element in the array. ++ */ ++- (NSArray*) pathComponents; + -+ * gcc.target/powerpc/crypto-builtin-1.c -+ (crypto1_be, crypto2_be, crypto3_be, crypto4_be, crypto5_be): -+ New testcases. ++/** ++ * Returns an array of strings made by appending the values in paths ++ * to the receiver. ++ */ ++- (NSArray*) stringsByAppendingPaths: (NSArray*)paths; + -+2019-03-05 Richard Biener +++ (NSString*) localizedStringWithFormat: (NSString*)format, ... ++ NS_FORMAT_FUNCTION(1,2); + -+ Backport from mainline -+ 2019-02-26 Richard Biener +++ (id) stringWithString: (NSString*)aString; +++ (id) stringWithContentsOfURL: (NSURL*)url; +++ (id) stringWithUTF8String: (const char*)bytes; ++- (id) initWithFormat: (NSString*)format ++ locale: (NSDictionary*)locale, ... NS_FORMAT_FUNCTION(1,3); ++- (id) initWithFormat: (NSString*)format ++ locale: (NSDictionary*)locale ++ arguments: (va_list)argList NS_FORMAT_FUNCTION(1,0); ++- (id) initWithUTF8String: (const char *)bytes; ++- (id) initWithContentsOfURL: (NSURL*)url; ++- (NSString*) substringWithRange: (NSRange)aRange; ++- (NSComparisonResult) caseInsensitiveCompare: (NSString*)aString; ++- (NSComparisonResult) compare: (NSString*)string ++ options: (NSUInteger)mask ++ range: (NSRange)compareRange ++ locale: (id)locale; ++- (NSComparisonResult) localizedCompare: (NSString *)string; ++- (NSComparisonResult) localizedCaseInsensitiveCompare: (NSString *)string; ++- (BOOL) writeToFile: (NSString*)filename ++ atomically: (BOOL)useAuxiliaryFile; ++- (BOOL) writeToURL: (NSURL*)url atomically: (BOOL)atomically; ++- (double) doubleValue; +++ (NSStringEncoding*) availableStringEncodings; +++ (NSString*) localizedNameOfStringEncoding: (NSStringEncoding)encoding; ++- (void) getLineStart: (NSUInteger *)startIndex ++ end: (NSUInteger *)lineEndIndex ++ contentsEnd: (NSUInteger *)contentsEndIndex ++ forRange: (NSRange)aRange; ++- (NSRange) lineRangeForRange: (NSRange)aRange; ++- (const char*) lossyCString; ++- (NSString*) stringByAddingPercentEscapesUsingEncoding: (NSStringEncoding)e; ++- (NSString*) stringByPaddingToLength: (NSUInteger)newLength ++ withString: (NSString*)padString ++ startingAtIndex: (NSUInteger)padIndex; ++- (NSString*) stringByReplacingPercentEscapesUsingEncoding: (NSStringEncoding)e; ++- (NSString*) stringByTrimmingCharactersInSet: (NSCharacterSet*)aSet; ++- (const char *)UTF8String; ++#endif + -+ PR tree-optimization/89505 -+ * gcc.dg/torture/pr89505.c: New testcase. ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_9,GS_API_LATEST) ++- (NSString *) stringByAddingPercentEncodingWithAllowedCharacters: (NSCharacterSet *)aSet; ++- (NSString *) stringByRemovingPercentEncoding; ++#endif + -+2019-03-03 Harald Anlauf ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_3,GS_API_LATEST) ++/** Not implemented */ ++- (void) getParagraphStart: (NSUInteger *)startIndex ++ end: (NSUInteger *)parEndIndex ++ contentsEnd: (NSUInteger *)contentsEndIndex ++ forRange: (NSRange)range; ++/** Not implemented */ ++ - (NSRange) paragraphRangeForRange: (NSRange)range; ++#endif + -+ Backport from trunk -+ PR fortran/89077 -+ * gfortran.dg/transfer_simplify_12.f90: New test. -+ * gfortran.dg/substr_simplify.f90: New test. ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_5,GS_API_LATEST) ++/** ++ * Returns YES when scanning the receiver's text from left to right ++ * finds an initial digit in the range 1-9 or a letter in the set ++ * ('Y', 'y', 'T', 't').
    ++ * Any trailing characters are ignored.
    ++ * Any leading whitespace or zeros or signs are also ignored.
    ++ * Returns NO if the above conditions are not met. ++ */ ++- (BOOL) boolValue; ++- (NSArray *) componentsSeparatedByCharactersInSet: (NSCharacterSet *)separator; ++- (NSInteger) integerValue; ++- (long long) longLongValue; ++/** Not implemented */ ++- (NSRange) rangeOfComposedCharacterSequencesForRange: (NSRange)range; ++/** Not implemented */ ++- (NSRange) rangeOfString: (NSString *)aString ++ options: (NSStringCompareOptions)mask ++ range: (NSRange)searchRange ++ locale: (NSLocale *)locale; + -+2019-03-03 Harald Anlauf ++#endif + -+ Backport from trunk -+ PR fortran/77583 -+ * gfortran.dg/pr77583.f90: New test. ++#if OS_API_VERSION(MAC_OS_X_VERSION_10_10,GS_API_LATEST) + -+2019-03-03 Thomas Koenig ++/** ++ * Returns YES if the receiver contains string, otherwise, NO. ++ */ ++- (BOOL) containsString: (NSString *)string; + -+ PR fortran/89174 -+ Backport from trunk -+ * gfortran.dg/allocate_with_mold_3.f90: New test. ++#endif + -+2019-03-03 Thomas Koenig ++#if OS_API_VERSION(GS_API_NONE, GS_API_NONE) +++ (Class) constantStringClass; ++#endif /* GS_API_NONE */ ++ ++@end ++ ++@interface NSMutableString : NSString ++ ++// Creating Temporary Strings +++ (id) string; +++ (id) stringWithCharacters: (const unichar*)characters ++ length: (NSUInteger)length; +++ (id) stringWithCString: (const char*)byteString ++ length: (NSUInteger)length; +++ (id) stringWithCString: (const char*)byteString; +++ (id) stringWithFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2); +++ (id) stringWithContentsOfFile: (NSString*)path; +++ (NSMutableString*) stringWithCapacity: (NSUInteger)capacity; ++ ++// Initializing Newly Allocated Strings ++- (id) initWithCapacity: (NSUInteger)capacity; ++ ++// Modify A String ++- (void) appendFormat: (NSString*)format, ... NS_FORMAT_FUNCTION(1,2); ++- (void) appendString: (NSString*)aString; ++- (void) deleteCharactersInRange: (NSRange)range; ++- (void) insertString: (NSString*)aString atIndex: (NSUInteger)loc; ++- (void) replaceCharactersInRange: (NSRange)range ++ withString: (NSString*)aString; ++- (NSUInteger) replaceOccurrencesOfString: (NSString*)replace ++ withString: (NSString*)by ++ options: (NSUInteger)opts ++ range: (NSRange)searchRange; ++- (void) setString: (NSString*)aString; ++ ++@end ++ ++#ifdef __OBJC_GNUSTEP_RUNTIME_ABI__ ++# if __OBJC_GNUSTEP_RUNTIME_ABI__ >= 20 ++# define GNUSTEP_NEW_STRING_ABI ++# endif ++#endif + -+ PR fortran/87689 -+ Backport from trunk -+ * gfortran.dg/lto/20091028-1_0.f90: Add -Wno-lto-type-mismatch to -+ options. -+ * gfortran.dg/lto/20091028-2_0.f90: Likewise. -+ * gfortran.dg/lto/pr87689_0.f: New file. -+ * gfortran.dg/lto/pr87689_1.f: New file. -+ * gfortran.dg/altreturn_9_0.f90: New file. -+ * gfortran.dg/altreturn_9_1.f90: New file. ++/** ++ *

    The NXConstantString class is used to hold constant 8-bit character ++ * string objects produced by the compiler where it sees @"..." in the ++ * source. The compiler generates the instances of this class - which ++ * has three instance variables -

    ++ * ++ * a pointer to the class (this is the sole ivar of NSObject) ++ * a pointer to the 8-bit data ++ * the length of the string ++ * ++ *

    In older versions of the compiler, the isa variable is always set to ++ * the NXConstantString class. In newer versions a compiler option was ++ * added for GNUstep, to permit the isa variable to be set to another ++ * class, and GNUstep uses this to avoid conflicts with the default ++ * implementation of NXConstantString in the ObjC runtime library (the ++ * preprocessor is used to change all occurrences of NXConstantString ++ * in the source code to NSConstantString).

    ++ *

    Since GNUstep will generally use the GNUstep extension to the ++ * compiler, you should never refer to the constant string class by ++ * name, but should use the [NSString+constantStringClass] method to ++ * get the actual class being used for constant strings.

    ++ * What follows is a dummy declaration of the class to keep the compiler ++ * happy. ++ */ ++@interface NXConstantString : NSString ++{ ++@public ++#ifdef GNUSTEP_NEW_STRING_ABI ++ /** ++ * Flags. The low 16 bits are reserved for the compiler, the top 16 for use ++ * by the Foundation Framework. Currently only the low 2 bits are used, to ++ * indicate the encoding of the string, with the following values: ++ * ++ * 0. ASCII (UTF-8 using only 7-bit characters) ++ * 1. UTF-8 ++ * 2. UTF-16 ++ * 3. UTF-32 ++ * ++ */ ++ uint32_t flags; ++ /** ++ * The number of characters (UTF-16 code units) in the string. ++ */ ++ uint32_t nxcslen; ++ /** ++ * The number of bytes in the string. For fixed-length encodings, this is a ++ * fixed multiple of nxcslen, but for UTF-8 it can be different. ++ */ ++ uint32_t size; ++ /** ++ * Hash value. ++ */ ++ uint32_t hash; ++ /** ++ * Pointer to the byte data of the string. Note that `char*` is the correct ++ * type only if the low two bits of the flags indicate that this is an ASCII ++ * or UTF-8 string, otherwise it is a pointer to 16- or 32-bit characters in ++ * native byte order. ++ */ ++ const char * const nxcsptr; ++#else ++ const char * const nxcsptr; ++ const unsigned int nxcslen; ++#endif ++} ++@end + -+2019-03-02 Jerry DeLisle ++#ifdef NeXT_RUNTIME ++/** For internal use with NeXT runtime; ++ needed, until Apple Radar 2870817 is fixed. */ ++extern struct objc_class _NSConstantStringClassReference; ++#endif + -+ Backport from trunk -+ PR fortran/84387 -+ * gfortran.dg/dtio_34.f90: New test. ++#if defined(__cplusplus) ++} ++#endif + -+2019-03-02 Harald Anlauf ++#if !NO_GNUSTEP && !defined(GNUSTEP_BASE_INTERNAL) ++#import "../GNUstepBase/NSString+GNUstepBase.h" ++#import "../GNUstepBase/NSMutableString+GNUstepBase.h" ++#endif + -+ Backport from trunk -+ PR fortran/89516 -+ * gfortran.dg/pr89492.f90: Adjust testcase. -+ * gfortran.dg/transfer_check_5.f90: New test. ++#endif /* __NSString_h_GNUSTEP_BASE_INCLUDE */ +Index: gcc/testsuite/objc-obj-c++-shared/F-NSValue.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/F-NSValue.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/F-NSValue.h (.../branches/gcc-8-branch) +@@ -0,0 +1,33 @@ ++/* Copyright (C) 2019 Free Software Foundation, Inc. + -+ PR fortran/89492 -+ * gfortran.dg/pr89492.f90: New test. ++This file is part of GCC. + -+ PR fortran/89266 -+ PR fortran/88326 -+ * gfortran.dg/pr89266.f90: New test. -+ * gfortran.dg/pr88326.f90: New test. ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#ifndef _OBJC_F_NSSTRING_H_ ++#define _OBJC_F_NSSTRING_H_ ++ ++/* This is a workaround to PR90709 for the NeXT runtime. ++ If we're on a system version that has headers with items we can't ++ consume, then use the GNUStep header instead. ++*/ + -+2019-02-28 Eric Botcazou ++#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1090 ++# import "GNUStep/Foundation/NSValue.h" ++#else ++# import ++#endif + -+ * gcc.c-torture/execute/20190228-1.c: New test. ++#endif /* _OBJC_F_NSSTRING_H_ */ +Index: gcc/testsuite/objc-obj-c++-shared/F-NSArray.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/F-NSArray.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/F-NSArray.h (.../branches/gcc-8-branch) +@@ -0,0 +1,33 @@ ++/* Copyright (C) 2019 Free Software Foundation, Inc. + -+2019-02-28 Li Jia He ++This file is part of GCC. + -+ Backport from trunk -+ 2019-02-20 Li Jia He ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#ifndef _OBJC_F_NSARRAY_H_ ++#define _OBJC_F_NSARRAY_H_ ++ ++/* This is a workaround to PR90709 for the NeXT runtime. ++ If we're on a system version that has headers with items we can't ++ consume, then use the GNUStep header instead. ++*/ + -+ PR target/88100 -+ * gcc/testsuite/gcc.target/powerpc/pr88100.c: New testcase. ++#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1090 ++# import "GNUStep/Foundation/NSArray.h" ++#else ++# import ++#endif + -+2019-02-26 Eric Botcazou ++#endif /* _OBJC_F_NSARRAY_H_ */ +Index: gcc/testsuite/objc-obj-c++-shared/CF-CFString.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/CF-CFString.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/CF-CFString.h (.../branches/gcc-8-branch) +@@ -0,0 +1,33 @@ ++/* Copyright (C) 2019 Free Software Foundation, Inc. + -+ * gnat.dg/opt77.adb: New test. -+ * gnat.dg/opt77_pkg.ad[sb]: New helper. ++This file is part of GCC. + -+2019-02-23 Thomas Koenig ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#ifndef _OBJC_CF_CFSTRING_H_ ++#define _OBJC_CF_CFSTRING_H_ ++ ++/* This is a workaround to PR90709 for the NeXT runtime. ++ If we're on a system version that has headers with items we can't ++ consume, then use the GNUStep header instead. ++*/ + -+ PR fortran/86119 -+ Backport from trunk -+ * gfortran.dg/warn_conversion_11.f90: New test. ++#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1090 ++# import "GNUStep/CoreFoundation/CFString.h" ++#else ++# import ++#endif + -+2019-02-23 Paul Thomas ++#endif /* _OBJC_CF_CFSTRING_H_ */ +Index: gcc/testsuite/objc-obj-c++-shared/F-NSAutoreleasePool.h +=================================================================== +--- a/src/gcc/testsuite/objc-obj-c++-shared/F-NSAutoreleasePool.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc-obj-c++-shared/F-NSAutoreleasePool.h (.../branches/gcc-8-branch) +@@ -0,0 +1,33 @@ ++/* Copyright (C) 2019 Free Software Foundation, Inc. + -+ Backport from trunk -+ PR fortran/88117 -+ * gfortran.dg/deferred_character_32.f90: New test ++This file is part of GCC. + -+2019-02-12 Thomas Koenig ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#ifndef _OBJC_F_NSAUTORELEASEPOOL_H_ ++#define _OBJC_F_NSAUTORELEASEPOOL_H_ ++ ++/* This is a workaround to PR90709 for the NeXT runtime. ++ If we're on a system version that has headers with items we can't ++ consume, then use the GNUStep header instead. ++*/ + -+ PR fortran/71066 -+ Backport from trunk -+ * gfortran.dg/coarray_data_1.f90: New test. ++#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1090 ++# import "GNUStep/Foundation/NSAutoreleasePool.h" ++#else ++# import ++#endif + - 2019-02-22 Release Manager - - * GCC 8.3.0 released. ++#endif /* _OBJC_F_NSAUTORELEASEPOOL_H_ */ Index: gcc/testsuite/g++.dg/ubsan/vptr-14.C =================================================================== --- a/src/gcc/testsuite/g++.dg/ubsan/vptr-14.C (.../tags/gcc_8_3_0_release) @@ -22812,6 +37280,40 @@ + + return 0; +} +Index: gcc/testsuite/g++.dg/gcov/pr16855.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/gcov/pr16855.C (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/g++.dg/gcov/pr16855.C (.../branches/gcc-8-branch) +@@ -1,6 +1,8 @@ + /* { dg-options "-fprofile-arcs -ftest-coverage" } */ + /* { dg-do run { target native } } */ + ++/* See PR91087 for information on Darwin xfails. */ ++ + #include + #include + +@@ -18,7 +20,9 @@ + { + public: + Test (void) { fprintf (stderr, "In Test::Test\n"); /* count(1) */ } +- ~Test (void) { fprintf (stderr, "In Test::~Test\n"); /* count(1) */ } ++ ~Test (void) { ++ fprintf (stderr, "In Test::~Test\n"); /* count(1) { xfail *-*-darwin* } */ ++ } + } T1; + + void +@@ -42,7 +46,7 @@ + + static void __attribute__ ((destructor)) dtor_default () + { +- fprintf (stderr, "in destructor(())\n"); /* count(1) */ ++ fprintf (stderr, "in destructor(())\n"); /* count(1) { xfail *-*-darwin* } */ + } + +-/* { dg-final { run-gcov branches { -b pr16855.C } } } */ ++/* { dg-final { run-gcov branches { -b pr16855.C } { xfail *-*-darwin* } } } */ Index: gcc/testsuite/g++.dg/opt/pr90026.C =================================================================== --- a/src/gcc/testsuite/g++.dg/opt/pr90026.C (.../tags/gcc_8_3_0_release) @@ -22956,6 +37458,17 @@ +int aq, ar, as, at, au; +void aw() { i(&aq, &ar, as, &at, (e)0, &au); } + +Index: gcc/testsuite/g++.dg/pr71694.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/pr71694.C (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/g++.dg/pr71694.C (.../branches/gcc-8-branch) +@@ -1,5 +1,6 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -fno-store-merging" } */ ++/* { dg-additional-options "-fno-common -mdynamic-no-pic" { target { ia32 && { x86_64-*-darwin* i?86-*-darwin* } } } } */ + + struct B { + B() {} Index: gcc/testsuite/g++.dg/asm-qual-3.C =================================================================== --- a/src/gcc/testsuite/g++.dg/asm-qual-3.C (.../tags/gcc_8_3_0_release) @@ -23083,6 +37596,18 @@ + void bar(); + p j; +}; +Index: gcc/testsuite/g++.dg/cpp0x/pr84497.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/cpp0x/pr84497.C (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/g++.dg/cpp0x/pr84497.C (.../branches/gcc-8-branch) +@@ -1,6 +1,7 @@ + // PR 84497 mismatch with thread constructor fn weakness + // { dg-do compile { target c++11 } } + // { dg-require-weak "" } ++// { dg-require-alias "" } + + struct Base + { Index: gcc/testsuite/g++.dg/cpp0x/decltype-tid1.C =================================================================== --- a/src/gcc/testsuite/g++.dg/cpp0x/decltype-tid1.C (.../tags/gcc_8_3_0_release) @@ -23137,6 +37662,26 @@ +{ + foo ({}); // { dg-error "too few arguments to function" } +} +Index: gcc/testsuite/g++.dg/cpp0x/alignas4.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/cpp0x/alignas4.C (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/g++.dg/cpp0x/alignas4.C (.../branches/gcc-8-branch) +@@ -1,8 +1,14 @@ + // PR c++/59012 + // { dg-do compile { target c++11 } } + // { dg-final { scan-assembler "align 8" { target { { i?86-*-* x86_64-*-* } && { { ! ia32 } && { ! *-*-darwin* } } } } } } +-// { dg-final { scan-assembler "align 4" { target ia32 } } } ++// { dg-final { scan-assembler "align 4" { target { ia32 && { ! *-*-darwin* } } } } } + ++// Darwin produces aligned .zerofill directives for these. ++// { dg-final { scan-assembler {zerofill[^\n\r]+_a,4,2} { target { ilp32 && *-*-darwin* } } } } ++// { dg-final { scan-assembler {zerofill[^\n\r]+_a,8,3} { target { lp64 && *-*-darwin* } } } } ++// { dg-final { scan-assembler {zerofill[^\n\r]+_a2,4,2} { target { ilp32 && *-*-darwin* } } } } ++// { dg-final { scan-assembler {zerofill[^\n\r]+_a2,8,3} { target { lp64 && *-*-darwin* } } } } ++ + template + struct A + { Index: gcc/testsuite/g++.dg/cpp0x/pr89403.C =================================================================== --- a/src/gcc/testsuite/g++.dg/cpp0x/pr89403.C (.../tags/gcc_8_3_0_release) @@ -23236,6 +37781,257 @@ + __builtin_abort (); + return 0; +} +Index: gcc/testsuite/g++.dg/torture/pr91280.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/torture/pr91280.C (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/g++.dg/torture/pr91280.C (.../branches/gcc-8-branch) +@@ -0,0 +1,223 @@ ++// { dg-do compile } ++ ++enum { Aligned, RowMajor }; ++enum { ReadOnlyAccessors }; ++template struct K { ++ enum { value }; ++}; ++template struct traits; ++template struct traits : traits {}; ++struct A { ++ enum { has_write_access, value }; ++}; ++template class array { ++public: ++ int operator[](unsigned long p1) { return values[p1]; } ++ int values[n]; ++}; ++template struct I; ++template class = I> class M; ++template class J; ++template class N; ++template class D; ++template class TensorContractionOp; ++template class TensorChippingOp; ++class C; ++template ++struct K> { ++ static const long value = NumDims; ++}; ++template ++struct traits> { ++ typedef IndexType_ Index; ++}; ++template class MakePointer_> ++struct traits> ++ : traits {}; ++template struct B { typedef T type; }; ++template class N { ++public: ++ typedef typename traits::Index Index; ++ D m_fn1(); ++ template ++ TensorContractionOp ++ m_fn2(OtherDerived, Dimensions); ++ template TensorChippingOp<1, Derived> m_fn3(Index); ++}; ++template ++class N : public N { ++public: ++ template C m_fn4(DeviceType); ++}; ++template struct TensorEvaluator; ++template ++struct TensorEvaluator, Device> { ++ TensorEvaluator(D, Device); ++}; ++template class D { ++public: ++ typedef typename B::type Nested; ++}; ++template ++struct traits< ++ TensorEvaluator, ++ Device_>> { ++ typedef Indices_ Indices; ++ typedef LeftArgType_ LeftArgType; ++ typedef RightArgType_ RightArgType; ++ typedef OutputKernelType_ OutputKernelType; ++ typedef Device_ Device; ++}; ++template ++class TensorContractionOp { ++public: ++ typedef typename B::type Nested; ++ typename LhsXprType::Nested m_fn5(); ++ typename RhsXprType::Nested m_fn6(); ++}; ++template struct TensorContractionEvaluatorBase { ++ typedef typename traits::LeftArgType LeftArgType; ++ typedef typename traits::RightArgType RightArgType; ++ typedef typename traits::Device Device; ++ TensorContractionEvaluatorBase( ++ TensorContractionOp::Indices, LeftArgType, ++ RightArgType, ++ typename traits::OutputKernelType> ++ p1, ++ Device p2) ++ : m_leftImpl(p1.m_fn6(), p2), m_rightImpl(p1.m_fn5(), p2) { ++ long nocontract_idx; ++ for (int i;; i++) { ++ bool contracting; ++ if (contracting) { ++ if (nocontract_idx < K::value) ++ m_j_size = m_j_strides[nocontract_idx]; ++ nocontract_idx++; ++ } ++ } ++ } ++ array m_j_strides; ++ long m_j_size; ++ TensorEvaluator m_leftImpl; ++ TensorEvaluator m_rightImpl; ++}; ++template ++struct TensorEvaluator< ++ const TensorContractionOp, ++ Device> ++ : TensorContractionEvaluatorBase, ++ Device>> { ++ typedef TensorEvaluator Self; ++ typedef TensorContractionEvaluatorBase Base; ++ TensorEvaluator( ++ TensorContractionOp ++ p1, ++ Device p2) ++ : Base(p1, p2) {} ++}; ++template ++struct traits> : traits {}; ++template ++class TensorChippingOp : public N> { ++public: ++ typedef typename B::type Nested; ++}; ++template ++struct TensorEvaluator, Device> { ++ static const int NumInputDims = K::value; ++ array m_dimensions; ++}; ++template ++struct TensorEvaluator, Device> ++ : TensorEvaluator, Device> { ++ TensorEvaluator(TensorChippingOp, Device); ++}; ++template class TensorAssignOp { ++public: ++ TensorAssignOp(TensorChippingOp<0, const M, 1>>, ++ RhsXprType); ++ TensorChippingOp<0, const M, 1>> m_fn7(); ++ typename RhsXprType::Nested m_fn8(); ++}; ++template ++struct TensorEvaluator, ++ Device> { ++ TensorEvaluator(TensorAssignOp p1, Device p2) ++ : m_leftImpl(p1.m_fn7(), p2), m_rightImpl(p1.m_fn8(), p2) {} ++ TensorEvaluator m_leftImpl; ++ TensorEvaluator m_rightImpl; ++}; ++template class F { ++public: ++ static void m_fn9(Expression p1) { ++ int device; ++ TensorEvaluator(p1, device); ++ } ++}; ++class C { ++public: ++ void ++ operator=(TensorContractionOp, ++ TensorChippingOp<1, M, 0>>, ++ const D, 0>>, int> ++ p1) { ++ TensorAssignOp< ++ TensorChippingOp<0, const M, 1>>, ++ const TensorContractionOp< ++ array, TensorChippingOp<1, M, 0>>, ++ const D, 0>>, int>> ++ assign(m_expression, p1); ++ F, 1>>, ++ const TensorContractionOp< ++ array, TensorChippingOp<1, M, 0>>, ++ const D, 0>>, int>>>::m_fn9(assign); ++ } ++ TensorChippingOp<0, const M, 1>> m_expression; ++}; ++template class J { ++public: ++ typedef array Dimensions; ++}; ++template class> ++class M : public N> { ++public: ++ typedef typename PlainObjectType::Dimensions Dimensions; ++}; ++template struct TTypes { ++ typedef M, Aligned> ConstTensor; ++}; ++class L { ++public: ++ template typename TTypes::ConstTensor m_fn10(); ++}; ++class H { ++public: ++ H(int *); ++}; ++class G { ++public: ++ G(H *(int *)); ++}; ++int Run_d; ++class O : H { ++public: ++ int BatchMatMul_context; ++ O() : H(&BatchMatMul_context) { ++ L out, in_y, in_x; ++ auto Tx = in_x.m_fn10(), Ty = in_y.m_fn10(), ++ Tz = out.m_fn10(), z = Tz; ++ array contract_pairs; ++ auto x = Tx.m_fn3<0>(0); ++ auto y = Ty.m_fn1(); ++ z.m_fn4(Run_d) = x.m_fn2(y, contract_pairs); ++ } ++}; ++G registrar__body__0__object([](int *) -> H * { O(); return 0; }); +Index: gcc/testsuite/g++.dg/torture/pr90194.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/torture/pr90194.C (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/g++.dg/torture/pr90194.C (.../branches/gcc-8-branch) +@@ -0,0 +1,18 @@ ++// { dg-do compile } ++// { dg-additional-options "-g" } ++ ++struct cb { ++ int yr; ++}; ++ ++void * ++operator new (__SIZE_TYPE__, void *nq) ++{ ++ return nq; ++} ++ ++void ++af (int xn) ++{ ++ new (&xn) cb { }; ++} Index: gcc/testsuite/g++.dg/torture/pr89698.C =================================================================== --- a/src/gcc/testsuite/g++.dg/torture/pr89698.C (.../tags/gcc_8_3_0_release) @@ -23832,6 +38628,19 @@ void test_int() { A::t = 42; } // { dg-final { scan-assembler-not "\n_?_ZN1AIcE1tE(:|\n|\t)" } } +Index: gcc/testsuite/g++.dg/ext/alignof2.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/ext/alignof2.C (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/g++.dg/ext/alignof2.C (.../branches/gcc-8-branch) +@@ -3,7 +3,7 @@ + // wrong for some fields. + + // { dg-do run } +-// { dg-xfail-run-if "AIX ABI increases struct alignment for first member double" { powerpc-ibm-aix* } } ++// { dg-xfail-run-if "AIX/Darwin ABI increases struct alignment for first member double" { powerpc-ibm-aix* || { ilp32 && powerpc-*-darwin* } } } + + extern "C" void abort(); + Index: gcc/testsuite/g++.dg/ext/asm15.C =================================================================== --- a/src/gcc/testsuite/g++.dg/ext/asm15.C (.../tags/gcc_8_3_0_release) @@ -23906,6 +38715,47 @@ + foo (12.0f, 2.0f); + bar (2.0f); +} +Index: gcc/testsuite/g++.dg/pch/pr90326.Hs +=================================================================== +--- a/src/gcc/testsuite/g++.dg/pch/pr90326.Hs (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/g++.dg/pch/pr90326.Hs (.../branches/gcc-8-branch) +@@ -0,0 +1 @@ ++// empty +Index: gcc/testsuite/g++.dg/pch/pr90326.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/pch/pr90326.C (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/g++.dg/pch/pr90326.C (.../branches/gcc-8-branch) +@@ -0,0 +1,9 @@ ++#include "pr90326.H" ++ ++int main() ++{ ++ float f = __FLT_MAX__; ++ if (f == 0.0) ++ __builtin_abort (); ++ return 0; ++} +Index: gcc/testsuite/g++.dg/gomp/lastprivate-1.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/gomp/lastprivate-1.C (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/g++.dg/gomp/lastprivate-1.C (.../branches/gcc-8-branch) +@@ -0,0 +1,16 @@ ++// PR c++/90950 ++// { dg-do compile } ++ ++template ++T ++foo (void) ++{ ++ T y = 0; ++ T &x = y; ++ #pragma omp parallel for lastprivate (x) ++ for (int i = 0; i < 8; ++i) ++ x = i; ++ return x; ++} ++ ++int a = foo (); Index: gcc/testsuite/g++.dg/gomp/pr89796.C =================================================================== --- a/src/gcc/testsuite/g++.dg/gomp/pr89796.C (.../tags/gcc_8_3_0_release) @@ -24350,6 +39200,617 @@ +S *f11 () { return &T::u7; } +template +int *f12 () { return &T::u8.i; } +Index: gcc/testsuite/objc.dg/no-extra-load.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/no-extra-load.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/no-extra-load.m (.../branches/gcc-8-branch) +@@ -1,7 +1,7 @@ + /* { dg-do compile { target *-*-darwin* } } */ + /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ + +-#include ++#include "../objc-obj-c++-shared/F-NSObject.h" + main() { [NSObject new]; } + + /* { dg-final { scan-assembler-not "L_objc_msgSend\\\$non_lazy_ptr" } } */ +Index: gcc/testsuite/objc.dg/method-6.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/method-6.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/method-6.m (.../branches/gcc-8-branch) +@@ -5,12 +5,12 @@ + /* { dg-options "-Wstrict-selector-match" } */ + + #ifdef __NEXT_RUNTIME__ +-#include +-#define OBJECT NSObject ++# include "../objc-obj-c++-shared/F-NSObject.h" ++# define OBJECT NSObject + #else +-#include +-#include +-#define OBJECT Object ++# include ++# include ++# define OBJECT Object + #endif + + @interface Base +Index: gcc/testsuite/objc.dg/objc-gc-4.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/objc-gc-4.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/objc-gc-4.m (.../branches/gcc-8-branch) +@@ -3,6 +3,7 @@ + /* Contributed by Ziemowit Laski */ + + /* { dg-do compile } */ ++/* { dg-skip-if "GC API is an error from Darwin16." { *-*-darwin1[6-8]* } { "-fnext-runtime" } { "" } } */ + /* { dg-options "-fobjc-gc" } */ + /* { dg-prune-output "cc1obj: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */ + +Index: gcc/testsuite/objc.dg/strings/const-cfstring-5.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/strings/const-cfstring-5.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/strings/const-cfstring-5.m (.../branches/gcc-8-branch) +@@ -6,7 +6,7 @@ + /* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */ + /* { dg-options "-mconstant-cfstrings" } */ + +-#include ++#include "../../objc-obj-c++-shared/F-NSObject.h" + + @interface Foo: NSObject { + char *cString; +Index: gcc/testsuite/objc.dg/strings/const-str-12b.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/strings/const-str-12b.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/strings/const-str-12b.m (.../branches/gcc-8-branch) +@@ -6,11 +6,11 @@ + /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=Foo" { target *-*-darwin* } } */ + + #ifdef __NEXT_RUNTIME__ +-#include +-#define OBJECT NSObject ++# include "../../objc-obj-c++-shared/F-NSObject.h" ++# define OBJECT NSObject + #else +-#include +-#define OBJECT Object ++# include ++# define OBJECT Object + #endif + #include "../../objc-obj-c++-shared/objc-test-suite-types.h" + +Index: gcc/testsuite/objc.dg/strings/const-cfstring-2.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/strings/const-cfstring-2.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/strings/const-cfstring-2.m (.../branches/gcc-8-branch) +@@ -8,8 +8,8 @@ + /* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */ + /* { dg-options "-mconstant-cfstrings -Wnonportable-cfstrings" } */ + +-#import +-#import ++#include "../../objc-obj-c++-shared/F-NSString.h" ++#include "../../objc-obj-c++-shared/CF-CFString.h" + + #ifndef __CONSTANT_CFSTRINGS__ + #error The -fconstant-cfstrings option is not functioning properly +Index: gcc/testsuite/objc.dg/encode-7-next-64bit.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/encode-7-next-64bit.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/encode-7-next-64bit.m (.../branches/gcc-8-branch) +@@ -9,10 +9,11 @@ + #include + #include + #include +-#include ++#include ++#include "../objc-obj-c++-shared/F-NSObject.h" ++#include "../objc-obj-c++-shared/CF-CFString.h" + #include "../objc-obj-c++-shared/runtime.h" + +-extern int printf(char *,...); + void CHECK_IF(const char *s1, const char *s2) + { + if (strcmp(s1,s2) != 0) { +Index: gcc/testsuite/objc.dg/proto-lossage-7.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/proto-lossage-7.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/proto-lossage-7.m (.../branches/gcc-8-branch) +@@ -3,7 +3,7 @@ + /* { dg-do compile } */ + + #ifdef __NEXT_RUNTIME__ +-#include ++#include "../objc-obj-c++-shared/F-NSObject.h" + #define OBJECT NSObject + #else + #include +Index: gcc/testsuite/objc.dg/symtab-1.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/symtab-1.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/symtab-1.m (.../branches/gcc-8-branch) +@@ -4,7 +4,7 @@ + /* { dg-do compile { target { *-*-darwin* } } } */ + /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ + +-#include ++#include "../objc-obj-c++-shared/F-NSObject.h" + + @interface Base: NSObject + - (void)setValues; +Index: gcc/testsuite/objc.dg/headers.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/headers.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/headers.m (.../branches/gcc-8-branch) +@@ -2,6 +2,7 @@ + // test in libstdc++-v3). Author: Loren J. Rittle . + // { dg-options "-Wall -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wshadow" } + // { dg-do compile } ++/* { dg-xfail-if "PR90709" { *-*-darwin1[4-9]* } { "-fnext-runtime" } { "" } } */ + + #ifdef __NEXT_RUNTIME__ + #include +Index: gcc/testsuite/objc.dg/objc-foreach-4.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/objc-foreach-4.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/objc-foreach-4.m (.../branches/gcc-8-branch) +@@ -5,9 +5,9 @@ + /* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */ + /* { dg-additional-options "-framework Foundation" { target { *-*-darwin* } } } */ + +-#include +-#include +-#include ++#include "../objc-obj-c++-shared/F-NSString.h" ++#include "../objc-obj-c++-shared/F-NSAutoreleasePool.h" ++#include "../objc-obj-c++-shared/F-NSArray.h" + + // gcc -o foo foo.m -framework Foundation + +Index: gcc/testsuite/objc.dg/instancetype-0.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/instancetype-0.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/instancetype-0.m (.../branches/gcc-8-branch) +@@ -0,0 +1,30 @@ ++/* Contributed by Iain Sandoe , May 2019. */ ++/* { dg-do compile } */ ++ ++/* Basic check of parsing instancetype. */ ++ ++extern id class_createInstance (id, int); ++extern id class_getSuperclass (id); ++ ++@interface MyObject ++{ ++ Class isa; ++} +++ (instancetype)alloc; ++- (instancetype)init; +++ (instancetype)initialize; +++ (instancetype)factoryMethodA; +++ (id)factoryMethodB; +++ (Class) class; +++ (Class) superclass; ++@end ++ ++@implementation MyObject +++ (instancetype)alloc { return class_createInstance (self, 0); } ++- (instancetype)init { return self; } +++ (instancetype)initialize { return self; } +++ (instancetype)factoryMethodA { return [[[self class] alloc] init]; } +++ (id)factoryMethodB { return [[[self class] alloc] init]; } +++ (Class) class { return self; } +++ (Class) superclass { return class_getSuperclass (self); } ++@end +Index: gcc/testsuite/objc.dg/objc-foreach-5.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/objc-foreach-5.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/objc-foreach-5.m (.../branches/gcc-8-branch) +@@ -4,8 +4,9 @@ + /* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */ + /* { dg-additional-options "-framework Foundation" { target { *-*-darwin* } } } */ + +-#include +-#include ++#include "../objc-obj-c++-shared/F-NSArray.h" ++#include "../objc-obj-c++-shared/F-NSAutoreleasePool.h" ++#include "../objc-obj-c++-shared/F-NSValue.h" + + NSArray * createTestVictim(unsigned capacity) { + NSMutableArray * arr = [[NSMutableArray alloc] initWithCapacity:capacity]; +Index: gcc/testsuite/objc.dg/zero-link-1.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/zero-link-1.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/zero-link-1.m (.../branches/gcc-8-branch) +@@ -5,7 +5,7 @@ + /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ + /* { dg-options "-fzero-link" } */ + +-#include ++#include "../objc-obj-c++-shared/F-NSObject.h" + + extern void abort(void); + #define CHECK_IF(expr) if(!(expr)) abort(); +Index: gcc/testsuite/objc.dg/zero-link-2.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/zero-link-2.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/zero-link-2.m (.../branches/gcc-8-branch) +@@ -5,7 +5,7 @@ + /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ + /* { dg-options "-fno-zero-link" } */ + +-#include ++#include "../objc-obj-c++-shared/F-NSObject.h" + + extern void abort(void); + #define CHECK_IF(expr) if(!(expr)) abort(); +Index: gcc/testsuite/objc.dg/torture/strings/const-str-10.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/torture/strings/const-str-10.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/torture/strings/const-str-10.m (.../branches/gcc-8-branch) +@@ -6,7 +6,8 @@ + /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ + /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ + +-#include ++#include "../../../objc-obj-c++-shared/F-NSObject.h" ++#include + #include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */ + + @interface NSString: NSObject +Index: gcc/testsuite/objc.dg/torture/strings/const-str-11.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/torture/strings/const-str-11.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/torture/strings/const-str-11.m (.../branches/gcc-8-branch) +@@ -7,7 +7,7 @@ + /* { dg-options "-fconstant-string-class=XStr" } */ + /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=XStr" { target *-*-darwin* } } */ + +-#include ++#include "../../../objc-obj-c++-shared/F-NSObject.h" + #include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */ + + @interface XString: NSObject { +Index: gcc/testsuite/objc.dg/torture/strings/const-cfstring-1.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/torture/strings/const-cfstring-1.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/torture/strings/const-cfstring-1.m (.../branches/gcc-8-branch) +@@ -13,8 +13,8 @@ + Well, we don't implement writable ones at this juncture. */ + /* { dg-options "-mconstant-cfstrings -framework Cocoa -Wl,-w" { target *-*-darwin[123]* } } */ + +-#import +-#import ++#include "../../../objc-obj-c++-shared/F-NSString.h" ++#include "../../../objc-obj-c++-shared/CF-CFString.h" + #include + + void printOut(NSString *str) { +Index: gcc/testsuite/objc.dg/torture/strings/const-str-9.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/torture/strings/const-str-9.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/torture/strings/const-str-9.m (.../branches/gcc-8-branch) +@@ -5,7 +5,7 @@ + /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ + /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ + +-#include ++#include "../../../objc-obj-c++-shared/F-NSObject.h" + #include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */ + + @interface NSConstantString: NSObject { +Index: gcc/testsuite/objc.dg/zero-link-3.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/zero-link-3.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/zero-link-3.m (.../branches/gcc-8-branch) +@@ -7,12 +7,12 @@ + /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ + + #ifdef __NEXT_RUNTIME__ +-#include +-#define OBJECT NSObject ++# include "../objc-obj-c++-shared/F-NSObject.h" ++# define OBJECT NSObject + #else +-#include +-#include +-#define OBJECT Object ++# include ++# include ++# define OBJECT Object + #endif + + extern void abort(void); +Index: gcc/testsuite/objc.dg/image-info.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/image-info.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/image-info.m (.../branches/gcc-8-branch) +@@ -7,7 +7,7 @@ + /* { dg-skip-if "NeXT-only" { *-*-* } { "-fgnu-runtime" } { "" } } */ + /* { dg-options "-freplace-objc-classes" } */ + +-#include ++#include "../objc-obj-c++-shared/F-NSObject.h" + + extern void abort(void); + #define CHECK_IF(expr) if(!(expr)) abort(); +Index: gcc/testsuite/objc.dg/isa-field-1.m +=================================================================== +--- a/src/gcc/testsuite/objc.dg/isa-field-1.m (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/objc.dg/isa-field-1.m (.../branches/gcc-8-branch) +@@ -1,5 +1,7 @@ + /* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects. */ + /* { dg-do compile } */ ++/* The use of isa is deprecated, but we still want to test that it works. */ ++/* { dg-additional-options "-Wno-deprecated-declarations" } */ + + #include "../objc-obj-c++-shared/TestsuiteObject.h" + #include "../objc-obj-c++-shared/runtime.h" +Index: gcc/testsuite/obj-c++.dg/stubify-1.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/stubify-1.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/stubify-1.mm (.../branches/gcc-8-branch) +@@ -10,7 +10,7 @@ + int x = 41 ; + + extern "C" { +- extern id objc_msgSend(id self, char * op, ...); ++ extern id objc_msgSend(id self, objc_selector* op, ...); + extern int bogonic (int, int, int); + } + +@@ -20,9 +20,9 @@ + - (Document *) close; + @end + @implementation Document +-- (Document *) class { } +-- (Document *) close { } +-- (Document *) window { } ++- (Document *) class { return (Document *)0; } ++- (Document *) close { return (Document *)0; } ++- (Document *) window { return (Document *)0; } + - (void)willEndCloseSheet:(void *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { + [[self window] close]; + ((void (*)(id, char *, int))objc_msgSend)([self class], (char *)contextInfo, 1); +Index: gcc/testsuite/obj-c++.dg/isa-field-1.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/isa-field-1.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/isa-field-1.mm (.../branches/gcc-8-branch) +@@ -1,5 +1,7 @@ + /* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects. */ + /* { dg-do compile } */ ++/* The use of isa is deprecated, but we still want to test that is works. */ ++/* { dg-additional-options "-Wno-deprecated-declarations" } */ + + #include "../objc-obj-c++-shared/TestsuiteObject.h" + #include "../objc-obj-c++-shared/runtime.h" +Index: gcc/testsuite/obj-c++.dg/try-catch-1.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/try-catch-1.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/try-catch-1.mm (.../branches/gcc-8-branch) +@@ -39,4 +39,5 @@ + @finally { + printf("In @finally block (%d)... ", exc_control); + } ++ return -1; + } +Index: gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm (.../branches/gcc-8-branch) +@@ -2,13 +2,14 @@ + + // { dg-do run { target *-*-darwin* } } + // { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } ++// { dg-skip-if "Headers incompatible with 10.4 APIs" { *-*-darwin1[3-8]* } { "-fnext-runtime" } { "" } } + // { dg-additional-options "-fobjc-call-cxx-cdtors -mmacosx-version-min=10.4 -framework Foundation" } + // This test has no equivalent or meaning for m64/ABI V2 +-// { dg-xfail-run-if "No Test Avail" { *-*-darwin* && lp64 } { "-fnext-runtime" } { "" } } ++// { dg-xfail-run-if "No Test Avail" { *-*-darwin* && lp64 } { "-fnext-runtime" } { "" } } + + #include + #include +-#include ++#include "../objc-obj-c++-shared/F-NSObject.h" + + //extern "C" { int printf(const char *,...); } + #define CHECK_IF(expr) if(!(expr)) abort() +Index: gcc/testsuite/obj-c++.dg/torture/strings/const-str-10.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/torture/strings/const-str-10.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/torture/strings/const-str-10.mm (.../branches/gcc-8-branch) +@@ -6,7 +6,7 @@ + /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ + /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ + +-#include ++#include "../../../objc-obj-c++-shared/F-NSObject.h" + #include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */ + + @interface NSString: NSObject +Index: gcc/testsuite/obj-c++.dg/torture/strings/const-str-11.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/torture/strings/const-str-11.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/torture/strings/const-str-11.mm (.../branches/gcc-8-branch) +@@ -7,7 +7,7 @@ + /* { dg-options "-fconstant-string-class=XStr" } */ + /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=XStr" { target *-*-darwin* } } */ + +-#include ++#include "../../../objc-obj-c++-shared/F-NSObject.h" + #include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */ + + @interface XString: NSObject { +Index: gcc/testsuite/obj-c++.dg/torture/strings/const-cfstring-1.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/torture/strings/const-cfstring-1.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/torture/strings/const-cfstring-1.mm (.../branches/gcc-8-branch) +@@ -13,8 +13,8 @@ + well, we don't implement writable ones at this juncture. */ + /* { dg-options "-mconstant-cfstrings -framework Cocoa -Wl,-w" { target *-*-darwin[123]* } } */ + +-#import +-#import ++#include "../../../objc-obj-c++-shared/F-NSString.h" ++#include "../../../objc-obj-c++-shared/CF-CFString.h" + #include + + void printOut(NSString *str) { +@@ -47,10 +47,10 @@ + checkNSRange([@"Hello World" rangeOfString:(id)CFSTR("World")]); + checkNSRange([(id)CFSTR("Hello World") rangeOfString:(id)CFSTR("World")]); + +- checkCFRange(CFStringFind((CFStringRef)@"Hello World", (CFStringRef)@"World", 0)); +- checkCFRange(CFStringFind(CFSTR("Hello World"), (CFStringRef)@"World", 0)); +- checkCFRange(CFStringFind((CFStringRef)@"Hello World", CFSTR("World"), 0)); +- checkCFRange(CFStringFind(CFSTR("Hello World"), CFSTR("World"), 0)); ++ checkCFRange(CFStringFind((CFStringRef)@"Hello World", (CFStringRef)@"World", (CFStringCompareFlags)0)); ++ checkCFRange(CFStringFind(CFSTR("Hello World"), (CFStringRef)@"World", (CFStringCompareFlags)0)); ++ checkCFRange(CFStringFind((CFStringRef)@"Hello World", CFSTR("World"), (CFStringCompareFlags)0)); ++ checkCFRange(CFStringFind(CFSTR("Hello World"), CFSTR("World"), (CFStringCompareFlags)0)); + + /* Check for string uniquing. */ + if (s0a != s0b || s0a != s2 || s1 != (id)s2) { +Index: gcc/testsuite/obj-c++.dg/torture/strings/const-str-9.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/torture/strings/const-str-9.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/torture/strings/const-str-9.mm (.../branches/gcc-8-branch) +@@ -5,7 +5,7 @@ + /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ + /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */ + +-#include ++#include "../../../objc-obj-c++-shared/F-NSObject.h" + #include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE. */ + + @interface NSConstantString: NSObject { +Index: gcc/testsuite/obj-c++.dg/strings/const-str-12.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/strings/const-str-12.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/strings/const-str-12.mm (.../branches/gcc-8-branch) +@@ -6,7 +6,7 @@ + /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=Foo" { target *-*-darwin* } } */ + + #ifdef __NEXT_RUNTIME__ +-#include ++#include "../../objc-obj-c++-shared/F-NSObject.h" + #define OBJECT NSObject + #else + #include +Index: gcc/testsuite/obj-c++.dg/strings/const-cfstring-2.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/strings/const-cfstring-2.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/strings/const-cfstring-2.mm (.../branches/gcc-8-branch) +@@ -8,8 +8,8 @@ + /* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */ + /* { dg-options "-ftrack-macro-expansion=0 -mconstant-cfstrings -Wnonportable-cfstrings" } */ + +-#import +-#import ++#include "../../objc-obj-c++-shared/F-NSString.h" ++#include "../../objc-obj-c++-shared/CF-CFString.h" + + #ifndef __CONSTANT_CFSTRINGS__ + #error The -fconstant-cfstrings option is not functioning properly +Index: gcc/testsuite/obj-c++.dg/strings/const-cfstring-5.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/strings/const-cfstring-5.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/strings/const-cfstring-5.mm (.../branches/gcc-8-branch) +@@ -6,7 +6,7 @@ + /* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */ + /* { dg-options "-mconstant-cfstrings" } */ + +-#include ++#include "../../objc-obj-c++-shared/F-NSObject.h" + + @interface Foo: NSObject { + char *cString; +Index: gcc/testsuite/obj-c++.dg/stubify-2.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/stubify-2.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/stubify-2.mm (.../branches/gcc-8-branch) +@@ -16,9 +16,9 @@ + - (Document *) close; + @end + @implementation Document +-- (Document *) class { } +-- (Document *) close { } +-- (Document *) window { } ++- (Document *) class { return (Document *)0; } ++- (Document *) close { return (Document *)0; } ++- (Document *) window { return (Document *)0; } + - (void)willEndCloseSheet:(void *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { + [[self window] close]; + ((void (*)(id, char *, int))objc_msgSend)([self class], (char *)contextInfo, 1); +Index: gcc/testsuite/obj-c++.dg/objc-gc-3.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/objc-gc-3.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/objc-gc-3.mm (.../branches/gcc-8-branch) +@@ -3,6 +3,7 @@ + /* Contributed by Ziemowit Laski */ + + /* { dg-do compile } */ ++/* { dg-skip-if "GC API is an error from Darwin16." { *-*-darwin1[6-8]* } { "-fnext-runtime" } { "" } } */ + /* { dg-options "-fobjc-gc" } */ + /* { dg-prune-output "cc1objplus: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */ + +Index: gcc/testsuite/obj-c++.dg/qual-types-1.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/qual-types-1.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/qual-types-1.mm (.../branches/gcc-8-branch) +@@ -4,6 +4,8 @@ + + /* { dg-do run } */ + /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ ++/* { dg-prune-output ".*ld: warning: direct access in.*" } */ ++ + #include "../objc-obj-c++-shared/TestsuiteObject.m" + #include + +Index: gcc/testsuite/obj-c++.dg/proto-lossage-7.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/proto-lossage-7.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/proto-lossage-7.mm (.../branches/gcc-8-branch) +@@ -1,9 +1,11 @@ + /* Check that typedefs of ObjC classes preserve + any @protocol qualifiers. */ + /* { dg-do compile } */ ++/* Suppress warnings that the GNUStep headers introduce. */ ++/* { dg-additional-options "-std=gnu++11 -Wno-expansion-to-defined -Wno-variadic-macros" { target *-*-darwin* } } */ + + #ifdef __NEXT_RUNTIME__ +-#include ++#include "../objc-obj-c++-shared/F-NSObject.h" + #define OBJECT NSObject + #else + #include +Index: gcc/testsuite/obj-c++.dg/syntax-error-1.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/syntax-error-1.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/syntax-error-1.mm (.../branches/gcc-8-branch) +@@ -1,8 +1,10 @@ + /* Graceful handling of a syntax error. */ + /* { dg-do compile } */ ++/* Suppress warnings that the GNUStep headers introduce. */ ++/* { dg-additional-options "-std=gnu++11 -Wno-expansion-to-defined -Wno-variadic-macros" { target *-*-darwin* } } */ + + #ifdef __NEXT_RUNTIME__ +-#include ++#include "../objc-obj-c++-shared/F-NSObject.h" + #define OBJECT NSObject + #else + #include +Index: gcc/testsuite/obj-c++.dg/try-catch-3.mm +=================================================================== +--- a/src/gcc/testsuite/obj-c++.dg/try-catch-3.mm (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/obj-c++.dg/try-catch-3.mm (.../branches/gcc-8-branch) +@@ -15,4 +15,5 @@ + @catch (TestsuiteObject* theException) { + return [theException name]; + } ++ return (const char *)0; + } Index: gcc/testsuite/c-c++-common/pr90108.c =================================================================== --- a/src/gcc/testsuite/c-c++-common/pr90108.c (.../tags/gcc_8_3_0_release) @@ -24384,6 +39845,38 @@ + a = v; + } +} +Index: gcc/testsuite/c-c++-common/gomp/pr90954.c +=================================================================== +--- a/src/gcc/testsuite/c-c++-common/gomp/pr90954.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/testsuite/c-c++-common/gomp/pr90954.c (.../branches/gcc-8-branch) +@@ -0,0 +1,27 @@ ++/* PR sanitizer/90954 */ ++/* { dg-do compile } */ ++/* { dg-options "-fopenmp -fsanitize=undefined" } */ ++ ++float v; ++int i; ++ ++void ++foo (float x, float y) ++{ ++ #pragma omp atomic ++ v += x / y; ++} ++ ++void ++bar (int x, int y) ++{ ++ #pragma omp atomic ++ i += x / y; ++} ++ ++void ++baz (int x, int y) ++{ ++ #pragma omp atomic ++ i *= (x << y); ++} Index: gcc/testsuite/c-c++-common/pr53633-2.c =================================================================== --- a/src/gcc/testsuite/c-c++-common/pr53633-2.c (.../tags/gcc_8_3_0_release) @@ -24460,6 +39953,34 @@ +int i, j; +__attribute__((patchable_function_entry (i))) void baz (void) {} /* { dg-warning "'patchable_function_entry' attribute argument 'i' is not an integer constant" } */ +__attribute__((patchable_function_entry (2, j))) void qux (void) {} /* { dg-warning "'patchable_function_entry' attribute argument 'j' is not an integer constant" } */ +Index: gcc/objcp/ChangeLog +=================================================================== +--- a/src/gcc/objcp/ChangeLog (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/objcp/ChangeLog (.../branches/gcc-8-branch) +@@ -1,3 +1,11 @@ ++2019-08-29 Jakub Jelinek ++ ++ Backported from mainline ++ 2019-05-10 Jakub Jelinek ++ ++ PR pch/90326 ++ * config-lang.in (gtfiles): Don't add c-family/c-cppbuiltin.c. ++ + 2019-02-22 Release Manager + + * GCC 8.3.0 released. +Index: gcc/objcp/config-lang.in +=================================================================== +--- a/src/gcc/objcp/config-lang.in (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/objcp/config-lang.in (.../branches/gcc-8-branch) +@@ -52,7 +52,6 @@ + gtfiles="$gtfiles \ + \$(srcdir)/objc/objc-act.h \ + \$(srcdir)/objc/objc-map.h \ +-\$(srcdir)/c-family/c-cppbuiltin.c \ + \$(srcdir)/objc/objc-act.c \ + \$(srcdir)/objc/objc-gnu-runtime-abi-01.c \ + \$(srcdir)/objc/objc-next-runtime-abi-01.c \ Index: gcc/cp/typeck.c =================================================================== --- a/src/gcc/cp/typeck.c (.../tags/gcc_8_3_0_release) @@ -24677,7 +40198,50 @@ =================================================================== --- a/src/gcc/cp/ChangeLog (.../tags/gcc_8_3_0_release) +++ b/src/gcc/cp/ChangeLog (.../branches/gcc-8-branch) -@@ -1,3 +1,205 @@ +@@ -1,3 +1,248 @@ ++2019-09-03 Iain Sandoe ++ ++ Backported from mainline ++ 2019-08-23 Iain Sandoe ++ ++ PR pch/61250 ++ * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch () ++ after determining that the first token is not ++ PRAGMA_GCC_PCH_PREPROCESS. ++ ++2019-08-30 Richard Biener ++ ++ Backport from mainline ++ 2019-02-21 Richard Biener ++ ++ PR middle-end/89392 ++ * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not ++ make symtab process new functions here. ++ ++2019-08-29 Jakub Jelinek ++ ++ Backported from mainline ++ 2019-06-21 Jakub Jelinek ++ ++ PR c++/90950 ++ * semantics.c (finish_omp_clauses): Don't reject references to ++ incomplete types if processing_template_decl. ++ ++ 2019-05-15 Jakub Jelinek ++ ++ PR debug/90197 ++ * cp-gimplify.c (genericize_cp_loop): Emit a DEBUG_BEGIN_STMT ++ before the condition (or if missing or constant non-zero at the end ++ of the loop. Emit a DEBUG_BEGIN_STMT before the increment expression ++ if any. Don't call protected_set_expr_location on incr if it already ++ has a location. ++ ++ 2019-05-10 Jakub Jelinek ++ ++ PR pch/90326 ++ * config-lang.in (gtfiles): Remove c-family/c-lex.c, add ++ c-family/c-cppbuiltin.c. ++ +2019-08-15 Jonathan Wakely + + Backport from mainline. @@ -24883,6 +40447,66 @@ 2019-02-22 Release Manager * GCC 8.3.0 released. +Index: gcc/cp/cp-gimplify.c +=================================================================== +--- a/src/gcc/cp/cp-gimplify.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/cp/cp-gimplify.c (.../branches/gcc-8-branch) +@@ -202,11 +202,13 @@ + tree blab, clab; + tree exit = NULL; + tree stmt_list = NULL; ++ tree debug_begin = NULL; + + blab = begin_bc_block (bc_break, start_locus); + clab = begin_bc_block (bc_continue, start_locus); + +- protected_set_expr_location (incr, start_locus); ++ if (EXPR_LOCATION (incr) == UNKNOWN_LOCATION) ++ protected_set_expr_location (incr, start_locus); + + cp_walk_tree (&cond, cp_genericize_r, data, NULL); + cp_walk_tree (&body, cp_genericize_r, data, NULL); +@@ -213,6 +215,13 @@ + cp_walk_tree (&incr, cp_genericize_r, data, NULL); + *walk_subtrees = 0; + ++ if (MAY_HAVE_DEBUG_MARKER_STMTS ++ && (!cond || !integer_zerop (cond))) ++ { ++ debug_begin = build0 (DEBUG_BEGIN_STMT, void_type_node); ++ SET_EXPR_LOCATION (debug_begin, EXPR_LOC_OR_LOC (cond, start_locus)); ++ } ++ + if (cond && TREE_CODE (cond) != INTEGER_CST) + { + /* If COND is constant, don't bother building an exit. If it's false, +@@ -225,10 +234,24 @@ + } + + if (exit && cond_is_first) +- append_to_statement_list (exit, &stmt_list); ++ { ++ append_to_statement_list (debug_begin, &stmt_list); ++ debug_begin = NULL_TREE; ++ append_to_statement_list (exit, &stmt_list); ++ } + append_to_statement_list (body, &stmt_list); + finish_bc_block (&stmt_list, bc_continue, clab); +- append_to_statement_list (incr, &stmt_list); ++ if (incr) ++ { ++ if (MAY_HAVE_DEBUG_MARKER_STMTS) ++ { ++ tree d = build0 (DEBUG_BEGIN_STMT, void_type_node); ++ SET_EXPR_LOCATION (d, EXPR_LOC_OR_LOC (incr, start_locus)); ++ append_to_statement_list (d, &stmt_list); ++ } ++ append_to_statement_list (incr, &stmt_list); ++ } ++ append_to_statement_list (debug_begin, &stmt_list); + if (exit && !cond_is_first) + append_to_statement_list (exit, &stmt_list); + Index: gcc/cp/typeck2.c =================================================================== --- a/src/gcc/cp/typeck2.c (.../tags/gcc_8_3_0_release) @@ -25117,7 +40741,17 @@ return true; } -@@ -8452,6 +8462,11 @@ +@@ -7305,7 +7315,8 @@ + t = require_complete_type (t); + if (t == error_mark_node) + remove = true; +- else if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE ++ else if (!processing_template_decl ++ && TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE + && !complete_type_or_else (TREE_TYPE (TREE_TYPE (t)), t)) + remove = true; + } +@@ -8452,6 +8463,11 @@ stmt = build2 (OMP_ATOMIC, void_type_node, integer_zero_node, stmt); OMP_ATOMIC_SEQ_CST (stmt) = seq_cst; } @@ -25389,6 +41023,31 @@ /* Look for the opening `('. */ if (!cp_parser_require (parser, CPP_OPEN_PAREN, RT_OPEN_PAREN)) return; +@@ -38680,7 +38734,10 @@ + + cp_lexer_get_preprocessor_token (NULL, first_token); + if (cp_parser_pragma_kind (first_token) != PRAGMA_GCC_PCH_PREPROCESS) +- return; ++ { ++ c_common_no_more_pch (); ++ return; ++ } + + cp_lexer_get_preprocessor_token (NULL, first_token); + if (first_token->type == CPP_STRING) +Index: gcc/cp/config-lang.in +=================================================================== +--- a/src/gcc/cp/config-lang.in (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/cp/config-lang.in (.../branches/gcc-8-branch) +@@ -37,7 +37,7 @@ + \$(srcdir)/c-family/c-pragma.h \$(srcdir)/cp/decl.h \ + \$(srcdir)/cp/parser.h \ + \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-format.c \ +-\$(srcdir)/c-family/c-lex.c \$(srcdir)/c-family/c-pragma.c \ ++\$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.c \ + \$(srcdir)/cp/call.c \$(srcdir)/cp/class.c \$(srcdir)/cp/constexpr.c \ + \$(srcdir)/cp/cp-gimplify.c \ + \$(srcdir)/cp/cp-lang.c \$(srcdir)/cp/cp-objcp-common.c \ Index: gcc/cp/call.c =================================================================== --- a/src/gcc/cp/call.c (.../tags/gcc_8_3_0_release) @@ -25456,6 +41115,19 @@ finish_member_declaration (field); } +Index: gcc/cp/vtable-class-hierarchy.c +=================================================================== +--- a/src/gcc/cp/vtable-class-hierarchy.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/cp/vtable-class-hierarchy.c (.../branches/gcc-8-branch) +@@ -1191,8 +1191,6 @@ + gimplify_function_tree (vtv_fndecl); + cgraph_node::add_new_function (vtv_fndecl, false); + +- symtab->process_new_functions (); +- + if (flag_vtable_verify == VTV_PREINIT_PRIORITY && !TARGET_PECOFF) + assemble_vtv_preinit_initializer (vtv_fndecl); + Index: gcc/cp/mangle.c =================================================================== --- a/src/gcc/cp/mangle.c (.../tags/gcc_8_3_0_release) @@ -25550,6 +41222,147 @@ /* When the old decl was a con-/destructor make sure the clone isn't. */ DECL_STATIC_CONSTRUCTOR (new_decl) = 0; DECL_STATIC_DESTRUCTOR (new_decl) = 0; +Index: gcc/tree-ssa-loop-ivopts.c +=================================================================== +--- a/src/gcc/tree-ssa-loop-ivopts.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-ssa-loop-ivopts.c (.../branches/gcc-8-branch) +@@ -582,6 +582,9 @@ + /* The common candidates. */ + vec iv_common_cands; + ++ /* Hash map recording base object information of tree exp. */ ++ hash_map *base_object_map; ++ + /* The maximum invariant variable id. */ + unsigned max_inv_var_id; + +@@ -1093,6 +1096,7 @@ + data->vcands.create (20); + data->inv_expr_tab = new hash_table (10); + data->name_expansion_cache = NULL; ++ data->base_object_map = NULL; + data->iv_common_cand_tab = new hash_table (10); + data->iv_common_cands.create (20); + decl_rtl_to_reset.create (20); +@@ -1099,55 +1103,61 @@ + gcc_obstack_init (&data->iv_obstack); + } + +-/* Returns a memory object to that EXPR points. In case we are able to +- determine that it does not point to any such object, NULL is returned. */ ++/* walk_tree callback for determine_base_object. */ + + static tree +-determine_base_object (tree expr) ++determine_base_object_1 (tree *tp, int *walk_subtrees, void *wdata) + { +- enum tree_code code = TREE_CODE (expr); +- tree base, obj; +- +- /* If this is a pointer casted to any type, we need to determine +- the base object for the pointer; so handle conversions before +- throwing away non-pointer expressions. */ +- if (CONVERT_EXPR_P (expr)) +- return determine_base_object (TREE_OPERAND (expr, 0)); +- +- if (!POINTER_TYPE_P (TREE_TYPE (expr))) +- return NULL_TREE; +- +- switch (code) ++ tree_code code = TREE_CODE (*tp); ++ tree obj = NULL_TREE; ++ if (code == ADDR_EXPR) + { +- case INTEGER_CST: +- return NULL_TREE; +- +- case ADDR_EXPR: +- obj = TREE_OPERAND (expr, 0); +- base = get_base_address (obj); +- ++ tree base = get_base_address (TREE_OPERAND (*tp, 0)); + if (!base) +- return expr; ++ obj = *tp; ++ else if (TREE_CODE (base) != MEM_REF) ++ obj = fold_convert (ptr_type_node, build_fold_addr_expr (base)); ++ } ++ else if (code == SSA_NAME && POINTER_TYPE_P (TREE_TYPE (*tp))) ++ obj = fold_convert (ptr_type_node, *tp); + +- if (TREE_CODE (base) == MEM_REF) +- return determine_base_object (TREE_OPERAND (base, 0)); ++ if (!obj) ++ { ++ if (!EXPR_P (*tp)) ++ *walk_subtrees = 0; + +- return fold_convert (ptr_type_node, +- build_fold_addr_expr (base)); ++ return NULL_TREE; ++ } ++ /* Record special node for multiple base objects and stop. */ ++ if (*static_cast (wdata)) ++ { ++ *static_cast (wdata) = integer_zero_node; ++ return integer_zero_node; ++ } ++ /* Record the base object and continue looking. */ ++ *static_cast (wdata) = obj; ++ return NULL_TREE; ++} + +- case POINTER_PLUS_EXPR: +- return determine_base_object (TREE_OPERAND (expr, 0)); ++/* Returns a memory object to that EXPR points with caching. Return NULL if we ++ are able to determine that it does not point to any such object; specially ++ return integer_zero_node if EXPR contains multiple base objects. */ + +- case PLUS_EXPR: +- case MINUS_EXPR: +- /* Pointer addition is done solely using POINTER_PLUS_EXPR. */ +- gcc_unreachable (); ++static tree ++determine_base_object (struct ivopts_data *data, tree expr) ++{ ++ tree *slot, obj = NULL_TREE; ++ if (data->base_object_map) ++ { ++ if ((slot = data->base_object_map->get(expr)) != NULL) ++ return *slot; ++ } ++ else ++ data->base_object_map = new hash_map; + +- default: +- if (POLY_INT_CST_P (expr)) +- return NULL_TREE; +- return fold_convert (ptr_type_node, expr); +- } ++ (void) walk_tree_without_duplicates (&expr, determine_base_object_1, &obj); ++ data->base_object_map->put (expr, obj); ++ return obj; + } + + /* Return true if address expression with non-DECL_P operand appears +@@ -1205,7 +1215,7 @@ + } + + iv->base = base; +- iv->base_object = determine_base_object (base); ++ iv->base_object = determine_base_object (data, base); + iv->step = step; + iv->biv_p = false; + iv->nonlin_use = NULL; +@@ -7487,6 +7497,8 @@ + delete data->inv_expr_tab; + data->inv_expr_tab = NULL; + free_affine_expand_cache (&data->name_expansion_cache); ++ if (data->base_object_map) ++ delete data->base_object_map; + delete data->iv_common_cand_tab; + data->iv_common_cand_tab = NULL; + data->iv_common_cands.release (); Index: gcc/df-core.c =================================================================== --- a/src/gcc/df-core.c (.../tags/gcc_8_3_0_release) @@ -25593,6 +41406,18 @@ return false; last_in_row = next_ps_i; +Index: gcc/lto-streamer-out.c +=================================================================== +--- a/src/gcc/lto-streamer-out.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/lto-streamer-out.c (.../branches/gcc-8-branch) +@@ -1945,6 +1945,7 @@ + /* Write OMP SIMD related info. */ + streamer_write_hwi (ob, loop->safelen); + streamer_write_hwi (ob, loop->unroll); ++ streamer_write_hwi (ob, loop->owned_clique); + streamer_write_hwi (ob, loop->dont_vectorize); + streamer_write_hwi (ob, loop->force_vectorize); + stream_write_tree (ob, loop->simduid, true); Index: gcc/xcoffout.c =================================================================== --- a/src/gcc/xcoffout.c (.../tags/gcc_8_3_0_release) @@ -25905,6 +41730,22 @@ for (i = 0; i < nr; ++i) { int j = ltrans_priorities[i*2 + 1]; +Index: gcc/tree-ssa-sink.c +=================================================================== +--- a/src/gcc/tree-ssa-sink.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-ssa-sink.c (.../branches/gcc-8-branch) +@@ -439,7 +439,10 @@ + if (sinkbb == frombb) + return false; + +- *togsi = gsi_for_stmt (use); ++ if (sinkbb == gimple_bb (use)) ++ *togsi = gsi_for_stmt (use); ++ else ++ *togsi = gsi_after_labels (sinkbb); + + return true; + } Index: gcc/dwarf2out.c =================================================================== --- a/src/gcc/dwarf2out.c (.../tags/gcc_8_3_0_release) @@ -26057,6 +41898,24 @@ *slot = ctnode; } +Index: gcc/match.pd +=================================================================== +--- a/src/gcc/match.pd (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/match.pd (.../branches/gcc-8-branch) +@@ -2406,6 +2406,13 @@ + && TYPE_UNSIGNED (TREE_TYPE (@1))))) + (view_convert @1))) + ++/* Simplify a view-converted empty constructor. */ ++(simplify ++ (view_convert CONSTRUCTOR@0) ++ (if (TREE_CODE (@0) != SSA_NAME ++ && CONSTRUCTOR_NELTS (@0) == 0) ++ { build_zero_cst (type); })) ++ + /* Re-association barriers around constants and other re-association + barriers can be removed. */ + (simplify Index: gcc/expr.c =================================================================== --- a/src/gcc/expr.c (.../tags/gcc_8_3_0_release) @@ -26192,11 +42051,42 @@ win = 1; break; +Index: gcc/ada/libgnat/system-darwin-ppc.ads +=================================================================== +--- a/src/gcc/ada/libgnat/system-darwin-ppc.ads (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/ada/libgnat/system-darwin-ppc.ads (.../branches/gcc-8-branch) +@@ -158,7 +158,7 @@ + Preallocated_Stacks : constant Boolean := False; + Signed_Zeros : constant Boolean := True; + Stack_Check_Default : constant Boolean := False; +- Stack_Check_Probes : constant Boolean := False; ++ Stack_Check_Probes : constant Boolean := True; + Stack_Check_Limits : constant Boolean := False; + Support_Aggregates : constant Boolean := True; + Support_Atomic_Primitives : constant Boolean := Word_Size = 64; Index: gcc/ada/ChangeLog =================================================================== --- a/src/gcc/ada/ChangeLog (.../tags/gcc_8_3_0_release) +++ b/src/gcc/ada/ChangeLog (.../branches/gcc-8-branch) -@@ -1,3 +1,62 @@ +@@ -1,3 +1,80 @@ ++2019-09-01 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-07-02 Iain Sandoe ++ ++ * libgnat/system-darwin-ppc.ads: Set Stack_Check_Probes True for ++ PPC Darwin. ++ ++2019-08-05 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-06-30 Iain Sandoe ++ ++ * gnatlink.adb (Link_Step): Push -shared-libgcc explicitly, when it ++ is the target default (unless overidden by the static flag). ++ When the user has put an instance of shared/static-libgcc do not push ++ a duplicate of this. ++ +2019-06-29 Eric Botcazou + + * gcc-interface/decl.c (gnat_to_gnu_entity): Beep up comment on SAVED, @@ -26534,6 +42424,76 @@ end if; Rewrite (N, +Index: gcc/ada/gnatlink.adb +=================================================================== +--- a/src/gcc/ada/gnatlink.adb (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/ada/gnatlink.adb (.../branches/gcc-8-branch) +@@ -1882,6 +1882,7 @@ + Clean_Link_Option_Set : declare + J : Natural; + Shared_Libgcc_Seen : Boolean := False; ++ Static_Libgcc_Seen : Boolean := False; + + begin + J := Linker_Options.First; +@@ -1903,7 +1904,7 @@ + end if; + end if; + +- -- Remove duplicate -shared-libgcc switch ++ -- Remove duplicate -shared-libgcc switches + + if Linker_Options.Table (J).all = Shared_Libgcc_String then + if Shared_Libgcc_Seen then +@@ -1917,6 +1918,20 @@ + end if; + end if; + ++ -- Remove duplicate -static-libgcc switches ++ ++ if Linker_Options.Table (J).all = Static_Libgcc_String then ++ if Static_Libgcc_Seen then ++ Linker_Options.Table (J .. Linker_Options.Last - 1) := ++ Linker_Options.Table (J + 1 .. Linker_Options.Last); ++ Linker_Options.Decrement_Last; ++ Num_Args := Num_Args - 1; ++ ++ else ++ Static_Libgcc_Seen := True; ++ end if; ++ end if; ++ + -- Here we just check for a canonical form that matches the + -- pragma Linker_Options set in the NT runtime. + +@@ -1948,14 +1963,27 @@ + -- libgcc, if gcc is not called with -shared-libgcc, call it + -- with -static-libgcc, as there are some platforms where one + -- of these two switches is compulsory to link. ++ -- Don't push extra switches if we already saw one. + + if Shared_Libgcc_Default = 'T' + and then not Shared_Libgcc_Seen ++ and then not Static_Libgcc_Seen + then + Linker_Options.Increment_Last; + Linker_Options.Table (Linker_Options.Last) := Static_Libgcc; + Num_Args := Num_Args + 1; + end if; ++ ++ -- Likewise, the reverse. ++ ++ if Shared_Libgcc_Default = 'H' ++ and then not Static_Libgcc_Seen ++ and then not Shared_Libgcc_Seen ++ then ++ Linker_Options.Increment_Last; ++ Linker_Options.Table (Linker_Options.Last) := Shared_Libgcc; ++ Num_Args := Num_Args + 1; ++ end if; + end if; + end Clean_Link_Option_Set; + Index: gcc/ada/osint.adb =================================================================== --- a/src/gcc/ada/osint.adb (.../tags/gcc_8_3_0_release) @@ -26887,6 +42847,26 @@ + #undef AARCH64_CPU_NAME_LENGTH +Index: gcc/dse.c +=================================================================== +--- a/src/gcc/dse.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/dse.c (.../branches/gcc-8-branch) +@@ -2515,10 +2515,13 @@ + clear_rhs_from_active_local_stores (); + } + } +- else if (SIBLING_CALL_P (insn) && reload_completed) ++ else if (SIBLING_CALL_P (insn) ++ && (reload_completed || HARD_FRAME_POINTER_IS_ARG_POINTER)) + /* Arguments for a sibling call that are pushed to memory are passed + using the incoming argument pointer of the current function. After +- reload that might be (and likely is) frame pointer based. */ ++ reload that might be (and likely is) frame pointer based. And, if ++ it is a frame pointer on the target, even before reload we need to ++ kill frame pointer based stores. */ + add_wild_read (bb_info); + else + /* Every other call, including pure functions, may read any memory Index: gcc/tree-ssa-ifcombine.c =================================================================== --- a/src/gcc/tree-ssa-ifcombine.c (.../tags/gcc_8_3_0_release) @@ -26916,7 +42896,15 @@ =================================================================== --- a/src/gcc/lto-streamer-in.c (.../tags/gcc_8_3_0_release) +++ b/src/gcc/lto-streamer-in.c (.../branches/gcc-8-branch) -@@ -1131,6 +1131,14 @@ +@@ -826,6 +826,7 @@ + /* Read OMP SIMD related info. */ + loop->safelen = streamer_read_hwi (ib); + loop->unroll = streamer_read_hwi (ib); ++ loop->owned_clique = streamer_read_hwi (ib); + loop->dont_vectorize = streamer_read_hwi (ib); + loop->force_vectorize = streamer_read_hwi (ib); + loop->simduid = stream_read_tree (ib, data_in); +@@ -1131,6 +1132,14 @@ ? !MAY_HAVE_DEBUG_MARKER_STMTS : !MAY_HAVE_DEBUG_BIND_STMTS)) remove = true; @@ -27342,7 +43330,68 @@ } } -@@ -7156,7 +7164,7 @@ +@@ -3891,7 +3899,6 @@ + return MATCH_YES; + } + +- + m = gfc_match (" type ("); + matched_type = (m == MATCH_YES); + if (matched_type) +@@ -3940,7 +3947,10 @@ + m = MATCH_YES; + + if (matched_type && m == MATCH_YES && gfc_match_char (')') != MATCH_YES) +- m = MATCH_ERROR; ++ { ++ gfc_error ("Malformed type-spec at %C"); ++ return MATCH_ERROR; ++ } + + return m; + } +@@ -3963,8 +3973,12 @@ + && !gfc_notify_std (GFC_STD_F2008, "TYPE with " + "intrinsic-type-spec at %C")) + return MATCH_ERROR; ++ + if (matched_type && gfc_match_char (')') != MATCH_YES) +- return MATCH_ERROR; ++ { ++ gfc_error ("Malformed type-spec at %C"); ++ return MATCH_ERROR; ++ } + + ts->type = BT_REAL; + ts->kind = gfc_default_double_kind; +@@ -3994,7 +4008,10 @@ + return MATCH_ERROR; + + if (matched_type && gfc_match_char (')') != MATCH_YES) +- return MATCH_ERROR; ++ { ++ gfc_error ("Malformed type-spec at %C"); ++ return MATCH_ERROR; ++ } + + ts->type = BT_COMPLEX; + ts->kind = gfc_default_double_kind; +@@ -4015,7 +4032,13 @@ + if (m == MATCH_ERROR) + return m; + +- m = gfc_match_char (')'); ++ gfc_gobble_whitespace (); ++ if (gfc_peek_ascii_char () != ')') ++ { ++ gfc_error ("Malformed type-spec at %C"); ++ return MATCH_ERROR; ++ } ++ m = gfc_match_char (')'); /* Burn closing ')'. */ + } + + if (m != MATCH_YES) +@@ -7156,7 +7179,7 @@ name is a global identifier. */ if (!binding_label || gfc_notification_std (GFC_STD_F2008)) { @@ -27351,7 +43400,7 @@ if (s->defined || (s->type != GSYM_UNKNOWN && s->type != type)) { -@@ -7178,7 +7186,7 @@ +@@ -7178,7 +7201,7 @@ && (!gfc_notification_std (GFC_STD_F2008) || strcmp (name, binding_label) != 0)) { @@ -27454,7 +43503,14 @@ =================================================================== --- a/src/gcc/fortran/ChangeLog (.../tags/gcc_8_3_0_release) +++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-8-branch) -@@ -1,3 +1,364 @@ +@@ -1,3 +1,371 @@ ++2019-09-05 Steven G. Kargl ++ ++ PR fortran/91660 ++ * gfortran.dg/pdt_4.f03: Fix invalid code. ++ * gfortran.dg/pr91660_1.f90: New test. ++ * gfortran.dg/pr91660_2.f90: Ditto. ++ +2013-08-13 Thomas Koenig + + Backport from trunk @@ -29084,6 +45140,317 @@ ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` fi +Index: gcc/gcse.c +=================================================================== +--- a/src/gcc/gcse.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/gcse.c (.../branches/gcc-8-branch) +@@ -1532,7 +1532,8 @@ + 0, regno, hrsi) + record_last_reg_set_info (insn, regno); + +- if (! RTL_CONST_OR_PURE_CALL_P (insn)) ++ if (! RTL_CONST_OR_PURE_CALL_P (insn) ++ || RTL_LOOPING_CONST_OR_PURE_CALL_P (insn)) + record_last_mem_set_info (insn); + } + +Index: gcc/tree-vect-loop.c +=================================================================== +--- a/src/gcc/tree-vect-loop.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-vect-loop.c (.../branches/gcc-8-branch) +@@ -4551,14 +4551,9 @@ + unsigned HOST_WIDE_INT nunits; + unsigned j, number_of_places_left_in_vector; + tree vector_type; +- tree vop; +- int group_size = stmts.length (); +- unsigned int vec_num, i; +- unsigned number_of_copies = 1; +- vec voprnds; +- voprnds.create (number_of_vectors); ++ unsigned int group_size = stmts.length (); ++ unsigned int i; + struct loop *loop; +- auto_vec permute_results; + + vector_type = STMT_VINFO_VECTYPE (stmt_vinfo); + +@@ -4589,119 +4584,79 @@ + if (!TYPE_VECTOR_SUBPARTS (vector_type).is_constant (&nunits)) + nunits = group_size; + +- number_of_copies = nunits * number_of_vectors / group_size; +- + number_of_places_left_in_vector = nunits; + bool constant_p = true; + tree_vector_builder elts (vector_type, nunits, 1); + elts.quick_grow (nunits); +- for (j = 0; j < number_of_copies; j++) ++ gimple_seq ctor_seq = NULL; ++ for (j = 0; j < nunits * number_of_vectors; ++j) + { +- for (i = group_size - 1; stmts.iterate (i, &stmt); i--) +- { +- tree op; +- /* Get the def before the loop. In reduction chain we have only +- one initial value. */ +- if ((j != (number_of_copies - 1) +- || (reduc_chain && i != 0)) +- && neutral_op) +- op = neutral_op; +- else +- op = PHI_ARG_DEF_FROM_EDGE (stmt, pe); ++ tree op; ++ i = j % group_size; ++ stmt_vinfo = vinfo_for_stmt (stmts[i]); + +- /* Create 'vect_ = {op0,op1,...,opn}'. */ +- number_of_places_left_in_vector--; +- elts[number_of_places_left_in_vector] = op; +- if (!CONSTANT_CLASS_P (op)) +- constant_p = false; ++ /* Get the def before the loop. In reduction chain we have only ++ one initial value. Else we have as many as PHIs in the group. */ ++ if (reduc_chain) ++ op = j != 0 ? neutral_op : PHI_ARG_DEF_FROM_EDGE (stmt_vinfo->stmt, pe); ++ else if (((vec_oprnds->length () + 1) * nunits ++ - number_of_places_left_in_vector >= group_size) ++ && neutral_op) ++ op = neutral_op; ++ else ++ op = PHI_ARG_DEF_FROM_EDGE (stmt_vinfo->stmt, pe); + +- if (number_of_places_left_in_vector == 0) +- { +- gimple_seq ctor_seq = NULL; +- tree init; +- if (constant_p && !neutral_op +- ? multiple_p (TYPE_VECTOR_SUBPARTS (vector_type), nunits) +- : known_eq (TYPE_VECTOR_SUBPARTS (vector_type), nunits)) +- /* Build the vector directly from ELTS. */ +- init = gimple_build_vector (&ctor_seq, &elts); +- else if (neutral_op) ++ /* Create 'vect_ = {op0,op1,...,opn}'. */ ++ number_of_places_left_in_vector--; ++ elts[nunits - number_of_places_left_in_vector - 1] = op; ++ if (!CONSTANT_CLASS_P (op)) ++ constant_p = false; ++ ++ if (number_of_places_left_in_vector == 0) ++ { ++ tree init; ++ if (constant_p && !neutral_op ++ ? multiple_p (TYPE_VECTOR_SUBPARTS (vector_type), nunits) ++ : known_eq (TYPE_VECTOR_SUBPARTS (vector_type), nunits)) ++ /* Build the vector directly from ELTS. */ ++ init = gimple_build_vector (&ctor_seq, &elts); ++ else if (neutral_op) ++ { ++ /* Build a vector of the neutral value and shift the ++ other elements into place. */ ++ init = gimple_build_vector_from_val (&ctor_seq, vector_type, ++ neutral_op); ++ int k = nunits; ++ while (k > 0 && elts[k - 1] == neutral_op) ++ k -= 1; ++ while (k > 0) + { +- /* Build a vector of the neutral value and shift the +- other elements into place. */ +- init = gimple_build_vector_from_val (&ctor_seq, vector_type, +- neutral_op); +- int k = nunits; +- while (k > 0 && elts[k - 1] == neutral_op) +- k -= 1; +- while (k > 0) +- { +- k -= 1; +- gcall *call = gimple_build_call_internal +- (IFN_VEC_SHL_INSERT, 2, init, elts[k]); +- init = make_ssa_name (vector_type); +- gimple_call_set_lhs (call, init); +- gimple_seq_add_stmt (&ctor_seq, call); +- } ++ k -= 1; ++ gcall *call = gimple_build_call_internal ++ (IFN_VEC_SHL_INSERT, 2, init, elts[k]); ++ init = make_ssa_name (vector_type); ++ gimple_call_set_lhs (call, init); ++ gimple_seq_add_stmt (&ctor_seq, call); + } +- else +- { +- /* First time round, duplicate ELTS to fill the +- required number of vectors, then cherry pick the +- appropriate result for each iteration. */ +- if (vec_oprnds->is_empty ()) +- duplicate_and_interleave (&ctor_seq, vector_type, elts, +- number_of_vectors, +- permute_results); +- init = permute_results[number_of_vectors - j - 1]; +- } +- if (ctor_seq != NULL) +- gsi_insert_seq_on_edge_immediate (pe, ctor_seq); +- voprnds.quick_push (init); +- +- number_of_places_left_in_vector = nunits; +- elts.new_vector (vector_type, nunits, 1); +- elts.quick_grow (nunits); +- constant_p = true; +- } +- } +- } +- +- /* Since the vectors are created in the reverse order, we should invert +- them. */ +- vec_num = voprnds.length (); +- for (j = vec_num; j != 0; j--) +- { +- vop = voprnds[j - 1]; +- vec_oprnds->quick_push (vop); +- } +- +- voprnds.release (); +- +- /* In case that VF is greater than the unrolling factor needed for the SLP +- group of stmts, NUMBER_OF_VECTORS to be created is greater than +- NUMBER_OF_SCALARS/NUNITS or NUNITS/NUMBER_OF_SCALARS, and hence we have +- to replicate the vectors. */ +- tree neutral_vec = NULL; +- while (number_of_vectors > vec_oprnds->length ()) +- { +- if (neutral_op) +- { +- if (!neutral_vec) ++ } ++ else + { +- gimple_seq ctor_seq = NULL; +- neutral_vec = gimple_build_vector_from_val +- (&ctor_seq, vector_type, neutral_op); +- if (ctor_seq != NULL) +- gsi_insert_seq_on_edge_immediate (pe, ctor_seq); ++ /* First time round, duplicate ELTS to fill the ++ required number of vectors. */ ++ duplicate_and_interleave (&ctor_seq, vector_type, elts, ++ number_of_vectors, *vec_oprnds); ++ break; + } +- vec_oprnds->quick_push (neutral_vec); +- } +- else +- { +- for (i = 0; vec_oprnds->iterate (i, &vop) && i < vec_num; i++) +- vec_oprnds->quick_push (vop); +- } ++ vec_oprnds->quick_push (init); ++ ++ number_of_places_left_in_vector = nunits; ++ elts.new_vector (vector_type, nunits, 1); ++ elts.quick_grow (nunits); ++ constant_p = true; ++ } + } ++ if (ctor_seq != NULL) ++ gsi_insert_seq_on_edge_immediate (pe, ctor_seq); + } + + +Index: gcc/tree-data-ref.c +=================================================================== +--- a/src/gcc/tree-data-ref.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-data-ref.c (.../branches/gcc-8-branch) +@@ -2230,7 +2230,7 @@ + + bool + dr_may_alias_p (const struct data_reference *a, const struct data_reference *b, +- bool loop_nest) ++ struct loop *loop_nest) + { + tree addr_a = DR_BASE_OBJECT (a); + tree addr_b = DR_BASE_OBJECT (b); +@@ -2254,6 +2254,11 @@ + + if ((TREE_CODE (addr_a) == MEM_REF || TREE_CODE (addr_a) == TARGET_MEM_REF) + && (TREE_CODE (addr_b) == MEM_REF || TREE_CODE (addr_b) == TARGET_MEM_REF) ++ /* For cross-iteration dependences the cliques must be valid for the ++ whole loop, not just individual iterations. */ ++ && (!loop_nest ++ || MR_DEPENDENCE_CLIQUE (addr_a) == 1 ++ || MR_DEPENDENCE_CLIQUE (addr_a) == loop_nest->owned_clique) + && MR_DEPENDENCE_CLIQUE (addr_a) == MR_DEPENDENCE_CLIQUE (addr_b) + && MR_DEPENDENCE_BASE (addr_a) != MR_DEPENDENCE_BASE (addr_b)) + return false; +@@ -2365,7 +2370,7 @@ + } + + /* If the data references do not alias, then they are independent. */ +- if (!dr_may_alias_p (a, b, loop_nest.exists ())) ++ if (!dr_may_alias_p (a, b, loop_nest.exists () ? loop_nest[0] : NULL)) + { + DDR_ARE_DEPENDENT (res) = chrec_known; + return res; +@@ -4048,9 +4053,9 @@ + } + + else if (evolution_function_is_affine_multivariate_p (chrec_a, loop_nest->num) +- && !chrec_contains_symbols (chrec_a) ++ && !chrec_contains_symbols (chrec_a, loop_nest) + && evolution_function_is_affine_multivariate_p (chrec_b, loop_nest->num) +- && !chrec_contains_symbols (chrec_b)) ++ && !chrec_contains_symbols (chrec_b, loop_nest)) + { + /* testsuite/.../ssa-chrec-35.c + {0, +, 1}_2 vs. {0, +, 1}_3 +@@ -4260,6 +4265,7 @@ + { + unsigned i; + lambda_vector init_v = lambda_vector_new (DDR_NB_LOOPS (ddr)); ++ struct loop *loop = DDR_LOOP_NEST (ddr)[0]; + + for (i = 0; i < DDR_NUM_SUBSCRIPTS (ddr); i++) + { +@@ -4290,6 +4296,15 @@ + return false; + } + ++ /* When data references are collected in a loop while data ++ dependences are analyzed in loop nest nested in the loop, we ++ would have more number of access functions than number of ++ loops. Skip access functions of loops not in the loop nest. ++ ++ See PR89725 for more information. */ ++ if (flow_loop_nested_p (get_loop (cfun, var_a), loop)) ++ continue; ++ + dist = int_cst_value (SUB_DISTANCE (subscript)); + index = index_in_loop_nest (var_a, DDR_LOOP_NEST (ddr)); + *index_carry = MIN (index, *index_carry); +@@ -4401,6 +4416,7 @@ + unsigned i; + int index_carry = DDR_NB_LOOPS (ddr); + subscript *sub; ++ struct loop *loop = DDR_LOOP_NEST (ddr)[0]; + + FOR_EACH_VEC_ELT (DDR_SUBSCRIPTS (ddr), i, sub) + { +@@ -4430,6 +4446,16 @@ + return; + } + ++ /* When data references are collected in a loop while data ++ dependences are analyzed in loop nest nested in the loop, we ++ would have more number of access functions than number of ++ loops. Skip access functions of loops not in the loop nest. ++ ++ See PR89725 for more information. */ ++ if (flow_loop_nested_p (get_loop (cfun, CHREC_VARIABLE (access_fun)), ++ loop)) ++ continue; ++ + index_carry = MIN (index_carry, + index_in_loop_nest (CHREC_VARIABLE (access_fun), + DDR_LOOP_NEST (ddr))); Index: gcc/loop-unroll.c =================================================================== --- a/src/gcc/loop-unroll.c (.../tags/gcc_8_3_0_release) @@ -29119,11 +45486,55 @@ /* We rely on the fact that the compare and jump cannot be optimized out, and hence the cfg we create is correct. */ +Index: gcc/tree-data-ref.h +=================================================================== +--- a/src/gcc/tree-data-ref.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-data-ref.h (.../branches/gcc-8-branch) +@@ -475,7 +475,7 @@ + } + + extern bool dr_may_alias_p (const struct data_reference *, +- const struct data_reference *, bool); ++ const struct data_reference *, struct loop *); + extern bool dr_equal_offsets_p (struct data_reference *, + struct data_reference *); + Index: gcc/tree-vect-data-refs.c =================================================================== --- a/src/gcc/tree-vect-data-refs.c (.../tags/gcc_8_3_0_release) +++ b/src/gcc/tree-vect-data-refs.c (.../branches/gcc-8-branch) -@@ -206,26 +206,60 @@ +@@ -144,6 +144,30 @@ + if (rhs < lhs) + scalar_type = rhs_type; + } ++ else if (gcall *call = dyn_cast (stmt)) ++ { ++ unsigned int i = 0; ++ if (gimple_call_internal_p (call)) ++ { ++ internal_fn ifn = gimple_call_internal_fn (call); ++ if (internal_load_fn_p (ifn) || internal_store_fn_p (ifn)) ++ /* gimple_expr_type already picked the type of the loaded ++ or stored data. */ ++ i = ~0U; ++ else if (internal_fn_mask_index (ifn) == 0) ++ i = 1; ++ } ++ if (i < gimple_call_num_args (call)) ++ { ++ tree rhs_type = TREE_TYPE (gimple_call_arg (call, i)); ++ if (tree_fits_uhwi_p (TYPE_SIZE_UNIT (rhs_type))) ++ { ++ rhs = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (rhs_type)); ++ if (rhs < lhs) ++ scalar_type = rhs_type; ++ } ++ } ++ } + + *lhs_size_unit = lhs; + *rhs_size_unit = rhs; +@@ -206,26 +230,60 @@ return true; /* STMT_A and STMT_B belong to overlapping groups. All loads in a @@ -29199,11 +45610,70 @@ } /* A subroutine of vect_analyze_data_ref_dependence. Handle +@@ -504,8 +562,19 @@ + reversed (to make distance vector positive), and the actual + distance is negative. */ + if (dump_enabled_p ()) +- dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, ++ dump_printf_loc (MSG_NOTE, vect_location, + "dependence distance negative.\n"); ++ /* When doing outer loop vectorization, we need to check if there is ++ a backward dependence at the inner loop level if the dependence ++ at the outer loop is reversed. See PR81740. */ ++ if (nested_in_vect_loop_p (loop, DR_STMT (dra)) ++ || nested_in_vect_loop_p (loop, DR_STMT (drb))) ++ { ++ unsigned inner_depth = index_in_loop_nest (loop->inner->num, ++ DDR_LOOP_NEST (ddr)); ++ if (dist_v[inner_depth] < 0) ++ return true; ++ } + /* Record a negative dependence distance to later limit the + amount of stmt copying / unrolling we can perform. + Only need to handle read-after-write dependence. */ +@@ -521,7 +590,7 @@ + { + /* The dependence distance requires reduction of the maximal + vectorization factor. */ +- *max_vf = abs (dist); ++ *max_vf = abs_dist; + if (dump_enabled_p ()) + dump_printf_loc (MSG_NOTE, vect_location, + "adjusting maximal vectorization factor to %i\n", Index: gcc/gimplify.c =================================================================== --- a/src/gcc/gimplify.c (.../tags/gcc_8_3_0_release) +++ b/src/gcc/gimplify.c (.../branches/gcc-8-branch) -@@ -4650,6 +4650,7 @@ +@@ -191,6 +191,7 @@ + bool target_map_scalars_firstprivate; + bool target_map_pointers_as_0len_arrays; + bool target_firstprivatize_array_bases; ++ bool add_safelen1; + }; + + static struct gimplify_ctx *gimplify_ctxp; +@@ -1294,12 +1295,17 @@ + || splay_tree_lookup (ctx->variables, + (splay_tree_key) t) == NULL)) + { ++ int flag = GOVD_LOCAL; + if (ctx->region_type == ORT_SIMD + && TREE_ADDRESSABLE (t) + && !TREE_STATIC (t)) +- omp_add_variable (ctx, t, GOVD_PRIVATE | GOVD_SEEN); +- else +- omp_add_variable (ctx, t, GOVD_LOCAL | GOVD_SEEN); ++ { ++ if (TREE_CODE (DECL_SIZE_UNIT (t)) != INTEGER_CST) ++ ctx->add_safelen1 = true; ++ else ++ flag = GOVD_PRIVATE; ++ } ++ omp_add_variable (ctx, t, flag | GOVD_SEEN); + } + + DECL_SEEN_IN_BIND_EXPR_P (t) = 1; +@@ -4650,6 +4656,7 @@ otherwise we'd generate a new temporary, and we can as well just use the decl we already have. */ else if (!TREE_ADDRESSABLE (decl) @@ -29211,7 +45681,16 @@ && init && (fallback & fb_lvalue) == 0 && gimple_test_f (init)) -@@ -6144,6 +6145,19 @@ +@@ -4946,7 +4953,7 @@ + one field to assign, initialize the target from a temporary. */ + if (TREE_THIS_VOLATILE (object) + && !TREE_ADDRESSABLE (type) +- && num_nonzero_elements > 0 ++ && (num_nonzero_elements > 0 || !cleared) + && vec_safe_length (elts) > 1) + { + tree temp = create_tmp_var (TYPE_MAIN_VARIANT (type)); +@@ -6144,6 +6151,19 @@ is_inout = false; } @@ -29231,7 +45710,7 @@ if (!allows_reg && allows_mem) mark_addressable (TREE_VALUE (link)); -@@ -6639,6 +6653,7 @@ +@@ -6639,6 +6659,7 @@ } if (asan_poisoned_variables && DECL_ALIGN (temp) <= MAX_SUPPORTED_STACK_ALIGNMENT @@ -29239,6 +45718,45 @@ && dbg_cnt (asan_use_after_scope) && !gimplify_omp_ctxp) { +@@ -9011,6 +9032,19 @@ + omp_find_stores_op, &wi); + } + } ++ ++ if (ctx->add_safelen1) ++ { ++ /* If there are VLAs in the body of simd loop, prevent ++ vectorization. */ ++ gcc_assert (ctx->region_type == ORT_SIMD); ++ c = build_omp_clause (UNKNOWN_LOCATION, OMP_CLAUSE_SAFELEN); ++ OMP_CLAUSE_SAFELEN_EXPR (c) = integer_one_node; ++ OMP_CLAUSE_CHAIN (c) = *list_p; ++ *list_p = c; ++ list_p = &OMP_CLAUSE_CHAIN (c); ++ } ++ + while ((c = *list_p) != NULL) + { + splay_tree_node n; +Index: gcc/graphite-scop-detection.c +=================================================================== +--- a/src/gcc/graphite-scop-detection.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/graphite-scop-detection.c (.../branches/gcc-8-branch) +@@ -1414,9 +1414,13 @@ + int i, j; + int *all_vertices; + ++ struct loop *nest ++ = find_common_loop (scop->scop_info->region.entry->dest->loop_father, ++ scop->scop_info->region.exit->src->loop_father); ++ + FOR_EACH_VEC_ELT (scop->drs, i, dr1) + for (j = i+1; scop->drs.iterate (j, &dr2); j++) +- if (dr_may_alias_p (dr1->dr, dr2->dr, true)) ++ if (dr_may_alias_p (dr1->dr, dr2->dr, nest)) + { + /* Dependences in the same alias set need to be handled + by just looking at DR_ACCESS_FNs. */ Index: gcc/lra-constraints.c =================================================================== --- a/src/gcc/lra-constraints.c (.../tags/gcc_8_3_0_release) @@ -29269,6 +45787,22 @@ } /* We should invalidate potential inheritance or splitting for the current insn usages to the next +Index: gcc/tree-ssa-phiopt.c +=================================================================== +--- a/src/gcc/tree-ssa-phiopt.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-ssa-phiopt.c (.../branches/gcc-8-branch) +@@ -1894,6 +1894,11 @@ + || gimple_has_volatile_ops (assign)) + return false; + ++ /* And no PHI nodes so all uses in the single stmt are also ++ available where we insert to. */ ++ if (!gimple_seq_empty_p (phi_nodes (middle_bb))) ++ return false; ++ + locus = gimple_location (assign); + lhs = gimple_assign_lhs (assign); + rhs = gimple_assign_rhs1 (assign); Index: gcc/calls.c =================================================================== --- a/src/gcc/calls.c (.../tags/gcc_8_3_0_release) @@ -29529,6 +46063,40 @@ gimple_seq_add_stmt_without_update (&stmts, repl); gsi_replace_with_seq_vops (gsi, stmts); /* gsi now points at the assignment to the lhs, get a +@@ -6721,14 +6720,10 @@ + = wi::sext (wi::to_poly_offset (idx) + - wi::to_poly_offset (low_bound), + TYPE_PRECISION (TREE_TYPE (idx))); +- ++ woffset *= tree_to_uhwi (unit_size); ++ woffset *= BITS_PER_UNIT; + if (woffset.to_shwi (&offset)) + { +- /* TODO: This code seems wrong, multiply then check +- to see if it fits. */ +- offset *= tree_to_uhwi (unit_size); +- offset *= BITS_PER_UNIT; +- + base = TREE_OPERAND (t, 0); + ctor = get_base_constructor (base, &offset, valueize); + /* Empty constructor. Always fold to 0. */ +Index: gcc/cfgexpand.c +=================================================================== +--- a/src/gcc/cfgexpand.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/cfgexpand.c (.../branches/gcc-8-branch) +@@ -4323,7 +4323,11 @@ + op0 = DECL_RTL_IF_SET (exp); + + /* This decl was probably optimized away. */ +- if (!op0) ++ if (!op0 ++ /* At least label RTXen are sometimes replaced by ++ NOTE_INSN_DELETED_LABEL. Any notes here are not ++ handled by copy_rtx. */ ++ || NOTE_P (op0)) + { + if (!VAR_P (exp) + || DECL_EXTERNAL (exp) Index: gcc/tree-cfgcleanup.c =================================================================== --- a/src/gcc/tree-cfgcleanup.c (.../tags/gcc_8_3_0_release) @@ -29628,6 +46196,24 @@ } } else +Index: gcc/tree-ssa-pre.c +=================================================================== +--- a/src/gcc/tree-ssa-pre.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-ssa-pre.c (.../branches/gcc-8-branch) +@@ -3919,6 +3919,13 @@ + continue; + } + ++ /* If the REFERENCE traps and there was a preceding ++ point in the block that might not return avoid ++ adding the reference to EXP_GEN. */ ++ if (BB_MAY_NOTRETURN (block) ++ && vn_reference_may_trap (ref)) ++ continue; ++ + /* If the value of the reference is not invalidated in + this block until it is computed, add the expression + to EXP_GEN. */ Index: gcc/tree-cfgcleanup.h =================================================================== --- a/src/gcc/tree-cfgcleanup.h (.../tags/gcc_8_3_0_release) @@ -29641,6 +46227,28 @@ extern bool fixup_noreturn_call (gimple *stmt); #endif /* GCC_TREE_CFGCLEANUP_H */ +Index: gcc/explow.c +=================================================================== +--- a/src/gcc/explow.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/explow.c (.../branches/gcc-8-branch) +@@ -893,16 +893,7 @@ + + tree type = TREE_TYPE (name); + int unsignedp = TYPE_UNSIGNED (type); +- machine_mode mode = TYPE_MODE (type); +- +- /* Bypass TYPE_MODE when it maps vector modes to BLKmode. */ +- if (mode == BLKmode) +- { +- gcc_assert (VECTOR_TYPE_P (type)); +- mode = type->type_common.mode; +- } +- +- machine_mode pmode = promote_mode (type, mode, &unsignedp); ++ machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp); + if (punsignedp) + *punsignedp = unsignedp; + Index: gcc/tree-sra.c =================================================================== --- a/src/gcc/tree-sra.c (.../tags/gcc_8_3_0_release) @@ -29801,6 +46409,42 @@ } else if (!POINTER_TYPE_P (TREE_TYPE (var)) && SSA_NAME_RANGE_INFO (var) +Index: gcc/tree-ssa-forwprop.c +=================================================================== +--- a/src/gcc/tree-ssa-forwprop.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-ssa-forwprop.c (.../branches/gcc-8-branch) +@@ -2481,6 +2481,8 @@ + { + int did_something; + did_something = forward_propagate_into_comparison (&gsi); ++ if (maybe_clean_or_replace_eh_stmt (stmt, gsi_stmt (gsi))) ++ bitmap_set_bit (to_purge, bb->index); + if (did_something == 2) + cfg_changed = true; + changed = did_something != 0; +Index: gcc/ggc-page.c +=================================================================== +--- a/src/gcc/ggc-page.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/ggc-page.c (.../branches/gcc-8-branch) +@@ -2555,6 +2555,9 @@ + + count_old_page_tables = G.by_depth_in_use; + ++ if (fread (&d, sizeof (d), 1, f) != 1) ++ fatal_error (input_location, "cannot read PCH file: %m"); ++ + /* We've just read in a PCH file. So, every object that used to be + allocated is now free. */ + clear_marks (); +@@ -2583,8 +2586,6 @@ + + /* Allocate the appropriate page-table entries for the pages read from + the PCH file. */ +- if (fread (&d, sizeof (d), 1, f) != 1) +- fatal_error (input_location, "can%'t read PCH file: %m"); + + for (i = 0; i < NUM_ORDERS; i++) + { Index: gcc/varasm.c =================================================================== --- a/src/gcc/varasm.c (.../tags/gcc_8_3_0_release) @@ -30057,7 +46701,34 @@ { insert_decl_map (id, type, type); return type; -@@ -5539,6 +5628,10 @@ +@@ -868,7 +957,12 @@ + bool existed; + unsigned short &newc = id->dependence_map->get_or_insert (clique, &existed); + if (!existed) +- newc = ++cfun->last_clique; ++ { ++ /* Clique 1 is reserved for local ones set by PTA. */ ++ if (cfun->last_clique == 0) ++ cfun->last_clique = 1; ++ newc = ++cfun->last_clique; ++ } + return newc; + } + +@@ -2651,7 +2745,11 @@ + dest_loop->simduid = remap_decl (src_loop->simduid, id); + cfun->has_simduid_loops = true; + } +- ++ if (id->src_cfun->last_clique != 0) ++ dest_loop->owned_clique ++ = remap_dependence_clique (id, ++ src_loop->owned_clique ++ ? src_loop->owned_clique : 1); + /* Recurse. */ + copy_loops (id, dest_loop, src_loop); + } +@@ -5539,6 +5637,10 @@ if (CODE_CONTAINS_STRUCT (TREE_CODE (copy), TS_DECL_WRTL) && !TREE_STATIC (copy) && !DECL_EXTERNAL (copy)) SET_DECL_RTL (copy, 0); @@ -30191,6 +46862,32 @@ if (TREE_CODE (expr) == RESULT_DECL || TREE_CODE (expr) == PARM_DECL || VAR_P (expr)) +Index: gcc/symtab.c +=================================================================== +--- a/src/gcc/symtab.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/symtab.c (.../branches/gcc-8-branch) +@@ -1546,7 +1546,7 @@ + void + symtab_node::set_section (const char *section) + { +- gcc_assert (!this->alias); ++ gcc_assert (!this->alias || !this->analyzed); + call_for_symbol_and_aliases + (symtab_node::set_section, const_cast(section), true); + } +Index: gcc/tree-outof-ssa.c +=================================================================== +--- a/src/gcc/tree-outof-ssa.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-outof-ssa.c (.../branches/gcc-8-branch) +@@ -651,6 +651,8 @@ + tree type = TREE_TYPE (name); + int unsignedp; + machine_mode reg_mode = promote_ssa_mode (name, &unsignedp); ++ if (reg_mode == BLKmode) ++ return assign_temp (type, 0, 0); + rtx x = gen_reg_rtx (reg_mode); + if (POINTER_TYPE_P (type)) + mark_reg_pointer (x, TYPE_ALIGN (TREE_TYPE (type))); Index: gcc/vr-values.c =================================================================== --- a/src/gcc/vr-values.c (.../tags/gcc_8_3_0_release) @@ -30228,11 +46925,117 @@ /* Get starting and ending insn, handling the case where each might be a SEQUENCE. */ +Index: gcc/var-tracking.c +=================================================================== +--- a/src/gcc/var-tracking.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/var-tracking.c (.../branches/gcc-8-branch) +@@ -8491,7 +8491,7 @@ + + /* Invalid SUBREGs are ok in debug info. ??? We could try + alternate expansions for the VALUE as well. */ +- if (!result) ++ if (!result && GET_MODE (subreg) != VOIDmode) + result = gen_rtx_raw_SUBREG (GET_MODE (x), subreg, SUBREG_BYTE (x)); + + return result; +Index: gcc/cfgloop.h +=================================================================== +--- a/src/gcc/cfgloop.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/cfgloop.h (.../branches/gcc-8-branch) +@@ -227,6 +227,10 @@ + Other values means unroll with the given unrolling factor. */ + unsigned short unroll; + ++ /* If this loop was inlined the main clique of the callee which does ++ not need remapping when copying the loop body. */ ++ unsigned short owned_clique; ++ + /* For SIMD loops, this is a unique identifier of the loop, referenced + by IFN_GOMP_SIMD_VF, IFN_GOMP_SIMD_LANE and IFN_GOMP_SIMD_LAST_LANE + builtins. */ Index: gcc/config.gcc =================================================================== --- a/src/gcc/config.gcc (.../tags/gcc_8_3_0_release) +++ b/src/gcc/config.gcc (.../branches/gcc-8-branch) -@@ -4676,8 +4676,11 @@ +@@ -647,7 +647,7 @@ + # Common parts for widely ported systems. + case ${target} in + *-*-darwin*) +- tmake_file="t-darwin ${cpu_type}/t-darwin" ++ tmake_file="t-darwin " + tm_file="${tm_file} darwin.h" + case ${target} in + *-*-darwin9*) +@@ -1479,16 +1479,25 @@ + dwarf2=no + fi + ;; ++i[34567]86-*-darwin1[89]*) ++ echo "Error: 32bit target is not supported after Darwin17" 1>&2 ++ ;; + i[34567]86-*-darwin*) + need_64bit_isa=yes + # Baseline choice for a machine that allows m64 support. + with_cpu=${with_cpu:-core2} ++ tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch t-slibgcc" ++ tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h" ++ ;; ++x86_64-*-darwin1[89]* | x86_64-*-darwin2[01]*) ++ # Only 64b from now ++ with_cpu=${with_cpu:-core2} + tmake_file="${tmake_file} t-slibgcc" + ;; + x86_64-*-darwin*) + with_cpu=${with_cpu:-core2} +- tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc" +- tm_file="${tm_file} ${cpu_type}/darwin64.h" ++ tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc" ++ tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h" + ;; + i[34567]86-*-elfiamcu) + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/iamcu.h" +@@ -2386,16 +2395,23 @@ + # extra_headers= + # ;; + powerpc-*-darwin*) +- extra_options="${extra_options} rs6000/darwin.opt" ++ extra_options="${extra_options} ${cpu_type}/darwin.opt" + case ${target} in +- *-darwin1[0-9]* | *-darwin[8-9]*) +- tmake_file="${tmake_file} rs6000/t-darwin8" +- tm_file="${tm_file} rs6000/darwin8.h" ++ *-darwin1[0-9]* | *-darwin9*) ++ tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch" ++ tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h" + ;; ++ *-darwin8*) ++ tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch" ++ tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h" ++ tm_file="${tm_file} ${cpu_type}/darwin8.h" ++ ;; + *-darwin7*) +- tm_file="${tm_file} rs6000/darwin7.h" ++ tm_file="${tm_file} ${cpu_type}/darwin7.h" + ;; +- *-darwin[0-6]*) ++ *-darwin[456]*) ++ # Earlier - ingle arch, with 32b only ++ # OS X 10.0, the first edition is Darwin4 + ;; + esac + tmake_file="${tmake_file} t-slibgcc" +@@ -2403,8 +2419,8 @@ + ;; + powerpc64-*-darwin*) + extra_options="${extra_options} ${cpu_type}/darwin.opt" +- tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc" +- tm_file="${tm_file} ${cpu_type}/darwin8.h ${cpu_type}/darwin64.h" ++ tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc" ++ tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h" + extra_headers=altivec.h + ;; + powerpc*-*-freebsd*) +@@ -4676,8 +4692,11 @@ ;; i[34567]86-*-dragonfly* | x86_64-*-dragonfly*) ;; @@ -30269,7 +47072,97 @@ =================================================================== --- a/src/gcc/tree-ssa-structalias.c (.../tags/gcc_8_3_0_release) +++ b/src/gcc/tree-ssa-structalias.c (.../branches/gcc-8-branch) -@@ -7552,7 +7552,10 @@ +@@ -3232,9 +3232,29 @@ + return; + } + +- /* Pretend to take the address of the base, we'll take care of +- adding the required subset of sub-fields below. */ +- get_constraint_for_1 (t, results, true, lhs_p); ++ /* Avoid creating pointer-offset constraints, so handle MEM_REF ++ offsets directly. Pretend to take the address of the base, ++ we'll take care of adding the required subset of sub-fields below. */ ++ if (TREE_CODE (t) == MEM_REF ++ && !integer_zerop (TREE_OPERAND (t, 0))) ++ { ++ poly_offset_int off = mem_ref_offset (t); ++ off <<= LOG2_BITS_PER_UNIT; ++ off += bitpos; ++ poly_int64 off_hwi; ++ if (off.to_shwi (&off_hwi)) ++ bitpos = off_hwi; ++ else ++ { ++ bitpos = 0; ++ bitmaxsize = -1; ++ } ++ get_constraint_for_1 (TREE_OPERAND (t, 0), results, false, lhs_p); ++ do_deref (results); ++ } ++ else ++ get_constraint_for_1 (t, results, true, lhs_p); ++ + /* Strip off nothing_id. */ + if (results->length () == 2) + { +@@ -7461,7 +7481,11 @@ + if (MR_DEPENDENCE_CLIQUE (ref) == 0) + { + if (clique == 0) +- clique = ++cfun->last_clique; ++ { ++ if (cfun->last_clique == 0) ++ cfun->last_clique = 1; ++ clique = 1; ++ } + if (restrict_var->ruid == 0) + restrict_var->ruid = ++last_ruid; + MR_DEPENDENCE_CLIQUE (ref) = clique; +@@ -7472,6 +7496,23 @@ + return false; + } + ++/* Clear dependence info for the clique DATA. */ ++ ++static bool ++clear_dependence_clique (gimple *, tree base, tree, void *data) ++{ ++ unsigned short clique = (uintptr_t)data; ++ if ((TREE_CODE (base) == MEM_REF ++ || TREE_CODE (base) == TARGET_MEM_REF) ++ && MR_DEPENDENCE_CLIQUE (base) == clique) ++ { ++ MR_DEPENDENCE_CLIQUE (base) = 0; ++ MR_DEPENDENCE_BASE (base) = 0; ++ } ++ ++ return false; ++} ++ + /* Compute the set of independend memory references based on restrict + tags and their conservative propagation to the points-to sets. */ + +@@ -7478,6 +7519,19 @@ + static void + compute_dependence_clique (void) + { ++ /* First clear the special "local" clique. */ ++ basic_block bb; ++ if (cfun->last_clique != 0) ++ FOR_EACH_BB_FN (bb, cfun) ++ for (gimple_stmt_iterator gsi = gsi_start_bb (bb); ++ !gsi_end_p (gsi); gsi_next (&gsi)) ++ { ++ gimple *stmt = gsi_stmt (gsi); ++ walk_stmt_load_store_ops (stmt, (void *)(uintptr_t) 1, ++ clear_dependence_clique, ++ clear_dependence_clique); ++ } ++ + unsigned short clique = 0; + unsigned short last_ruid = 0; + bitmap rvars = BITMAP_ALLOC (NULL); +@@ -7552,7 +7606,10 @@ } if (used) { @@ -30285,7 +47178,18 @@ =================================================================== --- a/src/gcc/tree-core.h (.../tags/gcc_8_3_0_release) +++ b/src/gcc/tree-core.h (.../branches/gcc-8-branch) -@@ -1644,6 +1644,7 @@ +@@ -997,7 +997,9 @@ + expression trees and specify known data non-dependences. For + two memory references in a function they are known to not + alias if dependence_info.clique are equal and dependence_info.base +- are distinct. */ ++ are distinct. Clique number zero means there is no information, ++ clique number one is populated from function global information ++ and thus needs no remapping on transforms like loop unrolling. */ + struct { + unsigned short clique; + unsigned short base; +@@ -1644,6 +1646,7 @@ /* In a VAR_DECL and PARM_DECL, this is DECL_READ_P. */ unsigned decl_read_flag : 1; /* In a VAR_DECL or RESULT_DECL, this is DECL_NONSHAREABLE. */ @@ -30306,6 +47210,71 @@ gsi_remove (&i, false); gsi_insert_before (&new_gsi, stmt, GSI_NEW_STMT); } +@@ -6308,7 +6308,7 @@ + preserve SSA form. */ + + static basic_block +-gimple_duplicate_bb (basic_block bb) ++gimple_duplicate_bb (basic_block bb, copy_bb_data *id) + { + basic_block new_bb; + gimple_stmt_iterator gsi_tgt; +@@ -6372,6 +6372,39 @@ + && (!VAR_P (base) || !DECL_HAS_VALUE_EXPR_P (base))) + DECL_NONSHAREABLE (base) = 1; + } ++ ++ /* If requested remap dependence info of cliques brought in ++ via inlining. */ ++ if (id) ++ for (unsigned i = 0; i < gimple_num_ops (copy); ++i) ++ { ++ tree op = gimple_op (copy, i); ++ if (!op) ++ continue; ++ if (TREE_CODE (op) == ADDR_EXPR ++ || TREE_CODE (op) == WITH_SIZE_EXPR) ++ op = TREE_OPERAND (op, 0); ++ while (handled_component_p (op)) ++ op = TREE_OPERAND (op, 0); ++ if ((TREE_CODE (op) == MEM_REF ++ || TREE_CODE (op) == TARGET_MEM_REF) ++ && MR_DEPENDENCE_CLIQUE (op) > 1 ++ && MR_DEPENDENCE_CLIQUE (op) != bb->loop_father->owned_clique) ++ { ++ if (!id->dependence_map) ++ id->dependence_map = new hash_map; ++ bool existed; ++ unsigned short &newc = id->dependence_map->get_or_insert ++ (MR_DEPENDENCE_CLIQUE (op), &existed); ++ if (!existed) ++ { ++ gcc_assert (MR_DEPENDENCE_CLIQUE (op) <= cfun->last_clique); ++ newc = ++cfun->last_clique; ++ } ++ MR_DEPENDENCE_CLIQUE (op) = newc; ++ } ++ } + + /* Create new names for all the definitions created by COPY and + add replacement mappings for each new name. */ +@@ -7199,7 +7232,14 @@ + if (virtual_operand_p (op)) + { + /* Remove the phi nodes for virtual operands (alias analysis will be +- run for the new function, anyway). */ ++ run for the new function, anyway). But replace all uses that ++ might be outside of the region we move. */ ++ use_operand_p use_p; ++ imm_use_iterator iter; ++ gimple *use_stmt; ++ FOR_EACH_IMM_USE_STMT (use_stmt, iter, op) ++ FOR_EACH_IMM_USE_ON_STMT (use_p, iter) ++ SET_USE (use_p, SSA_NAME_VAR (op)); + remove_phi_node (&psi, true); + continue; + } Index: gcc/passes.c =================================================================== --- a/src/gcc/passes.c (.../tags/gcc_8_3_0_release) @@ -30333,6 +47302,14 @@ break; loc = gimple_location (stmt); switch (code) +@@ -4768,6 +4769,7 @@ + else + { + stmts[i] = build_and_add_sum (TREE_TYPE (last_rhs1), op1, op2, opcode); ++ gimple_set_visited (stmts[i], true); + } + if (dump_file && (dump_flags & TDF_DETAILS)) + { Index: gcc/config/nvptx/nvptx.c =================================================================== --- a/src/gcc/config/nvptx/nvptx.c (.../tags/gcc_8_3_0_release) @@ -30748,6 +47725,178 @@ OB_DEF (s390_vec_store_len, s390_vec_store_len_s8,s390_vec_store_len_dbl,B_VX, BT_FN_VOID_OV4SI_VOIDPTR_UINT) OB_DEF_VAR (s390_vec_store_len_s8, s390_vstl, 0, 0, BT_OV_VOID_V16QI_SCHARPTR_UINT) +Index: gcc/config/sparc/sparc.c +=================================================================== +--- a/src/gcc/config/sparc/sparc.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/sparc/sparc.c (.../branches/gcc-8-branch) +@@ -4203,6 +4203,13 @@ + static bool + sparc_cannot_force_const_mem (machine_mode mode, rtx x) + { ++ /* After IRA has run in PIC mode, it is too late to put anything into the ++ constant pool if the PIC register hasn't already been initialized. */ ++ if ((lra_in_progress || reload_in_progress) ++ && flag_pic ++ && !crtl->uses_pic_offset_table) ++ return true; ++ + switch (GET_CODE (x)) + { + case CONST_INT: +@@ -4452,7 +4459,7 @@ + return true; + + if (!HARD_REGISTER_P (pic_offset_table_rtx) +- && (HARD_REGISTER_P (x) || lra_in_progress) ++ && (HARD_REGISTER_P (x) || lra_in_progress || reload_in_progress) + && ORIGINAL_REGNO (x) == REGNO (pic_offset_table_rtx)) + return true; + +Index: gcc/config/darwin-c.c +=================================================================== +--- a/src/gcc/config/darwin-c.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/darwin-c.c (.../branches/gcc-8-branch) +@@ -463,41 +463,32 @@ + /* Register the GNU objective-C runtime include path if STDINC. */ + + void +-darwin_register_objc_includes (const char *sysroot, const char *iprefix, +- int stdinc) ++darwin_register_objc_includes (const char *sysroot ATTRIBUTE_UNUSED, ++ const char *iprefix, int stdinc) + { +- const char *fname; +- size_t len; +- /* We do not do anything if we do not want the standard includes. */ +- if (!stdinc) +- return; ++ /* If we want standard includes; Register the GNU OBJC runtime include ++ path if we are compiling OBJC with GNU-runtime. ++ This path is compiler-relative, we don't want to prepend the sysroot ++ since it's not expected to find the headers there. */ + +- fname = GCC_INCLUDE_DIR "-gnu-runtime"; +- +- /* Register the GNU OBJC runtime include path if we are compiling OBJC +- with GNU-runtime. */ +- +- if (c_dialect_objc () && !flag_next_runtime) ++ if (stdinc && c_dialect_objc () && !flag_next_runtime) + { ++ const char *fname = GCC_INCLUDE_DIR "-gnu-runtime"; + char *str; +- /* See if our directory starts with the standard prefix. ++ size_t len; ++ ++ /* See if our directory starts with the standard prefix. + "Translate" them, i.e. replace /usr/local/lib/gcc... with + IPREFIX and search them first. */ +- if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0 && !sysroot ++ if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0 + && !strncmp (fname, cpp_GCC_INCLUDE_DIR, len)) + { + str = concat (iprefix, fname + len, NULL); +- /* FIXME: wrap the headers for C++awareness. */ +- add_path (str, INC_SYSTEM, /*c++aware=*/false, false); ++ add_path (str, INC_SYSTEM, /*c++aware=*/true, false); + } + +- /* Should this directory start with the sysroot? */ +- if (sysroot) +- str = concat (sysroot, fname, NULL); +- else +- str = update_path (fname, ""); +- +- add_path (str, INC_SYSTEM, /*c++aware=*/false, false); ++ str = update_path (fname, ""); ++ add_path (str, INC_SYSTEM, /*c++aware=*/true, false); + } + } + +Index: gcc/config/i386/t-darwin +=================================================================== +--- a/src/gcc/config/i386/t-darwin (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/i386/t-darwin (.../branches/gcc-8-branch) +@@ -1,2 +0,0 @@ +-MULTILIB_OPTIONS = m64 +-MULTILIB_DIRNAMES = x86_64 +Index: gcc/config/i386/darwin64.h +=================================================================== +--- a/src/gcc/config/i386/darwin64.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/i386/darwin64.h (.../branches/gcc-8-branch) +@@ -1,58 +0,0 @@ +-/* Target definitions for x86_64 running Darwin. +- Copyright (C) 2006-2018 Free Software Foundation, Inc. +- Contributed by Apple Computer Inc. +- +-This file is part of GCC. +- +-GCC is free software; you can redistribute it and/or modify +-it under the terms of the GNU General Public License as published by +-the Free Software Foundation; either version 3, or (at your option) +-any later version. +- +-GCC is distributed in the hope that it will be useful, +-but WITHOUT ANY WARRANTY; without even the implied warranty of +-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-GNU General Public License for more details. +- +-You should have received a copy of the GNU General Public License +-along with GCC; see the file COPYING3. If not see +-. */ +- +-#undef DARWIN_ARCH_SPEC +-#define DARWIN_ARCH_SPEC "%{m32:i386;:x86_64}" +- +-/* WORKAROUND pr80556: +- For x86_64 Darwin10 and later, the unwinder is in libunwind (redirected +- from libSystem). This doesn't use the keymgr (see keymgr.c) and therefore +- the calls that libgcc makes to obtain the KEYMGR_GCC3_DW2_OBJ_LIST are not +- updated to include new images, and might not even be valid for a single +- image. +- Therefore, for 64b exes at least, we must use the libunwind implementation, +- even when static-libgcc is specified. We put libSystem first so that +- unwinder symbols are satisfied from there. */ +-#undef REAL_LIBGCC_SPEC +-#define REAL_LIBGCC_SPEC \ +- "%{static-libgcc|static: \ +- %{!m32:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)} \ +- -lgcc_eh -lgcc; \ +- shared-libgcc|fexceptions|fgnu-runtime: \ +- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \ +- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \ +- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \ +- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \ +- -lgcc ; \ +- :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \ +- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \ +- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \ +- %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \ +- -lgcc }" +- +-#undef DARWIN_SUBARCH_SPEC +-#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC +- +-#undef SUBTARGET_EXTRA_SPECS +-#define SUBTARGET_EXTRA_SPECS \ +- DARWIN_EXTRA_SPECS \ +- { "darwin_arch", DARWIN_ARCH_SPEC }, \ +- { "darwin_crt2", "" }, \ +- { "darwin_subarch", DARWIN_SUBARCH_SPEC }, +Index: gcc/config/i386/t-darwin64 +=================================================================== +--- a/src/gcc/config/i386/t-darwin64 (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/i386/t-darwin64 (.../branches/gcc-8-branch) +@@ -1,2 +0,0 @@ +-MULTILIB_OPTIONS = m32 +-MULTILIB_DIRNAMES = i386 +Index: gcc/config/i386/t-darwin64-biarch +=================================================================== +--- a/src/gcc/config/i386/t-darwin64-biarch (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/i386/t-darwin64-biarch (.../branches/gcc-8-branch) +@@ -0,0 +1,2 @@ ++MULTILIB_OPTIONS = m32 ++MULTILIB_DIRNAMES = i386 Index: gcc/config/i386/t-freebsd64 =================================================================== --- a/src/gcc/config/i386/t-freebsd64 (.../tags/gcc_8_3_0_release) @@ -30813,6 +47962,26 @@ ;; See comment for addsi_1_zext why we do use nonimmediate_operand (define_insn "*andsi_1_zext" +Index: gcc/config/i386/avx2intrin.h +=================================================================== +--- a/src/gcc/config/i386/avx2intrin.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/i386/avx2intrin.h (.../branches/gcc-8-branch) +@@ -258,7 +258,7 @@ + __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) + _mm256_cmpgt_epi8 (__m256i __A, __m256i __B) + { +- return (__m256i) ((__v32qi)__A > (__v32qi)__B); ++ return (__m256i) ((__v32qs)__A > (__v32qs)__B); + } + + extern __inline __m256i +Index: gcc/config/i386/t-darwin32-biarch +=================================================================== +--- a/src/gcc/config/i386/t-darwin32-biarch (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/i386/t-darwin32-biarch (.../branches/gcc-8-branch) +@@ -0,0 +1,2 @@ ++MULTILIB_OPTIONS = m64 ++MULTILIB_DIRNAMES = x86_64 Index: gcc/config/i386/freebsd64.h =================================================================== --- a/src/gcc/config/i386/freebsd64.h (.../tags/gcc_8_3_0_release) @@ -30865,6 +48034,133 @@ #define __cpuid_count(level, count, a, b, c, d) \ __asm__ ("cpuid\n\t" \ +Index: gcc/config/i386/darwin32-biarch.h +=================================================================== +--- a/src/gcc/config/i386/darwin32-biarch.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/i386/darwin32-biarch.h (.../branches/gcc-8-branch) +@@ -0,0 +1,58 @@ ++/* Target definitions for i386 running Darwin with a 32b host and supporting ++ a 64b multilib. ++ Copyright (C) 2019 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#undef DARWIN_ARCH_SPEC ++#define DARWIN_ARCH_SPEC "%{m64:x86_64;:i386}" ++ ++/* WORKAROUND pr80556: ++ For x86_64 Darwin10 and later, the unwinder is in libunwind (redirected ++ from libSystem). This doesn't use the keymgr (see keymgr.c) and therefore ++ the calls that libgcc makes to obtain the KEYMGR_GCC3_DW2_OBJ_LIST are not ++ updated to include new images, and might not even be valid for a single ++ image. ++ Therefore, for 64b exes at least, we must use the libunwind implementation, ++ even when static-libgcc is specified. We put libSystem first so that ++ unwinder symbols are satisfied from there. */ ++#undef REAL_LIBGCC_SPEC ++#define REAL_LIBGCC_SPEC \ ++ "%{static-libgcc|static: \ ++ %{m64:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)} \ ++ -lgcc_eh -lgcc; \ ++ shared-libgcc|fexceptions|fgnu-runtime: \ ++ %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \ ++ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \ ++ %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \ ++ %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \ ++ -lgcc ; \ ++ :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \ ++ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \ ++ %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \ ++ %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \ ++ -lgcc }" ++ ++#undef DARWIN_SUBARCH_SPEC ++#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC ++ ++#undef SUBTARGET_EXTRA_SPECS ++#define SUBTARGET_EXTRA_SPECS \ ++ DARWIN_EXTRA_SPECS \ ++ { "darwin_arch", DARWIN_ARCH_SPEC }, \ ++ { "darwin_crt2", "" }, \ ++ { "darwin_subarch", DARWIN_SUBARCH_SPEC }, +Index: gcc/config/i386/darwin64-biarch.h +=================================================================== +--- a/src/gcc/config/i386/darwin64-biarch.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/i386/darwin64-biarch.h (.../branches/gcc-8-branch) +@@ -0,0 +1,59 @@ ++/* Target definitions for x86_64 running Darwin with a 64b host supporting a ++ 32b multilib. ++ Copyright (C) 2006-2019 Free Software Foundation, Inc. ++ Contributed by Apple Computer Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#undef DARWIN_ARCH_SPEC ++#define DARWIN_ARCH_SPEC "%{m32:i386;:x86_64}" ++ ++/* WORKAROUND pr80556: ++ For x86_64 Darwin10 and later, the unwinder is in libunwind (redirected ++ from libSystem). This doesn't use the keymgr (see keymgr.c) and therefore ++ the calls that libgcc makes to obtain the KEYMGR_GCC3_DW2_OBJ_LIST are not ++ updated to include new images, and might not even be valid for a single ++ image. ++ Therefore, for 64b exes at least, we must use the libunwind implementation, ++ even when static-libgcc is specified. We put libSystem first so that ++ unwinder symbols are satisfied from there. */ ++#undef REAL_LIBGCC_SPEC ++#define REAL_LIBGCC_SPEC \ ++ "%{static-libgcc|static: \ ++ %{!m32:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)} \ ++ -lgcc_eh -lgcc; \ ++ shared-libgcc|fexceptions|fgnu-runtime: \ ++ %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \ ++ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \ ++ %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \ ++ %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \ ++ -lgcc ; \ ++ :%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \ ++ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \ ++ %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \ ++ %:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \ ++ -lgcc }" ++ ++#undef DARWIN_SUBARCH_SPEC ++#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC ++ ++#undef SUBTARGET_EXTRA_SPECS ++#define SUBTARGET_EXTRA_SPECS \ ++ DARWIN_EXTRA_SPECS \ ++ { "darwin_arch", DARWIN_ARCH_SPEC }, \ ++ { "darwin_crt2", "" }, \ ++ { "darwin_subarch", DARWIN_SUBARCH_SPEC }, Index: gcc/config/i386/sse.md =================================================================== --- a/src/gcc/config/i386/sse.md (.../tags/gcc_8_3_0_release) @@ -30878,6 +48174,15 @@ { ix86_emit_swsqrtsf (operands[0], operands[1], mode, true); DONE; +@@ -15172,7 +15172,7 @@ + } + }) + +-(define_insn "abs2" ++(define_insn "ssse3_abs2" + [(set (match_operand:MMXMODEI 0 "register_operand" "=y") + (abs:MMXMODEI + (match_operand:MMXMODEI 1 "nonimmediate_operand" "ym")))] @@ -16271,9 +16271,9 @@ case 3: /* %X5 so that we don't emit any *WORD PTR for -masm=intel, as @@ -31044,11 +48349,47 @@ [(set_attr "type" "ssemov") (set_attr "prefix" "evex") (set_attr "mode" "")]) +Index: gcc/config/i386/i386-builtin.def +=================================================================== +--- a/src/gcc/config/i386/i386-builtin.def (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/i386/i386-builtin.def (.../branches/gcc-8-branch) +@@ -806,11 +806,11 @@ + + /* SSSE3 */ + BDESC (OPTION_MASK_ISA_SSSE3, CODE_FOR_absv16qi2, "__builtin_ia32_pabsb128", IX86_BUILTIN_PABSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI) +-BDESC (OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_MMX, CODE_FOR_absv8qi2, "__builtin_ia32_pabsb", IX86_BUILTIN_PABSB, UNKNOWN, (int) V8QI_FTYPE_V8QI) ++BDESC (OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_MMX, CODE_FOR_ssse3_absv8qi2, "__builtin_ia32_pabsb", IX86_BUILTIN_PABSB, UNKNOWN, (int) V8QI_FTYPE_V8QI) + BDESC (OPTION_MASK_ISA_SSSE3, CODE_FOR_absv8hi2, "__builtin_ia32_pabsw128", IX86_BUILTIN_PABSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI) +-BDESC (OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_MMX, CODE_FOR_absv4hi2, "__builtin_ia32_pabsw", IX86_BUILTIN_PABSW, UNKNOWN, (int) V4HI_FTYPE_V4HI) ++BDESC (OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_MMX, CODE_FOR_ssse3_absv4hi2, "__builtin_ia32_pabsw", IX86_BUILTIN_PABSW, UNKNOWN, (int) V4HI_FTYPE_V4HI) + BDESC (OPTION_MASK_ISA_SSSE3, CODE_FOR_absv4si2, "__builtin_ia32_pabsd128", IX86_BUILTIN_PABSD128, UNKNOWN, (int) V4SI_FTYPE_V4SI) +-BDESC (OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_MMX, CODE_FOR_absv2si2, "__builtin_ia32_pabsd", IX86_BUILTIN_PABSD, UNKNOWN, (int) V2SI_FTYPE_V2SI) ++BDESC (OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_MMX, CODE_FOR_ssse3_absv2si2, "__builtin_ia32_pabsd", IX86_BUILTIN_PABSD, UNKNOWN, (int) V2SI_FTYPE_V2SI) + + BDESC (OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phaddwv8hi3, "__builtin_ia32_phaddw128", IX86_BUILTIN_PHADDW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI) + BDESC (OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_MMX, CODE_FOR_ssse3_phaddwv4hi3, "__builtin_ia32_phaddw", IX86_BUILTIN_PHADDW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI) Index: gcc/config/i386/darwin.h =================================================================== --- a/src/gcc/config/i386/darwin.h (.../tags/gcc_8_3_0_release) +++ b/src/gcc/config/i386/darwin.h (.../branches/gcc-8-branch) -@@ -130,7 +130,8 @@ +@@ -47,12 +47,13 @@ + image. + Therefore, for 64b exes at least, we must use the libunwind implementation, + even when static-libgcc is specified. We put libSystem first so that +- unwinder symbols are satisfied from there. */ ++ unwinder symbols are satisfied from there. ++ We default to 64b for single-arch builds, so apply this unconditionally. */ + #undef REAL_LIBGCC_SPEC + #define REAL_LIBGCC_SPEC \ + "%{static-libgcc|static: \ +- %{m64:%:version-compare(>= 10.6 mmacosx-version-min= -lSystem)} \ +- -lgcc_eh -lgcc; \ ++ %:version-compare(>= 10.6 mmacosx-version-min= -lSystem) \ ++ -lgcc_eh -lgcc; \ + shared-libgcc|fexceptions|fgnu-runtime: \ + %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \ + %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \ +@@ -130,7 +131,8 @@ #undef CC1_SPEC #define CC1_SPEC "%(cc1_cpu) \ %{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}} \ @@ -31058,6 +48399,83 @@ DARWIN_CC1_SPEC #undef ASM_SPEC +@@ -138,9 +140,6 @@ + " ASM_OPTIONS " -force_cpusubtype_ALL \ + %{static}" ASM_MMACOSX_VERSION_MIN_SPEC + +-#define DARWIN_ARCH_SPEC "%{m64:x86_64;:i386}" +-#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC +- + #undef ENDFILE_SPEC + #define ENDFILE_SPEC \ + "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ +@@ -148,12 +147,15 @@ + %{mpc64:crtprec64.o%s} \ + %{mpc80:crtprec80.o%s}" TM_DESTRUCTOR + ++/* We default to x86_64 for single-arch builds, bi-arch overrides. */ ++#define DARWIN_ARCH_SPEC "x86_64" ++ + #undef SUBTARGET_EXTRA_SPECS + #define SUBTARGET_EXTRA_SPECS \ + DARWIN_EXTRA_SPECS \ +- { "darwin_arch", DARWIN_ARCH_SPEC }, \ ++ { "darwin_arch", DARWIN_ARCH_SPEC }, \ + { "darwin_crt2", "" }, \ +- { "darwin_subarch", DARWIN_SUBARCH_SPEC }, ++ { "darwin_subarch", DARWIN_ARCH_SPEC }, + + /* The Darwin assembler mostly follows AT&T syntax. */ + #undef ASSEMBLER_DIALECT +@@ -219,6 +221,23 @@ + } \ + } while (0) + ++#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN ++#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ ++ do { \ ++ if ((LOG) != 0) { \ ++ if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1) \ ++ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ ++ else \ ++ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ ++ } \ ++ } while (0) ++#endif ++ ++/* Darwin x86 assemblers support the .ident directive. */ ++ ++#undef TARGET_ASM_OUTPUT_IDENT ++#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive ++ + /* Darwin profiling -- call mcount. */ + #undef FUNCTION_PROFILER + #define FUNCTION_PROFILER(FILE, LABELNO) \ +Index: gcc/config/i386/emmintrin.h +=================================================================== +--- a/src/gcc/config/i386/emmintrin.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/i386/emmintrin.h (.../branches/gcc-8-branch) +@@ -1296,7 +1296,7 @@ + extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) + _mm_cmpeq_epi8 (__m128i __A, __m128i __B) + { +- return (__m128i) ((__v16qs)__A == (__v16qs)__B); ++ return (__m128i) ((__v16qi)__A == (__v16qi)__B); + } + + extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +Index: gcc/config/i386/avxintrin.h +=================================================================== +--- a/src/gcc/config/i386/avxintrin.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/i386/avxintrin.h (.../branches/gcc-8-branch) +@@ -47,6 +47,7 @@ + typedef short __v16hi __attribute__ ((__vector_size__ (32))); + typedef unsigned short __v16hu __attribute__ ((__vector_size__ (32))); + typedef char __v32qi __attribute__ ((__vector_size__ (32))); ++typedef signed char __v32qs __attribute__ ((__vector_size__ (32))); + typedef unsigned char __v32qu __attribute__ ((__vector_size__ (32))); + + /* The Intel API is flexible enough that we must allow aliasing with other Index: gcc/config/i386/i386.c =================================================================== --- a/src/gcc/config/i386/i386.c (.../tags/gcc_8_3_0_release) @@ -31490,7 +48908,26 @@ emit_move_insn (res, tmp); emit_label (label); -@@ -50999,7 +50913,7 @@ +@@ -46379,7 +46293,8 @@ + expand_vec_perm_blend (struct expand_vec_perm_d *d) + { + machine_mode mmode, vmode = d->vmode; +- unsigned i, mask, nelt = d->nelt; ++ unsigned i, nelt = d->nelt; ++ unsigned HOST_WIDE_INT mask; + rtx target, op0, op1, maskop, x; + rtx rperm[32], vperm; + +@@ -46433,7 +46348,7 @@ + case E_V16SImode: + case E_V8DImode: + for (i = 0; i < nelt; ++i) +- mask |= (d->perm[i] >= nelt) << i; ++ mask |= ((unsigned HOST_WIDE_INT) (d->perm[i] >= nelt)) << i; + break; + + case E_V2DImode: +@@ -50999,7 +50914,7 @@ there is no adddf3 pattern (since x87 floating point only has XFmode operations) so the default hook implementation gets this wrong. */ @@ -31499,7 +48936,7 @@ } /* Implement TARGET_ATOMIC_ASSIGN_EXPAND_FENV. */ -@@ -51007,7 +50921,7 @@ +@@ -51007,7 +50922,7 @@ static void ix86_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update) { @@ -31508,7 +48945,7 @@ return; tree exceptions_var = create_tmp_var_raw (integer_type_node); if (TARGET_80387) -@@ -51042,7 +50956,7 @@ +@@ -51042,7 +50957,7 @@ tree update_fldenv = build_call_expr (fldenv, 1, fenv_addr); *update = build2 (COMPOUND_EXPR, void_type_node, *update, update_fldenv); } @@ -31517,7 +48954,7 @@ { tree mxcsr_orig_var = create_tmp_var_raw (unsigned_type_node); tree mxcsr_mod_var = create_tmp_var_raw (unsigned_type_node); -@@ -51399,7 +51313,7 @@ +@@ -51399,7 +51314,7 @@ return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT; else if (!TARGET_MIX_SSE_I387) { @@ -31683,6 +49120,15 @@ ]) (define_c_enum "unspecv" [ +@@ -5412,7 +5413,7 @@ + [(match_operand:GPI 0 "register_operand") + (match_operand:GPF 1 "register_operand")] + "TARGET_FLOAT +- && ((GET_MODE_SIZE (mode) <= GET_MODE_SIZE (mode)) ++ && ((GET_MODE_BITSIZE (mode) <= LONG_TYPE_SIZE) + || !flag_trapping_math || flag_fp_int_builtin_inexact)" + { + rtx cvt = gen_reg_rtx (mode); @@ -5427,49 +5428,48 @@ ;; LDR d2, #(1 << 63) ;; BSL v2.8b, [y], [x] @@ -31931,6 +49377,65 @@ return aarch64_evpc_tbl (d); } return false; +Index: gcc/config/rs6000/darwin64.h +=================================================================== +--- a/src/gcc/config/rs6000/darwin64.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/rs6000/darwin64.h (.../branches/gcc-8-branch) +@@ -1,32 +0,0 @@ +-/* Target definitions for PowerPC running Darwin (Mac OS X). +- Copyright (C) 2006-2018 Free Software Foundation, Inc. +- Contributed by Apple Computer Inc. +- +- This file is part of GCC. +- +- GCC is free software; you can redistribute it and/or modify it +- under the terms of the GNU General Public License as published +- by the Free Software Foundation; either version 3, or (at your +- option) any later version. +- +- GCC is distributed in the hope that it will be useful, but WITHOUT +- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +- License for more details. +- +- You should have received a copy of the GNU General Public License +- along with GCC; see the file COPYING3. If not see +- . */ +- +-#undef TARGET_DEFAULT +-#define TARGET_DEFAULT (MASK_POWERPC64 | MASK_64BIT \ +- | MASK_MULTIPLE | MASK_PPC_GFXOPT) +- +-#undef DARWIN_ARCH_SPEC +-#define DARWIN_ARCH_SPEC "%{m32:ppc;:ppc64}" +- +-#undef DARWIN_SUBARCH_SPEC +-#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC +- +-#undef DARWIN_CRT2_SPEC +-#define DARWIN_CRT2_SPEC "" +Index: gcc/config/rs6000/t-darwin64 +=================================================================== +--- a/src/gcc/config/rs6000/t-darwin64 (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/rs6000/t-darwin64 (.../branches/gcc-8-branch) +@@ -1,2 +0,0 @@ +-MULTILIB_OPTIONS = m32 +-MULTILIB_DIRNAMES = ppc +Index: gcc/config/rs6000/t-darwin8 +=================================================================== +--- a/src/gcc/config/rs6000/t-darwin8 (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/rs6000/t-darwin8 (.../branches/gcc-8-branch) +@@ -1,3 +0,0 @@ +-# 64-bit libraries can only be built in Darwin 8.x or later. +-MULTILIB_OPTIONS = m64 +-MULTILIB_DIRNAMES = ppc64 +Index: gcc/config/rs6000/t-darwin64-biarch +=================================================================== +--- a/src/gcc/config/rs6000/t-darwin64-biarch (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/rs6000/t-darwin64-biarch (.../branches/gcc-8-branch) +@@ -0,0 +1,2 @@ ++MULTILIB_OPTIONS = m32 ++MULTILIB_DIRNAMES = ppc Index: gcc/config/rs6000/mmintrin.h =================================================================== --- a/src/gcc/config/rs6000/mmintrin.h (.../tags/gcc_8_3_0_release) @@ -31944,6 +49449,14 @@ } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +Index: gcc/config/rs6000/t-darwin32-biarch +=================================================================== +--- a/src/gcc/config/rs6000/t-darwin32-biarch (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/rs6000/t-darwin32-biarch (.../branches/gcc-8-branch) +@@ -0,0 +1,3 @@ ++# 64-bit libraries can only be built in Darwin 8.x or later. ++MULTILIB_OPTIONS = m64 ++MULTILIB_DIRNAMES = ppc64 Index: gcc/config/rs6000/power9.md =================================================================== --- a/src/gcc/config/rs6000/power9.md (.../tags/gcc_8_3_0_release) @@ -31971,6 +49484,103 @@ endif ifneq (,$(findstring powerpcle,$(target))) MULTIARCH_DIRNAME := $(subst -linux,le-linux,$(MULTIARCH_DIRNAME)) +Index: gcc/config/rs6000/darwin32-biarch.h +=================================================================== +--- a/src/gcc/config/rs6000/darwin32-biarch.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/rs6000/darwin32-biarch.h (.../branches/gcc-8-branch) +@@ -0,0 +1,49 @@ ++/* Target definitions for PowerPC running Darwin (Mac OS X) for a 32b host ++ with a 64b miultilib. ++ Copyright (C) 2019 Free Software Foundation, Inc. ++ ++ This file is part of GCC. ++ ++ GCC is free software; you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published ++ by the Free Software Foundation; either version 3, or (at your ++ option) any later version. ++ ++ GCC is distributed in the hope that it will be useful, but WITHOUT ++ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ++ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public ++ License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with GCC; see the file COPYING3. If not see ++ . */ ++ ++#undef DARWIN_ARCH_SPEC ++#define DARWIN_ARCH_SPEC "%{m64:ppc64;:ppc}" ++ ++#undef DARWIN_SUBARCH_SPEC ++#define DARWIN_SUBARCH_SPEC " \ ++ %{m64: ppc64} \ ++ %{!m64: \ ++ %{mcpu=601:ppc601; \ ++ mcpu=603:ppc603; \ ++ mcpu=603e:ppc603; \ ++ mcpu=604:ppc604; \ ++ mcpu=604e:ppc604e; \ ++ mcpu=740:ppc750; \ ++ mcpu=750:ppc750; \ ++ mcpu=G3:ppc750; \ ++ mcpu=7400:ppc7400; \ ++ mcpu=G4:ppc7400; \ ++ mcpu=7450:ppc7450; \ ++ mcpu=970:ppc970; \ ++ mcpu=power4:ppc970; \ ++ mcpu=G5:ppc970; \ ++ :ppc}}" ++ ++#undef SUBTARGET_EXTRA_SPECS ++#define SUBTARGET_EXTRA_SPECS \ ++ DARWIN_EXTRA_SPECS \ ++ { "darwin_arch", DARWIN_ARCH_SPEC }, \ ++ { "darwin_crt2", DARWIN_CRT2_SPEC }, \ ++ { "darwin_subarch", DARWIN_SUBARCH_SPEC }, +Index: gcc/config/rs6000/darwin64-biarch.h +=================================================================== +--- a/src/gcc/config/rs6000/darwin64-biarch.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/rs6000/darwin64-biarch.h (.../branches/gcc-8-branch) +@@ -0,0 +1,38 @@ ++/* Target definitions for PowerPC64 running Darwin (Mac OS X) for a 64b host ++ supporting a 32b multilib. ++ Copyright (C) 2006-2019 Free Software Foundation, Inc. ++ Contributed by Apple Computer Inc. ++ ++ This file is part of GCC. ++ ++ GCC is free software; you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published ++ by the Free Software Foundation; either version 3, or (at your ++ option) any later version. ++ ++ GCC is distributed in the hope that it will be useful, but WITHOUT ++ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ++ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public ++ License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with GCC; see the file COPYING3. If not see ++ . */ ++ ++#undef TARGET_DEFAULT ++#define TARGET_DEFAULT (MASK_POWERPC64 | MASK_64BIT \ ++ | MASK_MULTIPLE | MASK_PPC_GFXOPT) ++ ++#undef DARWIN_ARCH_SPEC ++#define DARWIN_ARCH_SPEC "%{m32:ppc;:ppc64}" ++ ++/* Actually, there's really only 970 as an active option. */ ++#undef DARWIN_SUBARCH_SPEC ++#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC ++ ++#undef SUBTARGET_EXTRA_SPECS ++#define SUBTARGET_EXTRA_SPECS \ ++ DARWIN_EXTRA_SPECS \ ++ { "darwin_arch", DARWIN_ARCH_SPEC }, \ ++ { "darwin_crt2", "" }, \ ++ { "darwin_subarch", DARWIN_SUBARCH_SPEC }, Index: gcc/config/rs6000/rs6000-builtin.def =================================================================== --- a/src/gcc/config/rs6000/rs6000-builtin.def (.../tags/gcc_8_3_0_release) @@ -32095,11 +49705,80 @@ /* Allocate structure to represent webs of insns. */ insn_entry = XCNEWVEC (swap_web_entry, get_max_uid ()); +Index: gcc/config/rs6000/darwin.h +=================================================================== +--- a/src/gcc/config/rs6000/darwin.h (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/rs6000/darwin.h (.../branches/gcc-8-branch) +@@ -53,9 +53,23 @@ + #define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ +- if (!TARGET_64BIT) builtin_define ("__ppc__"); \ +- if (TARGET_64BIT) builtin_define ("__ppc64__"); \ + builtin_define ("__POWERPC__"); \ ++ builtin_define ("__PPC__"); \ ++ if (TARGET_64BIT) \ ++ { \ ++ builtin_define ("__ppc64__"); \ ++ builtin_define ("__PPC64__"); \ ++ builtin_define ("__powerpc64__"); \ ++ builtin_assert ("cpu=powerpc64"); \ ++ builtin_assert ("machine=powerpc64"); \ ++ } \ ++ else \ ++ { \ ++ builtin_define ("__ppc__"); \ ++ builtin_define_std ("PPC"); \ ++ builtin_assert ("cpu=powerpc"); \ ++ builtin_assert ("machine=powerpc"); \ ++ } \ + builtin_define ("__NATURAL_ALIGNMENT__"); \ + darwin_cpp_builtins (pfile); \ + } \ +@@ -98,11 +112,10 @@ + %fregno % 2) == 1) cum->fregno++; @@ -32219,7 +49898,7 @@ { rtx rvec[GP_ARG_NUM_REG + AGGR_ARG_NUM_REG + 1]; rtx r, off; -@@ -12728,7 +12753,9 @@ +@@ -12728,7 +12762,9 @@ align_words = rs6000_parm_start (mode, type, cum->words); @@ -32230,7 +49909,7 @@ { unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3; -@@ -15417,9 +15444,17 @@ +@@ -15417,9 +15453,17 @@ op0 = expand_normal (arg0); op1 = expand_normal (arg1); @@ -32250,7 +49929,7 @@ tmode = TYPE_MODE (TREE_TYPE (TREE_TYPE (arg0))); mode0 = TYPE_MODE (TREE_TYPE (arg0)); -@@ -16765,15 +16800,6 @@ +@@ -16765,15 +16809,6 @@ case ALTIVEC_BUILTIN_VSPLTISH: case ALTIVEC_BUILTIN_VSPLTISW: { @@ -32266,7 +49945,7 @@ arg0 = gimple_call_arg (stmt, 0); lhs = gimple_call_lhs (stmt); -@@ -16780,8 +16806,7 @@ +@@ -16780,8 +16815,7 @@ /* Only fold the vec_splat_*() if the lower bits of arg 0 is a 5-bit signed constant in range -16 to +15. */ if (TREE_CODE (arg0) != INTEGER_CST @@ -32276,7 +49955,7 @@ return false; gimple_seq stmts = NULL; location_t loc = gimple_location (stmt); -@@ -18261,6 +18286,7 @@ +@@ -18261,6 +18295,7 @@ { /* unsigned 1 argument functions. */ case CRYPTO_BUILTIN_VSBOX: @@ -32284,7 +49963,7 @@ case P8V_BUILTIN_VGBBD: case MISC_BUILTIN_CDTBCD: case MISC_BUILTIN_CBCDTD: -@@ -18276,9 +18302,13 @@ +@@ -18276,9 +18311,13 @@ case ALTIVEC_BUILTIN_VMULOUH: case P8V_BUILTIN_VMULOUW: case CRYPTO_BUILTIN_VCIPHER: @@ -32298,7 +49977,7 @@ case CRYPTO_BUILTIN_VPMSUMB: case CRYPTO_BUILTIN_VPMSUMH: case CRYPTO_BUILTIN_VPMSUMW: -@@ -34192,6 +34222,10 @@ +@@ -34192,6 +34231,10 @@ rs6000_xcoff_output_readwrite_section_asm_op, &xcoff_private_data_section_name); @@ -32309,7 +49988,7 @@ tls_data_section = get_unnamed_section (SECTION_TLS, rs6000_xcoff_output_tls_section_asm_op, -@@ -34202,10 +34236,6 @@ +@@ -34202,10 +34245,6 @@ rs6000_xcoff_output_tls_section_asm_op, &xcoff_private_data_section_name); @@ -32320,7 +49999,7 @@ toc_section = get_unnamed_section (0, rs6000_xcoff_output_toc_section_asm_op, NULL); -@@ -34386,6 +34416,8 @@ +@@ -34386,6 +34425,8 @@ main_input_filename, ".bss_"); rs6000_gen_section_name (&xcoff_private_data_section_name, main_input_filename, ".rw_"); @@ -32329,7 +50008,7 @@ rs6000_gen_section_name (&xcoff_read_only_section_name, main_input_filename, ".ro_"); rs6000_gen_section_name (&xcoff_tls_data_section_name, -@@ -36605,11 +36637,21 @@ +@@ -36605,11 +36646,21 @@ unsigned int rs6000_dbx_register_number (unsigned int regno, unsigned int format) { @@ -32354,7 +50033,7 @@ /* On some platforms, we use the standard DWARF register numbering for .debug_info and .debug_frame. */ #ifdef RS6000_USE_DWARF_NUMBERING -@@ -36635,6 +36677,12 @@ +@@ -36635,6 +36686,12 @@ return 356; if (regno == VSCR_REGNO) return 67; @@ -32367,7 +50046,7 @@ #endif return regno; } -@@ -37840,6 +37888,7 @@ +@@ -37840,6 +37897,7 @@ /* Build result decl and add to function_decl. */ tree t = build_decl (UNKNOWN_LOCATION, RESULT_DECL, NULL_TREE, ptr_type_node); @@ -32401,6 +50080,254 @@ rs6000_split_vec_extract_var (gen_rtx_REG (smode, REGNO (operands[0])), operands[1], operands[2], operands[3], operands[4]); +Index: gcc/config/rs6000/altivec.md +=================================================================== +--- a/src/gcc/config/rs6000/altivec.md (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/rs6000/altivec.md (.../branches/gcc-8-branch) +@@ -80,9 +80,6 @@ + UNSPEC_VUPKHPX + UNSPEC_VUPKLPX + UNSPEC_CONVERT_4F32_8I16 +- UNSPEC_DARN +- UNSPEC_DARN_32 +- UNSPEC_DARN_RAW + UNSPEC_DST + UNSPEC_DSTT + UNSPEC_DSTST +@@ -161,9 +158,6 @@ + UNSPEC_BCDADD + UNSPEC_BCDSUB + UNSPEC_BCD_OVERFLOW +- UNSPEC_CMPRB +- UNSPEC_CMPRB2 +- UNSPEC_CMPEQB + UNSPEC_VRLMI + UNSPEC_VRLNM + ]) +@@ -4317,223 +4311,6 @@ + [(set_attr "length" "4") + (set_attr "type" "vecsimple")]) + +-(define_insn "darn_32" +- [(set (match_operand:SI 0 "register_operand" "=r") +- (unspec:SI [(const_int 0)] UNSPEC_DARN_32))] +- "TARGET_P9_MISC" +- "darn %0,0" +- [(set_attr "type" "integer")]) +- +-(define_insn "darn_raw" +- [(set (match_operand:DI 0 "register_operand" "=r") +- (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))] +- "TARGET_P9_MISC && TARGET_64BIT" +- "darn %0,2" +- [(set_attr "type" "integer")]) +- +-(define_insn "darn" +- [(set (match_operand:DI 0 "register_operand" "=r") +- (unspec:DI [(const_int 0)] UNSPEC_DARN))] +- "TARGET_P9_MISC && TARGET_64BIT" +- "darn %0,1" +- [(set_attr "type" "integer")]) +- +-;; Test byte within range. +-;; +-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx +-;; represents a byte whose value is ignored in this context and +-;; vv, the least significant byte, holds the byte value that is to +-;; be tested for membership within the range specified by operand 2. +-;; The bytes of operand 2 are organized as xx:xx:hi:lo. +-;; +-;; Return in target register operand 0 a value of 1 if lo <= vv and +-;; vv <= hi. Otherwise, set register operand 0 to 0. +-;; +-;; Though the instructions to which this expansion maps operate on +-;; 64-bit registers, the current implementation only operates on +-;; SI-mode operands as the high-order bits provide no information +-;; that is not already available in the low-order bits. To avoid the +-;; costs of data widening operations, future enhancements might allow +-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode. +-(define_expand "cmprb" +- [(set (match_dup 3) +- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") +- (match_operand:SI 2 "gpc_reg_operand" "r")] +- UNSPEC_CMPRB)) +- (set (match_operand:SI 0 "gpc_reg_operand" "=r") +- (if_then_else:SI (lt (match_dup 3) +- (const_int 0)) +- (const_int -1) +- (if_then_else (gt (match_dup 3) +- (const_int 0)) +- (const_int 1) +- (const_int 0))))] +- "TARGET_P9_MISC" +-{ +- operands[3] = gen_reg_rtx (CCmode); +-}) +- +-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx +-;; represents a byte whose value is ignored in this context and +-;; vv, the least significant byte, holds the byte value that is to +-;; be tested for membership within the range specified by operand 2. +-;; The bytes of operand 2 are organized as xx:xx:hi:lo. +-;; +-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if +-;; lo <= vv and vv <= hi. Otherwise, set the GT bit to 0. The other +-;; 3 bits of the target CR register are all set to 0. +-(define_insn "*cmprb_internal" +- [(set (match_operand:CC 0 "cc_reg_operand" "=y") +- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") +- (match_operand:SI 2 "gpc_reg_operand" "r")] +- UNSPEC_CMPRB))] +- "TARGET_P9_MISC" +- "cmprb %0,0,%1,%2" +- [(set_attr "type" "logical")]) +- +-;; Set operand 0 register to -1 if the LT bit (0x8) of condition +-;; register operand 1 is on. Otherwise, set operand 0 register to 1 +-;; if the GT bit (0x4) of condition register operand 1 is on. +-;; Otherwise, set operand 0 to 0. Note that the result stored into +-;; register operand 0 is non-zero iff either the LT or GT bits are on +-;; within condition register operand 1. +-(define_insn "setb_signed" +- [(set (match_operand:SI 0 "gpc_reg_operand" "=r") +- (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y") +- (const_int 0)) +- (const_int -1) +- (if_then_else (gt (match_dup 1) +- (const_int 0)) +- (const_int 1) +- (const_int 0))))] +- "TARGET_P9_MISC" +- "setb %0,%1" +- [(set_attr "type" "logical")]) +- +-(define_insn "setb_unsigned" +- [(set (match_operand:SI 0 "gpc_reg_operand" "=r") +- (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y") +- (const_int 0)) +- (const_int -1) +- (if_then_else (gtu (match_dup 1) +- (const_int 0)) +- (const_int 1) +- (const_int 0))))] +- "TARGET_P9_MISC" +- "setb %0,%1" +- [(set_attr "type" "logical")]) +- +-;; Test byte within two ranges. +-;; +-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx +-;; represents a byte whose value is ignored in this context and +-;; vv, the least significant byte, holds the byte value that is to +-;; be tested for membership within the range specified by operand 2. +-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2. +-;; +-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and +-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2). Otherwise, set register +-;; operand 0 to 0. +-;; +-;; Though the instructions to which this expansion maps operate on +-;; 64-bit registers, the current implementation only operates on +-;; SI-mode operands as the high-order bits provide no information +-;; that is not already available in the low-order bits. To avoid the +-;; costs of data widening operations, future enhancements might allow +-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode. +-(define_expand "cmprb2" +- [(set (match_dup 3) +- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") +- (match_operand:SI 2 "gpc_reg_operand" "r")] +- UNSPEC_CMPRB2)) +- (set (match_operand:SI 0 "gpc_reg_operand" "=r") +- (if_then_else:SI (lt (match_dup 3) +- (const_int 0)) +- (const_int -1) +- (if_then_else (gt (match_dup 3) +- (const_int 0)) +- (const_int 1) +- (const_int 0))))] +- "TARGET_P9_MISC" +-{ +- operands[3] = gen_reg_rtx (CCmode); +-}) +- +-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx +-;; represents a byte whose value is ignored in this context and +-;; vv, the least significant byte, holds the byte value that is to +-;; be tested for membership within the ranges specified by operand 2. +-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2. +-;; +-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if +-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2). +-;; Otherwise, set the GT bit to 0. The other 3 bits of the target +-;; CR register are all set to 0. +-(define_insn "*cmprb2_internal" +- [(set (match_operand:CC 0 "cc_reg_operand" "=y") +- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") +- (match_operand:SI 2 "gpc_reg_operand" "r")] +- UNSPEC_CMPRB2))] +- "TARGET_P9_MISC" +- "cmprb %0,1,%1,%2" +- [(set_attr "type" "logical")]) +- +-;; Test byte membership within set of 8 bytes. +-;; +-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx +-;; represents a byte whose value is ignored in this context and +-;; vv, the least significant byte, holds the byte value that is to +-;; be tested for membership within the set specified by operand 2. +-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7. +-;; +-;; Return in target register operand 0 a value of 1 if vv equals one +-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise, set +-;; register operand 0 to 0. Note that the 8 byte values held within +-;; operand 2 need not be unique. +-;; +-;; Though the instructions to which this expansion maps operate on +-;; 64-bit registers, the current implementation requires that operands +-;; 0 and 1 have mode SI as the high-order bits provide no information +-;; that is not already available in the low-order bits. To avoid the +-;; costs of data widening operations, future enhancements might allow +-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode. +-(define_expand "cmpeqb" +- [(set (match_dup 3) +- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") +- (match_operand:DI 2 "gpc_reg_operand" "r")] +- UNSPEC_CMPEQB)) +- (set (match_operand:SI 0 "gpc_reg_operand" "=r") +- (if_then_else:SI (lt (match_dup 3) +- (const_int 0)) +- (const_int -1) +- (if_then_else (gt (match_dup 3) +- (const_int 0)) +- (const_int 1) +- (const_int 0))))] +- "TARGET_P9_MISC && TARGET_64BIT" +-{ +- operands[3] = gen_reg_rtx (CCmode); +-}) +- +-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx +-;; represents a byte whose value is ignored in this context and +-;; vv, the least significant byte, holds the byte value that is to +-;; be tested for membership within the set specified by operand 2. +-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7. +-;; +-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv +-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise, +-;; set the GT bit to zero. The other 3 bits of the target CR register +-;; are all set to 0. +-(define_insn "*cmpeqb_internal" +- [(set (match_operand:CC 0 "cc_reg_operand" "=y") +- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") +- (match_operand:DI 2 "gpc_reg_operand" "r")] +- UNSPEC_CMPEQB))] +- "TARGET_P9_MISC && TARGET_64BIT" +- "cmpeqb %0,%1,%2" +- [(set_attr "type" "logical")]) +- + (define_expand "bcd_" + [(parallel [(set (reg:CCFP CR6_REGNO) + (compare:CCFP Index: gcc/config/rs6000/crypto.md =================================================================== --- a/src/gcc/config/rs6000/crypto.md (.../tags/gcc_8_3_0_release) @@ -32447,7 +50374,27 @@ =================================================================== --- a/src/gcc/config/rs6000/rs6000.md (.../tags/gcc_8_3_0_release) +++ b/src/gcc/config/rs6000/rs6000.md (.../branches/gcc-8-branch) -@@ -12594,15 +12594,18 @@ +@@ -136,6 +136,9 @@ + UNSPEC_LSQ + UNSPEC_FUSION_GPR + UNSPEC_STACK_CHECK ++ UNSPEC_CMPRB ++ UNSPEC_CMPRB2 ++ UNSPEC_CMPEQB + UNSPEC_FUSION_P9 + UNSPEC_FUSION_ADDIS + UNSPEC_ADD_ROUND_TO_ODD +@@ -162,6 +165,9 @@ + UNSPECV_EH_RR ; eh_reg_restore + UNSPECV_ISYNC ; isync instruction + UNSPECV_MFTB ; move from time base ++ UNSPECV_DARN ; darn 1 (deliver a random number) ++ UNSPECV_DARN_32 ; darn 2 ++ UNSPECV_DARN_RAW ; darn 0 + UNSPECV_NLGR ; non-local goto receiver + UNSPECV_MFFS ; Move from FPSCR + UNSPECV_MTFSF ; Move to FPSCR Fields +@@ -12594,15 +12600,18 @@ [(unspec [(const_int 0)] UNSPEC_GRP_END_NOP)] "" { @@ -32470,7 +50417,7 @@ ;; Define the subtract-one-and-jump insns, starting with the template ;; so loop.c knows what to generate. -@@ -12699,7 +12702,7 @@ +@@ -12699,7 +12708,7 @@ const0_rtx); emit_insn (gen_rtx_SET (operands[3], gen_rtx_COMPARE (CCmode, operands[1], const1_rtx))); @@ -32479,7 +50426,7 @@ emit_insn (gen_add3 (operands[0], operands[1], constm1_rtx)); else { -@@ -12768,7 +12771,7 @@ +@@ -12768,7 +12777,7 @@ (const_int 0)])) (match_operand 4) (match_operand 5))) @@ -32488,7 +50435,7 @@ (plus:P (match_dup 0) (const_int -1))) (clobber (match_scratch:P 7)) -@@ -12801,7 +12804,7 @@ +@@ -12801,7 +12810,7 @@ else emit_insn (gen_cceq_ior_compare_complement (operands[9], andexpr, ctrcmpcc, operands[8], cccmp, ccin)); @@ -32497,6 +50444,232 @@ emit_insn (gen_add3 (ctrout, ctr, constm1_rtx)); else { +@@ -14597,7 +14606,225 @@ + "xscmpuqp %0,%1,%2" + [(set_attr "type" "veccmp") + (set_attr "size" "128")]) ++ ++;; Miscellaneous ISA 3.0 (power9) instructions + ++(define_insn "darn_32" ++ [(set (match_operand:SI 0 "register_operand" "=r") ++ (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))] ++ "TARGET_P9_MISC" ++ "darn %0,0" ++ [(set_attr "type" "integer")]) ++ ++(define_insn "darn_raw" ++ [(set (match_operand:DI 0 "register_operand" "=r") ++ (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))] ++ "TARGET_P9_MISC && TARGET_64BIT" ++ "darn %0,2" ++ [(set_attr "type" "integer")]) ++ ++(define_insn "darn" ++ [(set (match_operand:DI 0 "register_operand" "=r") ++ (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))] ++ "TARGET_P9_MISC && TARGET_64BIT" ++ "darn %0,1" ++ [(set_attr "type" "integer")]) ++ ++;; Test byte within range. ++;; ++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx ++;; represents a byte whose value is ignored in this context and ++;; vv, the least significant byte, holds the byte value that is to ++;; be tested for membership within the range specified by operand 2. ++;; The bytes of operand 2 are organized as xx:xx:hi:lo. ++;; ++;; Return in target register operand 0 a value of 1 if lo <= vv and ++;; vv <= hi. Otherwise, set register operand 0 to 0. ++;; ++;; Though the instructions to which this expansion maps operate on ++;; 64-bit registers, the current implementation only operates on ++;; SI-mode operands as the high-order bits provide no information ++;; that is not already available in the low-order bits. To avoid the ++;; costs of data widening operations, future enhancements might allow ++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode. ++(define_expand "cmprb" ++ [(set (match_dup 3) ++ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") ++ (match_operand:SI 2 "gpc_reg_operand" "r")] ++ UNSPEC_CMPRB)) ++ (set (match_operand:SI 0 "gpc_reg_operand" "=r") ++ (if_then_else:SI (lt (match_dup 3) ++ (const_int 0)) ++ (const_int -1) ++ (if_then_else (gt (match_dup 3) ++ (const_int 0)) ++ (const_int 1) ++ (const_int 0))))] ++ "TARGET_P9_MISC" ++{ ++ operands[3] = gen_reg_rtx (CCmode); ++}) ++ ++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx ++;; represents a byte whose value is ignored in this context and ++;; vv, the least significant byte, holds the byte value that is to ++;; be tested for membership within the range specified by operand 2. ++;; The bytes of operand 2 are organized as xx:xx:hi:lo. ++;; ++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if ++;; lo <= vv and vv <= hi. Otherwise, set the GT bit to 0. The other ++;; 3 bits of the target CR register are all set to 0. ++(define_insn "*cmprb_internal" ++ [(set (match_operand:CC 0 "cc_reg_operand" "=y") ++ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") ++ (match_operand:SI 2 "gpc_reg_operand" "r")] ++ UNSPEC_CMPRB))] ++ "TARGET_P9_MISC" ++ "cmprb %0,0,%1,%2" ++ [(set_attr "type" "logical")]) ++ ++;; Set operand 0 register to -1 if the LT bit (0x8) of condition ++;; register operand 1 is on. Otherwise, set operand 0 register to 1 ++;; if the GT bit (0x4) of condition register operand 1 is on. ++;; Otherwise, set operand 0 to 0. Note that the result stored into ++;; register operand 0 is non-zero iff either the LT or GT bits are on ++;; within condition register operand 1. ++(define_insn "setb_signed" ++ [(set (match_operand:SI 0 "gpc_reg_operand" "=r") ++ (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y") ++ (const_int 0)) ++ (const_int -1) ++ (if_then_else (gt (match_dup 1) ++ (const_int 0)) ++ (const_int 1) ++ (const_int 0))))] ++ "TARGET_P9_MISC" ++ "setb %0,%1" ++ [(set_attr "type" "logical")]) ++ ++(define_insn "setb_unsigned" ++ [(set (match_operand:SI 0 "gpc_reg_operand" "=r") ++ (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y") ++ (const_int 0)) ++ (const_int -1) ++ (if_then_else (gtu (match_dup 1) ++ (const_int 0)) ++ (const_int 1) ++ (const_int 0))))] ++ "TARGET_P9_MISC" ++ "setb %0,%1" ++ [(set_attr "type" "logical")]) ++ ++;; Test byte within two ranges. ++;; ++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx ++;; represents a byte whose value is ignored in this context and ++;; vv, the least significant byte, holds the byte value that is to ++;; be tested for membership within the range specified by operand 2. ++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2. ++;; ++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and ++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2). Otherwise, set register ++;; operand 0 to 0. ++;; ++;; Though the instructions to which this expansion maps operate on ++;; 64-bit registers, the current implementation only operates on ++;; SI-mode operands as the high-order bits provide no information ++;; that is not already available in the low-order bits. To avoid the ++;; costs of data widening operations, future enhancements might allow ++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode. ++(define_expand "cmprb2" ++ [(set (match_dup 3) ++ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") ++ (match_operand:SI 2 "gpc_reg_operand" "r")] ++ UNSPEC_CMPRB2)) ++ (set (match_operand:SI 0 "gpc_reg_operand" "=r") ++ (if_then_else:SI (lt (match_dup 3) ++ (const_int 0)) ++ (const_int -1) ++ (if_then_else (gt (match_dup 3) ++ (const_int 0)) ++ (const_int 1) ++ (const_int 0))))] ++ "TARGET_P9_MISC" ++{ ++ operands[3] = gen_reg_rtx (CCmode); ++}) ++ ++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx ++;; represents a byte whose value is ignored in this context and ++;; vv, the least significant byte, holds the byte value that is to ++;; be tested for membership within the ranges specified by operand 2. ++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2. ++;; ++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if ++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2). ++;; Otherwise, set the GT bit to 0. The other 3 bits of the target ++;; CR register are all set to 0. ++(define_insn "*cmprb2_internal" ++ [(set (match_operand:CC 0 "cc_reg_operand" "=y") ++ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") ++ (match_operand:SI 2 "gpc_reg_operand" "r")] ++ UNSPEC_CMPRB2))] ++ "TARGET_P9_MISC" ++ "cmprb %0,1,%1,%2" ++ [(set_attr "type" "logical")]) ++ ++;; Test byte membership within set of 8 bytes. ++;; ++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx ++;; represents a byte whose value is ignored in this context and ++;; vv, the least significant byte, holds the byte value that is to ++;; be tested for membership within the set specified by operand 2. ++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7. ++;; ++;; Return in target register operand 0 a value of 1 if vv equals one ++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise, set ++;; register operand 0 to 0. Note that the 8 byte values held within ++;; operand 2 need not be unique. ++;; ++;; Though the instructions to which this expansion maps operate on ++;; 64-bit registers, the current implementation requires that operands ++;; 0 and 1 have mode SI as the high-order bits provide no information ++;; that is not already available in the low-order bits. To avoid the ++;; costs of data widening operations, future enhancements might allow ++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode. ++(define_expand "cmpeqb" ++ [(set (match_dup 3) ++ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") ++ (match_operand:DI 2 "gpc_reg_operand" "r")] ++ UNSPEC_CMPEQB)) ++ (set (match_operand:SI 0 "gpc_reg_operand" "=r") ++ (if_then_else:SI (lt (match_dup 3) ++ (const_int 0)) ++ (const_int -1) ++ (if_then_else (gt (match_dup 3) ++ (const_int 0)) ++ (const_int 1) ++ (const_int 0))))] ++ "TARGET_P9_MISC && TARGET_64BIT" ++{ ++ operands[3] = gen_reg_rtx (CCmode); ++}) ++ ++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx ++;; represents a byte whose value is ignored in this context and ++;; vv, the least significant byte, holds the byte value that is to ++;; be tested for membership within the set specified by operand 2. ++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7. ++;; ++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv ++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise, ++;; set the GT bit to zero. The other 3 bits of the target CR register ++;; are all set to 0. ++(define_insn "*cmpeqb_internal" ++ [(set (match_operand:CC 0 "cc_reg_operand" "=y") ++ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r") ++ (match_operand:DI 2 "gpc_reg_operand" "r")] ++ UNSPEC_CMPEQB))] ++ "TARGET_P9_MISC && TARGET_64BIT" ++ "cmpeqb %0,%1,%2" ++ [(set_attr "type" "logical")]) + + + (include "sync.md") Index: gcc/config/rs6000/altivec.h =================================================================== --- a/src/gcc/config/rs6000/altivec.h (.../tags/gcc_8_3_0_release) @@ -32513,6 +50686,57 @@ #endif #ifdef __POWER9_VECTOR__ +Index: gcc/config/darwin.c +=================================================================== +--- a/src/gcc/config/darwin.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/darwin.c (.../branches/gcc-8-branch) +@@ -2945,12 +2945,10 @@ + if (flag_objc_abi >= 2) + { + flags = 16; +- output_section_asm_op +- (darwin_sections[objc2_image_info_section]->unnamed.data); ++ switch_to_section (darwin_sections[objc2_image_info_section]); + } + else +- output_section_asm_op +- (darwin_sections[objc_image_info_section]->unnamed.data); ++ switch_to_section (darwin_sections[objc_image_info_section]); + + ASM_OUTPUT_ALIGN (asm_out_file, 2); + fputs ("L_OBJC_ImageInfo:\n", asm_out_file); +@@ -3242,8 +3240,6 @@ + /* so no tables either.. */ + flag_unwind_tables = 0; + flag_asynchronous_unwind_tables = 0; +- /* We still need to emit branch islands for kernel context. */ +- darwin_emit_branch_islands = true; + } + + if (flag_var_tracking_uninit == 0 +@@ -3253,6 +3249,8 @@ + && write_symbols == DWARF2_DEBUG) + flag_var_tracking_uninit = flag_var_tracking; + ++ /* Final check on PCI options; for Darwin these are not dependent on the PIE ++ ones, although PIE does require PIC to support it. */ + if (MACHO_DYNAMIC_NO_PIC_P) + { + if (flag_pic) +@@ -3261,9 +3259,11 @@ + " %<-fpie%> or %<-fPIE%>"); + flag_pic = 0; + } +- else if (flag_pic == 1) ++ else if (flag_pic == 1 ++ || (flag_pic == 0 && !(flag_mkernel || flag_apple_kext))) + { +- /* Darwin's -fpic is -fPIC. */ ++ /* Darwin's -fpic is -fPIC. ++ We only support "static" code in the kernel and kernel exts. */ + flag_pic = 2; + } + Index: gcc/config/darwin.h =================================================================== --- a/src/gcc/config/darwin.h (.../tags/gcc_8_3_0_release) @@ -32911,6 +51135,192 @@ } " ) +Index: gcc/config/darwin-driver.c +=================================================================== +--- a/src/gcc/config/darwin-driver.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/darwin-driver.c (.../branches/gcc-8-branch) +@@ -26,6 +26,91 @@ + #include "opts.h" + #include "diagnostic-core.h" + ++/* Validate a version string (either given on the command line or, perhaps ++ as MACOSX_DEPLOYMENT_TARGET). ++ ++ The specs %version-compare() function doesn't accept leading '0' on ++ numbers so strip them out. Do sanity checking here too. ++ ++ Return: ++ * original string means it was OK and we didn't want to change it. ++ * new string means it was OK but we rewrote it to avoid possible format ++ problems. ++ * NULL means we didn't like what we saw. ++*/ ++ ++static const char * ++validate_macosx_version_min (const char *version_str) ++{ ++ size_t version_len; ++ unsigned long major, minor, tiny = 0; ++ char *end; ++ const char *old_version = version_str; ++ bool need_rewrite = false; ++ ++ version_len = strlen (version_str); ++ if (version_len < 4) /* The minimum would be 10.x */ ++ return NULL; ++ ++ /* Version string must consist of digits and periods only. */ ++ if (strspn (version_str, "0123456789.") != version_len) ++ return NULL; ++ ++ if (!ISDIGIT (version_str[0]) || !ISDIGIT (version_str[version_len - 1])) ++ return NULL; ++ ++ if (version_str[0] == '0') ++ need_rewrite = true; ++ ++ major = strtoul (version_str, &end, 10); ++ version_str = end + ((*end == '.') ? 1 : 0); ++ ++ if (major != 10) /* So far .. all MacOS 10 ... */ ++ return NULL; ++ ++ /* Version string components must be present and numeric. */ ++ if (!ISDIGIT (version_str[0])) ++ return NULL; ++ ++ /* If we have one or more leading zeros on a component, then rewrite the ++ version string. */ ++ if (version_str[0] == '0' && version_str[1] != '\0' ++ && version_str[1] != '.') ++ need_rewrite = true; ++ ++ minor = strtoul (version_str, &end, 10); ++ version_str = end + ((*end == '.') ? 1 : 0); ++ if (minor > 99) ++ return NULL; ++ ++ /* If 'tiny' is present it must be numeric. */ ++ if (*end != '\0' && !ISDIGIT (version_str[0])) ++ return NULL; ++ ++ /* If we have one or more leading zeros on a component, then rewrite the ++ version string. */ ++ if (*end != '\0' && version_str[0] == '0' ++ && version_str[1] != '\0') ++ need_rewrite = true; ++ ++ tiny = strtoul (version_str, &end, 10); ++ if (tiny > 99) ++ return NULL; ++ ++ /* Version string must contain no more than three tokens. */ ++ if (*end != '\0') ++ return NULL; ++ ++ if (need_rewrite) ++ { ++ char *new_version; ++ asprintf (&new_version, "10.%lu.%lu", minor, tiny); ++ return new_version; ++ } ++ ++ return old_version; ++} ++ + #ifndef CROSS_DIRECTORY_STRUCTURE + #include + #include "xregex.h" +@@ -114,12 +199,13 @@ + + if (new_flag != NULL) + { +- size_t len = strlen (new_flag); +- if (len > 128) { /* Arbitrary limit, number should be like xx.yy.zz */ +- warning (0, "couldn%'t understand version %s\n", new_flag); +- return NULL; +- } +- new_flag = xstrndup (new_flag, len); ++ const char *checked = validate_macosx_version_min (new_flag); ++ if (checked == NULL) ++ { ++ warning (0, "couldn%'t understand version %s\n", new_flag); ++ return NULL; ++ } ++ new_flag = xstrndup (checked, strlen (checked)); + } + return new_flag; + } +@@ -175,7 +261,7 @@ + if (*decoded_options_count > i) { + memmove (*decoded_options + i, + *decoded_options + i + 1, +- ((*decoded_options_count - i) ++ ((*decoded_options_count - i - 1) + * sizeof (struct cl_decoded_option))); + } + --i; +@@ -209,7 +295,24 @@ + + case OPT_mmacosx_version_min_: + seen_version_min = true; +- vers_string = xstrndup ((*decoded_options)[i].arg, 32); ++ vers_string = ++ validate_macosx_version_min ((*decoded_options)[i].arg); ++ if (vers_string == NULL) ++ warning (0, "%qs is not valid for %\n", ++ (*decoded_options)[i].arg); ++ else if (vers_string == (*decoded_options)[i].arg) ++ vers_string = xstrndup ((*decoded_options)[i].arg, 32); ++ /* Now we've examined it, and verified/re-written, put it to ++ one side and append later. */ ++ if (*decoded_options_count > i) { ++ memmove (*decoded_options + i, ++ *decoded_options + i + 1, ++ ((*decoded_options_count - i - 1) ++ * sizeof (struct cl_decoded_option))); ++ } ++ --i; ++ --*decoded_options_count; ++ break; + + default: + break; +@@ -276,22 +379,20 @@ + so that we can figure out the mechanism and source for the sysroot to + be used. */ + if (! seen_version_min && *decoded_options_count > 1) +- { +- /* Not set by the User, try to figure it out. */ +- vers_string = darwin_default_min_version (); +- if (vers_string != NULL) +- { +- ++*decoded_options_count; +- *decoded_options = XRESIZEVEC (struct cl_decoded_option, +- *decoded_options, +- *decoded_options_count); +- generate_option (OPT_mmacosx_version_min_, vers_string, 1, CL_DRIVER, +- &(*decoded_options)[*decoded_options_count - 1]); +- } +- } +- /* Create and push the major version for assemblers that need it. */ ++ /* Not set by the User, try to figure it out. */ ++ vers_string = darwin_default_min_version (); ++ ++ /* Create and push a cleaned up version, plus the major version for ++ assemblers and other cases that need it. */ + if (vers_string != NULL) + { ++ ++*decoded_options_count; ++ *decoded_options = XRESIZEVEC (struct cl_decoded_option, ++ *decoded_options, ++ *decoded_options_count); ++ generate_option (OPT_mmacosx_version_min_, vers_string, 1, CL_DRIVER, ++ &(*decoded_options)[*decoded_options_count - 1]); ++ + char *asm_major = NULL; + const char *first_period = strchr(vers_string, '.'); + if (first_period != NULL) Index: gcc/config/pa/pa.md =================================================================== --- a/src/gcc/config/pa/pa.md (.../tags/gcc_8_3_0_release) @@ -33186,6 +51596,28 @@ + +/* Output default function prologue for hpux. */ +#define TARGET_ASM_FUNCTION_PROLOGUE pa_output_function_prologue +Index: gcc/config/mips/mips.md +=================================================================== +--- a/src/gcc/config/mips/mips.md (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/config/mips/mips.md (.../branches/gcc-8-branch) +@@ -7502,7 +7502,7 @@ + ;; __builtin_mips_get_fcsr: move the FCSR into operand 0. + (define_expand "mips_get_fcsr" + [(set (match_operand:SI 0 "register_operand") +- (unspec_volatile [(const_int 0)] UNSPEC_GET_FCSR))] ++ (unspec_volatile:SI [(const_int 0)] UNSPEC_GET_FCSR))] + "TARGET_HARD_FLOAT_ABI" + { + if (TARGET_MIPS16) +@@ -7514,7 +7514,7 @@ + + (define_insn "*mips_get_fcsr" + [(set (match_operand:SI 0 "register_operand" "=d") +- (unspec_volatile [(const_int 0)] UNSPEC_GET_FCSR))] ++ (unspec_volatile:SI [(const_int 0)] UNSPEC_GET_FCSR))] + "TARGET_HARD_FLOAT" + "cfc1\t%0,$31") + Index: gcc/config/mips/mips.c =================================================================== --- a/src/gcc/config/mips/mips.c (.../tags/gcc_8_3_0_release) @@ -33219,6 +51651,45 @@ case CODE_FOR_msa_slli_b: case CODE_FOR_msa_slli_h: case CODE_FOR_msa_slli_w: +Index: gcc/tree-vect-slp.c +=================================================================== +--- a/src/gcc/tree-vect-slp.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/tree-vect-slp.c (.../branches/gcc-8-branch) +@@ -1308,6 +1308,9 @@ + && nops == 2 + && oprnds_info[1]->first_dt == vect_internal_def + && is_gimple_assign (stmt) ++ /* Swapping operands for reductions breaks assumptions later on. */ ++ && STMT_VINFO_DEF_TYPE (vinfo_for_stmt (stmt)) != vect_reduction_def ++ && STMT_VINFO_DEF_TYPE (vinfo_for_stmt (stmt)) != vect_double_reduction_def + /* Do so only if the number of not successful permutes was nor more + than a cut-ff as re-trying the recursive match on + possibly each level of the tree would expose exponential +Index: gcc/cfgrtl.c +=================================================================== +--- a/src/gcc/cfgrtl.c (.../tags/gcc_8_3_0_release) ++++ b/src/gcc/cfgrtl.c (.../branches/gcc-8-branch) +@@ -4233,7 +4233,7 @@ + /* Create a duplicate of the basic block BB. */ + + static basic_block +-cfg_layout_duplicate_bb (basic_block bb) ++cfg_layout_duplicate_bb (basic_block bb, copy_bb_data *) + { + rtx_insn *insn; + basic_block new_bb; +@@ -5059,9 +5059,9 @@ + } + + static basic_block +-rtl_duplicate_bb (basic_block bb) ++rtl_duplicate_bb (basic_block bb, copy_bb_data *id) + { +- bb = cfg_layout_duplicate_bb (bb); ++ bb = cfg_layout_duplicate_bb (bb, id); + bb->aux = NULL; + return bb; + } Index: gcc/dce.c =================================================================== --- a/src/gcc/dce.c (.../tags/gcc_8_3_0_release) @@ -33706,7 +52177,7 @@ #define LTO_major_version 7 -#define LTO_minor_version 1 -+#define LTO_minor_version 2 ++#define LTO_minor_version 3 typedef unsigned char lto_decl_flags_t; @@ -33926,7 +52397,44 @@ =================================================================== --- a/src/fixincludes/ChangeLog (.../tags/gcc_8_3_0_release) +++ b/src/fixincludes/ChangeLog (.../branches/gcc-8-branch) -@@ -1,3 +1,23 @@ +@@ -1,3 +1,60 @@ ++2019-08-25 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-08-18 C.G. Dogan ++ Iain Sandoe ++ ++ PR target/83531 ++ * inclhack.def (darwin_api_availability): New; strip leading ++ underscores from API_XXXX defines. ++ * fixincl.x: Regenerate. ++ * tests/base/os/availability.h: New file. ++ ++2019-08-24 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-06-21 Iain Sandoe ++ ++ * inclhack.def: Replace the complex test using __STRICT_ANSI__ and ++ __STDC_VERSION__ with a test using __DARWIN_NO_LONG_LONG. ++ Ensure that the top level math.h uses <> to wrap included headers ++ rather than "". ++ * fixincl.x: Regenerated. ++ * tests/base/architecture/ppc/math.h: Update test to include the ++ __DARWIN_NO_LONG_LONG case. ++ ++2019-08-24 Iain Sandoe ++ ++ Backport from mainline. ++ 2019-06-21 Iain Sandoe ++ ++ * inclhack.def: Guard __has_attribute and __has_extension in ++ os/base.h. ++ Guard Apple blocks syntax in dispatch/object.h. ++ * fixincl.x: Regenerate. ++ * tests/base/dispatch/object.h: New file. ++ * tests/base/os/base.h: New file. ++ +2019-06-01 Iain Sandoe + + Backport from mainline. @@ -33950,6 +52458,90 @@ 2019-02-22 Release Manager * GCC 8.3.0 released. +Index: fixincludes/tests/base/dispatch/object.h +=================================================================== +--- a/src/fixincludes/tests/base/dispatch/object.h (.../tags/gcc_8_3_0_release) ++++ b/src/fixincludes/tests/base/dispatch/object.h (.../branches/gcc-8-branch) +@@ -0,0 +1,18 @@ ++/* DO NOT EDIT THIS FILE. ++ ++ It has been auto-edited by fixincludes from: ++ ++ "fixinc/tests/inc/dispatch/object.h" ++ ++ This had to be done to correct non-standard usages in the ++ original, manufacturer supplied header file. */ ++ ++ ++ ++#if defined( DARWIN_DISPATCH_OBJECT_1_CHECK ) ++#if __BLOCKS__ ++typedef void (^dispatch_block_t)(void); ++#endif ++ ++__BEGIN_DECLS ++#endif /* DARWIN_DISPATCH_OBJECT_1_CHECK */ +Index: fixincludes/tests/base/os/availability.h +=================================================================== +--- a/src/fixincludes/tests/base/os/availability.h (.../tags/gcc_8_3_0_release) ++++ b/src/fixincludes/tests/base/os/availability.h (.../branches/gcc-8-branch) +@@ -0,0 +1,18 @@ ++/* DO NOT EDIT THIS FILE. ++ ++ It has been auto-edited by fixincludes from: ++ ++ "fixinc/tests/inc/os/availability.h" ++ ++ This had to be done to correct non-standard usages in the ++ original, manufacturer supplied header file. */ ++ ++ ++ ++#if defined( DARWIN_API_AVAILABILITY_CHECK ) ++ #define API_AVAILABLE(...) ++ #define API_DEPRECATED(...) ++ #define API_DEPRECATED_WITH_REPLACEMENT(...) ++ #define API_UNAVAILABLE(...) ++ ++#endif /* DARWIN_API_AVAILABILITY_CHECK */ +Index: fixincludes/tests/base/os/base.h +=================================================================== +--- a/src/fixincludes/tests/base/os/base.h (.../tags/gcc_8_3_0_release) ++++ b/src/fixincludes/tests/base/os/base.h (.../branches/gcc-8-branch) +@@ -0,0 +1,20 @@ ++/* DO NOT EDIT THIS FILE. ++ ++ It has been auto-edited by fixincludes from: ++ ++ "fixinc/tests/inc/os/base.h" ++ ++ This had to be done to correct non-standard usages in the ++ original, manufacturer supplied header file. */ ++ ++ ++ ++#if defined( DARWIN_OS_BASE_1_CHECK ) ++#define __has_attribute(x) 0 ++#endif ++#ifndef __has_extension ++#define __has_extension(x) 0 ++#endif ++ ++#if __GNUC__ ++#endif /* DARWIN_OS_BASE_1_CHECK */ +Index: fixincludes/tests/base/architecture/ppc/math.h +=================================================================== +--- a/src/fixincludes/tests/base/architecture/ppc/math.h (.../tags/gcc_8_3_0_release) ++++ b/src/fixincludes/tests/base/architecture/ppc/math.h (.../branches/gcc-8-branch) +@@ -12,3 +12,8 @@ + #if defined( BROKEN_NAN_CHECK ) + #if 1 + #endif /* BROKEN_NAN_CHECK */ ++ ++ ++#if defined( DARWIN_LL_FUNCS_AVAIL_CHECK ) ++#if !(__DARWIN_NO_LONG_LONG) ++#endif /* DARWIN_LL_FUNCS_AVAIL_CHECK */ Index: fixincludes/fixincl.x =================================================================== --- a/src/fixincludes/fixincl.x (.../tags/gcc_8_3_0_release) @@ -33959,12 +52551,12 @@ * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed February 22, 2018 at 03:46:51 PM by AutoGen 5.18 -+ * It has been AutoGen-ed May 30, 2019 at 01:23:39 AM by AutoGen 5.17.4 ++ * It has been AutoGen-ed August 24, 2019 at 04:04:26 PM by AutoGen 5.17.4 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Feb 22 15:46:51 UTC 2018 -+/* DO NOT SVN-MERGE THIS FILE, EITHER Thu May 30 01:23:39 BST 2019 ++/* DO NOT SVN-MERGE THIS FILE, EITHER Sat Aug 24 16:04:26 BST 2019 * * You must regenerate it. Use the ./genfixes script. * @@ -33973,11 +52565,207 @@ * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 249 fixup descriptions. -+ * This file contains 250 fixup descriptions. ++ * This file contains 254 fixup descriptions. * * See README for more information. * -@@ -3222,6 +3222,48 @@ +@@ -269,6 +269,56 @@ + + /* * * * * * * * * * * * * * * * * * * * * * * * * * + * ++ * Description of Darwin_Api_Availability fix ++ */ ++tSCC zDarwin_Api_AvailabilityName[] = ++ "darwin_api_availability"; ++ ++/* ++ * File name selection pattern ++ */ ++tSCC zDarwin_Api_AvailabilityList[] = ++ "os/availability.h\0"; ++/* ++ * Machine/OS name selection pattern ++ */ ++tSCC* apzDarwin_Api_AvailabilityMachs[] = { ++ "*-*-darwin*", ++ (const char*)NULL }; ++ ++/* ++ * content selection pattern - do fix if pattern found ++ */ ++tSCC zDarwin_Api_AvailabilitySelect0[] = ++ " *#define __API_AVAILABLE.*\n\ ++ *#define __API_DEPRECATED.*\n\ ++ *#define __API_DEPRECATED_WITH_REPLACEMENT.*\n\ ++ *#define __API_UNAVAILABLE.*\n"; ++ ++/* ++ * content bypass pattern - skip fix if pattern found ++ */ ++tSCC zDarwin_Api_AvailabilityBypass0[] = ++ "__IPHONE_OS_VERSION_MIN_REQUIRED"; ++ ++#define DARWIN_API_AVAILABILITY_TEST_CT 2 ++static tTestDesc aDarwin_Api_AvailabilityTests[] = { ++ { TT_NEGREP, zDarwin_Api_AvailabilityBypass0, (regex_t*)NULL }, ++ { TT_EGREP, zDarwin_Api_AvailabilitySelect0, (regex_t*)NULL }, }; ++ ++/* ++ * Fix Command Arguments for Darwin_Api_Availability ++ */ ++static const char* apzDarwin_Api_AvailabilityPatch[] = { ++ "format", ++ " #define API_AVAILABLE(...)\n\ ++ #define API_DEPRECATED(...)\n\ ++ #define API_DEPRECATED_WITH_REPLACEMENT(...)\n\ ++ #define API_UNAVAILABLE(...)\n", ++ (char*)NULL }; ++ ++/* * * * * * * * * * * * * * * * * * * * * * * * * * ++ * + * Description of Aab_Fd_Zero_Asm_Posix_Types_H fix + */ + tSCC zAab_Fd_Zero_Asm_Posix_Types_HName[] = +@@ -2598,7 +2648,7 @@ + * Machine/OS name selection pattern + */ + tSCC* apzDarwin_9_Long_Double_Funcs_2Machs[] = { +- "*-*-darwin7.9*", ++ "*-*-darwin*", + (const char*)NULL }; + + /* +@@ -2704,6 +2754,42 @@ + + /* * * * * * * * * * * * * * * * * * * * * * * * * * + * ++ * Description of Darwin_Ll_Funcs_Avail fix ++ */ ++tSCC zDarwin_Ll_Funcs_AvailName[] = ++ "darwin_ll_funcs_avail"; ++ ++/* ++ * File name selection pattern ++ */ ++tSCC zDarwin_Ll_Funcs_AvailList[] = ++ "architecture/ppc/math.h\0architecture/i386/math.h\0"; ++/* ++ * Machine/OS name selection pattern ++ */ ++tSCC* apzDarwin_Ll_Funcs_AvailMachs[] = { ++ "*-*-darwin*", ++ (const char*)NULL }; ++ ++/* ++ * content selection pattern - do fix if pattern found ++ */ ++tSCC zDarwin_Ll_Funcs_AvailSelect0[] = ++ "#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^1]*199901L[^_]*__STRICT_ANSI__[^_]*__GNUC__[^)]*"; ++ ++#define DARWIN_LL_FUNCS_AVAIL_TEST_CT 1 ++static tTestDesc aDarwin_Ll_Funcs_AvailTests[] = { ++ { TT_EGREP, zDarwin_Ll_Funcs_AvailSelect0, (regex_t*)NULL }, }; ++ ++/* ++ * Fix Command Arguments for Darwin_Ll_Funcs_Avail ++ */ ++static const char* apzDarwin_Ll_Funcs_AvailPatch[] = { sed_cmd_z, ++ "-e", "s/#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^_]*199901L[^_]*__STRICT_ANSI__[^_]*__GNUC__[^\\)]*)/#if !(__DARWIN_NO_LONG_LONG)/", ++ (char*)NULL }; ++ ++/* * * * * * * * * * * * * * * * * * * * * * * * * * ++ * + * Description of Darwin_Longjmp_Noreturn fix + */ + tSCC zDarwin_Longjmp_NoreturnName[] = +@@ -2866,6 +2952,86 @@ + + /* * * * * * * * * * * * * * * * * * * * * * * * * * + * ++ * Description of Darwin_Os_Base_1 fix ++ */ ++tSCC zDarwin_Os_Base_1Name[] = ++ "darwin_os_base_1"; ++ ++/* ++ * File name selection pattern ++ */ ++tSCC zDarwin_Os_Base_1List[] = ++ "os/base.h\0"; ++/* ++ * Machine/OS name selection pattern ++ */ ++tSCC* apzDarwin_Os_Base_1Machs[] = { ++ "*-*-darwin*", ++ (const char*)NULL }; ++ ++/* ++ * content selection pattern - do fix if pattern found ++ */ ++tSCC zDarwin_Os_Base_1Select0[] = ++ "#define __has_attribute.*\n\ ++#endif"; ++ ++#define DARWIN_OS_BASE_1_TEST_CT 1 ++static tTestDesc aDarwin_Os_Base_1Tests[] = { ++ { TT_EGREP, zDarwin_Os_Base_1Select0, (regex_t*)NULL }, }; ++ ++/* ++ * Fix Command Arguments for Darwin_Os_Base_1 ++ */ ++static const char* apzDarwin_Os_Base_1Patch[] = { ++ "format", ++ "%0\n\ ++#ifndef __has_extension\n\ ++#define __has_extension(x) 0\n\ ++#endif", ++ (char*)NULL }; ++ ++/* * * * * * * * * * * * * * * * * * * * * * * * * * ++ * ++ * Description of Darwin_Dispatch_Object_1 fix ++ */ ++tSCC zDarwin_Dispatch_Object_1Name[] = ++ "darwin_dispatch_object_1"; ++ ++/* ++ * File name selection pattern ++ */ ++tSCC zDarwin_Dispatch_Object_1List[] = ++ "dispatch/object.h\0"; ++/* ++ * Machine/OS name selection pattern ++ */ ++tSCC* apzDarwin_Dispatch_Object_1Machs[] = { ++ "*-*-darwin*", ++ (const char*)NULL }; ++ ++/* ++ * content selection pattern - do fix if pattern found ++ */ ++tSCC zDarwin_Dispatch_Object_1Select0[] = ++ "typedef void.*\\^dispatch_block_t.*"; ++ ++#define DARWIN_DISPATCH_OBJECT_1_TEST_CT 1 ++static tTestDesc aDarwin_Dispatch_Object_1Tests[] = { ++ { TT_EGREP, zDarwin_Dispatch_Object_1Select0, (regex_t*)NULL }, }; ++ ++/* ++ * Fix Command Arguments for Darwin_Dispatch_Object_1 ++ */ ++static const char* apzDarwin_Dispatch_Object_1Patch[] = { ++ "format", ++ "#if __BLOCKS__\n\ ++%0\n\ ++#endif", ++ (char*)NULL }; ++ ++/* * * * * * * * * * * * * * * * * * * * * * * * * * ++ * + * Description of Darwin_Private_Extern fix + */ + tSCC zDarwin_Private_ExternName[] = +@@ -3222,6 +3388,48 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -34026,19 +52814,41 @@ * Description of Dec_Intern_Asm fix */ tSCC zDec_Intern_AsmName[] = -@@ -10099,9 +10141,9 @@ +@@ -10099,9 +10307,9 @@ * * List of all fixes */ -#define REGEX_COUNT 287 -+#define REGEX_COUNT 288 ++#define REGEX_COUNT 293 #define MACH_LIST_SIZE_LIMIT 187 -#define FIX_COUNT 249 -+#define FIX_COUNT 250 ++#define FIX_COUNT 254 /* * Enumerate the fixes -@@ -10183,6 +10225,7 @@ +@@ -10110,6 +10318,7 @@ + AAB_AIX_STDIO_FIXIDX, + AAB_AIX_FCNTL_FIXIDX, + AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_FIXIDX, ++ DARWIN_API_AVAILABILITY_FIXIDX, + AAB_FD_ZERO_ASM_POSIX_TYPES_H_FIXIDX, + AAB_FD_ZERO_GNU_TYPES_H_FIXIDX, + AAB_FD_ZERO_SELECTBITS_H_FIXIDX, +@@ -10171,10 +10380,13 @@ + DARWIN_9_LONG_DOUBLE_FUNCS_2_FIXIDX, + DARWIN_EXTERNC_FIXIDX, + DARWIN_GCC4_BREAKAGE_FIXIDX, ++ DARWIN_LL_FUNCS_AVAIL_FIXIDX, + DARWIN_LONGJMP_NORETURN_FIXIDX, + DARWIN_OS_TRACE_1_FIXIDX, + DARWIN_OS_TRACE_2_FIXIDX, + DARWIN_OS_TRACE_3_FIXIDX, ++ DARWIN_OS_BASE_1_FIXIDX, ++ DARWIN_DISPATCH_OBJECT_1_FIXIDX, + DARWIN_PRIVATE_EXTERN_FIXIDX, + DARWIN_STDINT_1_FIXIDX, + DARWIN_STDINT_2_FIXIDX, +@@ -10183,6 +10395,7 @@ DARWIN_STDINT_5_FIXIDX, DARWIN_STDINT_6_FIXIDX, DARWIN_STDINT_7_FIXIDX, @@ -34046,7 +52856,48 @@ DEC_INTERN_ASM_FIXIDX, DJGPP_WCHAR_H_FIXIDX, ECD_CURSOR_FIXIDX, -@@ -10739,6 +10782,11 @@ +@@ -10374,6 +10587,11 @@ + AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT, + aAab_Darwin7_9_Long_Double_FuncsTests, apzAab_Darwin7_9_Long_Double_FuncsPatch, 0 }, + ++ { zDarwin_Api_AvailabilityName, zDarwin_Api_AvailabilityList, ++ apzDarwin_Api_AvailabilityMachs, ++ DARWIN_API_AVAILABILITY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, ++ aDarwin_Api_AvailabilityTests, apzDarwin_Api_AvailabilityPatch, 0 }, ++ + { zAab_Fd_Zero_Asm_Posix_Types_HName, zAab_Fd_Zero_Asm_Posix_Types_HList, + apzAab_Fd_Zero_Asm_Posix_Types_HMachs, + AAB_FD_ZERO_ASM_POSIX_TYPES_H_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT, +@@ -10679,6 +10897,11 @@ + DARWIN_GCC4_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aDarwin_Gcc4_BreakageTests, apzDarwin_Gcc4_BreakagePatch, 0 }, + ++ { zDarwin_Ll_Funcs_AvailName, zDarwin_Ll_Funcs_AvailList, ++ apzDarwin_Ll_Funcs_AvailMachs, ++ DARWIN_LL_FUNCS_AVAIL_TEST_CT, FD_MACH_ONLY, ++ aDarwin_Ll_Funcs_AvailTests, apzDarwin_Ll_Funcs_AvailPatch, 0 }, ++ + { zDarwin_Longjmp_NoreturnName, zDarwin_Longjmp_NoreturnList, + apzDarwin_Longjmp_NoreturnMachs, + DARWIN_LONGJMP_NORETURN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, +@@ -10699,6 +10922,16 @@ + DARWIN_OS_TRACE_3_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aDarwin_Os_Trace_3Tests, apzDarwin_Os_Trace_3Patch, 0 }, + ++ { zDarwin_Os_Base_1Name, zDarwin_Os_Base_1List, ++ apzDarwin_Os_Base_1Machs, ++ DARWIN_OS_BASE_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, ++ aDarwin_Os_Base_1Tests, apzDarwin_Os_Base_1Patch, 0 }, ++ ++ { zDarwin_Dispatch_Object_1Name, zDarwin_Dispatch_Object_1List, ++ apzDarwin_Dispatch_Object_1Machs, ++ DARWIN_DISPATCH_OBJECT_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, ++ aDarwin_Dispatch_Object_1Tests, apzDarwin_Dispatch_Object_1Patch, 0 }, ++ + { zDarwin_Private_ExternName, zDarwin_Private_ExternList, + apzDarwin_Private_ExternMachs, + DARWIN_PRIVATE_EXTERN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, +@@ -10739,6 +10972,11 @@ DARWIN_STDINT_7_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aDarwin_Stdint_7Tests, apzDarwin_Stdint_7Patch, 0 }, @@ -34062,7 +52913,139 @@ =================================================================== --- a/src/fixincludes/inclhack.def (.../tags/gcc_8_3_0_release) +++ b/src/fixincludes/inclhack.def (.../branches/gcc-8-branch) -@@ -1592,6 +1592,25 @@ +@@ -195,6 +195,33 @@ + }; + + /* ++ * SDKs for 10.13 and 10.14 omit the definitions for API_AVAILABLE where ++ * __attribute__((availability)) is not supported. ++ */ ++fix = { ++ hackname = darwin_api_availability; ++ mach = "*-*-darwin*"; ++ files = os/availability.h; ++ bypass = "__IPHONE_OS_VERSION_MIN_REQUIRED"; ++ select = ++ " *#define __API_AVAILABLE.*\n" ++ " *#define __API_DEPRECATED.*\n" ++ " *#define __API_DEPRECATED_WITH_REPLACEMENT.*\n" ++ " *#define __API_UNAVAILABLE.*\n"; ++ c_fix = format; ++ c_fix_arg = ++ " #define API_AVAILABLE(...)\n" ++ " #define API_DEPRECATED(...)\n" ++ " #define API_DEPRECATED_WITH_REPLACEMENT(...)\n" ++ " #define API_UNAVAILABLE(...)\n"; ++ test_text = ++ "#define __API_AVAILABLE(...)\n" ++ "#define __API_DEPRECATED(...)\n" ++ "#define __API_DEPRECATED_WITH_REPLACEMENT(...)\n" ++ "#define __API_UNAVAILABLE(...)\n"; ++}; ++ ++/* + * This fixes __FD_ZERO bug for linux 2.x.y (x <= 2 && y <= some n) + */ + fix = { +@@ -1268,12 +1295,12 @@ + }; + + /* +- * For the AAB_darwin7_9_long_double_funcs fix to be useful, +- * you have to not use "" includes. ++ * For the AAB_darwin7_9_long_double_funcs fix (and later fixes for long long) ++ * to be useful, the main math.h must use <> and not "" includes. + */ + fix = { + hackname = darwin_9_long_double_funcs_2; +- mach = "*-*-darwin7.9*"; ++ mach = "*-*-darwin*"; + files = math.h; + select = '#include[ \t]+\"'; + c_fix = format; +@@ -1281,7 +1308,7 @@ + + c_fix_arg = '([ \t]*#[ \t]*include[ \t]+)"([a-z0-9/]+)\.h"'; + +- test_text = '#include "architecture/ppc/math.h"'; ++ test_text = '#include '; + }; + + /* +@@ -1325,6 +1352,22 @@ + }; + + /* ++ * math.h hides the long long functions that are available on the system for ++ * 10.5 and 10.6 SDKs, we expect to use them in G++ without specifying a value ++ * for __STDC_VERSION__, or switching __STRICT_ANSI__ off. ++ */ ++fix = { ++ hackname = darwin_ll_funcs_avail; ++ mach = "*-*-darwin*"; ++ files = architecture/ppc/math.h, architecture/i386/math.h; ++ select = "#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^1]*199901L[^_]*" ++ "__STRICT_ANSI__[^_]*__GNUC__[^\)]*"; ++ sed = "s/#if[^_]*__STDC_VERSION__[^_]*__STDC_VERSION__[^_]*199901L[^_]*" ++ "__STRICT_ANSI__[^_]*__GNUC__[^\\)]*\)/#if\ !\(__DARWIN_NO_LONG_LONG\)/"; ++ test_text = "#if\ !(__DARWIN_NO_LONG_LONG)"; ++}; ++ ++/* + * Before Mac OS X 10.8 doesn't mark longjump noreturn. + */ + fix = { +@@ -1396,6 +1439,49 @@ + }; + + /* ++ * In macOS 10.10 , doesn't have __has_extension guarded. ++ */ ++fix = { ++ hackname = darwin_os_base_1; ++ mach = "*-*-darwin*"; ++ files = os/base.h; ++ select = <<- OS_BASE_1_SEL ++#define __has_attribute.* ++#endif ++OS_BASE_1_SEL; ++ c_fix = format; ++ c_fix_arg = <<- OS_BASE_1_FIX ++%0 ++#ifndef __has_extension ++#define __has_extension(x) 0 ++#endif ++OS_BASE_1_FIX; ++ test_text = <<- OS_BASE_1_TEST ++#define __has_attribute(x) 0 ++#endif ++ ++#if __GNUC__ ++OS_BASE_1_TEST; ++}; ++ ++/* ++ * In macOS 10.10 , has unguarded block syntax. ++ */ ++fix = { ++ hackname = darwin_dispatch_object_1; ++ mach = "*-*-darwin*"; ++ files = dispatch/object.h; ++ select = "typedef void.*\\^dispatch_block_t.*"; ++ c_fix = format; ++ c_fix_arg = "#if __BLOCKS__\n%0\n#endif"; ++ test_text = <<- DISPATCH_OBJECT_1_TEST ++typedef void (^dispatch_block_t)(void); ++ ++__BEGIN_DECLS ++DISPATCH_OBJECT_1_TEST; ++}; ++ ++/* + * __private_extern__ doesn't exist in FSF GCC. Even if it did, + * why would you ever put it in a system header file? + */ +@@ -1592,6 +1678,25 @@ "#define UINTMAX_C(v) (v ## ULL)"; }; diff -u gcc-8-8.3.0/debian/rules.conf gcc-8-8.3.0/debian/rules.conf --- gcc-8-8.3.0/debian/rules.conf +++ gcc-8-8.3.0/debian/rules.conf @@ -461,7 +461,13 @@ ifneq ($(DEB_CROSS),yes) # all archs for which to create b-d's -any_archs = alpha amd64 armel armhf arm64 i386 mips mipsel mips64 mips64el mipsn32 powerpc ppc64 ppc64el m68k sh4 sparc64 s390x x32 +any_archs := alpha amd64 armel armhf arm64 i386 mips mipsel mips64 mips64el mipsn32 powerpc ppc64 ppc64el m68k riscv64 sh4 sparc64 s390x x32 +ifeq (,$(filter $(distrelease),squeeze wheezy jessie stretch buster lucid precise xenial bionic cosmic disco)) + any_archs := $(filter-out mips, $(any_archs)) +endif +ifeq (,$(filter $(distrelease),squeeze wheezy jessie stretch buster lucid precise xenial bionic cosmic disco)) + any_archs := $(filter-out powerpcspe, $(any_archs)) +endif ifeq (yes,$(MIPS_R6_ENABLED)) any_archs += mipsn32el mipsr6 mipsr6el mips64r6 mips64r6el mipsn32r6 mipsn32r6el endif diff -u gcc-8-8.3.0/debian/rules.defs gcc-8-8.3.0/debian/rules.defs --- gcc-8-8.3.0/debian/rules.defs +++ gcc-8-8.3.0/debian/rules.defs @@ -347,7 +347,8 @@ # FIXME: buildds not powerful ebough: mips*, sparc64 # FIXME: just let it build, takes too long: hurd-i386 # FIXME: not yet tried to build: alpha - ifneq (,$(filter $(DEB_HOST_ARCH), alpha hppa m68k mips mipsel mips64el riscv64 sh4 sparc64 hurd-i386)) + # FIXME: armhf and arm64 ftbfs, started with 8.3.0-22 + ifneq (,$(filter $(DEB_HOST_ARCH), alpha armhf arm64 hppa m68k mips mipsel mips64el riscv64 sh4 sparc64 hurd-i386)) with_lto_build := endif # Debian armel/armhf buildds too slow @@ -1581,7 +1582,7 @@ with_check := disabled for $(DEB_HOST_ARCH), testsuite timeouts with expect endif endif -with_check := disabled for this upload +#with_check := disabled for this upload # not a dependency on all archs, but if available, use it for the testsuite ifneq (,$(wildcard /usr/bin/localedef)) diff -u gcc-8-8.3.0/debian/rules.parameters gcc-8-8.3.0/debian/rules.parameters --- gcc-8-8.3.0/debian/rules.parameters +++ gcc-8-8.3.0/debian/rules.parameters @@ -2,14 +2,14 @@ GCC_VERSION := 8.3.0 NEXT_GCC_VERSION := 8.3.1 BASE_VERSION := 8 -SOURCE_VERSION := 8.3.0-21ubuntu1 -DEB_VERSION := 8.3.0-21ubuntu1 -DEB_EVERSION := 1:8.3.0-21ubuntu1 -DEB_GDC_VERSION := 8.3.0-21ubuntu1 +SOURCE_VERSION := 8.3.0-22ubuntu1 +DEB_VERSION := 8.3.0-22ubuntu1 +DEB_EVERSION := 1:8.3.0-22ubuntu1 +DEB_GDC_VERSION := 8.3.0-22ubuntu1 DEB_SOVERSION := 5 DEB_SOEVERSION := 1:5 DEB_LIBGCC_SOVERSION := -DEB_LIBGCC_VERSION := 1:8.3.0-21ubuntu1 +DEB_LIBGCC_VERSION := 1:8.3.0-22ubuntu1 DEB_STDCXX_SOVERSION := 5 DEB_GOMP_SOVERSION := 5 GCC_SONAME := 1 diff -u gcc-8-8.3.0/debian/rules.patch gcc-8-8.3.0/debian/rules.patch --- gcc-8-8.3.0/debian/rules.patch +++ gcc-8-8.3.0/debian/rules.patch @@ -82,6 +82,7 @@ pr87808 \ pr88419-revert \ verbose-lto-linker \ + libstdc++-futex \ ifeq (,$(filter $(distrelease),precise trusty stretch jessie wheezy)) debian_patches += pr90050 diff -u gcc-8-8.3.0/debian/rules2 gcc-8-8.3.0/debian/rules2 --- gcc-8-8.3.0/debian/rules2 +++ gcc-8-8.3.0/debian/rules2 @@ -349,7 +349,11 @@ CONFARGS += --with-system-zlib ifeq ($(with_phobos),yes) - CONFARGS += --with-target-system-zlib + ifeq ($(DEB_CROSS),yes) + CONFARGS += --without-target-system-zlib + else + CONFARGS += --with-target-system-zlib=auto + endif endif ifeq ($(with_d),yes) only in patch2: unchanged: --- gcc-8-8.3.0.orig/debian/patches/libstdc++-futex.diff +++ gcc-8-8.3.0/debian/patches/libstdc++-futex.diff @@ -0,0 +1,87 @@ +# DP: Fix GCC_LINUX_FUTEX to work with C99 compilers + +config/ + +2019-09-06 Florian Weimer + + * futex.m4 (GCC_LINUX_FUTEX): Include for the syscall + function. + +libitm/ libgomp/ libstdc++-v3/ + +2019-09-06 Florian Weimer + + * configure: Regenerate. + +--- a/src/config/futex.m4 ++++ b/src/config/futex.m4 +@@ -22,6 +22,7 @@ case "$target" in + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include ++ #include + int lk;], + [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])], + [save_LIBS="$LIBS" +@@ -48,6 +49,7 @@ If so, please configure with --disable-l + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include ++ #include + int lk;], + [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])],[], + [AC_MSG_ERROR([SYS_gettid and SYS_futex required for --enable-linux-futex])]) +--- a/src/libitm/configure ++++ b/src/libitm/configure +@@ -16252,6 +16252,7 @@ case "$target" in + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include ++#include + int lk; + int + main () +@@ -16304,6 +16305,7 @@ rm -f core conftest.err conftest.$ac_obj + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include ++ #include + int lk; + int + main () +--- a/src/libgomp/configure ++++ b/src/libgomp/configure +@@ -15625,6 +15625,7 @@ case "$target" in + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include ++ #include + int lk; + int + main () +@@ -15677,6 +15678,7 @@ rm -f core conftest.err conftest.$ac_obj + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include ++ #include + int lk; + int + main () +--- a/src/libstdc++-v3/configure ++++ b/src/libstdc++-v3/configure +@@ -78433,6 +78433,7 @@ fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include ++ #include + int lk; + int + main () +@@ -78491,6 +78492,7 @@ fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include ++ #include + int lk; + int + main ()