From 84f24d821ec11f1139df1aa95515b6d7eb15598c Mon Sep 17 00:00:00 2001 From: basebuilder_pel7ppc64bebuilder0 Date: Thu, 22 Nov 2018 09:53:41 +0100 Subject: [PATCH] gcc + glibc package update from upstream el7 Signed-off-by: basebuilder_pel7ppc64bebuilder0 --- SOURCES/cloog-0.18.0-ppc64le-config.patch | 506 ++--- SOURCES/fastjar-0.97-aarch64-config.patch | 1064 +++++----- SOURCES/fastjar-0.97-filename0.patch | 6 +- SOURCES/fastjar-0.97-len1.patch | 4 +- SOURCES/fastjar-0.97-ppc64le-config.patch | 498 ++--- SOURCES/fastjar-0.97-segfault.patch | 10 +- SOURCES/fastjar-CVE-2010-0831.patch | 40 +- SOURCES/fastjar-man.patch | 14 +- SOURCES/gcc48-aarch64-ada.patch | 9 +- SOURCES/gcc48-aarch64-async-unw-tables.patch | 5 +- SOURCES/gcc48-aarch64-unwind-opt.patch | 212 +- SOURCES/gcc48-cloog-dl.patch | 26 +- SOURCES/gcc48-cloog-dl2.patch | 8 +- SOURCES/gcc48-color-auto.patch | 10 +- SOURCES/gcc48-hack.patch | 34 +- SOURCES/gcc48-i386-libgomp.patch | 12 +- SOURCES/gcc48-java-nomulti.patch | 12 +- SOURCES/gcc48-libgo-p224.patch | 112 +- SOURCES/gcc48-libgomp-20160715.patch | 806 +++---- SOURCES/gcc48-libgomp-omp_h-multilib.patch | 7 +- SOURCES/gcc48-libtool-no-rpath.patch | 24 +- SOURCES/gcc48-no-add-needed.patch | 10 +- SOURCES/gcc48-ppc32-retaddr.patch | 4 +- SOURCES/gcc48-pr28865.patch | 48 +- SOURCES/gcc48-pr38757.patch | 22 +- SOURCES/gcc48-pr52714.patch | 16 +- SOURCES/gcc48-pr53477.patch | 30 +- SOURCES/gcc48-pr56564.patch | 120 +- SOURCES/gcc48-pr62258.patch | 2 +- SOURCES/gcc48-pr63293.patch | 28 +- SOURCES/gcc48-pr65142.patch | 3 +- SOURCES/gcc48-pr66731.patch | 4 +- SOURCES/gcc48-pr66840.patch | 16 + SOURCES/gcc48-pr67281.patch | 50 +- SOURCES/gcc48-pr68680.patch | 6 +- SOURCES/gcc48-pr69116.patch | 6 +- SOURCES/gcc48-pr69644.patch | 8 +- SOURCES/gcc48-pr70549.patch | 4 +- SOURCES/gcc48-pr72717.patch | 87 + SOURCES/gcc48-pr72747.patch | 2 +- SOURCES/gcc48-pr72863.patch | 8 +- SOURCES/gcc48-pr77375.patch | 12 +- SOURCES/gcc48-pr77767.patch | 8 +- SOURCES/gcc48-pr78064.patch | 2 +- SOURCES/gcc48-pr78378.patch | 13 +- SOURCES/gcc48-pr78416.patch | 54 +- SOURCES/gcc48-pr78796.patch | 2 +- SOURCES/gcc48-pr78875.patch | 22 +- SOURCES/gcc48-pr79439.patch | 8 +- SOURCES/gcc48-pr79969.patch | 2 +- SOURCES/gcc48-pr80129.patch | 16 +- SOURCES/gcc48-pr80362.patch | 8 +- SOURCES/gcc48-pr80692.patch | 4 +- SOURCES/gcc48-pr81395.patch | 67 + SOURCES/gcc48-pr82274.patch | 12 +- SOURCES/gcc48-rh1180633.patch | 74 +- SOURCES/gcc48-rh1243366.patch | 10 +- SOURCES/gcc48-rh1278872.patch | 22 +- SOURCES/gcc48-rh1296211.patch | 2 +- SOURCES/gcc48-rh1304449.patch | 120 +- SOURCES/gcc48-rh1312436.patch | 22 +- SOURCES/gcc48-rh1344807.patch | 12 +- SOURCES/gcc48-rh1369183.patch | 6 +- SOURCES/gcc48-rh1402585.patch | 40 +- SOURCES/gcc48-rh1468546.patch | 28 +- SOURCES/gcc48-rh1469384.patch | 16 +- SOURCES/gcc48-rh1469697-1.patch | 12 +- SOURCES/gcc48-rh1469697-10.patch | 9 +- SOURCES/gcc48-rh1469697-11.patch | 68 +- SOURCES/gcc48-rh1469697-12.patch | 13 +- SOURCES/gcc48-rh1469697-13.patch | 6 +- SOURCES/gcc48-rh1469697-14.patch | 10 +- SOURCES/gcc48-rh1469697-15.patch | 74 +- SOURCES/gcc48-rh1469697-16.patch | 68 +- SOURCES/gcc48-rh1469697-17.patch | 8 +- SOURCES/gcc48-rh1469697-18.patch | 104 +- SOURCES/gcc48-rh1469697-19.patch | 30 +- SOURCES/gcc48-rh1469697-2.patch | 36 +- SOURCES/gcc48-rh1469697-20.patch | 14 +- SOURCES/gcc48-rh1469697-21.patch | 24 +- SOURCES/gcc48-rh1469697-22.patch | 22 +- SOURCES/gcc48-rh1469697-23.patch | 18 +- SOURCES/gcc48-rh1469697-3.patch | 84 +- SOURCES/gcc48-rh1469697-4.patch | 72 +- SOURCES/gcc48-rh1469697-5.patch | 7 +- SOURCES/gcc48-rh1469697-6.patch | 37 +- SOURCES/gcc48-rh1469697-7.patch | 30 +- SOURCES/gcc48-rh1469697-8.patch | 55 +- SOURCES/gcc48-rh1469697-9.patch | 94 +- SOURCES/gcc48-rh1482762.patch | 20 +- SOURCES/gcc48-rh1487434.patch | 34 +- SOURCES/gcc48-rh1491395.patch | 8 +- SOURCES/gcc48-rh1535655-1.patch | 6 +- SOURCES/gcc48-rh1535655-2.patch | 76 +- SOURCES/gcc48-rh1535655-3.patch | 170 +- SOURCES/gcc48-rh1535655-4.patch | 141 +- SOURCES/gcc48-rh1535655-5.patch | 20 +- SOURCES/gcc48-rh1535655-6.patch | 16 +- SOURCES/gcc48-rh1537828-1.patch | 38 + SOURCES/gcc48-rh1537828-10.patch | 91 + SOURCES/gcc48-rh1537828-2.patch | 114 + SOURCES/gcc48-rh1537828-3.patch | 163 ++ SOURCES/gcc48-rh1537828-4.patch | 182 ++ SOURCES/gcc48-rh1537828-5.patch | 80 + SOURCES/gcc48-rh1537828-6.patch | 64 + SOURCES/gcc48-rh1537828-7.patch | 414 ++++ SOURCES/gcc48-rh1537828-8.patch | 175 ++ SOURCES/gcc48-rh1537828-9.patch | 516 +++++ SOURCES/gcc48-rh1546372.patch | 162 ++ SOURCES/gcc48-rh1546728.patch | 48 + SOURCES/gcc48-rh1552021.patch | 1966 ++++++++++++++++++ SOURCES/gcc48-rh1555397.patch | 263 +++ SOURCES/gcc48-rh330771.patch | 6 +- SOURCES/gcc48-s390-z13.patch | 924 ++++---- SOURCES/gcc48-sparc-config-detection.patch | 48 +- SOURCES/isl-0.11.1-aarch64-config.patch | 344 +-- SOURCES/isl-0.11.1-ppc64le-config.patch | 498 ++--- SPECS/gcc.spec | 176 +- SPECS/glibc.spec | 695 ++++++- 119 files changed, 9005 insertions(+), 3823 deletions(-) create mode 100644 SOURCES/gcc48-pr66840.patch create mode 100644 SOURCES/gcc48-pr72717.patch create mode 100644 SOURCES/gcc48-pr81395.patch create mode 100644 SOURCES/gcc48-rh1537828-1.patch create mode 100644 SOURCES/gcc48-rh1537828-10.patch create mode 100644 SOURCES/gcc48-rh1537828-2.patch create mode 100644 SOURCES/gcc48-rh1537828-3.patch create mode 100644 SOURCES/gcc48-rh1537828-4.patch create mode 100644 SOURCES/gcc48-rh1537828-5.patch create mode 100644 SOURCES/gcc48-rh1537828-6.patch create mode 100644 SOURCES/gcc48-rh1537828-7.patch create mode 100644 SOURCES/gcc48-rh1537828-8.patch create mode 100644 SOURCES/gcc48-rh1537828-9.patch create mode 100644 SOURCES/gcc48-rh1546372.patch create mode 100644 SOURCES/gcc48-rh1546728.patch create mode 100644 SOURCES/gcc48-rh1552021.patch create mode 100644 SOURCES/gcc48-rh1555397.patch diff --git a/SOURCES/cloog-0.18.0-ppc64le-config.patch b/SOURCES/cloog-0.18.0-ppc64le-config.patch index e5cf7ca0..5538a24b 100644 --- a/SOURCES/cloog-0.18.0-ppc64le-config.patch +++ b/SOURCES/cloog-0.18.0-ppc64le-config.patch @@ -3,36 +3,36 @@ @@ -1312,7 +1312,7 @@ rm -rf conftest* ;; - + -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -1326,7 +1326,10 @@ - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) @@ -1345,7 +1348,10 @@ - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) --- cloog-0.18.0/autoconf/config.sub.jj 2013-10-11 09:27:45.000000000 +0200 +++ cloog-0.18.0/autoconf/config.sub 2014-04-10 10:38:39.000000000 +0200 @@ -1,24 +1,18 @@ @@ -79,8 +79,8 @@ +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). - - + + -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. @@ -90,12 +90,12 @@ @@ -73,9 +68,7 @@ Report bugs and patches to /dev/null` | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. @@ -400,68 +400,68 @@ +esac + # Note: order is significant - the case branches are not exclusive. - + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -200,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -302,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + echo arm-unknown-riscos + exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -801,6 +820,9 @@ EOF i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; @@ -852,21 +874,21 @@ EOF - exit ;; + exit ;; *:GNU:*:*) - # the GNU system + # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + exit ;; *:GNU/*:*:*) - # other systems with GNU libc and userland + # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; + exit ;; i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + echo ${UNAME_MACHINE}-pc-minix + exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be + UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,59 +901,54 @@ EOF - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi @@ -469,46 +469,46 @@ + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else + else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; + fi + fi + exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build @@ -520,58 +520,58 @@ - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build + eval $set_cc_for_build @@ -950,54 +967,63 @@ EOF - #endif + #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; + ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} - exit ;; + exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} - exit ;; + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; + esac + exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} - exit ;; + exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} @@ -581,55 +581,55 @@ + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} - exit ;; + exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; + exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; + exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1201,6 +1227,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; @@ -1227,19 +1256,21 @@ EOF - exit ;; + exit ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build @@ -658,22 +658,22 @@ + esac + fi + fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1256,7 +1287,7 @@ EOF NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1330,9 +1361,6 @@ EOF - exit ;; + exit ;; esac - + -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - @@ -685,33 +685,33 @@ @@ -6383,7 +6383,7 @@ ia64-*-hpux*) rm -rf conftest* ;; - + -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -1326,7 +1326,10 @@ - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) @@ -1345,7 +1348,10 @@ - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) diff --git a/SOURCES/fastjar-0.97-aarch64-config.patch b/SOURCES/fastjar-0.97-aarch64-config.patch index d7d61d59..d340abc8 100644 --- a/SOURCES/fastjar-0.97-aarch64-config.patch +++ b/SOURCES/fastjar-0.97-aarch64-config.patch @@ -8,10 +8,10 @@ -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. - + -timestamp='2008-01-23' +timestamp='2012-06-10' - + # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ timestamp='2008-01-23' @@ -27,8 +27,8 @@ # distribute this file as part of a program that contains a @@ -27,16 +25,16 @@ timestamp='2008-01-23' # the same distribution terms that you use for the rest of that program. - - + + -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. @@ -44,91 +44,91 @@ -# don't specify an explicit build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD - + me=`echo "$0" | sed -e 's,.*/,,'` - + @@ -56,8 +54,9 @@ version="\ GNU config.guess ($timestamp) - + Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. - + This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -144,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or + # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward @@ -170,7 +169,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null + | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? @@ -180,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - fi - ;; - *) + fi + ;; + *) - os=netbsd + os=netbsd - ;; - esac - # The OS release + ;; + esac + # The OS release @@ -223,7 +222,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on @@ -269,7 +268,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead @@ -295,7 +297,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - echo s390-ibm-zvmoe - exit ;; + echo s390-ibm-zvmoe + exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 - exit ;; + exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix${UNAME_RELEASE} @@ -324,14 +326,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; @@ -148,24 +148,24 @@ + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + exit ;; sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize + # According to config.sub, this is the proper way to canonicalize @@ -375,23 +396,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; @@ -182,41 +182,41 @@ + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; @@ -461,8 +482,8 @@ EOF - echo m88k-motorola-sysv3 - exit ;; + echo m88k-motorola-sysv3 + exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -475,7 +496,7 @@ EOF - else - echo i586-dg-dgux${UNAME_RELEASE} - fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + echo m88k-dolphin-sysv3 + exit ;; @@ -532,7 +553,7 @@ EOF - echo rs6000-ibm-aix3.2 - fi - exit ;; + echo rs6000-ibm-aix3.2 + fi + exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 @@ -575,52 +596,52 @@ EOF - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 @@ -233,24 +233,24 @@ + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c - + - #define _HPUX_SOURCE - #include - #include + #define _HPUX_SOURCE + #include + #include - + - int main () - { - #if defined(_SC_KERNEL_BITS) @@ -263,7 +263,7 @@ + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - + - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; @@ -303,49 +303,49 @@ + exit (0); + } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa @@ -640,7 +661,7 @@ EOF - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else + then + HP_ARCH="hppa2.0w" + else @@ -711,22 +732,22 @@ EOF - exit ;; + exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd + echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd + echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd + echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd + echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; @@ -750,14 +771,14 @@ EOF - exit ;; + exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" @@ -361,30 +361,30 @@ + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -769,13 +790,12 @@ EOF - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; + esac + exit ;; i*:CYGWIN*:*) @@ -784,19 +804,22 @@ EOF *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; @@ -393,36 +393,36 @@ - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 - exit ;; + exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in + *:Interix*:*) + case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; - EM64T | authenticamd) + authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) @@ -806,6 +829,9 @@ EOF [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -835,6 +861,27 @@ EOF i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; @@ -445,12 +445,12 @@ + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ @@ -842,20 +889,40 @@ EOF - then - echo ${UNAME_MACHINE}-unknown-linux-gnu - else + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP @@ -459,19 +459,19 @@ + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi - fi - exit ;; + fi + exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu - exit ;; + exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu - exit ;; + exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -489,33 +489,33 @@ +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit ;; + exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -866,74 +933,33 @@ EOF m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; - mips:Linux:*:*) + mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU - #undef mips - #undef mipsel + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel + CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips + CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif + #else + CPU= + #endif + #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ @@ -546,17 +546,17 @@ - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + padre:Linux:*:*) + echo sparc-unknown-linux-gnu - exit ;; + exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; @@ -575,13 +575,13 @@ - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu - exit ;; + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level + # Look for CPU level @@ -943,14 +969,17 @@ EOF - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + ppc64:Linux:*:*) @@ -589,34 +589,34 @@ + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu - exit ;; + exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; + echo ${UNAME_MACHINE}-ibm-linux + exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -958,78 +987,18 @@ EOF sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent @@ -681,11 +681,11 @@ - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both @@ -1037,11 +1006,11 @@ EOF - echo i386-sequent-sysv4 - exit ;; + echo i386-sequent-sysv4 + exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... @@ -693,34 +693,34 @@ + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. + # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; i*86:OS/2:*:*) @@ -1058,7 +1027,7 @@ EOF i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; + echo ${UNAME_MACHINE}-pc-syllable + exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; i*86:*DOS:*:*) @@ -1073,7 +1042,7 @@ EOF - fi - exit ;; + fi + exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; @@ -1101,10 +1070,13 @@ EOF - exit ;; + exit ;; pc:*:*:*) - # Left here for compatibility: + # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp @@ -733,11 +733,11 @@ + echo i586-pc-msdosdjgpp + exit ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + echo i386-pc-mach3 + exit ;; @@ -1139,8 +1111,18 @@ EOF - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; @@ -754,21 +754,21 @@ + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; @@ -1153,7 +1135,7 @@ EOF rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; SM[BE]S:UNIX_SV:*:*) @@ -1173,10 +1155,10 @@ EOF - echo ns32k-sni-sysv - fi - exit ;; + echo ns32k-sni-sysv + fi + exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 @@ -778,37 +778,37 @@ + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm @@ -1202,11 +1184,11 @@ EOF - exit ;; + exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then + if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} - else + else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} - fi + fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + echo powerpc-be-beos + exit ;; @@ -1216,6 +1198,9 @@ EOF BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; @@ -1243,6 +1228,16 @@ EOF *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then @@ -819,41 +819,41 @@ + UNAME_PROCESSOR="x86_64" + fi + fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} @@ -1258,7 +1253,10 @@ EOF *:QNX:*:4*) - echo i386-pc-qnx - exit ;; + echo i386-pc-qnx + exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1303,13 +1301,13 @@ EOF - echo pdp10-unknown-its - exit ;; + echo pdp10-unknown-its + exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} - exit ;; + exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; @@ -1324,6 +1322,12 @@ EOF i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; @@ -861,7 +861,7 @@ + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac - + #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1346,11 +1350,11 @@ main () #include @@ -877,7 +877,7 @@ + ); exit (0); #endif #endif - + --- fastjar-0.97/config.sub +++ fastjar-0.97/config.sub @@ -1,10 +1,10 @@ @@ -888,10 +888,10 @@ -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. - + -timestamp='2008-01-16' +timestamp='2012-04-18' - + # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ timestamp='2008-01-16' @@ -906,8 +906,8 @@ # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -32,13 +30,16 @@ timestamp='2008-01-16' - - + + # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. @@ -916,7 +916,7 @@ # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. - + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + @@ -926,13 +926,13 @@ @@ -72,8 +73,9 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) - + -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. - + This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -120,12 +122,18 @@ esac @@ -957,105 +957,105 @@ basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -148,10 +156,13 @@ case $os in - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis | -knuth | -cray | -microblaze) - os= - basic_machine=$1 - ;; + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 @@ -166,10 +177,10 @@ case $os in - os=-chorusos - basic_machine=$1 - ;; + os=-chorusos + basic_machine=$1 + ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb - basic_machine=$1 + basic_machine=$1 - ;; + ;; - -hiux*) - os=-hiuxwe2 - ;; + -hiux*) + os=-hiuxwe2 + ;; @@ -214,6 +225,12 @@ case $os in - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; - -lynx*) - os=-lynxos - ;; + -lynx*) + os=-lynxos + ;; @@ -238,24 +255,32 @@ case $basic_machine in - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ + | maxq | mb | microblaze | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ - | mips64vr | mips64vrel \ + | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ @@ -268,29 +293,42 @@ case $basic_machine in - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ - | mt \ - | msp430 \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ - | nios | nios2 \ - | ns16k | ns32k \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ + | pyramid \ + | rl78 | rx \ - | score \ + | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ @@ -1063,13 +1063,13 @@ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ + | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) - basic_machine=$basic_machine-unknown - ;; + basic_machine=$basic_machine-unknown + ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. + c54x) @@ -1082,13 +1082,13 @@ + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; + basic_machine=$basic_machine-unknown + os=-none + ;; @@ -300,6 +338,21 @@ case $basic_machine in - basic_machine=mt-unknown - ;; - + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; @@ -1104,114 +1104,114 @@ + basic_machine=armel-unknown + ;; + - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. @@ -314,29 +367,36 @@ case $basic_machine in - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ - | bfin-* | bs2000-* \ + | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ + | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ @@ -351,27 +411,32 @@ case $basic_machine in - | mmix-* \ - | mt-* \ - | msp430-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ + | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ - | tron-* \ + | tron-* \ - | v850-* | v850e-* | vax-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ - | we32k-* \ + | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ - | z8k-*) + | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) @@ -393,7 +458,7 @@ case $basic_machine in - basic_machine=a29k-amd - os=-udi - ;; + basic_machine=a29k-amd + os=-udi + ;; - abacus) + abacus) - basic_machine=abacus-unknown - ;; - adobe68k) + basic_machine=abacus-unknown + ;; + adobe68k) @@ -439,6 +504,10 @@ case $basic_machine in - basic_machine=m68k-apollo - os=-bsd - ;; + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; - aux) - basic_machine=m68k-apple - os=-aux + aux) + basic_machine=m68k-apple + os=-aux @@ -455,10 +524,27 @@ case $basic_machine in - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk @@ -1225,114 +1225,114 @@ + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; - convex-c1) - basic_machine=c1-convex - os=-bsd + convex-c1) + basic_machine=c1-convex + os=-bsd @@ -487,7 +573,7 @@ case $basic_machine in - basic_machine=craynv-cray - os=-unicosmp - ;; + basic_machine=craynv-cray + os=-unicosmp + ;; - cr16) + cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; + basic_machine=cr16-unknown + os=-elf + ;; @@ -526,6 +612,10 @@ case $basic_machine in - basic_machine=m88k-motorola - os=-sysv3 - ;; + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp @@ -641,7 +731,6 @@ case $basic_machine in - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 @@ -699,6 +788,9 @@ case $basic_machine in - basic_machine=ns32k-utek - os=-sysv - ;; + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 + mingw32) + basic_machine=i386-pc + os=-mingw32 @@ -735,10 +827,18 @@ case $basic_machine in - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 + ncr3000) + basic_machine=i486-ncr + os=-sysv4 @@ -803,6 +903,12 @@ case $basic_machine in - np1) - basic_machine=np1-gould - ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; @@ -885,9 +991,10 @@ case $basic_machine in - ;; - power) basic_machine=power-ibm - ;; + ;; + power) basic_machine=power-ibm + ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown - ;; + ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown @@ -981,6 +1088,9 @@ case $basic_machine in - basic_machine=i860-stratus - os=-sysv4 - ;; + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; - sun2) - basic_machine=m68000-sun - ;; + sun2) + basic_machine=m68000-sun + ;; @@ -1037,20 +1147,8 @@ case $basic_machine in - basic_machine=t90-cray - os=-unicos - ;; + basic_machine=t90-cray + os=-unicos + ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff @@ -1345,42 +1345,42 @@ - basic_machine=tic6x-unknown - os=-coff - ;; - tile*) + tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) + os=-linux-gnu + ;; + tx39) @@ -1120,6 +1218,9 @@ case $basic_machine in - xps | xps100) - basic_machine=xps100-honeywell - ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; - ymp) - basic_machine=ymp-cray - os=-unicos + ymp) + basic_machine=ymp-cray + os=-unicos @@ -1128,6 +1229,10 @@ case $basic_machine in - basic_machine=z8k-unknown - os=-sim - ;; + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; - none) - basic_machine=none-none - os=-none + none) + basic_machine=none-none + os=-none @@ -1166,7 +1271,7 @@ case $basic_machine in - we32k) - basic_machine=we32k-att - ;; + we32k) + basic_machine=we32k-att + ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1213,9 +1318,12 @@ esac if [ x"$os" != x"" ] then @@ -1389,32 +1389,32 @@ - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; @@ -1236,10 +1344,11 @@ case $os in - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1248,9 +1357,10 @@ case $os in - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ @@ -1422,65 +1422,65 @@ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1258,7 +1368,7 @@ case $os in - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) @@ -1297,7 +1407,7 @@ case $os in - -opened*) - os=-openedition - ;; + -opened*) + os=-openedition + ;; - -os400*) + -os400*) - os=-os400 - ;; - -wince*) + os=-os400 + ;; + -wince*) @@ -1346,7 +1456,7 @@ case $os in - -sinix*) - os=-sysv4 - ;; + -sinix*) + os=-sysv4 + ;; - -tpf*) + -tpf*) - os=-tpf - ;; - -triton*) + os=-tpf + ;; + -triton*) @@ -1388,6 +1498,11 @@ case $os in - -zvmoe) - os=-zvmoe - ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; - -none) - ;; - *) + -none) + ;; + *) @@ -1410,10 +1525,10 @@ else # system, and we'll never get to this point. - + case $basic_machine in - score-*) + score-*) - os=-elf - ;; + os=-elf + ;; - spu-*) + spu-*) - os=-elf - ;; - *-acorn) + os=-elf + ;; + *-acorn) @@ -1425,8 +1540,20 @@ case $basic_machine in - arm*-semi) - os=-aout - ;; + arm*-semi) + os=-aout + ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) @@ -1497,40 +1497,40 @@ + ;; + tic6x-*) + os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) + ;; + # This must come before the *-dec entry. + pdp10-*) @@ -1446,14 +1573,11 @@ case $basic_machine in - ;; - m68000-sun) - os=-sunos3 + ;; + m68000-sun) + os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; + ;; + m68*-cisco) + os=-aout + ;; - mep-*) + mep-*) - os=-elf - ;; - mips*-cisco) + os=-elf + ;; + mips*-cisco) @@ -1480,7 +1604,7 @@ case $basic_machine in - *-ibm) - os=-aix - ;; + *-ibm) + os=-aix + ;; - *-knuth) + *-knuth) - os=-mmixware - ;; - *-wec) + os=-mmixware + ;; + *-wec) @@ -1585,7 +1709,7 @@ case $basic_machine in - -sunos*) - vendor=sun - ;; + -sunos*) + vendor=sun + ;; - -aix*) + -cnk*|-aix*) - vendor=ibm - ;; - -beos*) + vendor=ibm + ;; + -beos*) diff --git a/SOURCES/fastjar-0.97-filename0.patch b/SOURCES/fastjar-0.97-filename0.patch index 66977f48..34a02a74 100644 --- a/SOURCES/fastjar-0.97-filename0.patch +++ b/SOURCES/fastjar-0.97-filename0.patch @@ -5,9 +5,9 @@ --- fastjar-0.97/jartool.c 6 Sep 2009 22:16:00 -0000 1.59 +++ fastjar-0.97/jartool.c 1 Mar 2010 15:38:43 -0000 1.60 @@ -790,6 +790,7 @@ int read_entries (int fd) - progname, jarfile); - return 1; - } + progname, jarfile); + return 1; + } + ze->filename[len] = '\0'; len = UNPACK_UB4(header, CEN_EFLEN); len += UNPACK_UB4(header, CEN_COMLEN); diff --git a/SOURCES/fastjar-0.97-len1.patch b/SOURCES/fastjar-0.97-len1.patch index 36700b56..722351d3 100644 --- a/SOURCES/fastjar-0.97-len1.patch +++ b/SOURCES/fastjar-0.97-len1.patch @@ -7,10 +7,10 @@ +++ fastjar-0.97/jartool.c 2009-12-22 06:48:09.309530000 -0500 @@ -1257,7 +1257,7 @@ int add_file_to_jar(int jfd, int ffd, co exit_on_error("write"); - + /* write the file name to the zip file */ - if (1 == write(jfd, fname, file_name_length)) + if (-1 == write(jfd, fname, file_name_length)) exit_on_error("write"); - + if(verbose){ diff --git a/SOURCES/fastjar-0.97-ppc64le-config.patch b/SOURCES/fastjar-0.97-ppc64le-config.patch index 8fe12987..5671561c 100644 --- a/SOURCES/fastjar-0.97-ppc64le-config.patch +++ b/SOURCES/fastjar-0.97-ppc64le-config.patch @@ -3,36 +3,36 @@ @@ -1263,7 +1263,7 @@ ia64-*-hpux*) rm -rf conftest* ;; - + -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -1277,7 +1277,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) @@ -1296,7 +1299,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) --- fastjar-0.97/config.sub.jj 2014-04-10 20:40:53.000000000 +0200 +++ fastjar-0.97/config.sub 2014-04-10 10:38:39.000000000 +0200 @@ -1,24 +1,18 @@ @@ -79,8 +79,8 @@ +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). - - + + -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. @@ -90,12 +90,12 @@ @@ -73,9 +68,7 @@ Report bugs and patches to /dev/null` | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. @@ -400,68 +400,68 @@ +esac + # Note: order is significant - the case branches are not exclusive. - + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -200,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -302,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + echo arm-unknown-riscos + exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -801,6 +820,9 @@ EOF i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; @@ -852,21 +874,21 @@ EOF - exit ;; + exit ;; *:GNU:*:*) - # the GNU system + # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + exit ;; *:GNU/*:*:*) - # other systems with GNU libc and userland + # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; + exit ;; i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + echo ${UNAME_MACHINE}-pc-minix + exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be + UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,59 +901,54 @@ EOF - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi @@ -469,46 +469,46 @@ + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else + else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; + fi + fi + exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build @@ -520,58 +520,58 @@ - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build + eval $set_cc_for_build @@ -950,54 +967,63 @@ EOF - #endif + #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; + ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} - exit ;; + exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} - exit ;; + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; + esac + exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} - exit ;; + exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} @@ -581,55 +581,55 @@ + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} - exit ;; + exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; + exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; + exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1201,6 +1227,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; @@ -1227,19 +1256,21 @@ EOF - exit ;; + exit ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build @@ -658,13 +658,13 @@ + esac + fi + fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1330,9 +1361,6 @@ EOF - exit ;; + exit ;; esac - + -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - @@ -676,33 +676,33 @@ @@ -6918,7 +6918,7 @@ ia64-*-hpux*) rm -rf conftest* ;; - + -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -6936,7 +6936,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) @@ -6955,7 +6958,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) diff --git a/SOURCES/fastjar-0.97-segfault.patch b/SOURCES/fastjar-0.97-segfault.patch index dd71d12e..ab626240 100644 --- a/SOURCES/fastjar-0.97-segfault.patch +++ b/SOURCES/fastjar-0.97-segfault.patch @@ -8,18 +8,18 @@ @@ -820,6 +820,10 @@ int make_manifest(int jfd, const char *m int mod_time; /* file modification time */ struct zipentry *ze; - + + current_time = time(NULL); + if(current_time == (time_t)-1) + exit_on_error("time"); + - mod_time = unix2dostime(¤t_time); - + mod_time = unix2dostime(¤t_time); + /* If we are creating a new manifest, create a META-INF directory entry */ @@ -828,10 +832,6 @@ int make_manifest(int jfd, const char *m - + memset((file_header + 12), '\0', 16); /*clear mod time, crc, size fields*/ - + - current_time = time(NULL); - if(current_time == (time_t)-1) - exit_on_error("time"); diff --git a/SOURCES/fastjar-CVE-2010-0831.patch b/SOURCES/fastjar-CVE-2010-0831.patch index 7fd15244..2c6e23c7 100644 --- a/SOURCES/fastjar-CVE-2010-0831.patch +++ b/SOURCES/fastjar-CVE-2010-0831.patch @@ -10,7 +10,7 @@ @@ -1730,7 +1730,17 @@ int extract_jar(int fd, const char **fil struct stat sbuf; int depth = 0; - + - tmp_buff = malloc(sizeof(char) * strlen((const char *)filename)); + if(*filename == '/'){ + fprintf(stderr, "Absolute path names are not allowed.\n"); @@ -23,7 +23,7 @@ + fprintf(stderr, "Out of memory.\n"); + exit(EXIT_FAILURE); + } - + for(;;){ const ub1 *idx = (const unsigned char *)strchr((const char *)start, '/'); @@ -1738,25 +1748,28 @@ int extract_jar(int fd, const char **fil @@ -35,25 +35,25 @@ continue; } - start = idx + 1; - + - strncpy(tmp_buff, (const char *)filename, (idx - filename)); - tmp_buff[(idx - filename)] = '\0'; + memcpy(tmp_buff + (start - filename), (const char *)start, (idx - start)); + tmp_buff[idx - filename] = '\0'; - - #ifdef DEBUG + + #ifdef DEBUG printf("checking the existance of %s\n", tmp_buff); #endif - if(strcmp(tmp_buff, "..") == 0){ + if(idx - start == 2 && memcmp(start, "..", 2) == 0){ - --depth; - if (depth < 0){ - fprintf(stderr, "Traversal to parent directories during unpacking!\n"); - exit(EXIT_FAILURE); - } + --depth; + if (depth < 0){ + fprintf(stderr, "Traversal to parent directories during unpacking!\n"); + exit(EXIT_FAILURE); + } - } else if (strcmp(tmp_buff, ".") != 0) + } else if (idx - start != 1 || *start != '.') - ++depth; + ++depth; + + start = idx + 1; + @@ -61,7 +61,7 @@ if(errno != ENOENT) exit_on_error("stat"); @@ -1765,6 +1778,7 @@ int extract_jar(int fd, const char **fil - #ifdef DEBUG + #ifdef DEBUG printf("Directory exists\n"); #endif + tmp_buff[idx - filename] = '/'; @@ -71,32 +71,32 @@ @@ -1781,10 +1795,11 @@ int extract_jar(int fd, const char **fil if(verbose && handle) printf("%10s: %s/\n", "created", tmp_buff); - + + tmp_buff[idx - filename] = '/'; } - + /* only a directory */ - if(strlen((const char *)start) == 0) + if(*start == '\0') dir = TRUE; - - #ifdef DEBUG + + #ifdef DEBUG @@ -1792,7 +1807,7 @@ int extract_jar(int fd, const char **fil #endif - + /* If the entry was just a directory, don't write to file, etc */ - if(strlen((const char *)start) == 0) + if(*start == '\0') f_fd = -1; - + free(tmp_buff); @@ -1876,7 +1891,8 @@ int extract_jar(int fd, const char **fil exit(EXIT_FAILURE); } - + - close(f_fd); + if (f_fd != -1) + close(f_fd); - + if(verbose && dir == FALSE && handle) printf("%10s: %s\n", diff --git a/SOURCES/fastjar-man.patch b/SOURCES/fastjar-man.patch index 08795368..34bf704d 100644 --- a/SOURCES/fastjar-man.patch +++ b/SOURCES/fastjar-man.patch @@ -6,22 +6,22 @@ --- fastjar-0.97/Makefile.am.jj 2008-10-16 04:24:55.000000000 -0400 +++ fastjar-0.97/Makefile.am 2010-06-21 09:29:41.021398000 -0400 @@ -39,7 +39,7 @@ EXTRA_DIST = \ - texi2pod.pl - + texi2pod.pl + TEXI2POD = perl $(srcdir)/texi2pod.pl -POD2MAN = pod2man --center="GNU" --release=@VERSION@ +POD2MAN = pod2man --center="GNU" --release=@VERSION@ --date=$(shell sed -n '1s/ .*//p' <$(srcdir)/ChangeLog) - + .pod.1: - -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \ + -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \ --- fastjar-0.97/Makefile.in.jj 2008-10-16 04:15:16.000000000 -0400 +++ fastjar-0.97/Makefile.in 2010-06-21 09:30:15.882810000 -0400 @@ -515,7 +515,7 @@ EXTRA_DIST = \ - texi2pod.pl - + texi2pod.pl + TEXI2POD = perl $(srcdir)/texi2pod.pl -POD2MAN = pod2man --center="GNU" --release=@VERSION@ +POD2MAN = pod2man --center="GNU" --release=@VERSION@ --date=$(shell sed -n '1s/ .*//p' <$(srcdir)/ChangeLog) - + #SPLINT_FLAGS=-I . -I $(srcdir)/lib -I $(srcdir) -DHAVE_CONFIG_H +posixlib +weak SPLINT_FLAGS = -I . -I $(srcdir)/lib -I $(srcdir) -DHAVE_CONFIG_H -DPRIx32= -warnposix +weak diff --git a/SOURCES/gcc48-aarch64-ada.patch b/SOURCES/gcc48-aarch64-ada.patch index 1023fc5b..4d2fb7db 100644 --- a/SOURCES/gcc48-aarch64-ada.patch +++ b/SOURCES/gcc48-aarch64-ada.patch @@ -9,7 +9,7 @@ @@ -2123,6 +2123,44 @@ ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),) LIBRARY_VERSION := $(LIB_VERSION) endif - + +# AArch64 Linux +ifeq ($(strip $(filter-out aarch64% linux%,$(arch) $(osys))),) + LIBGNAT_TARGET_PAIRS = \ @@ -56,7 +56,7 @@ @@ -562,7 +562,9 @@ __gnat_error_handler (int sig, siginfo_t *si ATTRIBUTE_UNUSED, void *ucontext) Raise_From_Signal_Handler (exception, msg); } - + -#if defined (i386) || defined (__x86_64__) || defined (__powerpc__) +#if defined (i386) || defined (__x86_64__) || defined (__powerpc__) \ + || defined (__aarch64__) @@ -67,7 +67,7 @@ @@ -603,7 +605,7 @@ __gnat_install_handler (void) handled properly, avoiding a SEGV generation from stack usage by the handler itself. */ - + -#if defined (i386) || defined (__x86_64__) || defined (__powerpc__) +#ifdef HAVE_GNAT_ALTERNATE_STACK stack_t stack; @@ -91,5 +91,6 @@ -typedef struct {const char *Array; String_Template *Bounds; } - __attribute ((aligned (sizeof (char *) * 2))) Fat_Pointer; +typedef struct {const char *Array; String_Template *Bounds; } Fat_Pointer; - + /* Types for Node/Entity Kinds: */ + diff --git a/SOURCES/gcc48-aarch64-async-unw-tables.patch b/SOURCES/gcc48-aarch64-async-unw-tables.patch index 0de27120..feec149f 100644 --- a/SOURCES/gcc48-aarch64-async-unw-tables.patch +++ b/SOURCES/gcc48-aarch64-async-unw-tables.patch @@ -9,7 +9,7 @@ @@ -39,6 +39,9 @@ #undef TARGET_OPTION_OPTIMIZATION_TABLE #define TARGET_OPTION_OPTIMIZATION_TABLE aarch_option_optimization_table - + +#undef TARGET_OPTION_INIT_STRUCT +#define TARGET_OPTION_INIT_STRUCT aarch64_option_init_struct + @@ -19,7 +19,7 @@ @@ -47,6 +50,16 @@ static const struct default_options aarch_option_optimization_table[] = { OPT_LEVELS_NONE, 0, NULL, 0 } }; - + +/* Implement TARGET_OPTION_INIT_STRUCT. */ + +static void @@ -32,3 +32,4 @@ + /* Implement TARGET_HANDLE_OPTION. This function handles the target specific options for CPU/target selection. + diff --git a/SOURCES/gcc48-aarch64-unwind-opt.patch b/SOURCES/gcc48-aarch64-unwind-opt.patch index 16fe95b3..074cd7e0 100644 --- a/SOURCES/gcc48-aarch64-unwind-opt.patch +++ b/SOURCES/gcc48-aarch64-unwind-opt.patch @@ -11,7 +11,7 @@ --- gcc/config/aarch64/aarch64.c 2014-07-15 02:27:16.000000000 -0700 +++ gcc/config/aarch64/aarch64.c 2014-08-21 12:52:44.190455860 -0700 @@ -1603,24 +1603,23 @@ aarch64_register_saved_on_entry (int reg - + static void aarch64_save_or_restore_fprs (int start_offset, int increment, - bool restore, rtx base_rtx) @@ -22,38 +22,38 @@ unsigned regno2; rtx insn; rtx (*gen_mem_ref)(enum machine_mode, rtx) = (frame_pointer_needed)? gen_frame_mem : gen_rtx_MEM; - + - for (regno = V0_REGNUM; regno <= V31_REGNUM; regno++) { if (aarch64_register_saved_on_entry (regno)) - { + { - rtx mem; + rtx mem, reg1; - mem = gen_mem_ref (DFmode, - plus_constant (Pmode, - base_rtx, - start_offset)); + mem = gen_mem_ref (DFmode, + plus_constant (Pmode, + base_rtx, + start_offset)); + reg1 = gen_rtx_REG (DFmode, regno); - - for (regno2 = regno + 1; - regno2 <= V31_REGNUM + + for (regno2 = regno + 1; + regno2 <= V31_REGNUM @@ -1632,54 +1631,51 @@ aarch64_save_or_restore_fprs (int start_ - if (regno2 <= V31_REGNUM && - aarch64_register_saved_on_entry (regno2)) - { + if (regno2 <= V31_REGNUM && + aarch64_register_saved_on_entry (regno2)) + { - rtx mem2; + rtx mem2, reg2; - /* Next highest register to be saved. */ - mem2 = gen_mem_ref (DFmode, - plus_constant - (Pmode, - base_rtx, - start_offset + increment)); + /* Next highest register to be saved. */ + mem2 = gen_mem_ref (DFmode, + plus_constant + (Pmode, + base_rtx, + start_offset + increment)); + reg2 = gen_rtx_REG (DFmode, regno2); + - if (restore == false) - { + if (restore == false) + { - insn = emit_insn - ( gen_store_pairdf (mem, gen_rtx_REG (DFmode, regno), - mem2, gen_rtx_REG (DFmode, regno2))); @@ -65,9 +65,9 @@ + frame-related if explicitly marked. */ + RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, 1)) = 1; + RTX_FRAME_RELATED_P (insn) = 1; - } - else - { + } + else + { - insn = emit_insn - ( gen_load_pairdf (gen_rtx_REG (DFmode, regno), mem, - gen_rtx_REG (DFmode, regno2), mem2)); @@ -77,41 +77,41 @@ + emit_insn (gen_load_pairdf (reg1, mem, reg2, mem2)); + *cfi_ops = alloc_reg_note (REG_CFA_RESTORE, reg1, *cfi_ops); + *cfi_ops = alloc_reg_note (REG_CFA_RESTORE, reg2, *cfi_ops); - } - + } + - /* The first part of a frame-related parallel insn - is always assumed to be relevant to the frame - calculations; subsequent parts, are only - frame-related if explicitly marked. */ - RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, - 1)) = 1; - regno = regno2; - start_offset += increment * 2; - } - else - { - if (restore == false) + regno = regno2; + start_offset += increment * 2; + } + else + { + if (restore == false) - insn = emit_move_insn (mem, gen_rtx_REG (DFmode, regno)); + { + insn = emit_move_insn (mem, reg1); + RTX_FRAME_RELATED_P (insn) = 1; + } - else - { + else + { - insn = emit_move_insn (gen_rtx_REG (DFmode, regno), mem); - add_reg_note (insn, REG_CFA_RESTORE, gen_rtx_REG (DImode, regno)); + emit_move_insn (reg1, mem); + *cfi_ops = alloc_reg_note (REG_CFA_RESTORE, reg1, *cfi_ops); - } - start_offset += increment; - } + } + start_offset += increment; + } - RTX_FRAME_RELATED_P (insn) = 1; - } + } } - } - - + + @@ -1687,13 +1683,14 @@ aarch64_save_or_restore_fprs (int start_ restore's have to happen. */ static void @@ -132,34 +132,34 @@ @@ -1702,11 +1699,13 @@ aarch64_save_or_restore_callee_save_regi { if (aarch64_register_saved_on_entry (regno)) - { + { - rtx mem; + rtx mem, reg1; + - mem = gen_mem_ref (Pmode, - plus_constant (Pmode, - base_rtx, - start_offset)); + mem = gen_mem_ref (Pmode, + plus_constant (Pmode, + base_rtx, + start_offset)); + reg1 = gen_rtx_REG (DImode, regno); - - for (regno2 = regno + 1; - regno2 <= limit + + for (regno2 = regno + 1; + regno2 <= limit @@ -1718,56 +1717,54 @@ aarch64_save_or_restore_callee_save_regi - if (regno2 <= limit && - aarch64_register_saved_on_entry (regno2)) - { + if (regno2 <= limit && + aarch64_register_saved_on_entry (regno2)) + { - rtx mem2; + rtx mem2, reg2; - /* Next highest register to be saved. */ - mem2 = gen_mem_ref (Pmode, - plus_constant - (Pmode, - base_rtx, - start_offset + increment)); + /* Next highest register to be saved. */ + mem2 = gen_mem_ref (Pmode, + plus_constant + (Pmode, + base_rtx, + start_offset + increment)); + reg2 = gen_rtx_REG (DImode, regno2); + - if (restore == false) - { + if (restore == false) + { - insn = emit_insn - ( gen_store_pairdi (mem, gen_rtx_REG (DImode, regno), - mem2, gen_rtx_REG (DImode, regno2))); @@ -171,9 +171,9 @@ + frame-related if explicitly marked. */ + RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, 1)) = 1; + RTX_FRAME_RELATED_P (insn) = 1; - } - else - { + } + else + { - insn = emit_insn - ( gen_load_pairdi (gen_rtx_REG (DImode, regno), mem, - gen_rtx_REG (DImode, regno2), mem2)); @@ -183,66 +183,66 @@ + emit_insn (gen_load_pairdi (reg1, mem, reg2, mem2)); + *cfi_ops = alloc_reg_note (REG_CFA_RESTORE, reg1, *cfi_ops); + *cfi_ops = alloc_reg_note (REG_CFA_RESTORE, reg2, *cfi_ops); - } - + } + - /* The first part of a frame-related parallel insn - is always assumed to be relevant to the frame - calculations; subsequent parts, are only - frame-related if explicitly marked. */ - RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, - 1)) = 1; - regno = regno2; - start_offset += increment * 2; - } - else - { - if (restore == false) + regno = regno2; + start_offset += increment * 2; + } + else + { + if (restore == false) - insn = emit_move_insn (mem, gen_rtx_REG (DImode, regno)); + { + insn = emit_move_insn (mem, reg1); + RTX_FRAME_RELATED_P (insn) = 1; + } - else - { + else + { - insn = emit_move_insn (gen_rtx_REG (DImode, regno), mem); - add_reg_note (insn, REG_CFA_RESTORE, gen_rtx_REG (DImode, regno)); + emit_move_insn (reg1, mem); + *cfi_ops = alloc_reg_note (REG_CFA_RESTORE, reg1, *cfi_ops); - } - start_offset += increment; - } + } + start_offset += increment; + } - RTX_FRAME_RELATED_P (insn) = 1; - } + } } - + - aarch64_save_or_restore_fprs (start_offset, increment, restore, base_rtx); - + aarch64_save_or_restore_fprs (start_offset, increment, restore, + base_rtx, cfi_ops); } - + /* AArch64 stack frames generated by this compiler look like: @@ -1966,7 +1963,7 @@ aarch64_expand_prologue (void) - } - + } + aarch64_save_or_restore_callee_save_registers - (fp_offset + cfun->machine->frame.hardfp_offset, 0); + (fp_offset + cfun->machine->frame.hardfp_offset, 0, NULL); } - + /* when offset >= 512, @@ -1991,6 +1988,7 @@ aarch64_expand_epilogue (bool for_sibcal HOST_WIDE_INT fp_offset; rtx insn; rtx cfa_reg; + rtx cfi_ops = NULL; - + aarch64_layout_frame (); original_frame_size = get_frame_size () + cfun->machine->saved_varargs_size; @@ -2035,15 +2033,17 @@ aarch64_expand_epilogue (bool for_sibcal insn = emit_insn (gen_add3_insn (stack_pointer_rtx, - hard_frame_pointer_rtx, - GEN_INT (- fp_offset))); + hard_frame_pointer_rtx, + GEN_INT (- fp_offset))); + /* CFA should be calculated from the value of SP from now on. */ + add_reg_note (insn, REG_CFA_ADJUST_CFA, + gen_rtx_SET (VOIDmode, stack_pointer_rtx, @@ -254,26 +254,26 @@ - from the value of SP from now on. */ cfa_reg = stack_pointer_rtx; } - + aarch64_save_or_restore_callee_save_registers - (fp_offset + cfun->machine->frame.hardfp_offset, 1); + (fp_offset + cfun->machine->frame.hardfp_offset, 1, &cfi_ops); - + /* Restore the frame pointer and lr if the frame pointer is needed. */ if (offset > 0) @@ -2051,6 +2051,8 @@ aarch64_expand_epilogue (bool for_sibcal if (frame_pointer_needed) - { - rtx mem_fp, mem_lr; + { + rtx mem_fp, mem_lr; + rtx reg_fp = hard_frame_pointer_rtx; + rtx reg_lr = gen_rtx_REG (DImode, LR_REGNUM); - - if (fp_offset) - { + + if (fp_offset) + { @@ -2063,52 +2065,36 @@ aarch64_expand_epilogue (bool for_sibcal - stack_pointer_rtx, - fp_offset - + UNITS_PER_WORD)); + stack_pointer_rtx, + fp_offset + + UNITS_PER_WORD)); - insn = emit_insn (gen_load_pairdi (hard_frame_pointer_rtx, - mem_fp, - gen_rtx_REG (DImode, @@ -283,10 +283,10 @@ + + insn = emit_insn (gen_add2_insn (stack_pointer_rtx, + GEN_INT (offset))); - } - else - { - insn = emit_insn (gen_loadwb_pairdi_di + } + else + { + insn = emit_insn (gen_loadwb_pairdi_di - (stack_pointer_rtx, - stack_pointer_rtx, - hard_frame_pointer_rtx, @@ -294,7 +294,7 @@ - GEN_INT (offset), + (stack_pointer_rtx, stack_pointer_rtx, + reg_fp, reg_lr, GEN_INT (offset), - GEN_INT (GET_MODE_SIZE (DImode) + offset))); + GEN_INT (GET_MODE_SIZE (DImode) + offset))); - RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, 2)) = 1; - add_reg_note (insn, REG_CFA_ADJUST_CFA, - (gen_rtx_SET (Pmode, stack_pointer_rtx, @@ -317,16 +317,16 @@ - insn = emit_insn (gen_add2_insn (stack_pointer_rtx, - GEN_INT (offset))); - RTX_FRAME_RELATED_P (insn) = 1; - } + } + cfi_ops = alloc_reg_note (REG_CFA_RESTORE, reg_fp, cfi_ops); + cfi_ops = alloc_reg_note (REG_CFA_RESTORE, reg_lr, cfi_ops); - } + } else - { - insn = emit_insn (gen_add2_insn (stack_pointer_rtx, - GEN_INT (offset))); + { + insn = emit_insn (gen_add2_insn (stack_pointer_rtx, + GEN_INT (offset))); - RTX_FRAME_RELATED_P (insn) = 1; - } + } + cfi_ops = alloc_reg_note (REG_CFA_ADJUST_CFA, + gen_rtx_SET (VOIDmode, stack_pointer_rtx, + plus_constant (Pmode, cfa_reg, @@ -337,6 +337,6 @@ } + else + gcc_assert (cfi_ops == NULL); - + /* Stack adjustment for exception handler. */ if (crtl->calls_eh_return) diff --git a/SOURCES/gcc48-cloog-dl.patch b/SOURCES/gcc48-cloog-dl.patch index 87ff403b..52b5c510 100644 --- a/SOURCES/gcc48-cloog-dl.patch +++ b/SOURCES/gcc48-cloog-dl.patch @@ -3,16 +3,16 @@ @@ -1022,7 +1022,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY) # and the system's installed libraries. LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \ - $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS) + $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS) -BACKENDLIBS = $(CLOOGLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ +BACKENDLIBS = $(if $(CLOOGLIBS),-ldl) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ - $(ZLIB) + $(ZLIB) # Any system libraries needed just for GNAT. SYSLIBS = @GNAT_LIBEXC@ @@ -3442,6 +3442,15 @@ $(common_out_object_file): $(common_out_ $(DIAGNOSTIC_CORE_H) $(FLAGS_H) $(OPTS_H) $(TM_H) $(TM_P_H) $(MACHMODE_H) - $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \ - $< $(OUTPUT_OPTION) + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \ + $< $(OUTPUT_OPTION) + +graphite%.o : \ + ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS)) @@ -30,7 +30,7 @@ @@ -22,6 +22,369 @@ along with GCC; see the file COPYING3. #ifndef GCC_GRAPHITE_POLY_H #define GCC_GRAPHITE_POLY_H - + +#include +#include +#include @@ -395,14 +395,14 @@ +#define stmt_user (*cloog_pointers__.p_stmt_user) + typedef struct poly_dr *poly_dr_p; - + typedef struct poly_bb *poly_bb_p; --- gcc/graphite.c.jj 2012-12-13 11:31:00.000000000 +0100 +++ gcc/graphite.c 2012-12-14 13:40:44.155136961 +0100 @@ -66,6 +66,34 @@ along with GCC; see the file COPYING3. - + CloogState *cloog_state; - + +__typeof (cloog_pointers__) cloog_pointers__; + +static bool @@ -432,12 +432,12 @@ +} + /* Print global statistics to FILE. */ - + static void @@ -264,6 +292,15 @@ graphite_transform_loops (void) if (parallelized_function_p (cfun->decl)) return; - + + if (number_of_loops () <= 1) + return; + @@ -454,7 +454,7 @@ +++ gcc/graphite-clast-to-gimple.c 2012-12-14 13:27:47.196519858 +0100 @@ -910,7 +910,7 @@ compute_bounds_for_loop (struct clast_fo from STMT_FOR. */ - + static tree -type_for_clast_for (struct clast_for *stmt_for, ivs_params_p ip) +type_for_clast_for (struct clast_for *stmt_fora, ivs_params_p ip) @@ -464,11 +464,11 @@ @@ -918,8 +918,8 @@ type_for_clast_for (struct clast_for *st mpz_init (bound_one); mpz_init (bound_two); - + - lb_type = type_for_clast_expr (stmt_for->LB, ip, bound_one, bound_two); - ub_type = type_for_clast_expr (stmt_for->UB, ip, bound_one, bound_two); + lb_type = type_for_clast_expr (stmt_fora->LB, ip, bound_one, bound_two); + ub_type = type_for_clast_expr (stmt_fora->UB, ip, bound_one, bound_two); - + mpz_clear (bound_one); mpz_clear (bound_two); diff --git a/SOURCES/gcc48-cloog-dl2.patch b/SOURCES/gcc48-cloog-dl2.patch index 21db8888..2f647a30 100644 --- a/SOURCES/gcc48-cloog-dl2.patch +++ b/SOURCES/gcc48-cloog-dl2.patch @@ -10,21 +10,21 @@ @@ -107,6 +107,8 @@ static bool no_backend; /* Length of line when printing switch values. */ #define MAX_LINE 75 - + +const char **toplev_main_argv; + /* Decoded options, and number of such options. */ struct cl_decoded_option *save_decoded_options; unsigned int save_decoded_options_count; @@ -1909,6 +1911,8 @@ toplev_main (int argc, char **argv) - + expandargv (&argc, &argv); - + + toplev_main_argv = CONST_CAST2 (const char **, char **, argv); + /* Initialization of GCC's environment, and diagnostics. */ general_init (argv[0]); - + --- gcc/graphite.c.jj 2010-12-01 10:24:32.000000000 -0500 +++ gcc/graphite.c 2010-12-01 11:46:07.832118193 -0500 @@ -72,11 +72,39 @@ __typeof (cloog_pointers__) cloog_pointe diff --git a/SOURCES/gcc48-color-auto.patch b/SOURCES/gcc48-color-auto.patch index 262ac9a5..a8cf938b 100644 --- a/SOURCES/gcc48-color-auto.patch +++ b/SOURCES/gcc48-color-auto.patch @@ -10,19 +10,19 @@ +++ gcc/common.opt 2013-09-20 10:00:00.935823900 +0200 @@ -1037,7 +1037,7 @@ Common Alias(fdiagnostics-color=,always, ; - + fdiagnostics-color= -Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagnostic_color_rule) Init(DIAGNOSTICS_COLOR_NO) +Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagnostic_color_rule) Init(DIAGNOSTICS_COLOR_AUTO) -fdiagnostics-color=[never|always|auto] Colorize diagnostics - + ; Required for these enum values. --- gcc/toplev.c.jj 2013-09-09 11:32:39.000000000 +0200 +++ gcc/toplev.c 2013-09-20 10:10:08.198721005 +0200 @@ -1229,10 +1229,8 @@ process_options (void) - + maximum_field_alignment = initial_max_fld_align * BITS_PER_UNIT; - + - /* Default to -fdiagnostics-color=auto if GCC_COLORS is in the environment, - otherwise default to -fdiagnostics-color=never. */ - if (!global_options_set.x_flag_diagnostics_show_color @@ -31,7 +31,7 @@ + if (!global_options_set.x_flag_diagnostics_show_color) pp_show_color (global_dc->printer) = colorize_init (DIAGNOSTICS_COLOR_AUTO); - + --- gcc/doc/invoke.texi.jj 2013-09-18 12:06:50.000000000 +0200 +++ gcc/doc/invoke.texi 2013-09-20 10:09:29.079904455 +0200 @@ -3046,8 +3046,7 @@ a message which is too long to fit on a diff --git a/SOURCES/gcc48-hack.patch b/SOURCES/gcc48-hack.patch index 6c1b5ddd..1903e951 100644 --- a/SOURCES/gcc48-hack.patch +++ b/SOURCES/gcc48-hack.patch @@ -3,7 +3,7 @@ @@ -66,18 +66,40 @@ libsubdir := $(libdir)/gcc/$(target_nonc ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR)) ADA_RTS_SUBDIR=./rts$(subst /,_,$(MULTISUBDIR)) - + +DEFAULTMULTIFLAGS := +ifeq ($(MULTISUBDIR),) +targ:=$(subst -, ,$(target)) @@ -47,11 +47,11 @@ "TRACE=$(TRACE)" \ @@ -88,7 +110,7 @@ LIBADA_FLAGS_TO_PASS = \ "exeext=.exeext.should.not.be.used " \ - 'CC=the.host.compiler.should.not.be.needed' \ - "GCC_FOR_TARGET=$(CC)" \ + 'CC=the.host.compiler.should.not.be.needed' \ + "GCC_FOR_TARGET=$(CC)" \ - "CFLAGS=$(CFLAGS)" + "CFLAGS=$(CFLAGS) $(DEFAULTMULTIFLAGS)" - + # Rules to build gnatlib. .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared osconstool --- gcc/ada/sem_util.adb (revision 161677) @@ -63,35 +63,35 @@ - Comp_Type : Entity_Id; + Comp_Type : Entity_Id := Empty; Is_Array_Aggr : Boolean; - + begin --- config-ml.in.jj 2010-06-30 09:50:44.000000000 +0200 +++ config-ml.in 2010-07-02 21:24:17.994211151 +0200 @@ -516,6 +516,8 @@ multi-do: - ADAFLAGS="$(ADAFLAGS) $${flags}" \ - prefix="$(prefix)" \ - exec_prefix="$(exec_prefix)" \ + ADAFLAGS="$(ADAFLAGS) $${flags}" \ + prefix="$(prefix)" \ + exec_prefix="$(exec_prefix)" \ + mandir="$(mandir)" \ + infodir="$(infodir)" \ - GCJFLAGS="$(GCJFLAGS) $${flags}" \ - GOCFLAGS="$(GOCFLAGS) $${flags}" \ - CXXFLAGS="$(CXXFLAGS) $${flags}" \ + GCJFLAGS="$(GCJFLAGS) $${flags}" \ + GOCFLAGS="$(GOCFLAGS) $${flags}" \ + CXXFLAGS="$(CXXFLAGS) $${flags}" \ --- libjava/Makefile.am.jj 2010-07-09 11:17:33.729604090 +0200 +++ libjava/Makefile.am 2010-07-09 13:16:41.894375641 +0200 @@ -710,7 +710,8 @@ if USE_LIBGCJ_BC ## later. - @echo Installing dummy lib libgcj_bc.so.1.0.0; \ - rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ + @echo Installing dummy lib libgcj_bc.so.1.0.0; \ + rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ - mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ + $(INSTALL) $(INSTALL_STRIP_FLAG) $(here)/.libs/libgcj_bc.so $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ + rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0; \ - $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \ - -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \ - rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \ + $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \ + -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \ + rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \ --- libjava/Makefile.in.jj 2010-07-09 11:17:34.000000000 +0200 +++ libjava/Makefile.in 2010-07-09 13:18:07.542572270 +0200 @@ -12665,7 +12665,8 @@ install-exec-hook: install-binPROGRAMS i - install-libexecsubPROGRAMS + install-libexecsubPROGRAMS @USE_LIBGCJ_BC_TRUE@ @echo Installing dummy lib libgcj_bc.so.1.0.0; \ @USE_LIBGCJ_BC_TRUE@ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ -@USE_LIBGCJ_BC_TRUE@ mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ diff --git a/SOURCES/gcc48-i386-libgomp.patch b/SOURCES/gcc48-i386-libgomp.patch index e01fa8c2..520561e5 100644 --- a/SOURCES/gcc48-i386-libgomp.patch +++ b/SOURCES/gcc48-i386-libgomp.patch @@ -1,11 +1,11 @@ --- libgomp/configure.tgt.jj 2008-01-10 20:53:48.000000000 +0100 +++ libgomp/configure.tgt 2008-03-27 12:44:51.000000000 +0100 @@ -67,7 +67,7 @@ if test $enable_linux_futex = yes; then - ;; - *) - if test -z "$with_arch"; then + ;; + *) + if test -z "$with_arch"; then - XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" + XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" - fi - esac - ;; + fi + esac + ;; diff --git a/SOURCES/gcc48-java-nomulti.patch b/SOURCES/gcc48-java-nomulti.patch index a1f289c2..17334aac 100644 --- a/SOURCES/gcc48-java-nomulti.patch +++ b/SOURCES/gcc48-java-nomulti.patch @@ -1,9 +1,9 @@ --- libjava/configure.ac.jj 2007-12-07 17:55:50.000000000 +0100 +++ libjava/configure.ac 2007-12-07 18:36:56.000000000 +0100 @@ -82,6 +82,13 @@ AC_ARG_ENABLE(java-maintainer-mode, - [allow rebuilding of .class and .h files])) + [allow rebuilding of .class and .h files])) AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes) - + +AC_ARG_ENABLE(libjava-multilib, + AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib])) +if test "$enable_libjava_multilib" = no; then @@ -13,7 +13,7 @@ + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. GCC_NO_EXECUTABLES - + --- libjava/configure.jj 2007-12-07 17:55:50.000000000 +0100 +++ libjava/configure 2007-12-07 18:39:58.000000000 +0100 @@ -1021,6 +1021,8 @@ Optional Features: @@ -27,8 +27,8 @@ --enable-maintainer-mode enable make rules and dependencies not useful @@ -1973,6 +1975,16 @@ else fi - - + + +# Check whether --enable-libjava-multilib was given. +if test "${enable_libjava_multilib+set}" = set; then + enableval=$enable_libjava_multilib; @@ -40,3 +40,5 @@ +fi + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. + + diff --git a/SOURCES/gcc48-libgo-p224.patch b/SOURCES/gcc48-libgo-p224.patch index 49639504..50461bcb 100644 --- a/SOURCES/gcc48-libgo-p224.patch +++ b/SOURCES/gcc48-libgo-p224.patch @@ -2,49 +2,49 @@ +++ libgo/Makefile.am 2014-02-18 17:31:54.798484657 +0100 @@ -1109,8 +1109,7 @@ go_crypto_dsa_files = \ go_crypto_ecdsa_files = \ - go/crypto/ecdsa/ecdsa.go + go/crypto/ecdsa/ecdsa.go go_crypto_elliptic_files = \ - go/crypto/elliptic/elliptic.go \ - go/crypto/elliptic/p224.go + go/crypto/elliptic/elliptic.go go_crypto_hmac_files = \ - go/crypto/hmac/hmac.go + go/crypto/hmac/hmac.go go_crypto_md5_files = \ --- libgo/Makefile.in.jj 2013-12-12 19:01:49.000000000 +0100 +++ libgo/Makefile.in 2014-02-18 17:32:11.350389191 +0100 @@ -1274,8 +1274,7 @@ go_crypto_ecdsa_files = \ - go/crypto/ecdsa/ecdsa.go - + go/crypto/ecdsa/ecdsa.go + go_crypto_elliptic_files = \ - go/crypto/elliptic/elliptic.go \ - go/crypto/elliptic/p224.go + go/crypto/elliptic/elliptic.go - + go_crypto_hmac_files = \ - go/crypto/hmac/hmac.go + go/crypto/hmac/hmac.go --- libgo/go/crypto/elliptic/elliptic.go.jj 2012-12-13 11:32:02.640039537 +0100 +++ libgo/go/crypto/elliptic/elliptic.go 2014-02-18 17:28:22.909692022 +0100 @@ -327,7 +327,6 @@ var p384 *CurveParams var p521 *CurveParams - + func initAll() { - initP224() - initP256() - initP384() - initP521() + initP256() + initP384() + initP521() --- libgo/go/crypto/elliptic/elliptic_test.go.jj 2012-12-13 11:32:02.640039537 +0100 +++ libgo/go/crypto/elliptic/elliptic_test.go 2014-02-18 17:31:04.052774265 +0100 @@ -5,329 +5,14 @@ package elliptic - + import ( - "crypto/rand" - "encoding/hex" - "fmt" - "math/big" - "testing" + "testing" ) - + -func TestOnCurve(t *testing.T) { - p224 := P224() - if !p224.IsOnCurve(p224.Params().Gx, p224.Params().Gy) { @@ -356,17 +356,17 @@ -} - func TestInfinity(t *testing.T) { - tests := []struct { - name string - curve Curve - }{ + tests := []struct { + name string + curve Curve + }{ - {"p224", P224()}, - {"p256", P256()}, - } - + {"p256", P256()}, + } + @@ -359,43 +44,3 @@ func TestInfinity(t *testing.T) { - } - } + } + } } - -func BenchmarkBaseMult(b *testing.B) { @@ -412,33 +412,33 @@ +++ libgo/go/crypto/ecdsa/ecdsa_test.go 2014-02-18 17:28:22.909692022 +0100 @@ -33,7 +33,6 @@ func testKeyGeneration(t *testing.T, c e } - + func TestKeyGeneration(t *testing.T) { - testKeyGeneration(t, elliptic.P224(), "p224") - if testing.Short() { - return - } + if testing.Short() { + return + } @@ -63,7 +62,6 @@ func testSignAndVerify(t *testing.T, c e } - + func TestSignAndVerify(t *testing.T) { - testSignAndVerify(t, elliptic.P224(), "p224") - if testing.Short() { - return - } + if testing.Short() { + return + } @@ -129,8 +127,6 @@ func TestVectors(t *testing.T) { - parts := strings.SplitN(line, ",", 2) - - switch parts[0] { + parts := strings.SplitN(line, ",", 2) + + switch parts[0] { - case "P-224": - pub.Curve = elliptic.P224() - case "P-256": - pub.Curve = elliptic.P256() - case "P-384": + case "P-256": + pub.Curve = elliptic.P256() + case "P-384": --- libgo/go/crypto/x509/x509.go.jj 2013-08-14 13:55:08.939843607 +0200 +++ libgo/go/crypto/x509/x509.go 2014-02-18 17:28:22.943691764 +0100 @@ -283,9 +283,6 @@ func getPublicKeyAlgorithmFromOID(oid as - + // RFC 5480, 2.1.1.1. Named Curve // -// secp224r1 OBJECT IDENTIFIER ::= { @@ -452,36 +452,36 @@ // NB: secp256r1 is equivalent to prime256v1 var ( - oidNamedCurveP224 = asn1.ObjectIdentifier{1, 3, 132, 0, 33} - oidNamedCurveP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7} - oidNamedCurveP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34} - oidNamedCurveP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35} + oidNamedCurveP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7} + oidNamedCurveP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34} + oidNamedCurveP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35} @@ -306,8 +302,6 @@ var ( - + func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { - switch { + switch { - case oid.Equal(oidNamedCurveP224): - return elliptic.P224() - case oid.Equal(oidNamedCurveP256): - return elliptic.P256() - case oid.Equal(oidNamedCurveP384): + case oid.Equal(oidNamedCurveP256): + return elliptic.P256() + case oid.Equal(oidNamedCurveP384): @@ -320,8 +314,6 @@ func namedCurveFromOID(oid asn1.ObjectId - + func oidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool) { - switch curve { + switch curve { - case elliptic.P224(): - return oidNamedCurveP224, true - case elliptic.P256(): - return oidNamedCurveP256, true - case elliptic.P384(): + case elliptic.P256(): + return oidNamedCurveP256, true + case elliptic.P384(): @@ -1212,7 +1204,7 @@ func CreateCertificate(rand io.Reader, t - hashFunc = crypto.SHA1 - case *ecdsa.PrivateKey: - switch priv.Curve { + hashFunc = crypto.SHA1 + case *ecdsa.PrivateKey: + switch priv.Curve { - case elliptic.P224(), elliptic.P256(): + case elliptic.P256(): - hashFunc = crypto.SHA256 - signatureAlgorithm.Algorithm = oidSignatureECDSAWithSHA256 - case elliptic.P384(): + hashFunc = crypto.SHA256 + signatureAlgorithm.Algorithm = oidSignatureECDSAWithSHA256 + case elliptic.P384(): --- libgo/go/crypto/elliptic/p224.go.jj 2012-12-13 11:32:02.641039533 +0100 +++ libgo/go/crypto/elliptic/p224.go 2014-02-15 11:40:56.191557928 +0100 @@ -1,765 +0,0 @@ diff --git a/SOURCES/gcc48-libgomp-20160715.patch b/SOURCES/gcc48-libgomp-20160715.patch index 57f744b5..9b6a61e2 100644 --- a/SOURCES/gcc48-libgomp-20160715.patch +++ b/SOURCES/gcc48-libgomp-20160715.patch @@ -1,25 +1,25 @@ --- libgomp/config/linux/wait.h.jj 2013-01-31 20:29:10.091548989 +0100 +++ libgomp/config/linux/wait.h 2016-07-13 16:57:18.902355979 +0200 @@ -34,13 +34,13 @@ - + #define FUTEX_WAIT 0 #define FUTEX_WAKE 1 -#define FUTEX_PRIVATE_FLAG 128L +#define FUTEX_PRIVATE_FLAG 128 - + #ifdef HAVE_ATTRIBUTE_VISIBILITY # pragma GCC visibility push(hidden) #endif - + -extern long int gomp_futex_wait, gomp_futex_wake; +extern int gomp_futex_wait, gomp_futex_wake; - + #include - + @@ -48,7 +48,9 @@ static inline int do_spin (int *addr, in { unsigned long long i, count = gomp_spin_count_var; - + - if (__builtin_expect (gomp_managed_threads > gomp_available_cpus, 0)) + if (__builtin_expect (__atomic_load_n (&gomp_managed_threads, + MEMMODEL_RELAXED) @@ -32,7 +32,7 @@ @@ -352,6 +352,45 @@ gomp_affinity_print_place (void *p) fprintf (stderr, ":%lu", len); } - + +int +omp_get_place_num_procs (int place_num) +{ @@ -73,19 +73,19 @@ +ialias(omp_get_place_proc_ids) + #else - + #include "../posix/affinity.c" --- libgomp/config/linux/mutex.c.jj 2013-01-21 16:00:38.220917670 +0100 +++ libgomp/config/linux/mutex.c 2016-07-13 16:57:18.870356375 +0200 @@ -28,8 +28,8 @@ - + #include "wait.h" - + -long int gomp_futex_wake = FUTEX_WAKE | FUTEX_PRIVATE_FLAG; -long int gomp_futex_wait = FUTEX_WAIT | FUTEX_PRIVATE_FLAG; +int gomp_futex_wake = FUTEX_WAKE | FUTEX_PRIVATE_FLAG; +int gomp_futex_wait = FUTEX_WAIT | FUTEX_PRIVATE_FLAG; - + void gomp_mutex_lock_slow (gomp_mutex_t *mutex, int oldval) --- libgomp/config/posix/affinity.c.jj 2014-05-15 10:56:37.987498844 +0200 @@ -126,17 +126,17 @@ return gomp_loop_ull_static_start (up, start, end, incr, - icv->run_sched_modifier, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_DYNAMIC: return gomp_loop_ull_dynamic_start (up, start, end, incr, - icv->run_sched_modifier, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_GUIDED: return gomp_loop_ull_guided_start (up, start, end, incr, - icv->run_sched_modifier, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_AUTO: /* For now map to schedule(static), later on we could play with feedback @@ -278,15 +278,15 @@ GOMP_loop_ull_ordered_runtime_start (boo @@ -145,23 +145,23 @@ return gomp_loop_ull_ordered_static_start (up, start, end, incr, - icv->run_sched_modifier, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_DYNAMIC: return gomp_loop_ull_ordered_dynamic_start (up, start, end, incr, - icv->run_sched_modifier, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_GUIDED: return gomp_loop_ull_ordered_guided_start (up, start, end, incr, - icv->run_sched_modifier, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_AUTO: /* For now map to schedule(static), later on we could play with feedback @@ -298,6 +298,114 @@ GOMP_loop_ull_ordered_runtime_start (boo } } - + +/* The *_doacross_*_start routines are similar. The only difference is that + this work-share construct is initialized to expect an ORDERED(N) - DOACROSS + section, and the worksharing loop iterates always from 0 to COUNTS[0] - 1 @@ -274,20 +274,20 @@ the iteration block currently assigned to it. If the work-share construct is bound directly to a parallel construct, then the iteration @@ -457,6 +565,10 @@ extern __typeof(gomp_loop_ull_dynamic_st - __attribute__((alias ("gomp_loop_ull_dynamic_start"))); + __attribute__((alias ("gomp_loop_ull_dynamic_start"))); extern __typeof(gomp_loop_ull_guided_start) GOMP_loop_ull_guided_start - __attribute__((alias ("gomp_loop_ull_guided_start"))); + __attribute__((alias ("gomp_loop_ull_guided_start"))); +extern __typeof(gomp_loop_ull_dynamic_start) GOMP_loop_ull_nonmonotonic_dynamic_start + __attribute__((alias ("gomp_loop_ull_dynamic_start"))); +extern __typeof(gomp_loop_ull_guided_start) GOMP_loop_ull_nonmonotonic_guided_start + __attribute__((alias ("gomp_loop_ull_guided_start"))); - + extern __typeof(gomp_loop_ull_ordered_static_start) GOMP_loop_ull_ordered_static_start - __attribute__((alias ("gomp_loop_ull_ordered_static_start"))); + __attribute__((alias ("gomp_loop_ull_ordered_static_start"))); @@ -465,12 +577,23 @@ extern __typeof(gomp_loop_ull_ordered_dy extern __typeof(gomp_loop_ull_ordered_guided_start) GOMP_loop_ull_ordered_guided_start - __attribute__((alias ("gomp_loop_ull_ordered_guided_start"))); - + __attribute__((alias ("gomp_loop_ull_ordered_guided_start"))); + +extern __typeof(gomp_loop_ull_doacross_static_start) GOMP_loop_ull_doacross_static_start + __attribute__((alias ("gomp_loop_ull_doacross_static_start"))); +extern __typeof(gomp_loop_ull_doacross_dynamic_start) GOMP_loop_ull_doacross_dynamic_start @@ -296,21 +296,21 @@ + __attribute__((alias ("gomp_loop_ull_doacross_guided_start"))); + extern __typeof(gomp_loop_ull_static_next) GOMP_loop_ull_static_next - __attribute__((alias ("gomp_loop_ull_static_next"))); + __attribute__((alias ("gomp_loop_ull_static_next"))); extern __typeof(gomp_loop_ull_dynamic_next) GOMP_loop_ull_dynamic_next - __attribute__((alias ("gomp_loop_ull_dynamic_next"))); + __attribute__((alias ("gomp_loop_ull_dynamic_next"))); extern __typeof(gomp_loop_ull_guided_next) GOMP_loop_ull_guided_next - __attribute__((alias ("gomp_loop_ull_guided_next"))); + __attribute__((alias ("gomp_loop_ull_guided_next"))); +extern __typeof(gomp_loop_ull_dynamic_next) GOMP_loop_ull_nonmonotonic_dynamic_next + __attribute__((alias ("gomp_loop_ull_dynamic_next"))); +extern __typeof(gomp_loop_ull_guided_next) GOMP_loop_ull_nonmonotonic_guided_next + __attribute__((alias ("gomp_loop_ull_guided_next"))); - + extern __typeof(gomp_loop_ull_ordered_static_next) GOMP_loop_ull_ordered_static_next - __attribute__((alias ("gomp_loop_ull_ordered_static_next"))); + __attribute__((alias ("gomp_loop_ull_ordered_static_next"))); @@ -507,6 +630,25 @@ GOMP_loop_ull_guided_start (bool up, gom } - + bool +GOMP_loop_ull_nonmonotonic_dynamic_start (bool up, gomp_ull start, + gomp_ull end, gomp_ull incr, @@ -332,11 +332,11 @@ + +bool GOMP_loop_ull_ordered_static_start (bool up, gomp_ull start, gomp_ull end, - gomp_ull incr, gomp_ull chunk_size, - gomp_ull *istart, gomp_ull *iend) + gomp_ull incr, gomp_ull chunk_size, + gomp_ull *istart, gomp_ull *iend) @@ -534,6 +676,33 @@ GOMP_loop_ull_ordered_guided_start (bool } - + bool +GOMP_loop_ull_doacross_static_start (unsigned ncounts, gomp_ull *counts, + gomp_ull chunk_size, gomp_ull *istart, @@ -384,7 +384,7 @@ +{ + return gomp_loop_ull_guided_next (istart, iend); +} - + bool GOMP_loop_ull_ordered_static_next (gomp_ull *istart, gomp_ull *iend) --- libgomp/team.c.jj 2014-05-15 10:56:32.092524669 +0200 @@ -392,7 +392,7 @@ @@ -133,6 +133,25 @@ gomp_thread_start (void *xdata) return NULL; } - + +static inline struct gomp_team * +get_last_team (unsigned nthreads) +{ @@ -412,16 +412,16 @@ + } + return NULL; +} - + /* Create a new team data structure. */ - + @@ -140,18 +159,27 @@ struct gomp_team * gomp_new_team (unsigned nthreads) { struct gomp_team *team; - size_t size; int i; - + - size = sizeof (*team) + nthreads * (sizeof (team->ordered_release[0]) - + sizeof (team->implicit_task[0])); - team = gomp_malloc (size); @@ -440,7 +440,7 @@ + + team->nthreads = nthreads; + } - + team->work_share_chunk = 8; #ifdef HAVE_SYNC_BUILTINS team->single_count = 0; @@ -452,14 +452,14 @@ @@ -162,15 +190,11 @@ gomp_new_team (unsigned nthreads) team->work_shares[i].next_free = &team->work_shares[i + 1]; team->work_shares[i].next_free = NULL; - + - team->nthreads = nthreads; - gomp_barrier_init (&team->barrier, nthreads); - gomp_sem_init (&team->master_release, 0); team->ordered_release = (void *) &team->implicit_task[nthreads]; team->ordered_release[0] = &team->master_release; - + - gomp_mutex_init (&team->task_lock); - team->task_queue = NULL; + priority_queue_init (&team->task_queue); @@ -478,7 +478,7 @@ + priority_queue_free (&team->task_queue); free (team); } - + @@ -258,6 +286,8 @@ gomp_free_thread (void *arg __attribute_ free (pool); thr->thread_pool = NULL; @@ -490,7 +490,7 @@ struct gomp_task *task = thr->task; @@ -287,7 +317,7 @@ gomp_team_start (void (*fn) (void *), vo struct gomp_thread **affinity_thr = NULL; - + thr = gomp_thread (); - nested = thr->ts.team != NULL; + nested = thr->ts.level; @@ -504,7 +504,7 @@ -#ifndef HAVE_SYNC_BUILTINS - gomp_mutex_destroy (&team->work_share_list_free_lock); -#endif - + if (__builtin_expect (thr->ts.team != NULL, 0) || __builtin_expect (team->nthreads == 1, 0)) --- libgomp/target.c.jj 2014-05-15 10:56:38.313498020 +0200 @@ -512,11 +512,11 @@ @@ -22,14 +22,22 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ - + -/* This file handles the maintainence of threads in response to team - creation and termination. */ +/* This file contains the support of offloading. */ - + +#include "config.h" #include "libgomp.h" +#include "oacc-plugin.h" @@ -531,13 +531,13 @@ #include +#include +#include - + attribute_hidden int gomp_get_num_devices (void) @@ -37,22 +45,87 @@ gomp_get_num_devices (void) return 0; } - + -/* Called when encountering a target directive. If DEVICE - is -1, it means use device-var ICV. If it is -2 (or any other value - larger than last available hw device, use host fallback. @@ -550,7 +550,7 @@ +/* This function should be called from every offload image while loading. + It gets the descriptor of the host func and var tables HOST_TABLE, TYPE of + the target, and TARGET_DATA needed by target plugin. */ - + void -GOMP_target (int device, void (*fn) (void *), const void *openmp_target, - size_t mapnum, void **hostaddrs, size_t *sizes, @@ -638,7 +638,7 @@ @@ -66,10 +139,167 @@ GOMP_target (int device, void (*fn) (voi *thr = old_thr; } - + +/* Calculate alignment and size requirements of a private copy of data shared + as GOMP_MAP_FIRSTPRIVATE and store them to TGT_ALIGN and TGT_SIZE. */ + @@ -791,7 +791,7 @@ void -GOMP_target_data (int device, const void *openmp_target, size_t mapnum, +GOMP_target_data (int device, const void *unused, size_t mapnum, - void **hostaddrs, size_t *sizes, unsigned char *kinds) + void **hostaddrs, size_t *sizes, unsigned char *kinds) { + return gomp_target_data_fallback (); +} @@ -802,18 +802,18 @@ +{ + return gomp_target_data_fallback (); } - + void @@ -78,12 +308,112 @@ GOMP_target_end_data (void) } - + void -GOMP_target_update (int device, const void *openmp_target, size_t mapnum, +GOMP_target_update (int device, const void *unused, size_t mapnum, - void **hostaddrs, size_t *sizes, unsigned char *kinds) + void **hostaddrs, size_t *sizes, unsigned char *kinds) { } - + void +GOMP_target_update_ext (int device, size_t mapnum, void **hostaddrs, + size_t *sizes, unsigned short *kinds, @@ -1093,11 +1093,11 @@ +ialias_redirect (omp_get_initial_device) +ialias_redirect (omp_get_max_task_priority) #endif - + #ifndef LIBGOMP_GNU_SYMBOL_VERSIONING @@ -342,35 +350,35 @@ omp_get_wtime_ (void) } - + void -omp_set_schedule_ (const int32_t *kind, const int32_t *modifier) +omp_set_schedule_ (const int32_t *kind, const int32_t *chunk_size) @@ -1105,7 +1105,7 @@ - omp_set_schedule (*kind, *modifier); + omp_set_schedule (*kind, *chunk_size); } - + void -omp_set_schedule_8_ (const int32_t *kind, const int64_t *modifier) +omp_set_schedule_8_ (const int32_t *kind, const int64_t *chunk_size) @@ -1113,7 +1113,7 @@ - omp_set_schedule (*kind, TO_INT (*modifier)); + omp_set_schedule (*kind, TO_INT (*chunk_size)); } - + void -omp_get_schedule_ (int32_t *kind, int32_t *modifier) +omp_get_schedule_ (int32_t *kind, int32_t *chunk_size) @@ -1127,7 +1127,7 @@ - *modifier = m; + *chunk_size = cs; } - + void -omp_get_schedule_8_ (int32_t *kind, int64_t *modifier) +omp_get_schedule_8_ (int32_t *kind, int64_t *chunk_size) @@ -1141,12 +1141,12 @@ - *modifier = m; + *chunk_size = cs; } - + int32_t @@ -451,6 +459,69 @@ omp_get_proc_bind_ (void) return omp_get_proc_bind (); } - + +int32_t +omp_get_num_places_ (void) +{ @@ -1232,9 +1232,9 @@ --- libgomp/libgomp.map.jj 2014-05-15 10:56:31.927533549 +0200 +++ libgomp/libgomp.map 2016-07-13 16:57:04.434535373 +0200 @@ -134,6 +134,36 @@ OMP_4.0 { - omp_is_initial_device_; + omp_is_initial_device_; } OMP_3.1; - + +OMP_4.5 { + global: + omp_get_max_task_priority; @@ -1267,10 +1267,10 @@ + GOMP_1.0 { global: - GOMP_atomic_end; + GOMP_atomic_end; @@ -227,3 +257,158 @@ GOMP_4.0 { - GOMP_target_update; - GOMP_teams; + GOMP_target_update; + GOMP_teams; } GOMP_3.0; + +GOMP_4.0.1 { @@ -1431,13 +1431,13 @@ +++ libgomp/ordered.c 2016-07-13 16:57:18.918355780 +0200 @@ -25,6 +25,9 @@ /* This file handles the ORDERED construct. */ - + #include "libgomp.h" +#include +#include +#include "doacross.h" - - + + /* This function is called when first allocating an iteration block. That @@ -249,3 +252,533 @@ void GOMP_ordered_end (void) @@ -1978,7 +1978,7 @@ @@ -110,6 +110,11 @@ gomp_loop_static_start (long start, long return !gomp_iter_static_next (istart, iend); } - + +/* The current dynamic implementation is always monotonic. The + entrypoints without nonmonotonic in them have to be always monotonic, + but the nonmonotonic ones could be changed to use work-stealing for @@ -1986,17 +1986,17 @@ + static bool gomp_loop_dynamic_start (long start, long end, long incr, long chunk_size, - long *istart, long *iend) + long *istart, long *iend) @@ -135,6 +140,9 @@ gomp_loop_dynamic_start (long start, lon return ret; } - + +/* Similarly as for dynamic, though the question is how can the chunk sizes + be decreased without a central locking or atomics. */ + static bool gomp_loop_guided_start (long start, long end, long incr, long chunk_size, - long *istart, long *iend) + long *istart, long *iend) @@ -168,13 +176,16 @@ GOMP_loop_runtime_start (long start, lon switch (icv->run_sched_var) { @@ -2004,17 +2004,17 @@ - return gomp_loop_static_start (start, end, incr, icv->run_sched_modifier, + return gomp_loop_static_start (start, end, incr, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_DYNAMIC: - return gomp_loop_dynamic_start (start, end, incr, icv->run_sched_modifier, + return gomp_loop_dynamic_start (start, end, incr, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_GUIDED: - return gomp_loop_guided_start (start, end, incr, icv->run_sched_modifier, + return gomp_loop_guided_start (start, end, incr, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_AUTO: /* For now map to schedule(static), later on we could play with feedback @@ -265,15 +276,15 @@ GOMP_loop_ordered_runtime_start (long st @@ -2023,23 +2023,23 @@ return gomp_loop_ordered_static_start (start, end, incr, - icv->run_sched_modifier, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_DYNAMIC: return gomp_loop_ordered_dynamic_start (start, end, incr, - icv->run_sched_modifier, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_GUIDED: return gomp_loop_ordered_guided_start (start, end, incr, - icv->run_sched_modifier, + icv->run_sched_chunk_size, - istart, iend); + istart, iend); case GFS_AUTO: /* For now map to schedule(static), later on we could play with feedback @@ -285,6 +296,111 @@ GOMP_loop_ordered_runtime_start (long st } } - + +/* The *_doacross_*_start routines are similar. The only difference is that + this work-share construct is initialized to expect an ORDERED(N) - DOACROSS + section, and the worksharing loop iterates always from 0 to COUNTS[0] - 1 @@ -2145,8 +2145,8 @@ + } +} + - /* The *_next routines are called when the thread completes processing of - the iteration block currently assigned to it. If the work-share + /* The *_next routines are called when the thread completes processing of + the iteration block currently assigned to it. If the work-share construct is bound directly to a parallel construct, then the iteration @@ -483,7 +599,7 @@ GOMP_parallel_loop_runtime_start (void ( { @@ -2155,12 +2155,12 @@ - icv->run_sched_var, icv->run_sched_modifier, 0); + icv->run_sched_var, icv->run_sched_chunk_size, 0); } - + ialias_redirect (GOMP_parallel_end) @@ -521,6 +637,37 @@ GOMP_parallel_loop_guided (void (*fn) (v GOMP_parallel_end (); } - + +#ifdef HAVE_ATTRIBUTE_ALIAS +extern __typeof(GOMP_parallel_loop_dynamic) GOMP_parallel_loop_nonmonotonic_dynamic + __attribute__((alias ("GOMP_parallel_loop_dynamic"))); @@ -2194,31 +2194,31 @@ + void GOMP_parallel_loop_runtime (void (*fn) (void *), void *data, - unsigned num_threads, long start, long end, + unsigned num_threads, long start, long end, @@ -528,7 +675,7 @@ GOMP_parallel_loop_runtime (void (*fn) ( { struct gomp_task_icv *icv = gomp_icv (false); gomp_parallel_loop_start (fn, data, num_threads, start, end, incr, - icv->run_sched_var, icv->run_sched_modifier, + icv->run_sched_var, icv->run_sched_chunk_size, - flags); + flags); fn (data); GOMP_parallel_end (); @@ -569,6 +716,10 @@ extern __typeof(gomp_loop_dynamic_start) - __attribute__((alias ("gomp_loop_dynamic_start"))); + __attribute__((alias ("gomp_loop_dynamic_start"))); extern __typeof(gomp_loop_guided_start) GOMP_loop_guided_start - __attribute__((alias ("gomp_loop_guided_start"))); + __attribute__((alias ("gomp_loop_guided_start"))); +extern __typeof(gomp_loop_dynamic_start) GOMP_loop_nonmonotonic_dynamic_start + __attribute__((alias ("gomp_loop_dynamic_start"))); +extern __typeof(gomp_loop_guided_start) GOMP_loop_nonmonotonic_guided_start + __attribute__((alias ("gomp_loop_guided_start"))); - + extern __typeof(gomp_loop_ordered_static_start) GOMP_loop_ordered_static_start - __attribute__((alias ("gomp_loop_ordered_static_start"))); + __attribute__((alias ("gomp_loop_ordered_static_start"))); @@ -577,12 +728,23 @@ extern __typeof(gomp_loop_ordered_dynami extern __typeof(gomp_loop_ordered_guided_start) GOMP_loop_ordered_guided_start - __attribute__((alias ("gomp_loop_ordered_guided_start"))); - + __attribute__((alias ("gomp_loop_ordered_guided_start"))); + +extern __typeof(gomp_loop_doacross_static_start) GOMP_loop_doacross_static_start + __attribute__((alias ("gomp_loop_doacross_static_start"))); +extern __typeof(gomp_loop_doacross_dynamic_start) GOMP_loop_doacross_dynamic_start @@ -2227,21 +2227,21 @@ + __attribute__((alias ("gomp_loop_doacross_guided_start"))); + extern __typeof(gomp_loop_static_next) GOMP_loop_static_next - __attribute__((alias ("gomp_loop_static_next"))); + __attribute__((alias ("gomp_loop_static_next"))); extern __typeof(gomp_loop_dynamic_next) GOMP_loop_dynamic_next - __attribute__((alias ("gomp_loop_dynamic_next"))); + __attribute__((alias ("gomp_loop_dynamic_next"))); extern __typeof(gomp_loop_guided_next) GOMP_loop_guided_next - __attribute__((alias ("gomp_loop_guided_next"))); + __attribute__((alias ("gomp_loop_guided_next"))); +extern __typeof(gomp_loop_dynamic_next) GOMP_loop_nonmonotonic_dynamic_next + __attribute__((alias ("gomp_loop_dynamic_next"))); +extern __typeof(gomp_loop_guided_next) GOMP_loop_nonmonotonic_guided_next + __attribute__((alias ("gomp_loop_guided_next"))); - + extern __typeof(gomp_loop_ordered_static_next) GOMP_loop_ordered_static_next - __attribute__((alias ("gomp_loop_ordered_static_next"))); + __attribute__((alias ("gomp_loop_ordered_static_next"))); @@ -613,6 +775,21 @@ GOMP_loop_guided_start (long start, long } - + bool +GOMP_loop_nonmonotonic_dynamic_start (long start, long end, long incr, + long chunk_size, long *istart, @@ -2259,11 +2259,11 @@ + +bool GOMP_loop_ordered_static_start (long start, long end, long incr, - long chunk_size, long *istart, long *iend) + long chunk_size, long *istart, long *iend) { @@ -637,6 +814,30 @@ GOMP_loop_ordered_guided_start (long sta } - + bool +GOMP_loop_doacross_static_start (unsigned ncounts, long *counts, + long chunk_size, long *istart, long *iend) @@ -2308,15 +2308,15 @@ +{ + return gomp_loop_guided_next (istart, iend); +} - + bool GOMP_loop_ordered_static_next (long *istart, long *iend) --- libgomp/error.c.jj 2013-01-21 16:00:31.834953566 +0100 +++ libgomp/error.c 2016-07-13 16:57:04.437535335 +0200 @@ -35,7 +35,26 @@ #include - - + + -static void +#undef gomp_vdebug +void @@ -2343,7 +2343,7 @@ fputs ("\nlibgomp: ", stderr); @@ -54,13 +73,18 @@ gomp_error (const char *fmt, ...) } - + void +gomp_vfatal (const char *fmt, va_list list) +{ @@ -2355,7 +2355,7 @@ gomp_fatal (const char *fmt, ...) { va_list list; - + va_start (list, fmt); - gomp_verror (fmt, list); + gomp_vfatal (fmt, list); @@ -2367,8 +2367,8 @@ +++ libgomp/Makefile.am 2016-07-14 16:10:51.968202878 +0200 @@ -60,7 +60,13 @@ libgomp_la_LINK = $(LINK) $(libgomp_la_L libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \ - iter_ull.c loop.c loop_ull.c ordered.c parallel.c sections.c single.c \ - task.c team.c work.c lock.c mutex.c proc.c sem.c bar.c ptrlock.c \ + iter_ull.c loop.c loop_ull.c ordered.c parallel.c sections.c single.c \ + task.c team.c work.c lock.c mutex.c proc.c sem.c bar.c ptrlock.c \ - time.c fortran.c affinity.c target.c + time.c fortran.c affinity.c target.c splay-tree.c libgomp-plugin.c \ + oacc-parallel.c oacc-host.c oacc-init.c oacc-mem.c oacc-async.c \ @@ -2377,7 +2377,7 @@ +if USE_FORTRAN +libgomp_la_SOURCES += openacc.f90 +endif - + nodist_noinst_HEADERS = libgomp_f.h nodist_libsubinclude_HEADERS = omp.h --- libgomp/Makefile.in.jj 2014-05-15 11:12:10.000000000 +0200 @@ -2389,16 +2389,16 @@ +@USE_FORTRAN_TRUE@am__append_1 = openacc.f90 subdir = . DIST_COMMON = ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ + $(top_srcdir)/configure $(am__configure_deps) \ @@ -92,11 +93,15 @@ am__installdirs = "$(DESTDIR)$(toolexecl - "$(DESTDIR)$(toolexeclibdir)" + "$(DESTDIR)$(toolexeclibdir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) libgomp_la_LIBADD = +@USE_FORTRAN_TRUE@am__objects_1 = openacc.lo am_libgomp_la_OBJECTS = alloc.lo barrier.lo critical.lo env.lo \ - error.lo iter.lo iter_ull.lo loop.lo loop_ull.lo ordered.lo \ - parallel.lo sections.lo single.lo task.lo team.lo work.lo \ - lock.lo mutex.lo proc.lo sem.lo bar.lo ptrlock.lo time.lo \ + error.lo iter.lo iter_ull.lo loop.lo loop_ull.lo ordered.lo \ + parallel.lo sections.lo single.lo task.lo team.lo work.lo \ + lock.lo mutex.lo proc.lo sem.lo bar.lo ptrlock.lo time.lo \ - fortran.lo affinity.lo target.lo + fortran.lo affinity.lo target.lo splay-tree.lo \ + libgomp-plugin.lo oacc-parallel.lo oacc-host.lo oacc-init.lo \ @@ -2408,8 +2408,8 @@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/../depcomp @@ -108,6 +113,13 @@ LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIB - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) +FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS) +LTFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ @@ -2419,8 +2419,8 @@ + --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ SOURCES = $(libgomp_la_SOURCES) - MULTISRCTOP = - MULTIBUILDTOP = + MULTISRCTOP = + MULTIBUILDTOP = @@ -315,10 +327,12 @@ libgomp_la_LDFLAGS = $(libgomp_version_i libgomp_la_DEPENDENCIES = $(libgomp_version_dep) libgomp_la_LINK = $(LINK) $(libgomp_la_LDFLAGS) @@ -2439,13 +2439,13 @@ nodist_libsubinclude_HEADERS = omp.h @USE_FORTRAN_TRUE@nodist_finclude_HEADERS = omp_lib.h omp_lib.f90 omp_lib.mod omp_lib_kinds.mod @@ -351,7 +365,7 @@ all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - + $(MAKE) $(AM_MAKEFLAGS) all-recursive + .SUFFIXES: -.SUFFIXES: .c .dvi .lo .o .obj .ps +.SUFFIXES: .c .dvi .f90 .lo .o .obj .ps am--refresh: - @: + @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @@ -463,17 +477,27 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fortran.Plo@am__quote@ @@ -2478,7 +2478,7 @@ @@ -501,6 +525,15 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - + +.f90.o: + $(FCCOMPILE) -c -o $@ $< + @@ -2489,8 +2489,8 @@ + $(LTFCCOMPILE) -c -o $@ $< + mostlyclean-libtool: - -rm -f *.lo - + -rm -f *.lo + --- libgomp/task.c.jj 2014-08-06 16:25:16.575091658 +0200 +++ libgomp/task.c 2016-07-13 17:47:58.722758497 +0200 @@ -28,6 +28,7 @@ @@ -2498,12 +2498,12 @@ #include #include +#include "gomp-constants.h" - + typedef struct gomp_task_depend_entry *hash_entry_type; - + @@ -63,6 +64,14 @@ void gomp_init_task (struct gomp_task *task, struct gomp_task *parent_task, - struct gomp_task_icv *prev_icv) + struct gomp_task_icv *prev_icv) { + /* It would seem that using memset here would be a win, but it turns + out that partially filling gomp_task allows us to keep the @@ -2528,7 +2528,7 @@ @@ -90,30 +99,194 @@ gomp_end_task (void) thr->task = task->parent; } - + +/* Clear the parent field of every task in LIST. */ + static inline void @@ -2590,7 +2590,7 @@ + else + gomp_clear_parent_in_list (&q->l); } - + -static void gomp_task_maybe_wait_for_dependencies (void **depend); +/* Helper function for GOMP_task and gomp_create_target_task. + @@ -2711,7 +2711,7 @@ + } + } +} - + /* Called when encountering an explicit task directive. If IF_CLAUSE is false, then we must not delay in executing the task. If UNTIED is true, - then the task may be executed by any member of the team. */ @@ -2721,10 +2721,10 @@ + depend[0]: number of depend elements. + depend[1]: number of depend elements of type "out". + depend[2..N+1]: address of [1..N]th depend element. */ - + void GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *), - long arg_size, long arg_align, bool if_clause, unsigned flags, + long arg_size, long arg_align, bool if_clause, unsigned flags, - void **depend) + void **depend, int priority) { @@ -2738,12 +2738,12 @@ - flags &= ~1; + flags &= ~GOMP_TASK_FLAG_UNTIED; #endif - + /* If parallel or taskgroup has been cancelled, don't start new tasks. */ @@ -135,6 +307,11 @@ GOMP_task (void (*fn) (void *), void *da - || (thr->task->taskgroup && thr->task->taskgroup->cancelled))) + || (thr->task->taskgroup && thr->task->taskgroup->cancelled))) return; - + + if ((flags & GOMP_TASK_FLAG_PRIORITY) == 0) + priority = 0; + else if (priority > gomp_max_task_priority_var) @@ -2753,14 +2753,14 @@ || (thr->task && thr->task->final_task) || team->task_count > 64 * team->nthreads) @@ -147,12 +324,15 @@ GOMP_task (void (*fn) (void *), void *da - depend clauses for non-deferred tasks other than this, because - the parent task is suspended until the child task finishes and thus - it can't start further child tasks. */ + depend clauses for non-deferred tasks other than this, because + the parent task is suspended until the child task finishes and thus + it can't start further child tasks. */ - if ((flags & 8) && thr->task && thr->task->depend_hash) + if ((flags & GOMP_TASK_FLAG_DEPEND) + && thr->task && thr->task->depend_hash) - gomp_task_maybe_wait_for_dependencies (depend); - + gomp_task_maybe_wait_for_dependencies (depend); + gomp_init_task (&task, thr->task, gomp_icv (false)); - task.kind = GOMP_TASK_IFFALSE; - task.final_task = (thr->task && thr->task->final_task) || (flags & 2); @@ -2769,33 +2769,33 @@ + || (flags & GOMP_TASK_FLAG_FINAL); + task.priority = priority; if (thr->task) - { - task.in_tied_task = thr->task->in_tied_task; + { + task.in_tied_task = thr->task->in_tied_task; @@ -178,10 +358,10 @@ GOMP_task (void (*fn) (void *), void *da - child thread, but seeing a stale non-NULL value is not a - problem. Once past the task_lock acquisition, this thread - will see the real value of task.children. */ + child thread, but seeing a stale non-NULL value is not a + problem. Once past the task_lock acquisition, this thread + will see the real value of task.children. */ - if (task.children != NULL) + if (!priority_queue_empty_p (&task.children_queue, MEMMODEL_RELAXED)) - { - gomp_mutex_lock (&team->task_lock); + { + gomp_mutex_lock (&team->task_lock); - gomp_clear_parent (task.children); + gomp_clear_parent (&task.children_queue); - gomp_mutex_unlock (&team->task_lock); - } + gomp_mutex_unlock (&team->task_lock); + } gomp_end_task (); @@ -195,7 +375,7 @@ GOMP_task (void (*fn) (void *), void *da bool do_wake; size_t depend_size = 0; - + - if (flags & 8) + if (flags & GOMP_TASK_FLAG_DEPEND) - depend_size = ((uintptr_t) depend[0] - * sizeof (struct gomp_task_depend_entry)); + depend_size = ((uintptr_t) depend[0] + * sizeof (struct gomp_task_depend_entry)); task = gomp_malloc (sizeof (*task) + depend_size @@ -203,7 +383,8 @@ GOMP_task (void (*fn) (void *), void *da arg = (char *) (((uintptr_t) (task + 1) + depend_size + arg_align - 1) - & ~(uintptr_t) (arg_align - 1)); + & ~(uintptr_t) (arg_align - 1)); gomp_init_task (task, parent, gomp_icv (false)); - task->kind = GOMP_TASK_IFFALSE; + task->priority = priority; @@ -2811,11 +2811,11 @@ + task->final_task = (flags & GOMP_TASK_FLAG_FINAL) >> 1; gomp_mutex_lock (&team->task_lock); /* If parallel or taskgroup has been cancelled, don't start new - tasks. */ + tasks. */ @@ -235,171 +416,39 @@ GOMP_task (void (*fn) (void *), void *da - taskgroup->num_children++; + taskgroup->num_children++; if (depend_size) - { + { - size_t ndepend = (uintptr_t) depend[0]; - size_t nout = (uintptr_t) depend[1]; - size_t i; @@ -2934,8 +2934,8 @@ - } - } + gomp_task_handle_depend (task, parent, depend); - if (task->num_dependees) - { + if (task->num_dependees) + { + /* Tasks that depend on other tasks are not put into the + various waiting queues, so we are done for now. Said + tasks are instead put into the queues via @@ -2943,10 +2943,10 @@ + dependencies have been satisfied. After which, they + can be picked up by the various scheduling + points. */ - gomp_mutex_unlock (&team->task_lock); - return; - } - } + gomp_mutex_unlock (&team->task_lock); + return; + } + } - if (parent->children) - { - task->next_child = parent->children; @@ -3013,7 +3013,7 @@ @@ -411,36 +460,529 @@ GOMP_task (void (*fn) (void *), void *da } } - + -static inline bool -gomp_task_run_pre (struct gomp_task *child_task, struct gomp_task *parent, - struct gomp_taskgroup *taskgroup, struct gomp_team *team) @@ -3102,7 +3102,7 @@ + Inform any waiters. */ + parent->taskwait->in_taskwait = false; + gomp_sem_post (&parent->taskwait->taskwait_sem); - } + } + else if (parent->taskwait->in_depend_wait) + { + /* One more task has had its dependencies met. @@ -3564,7 +3564,7 @@ @@ -478,6 +1020,14 @@ gomp_task_run_post_handle_depend_hash (s } } - + +/* After a CHILD_TASK has been run, adjust the dependency queue for + each task that depends on CHILD_TASK, to record the fact that there + is one less dependency to worry about. If a task that depended on @@ -3575,7 +3575,7 @@ + static size_t gomp_task_run_post_handle_dependers (struct gomp_task *child_task, - struct gomp_team *team) + struct gomp_team *team) @@ -487,91 +1037,60 @@ gomp_task_run_post_handle_dependers (str for (i = 0; i < count; i++) { @@ -3586,11 +3586,11 @@ + depenencies, put it into the various queues so it will get + scheduled for execution. */ if (--task->num_dependees != 0) - continue; - + continue; + struct gomp_taskgroup *taskgroup = task->taskgroup; if (parent) - { + { - if (parent->children) - { - /* If parent is in gomp_task_maybe_wait_for_dependencies @@ -3624,29 +3624,29 @@ + PRIORITY_INSERT_BEGIN, + /*adjust_parent_depends_on=*/true, + task->parent_depends_on); - if (parent->taskwait) - { - if (parent->taskwait->in_taskwait) - { + if (parent->taskwait) + { + if (parent->taskwait->in_taskwait) + { + /* One more task has had its dependencies met. + Inform any waiters. */ - parent->taskwait->in_taskwait = false; - gomp_sem_post (&parent->taskwait->taskwait_sem); - } - else if (parent->taskwait->in_depend_wait) - { + parent->taskwait->in_taskwait = false; + gomp_sem_post (&parent->taskwait->taskwait_sem); + } + else if (parent->taskwait->in_depend_wait) + { + /* One more task has had its dependencies met. + Inform any waiters. */ - parent->taskwait->in_depend_wait = false; - gomp_sem_post (&parent->taskwait->taskwait_sem); - } + parent->taskwait->in_depend_wait = false; + gomp_sem_post (&parent->taskwait->taskwait_sem); + } - if (parent->taskwait->last_parent_depends_on == NULL - && task->parent_depends_on) - parent->taskwait->last_parent_depends_on = task; - } - } + } + } if (taskgroup) - { + { - if (taskgroup->children) - { - task->next_taskgroup = taskgroup->children; @@ -3665,14 +3665,14 @@ + PRIORITY_INSERT_BEGIN, + /*adjust_parent_depends_on=*/false, + task->parent_depends_on); - if (taskgroup->in_taskgroup_wait) - { + if (taskgroup->in_taskgroup_wait) + { + /* One more task has had its dependencies met. + Inform any waiters. */ - taskgroup->in_taskgroup_wait = false; - gomp_sem_post (&taskgroup->taskgroup_sem); - } - } + taskgroup->in_taskgroup_wait = false; + gomp_sem_post (&taskgroup->taskgroup_sem); + } + } - if (team->task_queue) - { - task->next_queue = team->task_queue; @@ -3697,7 +3697,7 @@ @@ -601,12 +1120,18 @@ gomp_task_run_post_handle_depend (struct return gomp_task_run_post_handle_dependers (child_task, team); } - + +/* Remove CHILD_TASK from its parent. */ + static inline void @@ -3746,7 +3746,7 @@ + child_task->pnode[PQ_CHILDREN].next = NULL; + child_task->pnode[PQ_CHILDREN].prev = NULL; } - + +/* Remove CHILD_TASK from its taskgroup. */ + static inline void @@ -3766,7 +3766,7 @@ --taskgroup->num_children; else @@ -655,18 +1175,10 @@ gomp_task_run_post_remove_taskgroup (str - before the NULL is written. */ + before the NULL is written. */ __atomic_store_n (&taskgroup->num_children, 0, MEMMODEL_RELEASE); } - if (taskgroup->children != child_task) @@ -3786,30 +3786,30 @@ + gomp_sem_post (&taskgroup->taskgroup_sem); } } - + @@ -696,11 +1208,15 @@ gomp_barrier_handle_tasks (gomp_barrier_ while (1) { bool cancelled = false; - if (team->task_queue != NULL) + if (!priority_queue_empty_p (&team->task_queue, MEMMODEL_RELAXED)) - { + { - child_task = team->task_queue; + bool ignored; + child_task + = priority_queue_next_task (PQ_TEAM, &team->task_queue, + PQ_IGNORED, NULL, + &ignored); - cancelled = gomp_task_run_pre (child_task, child_task->parent, + cancelled = gomp_task_run_pre (child_task, child_task->parent, - child_task->taskgroup, team); + team); - if (__builtin_expect (cancelled, 0)) - { - if (to_free) + if (__builtin_expect (cancelled, 0)) + { + if (to_free) @@ -729,7 +1245,29 @@ gomp_barrier_handle_tasks (gomp_barrier_ if (child_task) - { - thr->task = child_task; + { + thr->task = child_task; - child_task->fn (child_task->fn_data); + if (__builtin_expect (child_task->fn == NULL, 0)) + { @@ -3834,27 +3834,27 @@ + } + else + child_task->fn (child_task->fn_data); - thr->task = task; - } + thr->task = task; + } else @@ -741,7 +1279,7 @@ gomp_barrier_handle_tasks (gomp_barrier_ - size_t new_tasks - = gomp_task_run_post_handle_depend (child_task, team); - gomp_task_run_post_remove_parent (child_task); + size_t new_tasks + = gomp_task_run_post_handle_depend (child_task, team); + gomp_task_run_post_remove_parent (child_task); - gomp_clear_parent (child_task->children); + gomp_clear_parent (&child_task->children_queue); - gomp_task_run_post_remove_taskgroup (child_task); - to_free = child_task; - child_task = NULL; + gomp_task_run_post_remove_taskgroup (child_task); + to_free = child_task; + child_task = NULL; @@ -765,7 +1303,9 @@ gomp_barrier_handle_tasks (gomp_barrier_ } } - + -/* Called when encountering a taskwait directive. */ +/* Called when encountering a taskwait directive. + + Wait for all children of the current task. */ - + void GOMP_taskwait (void) @@ -785,15 +1325,16 @@ GOMP_taskwait (void) @@ -3864,7 +3864,7 @@ - || __atomic_load_n (&task->children, MEMMODEL_ACQUIRE) == NULL) + || priority_queue_empty_p (&task->children_queue, MEMMODEL_ACQUIRE)) return; - + memset (&taskwait, 0, sizeof (taskwait)); + bool child_q = false; gomp_mutex_lock (&team->task_lock); @@ -3873,45 +3873,45 @@ bool cancelled = false; - if (task->children == NULL) + if (priority_queue_empty_p (&task->children_queue, MEMMODEL_RELAXED)) - { - bool destroy_taskwait = task->taskwait != NULL; - task->taskwait = NULL; + { + bool destroy_taskwait = task->taskwait != NULL; + task->taskwait = NULL; @@ -807,12 +1348,14 @@ GOMP_taskwait (void) - gomp_sem_destroy (&taskwait.taskwait_sem); - return; - } + gomp_sem_destroy (&taskwait.taskwait_sem); + return; + } - if (task->children->kind == GOMP_TASK_WAITING) + struct gomp_task *next_task + = priority_queue_next_task (PQ_CHILDREN, &task->children_queue, + PQ_TEAM, &team->task_queue, &child_q); + if (next_task->kind == GOMP_TASK_WAITING) - { + { - child_task = task->children; + child_task = next_task; - cancelled + cancelled - = gomp_task_run_pre (child_task, task, child_task->taskgroup, - team); + = gomp_task_run_pre (child_task, task, team); - if (__builtin_expect (cancelled, 0)) - { - if (to_free) + if (__builtin_expect (cancelled, 0)) + { + if (to_free) @@ -826,8 +1369,10 @@ GOMP_taskwait (void) - } + } else - { + { - /* All tasks we are waiting for are already running - in other threads. Wait for them. */ + /* All tasks we are waiting for are either running in other + threads, or they are tasks that have not had their + dependencies met (so they're not even in the queue). Wait + for them. */ - if (task->taskwait == NULL) - { - taskwait.in_depend_wait = false; + if (task->taskwait == NULL) + { + taskwait.in_depend_wait = false; @@ -851,7 +1396,28 @@ GOMP_taskwait (void) if (child_task) - { - thr->task = child_task; + { + thr->task = child_task; - child_task->fn (child_task->fn_data); + if (__builtin_expect (child_task->fn == NULL, 0)) + { @@ -3935,13 +3935,13 @@ + } + else + child_task->fn (child_task->fn_data); - thr->task = task; - } + thr->task = task; + } else @@ -862,17 +1428,19 @@ GOMP_taskwait (void) - finish_cancelled:; - size_t new_tasks - = gomp_task_run_post_handle_depend (child_task, team); + finish_cancelled:; + size_t new_tasks + = gomp_task_run_post_handle_depend (child_task, team); - child_task->prev_child->next_child = child_task->next_child; - child_task->next_child->prev_child = child_task->prev_child; - if (task->children == child_task) @@ -3957,25 +3957,25 @@ + child_task, MEMMODEL_RELAXED); + child_task->pnode[PQ_CHILDREN].next = NULL; + child_task->pnode[PQ_CHILDREN].prev = NULL; - } + } - gomp_clear_parent (child_task->children); + + gomp_clear_parent (&child_task->children_queue); + - gomp_task_run_post_remove_taskgroup (child_task); + gomp_task_run_post_remove_taskgroup (child_task); + - to_free = child_task; - child_task = NULL; - team->task_count--; + to_free = child_task; + child_task = NULL; + team->task_count--; @@ -887,10 +1455,20 @@ GOMP_taskwait (void) } } - + -/* This is like GOMP_taskwait, but we only wait for tasks that the - upcoming task depends on. */ +/* An undeferred task is about to run. Wait for all tasks that this + undeferred task depends on. - + -static void + This is done by first putting all known ready dependencies + (dependencies that have their own dependencies met) at the top of @@ -4000,13 +4000,13 @@ size_t nout = (uintptr_t) depend[1]; size_t i; @@ -922,32 +1499,11 @@ gomp_task_maybe_wait_for_dependencies (v - { - tsk->parent_depends_on = true; - ++num_awaited; + { + tsk->parent_depends_on = true; + ++num_awaited; + /* If depenency TSK itself has no dependencies and is + ready to run, move it up front so that we run it as + soon as possible. */ - if (tsk->num_dependees == 0 && tsk->kind == GOMP_TASK_WAITING) + if (tsk->num_dependees == 0 && tsk->kind == GOMP_TASK_WAITING) - { - /* If a task we need to wait for is not already - running and is ready to be scheduled, move it @@ -4033,21 +4033,21 @@ - last_parent_depends_on = tsk; - } + priority_queue_upgrade_task (tsk, task); - } - } + } + } } @@ -959,7 +1515,6 @@ gomp_task_maybe_wait_for_dependencies (v - + memset (&taskwait, 0, sizeof (taskwait)); taskwait.n_depend = num_awaited; - taskwait.last_parent_depends_on = last_parent_depends_on; gomp_sem_init (&taskwait.taskwait_sem, 0); task->taskwait = &taskwait; - + @@ -978,12 +1533,30 @@ gomp_task_maybe_wait_for_dependencies (v - gomp_sem_destroy (&taskwait.taskwait_sem); - return; - } + gomp_sem_destroy (&taskwait.taskwait_sem); + return; + } - if (task->children->kind == GOMP_TASK_WAITING) + + /* Theoretically when we have multiple priorities, we should @@ -4069,19 +4069,19 @@ + PQ_IGNORED, NULL, &ignored); + + if (next_task->kind == GOMP_TASK_WAITING) - { + { - child_task = task->children; + child_task = next_task; - cancelled + cancelled - = gomp_task_run_pre (child_task, task, child_task->taskgroup, - team); + = gomp_task_run_pre (child_task, task, team); - if (__builtin_expect (cancelled, 0)) - { - if (to_free) + if (__builtin_expect (cancelled, 0)) + { + if (to_free) @@ -996,8 +1569,10 @@ gomp_task_maybe_wait_for_dependencies (v - } - } + } + } else - /* All tasks we are waiting for are already running - in other threads. Wait for them. */ @@ -4089,13 +4089,13 @@ + threads, or they are tasks that have not had their + dependencies met (so they're not even in the queue). Wait + for them. */ - taskwait.in_depend_wait = true; + taskwait.in_depend_wait = true; gomp_mutex_unlock (&team->task_lock); if (do_wake) @@ -1014,7 +1589,28 @@ gomp_task_maybe_wait_for_dependencies (v if (child_task) - { - thr->task = child_task; + { + thr->task = child_task; - child_task->fn (child_task->fn_data); + if (__builtin_expect (child_task->fn == NULL, 0)) + { @@ -4119,13 +4119,13 @@ + } + else + child_task->fn (child_task->fn_data); - thr->task = task; - } + thr->task = task; + } else @@ -1027,16 +1623,13 @@ gomp_task_maybe_wait_for_dependencies (v - = gomp_task_run_post_handle_depend (child_task, team); - if (child_task->parent_depends_on) - --taskwait.n_depend; + = gomp_task_run_post_handle_depend (child_task, team); + if (child_task->parent_depends_on) + --taskwait.n_depend; - child_task->prev_child->next_child = child_task->next_child; - child_task->next_child->prev_child = child_task->prev_child; - if (task->children == child_task) @@ -4143,12 +4143,12 @@ + child_task->pnode[PQ_CHILDREN].prev = NULL; + + gomp_clear_parent (&child_task->children_queue); - gomp_task_run_post_remove_taskgroup (child_task); - to_free = child_task; - child_task = NULL; + gomp_task_run_post_remove_taskgroup (child_task); + to_free = child_task; + child_task = NULL; @@ -1069,14 +1662,14 @@ GOMP_taskgroup_start (void) struct gomp_taskgroup *taskgroup; - + /* If team is NULL, all tasks are executed as - GOMP_TASK_IFFALSE tasks and thus all children tasks of + GOMP_TASK_UNDEFERRED tasks and thus all children tasks of @@ -4178,13 +4178,13 @@ + gomp_team_barrier_wait (&team->barrier); + return; + } - + /* The acquire barrier on load of taskgroup->num_children here synchronizes with the write of 0 in gomp_task_run_post_remove_taskgroup. @@ -1108,19 +1712,25 @@ GOMP_taskgroup_end (void) if (__atomic_load_n (&taskgroup->num_children, MEMMODEL_ACQUIRE) == 0) goto finish; - + + bool unused; gomp_mutex_lock (&team->task_lock); while (1) @@ -4193,13 +4193,13 @@ - if (taskgroup->children == NULL) + if (priority_queue_empty_p (&taskgroup->taskgroup_queue, + MEMMODEL_RELAXED)) - { - if (taskgroup->num_children) - { + { + if (taskgroup->num_children) + { - if (task->children == NULL) + if (priority_queue_empty_p (&task->children_queue, + MEMMODEL_RELAXED)) - goto do_wait; + goto do_wait; - child_task = task->children; - } - else @@ -4209,43 +4209,43 @@ + &unused); + } + else - { - gomp_mutex_unlock (&team->task_lock); - if (to_free) + { + gomp_mutex_unlock (&team->task_lock); + if (to_free) @@ -1132,12 +1742,13 @@ GOMP_taskgroup_end (void) - } - } + } + } else - child_task = taskgroup->children; + child_task + = priority_queue_next_task (PQ_TASKGROUP, &taskgroup->taskgroup_queue, + PQ_TEAM, &team->task_queue, &unused); if (child_task->kind == GOMP_TASK_WAITING) - { - cancelled + { + cancelled - = gomp_task_run_pre (child_task, child_task->parent, taskgroup, - team); + = gomp_task_run_pre (child_task, child_task->parent, team); - if (__builtin_expect (cancelled, 0)) - { - if (to_free) + if (__builtin_expect (cancelled, 0)) + { + if (to_free) @@ -1153,8 +1764,10 @@ GOMP_taskgroup_end (void) - { - child_task = NULL; - do_wait: + { + child_task = NULL; + do_wait: - /* All tasks we are waiting for are already running - in other threads. Wait for them. */ + /* All tasks we are waiting for are either running in other + threads, or they are tasks that have not had their + dependencies met (so they're not even in the queue). Wait + for them. */ - taskgroup->in_taskgroup_wait = true; - } + taskgroup->in_taskgroup_wait = true; + } gomp_mutex_unlock (&team->task_lock); @@ -1172,7 +1785,28 @@ GOMP_taskgroup_end (void) if (child_task) - { - thr->task = child_task; + { + thr->task = child_task; - child_task->fn (child_task->fn_data); + if (__builtin_expect (child_task->fn == NULL, 0)) + { @@ -4269,28 +4269,28 @@ + } + else + child_task->fn (child_task->fn_data); - thr->task = task; - } + thr->task = task; + } else @@ -1184,7 +1818,7 @@ GOMP_taskgroup_end (void) - size_t new_tasks - = gomp_task_run_post_handle_depend (child_task, team); - gomp_task_run_post_remove_parent (child_task); + size_t new_tasks + = gomp_task_run_post_handle_depend (child_task, team); + gomp_task_run_post_remove_parent (child_task); - gomp_clear_parent (child_task->children); + gomp_clear_parent (&child_task->children_queue); - gomp_task_run_post_remove_taskgroup (child_task); - to_free = child_task; - child_task = NULL; + gomp_task_run_post_remove_taskgroup (child_task); + to_free = child_task; + child_task = NULL; --- libgomp/libgomp_g.h.jj 2014-05-15 10:56:31.429532978 +0200 +++ libgomp/libgomp_g.h 2016-07-13 16:57:04.422535521 +0200 @@ -29,6 +29,7 @@ #define LIBGOMP_G_H 1 - + #include +#include - + /* barrier.c */ - + @@ -50,6 +51,10 @@ extern bool GOMP_loop_static_start (long extern bool GOMP_loop_dynamic_start (long, long, long, long, long *, long *); extern bool GOMP_loop_guided_start (long, long, long, long, long *, long *); @@ -4299,21 +4299,21 @@ + long *, long *); +extern bool GOMP_loop_nonmonotonic_guided_start (long, long, long, long, + long *, long *); - + extern bool GOMP_loop_ordered_static_start (long, long, long, long, - long *, long *); + long *, long *); @@ -63,12 +68,23 @@ extern bool GOMP_loop_static_next (long extern bool GOMP_loop_dynamic_next (long *, long *); extern bool GOMP_loop_guided_next (long *, long *); extern bool GOMP_loop_runtime_next (long *, long *); +extern bool GOMP_loop_nonmonotonic_dynamic_next (long *, long *); +extern bool GOMP_loop_nonmonotonic_guided_next (long *, long *); - + extern bool GOMP_loop_ordered_static_next (long *, long *); extern bool GOMP_loop_ordered_dynamic_next (long *, long *); extern bool GOMP_loop_ordered_guided_next (long *, long *); extern bool GOMP_loop_ordered_runtime_next (long *, long *); - + +extern bool GOMP_loop_doacross_static_start (unsigned, long *, long, long *, + long *); +extern bool GOMP_loop_doacross_dynamic_start (unsigned, long *, long, long *, @@ -4324,25 +4324,25 @@ + long *); + extern void GOMP_parallel_loop_static_start (void (*)(void *), void *, - unsigned, long, long, long, long); + unsigned, long, long, long, long); extern void GOMP_parallel_loop_dynamic_start (void (*)(void *), void *, @@ -89,6 +105,12 @@ extern void GOMP_parallel_loop_guided (v extern void GOMP_parallel_loop_runtime (void (*)(void *), void *, - unsigned, long, long, long, - unsigned); + unsigned, long, long, long, + unsigned); +extern void GOMP_parallel_loop_nonmonotonic_dynamic (void (*)(void *), void *, + unsigned, long, long, + long, long, unsigned); +extern void GOMP_parallel_loop_nonmonotonic_guided (void (*)(void *), void *, + unsigned, long, long, + long, long, unsigned); - + extern void GOMP_loop_end (void); extern void GOMP_loop_end_nowait (void); @@ -119,6 +141,18 @@ extern bool GOMP_loop_ull_runtime_start - unsigned long long, - unsigned long long *, - unsigned long long *); + unsigned long long, + unsigned long long *, + unsigned long long *); +extern bool GOMP_loop_ull_nonmonotonic_dynamic_start (bool, unsigned long long, + unsigned long long, + unsigned long long, @@ -4355,24 +4355,24 @@ + unsigned long long, + unsigned long long *, + unsigned long long *); - + extern bool GOMP_loop_ull_ordered_static_start (bool, unsigned long long, - unsigned long long, + unsigned long long, @@ -152,6 +186,10 @@ extern bool GOMP_loop_ull_guided_next (u - unsigned long long *); + unsigned long long *); extern bool GOMP_loop_ull_runtime_next (unsigned long long *, - unsigned long long *); + unsigned long long *); +extern bool GOMP_loop_ull_nonmonotonic_dynamic_next (unsigned long long *, + unsigned long long *); +extern bool GOMP_loop_ull_nonmonotonic_guided_next (unsigned long long *, + unsigned long long *); - + extern bool GOMP_loop_ull_ordered_static_next (unsigned long long *, - unsigned long long *); + unsigned long long *); @@ -162,10 +200,34 @@ extern bool GOMP_loop_ull_ordered_guided extern bool GOMP_loop_ull_ordered_runtime_next (unsigned long long *, - unsigned long long *); - + unsigned long long *); + +extern bool GOMP_loop_ull_doacross_static_start (unsigned, + unsigned long long *, + unsigned long long, @@ -4394,19 +4394,19 @@ + unsigned long long *); + /* ordered.c */ - + extern void GOMP_ordered_start (void); extern void GOMP_ordered_end (void); +extern void GOMP_doacross_post (long *); +extern void GOMP_doacross_wait (long, ...); +extern void GOMP_doacross_ull_post (unsigned long long *); +extern void GOMP_doacross_ull_wait (unsigned long long, ...); - + /* parallel.c */ - + @@ -178,7 +240,15 @@ extern bool GOMP_cancellation_point (int /* task.c */ - + extern void GOMP_task (void (*) (void *), void *, void (*) (void *, void *), - long, long, bool, unsigned, void **); + long, long, bool, unsigned, void **, int); @@ -4422,25 +4422,25 @@ extern void GOMP_taskyield (void); extern void GOMP_taskgroup_start (void); @@ -206,11 +276,38 @@ extern void GOMP_single_copy_end (void * - + extern void GOMP_target (int, void (*) (void *), const void *, - size_t, void **, size_t *, unsigned char *); + size_t, void **, size_t *, unsigned char *); +extern void GOMP_target_ext (int, void (*) (void *), size_t, void **, size_t *, + unsigned short *, unsigned int, void **, void **); extern void GOMP_target_data (int, const void *, - size_t, void **, size_t *, unsigned char *); + size_t, void **, size_t *, unsigned char *); +extern void GOMP_target_data_ext (int, size_t, void **, size_t *, + unsigned short *); extern void GOMP_target_end_data (void); extern void GOMP_target_update (int, const void *, - size_t, void **, size_t *, unsigned char *); + size_t, void **, size_t *, unsigned char *); +extern void GOMP_target_update_ext (int, size_t, void **, size_t *, + unsigned short *, unsigned int, void **); +extern void GOMP_target_enter_exit_data (int, size_t, void **, size_t *, + unsigned short *, unsigned int, + void **); extern void GOMP_teams (unsigned int, unsigned int); - + +/* oacc-parallel.c */ + +extern void GOACC_parallel_keyed (int, void (*) (void *), size_t, @@ -4463,9 +4463,9 @@ --- libgomp/libgomp.h.jj 2014-08-01 15:59:49.145188127 +0200 +++ libgomp/libgomp.h 2016-07-14 17:40:24.038243456 +0200 @@ -34,12 +34,35 @@ - #ifndef LIBGOMP_H + #ifndef LIBGOMP_H #define LIBGOMP_H 1 - + +#ifndef _LIBGOMP_CHECKING_ +/* Define to 1 to perform internal sanity checks. */ +#define _LIBGOMP_CHECKING_ 0 @@ -4474,7 +4474,7 @@ #include "config.h" #include "gstdint.h" +#include "libgomp-plugin.h" - + #include #include #include @@ -4495,13 +4495,13 @@ +# endif +# endif +#endif - + #ifdef HAVE_ATTRIBUTE_VISIBILITY # pragma GCC visibility push(hidden) @@ -56,6 +79,44 @@ enum memmodel MEMMODEL_SEQ_CST = 5 }; - + +/* alloc.c */ + +extern void *gomp_malloc (size_t) __attribute__((malloc)); @@ -4546,7 +4546,7 @@ @@ -74,6 +135,44 @@ enum gomp_schedule_type GFS_AUTO }; - + +struct gomp_doacross_work_share +{ + union { @@ -4591,7 +4591,7 @@ @@ -105,13 +204,18 @@ struct gomp_work_share }; }; - + - /* This is a circular queue that details which threads will be allowed - into the ordered region and in which order. When a thread allocates - iterations on which it is going to work, it also registers itself at @@ -4611,7 +4611,7 @@ + /* This is a pointer to DOACROSS work share data. */ + struct gomp_doacross_work_share *doacross; + }; - + /* This is the number of threads that have registered themselves in the circular queue ordered_team_ids. */ @@ -230,7 +334,7 @@ struct gomp_task_icv @@ -4638,7 +4638,7 @@ +extern int gomp_debug_var; +extern int goacc_device_num; +extern char *goacc_device_type; - + enum gomp_task_kind { + /* Implicit task. */ @@ -4657,7 +4657,7 @@ + unmapping. */ + GOMP_TASK_ASYNC_RUNNING }; - + -struct gomp_task; -struct gomp_taskgroup; -struct htab; @@ -4683,9 +4683,9 @@ - struct gomp_task *last_parent_depends_on; gomp_sem_t taskwait_sem; }; - + @@ -299,20 +415,31 @@ struct gomp_taskwait - + struct gomp_task { + /* Parent of this task. */ @@ -4735,7 +4735,7 @@ + is the number of items available. */ struct gomp_task_depend_entry depend[]; }; - + +/* This structure describes a single #pragma omp taskgroup. */ + struct gomp_taskgroup @@ -4749,7 +4749,7 @@ gomp_sem_t taskgroup_sem; size_t num_children; }; - + +/* Various state of OpenMP async offloading tasks. */ +enum gomp_target_task_state +{ @@ -4785,7 +4785,7 @@ constructs that the team encounters. */ @@ -396,7 +561,8 @@ struct gomp_team struct gomp_work_share work_shares[8]; - + gomp_mutex_t task_lock; - struct gomp_task *task_queue; + /* Scheduled tasks. */ @@ -4825,9 +4825,9 @@ -extern void gomp_fatal (const char *, ...) - __attribute__((noreturn, format (printf, 1, 2))); +extern void gomp_get_place_proc_ids_8 (int, int64_t *); - + /* iter.c */ - + @@ -572,6 +725,9 @@ extern void gomp_ordered_next (void); extern void gomp_ordered_static_init (void); extern void gomp_ordered_static_next (void); @@ -4835,11 +4835,11 @@ +extern void gomp_doacross_init (unsigned, long *, long); +extern void gomp_doacross_ull_init (unsigned, unsigned long long *, + unsigned long long); - + /* parallel.c */ - + @@ -588,6 +744,12 @@ extern void gomp_init_task (struct gomp_ - struct gomp_task_icv *); + struct gomp_task_icv *); extern void gomp_end_task (void); extern void gomp_barrier_handle_tasks (gomp_barrier_state_t); +extern void gomp_task_maybe_wait_for_dependencies (void **); @@ -4848,13 +4848,13 @@ + size_t *, unsigned short *, unsigned int, + void **, void **, + enum gomp_target_task_state); - + static void inline gomp_finish_task (struct gomp_task *task) @@ -606,7 +768,213 @@ extern void gomp_free_thread (void *); - + /* target.c */ - + +extern void gomp_init_targets_once (void); extern int gomp_get_num_devices (void); +extern bool gomp_target_task_fn (void *); @@ -5062,13 +5062,13 @@ +extern void gomp_init_device (struct gomp_device_descr *); +extern void gomp_free_memmap (struct splay_tree_s *); +extern void gomp_unload_device (struct gomp_device_descr *); - + /* work.c */ - + @@ -646,8 +1014,28 @@ typedef enum omp_proc_bind_t omp_proc_bind_spread = 4 } omp_proc_bind_t; - + +typedef enum omp_lock_hint_t +{ + omp_lock_hint_none = 0, @@ -5091,12 +5091,12 @@ +extern int omp_get_place_num (void) __GOMP_NOTHROW; +extern int omp_get_partition_num_places (void) __GOMP_NOTHROW; +extern void omp_get_partition_place_nums (int *) __GOMP_NOTHROW; - + extern void omp_set_default_device (int) __GOMP_NOTHROW; extern int omp_get_default_device (void) __GOMP_NOTHROW; @@ -656,6 +1044,24 @@ extern int omp_get_num_teams (void) __GO extern int omp_get_team_num (void) __GOMP_NOTHROW; - + extern int omp_is_initial_device (void) __GOMP_NOTHROW; +extern int omp_get_initial_device (void) __GOMP_NOTHROW; +extern int omp_get_max_task_priority (void) __GOMP_NOTHROW; @@ -5115,14 +5115,14 @@ + __GOMP_NOTHROW; +extern int omp_target_associate_ptr (void *, void *, __SIZE_TYPE__, + __SIZE_TYPE__, int) __GOMP_NOTHROW; -+extern int omp_target_disassociate_ptr (void *, int) __GOMP_NOTHROW; - ++extern int omp_target_disassociate_ptr (void *, int) __GOMP_NOTHROW; + #if !defined (HAVE_ATTRIBUTE_VISIBILITY) \ || !defined (HAVE_ATTRIBUTE_ALIAS) \ @@ -728,4 +1134,34 @@ extern int gomp_test_nest_lock_25 (omp_n # define ialias_call(fn) fn #endif - + +/* Helper function for priority_node_to_task() and + task_to_priority_node(). + @@ -5157,7 +5157,7 @@ --- libgomp/env.c.jj 2014-05-15 10:56:32.420522486 +0200 +++ libgomp/env.c 2016-07-13 16:57:04.437535335 +0200 @@ -27,6 +27,8 @@ - + #include "libgomp.h" #include "libgomp_f.h" +#include "oacc-int.h" @@ -5175,7 +5175,7 @@ .dyn_var = false, .nest_var = false, @@ -66,6 +68,7 @@ struct gomp_task_icv gomp_global_icv = { - + unsigned long gomp_max_active_levels_var = INT_MAX; bool gomp_cancel_var = false; +int gomp_max_task_priority_var = 0; @@ -5189,31 +5189,31 @@ +int gomp_debug_var; +char *goacc_device_type; +int goacc_device_num; - + /* Parse the OMP_SCHEDULE environment variable. */ - + @@ -118,7 +124,7 @@ parse_schedule (void) ++env; if (*env == '\0') { - gomp_global_icv.run_sched_modifier + gomp_global_icv.run_sched_chunk_size - = gomp_global_icv.run_sched_var != GFS_STATIC; + = gomp_global_icv.run_sched_var != GFS_STATIC; return; } @@ -144,7 +150,7 @@ parse_schedule (void) - + if (value == 0 && gomp_global_icv.run_sched_var != GFS_STATIC) value = 1; - gomp_global_icv.run_sched_modifier = value; + gomp_global_icv.run_sched_chunk_size = value; return; - + unknown: @@ -1011,6 +1017,16 @@ parse_affinity (bool ignore) return false; } - + +static void +parse_acc_device_type (void) +{ @@ -5224,25 +5224,25 @@ + else + goacc_device_type = NULL; +} - + static void handle_omp_display_env (unsigned long stacksize, int wait_policy) @@ -1054,7 +1070,7 @@ handle_omp_display_env (unsigned long st - + fputs ("\nOPENMP DISPLAY ENVIRONMENT BEGIN\n", stderr); - + - fputs (" _OPENMP = '201307'\n", stderr); + fputs (" _OPENMP = '201511'\n", stderr); fprintf (stderr, " OMP_DYNAMIC = '%s'\n", - gomp_global_icv.dyn_var ? "TRUE" : "FALSE"); + gomp_global_icv.dyn_var ? "TRUE" : "FALSE"); fprintf (stderr, " OMP_NESTED = '%s'\n", @@ -1142,6 +1158,8 @@ handle_omp_display_env (unsigned long st - gomp_cancel_var ? "TRUE" : "FALSE"); + gomp_cancel_var ? "TRUE" : "FALSE"); fprintf (stderr, " OMP_DEFAULT_DEVICE = '%d'\n", - gomp_global_icv.default_device_var); + gomp_global_icv.default_device_var); + fprintf (stderr, " OMP_MAX_TASK_PRIORITY = '%d'\n", + gomp_max_task_priority_var); - + if (verbose) { @@ -1174,6 +1192,7 @@ initialize_env (void) @@ -5251,11 +5251,11 @@ parse_int ("OMP_DEFAULT_DEVICE", &gomp_global_icv.default_device_var, true); + parse_int ("OMP_MAX_TASK_PRIORITY", &gomp_max_task_priority_var, true); parse_unsigned_long ("OMP_MAX_ACTIVE_LEVELS", &gomp_max_active_levels_var, - true); + true); if (parse_unsigned_long ("OMP_THREAD_LIMIT", &thread_limit_var, false)) @@ -1181,6 +1200,7 @@ initialize_env (void) gomp_global_icv.thread_limit_var - = thread_limit_var > INT_MAX ? UINT_MAX : thread_limit_var; + = thread_limit_var > INT_MAX ? UINT_MAX : thread_limit_var; } + parse_int ("GOMP_DEBUG", &gomp_debug_var, true); #ifndef HAVE_SYNC_BUILTINS @@ -5263,7 +5263,7 @@ #endif @@ -1271,6 +1291,15 @@ initialize_env (void) } - + handle_omp_display_env (stacksize, wait_policy); + + /* OpenACC. */ @@ -5275,11 +5275,11 @@ + + goacc_runtime_initialize (); } - + @@ -1312,21 +1341,21 @@ omp_get_nested (void) } - + void -omp_set_schedule (omp_sched_t kind, int modifier) +omp_set_schedule (omp_sched_t kind, int chunk_size) @@ -5308,7 +5308,7 @@ break; @@ -1337,11 +1366,11 @@ omp_set_schedule (omp_sched_t kind, int } - + void -omp_get_schedule (omp_sched_t *kind, int *modifier) +omp_get_schedule (omp_sched_t *kind, int *chunk_size) @@ -5318,12 +5318,12 @@ - *modifier = icv->run_sched_modifier; + *chunk_size = icv->run_sched_chunk_size; } - + int @@ -1377,6 +1406,12 @@ omp_get_cancellation (void) return gomp_cancel_var; } - + +int +omp_get_max_task_priority (void) +{ @@ -5336,7 +5336,7 @@ @@ -1425,6 +1460,59 @@ omp_is_initial_device (void) return 1; } - + +int +omp_get_initial_device (void) +{ @@ -6723,13 +6723,13 @@ + struct goacc_thread *thr = goacc_thread (); + struct gomp_device_descr *acc_dev = NULL, *base_dev = NULL; + int num_devices; -+ ++ + if (thr && thr->dev && (thr->dev->target_id == ord || ord < 0)) + return; -+ ++ + if (ord < 0) + ord = goacc_device_num; -+ ++ + /* Decide which type of device to use. If the current thread has a device + type already (e.g. set by acc_set_device_type), use that, else use the + global default. */ @@ -6740,22 +6740,22 @@ + assert (cached_base_dev); + base_dev = cached_base_dev; + } -+ ++ + num_devices = base_dev->get_num_devices_func (); + if (num_devices <= 0 || ord >= num_devices) + acc_dev_num_out_of_range (acc_device_type (base_dev->type), ord, + num_devices); -+ ++ + if (!thr) + thr = goacc_new_thread (); -+ ++ + thr->base_dev = base_dev; + thr->dev = acc_dev = &base_dev[ord]; + thr->saved_bound_dev = NULL; -+ ++ + thr->target_tls + = acc_dev->openacc.create_thread_data_func (ord); -+ ++ + acc_dev->openacc.async_set_async_func (acc_async_sync); +} + @@ -6770,7 +6770,7 @@ + cached_base_dev = acc_init_1 (d); + + gomp_mutex_unlock (&acc_device_lock); -+ ++ + goacc_attach_host_thread_to_device (-1); +} + @@ -6929,7 +6929,7 @@ + + goacc_attach_host_thread_to_device (ord); + } -+ ++ + goacc_device_num = ord; +} + @@ -6986,7 +6986,7 @@ +} + +/* This is called from any OpenACC support function that may need to implicitly -+ initialize the libgomp runtime, either globally or from a new host thread. ++ initialize the libgomp runtime, either globally or from a new host thread. + On exit "goacc_thread" will return a valid & populated thread block. */ + +attribute_hidden void @@ -7515,7 +7515,7 @@ + while (num_waits--) + { + int qid = va_arg (*ap, int); -+ ++ + if (acc_async_test (qid)) + continue; + @@ -7678,7 +7678,7 @@ + + if (thr && thr->dev && thr->dev->openacc.cuda.get_current_context_func) + return thr->dev->openacc.cuda.get_current_context_func (); -+ ++ + return NULL; +} + @@ -7692,7 +7692,7 @@ + + if (thr && thr->dev && thr->dev->openacc.cuda.get_stream_func) + return thr->dev->openacc.cuda.get_stream_func (async); -+ ++ + return NULL; +} + diff --git a/SOURCES/gcc48-libgomp-omp_h-multilib.patch b/SOURCES/gcc48-libgomp-omp_h-multilib.patch index ecc9f2b0..d0e98d19 100644 --- a/SOURCES/gcc48-libgomp-omp_h-multilib.patch +++ b/SOURCES/gcc48-libgomp-omp_h-multilib.patch @@ -5,12 +5,13 @@ --- libgomp/omp.h.in.jj 2008-06-09 13:34:05.000000000 +0200 +++ libgomp/omp.h.in 2008-06-09 13:34:48.000000000 +0200 @@ -42,8 +42,8 @@ typedef struct - + typedef struct { -- unsigned char _x[@OMP_NEST_LOCK_SIZE@] +- unsigned char _x[@OMP_NEST_LOCK_SIZE@] - __attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@))); -+ unsigned char _x[8 + sizeof (void *)] ++ unsigned char _x[8 + sizeof (void *)] + __attribute__((__aligned__(sizeof (void *)))); } omp_nest_lock_t; #endif + diff --git a/SOURCES/gcc48-libtool-no-rpath.patch b/SOURCES/gcc48-libtool-no-rpath.patch index a17357aa..466c661e 100644 --- a/SOURCES/gcc48-libtool-no-rpath.patch +++ b/SOURCES/gcc48-libtool-no-rpath.patch @@ -2,26 +2,26 @@ libtool sucks. --- ltmain.sh.jj 2007-12-07 14:53:21.000000000 +0100 +++ ltmain.sh 2008-09-05 21:51:48.000000000 +0200 @@ -5394,6 +5394,7 @@ EOF - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then @@ -6071,6 +6072,7 @@ EOF rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do + case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then @@ -6120,6 +6122,7 @@ EOF rpath= hardcode_libdirs= for libdir in $finalize_rpath; do + case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then diff --git a/SOURCES/gcc48-no-add-needed.patch b/SOURCES/gcc48-no-add-needed.patch index c9305131..b6ca777e 100644 --- a/SOURCES/gcc48-no-add-needed.patch +++ b/SOURCES/gcc48-no-add-needed.patch @@ -23,28 +23,28 @@ #undef LINK_EH_SPEC -#define LINK_EH_SPEC "" +#define LINK_EH_SPEC "--no-add-needed " - + /* Put all *tf routines in libgcc. */ #undef LIBGCC2_HAS_TF_MODE --- gcc/config/gnu-user.h.jj 2011-01-03 12:53:03.739057299 +0100 +++ gcc/config/gnu-user.h 2011-01-04 18:14:10.932814884 +0100 @@ -82,7 +82,7 @@ see the files COPYING3 and COPYING.RUNTI #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC - + #if defined(HAVE_LD_EH_FRAME_HDR) -#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " +#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} " #endif - + #undef LINK_GCC_C_SEQUENCE_SPEC --- gcc/config/rs6000/sysv4.h.jj 2011-01-03 13:02:18.255994215 +0100 +++ gcc/config/rs6000/sysv4.h 2011-01-04 18:14:10.933888871 +0100 @@ -820,7 +820,7 @@ extern int fixuplabelno; -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" - + #if defined(HAVE_LD_EH_FRAME_HDR) -# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " +# define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} " #endif - + #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \ diff --git a/SOURCES/gcc48-ppc32-retaddr.patch b/SOURCES/gcc48-ppc32-retaddr.patch index 28f6363b..e906dad0 100644 --- a/SOURCES/gcc48-ppc32-retaddr.patch +++ b/SOURCES/gcc48-ppc32-retaddr.patch @@ -14,7 +14,7 @@ { + rtx x; cfun->machine->ra_needs_full_frame = 1; - + - return - gen_rtx_MEM - (Pmode, @@ -39,7 +39,7 @@ + x = plus_constant (Pmode, x, RETURN_ADDRESS_OFFSET); + return gen_rtx_MEM (Pmode, memory_address (Pmode, x)); } - + cfun->machine->ra_need_lr = 1; --- gcc/testsuite/gcc.dg/20051128-1.c.jj 2005-10-10 11:21:41.096999000 +0200 +++ gcc/testsuite/gcc.dg/20051128-1.c 2005-11-28 12:30:57.000000000 +0100 diff --git a/SOURCES/gcc48-pr28865.patch b/SOURCES/gcc48-pr28865.patch index db679100..8e07e945 100644 --- a/SOURCES/gcc48-pr28865.patch +++ b/SOURCES/gcc48-pr28865.patch @@ -19,31 +19,31 @@ @@ -4474,8 +4474,10 @@ static unsigned HOST_WIDE_INT This includes the pseudo-op such as ".int" or ".byte", and a newline. Assumes output_addressed_constants has been done on EXP already. - + - Generate exactly SIZE bytes of assembler data, padding at the end - with zeros if necessary. SIZE must always be specified. + Generate at least SIZE bytes of assembler data, padding at the end + with zeros if necessary. SIZE must always be specified. The returned + value is the actual number of bytes of assembler data generated, which + may be bigger than SIZE if the object contains a variable length field. - + SIZE is important for structure constructors, since trailing members may have been omitted from the constructor. @@ -4490,14 +4492,14 @@ static unsigned HOST_WIDE_INT - + ALIGN is the alignment of the data in bits. */ - + -void +unsigned HOST_WIDE_INT output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align) { enum tree_code code; unsigned HOST_WIDE_INT thissize; - + if (size == 0 || flag_syntax_only) - return; + return size; - + /* See if we're trying to initialize a pointer in a non-default mode to the address of some declaration somewhere. If the target says @@ -4562,7 +4564,7 @@ output_constant (tree exp, unsigned HOST @@ -53,7 +53,7 @@ - return; + return size; } - + if (TREE_CODE (exp) == FDESC_EXPR) @@ -4574,7 +4576,7 @@ output_constant (tree exp, unsigned HOST #else @@ -62,18 +62,18 @@ - return; + return size; } - + /* Now output the underlying data. If we've handling the padding, return. @@ -4612,8 +4614,7 @@ output_constant (tree exp, unsigned HOST switch (TREE_CODE (exp)) - { - case CONSTRUCTOR: + { + case CONSTRUCTOR: - output_constructor (exp, size, align, NULL); - return; + return output_constructor (exp, size, align, NULL); - case STRING_CST: - thissize = MIN ((unsigned HOST_WIDE_INT)TREE_STRING_LENGTH (exp), - size); + case STRING_CST: + thissize = MIN ((unsigned HOST_WIDE_INT)TREE_STRING_LENGTH (exp), + size); @@ -4648,11 +4649,10 @@ output_constant (tree exp, unsigned HOST case RECORD_TYPE: case UNION_TYPE: @@ -81,29 +81,29 @@ - output_constructor (exp, size, align, NULL); - return; + return output_constructor (exp, size, align, NULL); - + case ERROR_MARK: - return; + return 0; - + default: gcc_unreachable (); @@ -4660,6 +4660,8 @@ output_constant (tree exp, unsigned HOST - + if (size > thissize) assemble_zeros (size - thissize); + + return size; } - + @@ -4759,7 +4761,7 @@ output_constructor_array_range (oc_local if (local->val == NULL_TREE) - assemble_zeros (fieldsize); + assemble_zeros (fieldsize); else - output_constant (local->val, fieldsize, align2); + fieldsize = output_constant (local->val, fieldsize, align2); - + /* Count its size. */ local->total_bytes += fieldsize; @@ -4808,9 +4810,8 @@ output_constructor_regular_field (oc_loc @@ -123,7 +123,7 @@ else - output_constant (local->val, fieldsize, align2); + fieldsize = output_constant (local->val, fieldsize, align2); - + /* Count its size. */ local->total_bytes += fieldsize; --- gcc/output.h (revision 206660) @@ -131,18 +131,18 @@ @@ -294,11 +294,13 @@ extern void output_quoted_string (FILE * This includes the pseudo-op such as ".int" or ".byte", and a newline. Assumes output_addressed_constants has been done on EXP already. - + - Generate exactly SIZE bytes of assembler data, padding at the end - with zeros if necessary. SIZE must always be specified. + Generate at least SIZE bytes of assembler data, padding at the end + with zeros if necessary. SIZE must always be specified. The returned + value is the actual number of bytes of assembler data generated, which + may be bigger than SIZE if the object contains a variable length field. - + ALIGN is the alignment in bits that may be assumed for the data. */ -extern void output_constant (tree, unsigned HOST_WIDE_INT, unsigned int); +extern unsigned HOST_WIDE_INT output_constant (tree, unsigned HOST_WIDE_INT, unsigned int); - + /* When outputting delayed branch sequences, this rtx holds the sequence being output. It is null when no delayed branch --- gcc/testsuite/gcc.c-torture/execute/pr28865.c (revision 0) @@ -182,7 +182,7 @@ + since each element has a variable length. GCC allows it + (for the moment) because it is used in existing code, such + as glibc. */ -+static const struct var_len var_array[] = ++static const struct var_len var_array[] = +{ + { 1, "Long exposure noise reduction" }, + { 2, "Shutter/AE lock buttons" }, diff --git a/SOURCES/gcc48-pr38757.patch b/SOURCES/gcc48-pr38757.patch index a8047b70..42065844 100644 --- a/SOURCES/gcc48-pr38757.patch +++ b/SOURCES/gcc48-pr38757.patch @@ -17,7 +17,7 @@ c/ @@ -467,6 +467,10 @@ struct lang_hooks gimplification. */ bool deep_unsharing; - + + /* Return year of the source language standard version if the FE supports + multiple versions of the standard. */ + int (*source_language) (void); @@ -32,7 +32,7 @@ c/ #define LANG_HOOKS_EH_USE_CXA_END_CLEANUP false #define LANG_HOOKS_DEEP_UNSHARING false +#define LANG_HOOKS_SOURCE_LANGUAGE NULL - + /* Attribute hooks. */ #define LANG_HOOKS_ATTRIBUTE_TABLE NULL @@ -303,7 +304,8 @@ extern void lhd_end_section (void); @@ -43,14 +43,14 @@ c/ + LANG_HOOKS_DEEP_UNSHARING, \ + LANG_HOOKS_SOURCE_LANGUAGE \ } - + #endif /* GCC_LANG_HOOKS_DEF_H */ --- gcc/c/c-lang.c.jj 2011-01-03 12:53:05.376056936 +0100 +++ gcc/c/c-lang.c 2011-01-04 17:59:43.167743798 +0100 @@ -36,6 +36,12 @@ along with GCC; see the file COPYING3. - + enum c_language_kind c_language = clk_c; - + +static int +c_source_language (void) +{ @@ -59,14 +59,14 @@ c/ + /* Lang hooks common to C and ObjC are declared in c-objc-common.h; consequently, there should be very few hooks below. */ - + @@ -45,6 +51,8 @@ enum c_language_kind c_language = clk_c; #define LANG_HOOKS_INIT c_objc_common_init #undef LANG_HOOKS_INIT_TS #define LANG_HOOKS_INIT_TS c_common_init_ts +#undef LANG_HOOKS_SOURCE_LANGUAGE +#define LANG_HOOKS_SOURCE_LANGUAGE c_source_language - + /* Each front end provides its own lang hook initializer. */ struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; --- gcc/dwarf2out.c.jj 2011-01-03 12:53:05.102056475 +0100 @@ -91,12 +91,12 @@ c/ + break; + } } - + /* Add an 'abstract_origin' attribute below a given DIE. The DIE is found @@ -18915,6 +18924,10 @@ gen_compile_unit_die (const char *filena - if (strcmp (language_string, "GNU Go") == 0) - language = DW_LANG_Go; - } + if (strcmp (language_string, "GNU Go") == 0) + language = DW_LANG_Go; + } + else if (strcmp (language_string, "GNU C") == 0 + && lang_hooks.source_language + && lang_hooks.source_language () >= 1999) diff --git a/SOURCES/gcc48-pr52714.patch b/SOURCES/gcc48-pr52714.patch index 45894916..2ea553d9 100644 --- a/SOURCES/gcc48-pr52714.patch +++ b/SOURCES/gcc48-pr52714.patch @@ -15,24 +15,24 @@ +++ gcc/combine.c (revision 208204) @@ -3706,6 +3706,9 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx #ifdef HAVE_cc0 - && !reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0)) + && !reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 0)) #endif + /* If I3 is a jump, ensure that set0 is a jump so that + we do not create invalid RTL. */ + && (!JUMP_P (i3) || SET_DEST (XVECEXP (newpat, 0, 0)) == pc_rtx) - ) - { - newi2pat = XVECEXP (newpat, 0, 1); + ) + { + newi2pat = XVECEXP (newpat, 0, 1); @@ -3716,6 +3719,9 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx #ifdef HAVE_cc0 - && !reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 1)) + && !reg_referenced_p (cc0_rtx, XVECEXP (newpat, 0, 1)) #endif + /* If I3 is a jump, ensure that set1 is a jump so that + we do not create invalid RTL. */ + && (!JUMP_P (i3) || SET_DEST (XVECEXP (newpat, 0, 1)) == pc_rtx) - ) - { - newi2pat = XVECEXP (newpat, 0, 0); + ) + { + newi2pat = XVECEXP (newpat, 0, 0); --- gcc/testsuite/gcc.c-torture/compile/pr52714.c (revision 0) +++ gcc/testsuite/gcc.c-torture/compile/pr52714.c (revision 208204) @@ -0,0 +1,25 @@ diff --git a/SOURCES/gcc48-pr53477.patch b/SOURCES/gcc48-pr53477.patch index 4781ad99..70d5d56f 100644 --- a/SOURCES/gcc48-pr53477.patch +++ b/SOURCES/gcc48-pr53477.patch @@ -21,11 +21,11 @@ + value = value.referenced_value() + return self.function(self.name, value) - + # A pretty-printer that conforms to the "PrettyPrinter" protocol from @@ -841,6 +846,11 @@ class Printer(object): return None - + basename = match.group(1) + + if val.type.code == gdb.TYPE_CODE_REF: @@ -34,20 +34,20 @@ + if basename in self.lookup: return self.lookup[basename].invoke(val) - + --- libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc (revision 201887) +++ libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc (revision 201888) @@ -1,5 +1,5 @@ // { dg-do run } -// { dg-options "-std=gnu++11 -g" } +// { dg-options "-std=gnu++11 -g -O0" } - + // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -24,6 +24,8 @@ #include #include - + +typedef std::tuple ExTuple; + template @@ -56,7 +56,7 @@ @@ -62,43 +64,75 @@ main() std::forward_list efl; // { dg-final { note-test efl "empty std::forward_list" } } - + + std::forward_list &refl = efl; +// { dg-final { note-test refl "empty std::forward_list" } } + @@ -64,7 +64,7 @@ fl.push_front(2); fl.push_front(1); // { dg-final { note-test fl {std::forward_list = {[0] = 1, [1] = 2}} } } - + + std::forward_list &rfl = fl; +// { dg-final { note-test rfl {std::forward_list = {[0] = 1, [1] = 2}} } } + @@ -87,12 +87,12 @@ // { dg-final { note-test eums "std::unordered_multiset with 0 elements" } } + std::unordered_multiset &reums = eums; +// { dg-final { note-test reums "std::unordered_multiset with 0 elements" } } - + std::unordered_map uom; uom[5] = "three"; uom[3] = "seven"; // { dg-final { note-test uom {std::unordered_map with 2 elements = {[3] = "seven", [5] = "three"}} } } - + + std::unordered_map &ruom = uom; +// { dg-final { note-test ruom {std::unordered_map with 2 elements = {[3] = "seven", [5] = "three"}} } } + @@ -102,30 +102,30 @@ // { dg-final { note-test uomm {std::unordered_multimap with 2 elements = {[5] = "seven", [5] = "three"}} } } + std::unordered_multimap &ruomm = uomm; +// { dg-final { note-test ruomm {std::unordered_multimap with 2 elements = {[5] = "seven", [5] = "three"}} } } - + std::unordered_set uos; uos.insert(5); // { dg-final { note-test uos {std::unordered_set with 1 elements = {[0] = 5}} } } + std::unordered_set &ruos = uos; +// { dg-final { note-test ruos {std::unordered_set with 1 elements = {[0] = 5}} } } - + std::unordered_multiset uoms; uoms.insert(5); // { dg-final { note-test uoms {std::unordered_multiset with 1 elements = {[0] = 5}} } } + std::unordered_multiset &ruoms = uoms; +// { dg-final { note-test ruoms {std::unordered_multiset with 1 elements = {[0] = 5}} } } - + std::unique_ptr uptr (new datum); uptr->s = "hi bob"; uptr->i = 23; // { dg-final { regexp-test uptr {std::unique_ptr.datum. containing 0x.*} } } + std::unique_ptr &ruptr = uptr; +// { dg-final { regexp-test ruptr {std::unique_ptr.datum. containing 0x.*} } } - + + ExTuple tpl(6,7); -+// { dg-final { note-test tpl {std::tuple containing = {[1] = 6, [2] = 7}} } } ++// { dg-final { note-test tpl {std::tuple containing = {[1] = 6, [2] = 7}} } } + ExTuple &rtpl = tpl; -+// { dg-final { note-test rtpl {std::tuple containing = {[1] = 6, [2] = 7}} } } ++// { dg-final { note-test rtpl {std::tuple containing = {[1] = 6, [2] = 7}} } } placeholder(""); // Mark SPOT use(efl); use(fl); diff --git a/SOURCES/gcc48-pr56564.patch b/SOURCES/gcc48-pr56564.patch index 003baaba..d81e02d7 100644 --- a/SOURCES/gcc48-pr56564.patch +++ b/SOURCES/gcc48-pr56564.patch @@ -65,7 +65,7 @@ @@ -1062,6 +1062,15 @@ arrays to be word-aligned so that @code{ constants to character arrays can be done inline. @end defmac - + +@defmac DATA_ABI_ALIGNMENT (@var{type}, @var{basic-align}) +Similar to @code{DATA_ALIGNMENT}, but for the cases where the ABI mandates +some alignment increase, instead of optimization only purposes. E.g.@ @@ -83,7 +83,7 @@ @@ -1078,6 +1078,15 @@ arrays to be word-aligned so that @code{ constants to character arrays can be done inline. @end defmac - + +@defmac DATA_ABI_ALIGNMENT (@var{type}, @var{basic-align}) +Similar to @code{DATA_ALIGNMENT}, but for the cases where the ABI mandates +some alignment increase, instead of optimization only purposes. E.g.@ @@ -101,7 +101,7 @@ @@ -966,13 +966,80 @@ align_variable (tree decl, bool dont_out align = MAX_OFILE_ALIGNMENT; } - + - /* On some machines, it is good to increase alignment sometimes. */ if (! DECL_USER_ALIGN (decl)) { @@ -179,31 +179,31 @@ - is too precious. */ + is too precious. */ if (! DECL_THREAD_LOCAL_P (decl) || data_align <= BITS_PER_WORD) - align = data_align; + align = data_align; #endif @@ -989,9 +1056,7 @@ align_variable (tree decl, bool dont_out #endif } - + - /* Reset the alignment in case we have made it tighter, so we can benefit - from it in get_pointer_alignment. */ - DECL_ALIGN (decl) = align; + return align; } - + /* Return the section into which the given VAR_DECL or CONST_DECL @@ -1043,7 +1108,8 @@ get_variable_section (tree decl, bool pr - return bss_noswitch_section; + return bss_noswitch_section; } - + - return targetm.asm_out.select_section (decl, reloc, DECL_ALIGN (decl)); + return targetm.asm_out.select_section (decl, reloc, + get_variable_align (decl)); } - + /* Return the block into which object_block DECL should be placed. */ @@ -1780,7 +1846,8 @@ emit_bss (tree decl ATTRIBUTE_UNUSED, - unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED) + unsigned HOST_WIDE_INT rounded ATTRIBUTE_UNUSED) { #if defined ASM_OUTPUT_ALIGNED_BSS - ASM_OUTPUT_ALIGNED_BSS (asm_out_file, decl, name, size, DECL_ALIGN (decl)); @@ -228,49 +228,49 @@ ASM_OUTPUT_COMMON (asm_out_file, name, size, rounded); @@ -1828,7 +1896,8 @@ emit_tls_common (tree decl ATTRIBUTE_UNU NAME is the name of DECL's SYMBOL_REF. */ - + static void -assemble_noswitch_variable (tree decl, const char *name, section *sect) +assemble_noswitch_variable (tree decl, const char *name, section *sect, + unsigned int align) { unsigned HOST_WIDE_INT size, rounded; - + @@ -1850,7 +1919,7 @@ assemble_noswitch_variable (tree decl, c - * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); - + * (BIGGEST_ALIGNMENT / BITS_PER_UNIT)); + if (!sect->noswitch.callback (decl, name, size, rounded) - && (unsigned HOST_WIDE_INT) DECL_ALIGN_UNIT (decl) > rounded) + && (unsigned HOST_WIDE_INT) (align / BITS_PER_UNIT) > rounded) warning (0, "requested alignment for %q+D is greater than " - "implemented alignment of %wu", decl, rounded); + "implemented alignment of %wu", decl, rounded); } @@ -1880,7 +1949,7 @@ assemble_variable_contents (tree decl, c - /* Output the actual data. */ - output_constant (DECL_INITIAL (decl), - tree_low_cst (DECL_SIZE_UNIT (decl), 1), + /* Output the actual data. */ + output_constant (DECL_INITIAL (decl), + tree_low_cst (DECL_SIZE_UNIT (decl), 1), - DECL_ALIGN (decl)); + get_variable_align (decl)); else - /* Leave space for it. */ - assemble_zeros (tree_low_cst (DECL_SIZE_UNIT (decl), 1)); + /* Leave space for it. */ + assemble_zeros (tree_low_cst (DECL_SIZE_UNIT (decl), 1)); @@ -1904,6 +1973,7 @@ assemble_variable (tree decl, int top_le const char *name; rtx decl_rtl, symbol; section *sect; + unsigned int align; bool asan_protected = false; - + /* This function is supposed to handle VARIABLES. Ensure we have one. */ @@ -2003,6 +2073,8 @@ assemble_variable (tree decl, int top_le - + set_mem_align (decl_rtl, DECL_ALIGN (decl)); - + + align = get_variable_align (decl); + if (TREE_PUBLIC (decl)) maybe_assemble_visibility (decl); - + @@ -2032,12 +2104,12 @@ assemble_variable (tree decl, int top_le place_block_symbol (symbol); } @@ -286,7 +286,7 @@ + ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT)); assemble_variable_contents (decl, name, dont_output_data); if (asan_protected) - { + { @@ -6709,10 +6781,10 @@ bool decl_binds_to_current_def_p (tree decl) { @@ -301,7 +301,7 @@ if (TREE_CODE (decl) == VAR_DECL && (TREE_STATIC (decl) || DECL_EXTERNAL (decl))) @@ -6730,10 +6802,20 @@ decl_binds_to_current_def_p (tree decl) - return resolution_to_local_definition_p (node->symbol.resolution); + return resolution_to_local_definition_p (node->symbol.resolution); } /* Otherwise we have to assume the worst for DECL_WEAK (hidden weaks - binds locally but still can be overwritten). @@ -321,7 +321,7 @@ + return false; + return true; } - + /* A replaceable function or variable is one which may be replaced @@ -6959,7 +7041,7 @@ place_block_symbol (rtx symbol) else @@ -331,16 +331,16 @@ + alignment = get_variable_align (decl); size = tree_low_cst (DECL_SIZE_UNIT (decl), 1); if (flag_asan && asan_protect_global (decl)) - { + { --- gcc/config/s390/s390.h (revision 199897) +++ gcc/config/s390/s390.h (revision 199898) @@ -221,7 +221,7 @@ enum processor_flags - + /* Alignment on even addresses for LARL instruction. */ #define CONSTANT_ALIGNMENT(EXP, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN) -#define DATA_ALIGNMENT(TYPE, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN) +#define DATA_ABI_ALIGNMENT(TYPE, ALIGN) (ALIGN) < 16 ? 16 : (ALIGN) - + /* Alignment is not required by the hardware. */ #define STRICT_ALIGNMENT 0 --- gcc/config/i386/i386.h (revision 199897) @@ -348,7 +348,7 @@ @@ -859,7 +859,18 @@ enum target_cpu_default cause character arrays to be word-aligned so that `strcpy' calls that copy constants to character arrays can be done inline. */ - + -#define DATA_ALIGNMENT(TYPE, ALIGN) ix86_data_alignment ((TYPE), (ALIGN)) +#define DATA_ALIGNMENT(TYPE, ALIGN) \ + ix86_data_alignment ((TYPE), (ALIGN), true) @@ -362,32 +362,32 @@ + +#define DATA_ABI_ALIGNMENT(TYPE, ALIGN) \ + ix86_data_alignment ((TYPE), (ALIGN), false) - + /* If defined, a C expression to compute the alignment for a local variable. TYPE is the data type, and ALIGN is the alignment that --- gcc/config/i386/i386-protos.h (revision 199897) +++ gcc/config/i386/i386-protos.h (revision 199898) @@ -207,7 +207,7 @@ extern void init_cumulative_args (CUMULA #endif /* RTX_CODE */ - + #ifdef TREE_CODE -extern int ix86_data_alignment (tree, int); +extern int ix86_data_alignment (tree, int, bool); extern unsigned int ix86_local_alignment (tree, enum machine_mode, - unsigned int); + unsigned int); extern unsigned int ix86_minimum_alignment (tree, enum machine_mode, --- gcc/config/i386/i386.c (revision 199897) +++ gcc/config/i386/i386.c (revision 199898) @@ -25292,12 +25292,13 @@ ix86_constant_alignment (tree exp, int a instead of that alignment to align the object. */ - + int -ix86_data_alignment (tree type, int align) +ix86_data_alignment (tree type, int align, bool opt) { int max_align = optimize_size ? BITS_PER_WORD : MIN (256, MAX_OFILE_ALIGNMENT); - + - if (AGGREGATE_TYPE_P (type) + if (opt + && AGGREGATE_TYPE_P (type) @@ -408,9 +408,9 @@ + && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST + && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128 + || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128) - return 128; + return 128; } - + + if (!opt) + return align; + @@ -427,24 +427,24 @@ +#define DATA_ABI_ALIGNMENT(TYPE, ALIGN) \ (((ALIGN) < BITS_PER_UNIT * 8 && TREE_CODE (TYPE) == ARRAY_TYPE) \ ? BITS_PER_UNIT * 8 : (ALIGN)) - + --- gcc/config/mmix/mmix.h (revision 199897) +++ gcc/config/mmix/mmix.h (revision 199898) @@ -164,7 +164,7 @@ struct GTY(()) machine_function /* Copied from elfos.h. */ #define MAX_OFILE_ALIGNMENT (32768 * 8) - + -#define DATA_ALIGNMENT(TYPE, BASIC_ALIGN) \ +#define DATA_ABI_ALIGNMENT(TYPE, BASIC_ALIGN) \ mmix_data_alignment (TYPE, BASIC_ALIGN) - + #define CONSTANT_ALIGNMENT(CONSTANT, BASIC_ALIGN) \ --- gcc/config/mmix/mmix.c (revision 199897) +++ gcc/config/mmix/mmix.c (revision 199898) @@ -313,7 +313,7 @@ mmix_init_machine_status (void) return ggc_alloc_cleared_machine_function (); } - + -/* DATA_ALIGNMENT. +/* DATA_ABI_ALIGNMENT. We have trouble getting the address of stuff that is located at other @@ -466,45 +466,45 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -ffast-math -mavx -mtune=generic" } */ +/* { dg-options "-O3 -ffast-math -mavx -mtune=generic -fno-common" } */ - + double a[1024]; - + --- gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c (revision 199897) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c (revision 199898) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -dp -mavx -mno-avx256-split-unaligned-load -mno-avx256-split-unaligned-store" } */ +/* { dg-options "-O3 -dp -mavx -mno-avx256-split-unaligned-load -mno-avx256-split-unaligned-store -fno-common" } */ - + #define N 1024 - + --- gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c (revision 199897) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c (revision 199898) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -dp -mavx -mavx256-split-unaligned-store" } */ +/* { dg-options "-O3 -dp -mavx -mavx256-split-unaligned-store -fno-common" } */ - + #define N 1024 - + --- gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c (revision 199897) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c (revision 199898) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -dp -mavx -mavx256-split-unaligned-store -mtune=generic" } */ +/* { dg-options "-O3 -dp -mavx -mavx256-split-unaligned-store -mtune=generic -fno-common" } */ - + #define N 1024 - + --- gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c (revision 199897) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c (revision 199898) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -dp -mavx -mno-avx256-split-unaligned-load -mno-avx256-split-unaligned-store" } */ +/* { dg-options "-O3 -dp -mavx -mno-avx256-split-unaligned-load -mno-avx256-split-unaligned-store -fno-common" } */ - + #define N 1024 - + --- gcc/testsuite/gcc.target/i386/pr56564-1.c (revision 0) +++ gcc/testsuite/gcc.target/i386/pr56564-1.c (revision 199985) @@ -0,0 +1,26 @@ @@ -624,31 +624,31 @@ @@ -18,7 +18,7 @@ struct s{ struct t e; /* unaligned (offset 2N+4N+4 B) */ }; - + -struct s tmp; +struct s tmp = { 1 }; - + int main1 () - { + { --- gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c (revision 199897) +++ gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c (revision 199898) @@ -18,7 +18,7 @@ struct s{ struct t e; /* unaligned (offset 2N+4N+4 B) */ }; - + -struct s tmp; +struct s tmp = { 1 }; - + int main1 () - { + { --- gcc/testsuite/gcc.dg/tree-ssa/loop-19.c (revision 200212) +++ gcc/testsuite/gcc.dg/tree-ssa/loop-19.c (revision 200213) @@ -6,7 +6,7 @@ - + /* { dg-do compile { target { i?86-*-* || { x86_64-*-* || powerpc_hard_double } } } } */ /* { dg-require-effective-target nonpic } */ -/* { dg-options "-O3 -fno-tree-loop-distribute-patterns -fno-prefetch-loop-arrays -fdump-tree-optimized" } */ +/* { dg-options "-O3 -fno-tree-loop-distribute-patterns -fno-prefetch-loop-arrays -fdump-tree-optimized -fno-common" } */ - + # define N 2000000 double a[N],c[N]; diff --git a/SOURCES/gcc48-pr62258.patch b/SOURCES/gcc48-pr62258.patch index 5f736434..4589214e 100644 --- a/SOURCES/gcc48-pr62258.patch +++ b/SOURCES/gcc48-pr62258.patch @@ -14,7 +14,7 @@ @@ -245,6 +245,9 @@ std::rethrow_exception(std::exception_pt __GXX_INIT_DEPENDENT_EXCEPTION_CLASS(dep->unwindHeader.exception_class); dep->unwindHeader.exception_cleanup = __gxx_dependent_exception_cleanup; - + + __cxa_eh_globals *globals = __cxa_get_globals (); + globals->uncaughtExceptions += 1; + diff --git a/SOURCES/gcc48-pr63293.patch b/SOURCES/gcc48-pr63293.patch index e33287db..4b11a8c5 100644 --- a/SOURCES/gcc48-pr63293.patch +++ b/SOURCES/gcc48-pr63293.patch @@ -14,7 +14,7 @@ + /* We need to add memory barrier to prevent read from deallocated stack. */ + bool need_barrier_p = (get_frame_size () != 0 + || cfun->machine->saved_varargs_size); - + aarch64_layout_frame (); original_frame_size = get_frame_size () + cfun->machine->saved_varargs_size; @@ -2030,6 +2033,9 @@ aarch64_expand_epilogue (bool for_sibcal @@ -25,8 +25,8 @@ + emit_insn (gen_stack_tie (stack_pointer_rtx, stack_pointer_rtx)); + insn = emit_insn (gen_add3_insn (stack_pointer_rtx, - hard_frame_pointer_rtx, - GEN_INT (- fp_offset))); + hard_frame_pointer_rtx, + GEN_INT (- fp_offset))); @@ -2048,6 +2054,9 @@ aarch64_expand_epilogue (bool for_sibcal /* Restore the frame pointer and lr if the frame pointer is needed. */ if (offset > 0) @@ -35,26 +35,26 @@ + emit_insn (gen_stack_tie (stack_pointer_rtx, stack_pointer_rtx)); + if (frame_pointer_needed) - { - rtx mem_fp, mem_lr; + { + rtx mem_fp, mem_lr; @@ -2067,6 +2076,10 @@ aarch64_expand_epilogue (bool for_sibcal - + UNITS_PER_WORD)); - emit_insn (gen_load_pairdi (reg_fp, mem_fp, reg_lr, mem_lr)); - + + UNITS_PER_WORD)); + emit_insn (gen_load_pairdi (reg_fp, mem_fp, reg_lr, mem_lr)); + + if (need_barrier_p) + emit_insn (gen_stack_tie (stack_pointer_rtx, + stack_pointer_rtx)); + - insn = emit_insn (gen_add2_insn (stack_pointer_rtx, - GEN_INT (offset))); - } + insn = emit_insn (gen_add2_insn (stack_pointer_rtx, + GEN_INT (offset))); + } @@ -2128,6 +2141,9 @@ aarch64_expand_epilogue (bool for_sibcal - + if (frame_size > -1) { + if (need_barrier_p) + emit_insn (gen_stack_tie (stack_pointer_rtx, stack_pointer_rtx)); + if (frame_size >= 0x1000000) - { - rtx op0 = gen_rtx_REG (Pmode, IP0_REGNUM); + { + rtx op0 = gen_rtx_REG (Pmode, IP0_REGNUM); diff --git a/SOURCES/gcc48-pr65142.patch b/SOURCES/gcc48-pr65142.patch index 0caa8b3e..367ec16f 100644 --- a/SOURCES/gcc48-pr65142.patch +++ b/SOURCES/gcc48-pr65142.patch @@ -10,7 +10,7 @@ +++ libstdc++-v3/src/c++11/random.cc (revision 228424) @@ -126,8 +126,10 @@ namespace std _GLIBCXX_VISIBILITY(defaul #endif - + result_type __ret; - std::fread(reinterpret_cast(&__ret), sizeof(result_type), - 1, _M_file); @@ -20,3 +20,4 @@ + std::__throw_runtime_error(__N("random_device could not be read")); return __ret; } + diff --git a/SOURCES/gcc48-pr66731.patch b/SOURCES/gcc48-pr66731.patch index 8940514d..daf20b34 100644 --- a/SOURCES/gcc48-pr66731.patch +++ b/SOURCES/gcc48-pr66731.patch @@ -15,8 +15,8 @@ +++ gcc/config/aarch64/aarch64.md (revision 226592) @@ -3101,6 +3101,17 @@ (mult:GPF - (neg:GPF (match_operand:GPF 1 "register_operand" "w")) - (match_operand:GPF 2 "register_operand" "w")))] + (neg:GPF (match_operand:GPF 1 "register_operand" "w")) + (match_operand:GPF 2 "register_operand" "w")))] + "TARGET_FLOAT && !flag_rounding_math" + "fnmul\\t%0, %1, %2" + [(set_attr "v8type" "fmul") diff --git a/SOURCES/gcc48-pr66840.patch b/SOURCES/gcc48-pr66840.patch new file mode 100644 index 00000000..721ee030 --- /dev/null +++ b/SOURCES/gcc48-pr66840.patch @@ -0,0 +1,16 @@ +2015-07-14 Matthias Klose + + PR target/66840 + * config/rs6000/t-rs6000 (TM_H): Add rs6000-cpus.def. + +diff -Nrup a/gcc/config/rs6000/t-rs6000 b/gcc/config/rs6000/t-rs6000 +--- /gcc/config/rs6000/t-rs6000 2013-08-14 05:55:11.000000000 -0600 ++++ gcc/config/rs6000/t-rs6000 2018-04-18 12:09:30.614737081 -0600 +@@ -19,6 +19,7 @@ + # . + + TM_H += $(srcdir)/config/rs6000/rs6000-builtin.def ++TM_H += $(srcdir)/config/rs6000/rs6000-cpus.def + + rs6000.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(REGS_H) hard-reg-set.h \ diff --git a/SOURCES/gcc48-pr67281.patch b/SOURCES/gcc48-pr67281.patch index 5b5f1f0b..9637e08b 100644 --- a/SOURCES/gcc48-pr67281.patch +++ b/SOURCES/gcc48-pr67281.patch @@ -25,7 +25,7 @@ @@ -16092,6 +16092,28 @@ unsigned int __builtin_tresume (void) unsigned int __builtin_tsuspend (void) @end smallexample - + +Note that the semantics of the above HTM builtins are required to mimic +the locking semantics used for critical sections. Builtins that are used +to create a new transaction or restart a suspended transaction must have @@ -50,12 +50,12 @@ + The following set of built-in functions are available to gain access to the HTM specific special purpose registers. - + --- gcc/config/rs6000/htm.md (revision 226531) +++ gcc/config/rs6000/htm.md (revision 228827) @@ -27,6 +27,14 @@ (define_constants ]) - + ;; +;; UNSPEC usage +;; @@ -67,11 +67,11 @@ +;; ;; UNSPEC_VOLATILE usage ;; - + @@ -45,96 +53,223 @@ (define_c_enum "unspecv" UNSPECV_HTM_MTSPR ]) - + +(define_expand "tabort" + [(parallel + [(set (match_operand:CC 1 "cc_reg_operand" "=x") @@ -83,7 +83,7 @@ + operands[2] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); + MEM_VOLATILE_P (operands[2]) = 1; +}) - + -(define_insn "tabort" +(define_insn "*tabort" [(set (match_operand:CC 1 "cc_reg_operand" "=x") @@ -96,7 +96,7 @@ "tabort. %0" [(set_attr "type" "htm") (set_attr "length" "4")]) - + -(define_insn "tabortc" +(define_expand "tabortc" + [(parallel @@ -114,9 +114,9 @@ + +(define_insn "*tabortc" [(set (match_operand:CC 3 "cc_reg_operand" "=x") - (unspec_volatile:CC [(match_operand 0 "u5bit_cint_operand" "n") - (match_operand:GPR 1 "gpc_reg_operand" "r") - (match_operand:GPR 2 "gpc_reg_operand" "r")] + (unspec_volatile:CC [(match_operand 0 "u5bit_cint_operand" "n") + (match_operand:GPR 1 "gpc_reg_operand" "r") + (match_operand:GPR 2 "gpc_reg_operand" "r")] - UNSPECV_HTM_TABORTXC))] + UNSPECV_HTM_TABORTXC)) + (set (match_operand:BLK 4) (unspec:BLK [(match_dup 4)] UNSPEC_HTM_FENCE))] @@ -124,7 +124,7 @@ "tabortc. %0,%1,%2" [(set_attr "type" "htm") (set_attr "length" "4")]) - + -(define_insn "tabortci" +(define_expand "tabortci" + [(parallel @@ -142,9 +142,9 @@ + +(define_insn "*tabortci" [(set (match_operand:CC 3 "cc_reg_operand" "=x") - (unspec_volatile:CC [(match_operand 0 "u5bit_cint_operand" "n") - (match_operand:GPR 1 "gpc_reg_operand" "r") - (match_operand 2 "s5bit_cint_operand" "n")] + (unspec_volatile:CC [(match_operand 0 "u5bit_cint_operand" "n") + (match_operand:GPR 1 "gpc_reg_operand" "r") + (match_operand 2 "s5bit_cint_operand" "n")] - UNSPECV_HTM_TABORTXCI))] + UNSPECV_HTM_TABORTXCI)) + (set (match_operand:BLK 4) (unspec:BLK [(match_dup 4)] UNSPEC_HTM_FENCE))] @@ -152,7 +152,7 @@ "tabortci. %0,%1,%2" [(set_attr "type" "htm") (set_attr "length" "4")]) - + -(define_insn "tbegin" +(define_expand "tbegin" + [(parallel @@ -168,7 +168,7 @@ + +(define_insn "*tbegin" [(set (match_operand:CC 1 "cc_reg_operand" "=x") - (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")] + (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")] - UNSPECV_HTM_TBEGIN))] + UNSPECV_HTM_TBEGIN)) + (set (match_operand:BLK 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))] @@ -176,7 +176,7 @@ "tbegin. %0" [(set_attr "type" "htm") (set_attr "length" "4")]) - + -(define_insn "tcheck" +(define_expand "tcheck" + [(parallel @@ -199,7 +199,7 @@ "tcheck %0" [(set_attr "type" "htm") (set_attr "length" "4")]) - + -(define_insn "tend" +(define_expand "tend" + [(parallel @@ -215,7 +215,7 @@ + +(define_insn "*tend" [(set (match_operand:CC 1 "cc_reg_operand" "=x") - (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")] + (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")] - UNSPECV_HTM_TEND))] + UNSPECV_HTM_TEND)) + (set (match_operand:BLK 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))] @@ -223,7 +223,7 @@ "tend. %0" [(set_attr "type" "htm") (set_attr "length" "4")]) - + -(define_insn "trechkpt" +(define_expand "trechkpt" + [(parallel @@ -246,7 +246,7 @@ "trechkpt." [(set_attr "type" "htm") (set_attr "length" "4")]) - + -(define_insn "treclaim" +(define_expand "treclaim" + [(parallel @@ -262,7 +262,7 @@ + +(define_insn "*treclaim" [(set (match_operand:CC 1 "cc_reg_operand" "=x") - (unspec_volatile:CC [(match_operand:SI 0 "gpc_reg_operand" "r")] + (unspec_volatile:CC [(match_operand:SI 0 "gpc_reg_operand" "r")] - UNSPECV_HTM_TRECLAIM))] + UNSPECV_HTM_TRECLAIM)) + (set (match_operand:BLK 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))] @@ -270,7 +270,7 @@ "treclaim. %0" [(set_attr "type" "htm") (set_attr "length" "4")]) - + -(define_insn "tsr" +(define_expand "tsr" + [(parallel @@ -286,7 +286,7 @@ + +(define_insn "*tsr" [(set (match_operand:CC 1 "cc_reg_operand" "=x") - (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")] + (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")] - UNSPECV_HTM_TSR))] + UNSPECV_HTM_TSR)) + (set (match_operand:BLK 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))] @@ -294,7 +294,7 @@ "tsr. %0" [(set_attr "type" "htm") (set_attr "length" "4")]) - + -(define_insn "ttest" +(define_expand "ttest" + [(parallel diff --git a/SOURCES/gcc48-pr68680.patch b/SOURCES/gcc48-pr68680.patch index d6c33aec..59f6ffe4 100644 --- a/SOURCES/gcc48-pr68680.patch +++ b/SOURCES/gcc48-pr68680.patch @@ -9,9 +9,9 @@ --- gcc/calls.c (revision 231278) +++ gcc/calls.c (revision 231279) @@ -564,6 +564,17 @@ special_function_p (const_tree fndecl, i - flags |= ECF_NORETURN; + flags |= ECF_NORETURN; } - + + if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL) + switch (DECL_FUNCTION_CODE (fndecl)) + { @@ -25,7 +25,7 @@ + return flags; } - + --- gcc/testsuite/gcc.target/i386/pr68680.c (revision 0) +++ gcc/testsuite/gcc.target/i386/pr68680.c (revision 231279) @@ -0,0 +1,15 @@ diff --git a/SOURCES/gcc48-pr69116.patch b/SOURCES/gcc48-pr69116.patch index 01da7d45..9b93c790 100644 --- a/SOURCES/gcc48-pr69116.patch +++ b/SOURCES/gcc48-pr69116.patch @@ -10,7 +10,7 @@ @@ -331,14 +331,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return pow(__x, __y); } }; - + + template + struct __fun_with_valarray + { @@ -22,7 +22,7 @@ + { + // No result type defined for invalid value types. + }; - + // We need these bits in order to recover the return type of // some functions/operators now that we're no longer using // function templates. @@ -32,7 +32,7 @@ { - typedef _Tp result_type; }; - + // several specializations for relational operators. --- libstdc++-v3/testsuite/26_numerics/valarray/69116.cc (nonexistent) +++ libstdc++-v3/testsuite/26_numerics/valarray/69116.cc (revision 233265) diff --git a/SOURCES/gcc48-pr69644.patch b/SOURCES/gcc48-pr69644.patch index 09a1ac99..d6731e5d 100644 --- a/SOURCES/gcc48-pr69644.patch +++ b/SOURCES/gcc48-pr69644.patch @@ -15,15 +15,15 @@ @@ -20263,6 +20263,9 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[]) else if (reg_overlap_mentioned_p (retval, oldval)) oldval = copy_to_reg (oldval); - + + if (mode != TImode && !reg_or_short_operand (oldval, mode)) + oldval = copy_to_mode_reg (mode, oldval); + mem = rs6000_pre_atomic_barrier (mem, mod_s); - + label1 = NULL_RTX; @@ -20277,10 +20280,8 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[]) - + x = retval; if (mask) - { @@ -32,7 +32,7 @@ - } + x = expand_simple_binop (SImode, AND, retval, mask, + NULL_RTX, 1, OPTAB_LIB_WIDEN); - + cond = gen_reg_rtx (CCmode); /* If we have TImode, synthesize a comparison. */ --- /dev/null diff --git a/SOURCES/gcc48-pr70549.patch b/SOURCES/gcc48-pr70549.patch index e392c8e9..429893fd 100644 --- a/SOURCES/gcc48-pr70549.patch +++ b/SOURCES/gcc48-pr70549.patch @@ -11,7 +11,7 @@ @@ -3846,8 +3846,13 @@ aarch64_secondary_reload (bool in_p ATTR && GET_MODE_SIZE (mode) == 16 && MEM_P (x)) return FP_REGS; - + + if (rclass == CORE_REGS + && (mode == SFmode || mode == DFmode) + && CONSTANT_P (x)) @@ -20,7 +20,7 @@ if (rclass == FP_REGS && (mode == TImode || mode == TFmode) && CONSTANT_P(x)) - return CORE_REGS; + return CORE_REGS; - + return NO_REGS; } --- gcc/testsuite/g++.dg/opt/pr70549.C.jj 2017-03-08 16:02:45.104918249 +0100 diff --git a/SOURCES/gcc48-pr72717.patch b/SOURCES/gcc48-pr72717.patch new file mode 100644 index 00000000..0aa4d2e1 --- /dev/null +++ b/SOURCES/gcc48-pr72717.patch @@ -0,0 +1,87 @@ +2016-12-13 Michael Meissner + + Backport from mainline + 2016-12-07 Michael Meissner + + PR target/72717 + * config/rs6000/rs6000.c (rs6000_expand_vector_init): If the + V2DImode elements are SUBREG's convert the result into DImode + rather than failing in emit_move_insn. + +--- gcc/testsuite/gcc.target/powerpc/pr72717.c (nonexistent) ++++ gcc/testsuite/gcc.target/powerpc/pr72717.c (revision 243626) +@@ -0,0 +1,18 @@ ++/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ ++/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ ++/* { dg-require-effective-target powerpc_p8vector_ok } */ ++/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ ++/* { dg-options "-mcpu=power8 -O2" } */ ++ ++typedef long V __attribute__((__vector_size__(32))); ++ ++extern void foo (V *, V*); ++ ++/* This test generated an failure in emit_move_insn. */ ++ ++void ++foo(V *p, V *q) ++{ ++ V v = *q; ++ *p = v << v[0]; ++} +--- gcc/config/rs6000/rs6000.c (revision 243625) ++++ gcc/config/rs6000/rs6000.c (revision 243626) +@@ -6667,25 +6667,43 @@ + /* Double word values on VSX can use xxpermdi or lxvdsx. */ + if (VECTOR_MEM_VSX_P (mode) && (mode == V2DFmode || mode == V2DImode)) + { +- rtx op0 = XVECEXP (vals, 0, 0); +- rtx op1 = XVECEXP (vals, 0, 1); ++ rtx op[2]; ++ size_t i; ++ size_t num_elements = (all_same) ? 1 : 2; ++ for (i = 0; i < num_elements; i++) ++ { ++ op[i] = XVECEXP (vals, 0, i); ++ /* Just in case there is a SUBREG with a smaller mode, do a ++ conversion. */ ++ if (GET_MODE (op[i]) != inner_mode) ++ { ++ rtx tmp = gen_reg_rtx (inner_mode); ++ convert_move (tmp, op[i], 0); ++ op[i] = tmp; ++ } ++ /* Allow load with splat double word. */ ++ else if (MEM_P (op[i])) ++ { ++ if (!all_same) ++ op[i] = force_reg (inner_mode, op[i]); ++ } ++ else if (!REG_P (op[i])) ++ op[i] = force_reg (inner_mode, op[i]); ++ } ++ + if (all_same) + { +- if (!MEM_P (op0) && !REG_P (op0)) +- op0 = force_reg (inner_mode, op0); + if (mode == V2DFmode) +- emit_insn (gen_vsx_splat_v2df (target, op0)); ++ emit_insn (gen_vsx_splat_v2df (target, op[0])); + else +- emit_insn (gen_vsx_splat_v2di (target, op0)); ++ emit_insn (gen_vsx_splat_v2di (target, op[0])); + } + else + { +- op0 = force_reg (inner_mode, op0); +- op1 = force_reg (inner_mode, op1); + if (mode == V2DFmode) +- emit_insn (gen_vsx_concat_v2df (target, op0, op1)); ++ emit_insn (gen_vsx_concat_v2df (target, op[0], op[1])); + else +- emit_insn (gen_vsx_concat_v2di (target, op0, op1)); ++ emit_insn (gen_vsx_concat_v2di (target, op[0], op[1])); + } + return; + } diff --git a/SOURCES/gcc48-pr72747.patch b/SOURCES/gcc48-pr72747.patch index 7d71298f..4216ada5 100644 --- a/SOURCES/gcc48-pr72747.patch +++ b/SOURCES/gcc48-pr72747.patch @@ -13,7 +13,7 @@ --- gcc/gimplify.c (revision 241792) +++ gcc/gimplify.c (revision 241793) @@ -4273,24 +4273,23 @@ gimplify_init_constructor (tree *expr_p, - + if (ret == GS_ERROR) return GS_ERROR; - else if (want_value) diff --git a/SOURCES/gcc48-pr72863.patch b/SOURCES/gcc48-pr72863.patch index 475dfd25..87547f7b 100644 --- a/SOURCES/gcc48-pr72863.patch +++ b/SOURCES/gcc48-pr72863.patch @@ -13,7 +13,7 @@ +++ gcc/config/rs6000/vsx.md (revision 239762) @@ -716,13 +716,27 @@ (define_expand "vsx_load_" [(set (match_operand:VSX_M 0 "vsx_register_operand" "") - (match_operand:VSX_M 1 "memory_operand" ""))] + (match_operand:VSX_M 1 "memory_operand" ""))] "VECTOR_MEM_VSX_P (mode)" - "") +{ @@ -24,10 +24,10 @@ + DONE; + } +}) - + (define_expand "vsx_store_" [(set (match_operand:VSX_M 0 "memory_operand" "") - (match_operand:VSX_M 1 "vsx_register_operand" ""))] + (match_operand:VSX_M 1 "vsx_register_operand" ""))] "VECTOR_MEM_VSX_P (mode)" - "") +{ @@ -38,7 +38,7 @@ + DONE; + } +}) - + ;; VSX vector floating point arithmetic instructions. The VSX scalar --- gcc/testsuite/gcc.target/powerpc/pr72863.c (nonexistent) diff --git a/SOURCES/gcc48-pr77375.patch b/SOURCES/gcc48-pr77375.patch index 9f49ffdf..09158e28 100644 --- a/SOURCES/gcc48-pr77375.patch +++ b/SOURCES/gcc48-pr77375.patch @@ -1,6 +1,6 @@ 2017-05-30 Jakub Jelinek - - Backported from mainline + + Backported from mainline 2016-09-16 Jakub Jelinek PR c++/77375 @@ -12,14 +12,14 @@ --- gcc/cp/class.c 2017-10-17 17:27:32.287980595 +0200 +++ gcc/cp/class.c 2017-10-17 17:29:11.104213281 +0200 @@ -1479,6 +1479,8 @@ check_bases (tree t, - |= CLASSTYPE_CONTAINS_EMPTY_CLASS_P (basetype); + |= CLASSTYPE_CONTAINS_EMPTY_CLASS_P (basetype); TYPE_HAS_COMPLEX_DFLT (t) |= (!TYPE_HAS_DEFAULT_CONSTRUCTOR (basetype) - || TYPE_HAS_COMPLEX_DFLT (basetype)); + || TYPE_HAS_COMPLEX_DFLT (basetype)); + if (TYPE_HAS_MUTABLE_P (basetype)) + CLASSTYPE_HAS_MUTABLE (t) = 1; - + /* A standard-layout class is a class that: - ... + ... --- /dev/null +++ gcc/testsuite/g++.dg/cpp0x/mutable1.C @@ -0,0 +1,12 @@ diff --git a/SOURCES/gcc48-pr77767.patch b/SOURCES/gcc48-pr77767.patch index 97aea4d0..ba80ac1b 100644 --- a/SOURCES/gcc48-pr77767.patch +++ b/SOURCES/gcc48-pr77767.patch @@ -1,6 +1,6 @@ 2017-05-30 Jakub Jelinek - - Backported from mainline + + Backported from mainline 2016-12-21 Jakub Jelinek PR c/77767 @@ -22,7 +22,7 @@ + } if (expr_const_operands == NULL) expr_const_operands = &expr_const_operands_dummy; - + - *expr = declspecs->expr; + if (declspecs->expr) + { @@ -33,7 +33,7 @@ + *expr = declspecs->expr; + } *expr_const_operands = declspecs->expr_const_operands; - + if (decl_context == FUNCDEF) --- /dev/null +++ gcc/testsuite/gcc.c-torture/execute/pr77767.c diff --git a/SOURCES/gcc48-pr78064.patch b/SOURCES/gcc48-pr78064.patch index 11dcef2b..0773493f 100644 --- a/SOURCES/gcc48-pr78064.patch +++ b/SOURCES/gcc48-pr78064.patch @@ -6,7 +6,7 @@ --- libgcc/unwind-c.c (revision 241490) +++ libgcc/unwind-c.c (revision 241491) @@ -26,6 +26,7 @@ see the files COPYING3 and COPYING.RUNTI - + #include "tconfig.h" #include "tsystem.h" +#include "auto-target.h" diff --git a/SOURCES/gcc48-pr78378.patch b/SOURCES/gcc48-pr78378.patch index a5eb5d88..bc78b816 100644 --- a/SOURCES/gcc48-pr78378.patch +++ b/SOURCES/gcc48-pr78378.patch @@ -1,6 +1,6 @@ 2017-05-30 Jakub Jelinek - - Backported from mainline + + Backported from mainline 2016-11-16 Jakub Jelinek PR rtl-optimization/78378 @@ -14,11 +14,11 @@ @@ -7342,6 +7342,7 @@ make_extraction (machine_mode mode, rtx inner, HOST_WIDE_INT pos, if (tmode != BLKmode && ((pos_rtx == 0 && (pos % BITS_PER_WORD) == 0 - && !MEM_P (inner) + && !MEM_P (inner) + && (pos == 0 || REG_P (inner)) - && (inner_mode == tmode - || !REG_P (inner) - || TRULY_NOOP_TRUNCATION_MODES_P (tmode, inner_mode) + && (inner_mode == tmode + || !REG_P (inner) + || TRULY_NOOP_TRUNCATION_MODES_P (tmode, inner_mode) --- /dev/null +++ gcc/testsuite/gcc.c-torture/execute/pr78378.c @@ -0,0 +1,18 @@ @@ -40,3 +40,4 @@ + __builtin_abort(); + return 0; +} + diff --git a/SOURCES/gcc48-pr78416.patch b/SOURCES/gcc48-pr78416.patch index 2078a2ba..76e6e935 100644 --- a/SOURCES/gcc48-pr78416.patch +++ b/SOURCES/gcc48-pr78416.patch @@ -10,7 +10,7 @@ +++ gcc/expmed.c @@ -3844,7 +3844,15 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, if (unsignedp) - ext_op1 &= GET_MODE_MASK (mode); + ext_op1 &= GET_MODE_MASK (mode); op1_is_pow2 = ((EXACT_POWER_OF_2_OR_ZERO_P (ext_op1) - || (! unsignedp && EXACT_POWER_OF_2_OR_ZERO_P (-ext_op1)))); + /* If mode is wider than HWI and op1 has msb set, @@ -23,12 +23,12 @@ + <= HOST_BITS_PER_WIDE_INT + || INTVAL (op1) < 0))); } - + /* @@ -3987,8 +3995,17 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, op1_is_constant = CONST_INT_P (op1); op1_is_pow2 = (op1_is_constant - && ((EXACT_POWER_OF_2_OR_ZERO_P (INTVAL (op1)) + && ((EXACT_POWER_OF_2_OR_ZERO_P (INTVAL (op1)) - || (! unsignedp - && EXACT_POWER_OF_2_OR_ZERO_P (-UINTVAL (op1)))))); + /* If mode is wider than HWI and op1 has msb set, @@ -43,49 +43,49 @@ + <= HOST_BITS_PER_WIDE_INT + || INTVAL (op1) < 0)))); } - + /* If one of the operands is a volatile MEM, copy it into a register. */ @@ -4031,7 +4048,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, - unsigned HOST_WIDE_INT d = (INTVAL (op1) - & GET_MODE_MASK (compute_mode)); - + unsigned HOST_WIDE_INT d = (INTVAL (op1) + & GET_MODE_MASK (compute_mode)); + - if (EXACT_POWER_OF_2_OR_ZERO_P (d)) + if (EXACT_POWER_OF_2_OR_ZERO_P (d) + && (INTVAL (op1) >= 0 || size <= HOST_BITS_PER_WIDE_INT)) - { - pre_shift = floor_log2 (d); - if (rem_flag) + { + pre_shift = floor_log2 (d); + if (rem_flag) @@ -4179,6 +4197,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, - goto fail1; - } - else if (EXACT_POWER_OF_2_OR_ZERO_P (d) + goto fail1; + } + else if (EXACT_POWER_OF_2_OR_ZERO_P (d) + && (size <= HOST_BITS_PER_WIDE_INT || d >= 0) - && (rem_flag - ? smod_pow2_cheap (speed, compute_mode) - : sdiv_pow2_cheap (speed, compute_mode)) + && (rem_flag + ? smod_pow2_cheap (speed, compute_mode) + : sdiv_pow2_cheap (speed, compute_mode)) @@ -4192,7 +4211,9 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, - compute_mode) - != CODE_FOR_nothing))) - ; + compute_mode) + != CODE_FOR_nothing))) + ; - else if (EXACT_POWER_OF_2_OR_ZERO_P (abs_d)) + else if (EXACT_POWER_OF_2_OR_ZERO_P (abs_d) + && (size <= HOST_BITS_PER_WIDE_INT + || abs_d != (unsigned HOST_WIDE_INT) d)) - { - if (rem_flag) - { + { + if (rem_flag) + { @@ -4504,7 +4525,10 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, case CEIL_MOD_EXPR: - if (unsignedp) - { + if (unsignedp) + { - if (op1_is_constant && EXACT_POWER_OF_2_OR_ZERO_P (INTVAL (op1))) + if (op1_is_constant + && EXACT_POWER_OF_2_OR_ZERO_P (INTVAL (op1)) + && (size <= HOST_BITS_PER_WIDE_INT + || INTVAL (op1) >= 0)) - { - rtx t1, t2, t3; - unsigned HOST_WIDE_INT d = INTVAL (op1); + { + rtx t1, t2, t3; + unsigned HOST_WIDE_INT d = INTVAL (op1); --- gcc/testsuite/gcc.dg/torture/pr78416.c +++ gcc/testsuite/gcc.dg/torture/pr78416.c @@ -0,0 +1,17 @@ diff --git a/SOURCES/gcc48-pr78796.patch b/SOURCES/gcc48-pr78796.patch index 8e04b023..6afd47a9 100644 --- a/SOURCES/gcc48-pr78796.patch +++ b/SOURCES/gcc48-pr78796.patch @@ -17,7 +17,7 @@ + return aarch64_classify_tls_symbol (x); + return SYMBOL_FORCE_TO_MEM; - + case AARCH64_CMODEL_TINY: --- gcc/testsuite/gcc.dg/tls/pr78796.c (nonexistent) +++ gcc/testsuite/gcc.dg/tls/pr78796.c (revision 243646) diff --git a/SOURCES/gcc48-pr78875.patch b/SOURCES/gcc48-pr78875.patch index 530121b5..12dd0ebb 100644 --- a/SOURCES/gcc48-pr78875.patch +++ b/SOURCES/gcc48-pr78875.patch @@ -55,9 +55,9 @@ --- gcc/config/rs6000/rs6000.c (revision 244555) +++ gcc/config/rs6000/rs6000.c (revision 244556) @@ -3727,6 +3727,54 @@ rs6000_option_override_internal (bool gl - atoi (rs6000_sched_insert_nops_str)); + atoi (rs6000_sched_insert_nops_str)); } - + + /* Handle stack protector */ + if (!global_options_set.x_rs6000_stack_protector_guard) +#ifdef TARGET_THREAD_SSP_OFFSET @@ -112,8 +112,8 @@ --- gcc/config/rs6000/rs6000.md (revision 244555) +++ gcc/config/rs6000/rs6000.md (revision 244556) @@ -13092,19 +13092,23 @@ - - + + (define_expand "stack_protect_set" - [(match_operand 0 "memory_operand" "") - (match_operand 1 "memory_operand" "")] @@ -141,10 +141,10 @@ + DONE; }) - + @@ -13127,21 +13131,26 @@ (set_attr "length" "12")]) - + (define_expand "stack_protect_test" - [(match_operand 0 "memory_operand" "") - (match_operand 1 "memory_operand" "") @@ -181,13 +181,13 @@ + DONE; }) - + --- gcc/config/rs6000/rs6000-opts.h (revision 244555) +++ gcc/config/rs6000/rs6000-opts.h (revision 244556) @@ -154,6 +154,12 @@ enum rs6000_vector { VECTOR_OTHER /* Some other vector unit */ }; - + +/* Where to get the canary for the stack protector. */ +enum stack_protector_guard { + SSP_TLS, /* per-thread canary in TLS block */ @@ -207,11 +207,11 @@ +-mcompat-align-parm -mno-compat-align-parm @gol +-mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol +-mstack-protector-guard-offset=@var{offset}} - + @emph{RX Options} @gccoptlist{-m64bit-doubles -m32bit-doubles -fpu -nofpu@gol @@ -18295,6 +18297,23 @@ GCC. - + In this version of the compiler, the @option{-mcompat-align-parm} is the default, except when using the Linux ELFv2 ABI. + @@ -232,7 +232,7 @@ +offset from that base register. The default for those is as specified in the +relevant ABI. @end table - + @node RX Options --- gcc/testsuite/gcc.target/powerpc/ssp-1.c (nonexistent) +++ gcc/testsuite/gcc.target/powerpc/ssp-1.c (revision 244562) diff --git a/SOURCES/gcc48-pr79439.patch b/SOURCES/gcc48-pr79439.patch index 29193ecd..c593dfc1 100644 --- a/SOURCES/gcc48-pr79439.patch +++ b/SOURCES/gcc48-pr79439.patch @@ -9,14 +9,14 @@ --- gcc/config/rs6000/predicates.md (revision 245812) +++ gcc/config/rs6000/predicates.md (revision 245813) @@ -1086,8 +1086,8 @@ - && ((DEFAULT_ABI != ABI_AIX - && DEFAULT_ABI != ABI_ELFv2) - || !SYMBOL_REF_EXTERNAL_P (op))) + && ((DEFAULT_ABI != ABI_AIX + && DEFAULT_ABI != ABI_ELFv2) + || !SYMBOL_REF_EXTERNAL_P (op))) - || (op == XEXP (DECL_RTL (current_function_decl), - 0)))"))) + || (op == XEXP (DECL_RTL (current_function_decl), 0) + && !decl_replaceable_p (current_function_decl)))"))) - + ;; Return 1 if this operand is a valid input for a move insn. (define_predicate "input_operand" --- gcc/testsuite/gcc.target/powerpc/pr79439.c (nonexistent) diff --git a/SOURCES/gcc48-pr79969.patch b/SOURCES/gcc48-pr79969.patch index 849f7b7d..53a4ed70 100644 --- a/SOURCES/gcc48-pr79969.patch +++ b/SOURCES/gcc48-pr79969.patch @@ -16,7 +16,7 @@ + a forward declaration. */ + else if (TYPE_STUB_DECL (enumtype)) + DECL_SOURCE_LOCATION (TYPE_STUB_DECL (enumtype)) = loc; - + if (C_TYPE_BEING_DEFINED (enumtype)) error_at (loc, "nested redefinition of %", name); --- gcc/testsuite/gcc.dg/debug/dwarf2/enum-loc1.c.jj 2017-03-09 08:09:30.742037844 +0100 diff --git a/SOURCES/gcc48-pr80129.patch b/SOURCES/gcc48-pr80129.patch index c0bb2ff4..34e160e2 100644 --- a/SOURCES/gcc48-pr80129.patch +++ b/SOURCES/gcc48-pr80129.patch @@ -1,6 +1,6 @@ 2017-05-30 Jakub Jelinek - - Backported from mainline + + Backported from mainline 2017-03-22 Jakub Jelinek PR c++/80129 @@ -12,9 +12,9 @@ --- gcc/gimplify.c +++ gcc/gimplify.c @@ -4293,6 +4293,14 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, - if (ret != GS_ERROR) - ret = GS_OK; - + if (ret != GS_ERROR) + ret = GS_OK; + + /* If we are going to write RESULT more than once, clear + TREE_READONLY flag, otherwise we might incorrectly promote + the variable to static const and initialize it at compile @@ -23,9 +23,9 @@ + && TREE_TYPE (TREE_OPERAND (cond, 1)) != void_type_node + && TREE_TYPE (TREE_OPERAND (cond, 2)) != void_type_node) + TREE_READONLY (result) = 0; - if (TREE_TYPE (TREE_OPERAND (cond, 1)) != void_type_node) - TREE_OPERAND (cond, 1) - = build2 (code, void_type_node, result, + if (TREE_TYPE (TREE_OPERAND (cond, 1)) != void_type_node) + TREE_OPERAND (cond, 1) + = build2 (code, void_type_node, result, --- /dev/null +++ gcc/testsuite/g++.dg/torture/pr80129.C @@ -0,0 +1,14 @@ diff --git a/SOURCES/gcc48-pr80362.patch b/SOURCES/gcc48-pr80362.patch index ec65b1e3..11378574 100644 --- a/SOURCES/gcc48-pr80362.patch +++ b/SOURCES/gcc48-pr80362.patch @@ -13,15 +13,15 @@ +++ gcc/fold-const.c @@ -11940,8 +11942,8 @@ fold_binary_loc (location_t loc, /* Convert -A / -B to A / B when the type is signed and overflow is - undefined. */ + undefined. */ if ((!INTEGRAL_TYPE_P (type) || TYPE_OVERFLOW_UNDEFINED (type)) - && TREE_CODE (arg0) == NEGATE_EXPR - && negate_expr_p (arg1)) + && TREE_CODE (op0) == NEGATE_EXPR + && negate_expr_p (op1)) - { - if (INTEGRAL_TYPE_P (type)) - fold_overflow_warning (("assuming signed overflow does not occur " + { + if (INTEGRAL_TYPE_P (type)) + fold_overflow_warning (("assuming signed overflow does not occur " --- /dev/null +++ gcc/testsuite/gcc.dg/torture/pr80362.c @@ -0,0 +1,11 @@ diff --git a/SOURCES/gcc48-pr80692.patch b/SOURCES/gcc48-pr80692.patch index aedcf4cf..2e3e352c 100644 --- a/SOURCES/gcc48-pr80692.patch +++ b/SOURCES/gcc48-pr80692.patch @@ -14,13 +14,13 @@ @@ -950,12 +950,12 @@ do_compare (const REAL_VALUE_TYPE *a, const REAL_VALUE_TYPE *b, gcc_unreachable (); } - + - if (a->sign != b->sign) - return -a->sign - -b->sign; - if (a->decimal || b->decimal) return decimal_do_compare (a, b, nan_result); - + + if (a->sign != b->sign) + return -a->sign - -b->sign; + diff --git a/SOURCES/gcc48-pr81395.patch b/SOURCES/gcc48-pr81395.patch new file mode 100644 index 00000000..b99fb74e --- /dev/null +++ b/SOURCES/gcc48-pr81395.patch @@ -0,0 +1,67 @@ +2017-07-18 Jonathan Wakely + + PR libstdc++/81395 + * include/bits/fstream.tcc (basic_filebuf::xsgetn): Don't set buffer + pointers for write mode after reading. + * testsuite/27_io/basic_filebuf/sgetn/char/81395.cc: New. + +--- libstdc++-v3/include/bits/fstream.tcc (revision 254017) ++++ libstdc++-v3/include/bits/fstream.tcc (revision 254018) +@@ -699,7 +699,7 @@ + + if (__n == 0) + { +- _M_set_buffer(0); ++ // Set _M_reading. Buffer is already in initial 'read' mode. + _M_reading = true; + } + else if (__len == 0) +--- libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/81395.cc (nonexistent) ++++ libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/81395.cc (revision 254018) +@@ -0,0 +1,46 @@ ++// Copyright (C) 2017 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-require-fileio "" } ++ ++// PR libstdc++/81395 ++ ++#include ++#include // for std::memset ++#include // For BUFSIZ ++ ++using std::memset; ++ ++int main() ++{ ++ { ++ std::filebuf fb; ++ fb.open("test.txt", std::ios::out); ++ char data[BUFSIZ]; ++ memset(data, 'A', sizeof(data)); ++ fb.sputn(data, sizeof(data)); ++ } ++ ++ std::filebuf fb; ++ fb.open("test.txt", std::ios::in|std::ios::out); ++ char buf[BUFSIZ]; ++ memset(buf, 0, sizeof(buf)); ++ fb.sgetn(buf, sizeof(buf)); ++ // Switch from reading to writing without seeking first: ++ fb.sputn("B", 1); ++ fb.pubsync(); ++} diff --git a/SOURCES/gcc48-pr82274.patch b/SOURCES/gcc48-pr82274.patch index dda7c6f6..5a330b9b 100644 --- a/SOURCES/gcc48-pr82274.patch +++ b/SOURCES/gcc48-pr82274.patch @@ -10,15 +10,15 @@ --- libgcc/libgcc2.c 2017/10/13 16:50:13 253733 +++ libgcc/libgcc2.c 2017/10/13 17:19:12 253734 @@ -375,7 +375,8 @@ - } - else - { + } + else + { - if (uu.s.high == (Wtype) -1 && vv.s.high == (Wtype) - 1) + if ((uu.s.high & vv.s.high) == (Wtype) -1 + && (uu.s.low | vv.s.low) != 0) - { - DWunion ww = {.ll = (UDWtype) (UWtype) uu.s.low - * (UDWtype) (UWtype) vv.s.low}; + { + DWunion ww = {.ll = (UDWtype) (UWtype) uu.s.low + * (UDWtype) (UWtype) vv.s.low}; --- /dev/null +++ gcc/testsuite/gcc.dg/pr82274-1.c @@ -0,0 +1,16 @@ diff --git a/SOURCES/gcc48-rh1180633.patch b/SOURCES/gcc48-rh1180633.patch index bf5dbaaa..f3898f98 100644 --- a/SOURCES/gcc48-rh1180633.patch +++ b/SOURCES/gcc48-rh1180633.patch @@ -20,7 +20,7 @@ @@ -32,7 +32,11 @@ using namespace GTM; extern __thread gtm_thread_tls _gtm_thr_tls; #endif - + -gtm_rwlock GTM::gtm_thread::serial_lock; +// Put this at the start of a cacheline so that serial_lock's writers and +// htm_fastpath fields are on the same cacheline, so that HW transactions @@ -29,11 +29,11 @@ + __attribute__((aligned(HW_CACHELINE_SIZE))); gtm_thread *GTM::gtm_thread::list_of_threads = 0; unsigned GTM::gtm_thread::number_of_threads = 0; - + @@ -54,9 +58,6 @@ static pthread_mutex_t global_tid_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_key_t thr_release_key; static pthread_once_t thr_release_once = PTHREAD_ONCE_INIT; - + -// See gtm_thread::begin_transaction. -uint32_t GTM::htm_fastpath = 0; - @@ -69,36 +69,36 @@ + // anything besides the serial lock, which is independent of method + // groups. + for (uint32_t t = serial_lock.get_htm_fastpath(); t; t--) - { - uint32_t ret = htm_begin(); - if (htm_begin_success(ret)) + { + uint32_t ret = htm_begin(); + if (htm_begin_success(ret)) @@ -197,9 +205,11 @@ GTM::gtm_thread::begin_transaction (uint32_t prop, const gtm_jmpbuf *jb) - // We are executing a transaction now. - // Monitor the writer flag in the serial-mode lock, and abort - // if there is an active or waiting serial-mode transaction. + // We are executing a transaction now. + // Monitor the writer flag in the serial-mode lock, and abort + // if there is an active or waiting serial-mode transaction. + // Also checks that htm_fastpath is still nonzero and thus + // HW transactions are allowed to run. - // Note that this can also happen due to an enclosing - // serial-mode transaction; we handle this case below. + // Note that this can also happen due to an enclosing + // serial-mode transaction; we handle this case below. - if (unlikely(serial_lock.is_write_locked())) + if (unlikely(serial_lock.htm_fastpath_disabled())) - htm_abort(); - else - // We do not need to set a_saveLiveVariables because of HTM. + htm_abort(); + else + // We do not need to set a_saveLiveVariables because of HTM. @@ -210,9 +220,12 @@ GTM::gtm_thread::begin_transaction (uint32_t prop, const gtm_jmpbuf *jb) - // retrying the transaction will be successful. - if (!htm_abort_should_retry(ret)) - break; + // retrying the transaction will be successful. + if (!htm_abort_should_retry(ret)) + break; + // Check whether the HTM fastpath has been disabled. + if (!serial_lock.get_htm_fastpath()) + break; - // Wait until any concurrent serial-mode transactions have finished. - // This is an empty critical section, but won't be elided. + // Wait until any concurrent serial-mode transactions have finished. + // This is an empty critical section, but won't be elided. - if (serial_lock.is_write_locked()) + if (serial_lock.htm_fastpath_disabled()) - { - tx = gtm_thr(); - if (unlikely(tx == NULL)) + { + tx = gtm_thr(); + if (unlikely(tx == NULL)) @@ -618,7 +631,7 @@ _ITM_commitTransaction(void) // a serial-mode transaction. If we are, then there will be no other // concurrent serial-mode transaction. @@ -128,7 +128,7 @@ +// standard layout, and the writers field must be first (i.e., so the +// assembler code can assume that its address is equal to the address of the +// respective instance of the class), and htm_fastpath must be second. - + class gtm_rwlock { - // TODO Put futexes on different cachelines? @@ -143,18 +143,18 @@ + // should remain on the same cacheline. std::atomic writer_readers;// A confirmed writer waits here for readers. std::atomic readers; // Readers wait here for writers (iff true). - + public: - gtm_rwlock() : writers(0), writer_readers(0), readers(0) {}; + gtm_rwlock() : writers(0), htm_fastpath(0), writer_readers(0), readers(0) + { } - + void read_lock (gtm_thread *tx); void read_unlock (gtm_thread *tx); @@ -59,12 +72,28 @@ class gtm_rwlock bool write_upgrade (gtm_thread *tx); void write_upgrade_finish (gtm_thread *tx); - + - // Returns true iff there is a concurrent active or waiting writer. - // This is primarily useful for simple HyTM approaches, and the value being - // checked is loaded with memory_order_relaxed. @@ -183,7 +183,7 @@ - return writers.load (memory_order_relaxed) != 0; + htm_fastpath.store (val, memory_order_relaxed); } - + protected: --- libitm/config/posix/rwlock.h +++ libitm/config/posix/rwlock.h @@ -196,7 +196,7 @@ +// standard layout, and the summary field must be first (i.e., so the +// assembler code can assume that its address is equal to the address of the +// respective instance of the class), and htm_fastpath must be second. - + class gtm_rwlock { - pthread_mutex_t mutex; // Held if manipulating any field. @@ -207,7 +207,7 @@ static const unsigned a_writer = 1; // An active writer. static const unsigned w_writer = 2; // The w_writers field != 0 static const unsigned w_reader = 4; // The w_readers field != 0 - + std::atomic summary; // Bitmask of the above. + + // We put the HTM fastpath control variable here so that HTM fastpath @@ -228,7 +228,7 @@ @@ -74,12 +87,28 @@ class gtm_rwlock bool write_upgrade (gtm_thread *tx); void write_upgrade_finish (gtm_thread *tx); - + - // Returns true iff there is a concurrent active or waiting writer. - // This is primarily useful for simple HyTM approaches, and the value being - // checked is loaded with memory_order_relaxed. @@ -257,13 +257,13 @@ - return summary.load (memory_order_relaxed) & (a_writer | w_writer); + htm_fastpath.store (val, memory_order_relaxed); } - + protected: --- libitm/config/posix/rwlock.cc +++ libitm/config/posix/rwlock.cc @@ -30,11 +30,12 @@ namespace GTM HIDDEN { // ??? Move this back to the header file when constexpr is implemented. - + gtm_rwlock::gtm_rwlock() - : mutex (PTHREAD_MUTEX_INITIALIZER), + : summary (0), @@ -279,15 +279,15 @@ --- libitm/libitm_i.h +++ libitm/libitm_i.h @@ -336,10 +336,6 @@ extern abi_dispatch *dispatch_htm(); - + extern gtm_cacheline_mask gtm_mask_stack(gtm_cacheline *, gtm_cacheline_mask); - + -// Control variable for the HTM fastpath that uses serial mode as fallback. -// Non-zero if the HTM fastpath is enabled. See gtm_thread::begin_transaction. -extern uint32_t htm_fastpath; - } // namespace GTM - + #endif // LIBITM_I_H --- libitm/method-serial.cc +++ libitm/method-serial.cc @@ -306,7 +306,7 @@ + gtm_thread::serial_lock.set_htm_fastpath(0); } }; - + @@ -288,7 +288,7 @@ GTM::gtm_thread::serialirr_mode () #if defined(USE_HTM_FASTPATH) // HTM fastpath. If we are executing a HW transaction, don't go serial but @@ -315,7 +315,7 @@ + if (likely(!gtm_thread::serial_lock.htm_fastpath_disabled())) return; #endif - + --- libitm/query.cc +++ libitm/query.cc @@ -49,7 +49,7 @@ _ITM_inTransaction (void) diff --git a/SOURCES/gcc48-rh1243366.patch b/SOURCES/gcc48-rh1243366.patch index 7a54d18f..da137f32 100644 --- a/SOURCES/gcc48-rh1243366.patch +++ b/SOURCES/gcc48-rh1243366.patch @@ -10,13 +10,13 @@ +++ libstdc++-v3/include/std/streambuf @@ -802,12 +802,22 @@ basic_streambuf(const basic_streambuf& __sb) - : _M_in_beg(__sb._M_in_beg), _M_in_cur(__sb._M_in_cur), - _M_in_end(__sb._M_in_end), _M_out_beg(__sb._M_out_beg), + : _M_in_beg(__sb._M_in_beg), _M_in_cur(__sb._M_in_cur), + _M_in_end(__sb._M_in_end), _M_out_beg(__sb._M_out_beg), - _M_out_cur(__sb._M_out_cur), _M_out_end(__sb._M_out_cur), + _M_out_cur(__sb._M_out_cur), _M_out_end(__sb._M_out_end), - _M_buf_locale(__sb._M_buf_locale) + _M_buf_locale(__sb._M_buf_locale) { } - + basic_streambuf& - operator=(const basic_streambuf&) { return *this; }; + operator=(const basic_streambuf& __sb) @@ -31,5 +31,5 @@ + return *this; + }; }; - + // Explicit specialization declarations, defined in src/streambuf.cc. diff --git a/SOURCES/gcc48-rh1278872.patch b/SOURCES/gcc48-rh1278872.patch index df5ff88f..ce82c3dc 100644 --- a/SOURCES/gcc48-rh1278872.patch +++ b/SOURCES/gcc48-rh1278872.patch @@ -9,7 +9,7 @@ @@ -7806,6 +7806,30 @@ unmark_all_dies (dw_die_ref die) unmark_all_dies (AT_ref (a)); } - + +/* Calculate if the entry should appear in the final output file. It may be + from a pruned a type. */ + @@ -36,9 +36,9 @@ + /* Return the size of the .debug_pubnames or .debug_pubtypes table generated for the compilation unit. */ - + @@ -7818,9 +7842,7 @@ size_of_pubnames (vecname) + DWARF_OFFSET_SIZE + 1; - + size += DWARF_OFFSET_SIZE; @@ -8999,22 +9021,14 @@ output_pubnames (vecdie->die_offset != 0 - || !flag_eliminate_unused_debug_types) + if (include_pubname_in_output (names, pub)) - { - dw_offset die_offset = pub->die->die_offset; - + { + dw_offset die_offset = pub->die->die_offset; + + /* We shouldn't see pubnames for DIEs outside of the main CU. */ + if (names == pubname_table) + gcc_assert (pub->die->die_mark); + - /* If we're putting types in their own .debug_types sections, - the .debug_pubtypes table will still point to the compile - unit (not the type unit), so we want to use the offset of + /* If we're putting types in their own .debug_types sections, + the .debug_pubtypes table will still point to the compile + unit (not the type unit), so we want to use the offset of diff --git a/SOURCES/gcc48-rh1296211.patch b/SOURCES/gcc48-rh1296211.patch index 460c6d00..f1b084ac 100644 --- a/SOURCES/gcc48-rh1296211.patch +++ b/SOURCES/gcc48-rh1296211.patch @@ -10,5 +10,5 @@ %{!T*: %(link_start) } \ -%(link_target) \ %(link_os)" - + /* Shared libraries are not default. */ diff --git a/SOURCES/gcc48-rh1304449.patch b/SOURCES/gcc48-rh1304449.patch index 33a6821e..213ff0ce 100644 --- a/SOURCES/gcc48-rh1304449.patch +++ b/SOURCES/gcc48-rh1304449.patch @@ -40,22 +40,22 @@ --- gcc/config.gcc (revision 231943) +++ gcc/config.gcc (revision 231945) @@ -368,7 +368,7 @@ i[34567]86-*-*) - lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h - avx2intrin.h fmaintrin.h f16cintrin.h rtmintrin.h - xtestintrin.h rdseedintrin.h prfchwintrin.h adxintrin.h + lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h + avx2intrin.h fmaintrin.h f16cintrin.h rtmintrin.h + xtestintrin.h rdseedintrin.h prfchwintrin.h adxintrin.h - fxsrintrin.h xsaveintrin.h xsaveoptintrin.h" + fxsrintrin.h xsaveintrin.h xsaveoptintrin.h pkuintrin.h" - ;; + ;; x86_64-*-*) - cpu_type=i386 + cpu_type=i386 @@ -383,7 +383,7 @@ x86_64-*-*) - lzcntintrin.h bmiintrin.h tbmintrin.h bmi2intrin.h - avx2intrin.h fmaintrin.h f16cintrin.h rtmintrin.h - xtestintrin.h rdseedintrin.h prfchwintrin.h adxintrin.h + lzcntintrin.h bmiintrin.h tbmintrin.h bmi2intrin.h + avx2intrin.h fmaintrin.h f16cintrin.h rtmintrin.h + xtestintrin.h rdseedintrin.h prfchwintrin.h adxintrin.h - fxsrintrin.h xsaveintrin.h xsaveoptintrin.h" + fxsrintrin.h xsaveintrin.h xsaveoptintrin.h pkuintrin.h" - need_64bit_hwint=yes - ;; + need_64bit_hwint=yes + ;; ia64-*-*) --- gcc/common/config/i386/i386-common.c (revision 231943) +++ gcc/common/config/i386/i386-common.c (revision 231945) @@ -64,7 +64,7 @@ #define OPTION_MASK_ISA_F16C_SET \ (OPTION_MASK_ISA_F16C | OPTION_MASK_ISA_AVX_SET) +#define OPTION_MASK_ISA_PKU_SET OPTION_MASK_ISA_PKU - + /* Define a set of ISAs which aren't available when a given ISA is disabled. MMX and SSE ISAs are handled separately. */ @@ -164,6 +165,7 @@ along with GCC; see the file COPYING3. @@ -72,13 +72,13 @@ #define OPTION_MASK_ISA_RDRND_UNSET OPTION_MASK_ISA_RDRND #define OPTION_MASK_ISA_F16C_UNSET OPTION_MASK_ISA_F16C +#define OPTION_MASK_ISA_PKU_UNSET OPTION_MASK_ISA_PKU - + /* Implement TARGET_HANDLE_OPTION. */ - + @@ -659,6 +661,19 @@ ix86_handle_option (struct gcc_options * - } + } return true; - + + case OPT_mpku: + if (value) + { @@ -94,7 +94,7 @@ + /* Comes from final.c -- no real reason to change it. */ #define MAX_CODE_ALIGN 16 - + --- gcc/config/i386/i386.h (revision 231943) +++ gcc/config/i386/i386.h (revision 231945) @@ -80,6 +80,7 @@ see the files COPYING3 and COPYING.RUNTI @@ -102,25 +102,25 @@ #define TARGET_XSAVE TARGET_ISA_XSAVE #define TARGET_XSAVEOPT TARGET_ISA_XSAVEOPT +#define TARGET_PKU TARGET_ISA_PKU - + #define TARGET_LP64 TARGET_ABI_64 #define TARGET_X32 TARGET_ABI_X32 --- gcc/config/i386/i386.md (revision 231943) +++ gcc/config/i386/i386.md (revision 231945) @@ -224,6 +224,9 @@ (define_c_enum "unspecv" [ UNSPECV_XTEST - + UNSPECV_NLGR + + ;; For RDPKRU and WRPKRU support + UNSPECV_PKU ]) - + ;; Constants to represent rounding modes in the ROUND instruction @@ -18289,6 +18292,48 @@ (define_insn "xtest_1" [(set_attr "type" "other") (set_attr "length" "3")]) - + +;; RDPKRU and WRPKRU + +(define_expand "rdpkru" @@ -219,20 +219,20 @@ @@ -74,6 +74,10 @@ #define bit_RDSEED (1 << 18) #define bit_ADX (1 << 19) - + +/* %ecx */ +#define bit_PKU (1 << 3) +#define bit_OSPKE (1 << 4) -+ ++ /* Extended State Enumeration Sub-leaf (%eax == 13, %ecx == 1) */ #define bit_XSAVEOPT (1 << 0) - + --- gcc/config/i386/x86intrin.h (revision 231943) +++ gcc/config/i386/x86intrin.h (revision 231945) @@ -119,4 +119,8 @@ - + #include - + +#ifdef __PKU__ +#include +#endif @@ -266,9 +266,9 @@ unsigned int has_rdseed = 0, has_prfchw = 0, has_adx = 0; unsigned int has_osxsave = 0, has_fxsr = 0, has_xsave = 0, has_xsaveopt = 0; + unsigned int has_pku = 0; - + bool arch; - + @@ -479,6 +480,8 @@ const char *host_detect_local_cpu (int a has_fsgsbase = ebx & bit_FSGSBASE; has_rdseed = ebx & bit_RDSEED; @@ -276,22 +276,22 @@ + + has_pku = ecx & bit_OSPKE; } - + if (max_level >= 13) @@ -855,12 +858,13 @@ const char *host_detect_local_cpu (int a const char *fxsr = has_fxsr ? " -mfxsr" : " -mno-fxsr"; const char *xsave = has_xsave ? " -mxsave" : " -mno-xsave"; const char *xsaveopt = has_xsaveopt ? " -mxsaveopt" : " -mno-xsaveopt"; + const char *pku = has_pku ? " -mpku" : " -mno-pku"; - + options = concat (options, cx16, sahf, movbe, ase, pclmul, - popcnt, abm, lwp, fma, fma4, xop, bmi, bmi2, - tbm, avx, avx2, sse4_2, sse4_1, lzcnt, rtm, - hle, rdrnd, f16c, fsgsbase, rdseed, prfchw, adx, + popcnt, abm, lwp, fma, fma4, xop, bmi, bmi2, + tbm, avx, avx2, sse4_2, sse4_1, lzcnt, rtm, + hle, rdrnd, f16c, fsgsbase, rdseed, prfchw, adx, - fxsr, xsave, xsaveopt, NULL); + fxsr, xsave, xsaveopt, pku, NULL); } - + done: --- gcc/config/i386/i386.c (revision 231943) +++ gcc/config/i386/i386.c (revision 231945) @@ -301,45 +301,45 @@ { "-mxsaveopt", OPTION_MASK_ISA_XSAVEOPT }, + { "-mpku", OPTION_MASK_ISA_PKU }, }; - + /* Flag options. */ @@ -2905,6 +2906,7 @@ ix86_option_override_internal (bool main #define PTA_FXSR (HOST_WIDE_INT_1 << 37) #define PTA_XSAVE (HOST_WIDE_INT_1 << 38) #define PTA_XSAVEOPT (HOST_WIDE_INT_1 << 39) +#define PTA_PKU (HOST_WIDE_INT_1 << 60) - + /* if this reaches 64, need to widen struct pta flags below */ - + @@ -3429,6 +3431,9 @@ ix86_option_override_internal (bool main - if (processor_alias_table[i].flags & PTA_XSAVEOPT - && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_XSAVEOPT)) - ix86_isa_flags |= OPTION_MASK_ISA_XSAVEOPT; + if (processor_alias_table[i].flags & PTA_XSAVEOPT + && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_XSAVEOPT)) + ix86_isa_flags |= OPTION_MASK_ISA_XSAVEOPT; + if (processor_alias_table[i].flags & PTA_PKU + && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_PKU)) + ix86_isa_flags |= OPTION_MASK_ISA_PKU; - if (processor_alias_table[i].flags & (PTA_PREFETCH_SSE | PTA_SSE)) - x86_prefetch_sse = true; - + if (processor_alias_table[i].flags & (PTA_PREFETCH_SSE | PTA_SSE)) + x86_prefetch_sse = true; + @@ -4220,6 +4225,7 @@ ix86_valid_target_attribute_inner_p (tre IX86_ATTR_ISA ("fxsr", OPT_mfxsr), IX86_ATTR_ISA ("xsave", OPT_mxsave), IX86_ATTR_ISA ("xsaveopt", OPT_mxsaveopt), + IX86_ATTR_ISA ("pku", OPT_mpku), - + /* enum options */ IX86_ATTR_ENUM ("fpmath=", OPT_mfpmath_), @@ -27042,6 +27048,10 @@ enum ix86_builtins IX86_BUILTIN_CPU_IS, IX86_BUILTIN_CPU_SUPPORTS, - + + /* PKU instructions. */ + IX86_BUILTIN_RDPKRU, + IX86_BUILTIN_WRPKRU, + IX86_BUILTIN_MAX }; - + @@ -27357,6 +27367,10 @@ static const struct builtin_description { OPTION_MASK_ISA_RTM, CODE_FOR_xbegin, "__builtin_ia32_xbegin", IX86_BUILTIN_XBEGIN, UNKNOWN, (int) UNSIGNED_FTYPE_VOID }, { OPTION_MASK_ISA_RTM, CODE_FOR_xend, "__builtin_ia32_xend", IX86_BUILTIN_XEND, UNKNOWN, (int) VOID_FTYPE_VOID }, @@ -349,14 +349,14 @@ + { OPTION_MASK_ISA_PKU, CODE_FOR_rdpkru, "__builtin_ia32_rdpkru", IX86_BUILTIN_RDPKRU, UNKNOWN, (int) UNSIGNED_FTYPE_VOID }, + { OPTION_MASK_ISA_PKU, CODE_FOR_wrpkru, "__builtin_ia32_wrpkru", IX86_BUILTIN_WRPKRU, UNKNOWN, (int) VOID_FTYPE_UNSIGNED }, }; - + /* Builtins with variable number of arguments. */ --- gcc/doc/extend.texi (revision 231943) +++ gcc/doc/extend.texi (revision 231945) @@ -10996,6 +10996,13 @@ void __builtin_ia32_xabort (status) int __builtin_ia32_xtest () @end smallexample - + +The following built-in functions are available when @option{-mpku} is used. +They generate reads and writes to PKRU. +@smallexample @@ -366,7 +366,7 @@ + @node X86 transactional memory intrinsics @subsection X86 transaction memory intrinsics - + --- gcc/doc/invoke.texi (revision 231943) +++ gcc/doc/invoke.texi (revision 231945) @@ -645,7 +645,7 @@ Objective-C and Objective-C++ Dialects}. @@ -404,22 +404,22 @@ /* { dg-do compile } */ -/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt" } */ +/* { dg-options "-O -std=c89 -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mpku" } */ - + #include - + --- gcc/testsuite/gcc.target/i386/sse-13.c (revision 231943) +++ gcc/testsuite/gcc.target/i386/sse-13.c (revision 231945) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt" } */ +/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mpku" } */ - + #include - + --- gcc/testsuite/gcc.target/i386/sse-22.c (revision 231943) +++ gcc/testsuite/gcc.target/i386/sse-22.c (revision 231945) @@ -268,7 +268,7 @@ test_2 (_mm_clmulepi64_si128, __m128i, _ - + /* x86intrin.h (FMA4/XOP/LWP/BMI/BMI2/TBM/LZCNT/FMA). */ #ifdef DIFFERENT_PRAGMAS -#pragma GCC target ("fma4,xop,lwp,bmi,bmi2,tbm,lzcnt,fma,rdseed,prfchw,adx,fxsr,xsaveopt") @@ -432,7 +432,7 @@ @@ -183,7 +183,7 @@ /* rtmintrin.h */ #define __builtin_ia32_xabort(M) __builtin_ia32_xabort(1) - + -#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,fma,rtm,rdseed,prfchw,adx,fxsr,xsaveopt") +#pragma GCC target ("sse4a,3dnow,avx,avx2,fma4,xop,aes,pclmul,popcnt,abm,lzcnt,bmi,bmi2,tbm,lwp,fsgsbase,rdrnd,f16c,fma,rtm,rdseed,prfchw,adx,fxsr,xsaveopt,pku") #include @@ -472,13 +472,13 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt" } */ +/* { dg-options "-O -pedantic-errors -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mpku" } */ - + /* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h, xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, lwpintrin.h, -- popcntintrin.h, fmaintrin.h and mm_malloc.h.h are usable with -+ popcntintrin.h, fmaintrin.h, pkuintrin.h and mm_malloc.h.h are usable with +- popcntintrin.h, fmaintrin.h and mm_malloc.h.h are usable with ++ popcntintrin.h, fmaintrin.h, pkuintrin.h and mm_malloc.h.h are usable with -O -pedantic-errors. */ - + #include --- gcc/testsuite/g++.dg/other/i386-3.C (revision 231943) +++ gcc/testsuite/g++.dg/other/i386-3.C (revision 231945) @@ -486,11 +486,11 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt" } */ +/* { dg-options "-O -fkeep-inline-functions -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mpku" } */ - + /* Test that {,x,e,p,t,s,w,a,b,i}mmintrin.h, mm3dnow.h, fma4intrin.h, xopintrin.h, abmintrin.h, bmiintrin.h, tbmintrin.h, lwpintrin.h, - popcntintrin.h, fmaintrin.h and mm_malloc.h are usable with + popcntintrin.h, fmaintrin.h, pkuintrin.h and mm_malloc.h are usable with -O -fkeep-inline-functions. */ - + #include diff --git a/SOURCES/gcc48-rh1312436.patch b/SOURCES/gcc48-rh1312436.patch index 62494328..6bf9313e 100644 --- a/SOURCES/gcc48-rh1312436.patch +++ b/SOURCES/gcc48-rh1312436.patch @@ -7,16 +7,16 @@ --- gcc/dwarf2out.c (revision 231184) +++ gcc/dwarf2out.c (revision 231185) @@ -18051,18 +18051,23 @@ gen_subprogram_die (tree decl, dw_die_re - } - if (mode == VOIDmode || mode == BLKmode) - continue; + } + if (mode == VOIDmode || mode == BLKmode) + continue; - if (XEXP (XEXP (arg, 0), 0) == pc_rtx) + /* Get dynamic information about call target only if we + have no static information: we cannot generate both + DW_AT_abstract_origin and DW_AT_GNU_call_site_target + attributes. */ + if (ca_loc->symbol_ref == NULL_RTX) - { + { - gcc_assert (ca_loc->symbol_ref == NULL_RTX); - tloc = XEXP (XEXP (arg, 0), 1); - continue; @@ -38,18 +38,18 @@ + tlocc = XEXP (XEXP (arg, 0), 1); + continue; + } - } - reg = NULL; - if (REG_P (XEXP (XEXP (arg, 0), 0))) + } + reg = NULL; + if (REG_P (XEXP (XEXP (arg, 0), 0))) @@ -20842,15 +20847,27 @@ dwarf2out_var_location (rtx loc_note) if (!CALL_P (prev)) - prev = XVECEXP (PATTERN (prev), 0, 0); + prev = XVECEXP (PATTERN (prev), 0, 0); ca_loc->tail_call_p = SIBLING_CALL_P (prev); + + /* Look for a SYMBOL_REF in the "prev" instruction. */ x = get_call_rtx_from (PATTERN (prev)); if (x) - { + { - x = XEXP (XEXP (x, 0), 0); - if (GET_CODE (x) == SYMBOL_REF - && SYMBOL_REF_DECL (x) @@ -69,8 +69,8 @@ + && MEM_EXPR (x) + && TREE_CODE (MEM_EXPR (x)) == FUNCTION_DECL) + ca_loc->symbol_ref = XEXP (DECL_RTL (MEM_EXPR (x)), 0); - } + } + ca_loc->block = insn_scope (prev); if (call_arg_locations) - call_arg_loc_last->next = ca_loc; + call_arg_loc_last->next = ca_loc; diff --git a/SOURCES/gcc48-rh1344807.patch b/SOURCES/gcc48-rh1344807.patch index 01ba65c4..130f5581 100644 --- a/SOURCES/gcc48-rh1344807.patch +++ b/SOURCES/gcc48-rh1344807.patch @@ -10,16 +10,16 @@ --- gcc/cp/call.c.jj 2014-08-06 10:45:03.260163142 +0200 +++ gcc/cp/call.c 2016-06-15 11:15:06.663878423 +0200 @@ -1975,7 +1975,9 @@ add_function_candidate (struct z_candida - bool rv = FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (fn)); - parmtype = cp_build_reference_type (parmtype, rv); - if (TREE_CODE (arg) == CONVERT_EXPR + bool rv = FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (fn)); + parmtype = cp_build_reference_type (parmtype, rv); + if (TREE_CODE (arg) == CONVERT_EXPR - && TYPE_PTR_P (TREE_TYPE (arg))) + && TYPE_PTR_P (TREE_TYPE (arg)) + && (TREE_CODE (TREE_TYPE (TREE_OPERAND (arg, 0))) + == REFERENCE_TYPE)) - /* Strip conversion from reference to pointer. */ - arg = TREE_OPERAND (arg, 0); - arg = build_fold_indirect_ref (arg); + /* Strip conversion from reference to pointer. */ + arg = TREE_OPERAND (arg, 0); + arg = build_fold_indirect_ref (arg); --- gcc/testsuite/g++.dg/cpp0x/ref-qual17.C.jj 2016-06-15 11:12:57.692558903 +0200 +++ gcc/testsuite/g++.dg/cpp0x/ref-qual17.C 2016-06-15 11:07:02.000000000 +0200 @@ -0,0 +1,12 @@ diff --git a/SOURCES/gcc48-rh1369183.patch b/SOURCES/gcc48-rh1369183.patch index 6bc53121..7127d15f 100644 --- a/SOURCES/gcc48-rh1369183.patch +++ b/SOURCES/gcc48-rh1369183.patch @@ -14,7 +14,7 @@ @@ -418,6 +418,13 @@ gfc_compare_derived_types (gfc_symbol *d && !(derived1->attr.is_bind_c && derived2->attr.is_bind_c)) return 0; - + + /* Protect against null components. */ + if (derived1->attr.zero_comp != derived2->attr.zero_comp) + return 0; @@ -24,7 +24,7 @@ + dt1 = derived1->components; dt2 = derived2->components; - + --- gcc/testsuite/gfortran.dg/rh1369183.f90.jj 2017-03-07 18:37:39.574775432 +0100 +++ gcc/testsuite/gfortran.dg/rh1369183.f90 2017-03-07 18:38:38.423993194 +0100 @@ -0,0 +1,22 @@ @@ -43,7 +43,7 @@ +end module mod1369183 +subroutine rh1369183 + use mod1369183 -+ implicit none ++ implicit none + type test_t + sequence + end type test_t diff --git a/SOURCES/gcc48-rh1402585.patch b/SOURCES/gcc48-rh1402585.patch index 17f6dc22..3aa1cae9 100644 --- a/SOURCES/gcc48-rh1402585.patch +++ b/SOURCES/gcc48-rh1402585.patch @@ -1,32 +1,32 @@ --- gcc/reload.c (revision 235552) +++ gcc/reload.c (working copy) @@ -4054,14 +4054,14 @@ find_reloads (rtx insn, int replace, int - &XEXP (recog_data.operand[i], 0), (rtx*) 0, - base_reg_class (VOIDmode, as, MEM, SCRATCH), - address_mode, + &XEXP (recog_data.operand[i], 0), (rtx*) 0, + base_reg_class (VOIDmode, as, MEM, SCRATCH), + address_mode, - VOIDmode, 0, 0, i, RELOAD_FOR_INPUT); + VOIDmode, 0, 0, i, RELOAD_OTHER); - rld[operand_reloadnum[i]].inc - = GET_MODE_SIZE (GET_MODE (recog_data.operand[i])); - - /* If this operand is an output, we will have made any - reloads for its address as RELOAD_FOR_OUTPUT_ADDRESS, but - now we are treating part of the operand as an input, so + rld[operand_reloadnum[i]].inc + = GET_MODE_SIZE (GET_MODE (recog_data.operand[i])); + + /* If this operand is an output, we will have made any + reloads for its address as RELOAD_FOR_OUTPUT_ADDRESS, but + now we are treating part of the operand as an input, so - we must change these to RELOAD_FOR_INPUT_ADDRESS. */ + we must change these to RELOAD_FOR_OTHER_ADDRESS. */ - - if (modified[i] == RELOAD_WRITE) - { + + if (modified[i] == RELOAD_WRITE) + { @@ -4070,10 +4070,10 @@ find_reloads (rtx insn, int replace, int - if (rld[j].opnum == i) - { - if (rld[j].when_needed == RELOAD_FOR_OUTPUT_ADDRESS) + if (rld[j].opnum == i) + { + if (rld[j].when_needed == RELOAD_FOR_OUTPUT_ADDRESS) - rld[j].when_needed = RELOAD_FOR_INPUT_ADDRESS; + rld[j].when_needed = RELOAD_FOR_OTHER_ADDRESS; - else if (rld[j].when_needed - == RELOAD_FOR_OUTADDR_ADDRESS) + else if (rld[j].when_needed + == RELOAD_FOR_OUTADDR_ADDRESS) - rld[j].when_needed = RELOAD_FOR_INPADDR_ADDRESS; + rld[j].when_needed = RELOAD_FOR_OTHER_ADDRESS; - } - } - } + } + } + } diff --git a/SOURCES/gcc48-rh1468546.patch b/SOURCES/gcc48-rh1468546.patch index 75504912..2e8e616b 100644 --- a/SOURCES/gcc48-rh1468546.patch +++ b/SOURCES/gcc48-rh1468546.patch @@ -26,7 +26,7 @@ @@ -4953,6 +4953,10 @@ Define this macro if the code for function profiling should come before the function prologue. Normally, the profiling code comes after. @end defmac - + +@deftypefn {Target Hook} bool TARGET_KEEP_LEAF_WHEN_PROFILED (void) +This target hook returns true if the target wants the leaf flag for the current function to stay true even if it calls mcount. This might make sense for targets using the leaf flag only to determine whether a stack frame needs to be generated or not and for which the call to mcount is generated before the function prologue. +@end deftypefn @@ -39,7 +39,7 @@ @@ -3963,6 +3963,8 @@ Define this macro if the code for function profiling should come before the function prologue. Normally, the profiling code comes after. @end defmac - + +@hook TARGET_KEEP_LEAF_WHEN_PROFILED + @node Tail Calls @@ -50,20 +50,20 @@ @@ -4241,7 +4241,9 @@ leaf_function_p (void) { rtx insn; - + - if (crtl->profile || profile_arc_flag) + /* Some back-ends (e.g. s390) want leaf functions to stay leaf + functions even if they call mcount. */ + if (crtl->profile && !targetm.keep_leaf_when_profiled ()) return 0; - + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) --- gcc/target.def +++ gcc/target.def @@ -2658,6 +2658,18 @@ The default version of this hook use the target macro\n\ bool, (void), default_profile_before_prologue) - + +/* Return true if a leaf function should stay leaf even with profiling + enabled. */ +DEFHOOK @@ -84,7 +84,7 @@ @@ -1447,6 +1447,15 @@ default_get_reg_raw_mode (int regno) return reg_raw_mode[regno]; } - + +/* Return true if a leaf function should stay leaf even with profiling + enabled. */ + @@ -100,29 +100,29 @@ --- gcc/targhooks.h +++ gcc/targhooks.h @@ -188,6 +188,7 @@ extern section * default_function_sectio - bool startup, bool exit); + bool startup, bool exit); extern enum machine_mode default_dwarf_frame_reg_mode (int); extern enum machine_mode default_get_reg_raw_mode(int); +extern bool default_keep_leaf_when_profiled (); - + extern void *default_get_pch_validity (size_t *); extern const char *default_pch_valid_p (const void *, size_t); --- gcc/config/rs6000/rs6000.c +++ gcc/config/rs6000/rs6000.c @@ -24433,7 +24433,6 @@ rs6000_output_function_prologue (FILE *file, gcc_assert (!TARGET_32BIT); - + asm_fprintf (file, "\tmflr %s\n", reg_names[0]); - asm_fprintf (file, "\tstd %s,16(%s)\n", reg_names[0], reg_names[1]); - + /* In the ELFv2 ABI we have no compiler stack word. It must be - the resposibility of _mcount to preserve the static chain + the resposibility of _mcount to preserve the static chain --- gcc/config/rs6000/linux64.h +++ gcc/config/rs6000/linux64.h @@ -59,6 +59,9 @@ extern int dot_symbols; - + #define TARGET_PROFILE_KERNEL profile_kernel - + +#undef TARGET_KEEP_LEAF_WHEN_PROFILED +#define TARGET_KEEP_LEAF_WHEN_PROFILED rs6000_keep_leaf_when_profiled + @@ -134,7 +134,7 @@ @@ -26237,6 +26237,14 @@ rs6000_output_function_prologue (FILE *file, rs6000_pic_labelno++; } - + +/* -mprofile-kernel code calls mcount before the function prolog, + so a profiled leaf function should stay a leaf function. */ +static bool diff --git a/SOURCES/gcc48-rh1469384.patch b/SOURCES/gcc48-rh1469384.patch index 7dc70ba6..c6b9ad5c 100644 --- a/SOURCES/gcc48-rh1469384.patch +++ b/SOURCES/gcc48-rh1469384.patch @@ -1,5 +1,5 @@ 2017-07-25 Jonathan Wakely - + PR libstdc++/53984 * include/bits/basic_ios.h (basic_ios::_M_setstate): Adjust comment. * include/bits/istream.tcc (basic_istream::sentry): Handle exceptions @@ -14,7 +14,7 @@ @@ -157,8 +157,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION setstate(iostate __state) { this->clear(this->rdstate() | __state); } - + - // Flip the internal state on for the proper state bits, then re - // throws the propagated exception if bit also set in + // Flip the internal state on for the proper state bits, then @@ -39,7 +39,7 @@ - - const __ctype_type& __ct = __check_facet(__in._M_ctype); - while (!traits_type::eq_int_type(__c, __eof) -- && __ct.is(ctype_base::space, +- && __ct.is(ctype_base::space, - traits_type::to_char_type(__c))) - __c = __sb->snextc(); + __try @@ -57,7 +57,7 @@ + && __ct.is(ctype_base::space, + traits_type::to_char_type(__c))) + __c = __sb->snextc(); - + - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 195. Should basic_istream::sentry's constructor ever - // set eofbit? @@ -79,9 +79,9 @@ + } + __catch(...) + { __in._M_setstate(ios_base::badbit); } - + if (__in.good() && __err == ios_base::goodbit) - _M_ok = true; + _M_ok = true; --- libstdc++-v3/include/std/istream +++ libstdc++-v3/include/std/istream @@ -150,9 +150,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -95,7 +95,7 @@ + * ios_base::failure to be thrown) and the original exception will + * be rethrown if badbit is set in the exceptions mask. */ - + //@{ @@ -286,9 +286,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * by gcount(). @@ -108,7 +108,7 @@ + * ios_base::failure to be thrown) and the original exception will + * be rethrown if badbit is set in the exceptions mask. */ - + /** --- /dev/null +++ libstdc++-v3/testsuite/27_io/basic_fstream/53984.cc diff --git a/SOURCES/gcc48-rh1469697-1.patch b/SOURCES/gcc48-rh1469697-1.patch index 7bb83187..99a0a474 100644 --- a/SOURCES/gcc48-rh1469697-1.patch +++ b/SOURCES/gcc48-rh1469697-1.patch @@ -17,15 +17,15 @@ index 5b18468439d..4fb41b1112b 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -216,10 +216,6 @@ static const size_t extra_order_size_table[] = { - + #define ROUND_UP_VALUE(x, f) ((f) - 1 - ((f) - 1 + (x)) % (f)) - + -/* Compute the smallest multiple of F that is >= X. */ - -#define ROUND_UP(x, f) (CEIL (x, f) * (f)) - /* Round X to next multiple of the page size */ - + #define PAGE_ALIGN(x) (((x) + G.pagesize - 1) & ~(G.pagesize - 1)) diff --git a/gcc/hwint.h b/gcc/hwint.h index da62fadcc9e..64b1805345d 100644 @@ -34,11 +34,11 @@ index da62fadcc9e..64b1805345d 100644 @@ -76,7 +76,9 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1]; # endif #endif - + +#define HOST_WIDE_INT_UC(X) HOST_WIDE_INT_C (X ## U) #define HOST_WIDE_INT_1 HOST_WIDE_INT_C(1) +#define HOST_WIDE_INT_1U HOST_WIDE_INT_UC(1) - + /* This is a magic identifier which allows GCC to figure out the type of HOST_WIDE_INT for %wd specifier checks. You must issue this diff --git a/gcc/system.h b/gcc/system.h @@ -48,7 +48,7 @@ index 41cd565538a..8230d506fc3 100644 @@ -348,6 +348,12 @@ extern int errno; /* Returns the least number N such that N * Y >= X. */ #define CEIL(x,y) (((x) + (y) - 1) / (y)) - + +/* This macro rounds x up to the y boundary. */ +#define ROUND_UP(x,y) (((x) + (y) - 1) & ~((y) - 1)) + diff --git a/SOURCES/gcc48-rh1469697-10.patch b/SOURCES/gcc48-rh1469697-10.patch index 43277469..df9ae9fb 100644 --- a/SOURCES/gcc48-rh1469697-10.patch +++ b/SOURCES/gcc48-rh1469697-10.patch @@ -4,11 +4,11 @@ Date: Thu Sep 21 22:03:59 2017 +0000 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Fix dump output if the only stack space is for pushed registers. - + * lib/target-supports.exp (check_effective_target_frame_pointer_for_non_leaf): Add case for x86 Solaris. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253082 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c @@ -32,14 +32,14 @@ index a9072f58f50..d8a225195ae 100644 + dump_stack_clash_frame_info (NO_PROBE_NO_FRAME, false); return; } - + diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index f24c5c6e0ac..7c126e4122b 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5439,6 +5439,12 @@ proc check_effective_target_frame_pointer_for_non_leaf { } { if { [istarget aarch*-*-*] } { - return 1 + return 1 } + + # Solaris/x86 defaults to -fno-omit-frame-pointer. @@ -49,3 +49,4 @@ index f24c5c6e0ac..7c126e4122b 100644 + return 0 } + diff --git a/SOURCES/gcc48-rh1469697-11.patch b/SOURCES/gcc48-rh1469697-11.patch index 75913b43..16332f1f 100644 --- a/SOURCES/gcc48-rh1469697-11.patch +++ b/SOURCES/gcc48-rh1469697-11.patch @@ -18,11 +18,11 @@ Date: Mon Sep 25 23:13:55 2017 +0000 * rs6000.md (allocate_stack): Handle -fstack-clash-protection. (probe_stack_range): Operand 0 is now early-clobbered. Add additional operand and pass it to output_probe_stack_range. - + * lib/target-supports.exp (check_effective_target_supports_stack_clash_protection): Enable for rs6000 and powerpc targets. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253179 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h @@ -45,11 +45,11 @@ index a9052c6becf..c5d9988c1d9 100644 @@ -22320,6 +22320,220 @@ rs6000_emit_stack_tie (rtx fp, bool hard_frame_needed) emit_insn (gen_stack_tie (gen_rtx_PARALLEL (VOIDmode, p))); } - + +/* Allocate SIZE_INT bytes on the stack using a store with update style insn + and set the appropriate attributes for the generated insn. Return the + first insn which adjusts the stack pointer or the last insn before -+ the stack adjustment loop. ++ the stack adjustment loop. + + SIZE_INT is used to create the CFI note for the allocation. + @@ -74,7 +74,7 @@ index a9052c6becf..c5d9988c1d9 100644 + try_split (PATTERN (insn), insn, 0); + size_rtx = tmp_reg; + } -+ ++ + if (Pmode == SImode) + insn = emit_insn (gen_movsi_update_stack (stack_pointer_rtx, + stack_pointer_rtx, @@ -268,13 +268,13 @@ index a9052c6becf..c5d9988c1d9 100644 rtx tmp_reg = gen_rtx_REG (Pmode, 0); rtx todec = gen_int_mode (-size, Pmode); - rtx par, set, mem; - + if (INTVAL (todec) != -size) { @@ -22368,6 +22581,22 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, rtx copy_reg, int copy_off) - warning (0, "stack limit expression is not supported"); + warning (0, "stack limit expression is not supported"); } - + + if (flag_stack_clash_protection) + { + if (size < get_stack_clash_protection_guard_size ()) @@ -295,9 +295,9 @@ index a9052c6becf..c5d9988c1d9 100644 { if (copy_off != 0) @@ -22376,39 +22605,12 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, rtx copy_reg, int copy_off) - emit_move_insn (copy_reg, stack_reg); + emit_move_insn (copy_reg, stack_reg); } - + - if (size > 32767) - { - /* Need a note here so that try_split doesn't get confused. */ @@ -307,7 +307,7 @@ index a9052c6becf..c5d9988c1d9 100644 - try_split (PATTERN (insn), insn, 0); - todec = tmp_reg; - } -- +- - insn = emit_insn (TARGET_32BIT - ? gen_movsi_update_stack (stack_reg, stack_reg, - todec, stack_reg) @@ -334,27 +334,27 @@ index a9052c6becf..c5d9988c1d9 100644 + insn = rs6000_emit_allocate_stack_1 (size, stack_reg); + return; } - + #define PROBE_INTERVAL (1 << STACK_CHECK_PROBE_INTERVAL_EXP) @@ -22490,9 +22692,9 @@ rs6000_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size) - until it is equal to ROUNDED_SIZE. */ - + until it is equal to ROUNDED_SIZE. */ + if (TARGET_64BIT) - emit_insn (gen_probe_stack_rangedi (r12, r12, r0)); + emit_insn (gen_probe_stack_rangedi (r12, r12, stack_pointer_rtx, r0)); else - emit_insn (gen_probe_stack_rangesi (r12, r12, r0)); + emit_insn (gen_probe_stack_rangesi (r12, r12, stack_pointer_rtx, r0)); - - + + /* Step 4: probe at FIRST + SIZE if we cannot assert at compile-time @@ -22504,10 +22706,10 @@ rs6000_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size) } - + /* Probe a range of stack addresses from REG1 to REG2 inclusive. These are - absolute addresses. */ + addresses, not offsets. */ - + -const char * -output_probe_stack_range (rtx reg1, rtx reg2) +static const char * @@ -365,7 +365,7 @@ index a9052c6becf..c5d9988c1d9 100644 @@ -22546,6 +22748,63 @@ output_probe_stack_range (rtx reg1, rtx reg2) return ""; } - + +/* Probe a range of stack addresses from REG1 to REG3 inclusive. These are + addresses, not offsets. + @@ -427,9 +427,9 @@ index a9052c6becf..c5d9988c1d9 100644 with (plus:P (reg 1) VAL), and with REG2 replaced with RREG if REG2 is not NULL. It would be nice if dwarf2out_frame_debug_expr could @@ -23857,6 +24116,13 @@ rs6000_emit_prologue (void) - } + } } - + + /* If we are emitting stack probes, but allocate no stack, then + just note that in the dump file. */ + if (flag_stack_clash_protection @@ -465,12 +465,12 @@ index cd197213480..3cd70e592c1 100644 - (minus (reg 1) (match_operand 1 "reg_or_short_operand" ""))) + (minus (reg 1) (match_operand 1 "reg_or_cint_operand" ""))) (set (reg 1) - (minus (reg 1) (match_dup 1)))] + (minus (reg 1) (match_dup 1)))] "" @@ -11835,6 +11845,15 @@ rtx neg_op0; rtx insn, par, set, mem; - + + /* By allowing reg_or_cint_operand as the predicate we can get + better code for stack-clash-protection because we do not lose + size information. But the rest of the code expects the operand @@ -481,12 +481,12 @@ index cd197213480..3cd70e592c1 100644 + operands[1] = force_reg (Pmode, operands[1]); + emit_move_insn (chain, stack_bot); - + /* Check stack bounds if necessary. */ @@ -11847,6 +11866,51 @@ emit_insn (gen_cond_trap (LTU, available, operands[1], const0_rtx)); } - + + /* Allocate and probe if requested. + This may look similar to the loop we use for prologue allocations, + but it is critically different. For the former we know the loop @@ -500,7 +500,7 @@ index cd197213480..3cd70e592c1 100644 + compute_stack_clash_protection_loop_data (&rounded_size, &last_addr, + &residual, &probe_interval, + orig_op1); -+ ++ + /* We do occasionally get in here with constant sizes, we might + as well do a reasonable job when we obviously can. */ + if (rounded_size != const0_rtx) @@ -537,15 +537,15 @@ index cd197213480..3cd70e592c1 100644 || INTVAL (operands[1]) > 32768) @@ -12994,12 +13058,13 @@ (set_attr "length" "4")]) - + (define_insn "probe_stack_range" - [(set (match_operand:P 0 "register_operand" "=r") + [(set (match_operand:P 0 "register_operand" "=&r") - (unspec_volatile:P [(match_operand:P 1 "register_operand" "0") + (unspec_volatile:P [(match_operand:P 1 "register_operand" "0") - (match_operand:P 2 "register_operand" "r")] + (match_operand:P 2 "register_operand" "r") + (match_operand:P 3 "register_operand" "r")] - UNSPECV_PROBE_STACK_RANGE))] + UNSPECV_PROBE_STACK_RANGE))] "" - "* return output_probe_stack_range (operands[0], operands[2]);" + "* return output_probe_stack_range (operands[0], operands[2], operands[3]);" @@ -558,16 +558,16 @@ index 7c126e4122b..aba99513ed0 100644 +++ b/gcc/testsuite/lib/target-supports.exp @@ -5421,12 +5421,12 @@ proc check_effective_target_autoincdec { } { proc check_effective_target_supports_stack_clash_protection { } { - + # Temporary until the target bits are fully ACK'd. -# if { [istarget aarch*-*-*] -# || [istarget powerpc*-*-*] || [istarget rs6000*-*-*] } { +# if { [istarget aarch*-*-*] } { # return 1 # } - - if { [istarget x86_64-*-*] || [istarget i?86-*-*] + + if { [istarget x86_64-*-*] || [istarget i?86-*-*] + || [istarget powerpc*-*-*] || [istarget rs6000*-*-*] - || [istarget s390*-*-*] } { - return 1 + || [istarget s390*-*-*] } { + return 1 } diff --git a/SOURCES/gcc48-rh1469697-12.patch b/SOURCES/gcc48-rh1469697-12.patch index de7fc07d..2a7dd8fe 100644 --- a/SOURCES/gcc48-rh1469697-12.patch +++ b/SOURCES/gcc48-rh1469697-12.patch @@ -5,7 +5,7 @@ Date: Sun Oct 8 15:44:39 2017 +0000 * gcc.dg/stack-check-5.c: Skip with -fstack-protector. * gcc.dg/stack-check-6.c: Likewise. * gcc.dg/stack-check-6a.c: Likewise. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253527 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/testsuite/gcc.dg/stack-check-5.c b/gcc/testsuite/gcc.dg/stack-check-5.c @@ -17,8 +17,8 @@ index 3178f5d8ce5..850e023ea4e 100644 /* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */ /* { dg-require-effective-target supports_stack_clash_protection } */ +/* { dg-skip-if "" { *-*-* } { "-fstack-protector" } { "" } } */ - - + + /* Otherwise the S/390 back-end might save the stack pointer in f2 () diff --git a/gcc/testsuite/gcc.dg/stack-check-6.c b/gcc/testsuite/gcc.dg/stack-check-6.c index ad2021c9037..ab4b0e8894c 100644 @@ -29,8 +29,8 @@ index ad2021c9037..ab4b0e8894c 100644 /* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */ /* { dg-require-effective-target supports_stack_clash_protection } */ +/* { dg-skip-if "" { *-*-* } { "-fstack-protector" } { "" } } */ - - + + extern void foo (char *); diff --git a/gcc/testsuite/gcc.dg/stack-check-6a.c b/gcc/testsuite/gcc.dg/stack-check-6a.c index 6f8e7128921..468d649a4fa 100644 @@ -42,5 +42,6 @@ index 6f8e7128921..468d649a4fa 100644 /* { dg-require-effective-target supports_stack_clash_protection } */ +/* { dg-skip-if "" { *-*-* } { "-fstack-protector" } { "" } } */ + - + #include "stack-check-6.c" + diff --git a/SOURCES/gcc48-rh1469697-13.patch b/SOURCES/gcc48-rh1469697-13.patch index e8ac4b7b..64c98aa8 100644 --- a/SOURCES/gcc48-rh1469697-13.patch +++ b/SOURCES/gcc48-rh1469697-13.patch @@ -6,7 +6,7 @@ diff -rup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c 2017-11-03 10:41:10.654774032 -0600 @@ -10686,8 +10686,12 @@ ix86_expand_prologue (void) && (flag_stack_check == STATIC_BUILTIN_STACK_CHECK - || flag_stack_clash_protection)) + || flag_stack_clash_protection)) { - /* We expect the registers to be saved when probes are used. */ - gcc_assert (int_registers_saved); @@ -16,6 +16,6 @@ diff -rup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c + protection probing. */ + if (!flag_stack_clash_protection) + gcc_assert (int_registers_saved); - + if (flag_stack_clash_protection) - { + { diff --git a/SOURCES/gcc48-rh1469697-14.patch b/SOURCES/gcc48-rh1469697-14.patch index b6153d7d..bb060fdc 100644 --- a/SOURCES/gcc48-rh1469697-14.patch +++ b/SOURCES/gcc48-rh1469697-14.patch @@ -23,7 +23,7 @@ index 5afc167d569..cadf193cfcf 100644 @@ -969,6 +969,199 @@ aarch64_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) return true; } - + +static int +aarch64_internal_mov_immediate (rtx dest, rtx imm, bool generate, + enum machine_mode mode) @@ -218,12 +218,12 @@ index 5afc167d569..cadf193cfcf 100644 +} + /* Implement TARGET_PASS_BY_REFERENCE. */ - + static bool @@ -1476,6 +1669,47 @@ aarch64_libgcc_cmp_return_mode (void) return SImode; } - + +#define PROBE_INTERVAL (1 << STACK_CHECK_PROBE_INTERVAL_EXP) + +/* We use the 12-bit shifted immediate arithmetic instructions so values @@ -279,11 +279,11 @@ index 91299901bbf..17082486ac8 100644 + UNSPECV_PROBE_STACK_RANGE ; Represent stack range probing. UNSPEC_VSTRUCTDUMMY ]) - + @@ -3399,6 +3400,18 @@ [(set_attr "length" "0")] ) - + +(define_insn "probe_stack_range" + [(set (match_operand:DI 0 "register_operand" "=r") + (unspec_volatile:DI [(match_operand:DI 1 "register_operand" "0") diff --git a/SOURCES/gcc48-rh1469697-15.patch b/SOURCES/gcc48-rh1469697-15.patch index 6671acf8..e2df5314 100644 --- a/SOURCES/gcc48-rh1469697-15.patch +++ b/SOURCES/gcc48-rh1469697-15.patch @@ -9,10 +9,10 @@ Date: Tue Jan 13 14:11:15 2015 +0000 (*sub__shft_si_uxtw, *sub__multp2) (*sub_si_multp2_uxtw, *sub_uxt_multp2) (*sub_uxtsi_multp2_uxtw): Add stack pointer sources. - + gcc/testsuite/ * gcc.target/aarch64/subsp.c: New test. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219533 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md @@ -20,7 +20,7 @@ index 17082486ac8..a085c6acaf5 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -1610,8 +1610,8 @@ - + (define_insn "subsi3" [(set (match_operand:SI 0 "register_operand" "=rk") - (minus:SI (match_operand:SI 1 "register_operand" "r") @@ -33,93 +33,93 @@ index 17082486ac8..a085c6acaf5 100644 @@ -1622,7 +1622,7 @@ (define_insn "*subsi3_uxtw" [(set (match_operand:DI 0 "register_operand" "=rk") - (zero_extend:DI + (zero_extend:DI - (minus:SI (match_operand:SI 1 "register_operand" "r") + (minus:SI (match_operand:SI 1 "register_operand" "rk") - (match_operand:SI 2 "register_operand" "r"))))] + (match_operand:SI 2 "register_operand" "r"))))] "" "sub\\t%w0, %w1, %w2" @@ -1632,7 +1632,7 @@ - + (define_insn "subdi3" [(set (match_operand:DI 0 "register_operand" "=rk,!w") - (minus:DI (match_operand:DI 1 "register_operand" "r,!w") + (minus:DI (match_operand:DI 1 "register_operand" "rk,!w") - (match_operand:DI 2 "register_operand" "r,!w")))] + (match_operand:DI 2 "register_operand" "r,!w")))] "" "@ @@ -1725,7 +1725,7 @@ - + (define_insn "*sub__" [(set (match_operand:GPI 0 "register_operand" "=rk") - (minus:GPI (match_operand:GPI 1 "register_operand" "r") + (minus:GPI (match_operand:GPI 1 "register_operand" "rk") - (ANY_EXTEND:GPI - (match_operand:ALLX 2 "register_operand" "r"))))] + (ANY_EXTEND:GPI + (match_operand:ALLX 2 "register_operand" "r"))))] "" @@ -1738,7 +1738,7 @@ (define_insn "*sub__si_uxtw" [(set (match_operand:DI 0 "register_operand" "=rk") - (zero_extend:DI + (zero_extend:DI - (minus:SI (match_operand:SI 1 "register_operand" "r") + (minus:SI (match_operand:SI 1 "register_operand" "rk") - (ANY_EXTEND:SI - (match_operand:SHORT 2 "register_operand" "r")))))] + (ANY_EXTEND:SI + (match_operand:SHORT 2 "register_operand" "r")))))] "" @@ -1749,7 +1749,7 @@ - + (define_insn "*sub__shft_" [(set (match_operand:GPI 0 "register_operand" "=rk") - (minus:GPI (match_operand:GPI 1 "register_operand" "r") + (minus:GPI (match_operand:GPI 1 "register_operand" "rk") - (ashift:GPI (ANY_EXTEND:GPI - (match_operand:ALLX 2 "register_operand" "r")) - (match_operand 3 "aarch64_imm3" "Ui3"))))] + (ashift:GPI (ANY_EXTEND:GPI + (match_operand:ALLX 2 "register_operand" "r")) + (match_operand 3 "aarch64_imm3" "Ui3"))))] @@ -1763,7 +1763,7 @@ (define_insn "*sub__shft_si_uxtw" [(set (match_operand:DI 0 "register_operand" "=rk") - (zero_extend:DI + (zero_extend:DI - (minus:SI (match_operand:SI 1 "register_operand" "r") + (minus:SI (match_operand:SI 1 "register_operand" "rk") - (ashift:SI (ANY_EXTEND:SI - (match_operand:SHORT 2 "register_operand" "r")) - (match_operand 3 "aarch64_imm3" "Ui3")))))] + (ashift:SI (ANY_EXTEND:SI + (match_operand:SHORT 2 "register_operand" "r")) + (match_operand 3 "aarch64_imm3" "Ui3")))))] @@ -1775,7 +1775,7 @@ - + (define_insn "*sub__multp2" [(set (match_operand:GPI 0 "register_operand" "=rk") - (minus:GPI (match_operand:GPI 4 "register_operand" "r") + (minus:GPI (match_operand:GPI 4 "register_operand" "rk") - (ANY_EXTRACT:GPI - (mult:GPI (match_operand:GPI 1 "register_operand" "r") - (match_operand 2 "aarch64_pwr_imm3" "Up3")) + (ANY_EXTRACT:GPI + (mult:GPI (match_operand:GPI 1 "register_operand" "r") + (match_operand 2 "aarch64_pwr_imm3" "Up3")) @@ -1791,7 +1791,7 @@ (define_insn "*sub_si_multp2_uxtw" [(set (match_operand:DI 0 "register_operand" "=rk") - (zero_extend:DI + (zero_extend:DI - (minus:SI (match_operand:SI 4 "register_operand" "r") + (minus:SI (match_operand:SI 4 "register_operand" "rk") - (ANY_EXTRACT:SI - (mult:SI (match_operand:SI 1 "register_operand" "r") - (match_operand 2 "aarch64_pwr_imm3" "Up3")) + (ANY_EXTRACT:SI + (mult:SI (match_operand:SI 1 "register_operand" "r") + (match_operand 2 "aarch64_pwr_imm3" "Up3")) @@ -1805,7 +1805,7 @@ - + (define_insn "*sub_uxt_multp2" [(set (match_operand:GPI 0 "register_operand" "=rk") - (minus:GPI (match_operand:GPI 4 "register_operand" "r") + (minus:GPI (match_operand:GPI 4 "register_operand" "rk") - (and:GPI - (mult:GPI (match_operand:GPI 1 "register_operand" "r") - (match_operand 2 "aarch64_pwr_imm3" "Up3")) + (and:GPI + (mult:GPI (match_operand:GPI 1 "register_operand" "r") + (match_operand 2 "aarch64_pwr_imm3" "Up3")) @@ -1823,7 +1823,7 @@ (define_insn "*sub_uxtsi_multp2_uxtw" [(set (match_operand:DI 0 "register_operand" "=rk") - (zero_extend:DI + (zero_extend:DI - (minus:SI (match_operand:SI 4 "register_operand" "r") + (minus:SI (match_operand:SI 4 "register_operand" "rk") - (and:SI - (mult:SI (match_operand:SI 1 "register_operand" "r") - (match_operand 2 "aarch64_pwr_imm3" "Up3")) + (and:SI + (mult:SI (match_operand:SI 1 "register_operand" "r") + (match_operand 2 "aarch64_pwr_imm3" "Up3")) diff --git a/gcc/testsuite/gcc.target/aarch64/subsp.c b/gcc/testsuite/gcc.target/aarch64/subsp.c new file mode 100644 index 00000000000..70d848c59d1 diff --git a/SOURCES/gcc48-rh1469697-16.patch b/SOURCES/gcc48-rh1469697-16.patch index d212a46b..423f4484 100644 --- a/SOURCES/gcc48-rh1469697-16.patch +++ b/SOURCES/gcc48-rh1469697-16.patch @@ -18,12 +18,12 @@ index cadf193cfcf..e08632ffa88 100644 #include "dwarf2.h" +#include "params.h" +#include "dumpfile.h" - + /* Classifies an address. - + @@ -1696,7 +1698,14 @@ aarch64_output_probe_stack_range (rtx reg1, rtx reg2) output_asm_insn ("sub\t%0, %0, %1", xops); - + /* Probe at TEST_ADDR. */ - output_asm_insn ("str\txzr, [%0]", xops); + if (flag_stack_clash_protection) @@ -34,13 +34,13 @@ index cadf193cfcf..e08632ffa88 100644 + } + else + output_asm_insn ("str\txzr, [%0]", xops); - + /* Test if TEST_ADDR == LAST_ADDR. */ xops[1] = reg2; @@ -2001,6 +2010,123 @@ aarch64_save_or_restore_callee_save_registers (HOST_WIDE_INT offset, - base_rtx, cfi_ops); + base_rtx, cfi_ops); } - + +/* Allocate SIZE bytes of stack space using SCRATCH_REG as a scratch + register. */ + @@ -159,12 +159,12 @@ index cadf193cfcf..e08632ffa88 100644 +} + /* AArch64 stack frames generated by this compiler look like: - - +-------------------------------+ + + +-------------------------------+ @@ -2073,6 +2199,44 @@ aarch64_expand_prologue (void) - - original_frame_size - - cfun->machine->frame.saved_regs_size); - + - original_frame_size + - cfun->machine->frame.saved_regs_size); + + /* We do not fully protect aarch64 against stack clash style attacks + as doing so would be prohibitively expensive with less utility over + time as newer compilers are deployed. @@ -209,19 +209,19 @@ index cadf193cfcf..e08632ffa88 100644 @@ -2089,7 +2253,10 @@ aarch64_expand_prologue (void) frame_size -= (offset + crtl->outgoing_args_size); fp_offset = 0; - + - if (frame_size >= 0x1000000) + if (flag_stack_clash_protection + && frame_size >= guard_size - guard_used_by_caller) + aarch64_allocate_and_probe_stack_space (IP0_REGNUM, frame_size); + else if (frame_size >= 0x1000000) - { - rtx op0 = gen_rtx_REG (Pmode, IP0_REGNUM); - emit_move_insn (op0, GEN_INT (-frame_size)); + { + rtx op0 = gen_rtx_REG (Pmode, IP0_REGNUM); + emit_move_insn (op0, GEN_INT (-frame_size)); @@ -2206,10 +2373,30 @@ aarch64_expand_prologue (void) { if (crtl->outgoing_args_size > 0) - { + { - insn = emit_insn (gen_add2_insn - (stack_pointer_rtx, - GEN_INT (- crtl->outgoing_args_size))); @@ -250,13 +250,13 @@ index cadf193cfcf..e08632ffa88 100644 + } + else + aarch64_sub_sp (IP1_REGNUM, final_adjust, !frame_pointer_needed); - } + } } } @@ -5088,6 +5275,12 @@ aarch64_override_options (void) #endif } - + + /* We assume the guard page is 64k. */ + maybe_set_param_value (PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE, + 16, @@ -265,11 +265,11 @@ index cadf193cfcf..e08632ffa88 100644 + aarch64_override_options_after_change (); } - + @@ -8161,6 +8354,28 @@ aarch64_vectorize_vec_perm_const_ok (enum machine_mode vmode, return ret; } - + +/* It has been decided that to allow up to 1kb of outgoing argument + space to be allocated w/o probing. If more than 1kb of outgoing + argment space is allocated, then it must be probed and the last @@ -294,17 +294,17 @@ index cadf193cfcf..e08632ffa88 100644 + #undef TARGET_ADDRESS_COST #define TARGET_ADDRESS_COST aarch64_address_cost - + @@ -8378,6 +8593,10 @@ aarch64_vectorize_vec_perm_const_ok (enum machine_mode vmode, #undef TARGET_FIXED_CONDITION_CODE_REGS #define TARGET_FIXED_CONDITION_CODE_REGS aarch64_fixed_condition_code_regs - + +#undef TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE +#define TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE \ + aarch64_stack_clash_protection_final_dynamic_probe + struct gcc_target targetm = TARGET_INITIALIZER; - + #include "gt-aarch64.h" diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index a085c6acaf5..5485a5f70b1 100644 @@ -312,13 +312,13 @@ index a085c6acaf5..5485a5f70b1 100644 +++ b/gcc/config/aarch64/aarch64.md @@ -3401,7 +3401,7 @@ ) - + (define_insn "probe_stack_range" - [(set (match_operand:DI 0 "register_operand" "=r") + [(set (match_operand:DI 0 "register_operand" "=rk") - (unspec_volatile:DI [(match_operand:DI 1 "register_operand" "0") - (match_operand:DI 2 "register_operand" "r")] - UNSPECV_PROBE_STACK_RANGE))] + (unspec_volatile:DI [(match_operand:DI 1 "register_operand" "0") + (match_operand:DI 2 "register_operand" "r")] + UNSPECV_PROBE_STACK_RANGE))] diff --git a/gcc/testsuite/gcc.target/aarch64/stack-check-12.c b/gcc/testsuite/gcc.target/aarch64/stack-check-12.c new file mode 100644 index 00000000000..2ce38483b6b @@ -402,7 +402,7 @@ index 00000000000..59ffe01376d +/* This test has a constant sized alloca that is smaller than the + probe interval. But it actually requires two probes instead + of one because of the optimistic assumptions we made in the -+ aarch64 prologue code WRT probing state. ++ aarch64 prologue code WRT probing state. + + The form can change quite a bit so we just check for two + probes without looking at the actual address. */ @@ -432,7 +432,7 @@ index 00000000000..e06db6dc2f0 + +/* This test has a variable sized alloca. It requires 3 probes. + One in the loop, one for the residual and at the end of the -+ alloca area. ++ alloca area. + + The form can change quite a bit so we just check for two + probes without looking at the actual address. */ @@ -445,18 +445,18 @@ index aba99513ed0..a8451c98b08 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5420,14 +5420,9 @@ proc check_effective_target_autoincdec { } { - # + # proc check_effective_target_supports_stack_clash_protection { } { - + - # Temporary until the target bits are fully ACK'd. -# if { [istarget aarch*-*-*] } { -# return 1 -# } - - if { [istarget x86_64-*-*] || [istarget i?86-*-*] - || [istarget powerpc*-*-*] || [istarget rs6000*-*-*] + if { [istarget x86_64-*-*] || [istarget i?86-*-*] + || [istarget powerpc*-*-*] || [istarget rs6000*-*-*] - || [istarget s390*-*-*] } { + || [istarget aarch64*-**] || [istarget s390*-*-*] } { - return 1 + return 1 } return 0 diff --git a/SOURCES/gcc48-rh1469697-17.patch b/SOURCES/gcc48-rh1469697-17.patch index ef6eb4d1..614a8dbd 100644 --- a/SOURCES/gcc48-rh1469697-17.patch +++ b/SOURCES/gcc48-rh1469697-17.patch @@ -2,7 +2,7 @@ * config/i386/i386.c (ix86_emit_restore_reg_using_pop): Prototype. (ix86_adjust_stack_and_probe_stack_clash): Use a push/pop sequence to probe at the start of a noreturn function. - + * gcc.target/i386/stack-check-12.c: New test diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c @@ -10,10 +10,10 @@ diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c 2017-11-03 13:37:39.489361692 -0600 @@ -64,6 +64,7 @@ along with GCC; see the file COPYING3. #include "tree-flow.h" - + static rtx legitimize_dllimport_symbol (rtx, bool); +static void ix86_emit_restore_reg_using_pop (rtx); - + #ifndef CHECK_STACK_LIMIT #define CHECK_STACK_LIMIT (-1) @@ -9884,8 +9885,14 @@ ix86_adjust_stack_and_probe_stack_clash @@ -32,7 +32,7 @@ diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c + ix86_emit_restore_reg_using_pop (dummy_reg); emit_insn (gen_blockage ()); } - + diff -Nrup a/gcc/testsuite/gcc.target/i386/stack-check-12.c b/gcc/testsuite/gcc.target/i386/stack-check-12.c --- a/gcc/testsuite/gcc.target/i386/stack-check-12.c 1969-12-31 17:00:00.000000000 -0700 +++ b/gcc/testsuite/gcc.target/i386/stack-check-12.c 2017-11-03 13:36:15.104055651 -0600 diff --git a/SOURCES/gcc48-rh1469697-18.patch b/SOURCES/gcc48-rh1469697-18.patch index 07629b88..612fad4e 100644 --- a/SOURCES/gcc48-rh1469697-18.patch +++ b/SOURCES/gcc48-rh1469697-18.patch @@ -15,7 +15,7 @@ diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c @@ -9839,7 +9839,17 @@ release_scratch_register_on_entry (struc } } - + -#define PROBE_INTERVAL (1 << STACK_CHECK_PROBE_INTERVAL_EXP) +/* Return the probing interval for -fstack-clash-protection. */ + @@ -28,9 +28,9 @@ diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c + else + return (HOST_WIDE_INT_1U << STACK_CHECK_PROBE_INTERVAL_EXP); +} - + /* Emit code to adjust the stack pointer by SIZE bytes while probing it. - + @@ -9911,8 +9921,7 @@ ix86_adjust_stack_and_probe_stack_clash /* We're allocating a large enough stack frame that we need to emit probes. Either emit them inline or in a loop depending @@ -42,14 +42,14 @@ diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c { HOST_WIDE_INT i; @@ -9921,7 +9930,7 @@ ix86_adjust_stack_and_probe_stack_clash - /* Allocate PROBE_INTERVAL bytes. */ - rtx insn - = pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx, + /* Allocate PROBE_INTERVAL bytes. */ + rtx insn + = pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx, - GEN_INT (-PROBE_INTERVAL), -1, + GEN_INT (-probe_interval), -1, - m->fs.cfa_reg == stack_pointer_rtx); - add_reg_note (insn, REG_STACK_CHECK, const0_rtx); - + m->fs.cfa_reg == stack_pointer_rtx); + add_reg_note (insn, REG_STACK_CHECK, const0_rtx); + @@ -10014,7 +10023,7 @@ ix86_adjust_stack_and_probe (const HOST_ that's the easy case. The run-time loop is made up of 11 insns in the generic case while the compile-time loop is made up of 3+2*(n-1) insns @@ -60,91 +60,91 @@ diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c HOST_WIDE_INT i, adjust; bool first_probe = true; @@ -10023,15 +10032,15 @@ ix86_adjust_stack_and_probe (const HOST_ - values of N from 1 until it exceeds SIZE. If only one probe is - needed, this will not generate any code. Then adjust and probe - to PROBE_INTERVAL + SIZE. */ + values of N from 1 until it exceeds SIZE. If only one probe is + needed, this will not generate any code. Then adjust and probe + to PROBE_INTERVAL + SIZE. */ - for (i = PROBE_INTERVAL; i < size; i += PROBE_INTERVAL) + for (i = get_probe_interval (); i < size; i += get_probe_interval ()) - { - if (first_probe) - { + { + if (first_probe) + { - adjust = 2 * PROBE_INTERVAL + dope; + adjust = 2 * get_probe_interval () + dope; - first_probe = false; - } - else + first_probe = false; + } + else - adjust = PROBE_INTERVAL; + adjust = get_probe_interval (); - - emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx, - plus_constant (Pmode, stack_pointer_rtx, + + emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx, + plus_constant (Pmode, stack_pointer_rtx, @@ -10040,9 +10049,9 @@ ix86_adjust_stack_and_probe (const HOST_ - } - + } + if (first_probe) - adjust = size + PROBE_INTERVAL + dope; + adjust = size + get_probe_interval () + dope; else - adjust = size + PROBE_INTERVAL - i; + adjust = size + get_probe_interval () - i; - + emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx, - plus_constant (Pmode, stack_pointer_rtx, + plus_constant (Pmode, stack_pointer_rtx, @@ -10052,7 +10061,8 @@ ix86_adjust_stack_and_probe (const HOST_ /* Adjust back to account for the additional first interval. */ last = emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx, - plus_constant (Pmode, stack_pointer_rtx, + plus_constant (Pmode, stack_pointer_rtx, - PROBE_INTERVAL + dope))); + (get_probe_interval () + + dope)))); } - + /* Otherwise, do the same as above, but in a loop. Note that we must be @@ -10070,7 +10080,7 @@ ix86_adjust_stack_and_probe (const HOST_ - + /* Step 1: round SIZE to the previous multiple of the interval. */ - + - rounded_size = size & -PROBE_INTERVAL; + rounded_size = size & get_probe_interval (); - - + + /* Step 2: compute initial and final value of the loop counter. */ @@ -10078,7 +10088,7 @@ ix86_adjust_stack_and_probe (const HOST_ /* SP = SP_0 + PROBE_INTERVAL. */ emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx, - plus_constant (Pmode, stack_pointer_rtx, + plus_constant (Pmode, stack_pointer_rtx, - - (PROBE_INTERVAL + dope)))); + - (get_probe_interval () + dope)))); - + /* LAST_ADDR = SP_0 + PROBE_INTERVAL + ROUNDED_SIZE. */ emit_move_insn (sr.reg, GEN_INT (-rounded_size)); @@ -10115,7 +10125,8 @@ ix86_adjust_stack_and_probe (const HOST_ /* Adjust back to account for the additional first interval. */ last = emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx, - plus_constant (Pmode, stack_pointer_rtx, + plus_constant (Pmode, stack_pointer_rtx, - PROBE_INTERVAL + dope))); + (get_probe_interval () + + dope)))); - + release_scratch_register_on_entry (&sr); } @@ -10134,7 +10145,7 @@ ix86_adjust_stack_and_probe (const HOST_ XVECEXP (expr, 0, 1) - = gen_rtx_SET (VOIDmode, stack_pointer_rtx, - plus_constant (Pmode, stack_pointer_rtx, + = gen_rtx_SET (VOIDmode, stack_pointer_rtx, + plus_constant (Pmode, stack_pointer_rtx, - PROBE_INTERVAL + dope + size)); + get_probe_interval () + dope + size)); add_reg_note (last, REG_FRAME_RELATED_EXPR, expr); RTX_FRAME_RELATED_P (last) = 1; - + @@ -10168,7 +10179,7 @@ output_adjust_stack_and_probe (rtx reg) fputc ('\n', asm_out_file); - + /* SP = SP + PROBE_INTERVAL. */ - xops[1] = GEN_INT (PROBE_INTERVAL); + xops[1] = GEN_INT (get_probe_interval ()); output_asm_insn ("sub%z0\t{%1, %0|%0, %1}", xops); - + /* Probe at SP. */ @@ -10194,14 +10205,14 @@ ix86_emit_probe_stack_range (HOST_WIDE_I that's the easy case. The run-time loop is made up of 7 insns in the @@ -154,32 +154,32 @@ diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c + if (size <= 7 * get_probe_interval ()) { HOST_WIDE_INT i; - + /* Probe at FIRST + N * PROBE_INTERVAL for values of N from 1 until - it exceeds SIZE. If only one probe is needed, this will not - generate any code. Then probe at FIRST + SIZE. */ + it exceeds SIZE. If only one probe is needed, this will not + generate any code. Then probe at FIRST + SIZE. */ - for (i = PROBE_INTERVAL; i < size; i += PROBE_INTERVAL) + for (i = get_probe_interval (); i < size; i += get_probe_interval ()) - emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx, - -(first + i))); - + emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx, + -(first + i))); + @@ -10224,7 +10235,7 @@ ix86_emit_probe_stack_range (HOST_WIDE_I - + /* Step 1: round SIZE to the previous multiple of the interval. */ - + - rounded_size = size & -PROBE_INTERVAL; + rounded_size = size & -get_probe_interval (); - - + + /* Step 2: compute initial and final value of the loop counter. */ @@ -10291,7 +10302,7 @@ output_probe_stack_range (rtx reg, rtx e fputc ('\n', asm_out_file); - + /* TEST_ADDR = TEST_ADDR + PROBE_INTERVAL. */ - xops[1] = GEN_INT (PROBE_INTERVAL); + xops[1] = GEN_INT (get_probe_interval ()); output_asm_insn ("sub%z0\t{%1, %0|%0, %1}", xops); - + /* Probe at TEST_ADDR. */ diff -Nrup a/gcc/testsuite/gcc.dg/pr82788.c b/gcc/testsuite/gcc.dg/pr82788.c --- a/gcc/testsuite/gcc.dg/pr82788.c 1969-12-31 17:00:00.000000000 -0700 diff --git a/SOURCES/gcc48-rh1469697-19.patch b/SOURCES/gcc48-rh1469697-19.patch index 4812694f..655097eb 100644 --- a/SOURCES/gcc48-rh1469697-19.patch +++ b/SOURCES/gcc48-rh1469697-19.patch @@ -9,28 +9,28 @@ diff -Nrup a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md --- a/gcc/config/rs6000/rs6000.md 2017-11-06 09:12:21.128237467 -0700 +++ b/gcc/config/rs6000/rs6000.md 2017-11-06 09:13:40.521601373 -0700 @@ -11886,6 +11886,9 @@ - { - rtx loop_lab, end_loop; - bool rotated = CONST_INT_P (rounded_size); + { + rtx loop_lab, end_loop; + bool rotated = CONST_INT_P (rounded_size); + rtx update = GEN_INT (-probe_interval); + if (probe_interval > 32768) + update = force_reg (Pmode, update); - - emit_stack_clash_protection_probe_loop_start (&loop_lab, &end_loop, - last_addr, rotated); + + emit_stack_clash_protection_probe_loop_start (&loop_lab, &end_loop, + last_addr, rotated); @@ -11893,13 +11896,11 @@ - if (Pmode == SImode) - emit_insn (gen_movsi_update_stack (stack_pointer_rtx, - stack_pointer_rtx, + if (Pmode == SImode) + emit_insn (gen_movsi_update_stack (stack_pointer_rtx, + stack_pointer_rtx, - GEN_INT (-probe_interval), - chain)); + update, chain)); - else - emit_insn (gen_movdi_di_update_stack (stack_pointer_rtx, - stack_pointer_rtx, + else + emit_insn (gen_movdi_di_update_stack (stack_pointer_rtx, + stack_pointer_rtx, - GEN_INT (-probe_interval), - chain)); + update, chain)); - emit_stack_clash_protection_probe_loop_end (loop_lab, end_loop, - last_addr, rotated); - } + emit_stack_clash_protection_probe_loop_end (loop_lab, end_loop, + last_addr, rotated); + } diff --git a/SOURCES/gcc48-rh1469697-2.patch b/SOURCES/gcc48-rh1469697-2.patch index 304dc954..a4b1b9cb 100644 --- a/SOURCES/gcc48-rh1469697-2.patch +++ b/SOURCES/gcc48-rh1469697-2.patch @@ -14,13 +14,13 @@ Date: Wed Sep 20 04:56:54 2017 +0000 Note that -fstack-check is primarily for Ada and refer users to -fstack-clash-protection for stack-clash-protection. Document new params for stack clash protection. - + * gcc.dg/stack-check-2.c: New test. * lib/target-supports.exp (check_effective_target_supports_stack_clash_protection): New function. (check_effective_target_frame_pointer_for_non_leaf): Likewise. (check_effective_target_caller_implicit_probes): Likewise. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252994 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/common.opt b/gcc/common.opt @@ -29,17 +29,17 @@ index 16846c13b62..0c335cb12cd 100644 +++ b/gcc/common.opt @@ -1911,13 +1911,18 @@ Common Report Var(flag_variable_expansion_in_unroller) Optimization Apply variable expansion when loops are unrolled - + fstack-check= -Common Report RejectNegative Joined --fstack-check=[no|generic|specific] Insert stack checking code into the program +Common Report RejectNegative Joined Optimization +-fstack-check=[no|generic|specific] Insert stack checking code into the program. - + fstack-check Common Alias(fstack-check=, specific, no) Insert stack checking code into the program. Same as -fstack-check=specific - + +fstack-clash-protection +Common Report Var(flag_stack_clash_protection) Optimization +Insert code to probe each page of stack space as it is allocated to protect @@ -47,7 +47,7 @@ index 16846c13b62..0c335cb12cd 100644 + fstack-limit Common Var(common_deferred_options) Defer - + diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index f7a15ca190e..313a6c5ff76 100644 --- a/gcc/doc/invoke.texi @@ -55,7 +55,7 @@ index f7a15ca190e..313a6c5ff76 100644 @@ -9406,6 +9406,21 @@ compilation for profile feedback and one for compilation without. The value for compilation with profile feedback needs to be more conservative (higher) in order to make tracer effective. - + +@item stack-clash-protection-guard-size +Specify the size of the operating system provided stack guard as +2 raised to @var{num} bytes. The default value is 12 (4096 bytes). @@ -72,7 +72,7 @@ index f7a15ca190e..313a6c5ff76 100644 +stack clash style attacks. + @item max-cse-path-length - + The maximum number of basic blocks on path that CSE considers. @@ -20949,7 +20964,8 @@ target support in the compiler but comes with the following drawbacks: @enumerate @@ -81,13 +81,13 @@ index f7a15ca190e..313a6c5ff76 100644 -allocated dynamically if their size exceeds a fixed threshold. +allocated dynamically if their size exceeds a fixed threshold. Note this +may change the semantics of some code. - + @item Fixed limit on the size of the static frame of functions: when it is @@ -20964,6 +20980,27 @@ generic implementation, code performance is hampered. Note that old-style stack checking is also the fallback method for @code{specific} if no target support has been added in the compiler. - + +@samp{-fstack-check=} is designed for Ada's needs to detect infinite recursion +and stack overflows. @samp{specific} is an excellent choice when compiling +Ada code. It is not generally sufficient to protect against stack-clash @@ -119,7 +119,7 @@ index 4fc5d33348e..21e943d38fa 100644 @@ -139,7 +139,14 @@ enum excess_precision EXCESS_PRECISION_STANDARD }; - + -/* Type of stack check. */ +/* Type of stack check. + @@ -137,9 +137,9 @@ index e51b847a7c4..e668624b0cb 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -208,6 +208,16 @@ DEFPARAM(PARAM_STACK_FRAME_GROWTH, - "Maximal stack frame growth due to inlining (in percent)", - 1000, 0, 0) - + "Maximal stack frame growth due to inlining (in percent)", + 1000, 0, 0) + +DEFPARAM(PARAM_STACK_CLASH_PROTECTION_GUARD_SIZE, + "stack-clash-protection-guard-size", + "Size of the stack guard expressed as a power of two.", @@ -230,7 +230,7 @@ index ef371ad7efd..821cea9cb33 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5392,3 +5392,95 @@ proc check_effective_target_fenv_exceptions {} { - } + } } "-std=gnu99"] } + @@ -254,11 +254,11 @@ index ef371ad7efd..821cea9cb33 100644 +# +# This is used to restrict the stack-clash mitigation tests to +# just those targets that have been explicitly supported. -+# ++# +# In addition to the prologue work on those targets, each target's +# properties should be described in the functions below so that +# tests do not become a mess of unreadable target conditions. -+# ++# +proc check_effective_target_supports_stack_clash_protection { } { + + # Temporary until the target bits are fully ACK'd. @@ -332,7 +332,7 @@ index 26f2ffb362c..1def163f8b9 100644 @@ -1520,6 +1520,28 @@ process_options (void) flag_associative_math = 0; } - + +#ifndef STACK_GROWS_DOWNWARD + /* -fstack-clash-protection is not currently supported on targets + where the stack grows up. */ diff --git a/SOURCES/gcc48-rh1469697-20.patch b/SOURCES/gcc48-rh1469697-20.patch index c67f025f..ad82c9b2 100644 --- a/SOURCES/gcc48-rh1469697-20.patch +++ b/SOURCES/gcc48-rh1469697-20.patch @@ -2,7 +2,7 @@ * explow.c (anti_adjust_stack_and_probe_stack_clash): Avoid probing the red zone for stack_clash_protection_final_dynamic_probe targets when the total dynamic stack size is zero bytes. - + diff -Nrup a/gcc/explow.c b/gcc/explow.c --- a/gcc/explow.c 2017-11-14 23:33:15.403557607 -0700 +++ b/gcc/explow.c 2017-11-14 23:33:56.243239120 -0700 @@ -18,20 +18,20 @@ diff -Nrup a/gcc/explow.c b/gcc/explow.c + if SIZE is not a compile time constant. */ + /* Ideally we would just probe at *sp. However, if SIZE is not - a compile-time constant, but is zero at runtime, then *sp - might hold live data. So probe at *sp if we know that + a compile-time constant, but is zero at runtime, then *sp + might hold live data. So probe at *sp if we know that @@ -1946,9 +1953,12 @@ anti_adjust_stack_and_probe_stack_clash - } + } else - { + { - emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx, - -GET_MODE_SIZE (word_mode))); + rtx label = gen_label_rtx (); + emit_cmp_and_jump_insns (size, CONST0_RTX (GET_MODE (size)), + EQ, NULL_RTX, Pmode, 1, label); + emit_stack_probe (stack_pointer_rtx); - emit_insn (gen_blockage ()); + emit_insn (gen_blockage ()); + emit_label (label); - } + } } } diff --git a/SOURCES/gcc48-rh1469697-21.patch b/SOURCES/gcc48-rh1469697-21.patch index 3057d6e8..0c694cc0 100644 --- a/SOURCES/gcc48-rh1469697-21.patch +++ b/SOURCES/gcc48-rh1469697-21.patch @@ -13,7 +13,7 @@ index b6c56602152..042e71904ec 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -1997,11 +1997,27 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) - + if (residual != CONST0_RTX (Pmode)) { + rtx label = NULL_RTX; @@ -31,22 +31,22 @@ index b6c56602152..042e71904ec 100644 + } + rtx x = force_reg (Pmode, plus_constant (Pmode, residual, - -GET_MODE_SIZE (word_mode))); + -GET_MODE_SIZE (word_mode))); anti_adjust_stack (residual); emit_stack_probe (gen_rtx_PLUS (Pmode, stack_pointer_rtx, x)); emit_insn (gen_blockage ()); + if (!CONST_INT_P (residual)) + emit_label (label); } - + /* Some targets make optimistic assumptions in their prologues about @@ -2014,28 +2030,20 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) - live data. Furthermore, we don't want to probe into the red - zone. - + live data. Furthermore, we don't want to probe into the red + zone. + - Go ahead and just guard a probe at *sp on SIZE != 0 at runtime + Go ahead and just guard the probe at *sp on SIZE != 0 at runtime - if SIZE is not a compile time constant. */ + if SIZE is not a compile time constant. */ - - /* Ideally we would just probe at *sp. However, if SIZE is not - a compile-time constant, but is zero at runtime, then *sp @@ -61,15 +61,15 @@ index b6c56602152..042e71904ec 100644 - else + rtx label = NULL_RTX; + if (!CONST_INT_P (size)) - { + { - rtx label = gen_label_rtx (); + label = gen_label_rtx (); - emit_cmp_and_jump_insns (size, CONST0_RTX (GET_MODE (size)), - EQ, NULL_RTX, Pmode, 1, label); + emit_cmp_and_jump_insns (size, CONST0_RTX (GET_MODE (size)), + EQ, NULL_RTX, Pmode, 1, label); - emit_stack_probe (stack_pointer_rtx); - emit_insn (gen_blockage ()); - emit_label (label); - } + } + + emit_stack_probe (stack_pointer_rtx); + emit_insn (gen_blockage ()); @@ -77,7 +77,7 @@ index b6c56602152..042e71904ec 100644 + emit_label (label); } } - + diff --git a/gcc/testsuite/gcc.target/i386/stack-check-18.c b/gcc/testsuite/gcc.target/i386/stack-check-18.c new file mode 100644 index 00000000000..6dbff4402da diff --git a/SOURCES/gcc48-rh1469697-22.patch b/SOURCES/gcc48-rh1469697-22.patch index 27a162b8..ee75edbf 100644 --- a/SOURCES/gcc48-rh1469697-22.patch +++ b/SOURCES/gcc48-rh1469697-22.patch @@ -7,7 +7,7 @@ diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c struct machine_function *m = cfun->machine; + struct ix86_frame frame; + ix86_compute_frame_layout (&frame); - + /* If this function does not statically allocate stack space, then no probes are needed. */ if (!size) @@ -16,12 +16,12 @@ diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c - ix86_compute_frame_layout (&frame); - /* However, the allocation of space via pushes for register - saves could be viewed as allocating space, but without the - need to probe. */ + saves could be viewed as allocating space, but without the + need to probe. */ @@ -9888,21 +9887,40 @@ ix86_adjust_stack_and_probe_stack_clash pointer could be anywhere in the guard page. The safe thing to do is emit a probe now. - + + The probe can be avoided if we have already emitted any callee + register saves into the stack or have a frame pointer (which will + have been saved as well). Those saves will function as implicit @@ -38,9 +38,9 @@ diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c + { /* We can safely use any register here since we're just going to push - its value and immediately pop it back. But we do try and avoid - argument passing registers so as not to introduce dependencies in - the pipeline. For 32 bit we use %esi and for 64 bit we use %rax. */ + its value and immediately pop it back. But we do try and avoid + argument passing registers so as not to introduce dependencies in + the pipeline. For 32 bit we use %esi and for 64 bit we use %rax. */ rtx dummy_reg = gen_rtx_REG (word_mode, TARGET_64BIT ? AX_REG : SI_REG); - rtx insn = emit_insn (gen_push (dummy_reg)); - RTX_FRAME_RELATED_P (insn) = 1; @@ -62,8 +62,8 @@ diff -Nrup a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c + } emit_insn (gen_blockage ()); } - - + + diff -Nrup a/gcc-4.8.5-20150702/gcc/testsuite/gcc.target/i386/stack-check-12.c b/gcc-4.8.5-20150702/gcc/testsuite/gcc.target/i386/stack-check-12.c --- gcc-4.8.5-20150702/gcc/testsuite/gcc.target/i386/stack-check-12.c 2018-01-03 15:42:40.849530670 -0700 +++ gcc-4.8.5-20150702/gcc/testsuite/gcc.target/i386/stack-check-12.c 2018-01-03 15:36:12.528488596 -0700 @@ -74,7 +74,7 @@ diff -Nrup a/gcc-4.8.5-20150702/gcc/testsuite/gcc.target/i386/stack-check-12.c b - asm volatile ("nop" ::: "edi"); exit (1); } - + diff -Nrup a/gcc-4.8.5-20150702/gcc/testsuite/gcc.target/i386/stack-check-17.c b/gcc-4.8.5-20150702/gcc/testsuite/gcc.target/i386/stack-check-17.c --- gcc-4.8.5-20150702/gcc/testsuite/gcc.target/i386/stack-check-17.c 1969-12-31 17:00:00.000000000 -0700 +++ gcc-4.8.5-20150702/gcc/testsuite/gcc.target/i386/stack-check-17.c 2018-01-03 15:36:12.528488596 -0700 @@ -91,7 +91,7 @@ diff -Nrup a/gcc-4.8.5-20150702/gcc/testsuite/gcc.target/i386/stack-check-17.c b +__attribute__ ((noreturn)) +void +f3 (void) -+{ ++{ + int y0 = x0; + int y1 = x1; + f1 (); diff --git a/SOURCES/gcc48-rh1469697-23.patch b/SOURCES/gcc48-rh1469697-23.patch index 61580d42..3b69367e 100644 --- a/SOURCES/gcc48-rh1469697-23.patch +++ b/SOURCES/gcc48-rh1469697-23.patch @@ -5,19 +5,19 @@ index d2ef83b..dcd2930 100644 @@ -29,9 +29,11 @@ f3 (void) into either a stack slot or callee saved register. The former would be rather dumb. So assume it does not happen. - + - So search for two/four pushes for the callee register saves/argument - pushes and no pops (since the function has no reachable epilogue). */ -/* { dg-final { scan-assembler-times "push\[ql\]" 2 { target { ! ia32 } } } } */ -/* { dg-final { scan-assembler-times "push\[ql\]" 4 { target { ia32 } } } } */ + So search for two pushes for the callee register saves pushes -+ and no pops (since the function has no reachable epilogue). ++ and no pops (since the function has no reachable epilogue). + + This is slightly different than upstream because the code we + generate for argument setup is slightly different. */ +/* { dg-final { scan-assembler-times "push\[ql\]" 2 } } */ /* { dg-final { scan-assembler-not "pop" } } */ - + diff --git a/gcc/testsuite/gcc.target/i386/stack-check-18.c b/gcc/testsuite/gcc.target/i386/stack-check-18.c index 6dbff44..1638f77 100644 --- a/gcc/testsuite/gcc.target/i386/stack-check-18.c @@ -27,9 +27,9 @@ index 6dbff44..1638f77 100644 /* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fdump-rtl-expand" } */ /* { dg-require-effective-target supports_stack_clash_protection } */ +/* { dg-skip-if "" { *-*-* } { "-fstack-protector" } { "" } } */ - + int f1 (char *); - + diff --git a/gcc/testsuite/gcc.target/i386/stack-check-19.c b/gcc/testsuite/gcc.target/i386/stack-check-19.c index b92c126..c341801 100644 --- a/gcc/testsuite/gcc.target/i386/stack-check-19.c @@ -39,12 +39,14 @@ index b92c126..c341801 100644 /* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fdump-rtl-expand" } */ /* { dg-require-effective-target supports_stack_clash_protection } */ +/* { dg-skip-if "" { *-*-* } { "-fstack-protector" } { "" } } */ - + int f1 (char *); - + @@ -24,6 +25,6 @@ f2 (const int size) in the probe loop and one that bypasses the residual probe. - + These will all be equality tests. */ -/* { dg-final { scan-assembler-times "(\?:je|jne)" 3 } } */ +/* { dg-final { scan-assembler-times "(\?:jmp|je|jne)" 3 } } */ + + diff --git a/SOURCES/gcc48-rh1469697-3.patch b/SOURCES/gcc48-rh1469697-3.patch index d17b2c19..6dbf24b8 100644 --- a/SOURCES/gcc48-rh1469697-3.patch +++ b/SOURCES/gcc48-rh1469697-3.patch @@ -3,7 +3,7 @@ Author: law Date: Wed Sep 20 05:05:12 2017 +0000 2017-09-18 Jeff Law - + * explow.c: Include "params.h" and "dumpfile.h". (anti_adjust_stack_and_probe_stack_clash): New function. (get_stack_check_protect): Likewise. @@ -30,9 +30,9 @@ Date: Wed Sep 20 05:05:12 2017 +0000 * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. * config/sparc/sparc.c (sparc_expand_prologue): Likewise. (sparc_flat_expand_prologue): Likewise. - + * gcc.dg/stack-check-3.c: New test. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252995 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c @@ -40,12 +40,12 @@ index 2874b8454a9..5402f5213d6 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -7625,7 +7625,7 @@ alpha_expand_prologue (void) - + probed_size = frame_size; if (flag_stack_check) - probed_size += STACK_CHECK_PROTECT; + probed_size += get_stack_check_protect (); - + if (probed_size <= 32768) { diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c @@ -53,45 +53,45 @@ index e36726ba722..d996fd160e8 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -10544,12 +10544,12 @@ ix86_expand_prologue (void) - HOST_WIDE_INT size = allocate; - - if (TARGET_64BIT && size >= (HOST_WIDE_INT) 0x80000000) + HOST_WIDE_INT size = allocate; + + if (TARGET_64BIT && size >= (HOST_WIDE_INT) 0x80000000) - size = 0x80000000 - STACK_CHECK_PROTECT - 1; + size = 0x80000000 - get_stack_check_protect () - 1; - - if (TARGET_STACK_PROBE) + + if (TARGET_STACK_PROBE) - ix86_emit_probe_stack_range (0, size + STACK_CHECK_PROTECT); + ix86_emit_probe_stack_range (0, size + get_stack_check_protect ()); - else + else - ix86_emit_probe_stack_range (STACK_CHECK_PROTECT, size); + ix86_emit_probe_stack_range (get_stack_check_protect (), size); - } + } } - + diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 50bbad6661c..390983936e8 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -3435,7 +3435,7 @@ ia64_expand_prologue (void) current_function_static_stack_size = current_frame_info.total_size; - + if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK) - ia64_emit_probe_stack_range (STACK_CHECK_PROTECT, + ia64_emit_probe_stack_range (get_stack_check_protect (), - current_frame_info.total_size, - current_frame_info.n_input_regs - + current_frame_info.n_local_regs); + current_frame_info.total_size, + current_frame_info.n_input_regs + + current_frame_info.n_local_regs); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 41c5d6b6b1f..9b7eb678f19 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -10746,7 +10746,7 @@ mips_expand_prologue (void) current_function_static_stack_size = size; - + if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK && size) - mips_emit_probe_stack_range (STACK_CHECK_PROTECT, size); + mips_emit_probe_stack_range (get_stack_check_protect (), size); - + /* Save the registers. Allocate up to MIPS_MAX_FIRST_STACK_STEP bytes beforehand; this is enough to cover the register save area diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c @@ -100,12 +100,12 @@ index 15583055895..a9052c6becf 100644 +++ b/gcc/config/rs6000/rs6000.c @@ -23214,7 +23214,8 @@ rs6000_emit_prologue (void) current_function_static_stack_size = info->total_size; - + if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK && info->total_size) - rs6000_emit_probe_stack_range (STACK_CHECK_PROTECT, info->total_size); + rs6000_emit_probe_stack_range (get_stack_check_protect (), + info->total_size); - + if (TARGET_FIX_AND_CONTINUE) { diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c @@ -114,20 +114,20 @@ index e5d326cdf23..e5e93c80261 100644 +++ b/gcc/config/sparc/sparc.c @@ -5431,7 +5431,7 @@ sparc_expand_prologue (void) current_function_static_stack_size = size; - + if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK && size) - sparc_emit_probe_stack_range (STACK_CHECK_PROTECT, size); + sparc_emit_probe_stack_range (get_stack_check_protect (), size); - + if (size == 0) ; /* do nothing. */ @@ -5533,7 +5533,7 @@ sparc_flat_expand_prologue (void) current_function_static_stack_size = size; - + if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK && size) - sparc_emit_probe_stack_range (STACK_CHECK_PROTECT, size); + sparc_emit_probe_stack_range (get_stack_check_protect (), size); - + if (sparc_save_local_in_regs_p) emit_save_or_restore_local_in_regs (stack_pointer_rtx, SPARC_STACK_BIAS, diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi @@ -137,7 +137,7 @@ index 6b18a2724bc..eeef757bf5b 100644 @@ -3571,6 +3571,10 @@ GCC computed the default from the values of the above macros and you will normally not need to override that default. @end defmac - + +@deftypefn {Target Hook} bool TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE (rtx @var{residual}) +Some targets make optimistic assumptions about the state of stack probing when they emit their prologues. On such targets a probe into the end of any dynamically allocated space is likely required for safety against stack clash style attacks. Define this variable to return nonzero if such a probe is required or zero otherwise. You need not define this macro if it would always have the value zero. +@end deftypefn @@ -152,7 +152,7 @@ index 7d0b3c73b2f..6707ca87236 100644 @@ -3539,6 +3539,8 @@ GCC computed the default from the values of the above macros and you will normally not need to override that default. @end defmac - + +@hook TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE + @need 2000 @@ -168,11 +168,11 @@ index 7da8bc75f19..2526e8513b7 100644 #include "output.h" +#include "params.h" +#include "dumpfile.h" - + static rtx break_out_memory_refs (rtx); +static void anti_adjust_stack_and_probe_stack_clash (rtx); - - + + /* Truncate and perhaps sign-extend C as appropriate for MODE. */ @@ -1140,6 +1143,29 @@ update_nonlocal_goto_save_area (void) emit_stack_save (SAVE_NONLOCAL, &r_save); @@ -203,29 +203,29 @@ index 7da8bc75f19..2526e8513b7 100644 + /* Return an rtx representing the address of an area of memory dynamically pushed on the stack. - + @@ -1393,7 +1419,7 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align, probe_stack_range (STACK_OLD_CHECK_PROTECT + STACK_CHECK_MAX_FRAME_SIZE, - size); + size); else if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK) - probe_stack_range (STACK_CHECK_PROTECT, size); + probe_stack_range (get_stack_check_protect (), size); - + /* Don't let anti_adjust_stack emit notes. */ suppress_reg_args_size = true; @@ -1451,6 +1477,8 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align, - + if (flag_stack_check && STACK_CHECK_MOVING_SP) - anti_adjust_stack_and_probe (size, false); + anti_adjust_stack_and_probe (size, false); + else if (flag_stack_clash_protection) + anti_adjust_stack_and_probe_stack_clash (size); else - anti_adjust_stack (size); - + anti_adjust_stack (size); + @@ -1712,6 +1740,219 @@ probe_stack_range (HOST_WIDE_INT first, rtx size) } } - + +/* Compute parameters for stack clash probing a dynamic stack + allocation of SIZE bytes. + @@ -461,7 +461,7 @@ index 91f3387c701..ab8ec27418d 100644 +extern void emit_stack_clash_protection_probe_loop_end (rtx, rtx, + rtx, bool); + - + /* In rtl.c */ extern rtx rtx_alloc_stat (RTX_CODE MEM_STAT_DECL); diff --git a/gcc/target.def b/gcc/target.def @@ -471,7 +471,7 @@ index 4d6081c3121..eb2bd46f7a1 100644 @@ -2580,6 +2580,13 @@ DEFHOOK void, (void), hook_void_void) - + +DEFHOOK +(stack_clash_protection_final_dynamic_probe, + "Some targets make optimistic assumptions about the state of stack probing when they emit their prologues. On such targets a probe into the end of any dynamically allocated space is likely required for safety against stack clash style attacks. Define this variable to return nonzero if such a probe is required or zero otherwise. You need not define this macro if it would always have the value zero.", @@ -489,7 +489,7 @@ index f6aa9907225..be23875538d 100644 @@ -1557,4 +1557,10 @@ default_canonicalize_comparison (int *, rtx *, rtx *, bool) { } - + +bool +default_stack_clash_protection_final_dynamic_probe (rtx residual ATTRIBUTE_UNUSED) +{ @@ -503,7 +503,7 @@ index b64274d3ff9..4acf33fae08 100644 +++ b/gcc/targhooks.h @@ -195,3 +195,4 @@ extern const char *default_pch_valid_p (const void *, size_t); extern void default_asm_output_ident_directive (const char*); - + extern bool default_member_type_forces_blk (const_tree, enum machine_mode); +extern bool default_stack_clash_protection_final_dynamic_probe (rtx); diff --git a/gcc/testsuite/gcc.dg/stack-check-3.c b/gcc/testsuite/gcc.dg/stack-check-3.c diff --git a/SOURCES/gcc48-rh1469697-4.patch b/SOURCES/gcc48-rh1469697-4.patch index b39dd4bd..003d79f0 100644 --- a/SOURCES/gcc48-rh1469697-4.patch +++ b/SOURCES/gcc48-rh1469697-4.patch @@ -10,7 +10,7 @@ Date: Wed Sep 20 05:21:09 2017 +0000 * config/sparc/sparc.c (sparc_expand_prologue): Likewise. (sparc_flat_expand_prologue): Likewise. * config/spu/spu.c (spu_expand_prologue): Likewise. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252996 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c @@ -19,65 +19,65 @@ index 5402f5213d6..c46c843e462 100644 +++ b/gcc/config/alpha/alpha.c @@ -7624,7 +7624,7 @@ alpha_expand_prologue (void) Note that we are only allowed to adjust sp once in the prologue. */ - + probed_size = frame_size; - if (flag_stack_check) + if (flag_stack_check || flag_stack_clash_protection) probed_size += get_stack_check_protect (); - + if (probed_size <= 32768) @@ -7639,7 +7639,7 @@ alpha_expand_prologue (void) - /* We only have to do this probe if we aren't saving registers or - if we are probing beyond the frame because of -fstack-check. */ - if ((sa_size == 0 && probed_size > probed - 4096) + /* We only have to do this probe if we aren't saving registers or + if we are probing beyond the frame because of -fstack-check. */ + if ((sa_size == 0 && probed_size > probed - 4096) - || flag_stack_check) + || flag_stack_check || flag_stack_clash_protection) - emit_insn (gen_probe_stack (GEN_INT (-probed_size))); - } - + emit_insn (gen_probe_stack (GEN_INT (-probed_size))); + } + @@ -7669,7 +7669,8 @@ alpha_expand_prologue (void) - late in the compilation, generate the loop as a single insn. */ + late in the compilation, generate the loop as a single insn. */ emit_insn (gen_prologue_stack_probe_loop (count, ptr)); - + - if ((leftover > 4096 && sa_size == 0) || flag_stack_check) + if ((leftover > 4096 && sa_size == 0) + || flag_stack_check || flag_stack_clash_protection) - { - rtx last = gen_rtx_MEM (DImode, - plus_constant (Pmode, ptr, -leftover)); + { + rtx last = gen_rtx_MEM (DImode, + plus_constant (Pmode, ptr, -leftover)); @@ -7677,7 +7678,7 @@ alpha_expand_prologue (void) - emit_move_insn (last, const0_rtx); - } - + emit_move_insn (last, const0_rtx); + } + - if (flag_stack_check) + if (flag_stack_check || flag_stack_clash_protection) - { - /* If -fstack-check is specified we have to load the entire - constant into a register and subtract from the sp in one go, + { + /* If -fstack-check is specified we have to load the entire + constant into a register and subtract from the sp in one go, diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 390983936e8..5bf7046cf15 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -2638,7 +2638,8 @@ ia64_compute_frame_size (HOST_WIDE_INT size) mark_reg_gr_used_mask (cfun->machine->ia64_eh_epilogue_bsp, NULL); - + /* Static stack checking uses r2 and r3. */ - if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK) + if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK + || flag_stack_clash_protection) current_frame_info.gr_used_mask |= 0xc; - + /* Find the size of the register stack frame. We have only 80 local @@ -3434,7 +3435,8 @@ ia64_expand_prologue (void) if (flag_stack_usage_info) current_function_static_stack_size = current_frame_info.total_size; - + - if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK) + if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK + || flag_stack_clash_protection) ia64_emit_probe_stack_range (get_stack_check_protect (), - current_frame_info.total_size, - current_frame_info.n_input_regs + current_frame_info.total_size, + current_frame_info.n_input_regs diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 9b7eb678f19..da17f94b4f9 100644 --- a/gcc/config/mips/mips.c @@ -85,13 +85,13 @@ index 9b7eb678f19..da17f94b4f9 100644 @@ -10745,7 +10745,9 @@ mips_expand_prologue (void) if (flag_stack_usage_info) current_function_static_stack_size = size; - + - if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK && size) + if ((flag_stack_check == STATIC_BUILTIN_STACK_CHECK + || flag_stack_clash_protection) + && size) mips_emit_probe_stack_range (get_stack_check_protect (), size); - + /* Save the registers. Allocate up to MIPS_MAX_FIRST_STACK_STEP diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index e5e93c80261..617aa617208 100644 @@ -100,42 +100,42 @@ index e5e93c80261..617aa617208 100644 @@ -5430,7 +5430,9 @@ sparc_expand_prologue (void) if (flag_stack_usage_info) current_function_static_stack_size = size; - + - if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK && size) + if ((flag_stack_check == STATIC_BUILTIN_STACK_CHECK + || flag_stack_clash_protection) + && size) sparc_emit_probe_stack_range (get_stack_check_protect (), size); - + if (size == 0) @@ -5532,7 +5534,9 @@ sparc_flat_expand_prologue (void) if (flag_stack_usage_info) current_function_static_stack_size = size; - + - if (flag_stack_check == STATIC_BUILTIN_STACK_CHECK && size) + if ((flag_stack_check == STATIC_BUILTIN_STACK_CHECK + || flag_stack_clash_protection) + && size) sparc_emit_probe_stack_range (get_stack_check_protect (), size); - + if (sparc_save_local_in_regs_p) diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index 328bd5bd2ae..5541a3cd243 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -1761,7 +1761,7 @@ spu_expand_prologue (void) - + if (total_size > 0) { - if (flag_stack_check) + if (flag_stack_check || flag_stack_clash_protection) - { - /* We compare against total_size-1 because - ($sp >= total_size) <=> ($sp > total_size-1) */ + { + /* We compare against total_size-1 because + ($sp >= total_size) <=> ($sp > total_size-1) */ @@ -5366,7 +5366,7 @@ spu_allocate_stack (rtx op0, rtx op1) emit_insn (gen_spu_convert (sp, stack_pointer_rtx)); emit_insn (gen_subv4si3 (sp, sp, splatted)); - + - if (flag_stack_check) + if (flag_stack_check || flag_stack_clash_protection) { diff --git a/SOURCES/gcc48-rh1469697-5.patch b/SOURCES/gcc48-rh1469697-5.patch index 43f5b33d..e56e7b11 100644 --- a/SOURCES/gcc48-rh1469697-5.patch +++ b/SOURCES/gcc48-rh1469697-5.patch @@ -5,7 +5,7 @@ Date: Wed Sep 20 05:23:51 2017 +0000 * function.c (dump_stack_clash_frame_info): New function. * function.h (dump_stack_clash_frame_info): Prototype. (enum stack_clash_probes): New enum. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252997 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/function.c b/gcc/function.c @@ -70,7 +70,7 @@ index 76baf307984..9b395aebcb3 100644 + /* Add a list of INSNS to the hash HASHP, possibly allocating HASHP for the first time. */ - + diff --git a/gcc/function.h b/gcc/function.h index 89d71e592dd..ffea1e564ba 100644 --- a/gcc/function.h @@ -78,7 +78,7 @@ index 89d71e592dd..ffea1e564ba 100644 @@ -712,6 +712,16 @@ extern void instantiate_decl_rtl (rtx x); and create duplicate blocks. */ extern void reorder_blocks (void); - + +enum stack_clash_probes { + NO_PROBE_NO_FRAME, + NO_PROBE_SMALL_FRAME, @@ -91,3 +91,4 @@ index 89d71e592dd..ffea1e564ba 100644 + /* Set BLOCK_NUMBER for all the blocks in FN. */ extern void number_blocks (tree); + diff --git a/SOURCES/gcc48-rh1469697-6.patch b/SOURCES/gcc48-rh1469697-6.patch index 663016c6..b08bb307 100644 --- a/SOURCES/gcc48-rh1469697-6.patch +++ b/SOURCES/gcc48-rh1469697-6.patch @@ -5,7 +5,7 @@ Date: Wed Sep 20 05:35:07 2017 +0000 * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): New. (ix86_expand_prologue): Dump stack clash info as needed. Call ix86_adjust_stack_and_probe_stack_clash as needed. - + * gcc.dg/stack-check-4.c: New test. * gcc.dg/stack-check-5.c: New test. * gcc.dg/stack-check-6.c: New test. @@ -17,7 +17,7 @@ Date: Wed Sep 20 05:35:07 2017 +0000 * lib/target-supports.exp (check_effective_target_supports_stack_clash_protection): Enable for x86 and x86_64 targets. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252998 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c @@ -25,9 +25,9 @@ index d996fd160e8..a555b0774c0 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -9839,6 +9839,147 @@ release_scratch_register_on_entry (struct scratch_reg *sr) - + #define PROBE_INTERVAL (1 << STACK_CHECK_PROBE_INTERVAL_EXP) - + +/* Emit code to adjust the stack pointer by SIZE bytes while probing it. + + This differs from the next routine in that it tries hard to prevent @@ -170,10 +170,10 @@ index d996fd160e8..a555b0774c0 100644 +} + /* Emit code to adjust the stack pointer by SIZE bytes while probing it. */ - + static void @@ -10529,12 +10670,19 @@ ix86_expand_prologue (void) - + /* The stack has already been decremented by the instruction calling us so probe if the size is non-negative to preserve the protection area. */ - if (allocate >= 0 && flag_stack_check == STATIC_BUILTIN_STACK_CHECK) @@ -183,7 +183,7 @@ index d996fd160e8..a555b0774c0 100644 { /* We expect the registers to be saved when probes are used. */ gcc_assert (int_registers_saved); - + - if (STACK_CHECK_MOVING_SP) + if (flag_stack_clash_protection) + { @@ -191,9 +191,9 @@ index d996fd160e8..a555b0774c0 100644 + allocate = 0; + } + else if (STACK_CHECK_MOVING_SP) - { - ix86_adjust_stack_and_probe (allocate); - allocate = 0; + { + ix86_adjust_stack_and_probe (allocate); + allocate = 0; diff --git a/gcc/testsuite/gcc.dg/stack-check-10.c b/gcc/testsuite/gcc.dg/stack-check-10.c new file mode 100644 index 00000000000..a86956ad692 @@ -247,12 +247,12 @@ index 58fb65649ee..f0bf7c71a5b 100644 +++ b/gcc/testsuite/gcc.dg/stack-check-3.c @@ -7,7 +7,7 @@ residual allocation + probe for f?. */ - + /* { dg-do compile } */ -/* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-expand -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=4096 --param stack-clash-protection-guard-size=4096" } */ +/* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-expand -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */ /* { dg-require-effective-target supports_stack_clash_protection } */ - + __attribute__((noinline, noclone)) void diff --git a/gcc/testsuite/gcc.dg/stack-check-4.c b/gcc/testsuite/gcc.dg/stack-check-4.c new file mode 100644 @@ -321,7 +321,7 @@ index 00000000000..2171d9b6c23 +int +f0 (int x, int y) +{ -+ asm volatile ("" : : : "memory"); ++ asm volatile ("" : : : "memory"); + return x + y; +} + @@ -330,7 +330,7 @@ index 00000000000..2171d9b6c23 +int +f1 (int x, int y) +{ -+ asm volatile ("" : : : "memory"); ++ asm volatile ("" : : : "memory"); + bar (); +} + @@ -451,7 +451,7 @@ index 00000000000..6f8e7128921 @@ -0,0 +1,17 @@ +/* The goal here is to verify that increasing the size of the guard allows + elimination of all probing on the relevant targets. */ -+ ++ +/* { dg-do compile } */ +/* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=16" } */ +/* { dg-require-effective-target supports_stack_clash_protection } */ @@ -530,7 +530,7 @@ index 00000000000..0ccec8b532a +__attribute__((noinline, noclone)) int +f0 (int x, int y) +{ -+ asm volatile ("" : : : "memory"); ++ asm volatile ("" : : : "memory"); + return x + y; +} + @@ -582,7 +582,7 @@ index 00000000000..0ccec8b532a +__attribute__((noinline, noclone)) int +f6 (int x, int y, V a, V b, V c) +{ -+ asm volatile ("" : : : "memory"); ++ asm volatile ("" : : : "memory"); + v = a + b + c; + return x + y; +} @@ -2687,7 +2687,7 @@ index 821cea9cb33..2c669a9822f 100644 +++ b/gcc/testsuite/lib/target-supports.exp @@ -5421,11 +5421,15 @@ proc check_effective_target_autoincdec { } { proc check_effective_target_supports_stack_clash_protection { } { - + # Temporary until the target bits are fully ACK'd. -# if { [istarget aarch*-*-*] || [istarget x86_64-*-*] -# || [istarget i?86-*-*] || [istarget s390*-*-*] @@ -2702,3 +2702,4 @@ index 821cea9cb33..2c669a9822f 100644 + } return 0 } + diff --git a/SOURCES/gcc48-rh1469697-7.patch b/SOURCES/gcc48-rh1469697-7.patch index fe6d5b58..0a86f92d 100644 --- a/SOURCES/gcc48-rh1469697-7.patch +++ b/SOURCES/gcc48-rh1469697-7.patch @@ -9,9 +9,9 @@ Date: Wed Sep 20 05:43:28 2017 +0000 * config/i386/i386.c (pro_epilogue_adjust_stack): Return insn. (ix86_adjust_satck_and_probe_stack_clash): Add REG_STACK_NOTEs. * reg-notes.def (STACK_CHECK): New note. - + * gcc.target/i386/stack-check-11.c: New test. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252999 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c @@ -19,14 +19,14 @@ index 0a4d8a51d1d..ee66c28ca35 100644 --- a/gcc/combine-stack-adj.c +++ b/gcc/combine-stack-adj.c @@ -441,6 +441,8 @@ combine_stack_adjustments_for_block (basic_block bb) - continue; - + continue; + set = single_set_for_csa (insn); + if (set && find_reg_note (insn, REG_STACK_CHECK, NULL_RTX)) + set = NULL_RTX; if (set) - { - rtx dest = SET_DEST (set); + { + rtx dest = SET_DEST (set); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a07104d304d..a9072f58f50 100644 --- a/gcc/config/i386/i386.c @@ -34,11 +34,11 @@ index a07104d304d..a9072f58f50 100644 @@ -9502,7 +9502,7 @@ ix86_add_queued_cfa_restore_notes (rtx insn) zero if %r11 register is live and cannot be freely used and positive otherwise. */ - + -static void +static rtx pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset, - int style, bool set_cfa) + int style, bool set_cfa) { @@ -9589,6 +9589,7 @@ pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset, m->fs.sp_offset = ooffset - INTVAL (offset); @@ -46,12 +46,12 @@ index a07104d304d..a9072f58f50 100644 } + return insn; } - + /* Find an available register to be used as dynamic realign argument @@ -9902,9 +9903,11 @@ ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size) for (i = probe_interval; i <= size; i += probe_interval) - { - /* Allocate PROBE_INTERVAL bytes. */ + { + /* Allocate PROBE_INTERVAL bytes. */ - pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx, - GEN_INT (-probe_interval), -1, - m->fs.cfa_reg == stack_pointer_rtx); @@ -60,9 +60,9 @@ index a07104d304d..a9072f58f50 100644 + GEN_INT (-PROBE_INTERVAL), -1, + m->fs.cfa_reg == stack_pointer_rtx); + add_reg_note (insn, REG_STACK_CHECK, const0_rtx); - - /* And probe at *sp. */ - emit_stack_probe (stack_pointer_rtx); + + /* And probe at *sp. */ + emit_stack_probe (stack_pointer_rtx); diff --git a/gcc/reg-notes.def b/gcc/reg-notes.def index db61c092aab..1d7a4356a85 100644 --- a/gcc/reg-notes.def @@ -82,7 +82,7 @@ index 4ac2542a3af..75780150e34 100644 @@ -4607,6 +4607,11 @@ parse_add_or_inc (struct mem_inc_info *mii, rtx insn, bool before_mem) if (RTX_FRAME_RELATED_P (insn) || !pat) return false; - + + /* Do not allow breaking data dependencies for insns that are marked + with REG_STACK_CHECK. */ + if (find_reg_note (insn, REG_STACK_CHECK, NULL)) diff --git a/SOURCES/gcc48-rh1469697-8.patch b/SOURCES/gcc48-rh1469697-8.patch index a24badcb..1c3cdd63 100644 --- a/SOURCES/gcc48-rh1469697-8.patch +++ b/SOURCES/gcc48-rh1469697-8.patch @@ -7,10 +7,10 @@ Date: Wed Sep 20 21:59:50 2017 +0000 CONST_INT_P before looking at INTVAL. (anti_adjust_stack_and_probe_stack_clash): Use CONST_INT_P instead of explicit test. - + * gcc.target/i386/stack-check-11.c: Update test and regexp so that it works for both i?86 and x86_64. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253034 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/explow.c b/gcc/explow.c @@ -19,46 +19,46 @@ index 2526e8513b7..d118e0d7782 100644 +++ b/gcc/explow.c @@ -1778,11 +1778,11 @@ compute_stack_clash_protection_loop_data (rtx *rounded_size, rtx *last_addr, if (*rounded_size == CONST0_RTX (Pmode)) - fprintf (dump_file, - "Stack clash skipped dynamic allocation and probing loop.\n"); + fprintf (dump_file, + "Stack clash skipped dynamic allocation and probing loop.\n"); - else if (GET_CODE (*rounded_size) == CONST_INT + else if (CONST_INT_P (*rounded_size) - && INTVAL (*rounded_size) <= 4 * *probe_interval) - fprintf (dump_file, - "Stack clash dynamic allocation and probing inline.\n"); + && INTVAL (*rounded_size) <= 4 * *probe_interval) + fprintf (dump_file, + "Stack clash dynamic allocation and probing inline.\n"); - else if (GET_CODE (*rounded_size) == CONST_INT) + else if (CONST_INT_P (*rounded_size)) - fprintf (dump_file, - "Stack clash dynamic allocation and probing in " - "rotated loop.\n"); + fprintf (dump_file, + "Stack clash dynamic allocation and probing in " + "rotated loop.\n"); @@ -1880,7 +1880,8 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) - + if (rounded_size != CONST0_RTX (Pmode)) { - if (INTVAL (rounded_size) <= 4 * probe_interval) + if (CONST_INT_P (rounded_size) + && INTVAL (rounded_size) <= 4 * probe_interval) - { - for (HOST_WIDE_INT i = 0; - i < INTVAL (rounded_size); + { + for (HOST_WIDE_INT i = 0; + i < INTVAL (rounded_size); @@ -1900,7 +1901,7 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) else - { - rtx loop_lab, end_loop; + { + rtx loop_lab, end_loop; - bool rotate_loop = GET_CODE (rounded_size) == CONST_INT; + bool rotate_loop = CONST_INT_P (rounded_size); - emit_stack_clash_protection_probe_loop_start (&loop_lab, &end_loop, - last_addr, rotate_loop); - + emit_stack_clash_protection_probe_loop_start (&loop_lab, &end_loop, + last_addr, rotate_loop); + @@ -1938,7 +1939,7 @@ anti_adjust_stack_and_probe_stack_clash (rtx size) - might hold live data. So probe at *sp if we know that - an allocation was made, otherwise probe into the red zone - which is obviously undesirable. */ + might hold live data. So probe at *sp if we know that + an allocation was made, otherwise probe into the red zone + which is obviously undesirable. */ - if (GET_CODE (size) == CONST_INT) + if (CONST_INT_P (size)) - { - emit_stack_probe (stack_pointer_rtx); - emit_insn (gen_blockage ()); + { + emit_stack_probe (stack_pointer_rtx); + emit_insn (gen_blockage ()); diff --git a/gcc/testsuite/gcc.target/i386/stack-check-11.c b/gcc/testsuite/gcc.target/i386/stack-check-11.c index 183103f01e5..fe5b2c2b844 100644 --- a/gcc/testsuite/gcc.target/i386/stack-check-11.c @@ -66,7 +66,7 @@ index 183103f01e5..fe5b2c2b844 100644 @@ -2,15 +2,17 @@ /* { dg-options "-O2 -fstack-clash-protection" } */ /* { dg-require-effective-target supports_stack_clash_protection } */ - + -extern void arf (unsigned long int *, unsigned long int *); +#include + @@ -80,8 +80,9 @@ index 183103f01e5..fe5b2c2b844 100644 + uint64_t den[859]; arf (den, num); } - + -/* { dg-final { scan-assembler-times "subq" 4 } } */ -/* { dg-final { scan-assembler-times "orq" 3 } } */ +/* { dg-final { scan-assembler-times "sub\[ql\]" 4 } } */ +/* { dg-final { scan-assembler-times "or\[ql\]" 3 } } */ + diff --git a/SOURCES/gcc48-rh1469697-9.patch b/SOURCES/gcc48-rh1469697-9.patch index ed7c1c72..fb2903b8 100644 --- a/SOURCES/gcc48-rh1469697-9.patch +++ b/SOURCES/gcc48-rh1469697-9.patch @@ -10,12 +10,12 @@ Date: Thu Sep 21 04:30:16 2017 +0000 Dump actions when no stack is allocated. (s390_prologue_plus_offset): New function. (s390_emit_stack_probe): Likewise. - + * gcc.dg/stack-check-5.c: Add argument for s390. * lib/target-supports.exp: (check_effective_target_supports_stack_clash_protection): Enable for s390/s390x targets. - + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253049 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c @@ -25,7 +25,7 @@ index 3c04781f947..45998bc7516 100644 @@ -10350,6 +10350,184 @@ s390_emit_stack_tie (void) emit_insn (gen_stack_tie (mem)); } - + +/* Calculate TARGET = REG + OFFSET as s390_emit_prologue would do it. + - push too big immediates to the literal pool and annotate the refs + - emit frame related notes for stack pointer changes. */ @@ -205,12 +205,12 @@ index 3c04781f947..45998bc7516 100644 + + /* Expand the prologue into a bunch of separate insns. */ - + void @@ -10391,6 +10569,19 @@ s390_emit_prologue (void) else temp_reg = gen_rtx_REG (Pmode, 1); - + + /* When probing for stack-clash mitigation, we have to track the distance + between the stack pointer and closest known reference. + @@ -228,9 +228,9 @@ index 3c04781f947..45998bc7516 100644 if (cfun_frame_layout.first_save_gpr != -1) { @@ -10400,6 +10591,14 @@ s390_emit_prologue (void) - - cfun_frame_layout.first_save_gpr_slot), - cfun_frame_layout.first_save_gpr, - cfun_frame_layout.last_save_gpr); + - cfun_frame_layout.first_save_gpr_slot), + cfun_frame_layout.first_save_gpr, + cfun_frame_layout.last_save_gpr); + + /* This is not 100% correct. If we have more than one register saved, + then LAST_PROBE_OFFSET can move even closer to sp. */ @@ -241,34 +241,34 @@ index 3c04781f947..45998bc7516 100644 + emit_insn (insn); } - + @@ -10416,6 +10615,8 @@ s390_emit_prologue (void) if (cfun_fpr_bit_p (i)) - { - save_fpr (stack_pointer_rtx, offset, i + 16); + { + save_fpr (stack_pointer_rtx, offset, i + 16); + if (offset < last_probe_offset) + last_probe_offset = offset; - offset += 8; - } + offset += 8; + } else if (!TARGET_PACKED_STACK) @@ -10429,6 +10630,8 @@ s390_emit_prologue (void) if (cfun_fpr_bit_p (i)) - { - insn = save_fpr (stack_pointer_rtx, offset, i + 16); + { + insn = save_fpr (stack_pointer_rtx, offset, i + 16); + if (offset < last_probe_offset) + last_probe_offset = offset; - offset += 8; - - /* If f4 and f6 are call clobbered they are saved due to stdargs and + offset += 8; + + /* If f4 and f6 are call clobbered they are saved due to stdargs and @@ -10451,6 +10654,8 @@ s390_emit_prologue (void) - if (cfun_fpr_bit_p (i)) - { - insn = save_fpr (stack_pointer_rtx, offset, i + 16); + if (cfun_fpr_bit_p (i)) + { + insn = save_fpr (stack_pointer_rtx, offset, i + 16); + if (offset < last_probe_offset) + last_probe_offset = offset; - - RTX_FRAME_RELATED_P (insn) = 1; - offset -= 8; + + RTX_FRAME_RELATED_P (insn) = 1; + offset -= 8; @@ -10470,10 +10675,11 @@ s390_emit_prologue (void) if (cfun_frame_layout.frame_size > 0) { @@ -276,28 +276,28 @@ index 3c04781f947..45998bc7516 100644 - rtx real_frame_off; + rtx stack_pointer_backup_loc; + bool temp_reg_clobbered_p; - + if (s390_stack_size) - { + { - HOST_WIDE_INT stack_guard; - - if (s390_stack_guard) + HOST_WIDE_INT stack_guard; + + if (s390_stack_guard) @@ -10538,35 +10744,36 @@ s390_emit_prologue (void) if (s390_warn_dynamicstack_p && cfun->calls_alloca) - warning (0, "%qs uses dynamic stack allocation", current_function_name ()); - + warning (0, "%qs uses dynamic stack allocation", current_function_name ()); + - /* Save incoming stack pointer into temp reg. */ - if (TARGET_BACKCHAIN || next_fpr) - insn = emit_insn (gen_move_insn (temp_reg, stack_pointer_rtx)); + /* Save the location where we could backup the incoming stack + pointer. */ + stack_pointer_backup_loc = get_last_insn (); - + - /* Subtract frame size from stack pointer. */ + temp_reg_clobbered_p = allocate_stack_space (frame_off, last_probe_offset, + temp_reg); - + - if (DISP_IN_RANGE (INTVAL (frame_off))) - { - insn = gen_rtx_SET (VOIDmode, stack_pointer_rtx, @@ -307,7 +307,7 @@ index 3c04781f947..45998bc7516 100644 - } - else + if (TARGET_BACKCHAIN || next_fpr) - { + { - if (!CONST_OK_FOR_K (INTVAL (frame_off))) - frame_off = force_const_mem (Pmode, frame_off); - @@ -332,8 +332,8 @@ index 3c04781f947..45998bc7516 100644 + emit_insn_after (gen_move_insn (temp_reg, stack_pointer_rtx), + stack_pointer_backup_loc); + } - } - + } + - RTX_FRAME_RELATED_P (insn) = 1; - real_frame_off = GEN_INT (-cfun_frame_layout.frame_size); - add_reg_note (insn, REG_FRAME_RELATED_EXPR, @@ -342,48 +342,48 @@ index 3c04781f947..45998bc7516 100644 - real_frame_off))); - /* Set backchain. */ - + if (TARGET_BACKCHAIN) @@ -10590,6 +10797,8 @@ s390_emit_prologue (void) - emit_clobber (addr); - } + emit_clobber (addr); + } } + else if (flag_stack_clash_protection) + dump_stack_clash_frame_info (NO_PROBE_NO_FRAME, false); - + /* Save fprs 8 - 15 (64 bit ABI). */ - + diff --git a/gcc/testsuite/gcc.dg/stack-check-5.c b/gcc/testsuite/gcc.dg/stack-check-5.c index 2171d9b6c23..3178f5d8ce5 100644 --- a/gcc/testsuite/gcc.dg/stack-check-5.c +++ b/gcc/testsuite/gcc.dg/stack-check-5.c @@ -3,6 +3,10 @@ /* { dg-require-effective-target supports_stack_clash_protection } */ - - + + +/* Otherwise the S/390 back-end might save the stack pointer in f2 () + into an FPR. */ +/* { dg-additional-options "-msoft-float" { target { s390x-*-* } } } */ + extern void foo (char *); extern void bar (void); - + diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 2c669a9822f..f24c5c6e0ac 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5422,12 +5422,12 @@ proc check_effective_target_supports_stack_clash_protection { } { - + # Temporary until the target bits are fully ACK'd. # if { [istarget aarch*-*-*] -# || [istarget s390*-*-*] # || [istarget powerpc*-*-*] || [istarget rs6000*-*-*] } { # return 1 # } - + - if { [istarget x86_64-*-*] || [istarget i?86-*-*] } { -+ if { [istarget x86_64-*-*] || [istarget i?86-*-*] ++ if { [istarget x86_64-*-*] || [istarget i?86-*-*] + || [istarget s390*-*-*] } { - return 1 + return 1 } return 0 diff --git a/SOURCES/gcc48-rh1482762.patch b/SOURCES/gcc48-rh1482762.patch index 17e66327..bb570d44 100644 --- a/SOURCES/gcc48-rh1482762.patch +++ b/SOURCES/gcc48-rh1482762.patch @@ -11,7 +11,7 @@ +++ gcc/config/i386/i386.c (revision 246479) @@ -39533,9 +39533,6 @@ mode0 = DImode; - + rdrand_step: - op0 = gen_reg_rtx (mode0); - emit_insn (GEN_FCN (icode) (op0)); @@ -20,19 +20,19 @@ op1 = expand_normal (arg0); if (!address_operand (op1, VOIDmode)) @@ -39543,6 +39540,10 @@ - op1 = convert_memory_address (Pmode, op1); - op1 = copy_addr_to_reg (op1); - } + op1 = convert_memory_address (Pmode, op1); + op1 = copy_addr_to_reg (op1); + } + + op0 = gen_reg_rtx (mode0); + emit_insn (GEN_FCN (icode) (op0)); + emit_move_insn (gen_rtx_MEM (mode0, op1), op0); - + op1 = gen_reg_rtx (SImode); @@ -39584,9 +39597,6 @@ mode0 = DImode; - + rdseed_step: - op0 = gen_reg_rtx (mode0); - emit_insn (GEN_FCN (icode) (op0)); @@ -41,13 +41,13 @@ op1 = expand_normal (arg0); if (!address_operand (op1, VOIDmode)) @@ -39594,6 +39604,10 @@ - op1 = convert_memory_address (Pmode, op1); - op1 = copy_addr_to_reg (op1); - } + op1 = convert_memory_address (Pmode, op1); + op1 = copy_addr_to_reg (op1); + } + + op0 = gen_reg_rtx (mode0); + emit_insn (GEN_FCN (icode) (op0)); + emit_move_insn (gen_rtx_MEM (mode0, op1), op0); - + op2 = gen_reg_rtx (QImode); diff --git a/SOURCES/gcc48-rh1487434.patch b/SOURCES/gcc48-rh1487434.patch index 35e3780e..5295ce61 100644 --- a/SOURCES/gcc48-rh1487434.patch +++ b/SOURCES/gcc48-rh1487434.patch @@ -8,27 +8,27 @@ @@ -31339,8 +31339,8 @@ rs6000_elf_output_toc_section_asm_op (const void *data ATTRIBUTE_UNUSED) { if (!toc_initialized) - { + { - toc_initialized = 1; - fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); + fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); + ASM_OUTPUT_ALIGN (asm_out_file, TARGET_64BIT ? 3 : 2); - (*targetm.asm_out.internal_label) (asm_out_file, "LCTOC", 0); - fprintf (asm_out_file, "\t.tc "); - ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); + (*targetm.asm_out.internal_label) (asm_out_file, "LCTOC", 0); + fprintf (asm_out_file, "\t.tc "); + ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],"); @@ -31348,20 +31348,30 @@ rs6000_elf_output_toc_section_asm_op (const void *data ATTRIBUTE_UNUSED) - fprintf (asm_out_file, "\n"); - - fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); + fprintf (asm_out_file, "\n"); + + fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); + ASM_OUTPUT_ALIGN (asm_out_file, TARGET_64BIT ? 3 : 2); - ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); - fprintf (asm_out_file, " = .+32768\n"); + ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); + fprintf (asm_out_file, " = .+32768\n"); + toc_initialized = 1; - } + } else - fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); + fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); } else if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2) - && !TARGET_RELOCATABLE) + && !TARGET_RELOCATABLE) - fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); + { + fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP); @@ -42,8 +42,8 @@ { fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP); if (!toc_initialized) - { + { + ASM_OUTPUT_ALIGN (asm_out_file, TARGET_64BIT ? 3 : 2); - ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); - fprintf (asm_out_file, " = .+32768\n"); - toc_initialized = 1; + ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1"); + fprintf (asm_out_file, " = .+32768\n"); + toc_initialized = 1; diff --git a/SOURCES/gcc48-rh1491395.patch b/SOURCES/gcc48-rh1491395.patch index 97986503..f0a8bb42 100644 --- a/SOURCES/gcc48-rh1491395.patch +++ b/SOURCES/gcc48-rh1491395.patch @@ -9,8 +9,8 @@ +++ libitm/method-gl.cc @@ -291,12 +291,18 @@ public: // See begin_or_restart() for why we need release memory order here. - v = gl_mg::clear_locked(v) + 1; - o_gl_mg.orec.store(v, memory_order_release); + v = gl_mg::clear_locked(v) + 1; + o_gl_mg.orec.store(v, memory_order_release); - - // Need to ensure privatization safety. Every other transaction must - // have a snapshot time that is at least as high as our commit time @@ -30,7 +30,7 @@ + priv_time = v; return true; } - + --- libitm/method-ml.cc +++ libitm/method-ml.cc @@ -513,6 +513,21 @@ public: @@ -54,7 +54,7 @@ + priv_time = tx->shared_state.load(memory_order_relaxed); return true; } - + --- /dev/null +++ libitm/testsuite/libitm.c/priv-1.c @@ -0,0 +1,117 @@ diff --git a/SOURCES/gcc48-rh1535655-1.patch b/SOURCES/gcc48-rh1535655-1.patch index 259bfdac..2aa5bc1b 100644 --- a/SOURCES/gcc48-rh1535655-1.patch +++ b/SOURCES/gcc48-rh1535655-1.patch @@ -11,17 +11,17 @@ index e31c8d0..87fd381 100644 @@ -1115,6 +1115,9 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); /* Base register for access to local variables of the function. */ #define FRAME_POINTER_REGNUM 20 - + +#define FIRST_INT_REG AX_REG +#define LAST_INT_REG SP_REG + /* First floating point reg */ #define FIRST_FLOAT_REG 8 - + @@ -1317,6 +1320,9 @@ enum reg_class #define QI_REG_P(X) (REG_P (X) && QI_REGNO_P (REGNO (X))) #define QI_REGNO_P(N) IN_RANGE ((N), AX_REG, BX_REG) - + +#define LEGACY_INT_REG_P(X) (REG_P (X) && LEGACY_INT_REGNO_P (REGNO (X))) +#define LEGACY_INT_REGNO_P(N) (IN_RANGE ((N), FIRST_INT_REG, LAST_INT_REG)) + diff --git a/SOURCES/gcc48-rh1535655-2.patch b/SOURCES/gcc48-rh1535655-2.patch index 6ed4cf19..339098b8 100644 --- a/SOURCES/gcc48-rh1535655-2.patch +++ b/SOURCES/gcc48-rh1535655-2.patch @@ -11,7 +11,7 @@ index 11c0845..139d23c 100644 @@ -85,4 +85,16 @@ enum ix86_veclibabi { ix86_veclibabi_type_acml }; - + +/* This is used to mitigate variant #2 of the speculative execution + vulnerabilities on x86 processors identified by CVE-2017-5715, aka + Spectre. They convert indirect branches and function returns to @@ -31,10 +31,10 @@ index 96e7c5c..ecdf108 100644 +++ b/gcc/config/i386/i386-protos.h @@ -306,6 +306,7 @@ extern enum attr_cpu ix86_schedule; #endif - + extern const char * ix86_output_call_insn (rtx insn, rtx call_op); +extern const char * ix86_output_indirect_jmp (rtx call_op, bool ret_p); - + #ifdef RTX_CODE /* Target data for multipass lookahead scheduling. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c @@ -44,7 +44,7 @@ index b91a456..ebc9a90 100644 @@ -2572,12 +2572,23 @@ struct rtl_opt_pass pass_insert_vzeroupper = } }; - + -/* Return true if a red-zone is in use. */ +/* Return true if a red-zone is in use. We can't use red-zone when + there are local indirect jumps, like "indirect_jump" or "tablejump", @@ -55,7 +55,7 @@ index b91a456..ebc9a90 100644 + TODO: If we can reserve the first 2 WORDs, for PUSH and, another + for CALL, in red-zone, we can allow local indirect jumps with + indirect thunk. */ - + static inline bool ix86_using_red_zone (void) { @@ -69,7 +69,7 @@ index b91a456..ebc9a90 100644 /* Return a string that documents the current -m options. The caller is @@ -4595,6 +4606,37 @@ ix86_can_inline_p (tree caller, tree callee) } - + +/* Set the indirect_branch_type field from the function FNDECL. */ + @@ -104,7 +104,7 @@ index b91a456..ebc9a90 100644 + /* Remember the last target of ix86_set_current_function. */ static GTY(()) tree ix86_previous_fndecl; - + @@ -4609,6 +4651,9 @@ ix86_set_current_function (tree fndecl) slow things down too much or call target_reinit when it isn't safe. */ if (fndecl && fndecl != ix86_previous_fndecl) @@ -113,21 +113,21 @@ index b91a456..ebc9a90 100644 + ix86_set_indirect_branch_type (fndecl); + tree old_tree = (ix86_previous_fndecl - ? DECL_FUNCTION_SPECIFIC_TARGET (ix86_previous_fndecl) - : NULL_TREE); + ? DECL_FUNCTION_SPECIFIC_TARGET (ix86_previous_fndecl) + : NULL_TREE); @@ -4637,6 +4682,8 @@ ix86_set_current_function (tree fndecl) - target_reinit (); - } + target_reinit (); + } } + if (cfun && cfun->machine && fndecl) + ix86_set_indirect_branch_type (fndecl); } - + @@ -8668,6 +8715,196 @@ ix86_setup_frame_addresses (void) # endif #endif - + +/* Label count for call and return thunks. It is used to make unique + labels in call and return thunks. */ +static int indirectlabelno; @@ -319,12 +319,12 @@ index b91a456..ebc9a90 100644 +} + static int pic_labels_used; - + /* Fills in the label name that should be used for a pc thunk for @@ -8694,11 +8931,24 @@ ix86_code_end (void) rtx xops[2]; int regno; - + + if (indirect_thunk_needed) + output_indirect_thunk_function (-1); + @@ -339,17 +339,17 @@ index b91a456..ebc9a90 100644 { char name[32]; tree decl; - + + if ((indirect_thunks_used & (1 << regno))) + output_indirect_thunk_function (regno); + if (!(pic_labels_used & (1 << regno))) - continue; - + continue; + @@ -24074,12 +24324,250 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, return call; } - + +/* Output indirect branch via a call and return thunk. CALL_OP is a + register which contains the branch target. XASM is the assembly + template for CALL_OP. Branch is a tail call if SIBCALL_P is true. @@ -586,7 +586,7 @@ index b91a456..ebc9a90 100644 +} + /* Output the assembly for a call instruction. */ - + const char * ix86_output_call_insn (rtx insn, rtx call_op) { @@ -596,10 +596,10 @@ index b91a456..ebc9a90 100644 + && cfun->machine->indirect_branch_type != indirect_branch_keep); bool seh_nop_p = false; const char *xasm; - + @@ -24092,9 +24580,17 @@ ix86_output_call_insn (rtx insn, rtx call_op) else if (TARGET_SEH) - xasm = "rex.W jmp %A0"; + xasm = "rex.W jmp %A0"; else - xasm = "jmp\t%A0"; + { @@ -608,7 +608,7 @@ index b91a456..ebc9a90 100644 + else + xasm = "jmp\t%A0"; + } - + - output_asm_insn (xasm, &call_op); + if (output_indirect_p && !direct_p) + ix86_output_indirect_branch (call_op, xasm, true); @@ -616,7 +616,7 @@ index b91a456..ebc9a90 100644 + output_asm_insn (xasm, &call_op); return ""; } - + @@ -24131,9 +24627,17 @@ ix86_output_call_insn (rtx insn, rtx call_op) if (direct_p) xasm = "call\t%P0"; @@ -628,17 +628,17 @@ index b91a456..ebc9a90 100644 + else + xasm = "call\t%A0"; + } - + - output_asm_insn (xasm, &call_op); + if (output_indirect_p && !direct_p) + ix86_output_indirect_branch (call_op, xasm, false); + else + output_asm_insn (xasm, &call_op); - + if (seh_nop_p) return "nop"; @@ -35436,7 +35940,7 @@ ix86_handle_struct_attribute (tree *node, tree name, - + static tree ix86_handle_fndecl_attribute (tree *node, tree name, - tree args ATTRIBUTE_UNUSED, @@ -675,7 +675,7 @@ index b91a456..ebc9a90 100644 + return NULL_TREE; } - + @@ -38963,6 +39490,8 @@ static const struct attribute_spec ix86_attribute_table[] = false }, { "callee_pop_aggregate_return", 1, 1, false, true, true, @@ -692,7 +692,7 @@ index 87fd381..8183cee7 100644 @@ -2322,6 +2322,13 @@ struct GTY(()) machine_function { stack below the return address. */ BOOL_BITFIELD static_chain_on_stack : 1; - + + /* How to generate indirec branch. */ + ENUM_BITFIELD(indirect_branch) indirect_branch_type : 3; + @@ -713,7 +713,7 @@ index e09e961..b943849 100644 operands[0] = convert_memory_address (word_mode, operands[0]); + cfun->machine->has_local_indirect_jump = true; }) - + (define_insn "*indirect_jump" [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw"))] "" @@ -726,15 +726,15 @@ index e09e961..b943849 100644 + (const_string "multi") + (const_string "ibr"))) (set_attr "length_immediate" "0")]) - + (define_expand "tablejump" @@ -11324,14 +11329,19 @@ - + if (TARGET_X32) operands[0] = convert_memory_address (word_mode, operands[0]); + cfun->machine->has_local_indirect_jump = true; }) - + (define_insn "*tablejump_1" [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw")) (use (label_ref (match_operand 1)))] @@ -763,7 +763,7 @@ index e09e961..b943849 100644 + (const_string "multi") + (const_string "ibr"))) (set_attr "length_immediate" "0")]) - + (define_insn "nop" diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt index e93aa5a..0f6965a 100644 @@ -812,7 +812,7 @@ index e495af5..847991c 100644 +@samp{thunk-extern} converts indirect call and jump to external call +and return thunk provided in a separate object file. @end table - + On the PowerPC, the following options are allowed: diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 313a6c5..b299fbf 100644 @@ -825,13 +825,13 @@ index 313a6c5..b299fbf 100644 --mavx256-split-unaligned-load -mavx256-split-unaligned-store} +-mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol +-mindirect-branch=@var{choice}} - + @emph{i386 and x86-64 Windows Options} @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol @@ -14646,6 +14647,17 @@ to 255, 8-bit unsigned integer divide is used instead of @opindex avx256-split-unaligned-store Split 32-byte AVX unaligned load and store. - + +@item -mindirect-branch=@var{choice} +@opindex -mindirect-branch +Convert indirect call and jump with @var{choice}. The default is @@ -844,7 +844,7 @@ index 313a6c5..b299fbf 100644 +function attribute @code{indirect_branch}. @xref{Function Attributes}. + @end table - + These @samp{-m} switches are supported in addition to the above diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c new file mode 100644 diff --git a/SOURCES/gcc48-rh1535655-3.patch b/SOURCES/gcc48-rh1535655-3.patch index 89315ee6..903a76b8 100644 --- a/SOURCES/gcc48-rh1535655-3.patch +++ b/SOURCES/gcc48-rh1535655-3.patch @@ -9,11 +9,11 @@ index ecdf108..4e4b210 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -307,6 +307,7 @@ extern enum attr_cpu ix86_schedule; - + extern const char * ix86_output_call_insn (rtx insn, rtx call_op); extern const char * ix86_output_indirect_jmp (rtx call_op, bool ret_p); +extern const char * ix86_output_function_return (bool long_p); - + #ifdef RTX_CODE /* Target data for multipass lookahead scheduling. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c @@ -22,7 +22,7 @@ index ebc9a90..9dffd02f 100644 +++ b/gcc/config/i386/i386.c @@ -4635,6 +4635,31 @@ ix86_set_indirect_branch_type (tree fndecl) else - cfun->machine->indirect_branch_type = ix86_indirect_branch; + cfun->machine->indirect_branch_type = ix86_indirect_branch; } + + if (cfun->machine->function_return_type == indirect_branch_unset) @@ -50,11 +50,11 @@ index ebc9a90..9dffd02f 100644 + cfun->machine->function_return_type = ix86_function_return; + } } - + /* Remember the last target of ix86_set_current_function. */ @@ -8733,8 +8758,11 @@ static int indirect_thunks_used; /* Fills in the label name that should be used for the indirect thunk. */ - + static void -indirect_thunk_name (char name[32], int regno) +indirect_thunk_name (char name[32], int regno, bool ret_p) @@ -66,8 +66,8 @@ index ebc9a90..9dffd02f 100644 { if (regno >= 0) @@ -8748,14 +8776,22 @@ indirect_thunk_name (char name[32], int regno) - reg_prefix, reg_names[regno]); - } + reg_prefix, reg_names[regno]); + } else - sprintf (name, "__x86_indirect_thunk"); + { @@ -78,7 +78,7 @@ index ebc9a90..9dffd02f 100644 else { if (regno >= 0) - ASM_GENERATE_INTERNAL_LABEL (name, "LITR", regno); + ASM_GENERATE_INTERNAL_LABEL (name, "LITR", regno); else - ASM_GENERATE_INTERNAL_LABEL (name, "LIT", 0); + { @@ -89,20 +89,20 @@ index ebc9a90..9dffd02f 100644 + } } } - + @@ -8841,7 +8877,7 @@ output_indirect_thunk_function (int regno) tree decl; - + /* Create __x86_indirect_thunk. */ - indirect_thunk_name (name, regno); + indirect_thunk_name (name, regno, false); decl = build_decl (BUILTINS_LOCATION, FUNCTION_DECL, - get_identifier (name), - build_function_type_list (void_type_node, NULL_TREE)); + get_identifier (name), + build_function_type_list (void_type_node, NULL_TREE)); @@ -8885,6 +8921,36 @@ output_indirect_thunk_function (int regno) - ASM_OUTPUT_LABEL (asm_out_file, name); + ASM_OUTPUT_LABEL (asm_out_file, name); } - + + if (regno < 0) + { + /* Create alias for __x86.return_thunk/__x86.return_thunk_bnd. */ @@ -137,9 +137,9 @@ index ebc9a90..9dffd02f 100644 current_function_decl = decl; allocate_struct_function (decl, false); @@ -24353,7 +24419,7 @@ ix86_output_indirect_branch_via_reg (rtx call_op, bool sibcall_p) - i -= (FIRST_REX_INT_REG - LAST_INT_REG - 1); - indirect_thunks_used |= 1 << i; - } + i -= (FIRST_REX_INT_REG - LAST_INT_REG - 1); + indirect_thunks_used |= 1 << i; + } - indirect_thunk_name (thunk_name_buf, regno); + indirect_thunk_name (thunk_name_buf, regno, false); thunk_name = thunk_name_buf; @@ -148,7 +148,7 @@ index ebc9a90..9dffd02f 100644 @@ -24437,7 +24503,7 @@ ix86_output_indirect_branch_via_push (rtx call_op, const char *xasm, { if (cfun->machine->indirect_branch_type == indirect_branch_thunk) - indirect_thunk_needed = true; + indirect_thunk_needed = true; - indirect_thunk_name (thunk_name_buf, regno); + indirect_thunk_name (thunk_name_buf, regno, false); thunk_name = thunk_name_buf; @@ -157,7 +157,7 @@ index ebc9a90..9dffd02f 100644 @@ -24559,6 +24625,37 @@ ix86_output_indirect_jmp (rtx call_op, bool ret_p) return "jmp\t%A0"; } - + +/* Output function return. CALL_OP is the jump target. Add a REP + prefix to RET if LONG_P is true and function return is kept. */ + @@ -190,12 +190,12 @@ index ebc9a90..9dffd02f 100644 +} + /* Output the assembly for a call instruction. */ - + const char * @@ -35972,6 +36069,28 @@ ix86_handle_fndecl_attribute (tree *node, tree name, - } + } } - + + if (is_attribute_p ("function_return", name)) + { + tree cst = TREE_VALUE (args); @@ -220,7 +220,7 @@ index ebc9a90..9dffd02f 100644 + return NULL_TREE; } - + @@ -39492,6 +39611,9 @@ static const struct attribute_spec ix86_attribute_table[] = ix86_handle_callee_pop_aggregate_return, true }, { "indirect_branch", 1, 1, true, false, false, @@ -238,7 +238,7 @@ index 8183cee7..8ff7026 100644 @@ -2329,6 +2329,9 @@ struct GTY(()) machine_function { "indirect_jump" or "tablejump". */ BOOL_BITFIELD has_local_indirect_jump : 1; - + + /* How to generate function return. */ + ENUM_BITFIELD(indirect_branch) function_return_type : 3; + @@ -274,7 +274,7 @@ index 0f6965a..9dfa2cb 100644 @@ -635,9 +635,13 @@ mindirect-branch= Target Report RejectNegative Joined Enum(indirect_branch) Var(ix86_indirect_branch) Init(indirect_branch_keep) Convert indirect call and jump to call and return thunks. - + +mfunction-return= +Target Report RejectNegative Joined Enum(indirect_branch) Var(ix86_function_return) Init(indirect_branch_keep) +Convert function return to call and return thunk. @@ -283,7 +283,7 @@ index 0f6965a..9dfa2cb 100644 Name(indirect_branch) Type(enum indirect_branch) -Known indirect branch choices (for use with the -mindirect-branch= option): +Known indirect branch choices (for use with the -mindirect-branch=/-mfunction-return= options): - + EnumValue Enum(indirect_branch) String(keep) Value(indirect_branch_keep) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi @@ -304,7 +304,7 @@ index 847991c..add4f18 100644 +call and return thunk. @samp{thunk-extern} converts function return to +external call and return thunk provided in a separate object file. @end table - + On the PowerPC, the following options are allowed: diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index b299fbf..5acd23a 100644 @@ -316,13 +316,13 @@ index b299fbf..5acd23a 100644 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol --mindirect-branch=@var{choice}} +-mindirect-branch=@var{choice} -mfunction-return==@var{choice}} - + @emph{i386 and x86-64 Windows Options} @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol @@ -14658,6 +14658,17 @@ to external call and return thunk provided in a separate object file. You can control this behavior for a specific function by using the function attribute @code{indirect_branch}. @xref{Function Attributes}. - + +@item -mfunction-return=@var{choice} +@opindex -mfunction-return +Convert function return with @var{choice}. The default is @samp{keep}, @@ -335,7 +335,7 @@ index b299fbf..5acd23a 100644 +@xref{Function Attributes}. + @end table - + These @samp{-m} switches are supported in addition to the above diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c index 87f6dae..034b4cc 100644 @@ -345,9 +345,9 @@ index 87f6dae..034b4cc 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c index 6bc4f0a..e0c57cb 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c @@ -356,9 +356,9 @@ index 6bc4f0a..e0c57cb 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c index f20d35c..3c0d4c3 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c @@ -367,13 +367,13 @@ index f20d35c..3c0d4c3 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + @@ -12,7 +12,7 @@ male_indirect_jump (long offset) return 0; } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ @@ -387,13 +387,13 @@ index 0eff8fb..14d4ef6 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + @@ -12,7 +12,7 @@ male_indirect_jump (long offset) return 0; } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ @@ -407,13 +407,13 @@ index afdb600..bc6b47a 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + void func0 (void); void func1 (void); @@ -35,7 +35,7 @@ bar (int i) } } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ @@ -427,9 +427,9 @@ index efccdec..7c45142 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c index ca3814e..9eebc84 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c @@ -438,9 +438,9 @@ index ca3814e..9eebc84 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c index 97744d6..f938db0 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c @@ -449,13 +449,13 @@ index 97744d6..f938db0 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + @@ -14,7 +14,7 @@ male_indirect_jump (long offset) return 0; } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ @@ -469,13 +469,13 @@ index bfce3ea..4e58599 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + @@ -13,7 +13,7 @@ male_indirect_jump (long offset) return 0; } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ @@ -489,13 +489,13 @@ index 0833606..b8d5024 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + @@ -14,7 +14,7 @@ male_indirect_jump (long offset) return 0; } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ @@ -509,13 +509,13 @@ index 2eba0fb..455adab 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + @@ -13,7 +13,7 @@ male_indirect_jump (long offset) return 0; } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ @@ -529,13 +529,13 @@ index f58427e..4595b84 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ - + void func0 (void); void func1 (void); @@ -36,7 +36,7 @@ bar (int i) } } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ @@ -549,7 +549,7 @@ index 564ed39..d730d31 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + void func0 (void); void func1 (void); diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c @@ -560,9 +560,9 @@ index 7fd01d6..f424181 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c index 825f6b2..ac54868 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c @@ -571,9 +571,9 @@ index 825f6b2..ac54868 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c index 395634e..06ebf1c 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c @@ -582,13 +582,13 @@ index 395634e..06ebf1c 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + @@ -12,7 +12,7 @@ male_indirect_jump (long offset) return 0; } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ @@ -602,13 +602,13 @@ index fd3f633..1c8f944 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + @@ -12,7 +12,7 @@ male_indirect_jump (long offset) return 0; } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ @@ -622,13 +622,13 @@ index 6652523..86e9fd1 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ - + void func0 (void); void func1 (void); @@ -35,7 +35,7 @@ bar (int i) } } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ @@ -642,9 +642,9 @@ index 48c4dd4..4117a35 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c index 355dad5..650d55c 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c @@ -653,9 +653,9 @@ index 355dad5..650d55c 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c index 244fec7..9540996 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c @@ -664,13 +664,13 @@ index 244fec7..9540996 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + @@ -12,7 +12,7 @@ male_indirect_jump (long offset) return 0; } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ @@ -684,13 +684,13 @@ index 107ebe3..f3db6e2 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + @@ -12,7 +12,7 @@ male_indirect_jump (long offset) return 0; } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ @@ -704,13 +704,13 @@ index d02b1dc..764a375 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ - + void func0 (void); void func1 (void); @@ -35,7 +35,7 @@ bar (int i) } } - + -/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { ! x32 } } } } */ +/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { { ! x32 } && *-*-linux* } } } } */ /* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ diff --git a/SOURCES/gcc48-rh1535655-4.patch b/SOURCES/gcc48-rh1535655-4.patch index 480c3ba7..9856ee5d 100644 --- a/SOURCES/gcc48-rh1535655-4.patch +++ b/SOURCES/gcc48-rh1535655-4.patch @@ -9,14 +9,14 @@ index d567fd7..43faabb 100644 --- a/gcc/config/i386/constraints.md +++ b/gcc/config/i386/constraints.md @@ -135,7 +135,8 @@ - + (define_constraint "w" "@internal Call memory operand." - (and (not (match_test "TARGET_X32")) + (and (not (match_test "ix86_indirect_branch_register")) + (not (match_test "TARGET_X32")) (match_operand 0 "memory_operand"))) - + ;; Integer constant constraints. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index ef16cf5..228f8f6 100644 @@ -32,9 +32,9 @@ index ef16cf5..228f8f6 100644 cfun->machine->has_local_indirect_jump = true; }) @@ -11327,7 +11327,7 @@ - OPTAB_DIRECT); + OPTAB_DIRECT); } - + - if (TARGET_X32) + if (TARGET_X32 || ix86_indirect_branch_register) operands[0] = convert_memory_address (word_mode, operands[0]); @@ -42,28 +42,28 @@ index ef16cf5..228f8f6 100644 }) @@ -11514,7 +11514,7 @@ }) - + (define_insn "*call_pop" - [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lzm")) + [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lwz")) - (match_operand 1)) + (match_operand 1)) (set (reg:SI SP_REG) - (plus:SI (reg:SI SP_REG) + (plus:SI (reg:SI SP_REG) @@ -11612,7 +11612,7 @@ - + (define_insn "*call_value_pop" [(set (match_operand 0) - (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lzm")) + (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lwz")) - (match_operand 2))) + (match_operand 2))) (set (reg:SI SP_REG) - (plus:SI (reg:SI SP_REG) + (plus:SI (reg:SI SP_REG) diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt index 9dfa2cb..0a8ae8f 100644 --- a/gcc/config/i386/i386.opt +++ b/gcc/config/i386/i386.opt @@ -654,3 +654,7 @@ Enum(indirect_branch) String(thunk-inline) Value(indirect_branch_thunk_inline) - + EnumValue Enum(indirect_branch) String(thunk-extern) Value(indirect_branch_thunk_extern) + @@ -81,19 +81,19 @@ index 61614e1..6c7a593 100644 - (and (not (match_test "TARGET_X32")) + (and (not (match_test "ix86_indirect_branch_register")) + (not (match_test "TARGET_X32")) - (match_operand 0 "memory_operand")))) - + (match_operand 0 "memory_operand")))) + ;; Test for a valid operand for a call instruction. @@ -549,8 +550,9 @@ (ior (match_test "constant_call_address_operand - (op, mode == VOIDmode ? mode : Pmode)") + (op, mode == VOIDmode ? mode : Pmode)") (match_operand 0 "call_register_no_elim_operand") - (and (not (match_test "TARGET_X32")) - (match_operand 0 "memory_operand")))) + (and (not (match_test "ix86_indirect_branch_register")) + (and (not (match_test "TARGET_X32")) + (match_operand 0 "memory_operand"))))) - + ;; Similarly, but for tail calls, in which we cannot allow memory references. (define_special_predicate "sibcall_insn_operand" diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi @@ -107,19 +107,19 @@ index 5acd23a..4a365c7 100644 --mindirect-branch=@var{choice} -mfunction-return==@var{choice}} +-mindirect-branch=@var{choice} -mfunction-return==@var{choice} +-mindirect-branch-register} - + @emph{i386 and x86-64 Windows Options} @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol @@ -14669,6 +14670,10 @@ object file. You can control this behavior for a specific function by using the function attribute @code{function_return}. @xref{Function Attributes}. - + +@item -mindirect-branch-register +@opindex -mindirect-branch-register +Force indirect call and jump via register. + @end table - + These @samp{-m} switches are supported in addition to the above diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c index 034b4cc..321db77 100644 @@ -129,9 +129,9 @@ index 034b4cc..321db77 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c index e0c57cb..d584516 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c @@ -140,9 +140,9 @@ index e0c57cb..d584516 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c index 3c0d4c3..9e24a38 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c @@ -151,9 +151,9 @@ index 3c0d4c3..9e24a38 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c index 14d4ef6..127b5d9 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c @@ -162,9 +162,9 @@ index 14d4ef6..127b5d9 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c index bc6b47a..17c2d0f 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c @@ -173,7 +173,7 @@ index bc6b47a..17c2d0f 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + void func0 (void); void func1 (void); diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c @@ -184,9 +184,9 @@ index 7c45142..cd7e8d7 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c index 9eebc84..4dbd7a5 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c @@ -195,9 +195,9 @@ index 9eebc84..4dbd7a5 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c index f938db0..4aeec18 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c @@ -206,9 +206,9 @@ index f938db0..4aeec18 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c index 4e58599..ac0e599 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c @@ -217,9 +217,9 @@ index 4e58599..ac0e599 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c index b8d5024..573cf1e 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c @@ -228,9 +228,9 @@ index b8d5024..573cf1e 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c index 455adab..b2b37fc 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c @@ -239,9 +239,9 @@ index 455adab..b2b37fc 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c index 4595b84..4a43e19 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c @@ -250,7 +250,7 @@ index 4595b84..4a43e19 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -fno-pic" } */ - + void func0 (void); void func1 (void); diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c @@ -261,9 +261,9 @@ index f424181..72de88e 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c index ac54868..d4137b3 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c @@ -272,9 +272,9 @@ index ac54868..d4137b3 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c index 06ebf1c..d9964c2 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c @@ -283,9 +283,9 @@ index 06ebf1c..d9964c2 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c index 1c8f944..d4dca4d 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c @@ -294,9 +294,9 @@ index 1c8f944..d4dca4d 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c index 86e9fd1..aece938 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c @@ -305,7 +305,7 @@ index 86e9fd1..aece938 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ - + void func0 (void); void func1 (void); diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c @@ -316,9 +316,9 @@ index 4117a35..e3cea3f 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c index 650d55c..6222996 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c @@ -327,9 +327,9 @@ index 650d55c..6222996 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c index 9540996..2eef6f3 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c @@ -338,9 +338,9 @@ index 9540996..2eef6f3 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c index f3db6e2..e825a10 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c @@ -349,9 +349,9 @@ index f3db6e2..e825a10 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ - + typedef void (*dispatch_t)(long offset); - + diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c index 764a375..c67066c 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c @@ -360,7 +360,7 @@ index 764a375..c67066c 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ - + void func0 (void); void func1 (void); diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-1.c @@ -450,9 +450,9 @@ index 3a6727b..e6fea84 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=thunk-inline -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=thunk-inline -mindirect-branch=thunk -fno-pic" } */ - + extern void (*bar) (void); - + diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-11.c b/gcc/testsuite/gcc.target/i386/ret-thunk-11.c index b8f6818..e239ec4 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-11.c @@ -461,9 +461,9 @@ index b8f6818..e239ec4 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=thunk-extern -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=thunk-extern -mindirect-branch=thunk -fno-pic" } */ - + extern void (*bar) (void); - + diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-12.c b/gcc/testsuite/gcc.target/i386/ret-thunk-12.c index 01b0a02..fa31813 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-12.c @@ -472,9 +472,9 @@ index 01b0a02..fa31813 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk -fno-pic" } */ - + extern void (*bar) (void); - + diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-13.c b/gcc/testsuite/gcc.target/i386/ret-thunk-13.c index 4b497b5..fd5b41f 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-13.c @@ -483,7 +483,7 @@ index 4b497b5..fd5b41f 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-inline -fno-pic" } */ - + extern void (*bar) (void); extern int foo (void) __attribute__ ((function_return("thunk"))); diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-14.c b/gcc/testsuite/gcc.target/i386/ret-thunk-14.c @@ -494,9 +494,9 @@ index 4ae4c44..d606373 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=thunk-extern -fno-pic" } */ - + extern void (*bar) (void); - + diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-15.c b/gcc/testsuite/gcc.target/i386/ret-thunk-15.c index 5b5bc76..75e45e2 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-15.c @@ -505,9 +505,9 @@ index 5b5bc76..75e45e2 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=keep -mindirect-branch=keep -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=keep -mindirect-branch=keep -fno-pic" } */ - + extern void (*bar) (void); - + diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c index fa24a1f..d1db41c 100644 --- a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c @@ -516,5 +516,6 @@ index fa24a1f..d1db41c 100644 /* { dg-do compile } */ -/* { dg-options "-O2 -mfunction-return=thunk -mindirect-branch=thunk -fno-pic" } */ +/* { dg-options "-O2 -mno-indirect-branch-register -mno-indirect-branch-register -mfunction-return=thunk -mindirect-branch=thunk -fno-pic" } */ - + extern void (*bar) (void); + diff --git a/SOURCES/gcc48-rh1535655-5.patch b/SOURCES/gcc48-rh1535655-5.patch index d42eb358..16539c91 100644 --- a/SOURCES/gcc48-rh1535655-5.patch +++ b/SOURCES/gcc48-rh1535655-5.patch @@ -14,21 +14,21 @@ index 9dffd02f..e73389b 100644 If CODE is 'd', duplicate the operand for AVX instruction. + If CODE is 'V', print naked full integer register name without %. */ - + void @@ -14506,7 +14507,7 @@ print_reg (rtx x, int code, FILE *file) unsigned int regno; bool duplicated = code == 'd' && TARGET_AVX; - + - if (ASSEMBLER_DIALECT == ASM_ATT) + if (ASSEMBLER_DIALECT == ASM_ATT && code != 'V') putc ('%', file); - + if (x == pc_rtx) @@ -14542,6 +14543,14 @@ print_reg (rtx x, int code, FILE *file) else code = GET_MODE_SIZE (GET_MODE (x)); - + + if (code == 'V') + { + if (GENERAL_REGNO_P (regno)) @@ -49,13 +49,13 @@ index 9dffd02f..e73389b 100644 ; -- print a semicolon (after prefixes due to bug in older gas). ~ -- print "i" if TARGET_AVX2, "f" otherwise. @@ -14919,6 +14929,7 @@ ix86_print_operand (FILE *file, rtx x, int code) - case 'X': - case 'P': - case 'p': + case 'X': + case 'P': + case 'p': + case 'V': - break; - - case 's': + break; + + case 's': diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c new file mode 100644 index 0000000..f0cd9b7 diff --git a/SOURCES/gcc48-rh1535655-6.patch b/SOURCES/gcc48-rh1535655-6.patch index c1ecde70..815e0c67 100644 --- a/SOURCES/gcc48-rh1535655-6.patch +++ b/SOURCES/gcc48-rh1535655-6.patch @@ -9,9 +9,9 @@ index e73389b..15cfe83 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4634,6 +4634,19 @@ ix86_set_indirect_branch_type (tree fndecl) - } + } else - cfun->machine->indirect_branch_type = ix86_indirect_branch; + cfun->machine->indirect_branch_type = ix86_indirect_branch; + + /* -mcmodel=large is not compatible with -mindirect-branch=thunk + nor -mindirect-branch=thunk-extern. */ @@ -26,12 +26,12 @@ index e73389b..15cfe83 100644 + == indirect_branch_thunk_extern) + ? "thunk-extern" : "thunk")); } - + if (cfun->machine->function_return_type == indirect_branch_unset) @@ -4659,6 +4672,19 @@ ix86_set_indirect_branch_type (tree fndecl) - } + } else - cfun->machine->function_return_type = ix86_function_return; + cfun->machine->function_return_type = ix86_function_return; + + /* -mcmodel=large is not compatible with -mfunction-return=thunk + nor -mfunction-return=thunk-extern. */ @@ -47,7 +47,7 @@ index e73389b..15cfe83 100644 + ? "thunk-extern" : "thunk")); } } - + diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 4a365c7..7b33803 100644 --- a/gcc/doc/invoke.texi @@ -55,7 +55,7 @@ index 4a365c7..7b33803 100644 @@ -14659,6 +14659,11 @@ to external call and return thunk provided in a separate object file. You can control this behavior for a specific function by using the function attribute @code{indirect_branch}. @xref{Function Attributes}. - + +Note that @option{-mcmodel=large} is incompatible with +@option{-mindirect-branch=thunk} nor +@option{-mindirect-branch=thunk-extern} since the thunk function may @@ -67,7 +67,7 @@ index 4a365c7..7b33803 100644 @@ -14670,6 +14675,11 @@ object file. You can control this behavior for a specific function by using the function attribute @code{function_return}. @xref{Function Attributes}. - + +Note that @option{-mcmodel=large} is incompatible with +@option{-mfunction-return=thunk} nor +@option{-mfunction-return=thunk-extern} since the thunk function may diff --git a/SOURCES/gcc48-rh1537828-1.patch b/SOURCES/gcc48-rh1537828-1.patch new file mode 100644 index 00000000..45ac7eba --- /dev/null +++ b/SOURCES/gcc48-rh1537828-1.patch @@ -0,0 +1,38 @@ +2018-04-10 Segher Boessenkool + + PR target/85287 + * gcc/config/rs6000/rs6000.md (allocate_stack): Put the residual size + for stack clash protection in a register whenever we need it to be in + a register. + + +--- a/gcc/config/rs6000/rs6000.md 2018/04/10 21:09:30 259298 ++++ b/gcc/config/rs6000/rs6000.md 2018/04/10 21:37:34 259299 +@@ -9783,14 +9783,12 @@ + /* Now handle residuals. We just have to set operands[1] correctly + and let the rest of the expander run. */ + operands[1] = residual; +- if (!CONST_INT_P (residual)) +- operands[1] = force_reg (Pmode, operands[1]); + } + +- if (GET_CODE (operands[1]) != CONST_INT +- || INTVAL (operands[1]) < -32767 +- || INTVAL (operands[1]) > 32768) ++ if (!(CONST_INT_P (operands[1]) ++ && IN_RANGE (INTVAL (operands[1]), -32767, 32768))) + { ++ operands[1] = force_reg (Pmode, operands[1]); + neg_op0 = gen_reg_rtx (Pmode); + if (TARGET_32BIT) + emit_insn (gen_negsi2 (neg_op0, operands[1])); +@@ -9798,7 +9796,7 @@ + emit_insn (gen_negdi2 (neg_op0, operands[1])); + } + else +- neg_op0 = GEN_INT (- INTVAL (operands[1])); ++ neg_op0 = GEN_INT (-INTVAL (operands[1])); + + insn = emit_insn ((* ((TARGET_32BIT) ? gen_movsi_update_stack + : gen_movdi_di_update_stack)) + diff --git a/SOURCES/gcc48-rh1537828-10.patch b/SOURCES/gcc48-rh1537828-10.patch new file mode 100644 index 00000000..50978740 --- /dev/null +++ b/SOURCES/gcc48-rh1537828-10.patch @@ -0,0 +1,91 @@ +diff --git a/gcc/testsuite/gcc.dg/stack-check-5.c b/gcc/testsuite/gcc.dg/stack-check-5.c +index 850e023ea4e..604fa3cf6c5 100644 +--- a/gcc/testsuite/gcc.dg/stack-check-5.c ++++ b/gcc/testsuite/gcc.dg/stack-check-5.c +@@ -1,7 +1,7 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */ + /* { dg-require-effective-target supports_stack_clash_protection } */ +-/* { dg-skip-if "" { *-*-* } { "-fstack-protector" } { "" } } */ ++/* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */ + + + /* Otherwise the S/390 back-end might save the stack pointer in f2 () +diff --git a/gcc/testsuite/gcc.dg/stack-check-6.c b/gcc/testsuite/gcc.dg/stack-check-6.c +index ab4b0e8894c..fe75612b737 100644 +--- a/gcc/testsuite/gcc.dg/stack-check-6.c ++++ b/gcc/testsuite/gcc.dg/stack-check-6.c +@@ -1,7 +1,7 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=12" } */ + /* { dg-require-effective-target supports_stack_clash_protection } */ +-/* { dg-skip-if "" { *-*-* } { "-fstack-protector" } { "" } } */ ++/* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */ + + + extern void foo (char *); +diff --git a/gcc/testsuite/gcc.dg/stack-check-6a.c b/gcc/testsuite/gcc.dg/stack-check-6a.c +index 468d649a4fa..8fb9c621585 100644 +--- a/gcc/testsuite/gcc.dg/stack-check-6a.c ++++ b/gcc/testsuite/gcc.dg/stack-check-6a.c +@@ -4,7 +4,7 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -fstack-clash-protection -fdump-rtl-pro_and_epilogue -fno-optimize-sibling-calls --param stack-clash-protection-probe-interval=12 --param stack-clash-protection-guard-size=16" } */ + /* { dg-require-effective-target supports_stack_clash_protection } */ +-/* { dg-skip-if "" { *-*-* } { "-fstack-protector" } { "" } } */ ++/* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */ + + + #include "stack-check-6.c" +diff --git a/gcc/testsuite/gcc.target/i386/stack-check-11.c b/gcc/testsuite/gcc.target/i386/stack-check-11.c +index fe5b2c2b844..43a291857b6 100644 +--- a/gcc/testsuite/gcc.target/i386/stack-check-11.c ++++ b/gcc/testsuite/gcc.target/i386/stack-check-11.c +@@ -1,6 +1,8 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -fstack-clash-protection" } */ + /* { dg-require-effective-target supports_stack_clash_protection } */ ++/* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */ ++ + + #include + +diff --git a/gcc/testsuite/gcc.target/i386/stack-check-17.c b/gcc/testsuite/gcc.target/i386/stack-check-17.c +index dcd29305a2c..da6ea016815 100644 +--- a/gcc/testsuite/gcc.target/i386/stack-check-17.c ++++ b/gcc/testsuite/gcc.target/i386/stack-check-17.c +@@ -1,6 +1,8 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fomit-frame-pointer" } */ + /* { dg-require-effective-target supports_stack_clash_protection } */ ++/* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */ ++ + + + int x0, x1; +diff --git a/gcc/testsuite/gcc.target/i386/stack-check-18.c b/gcc/testsuite/gcc.target/i386/stack-check-18.c +index 1638f776267..1cf4bbcfafb 100644 +--- a/gcc/testsuite/gcc.target/i386/stack-check-18.c ++++ b/gcc/testsuite/gcc.target/i386/stack-check-18.c +@@ -1,7 +1,7 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fdump-rtl-expand" } */ + /* { dg-require-effective-target supports_stack_clash_protection } */ +-/* { dg-skip-if "" { *-*-* } { "-fstack-protector" } { "" } } */ ++/* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */ + + int f1 (char *); + +diff --git a/gcc/testsuite/gcc.target/i386/stack-check-19.c b/gcc/testsuite/gcc.target/i386/stack-check-19.c +index c341801189c..49f3a20af8b 100644 +--- a/gcc/testsuite/gcc.target/i386/stack-check-19.c ++++ b/gcc/testsuite/gcc.target/i386/stack-check-19.c +@@ -1,7 +1,7 @@ + /* { dg-do compile } */ + /* { dg-options "-O2 -fstack-clash-protection -mtune=generic -fdump-rtl-expand" } */ + /* { dg-require-effective-target supports_stack_clash_protection } */ +-/* { dg-skip-if "" { *-*-* } { "-fstack-protector" } { "" } } */ ++/* { dg-skip-if "" { *-*-* } { "-fstack-protector*" } { "" } } */ + + int f1 (char *); + diff --git a/SOURCES/gcc48-rh1537828-2.patch b/SOURCES/gcc48-rh1537828-2.patch new file mode 100644 index 00000000..7729d2c2 --- /dev/null +++ b/SOURCES/gcc48-rh1537828-2.patch @@ -0,0 +1,114 @@ +commit f7765f70e0e254fd9ce4469c7281c69cd06c9467 +Author: law +Date: Wed Jan 24 21:57:16 2018 +0000 + + PR target/83994 + * i386.c (get_probe_interval): Move to earlier point. + (ix86_compute_frame_layout): If -fstack-clash-protection and + the frame is larger than the probe interval, then use pushes + to save registers rather than reg->mem moves. + (ix86_expand_prologue): Remove conditional for int_registers_saved + assertion. + + PR target/83994 + * gcc.target/i386/pr83994.c: New test. + +diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c +index 15cfe83..5230227 100644 +--- a/gcc/config/i386/i386.c ++++ b/gcc/config/i386/i386.c +@@ -9371,6 +9371,18 @@ ix86_builtin_setjmp_frame_value (void) + return stack_realign_fp ? hard_frame_pointer_rtx : virtual_stack_vars_rtx; + } + ++/* Return the probing interval for -fstack-clash-protection. */ ++ ++static HOST_WIDE_INT ++get_probe_interval (void) ++{ ++ if (flag_stack_clash_protection) ++ return (HOST_WIDE_INT_1U ++ << PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL)); ++ else ++ return (HOST_WIDE_INT_1U << STACK_CHECK_PROBE_INTERVAL_EXP); ++} ++ + /* When using -fsplit-stack, the allocation routines set a field in + the TCB to the bottom of the stack plus this much space, measured + in bytes. */ +@@ -9545,7 +9557,15 @@ ix86_compute_frame_layout (struct ix86_frame *frame) + to_allocate = offset - frame->sse_reg_save_offset; + + if ((!to_allocate && frame->nregs <= 1) +- || (TARGET_64BIT && to_allocate >= (HOST_WIDE_INT) 0x80000000)) ++ || (TARGET_64BIT && to_allocate >= (HOST_WIDE_INT) 0x80000000) ++ /* If stack clash probing needs a loop, then it needs a ++ scratch register. But the returned register is only guaranteed ++ to be safe to use after register saves are complete. So if ++ stack clash protections are enabled and the allocated frame is ++ larger than the probe interval, then use pushes to save ++ callee saved registers. */ ++ || (flag_stack_clash_protection && to_allocate > get_probe_interval ())) ++ + frame->save_regs_using_mov = false; + + if (ix86_using_red_zone () +@@ -10181,18 +10201,6 @@ release_scratch_register_on_entry (struct scratch_reg *sr) + } + } + +-/* Return the probing interval for -fstack-clash-protection. */ +- +-static HOST_WIDE_INT +-get_probe_interval (void) +-{ +- if (flag_stack_clash_protection) +- return (HOST_WIDE_INT_1U +- << PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL)); +- else +- return (HOST_WIDE_INT_1U << STACK_CHECK_PROBE_INTERVAL_EXP); +-} +- + /* Emit code to adjust the stack pointer by SIZE bytes while probing it. + + This differs from the next routine in that it tries hard to prevent +@@ -11064,12 +11072,11 @@ ix86_expand_prologue (void) + && (flag_stack_check == STATIC_BUILTIN_STACK_CHECK + || flag_stack_clash_protection)) + { +- /* This assert wants to verify that integer registers were saved +- prior to probing. This is necessary when probing may be implemented +- as a function call (Windows). It is not necessary for stack clash +- protection probing. */ +- if (!flag_stack_clash_protection) +- gcc_assert (int_registers_saved); ++ /* We expect the GP registers to be saved when probes are used ++ as the probing sequences might need a scratch register and ++ the routine to allocate one assumes the integer registers ++ have already been saved. */ ++ gcc_assert (int_registers_saved); + + if (flag_stack_clash_protection) + { +diff --git a/gcc/testsuite/gcc.target/i386/pr83994.c b/gcc/testsuite/gcc.target/i386/pr83994.c +new file mode 100644 +index 0000000..dc0b7cb +--- /dev/null ++++ b/gcc/testsuite/gcc.target/i386/pr83994.c +@@ -0,0 +1,16 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -march=i686 -fpic -fstack-clash-protection" } */ ++/* { dg-require-effective-target ia32 } */ ++ ++void f1 (char *); ++ ++__attribute__ ((regparm (3))) ++int ++f2 (int arg1, int arg2, int arg3) ++{ ++ char buf[16384]; ++ f1 (buf); ++ f1 (buf); ++ return 0; ++} ++ diff --git a/SOURCES/gcc48-rh1537828-3.patch b/SOURCES/gcc48-rh1537828-3.patch new file mode 100644 index 00000000..4493a80e --- /dev/null +++ b/SOURCES/gcc48-rh1537828-3.patch @@ -0,0 +1,163 @@ +commit 33839c8f8aa7857cc5f22ddb3f0960999cb0dfc7 +Author: law +Date: Wed Jan 31 05:02:30 2018 +0000 + + PR target/84064 + * i386.c (ix86_adjust_stack_and_probe_stack_clash): New argument + INT_REGISTERS_SAVED. Check it prior to calling + get_scratch_register_on_entry. + (ix86_adjust_stack_and_probe): Similarly. + (ix86_emit_probe_stack_range): Similarly. + (ix86_expand_prologue): Corresponding changes. + + PR target/84064 + * gcc.target/i386/pr84064: New test. + +diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c +index 5230227..2fe2a0c 100644 +--- a/gcc/config/i386/i386.c ++++ b/gcc/config/i386/i386.c +@@ -10206,10 +10206,14 @@ release_scratch_register_on_entry (struct scratch_reg *sr) + This differs from the next routine in that it tries hard to prevent + attacks that jump the stack guard. Thus it is never allowed to allocate + more than PROBE_INTERVAL bytes of stack space without a suitable +- probe. */ ++ probe. ++ ++ INT_REGISTERS_SAVED is true if integer registers have already been ++ pushed on the stack. */ + + static void +-ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size) ++ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size, ++ const bool int_registers_saved) + { + struct machine_function *m = cfun->machine; + struct ix86_frame frame; +@@ -10318,6 +10322,12 @@ ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size) + } + else + { ++ /* We expect the GP registers to be saved when probes are used ++ as the probing sequences might need a scratch register and ++ the routine to allocate one assumes the integer registers ++ have already been saved. */ ++ gcc_assert (int_registers_saved); ++ + struct scratch_reg sr; + get_scratch_register_on_entry (&sr); + +@@ -10376,10 +10386,14 @@ ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size) + emit_insn (gen_blockage ()); + } + +-/* Emit code to adjust the stack pointer by SIZE bytes while probing it. */ ++/* Emit code to adjust the stack pointer by SIZE bytes while probing it. ++ ++ INT_REGISTERS_SAVED is true if integer registers have already been ++ pushed on the stack. */ + + static void +-ix86_adjust_stack_and_probe (const HOST_WIDE_INT size) ++ix86_adjust_stack_and_probe (const HOST_WIDE_INT size, ++ const bool int_registers_saved) + { + /* We skip the probe for the first interval + a small dope of 4 words and + probe that many bytes past the specified size to maintain a protection +@@ -10440,6 +10454,12 @@ ix86_adjust_stack_and_probe (const HOST_WIDE_INT size) + equality test for the loop condition. */ + else + { ++ /* We expect the GP registers to be saved when probes are used ++ as the probing sequences might need a scratch register and ++ the routine to allocate one assumes the integer registers ++ have already been saved. */ ++ gcc_assert (int_registers_saved); ++ + HOST_WIDE_INT rounded_size; + struct scratch_reg sr; + +@@ -10564,10 +10584,14 @@ output_adjust_stack_and_probe (rtx reg) + } + + /* Emit code to probe a range of stack addresses from FIRST to FIRST+SIZE, +- inclusive. These are offsets from the current stack pointer. */ ++ inclusive. These are offsets from the current stack pointer. ++ ++ INT_REGISTERS_SAVED is true if integer registers have already been ++ pushed on the stack. */ + + static void +-ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size) ++ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size, ++ const bool int_registers_saved) + { + /* See if we have a constant small number of probes to generate. If so, + that's the easy case. The run-time loop is made up of 7 insns in the +@@ -10595,6 +10619,12 @@ ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size) + equality test for the loop condition. */ + else + { ++ /* We expect the GP registers to be saved when probes are used ++ as the probing sequences might need a scratch register and ++ the routine to allocate one assumes the integer registers ++ have already been saved. */ ++ gcc_assert (int_registers_saved); ++ + HOST_WIDE_INT rounded_size, last; + struct scratch_reg sr; + +@@ -11072,20 +11102,15 @@ ix86_expand_prologue (void) + && (flag_stack_check == STATIC_BUILTIN_STACK_CHECK + || flag_stack_clash_protection)) + { +- /* We expect the GP registers to be saved when probes are used +- as the probing sequences might need a scratch register and +- the routine to allocate one assumes the integer registers +- have already been saved. */ +- gcc_assert (int_registers_saved); +- + if (flag_stack_clash_protection) + { +- ix86_adjust_stack_and_probe_stack_clash (allocate); ++ ix86_adjust_stack_and_probe_stack_clash (allocate, ++ int_registers_saved); + allocate = 0; + } + else if (STACK_CHECK_MOVING_SP) + { +- ix86_adjust_stack_and_probe (allocate); ++ ix86_adjust_stack_and_probe (allocate, int_registers_saved); + allocate = 0; + } + else +@@ -11096,9 +11121,11 @@ ix86_expand_prologue (void) + size = 0x80000000 - get_stack_check_protect () - 1; + + if (TARGET_STACK_PROBE) +- ix86_emit_probe_stack_range (0, size + get_stack_check_protect ()); ++ ix86_emit_probe_stack_range (0, size + get_stack_check_protect (), ++ int_registers_saved); + else +- ix86_emit_probe_stack_range (get_stack_check_protect (), size); ++ ix86_emit_probe_stack_range (get_stack_check_protect (), size, ++ int_registers_saved); + } + } + +diff --git a/gcc/testsuite/gcc.target/i386/pr84064.c b/gcc/testsuite/gcc.target/i386/pr84064.c +new file mode 100644 +index 0000000..01f8d9e +--- /dev/null ++++ b/gcc/testsuite/gcc.target/i386/pr84064.c +@@ -0,0 +1,10 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -march=i686 -fstack-clash-protection" } */ ++/* { dg-require-effective-target ia32 } */ ++ ++void ++f (void *p1, void *p2) ++{ ++ __builtin_memcpy (p1, p2, 1000); ++} ++ diff --git a/SOURCES/gcc48-rh1537828-4.patch b/SOURCES/gcc48-rh1537828-4.patch new file mode 100644 index 00000000..4750f190 --- /dev/null +++ b/SOURCES/gcc48-rh1537828-4.patch @@ -0,0 +1,182 @@ +commit 14041afe24556efd5845564aa183b6451fd9d6cc +Author: law +Date: Thu Feb 1 16:22:56 2018 +0000 + + PR target/84128 + * config/i386/i386.c (release_scratch_register_on_entry): Add new + OFFSET and RELEASE_VIA_POP arguments. Use SP+OFFSET to restore + the scratch if RELEASE_VIA_POP is false. + (ix86_adjust_stack_and_probe_stack_clash): Un-constify SIZE. + If we have to save a temporary register, decrement SIZE appropriately. + Pass new arguments to release_scratch_register_on_entry. + (ix86_adjust_stack_and_probe): Likewise. + (ix86_emit_probe_stack_range): Pass new arguments to + release_scratch_register_on_entry. + + PR target/84128 + * gcc.target/i386/pr84128.c: New test. + +diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c +index 2fe2a0c..c25d26c 100644 +--- a/gcc/config/i386/i386.c ++++ b/gcc/config/i386/i386.c +@@ -10182,22 +10182,39 @@ get_scratch_register_on_entry (struct scratch_reg *sr) + } + } + +-/* Release a scratch register obtained from the preceding function. */ ++/* Release a scratch register obtained from the preceding function. ++ ++ If RELEASE_VIA_POP is true, we just pop the register off the stack ++ to release it. This is what non-Linux systems use with -fstack-check. ++ ++ Otherwise we use OFFSET to locate the saved register and the ++ allocated stack space becomes part of the local frame and is ++ deallcated by the epilogue. */ + + static void +-release_scratch_register_on_entry (struct scratch_reg *sr) ++release_scratch_register_on_entry (struct scratch_reg *sr, HOST_WIDE_INT offset, ++ bool release_via_pop) + { + if (sr->saved) + { +- struct machine_function *m = cfun->machine; +- rtx x, insn = emit_insn (gen_pop (sr->reg)); ++ if (release_via_pop) ++ { ++ struct machine_function *m = cfun->machine; ++ rtx x, insn = emit_insn (gen_pop (sr->reg)); + +- /* The RTX_FRAME_RELATED_P mechanism doesn't know about pop. */ +- RTX_FRAME_RELATED_P (insn) = 1; +- x = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (UNITS_PER_WORD)); +- x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x); +- add_reg_note (insn, REG_FRAME_RELATED_EXPR, x); +- m->fs.sp_offset -= UNITS_PER_WORD; ++ /* The RTX FRAME_RELATED_P mechanism doesn't know about pop. */ ++ RTX_FRAME_RELATED_P (insn) = 1; ++ x = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (UNITS_PER_WORD)); ++ x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x); ++ add_reg_note (insn, REG_FRAME_RELATED_EXPR, x); ++ m->fs.sp_offset -= UNITS_PER_WORD; ++ } ++ else ++ { ++ rtx x = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (offset)); ++ x = gen_rtx_SET (VOIDmode, sr->reg, gen_rtx_MEM (word_mode, x)); ++ emit_insn (x); ++ } + } + } + +@@ -10212,7 +10229,7 @@ release_scratch_register_on_entry (struct scratch_reg *sr) + pushed on the stack. */ + + static void +-ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size, ++ix86_adjust_stack_and_probe_stack_clash (HOST_WIDE_INT size, + const bool int_registers_saved) + { + struct machine_function *m = cfun->machine; +@@ -10331,6 +10348,12 @@ ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size, + struct scratch_reg sr; + get_scratch_register_on_entry (&sr); + ++ /* If we needed to save a register, then account for any space ++ that was pushed (we are not going to pop the register when ++ we do the restore). */ ++ if (sr.saved) ++ size -= UNITS_PER_WORD; ++ + /* Step 1: round SIZE down to a multiple of the interval. */ + HOST_WIDE_INT rounded_size = size & -probe_interval; + +@@ -10379,7 +10402,9 @@ ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size, + m->fs.cfa_reg == stack_pointer_rtx); + dump_stack_clash_frame_info (PROBE_LOOP, size != rounded_size); + +- release_scratch_register_on_entry (&sr); ++ /* This does not deallocate the space reserved for the scratch ++ register. That will be deallocated in the epilogue. */ ++ release_scratch_register_on_entry (&sr, size, false); + } + + /* Make sure nothing is scheduled before we are done. */ +@@ -10392,7 +10417,7 @@ ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size, + pushed on the stack. */ + + static void +-ix86_adjust_stack_and_probe (const HOST_WIDE_INT size, ++ix86_adjust_stack_and_probe (HOST_WIDE_INT size, + const bool int_registers_saved) + { + /* We skip the probe for the first interval + a small dope of 4 words and +@@ -10465,6 +10490,11 @@ ix86_adjust_stack_and_probe (const HOST_WIDE_INT size, + + get_scratch_register_on_entry (&sr); + ++ /* If we needed to save a register, then account for any space ++ that was pushed (we are not going to pop the register when ++ we do the restore). */ ++ if (sr.saved) ++ size -= UNITS_PER_WORD; + + /* Step 1: round SIZE to the previous multiple of the interval. */ + +@@ -10516,7 +10546,9 @@ ix86_adjust_stack_and_probe (const HOST_WIDE_INT size, + (get_probe_interval () + + dope)))); + +- release_scratch_register_on_entry (&sr); ++ /* This does not deallocate the space reserved for the scratch ++ register. That will be deallocated in the epilogue. */ ++ release_scratch_register_on_entry (&sr, size, false); + } + + gcc_assert (cfun->machine->fs.cfa_reg != stack_pointer_rtx); +@@ -10669,7 +10701,7 @@ ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size, + sr.reg), + rounded_size - size)); + +- release_scratch_register_on_entry (&sr); ++ release_scratch_register_on_entry (&sr, size, true); + } + + /* Make sure nothing is scheduled before we are done. */ +diff --git a/gcc/testsuite/gcc.target/i386/pr84128.c b/gcc/testsuite/gcc.target/i386/pr84128.c +new file mode 100644 +index 0000000..a8323fd +--- /dev/null ++++ b/gcc/testsuite/gcc.target/i386/pr84128.c +@@ -0,0 +1,30 @@ ++/* { dg-do run } */ ++/* { dg-options "-O2 -march=i686 -mtune=generic -fstack-clash-protection" } */ ++/* { dg-require-effective-target ia32 } */ ++ ++__attribute__ ((noinline, noclone, weak, regparm (3))) ++int ++f1 (long arg0, int (*pf) (long, void *)) ++{ ++ unsigned char buf[32768]; ++ return pf (arg0, buf); ++} ++ ++__attribute__ ((noinline, noclone, weak)) ++int ++f2 (long arg0, void *ignored) ++{ ++ if (arg0 != 17) ++ __builtin_abort (); ++ return 19; ++} ++ ++int ++main (void) ++{ ++ if (f1 (17, f2) != 19) ++ __builtin_abort (); ++ return 0; ++} ++ ++ diff --git a/SOURCES/gcc48-rh1537828-5.patch b/SOURCES/gcc48-rh1537828-5.patch new file mode 100644 index 00000000..83597adf --- /dev/null +++ b/SOURCES/gcc48-rh1537828-5.patch @@ -0,0 +1,80 @@ +commit 5fdcac79eb72406c59fa72073dfb3ba21380f56d +Author: ktkachov +Date: Tue Apr 10 09:58:57 2018 +0000 + + [explow] PR target/85173: validize memory before passing it on to target probe_stack + + In this PR the expansion code emits an invalid memory address for the stack probe, which the backend fails to recognise. + The address is created explicitly in anti_adjust_stack_and_probe_stack_clash in explow.c and passed down to gen_probe_stack + without any validation in emit_stack_probe. + + This patch fixes the ICE by calling validize_mem on the memory location before passing it down to the target. + Jakub pointed out that we also want to create valid addresses for the probe_stack_address case, so this patch + creates an expand operand and legitimizes it before passing it down to the probe_stack_address expander. + + This patch passes bootstrap and testing on arm-none-linux-gnueabihf and aarch64-none-linux-gnu + and ppc64le-redhat-linux on gcc112 in the compile farm. + + PR target/85173 + * explow.c (emit_stack_probe): Call validize_mem on memory location + before passing it to gen_probe_stack. Create address operand and + legitimize it for the probe_stack_address case. + + * gcc.target/arm/pr85173.c: New test. + + + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@259266 138bc75d-0d04-0410-961f-82ee72b054a4 + +diff --git a/gcc/explow.c b/gcc/explow.c +index 9386489..e2253ae 100644 +--- a/gcc/explow.c ++++ b/gcc/explow.c +@@ -1549,13 +1549,20 @@ emit_stack_probe (rtx address) + { + #ifdef HAVE_probe_stack_address + if (HAVE_probe_stack_address) +- emit_insn (gen_probe_stack_address (address)); ++ { ++ struct expand_operand ops[1]; ++ insn_code icode = targetm.code_for_probe_stack_address; ++ create_address_operand (ops, address); ++ maybe_legitimize_operands (icode, 0, 1, ops); ++ expand_insn (icode, 1, ops); ++ } + else + #endif + { + rtx memref = gen_rtx_MEM (word_mode, address); + + MEM_VOLATILE_P (memref) = 1; ++ memref = validize_mem (memref); + + /* See if we have an insn to probe the stack. */ + #ifdef HAVE_probe_stack +diff --git a/gcc/testsuite/gcc.target/arm/pr85173.c b/gcc/testsuite/gcc.target/arm/pr85173.c +new file mode 100644 +index 0000000..36105c9 +--- /dev/null ++++ b/gcc/testsuite/gcc.target/arm/pr85173.c +@@ -0,0 +1,20 @@ ++/* PR target/85173. */ ++ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-probe-interval=14" } */ ++/* { dg-require-effective-target arm_thumb2_ok } */ ++ ++__attribute__((noinline, noclone)) void ++foo (char *p) ++{ ++ asm volatile ("" : : "r" (p) : "memory"); ++} ++ ++/* Nonconstant alloca, small local frame. */ ++__attribute__((noinline, noclone)) void ++f5 (int x) ++{ ++ char locals[128]; ++ char *vla = __builtin_alloca (x); ++ foo (vla); ++} diff --git a/SOURCES/gcc48-rh1537828-6.patch b/SOURCES/gcc48-rh1537828-6.patch new file mode 100644 index 00000000..01226988 --- /dev/null +++ b/SOURCES/gcc48-rh1537828-6.patch @@ -0,0 +1,64 @@ +commit 49033c9c57a415db02ac5d98badf5f53342bca83 +Author: krebbel +Date: Thu Apr 12 09:14:57 2018 +0000 + + IBM Z: Spectre: Prevent thunk cfi to be emitted with -fno-dwarf2-cfi-asm + + The CFI magic we emit as part of the indirect branch thunks in order to + have somewhat sane unwind information must not be emitted with + -fno-dwarf2-cfi-asm. + + gcc/ChangeLog: + + 2018-04-12 Andreas Krebbel + + * config/s390/s390.c (s390_output_indirect_thunk_function): Check + also for flag_dwarf2_cfi_asm. + + gcc/testsuite/ChangeLog: + + 2018-04-12 Andreas Krebbel + + * gcc.target/s390/nobp-no-dwarf2-cfi.c: New test. + + + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@259340 138bc75d-0d04-0410-961f-82ee72b054a4 + +diff -Nrup gcc/config/s390/s390.c gcc/config/s390/s390.c +--- gcc/config/s390/s390.c 2018-04-18 13:35:43.856279249 -0600 ++++ gcc/config/s390/s390.c 2018-04-18 13:36:21.037007877 -0600 +@@ -14091,7 +14091,7 @@ s390_output_indirect_thunk_function (uns + + calls: Instead of caller->thunk the backtrace will be + caller->callee->thunk */ +- if (flag_asynchronous_unwind_tables) ++ if (flag_asynchronous_unwind_tables && flag_dwarf2_cfi_asm) + { + fputs ("\t.cfi_signal_frame\n", asm_out_file); + fprintf (asm_out_file, "\t.cfi_return_column %d\n", regno); +diff --git gcc/testsuite/gcc.target/s390/nobp-no-dwarf2-cfi.c gcc/testsuite/gcc.target/s390/nobp-no-dwarf2-cfi.c +new file mode 100644 +index 0000000..75e32a1 +--- /dev/null ++++ gcc/testsuite/gcc.target/s390/nobp-no-dwarf2-cfi.c +@@ -0,0 +1,19 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -march=z900 --save-temps -mfunction-return-reg=thunk -mindirect-branch-table -fno-dwarf2-cfi-asm" } */ ++ ++/* Make sure that we do not emit .cfi directives when -fno-dwarf2-cfi-asm is being used. */ ++ ++int ++main () ++{ ++ return 0; ++} ++ ++/* 1 x main ++/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 1 } } */ ++/* { dg-final { scan-assembler "ex\t" } } */ ++ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ diff --git a/SOURCES/gcc48-rh1537828-7.patch b/SOURCES/gcc48-rh1537828-7.patch new file mode 100644 index 00000000..d8bd816c --- /dev/null +++ b/SOURCES/gcc48-rh1537828-7.patch @@ -0,0 +1,414 @@ +commit 4361c221ff4b53f585a2e8c0ba38956c8132609f +Author: hjl +Date: Mon Feb 26 15:29:30 2018 +0000 + + i386: Update -mfunction-return= for return with pop + + When -mfunction-return= is used, simple_return_pop_internal should pop + return address into ECX register, adjust stack by bytes to pop from stack + and jump to the return thunk via ECX register. + + Tested on i686 and x86-64. + + PR target/84530 + * config/i386/i386-protos.h (ix86_output_indirect_jmp): Remove + the bool argument. + (ix86_output_indirect_function_return): New prototype. + (ix86_split_simple_return_pop_internal): Likewise. + * config/i386/i386.c (indirect_return_via_cx): New. + (indirect_return_via_cx_bnd): Likewise. + (indirect_thunk_name): Handle return va CX_REG. + (output_indirect_thunk_function): Create alias for + __x86_return_thunk_[re]cx and __x86_return_thunk_[re]cx_bnd. + (ix86_output_indirect_jmp): Remove the bool argument. + (ix86_output_indirect_function_return): New function. + (ix86_split_simple_return_pop_internal): Likewise. + * config/i386/i386.md (*indirect_jump): Don't pass false + to ix86_output_indirect_jmp. + (*tablejump_1): Likewise. + (simple_return_pop_internal): Change it to define_insn_and_split. + Call ix86_split_simple_return_pop_internal to split it for + -mfunction-return=. + (simple_return_indirect_internal): Call + ix86_output_indirect_function_return instead of + ix86_output_indirect_jmp. + + gcc/testsuite/ + + PR target/84530 + * gcc.target/i386/ret-thunk-22.c: New test. + * gcc.target/i386/ret-thunk-23.c: Likewise. + * gcc.target/i386/ret-thunk-24.c: Likewise. + * gcc.target/i386/ret-thunk-25.c: Likewise. + * gcc.target/i386/ret-thunk-26.c: Likewise. + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257992 138bc75d-0d04-0410-961f-82ee72b054a4 + +diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h +index 4e4b2100f79..394d4aebf96 100644 +--- a/gcc/config/i386/i386-protos.h ++++ b/gcc/config/i386/i386-protos.h +@@ -306,8 +306,10 @@ extern enum attr_cpu ix86_schedule; + #endif + + extern const char * ix86_output_call_insn (rtx insn, rtx call_op); +-extern const char * ix86_output_indirect_jmp (rtx call_op, bool ret_p); ++extern const char * ix86_output_indirect_jmp (rtx call_op); + extern const char * ix86_output_function_return (bool long_p); ++extern const char * ix86_output_indirect_function_return (rtx ret_op); ++extern void ix86_split_simple_return_pop_internal (rtx); + + #ifdef RTX_CODE + /* Target data for multipass lookahead scheduling. +diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c +index c25d26ca826..a8238a001ee 100644 +--- a/gcc/config/i386/i386.c ++++ b/gcc/config/i386/i386.c +@@ -8777,6 +8777,9 @@ static bool indirect_thunk_needed = false; + by call and return thunks functions. */ + static int indirect_thunks_used; + ++/* True if return thunk function via CX is needed. */ ++static bool indirect_return_via_cx; ++ + #ifndef INDIRECT_LABEL + # define INDIRECT_LABEL "LIND" + #endif +@@ -8786,26 +8789,29 @@ static int indirect_thunks_used; + static void + indirect_thunk_name (char name[32], int regno, bool ret_p) + { +- if (regno >= 0 && ret_p) ++ if (regno != INVALID_REGNUM && regno != CX_REG && ret_p) + gcc_unreachable (); + + if (USE_HIDDEN_LINKONCE) + { +- if (regno >= 0) ++ const char *prefix; ++ ++ prefix = ""; ++ ++ const char *ret = ret_p ? "return" : "indirect"; ++ ++ if (regno != INVALID_REGNUM) + { + const char *reg_prefix; + if (LEGACY_INT_REGNO_P (regno)) + reg_prefix = TARGET_64BIT ? "r" : "e"; + else + reg_prefix = ""; +- sprintf (name, "__x86_indirect_thunk_%s%s", +- reg_prefix, reg_names[regno]); ++ sprintf (name, "__x86_%s_thunk%s_%s%s", ++ ret, prefix, reg_prefix, reg_names[regno]); + } + else +- { +- const char *ret = ret_p ? "return" : "indirect"; +- sprintf (name, "__x86_%s_thunk", ret); +- } ++ sprintf (name, "__x86_%s_thunk%s", ret, prefix); + } + else + { +@@ -8947,9 +8953,18 @@ output_indirect_thunk_function (int regno) + ASM_OUTPUT_LABEL (asm_out_file, name); + } + +- if (regno < 0) ++ /* Create alias for __x86_return_thunk or ++ __x86_return_thunk_ecx. */ ++ bool need_alias; ++ if (regno == INVALID_REGNUM) ++ need_alias = true; ++ else if (regno == CX_REG) ++ need_alias = indirect_return_via_cx; ++ else ++ need_alias = false; ++ ++ if (need_alias) + { +- /* Create alias for __x86.return_thunk/__x86.return_thunk_bnd. */ + char alias[32]; + + indirect_thunk_name (alias, regno, true); +@@ -24704,21 +24719,21 @@ ix86_output_indirect_branch (rtx call_op, const char *xasm, + else + ix86_output_indirect_branch_via_push (call_op, xasm, sibcall_p); + } ++ + /* Output indirect jump. CALL_OP is the jump target. Jump is a + function return if RET_P is true. */ + + const char * +-ix86_output_indirect_jmp (rtx call_op, bool ret_p) ++ix86_output_indirect_jmp (rtx call_op) + { + if (cfun->machine->indirect_branch_type != indirect_branch_keep) + { + struct ix86_frame frame; + ix86_compute_frame_layout (&frame); + +- /* We can't have red-zone if this isn't a function return since +- "call" in the indirect thunk pushes the return address onto +- stack, destroying red-zone. */ +- if (!ret_p && frame.red_zone_size != 0) ++ /* We can't have red-zone since "call" in the indirect thunk ++ pushes the return address onto the stack, destroying the red-zone. */ ++ if (frame.red_zone_size != 0) + gcc_unreachable (); + + ix86_output_indirect_branch (call_op, "%0", true); +@@ -24759,6 +24774,75 @@ ix86_output_function_return (bool long_p) + return "rep%; ret"; + } + ++/* Output indirect function return. RET_OP is the function return ++ target. */ ++ ++const char * ++ix86_output_indirect_function_return (rtx ret_op) ++{ ++ if (cfun->machine->function_return_type != indirect_branch_keep) ++ { ++ char thunk_name[32]; ++ enum indirect_thunk_prefix need_prefix ++ = indirect_thunk_need_prefix (current_output_insn); ++ unsigned int regno = REGNO (ret_op); ++ gcc_assert (regno == CX_REG); ++ ++ if (cfun->machine->function_return_type ++ != indirect_branch_thunk_inline) ++ { ++ bool need_thunk = (cfun->machine->function_return_type ++ == indirect_branch_thunk); ++ indirect_thunk_name (thunk_name, regno, need_prefix, true); ++ if (need_thunk) ++ { ++ indirect_return_via_cx = true; ++ indirect_thunks_used |= 1 << CX_REG; ++ } ++ fprintf (asm_out_file, "\tjmp\t%s\n", thunk_name); ++ } ++ else ++ output_indirect_thunk (need_prefix, regno); ++ ++ return ""; ++ } ++ else ++ return "jmp\t%A0"; ++} ++ ++/* Split simple return with popping POPC bytes from stack to indirect ++ branch with stack adjustment . */ ++ ++void ++ix86_split_simple_return_pop_internal (rtx popc) ++{ ++ struct machine_function *m = cfun->machine; ++ rtx ecx = gen_rtx_REG (SImode, CX_REG); ++ rtx insn; ++ ++ /* There is no "pascal" calling convention in any 64bit ABI. */ ++ gcc_assert (!TARGET_64BIT); ++ ++ insn = emit_insn (gen_pop (ecx)); ++ m->fs.cfa_offset -= UNITS_PER_WORD; ++ m->fs.sp_offset -= UNITS_PER_WORD; ++ ++ rtx x = plus_constant (Pmode, stack_pointer_rtx, UNITS_PER_WORD); ++ x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x); ++ add_reg_note (insn, REG_CFA_ADJUST_CFA, x); ++ add_reg_note (insn, REG_CFA_REGISTER, gen_rtx_SET (VOIDmode, ecx, pc_rtx)); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ ++ x = gen_rtx_PLUS (Pmode, stack_pointer_rtx, popc); ++ x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x); ++ insn = emit_insn (x); ++ add_reg_note (insn, REG_CFA_ADJUST_CFA, x); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ ++ /* Now return address is in ECX. */ ++ emit_jump_insn (gen_simple_return_indirect_internal (ecx)); ++} ++ + /* Output the assembly for a call instruction. */ + + const char * +diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md +index 228f8f6d77a..3320ec233d2 100644 +--- a/gcc/config/i386/i386.md ++++ b/gcc/config/i386/i386.md +@@ -11282,7 +11282,7 @@ + (define_insn "*indirect_jump" + [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw"))] + "" +- "* return ix86_output_indirect_jmp (operands[0], false);" ++ "* return ix86_output_indirect_jmp (operands[0]);" + [(set (attr "type") + (if_then_else (match_test "(cfun->machine->indirect_branch_type + != indirect_branch_keep)") +@@ -11336,7 +11336,7 @@ + [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw")) + (use (label_ref (match_operand 1)))] + "" +- "* return ix86_output_indirect_jmp (operands[0], false);" ++ "* return ix86_output_indirect_jmp (operands[0]);" + [(set (attr "type") + (if_then_else (match_test "(cfun->machine->indirect_branch_type + != indirect_branch_keep)") +@@ -11769,11 +11769,14 @@ + (set_attr "prefix_rep" "1") + (set_attr "modrm" "0")]) + +-(define_insn "simple_return_pop_internal" ++(define_insn_and_split "simple_return_pop_internal" + [(simple_return) + (use (match_operand:SI 0 "const_int_operand"))] + "reload_completed" + "ret\t%0" ++ "&& cfun->machine->function_return_type != indirect_branch_keep" ++ [(const_int 0)] ++ "ix86_split_simple_return_pop_internal (operands[0]); DONE;" + [(set_attr "length" "3") + (set_attr "atom_unit" "jeu") + (set_attr "length_immediate" "2") +@@ -11783,7 +11786,7 @@ + [(simple_return) + (use (match_operand:SI 0 "register_operand" "r"))] + "reload_completed" +- "* return ix86_output_indirect_jmp (operands[0], true);" ++ "* return ix86_output_indirect_function_return (operands[0]);" + [(set (attr "type") + (if_then_else (match_test "(cfun->machine->indirect_branch_type + != indirect_branch_keep)") +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-22.c b/gcc/testsuite/gcc.target/i386/ret-thunk-22.c +new file mode 100644 +index 00000000000..89e086de97b +--- /dev/null ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-22.c +@@ -0,0 +1,15 @@ ++/* PR target/r84530 */ ++/* { dg-do compile { target ia32 } } */ ++/* { dg-options "-O2 -mfunction-return=thunk" } */ ++ ++struct s { _Complex unsigned short x; }; ++struct s gs = { 100 + 200i }; ++struct s __attribute__((noinline)) foo (void) { return gs; } ++ ++/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 } } */ ++/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" } } */ ++/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk_ecx" } } */ ++/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ ++/* { dg-final { scan-assembler {\tpause} } } */ ++/* { dg-final { scan-assembler {\tlfence} } } */ +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-23.c b/gcc/testsuite/gcc.target/i386/ret-thunk-23.c +new file mode 100644 +index 00000000000..43f0ccaa854 +--- /dev/null ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-23.c +@@ -0,0 +1,15 @@ ++/* PR target/r84530 */ ++/* { dg-do compile { target ia32 } } */ ++/* { dg-options "-O2 -mfunction-return=thunk-extern" } */ ++ ++struct s { _Complex unsigned short x; }; ++struct s gs = { 100 + 200i }; ++struct s __attribute__((noinline)) foo (void) { return gs; } ++ ++/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 } } */ ++/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" } } */ ++/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk_ecx" } } */ ++/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ ++/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ ++/* { dg-final { scan-assembler-not {\tpause} } } */ ++/* { dg-final { scan-assembler-not {\tlfence} } } */ +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-24.c b/gcc/testsuite/gcc.target/i386/ret-thunk-24.c +new file mode 100644 +index 00000000000..8729e35147e +--- /dev/null ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-24.c +@@ -0,0 +1,15 @@ ++/* PR target/r84530 */ ++/* { dg-do compile { target ia32 } } */ ++/* { dg-options "-O2 -mfunction-return=thunk-inline" } */ ++ ++struct s { _Complex unsigned short x; }; ++struct s gs = { 100 + 200i }; ++struct s __attribute__((noinline)) foo (void) { return gs; } ++ ++/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 } } */ ++/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" } } */ ++/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk_ecx" } } */ ++/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ ++/* { dg-final { scan-assembler {\tpause} } } */ ++/* { dg-final { scan-assembler {\tlfence} } } */ +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-25.c b/gcc/testsuite/gcc.target/i386/ret-thunk-25.c +new file mode 100644 +index 00000000000..f73553c9a9f +--- /dev/null ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-25.c +@@ -0,0 +1,14 @@ ++/* PR target/r84530 */ ++/* { dg-do compile { target ia32 } } */ ++/* { dg-options "-O2 -mfunction-return=thunk -fno-pic" } */ ++ ++struct s { _Complex unsigned short x; }; ++struct s gs = { 100 + 200i }; ++struct s __attribute__((noinline)) foo (void) { return gs; } ++ ++/* { dg-final { scan-assembler-times "popl\[\\t \]*%ecx" 1 } } */ ++/* { dg-final { scan-assembler "lea\[l\]?\[\\t \]*4\\(%esp\\), %esp" } } */ ++/* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ ++/* { dg-final { scan-assembler {\tpause} } } */ ++/* { dg-final { scan-assembler {\tlfence} } } */ +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-26.c b/gcc/testsuite/gcc.target/i386/ret-thunk-26.c +new file mode 100644 +index 00000000000..9144e988735 +--- /dev/null ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-26.c +@@ -0,0 +1,40 @@ ++/* PR target/r84530 */ ++/* { dg-do run } */ ++/* { dg-options "-Os -mfunction-return=thunk" } */ ++ ++struct S { int i; }; ++__attribute__((const, noinline, noclone)) ++struct S foo (int x) ++{ ++ struct S s; ++ s.i = x; ++ return s; ++} ++ ++int a[2048], b[2048], c[2048], d[2048]; ++struct S e[2048]; ++ ++__attribute__((noinline, noclone)) void ++bar (void) ++{ ++ int i; ++ for (i = 0; i < 1024; i++) ++ { ++ e[i] = foo (i); ++ a[i+2] = a[i] + a[i+1]; ++ b[10] = b[10] + i; ++ c[i] = c[2047 - i]; ++ d[i] = d[i + 1]; ++ } ++} ++ ++int ++main () ++{ ++ int i; ++ bar (); ++ for (i = 0; i < 1024; i++) ++ if (e[i].i != i) ++ __builtin_abort (); ++ return 0; ++} diff --git a/SOURCES/gcc48-rh1537828-8.patch b/SOURCES/gcc48-rh1537828-8.patch new file mode 100644 index 00000000..4f309a79 --- /dev/null +++ b/SOURCES/gcc48-rh1537828-8.patch @@ -0,0 +1,175 @@ +diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c +index a8238a001ee..34f27c597a2 100644 +--- a/gcc/config/i386/i386.c ++++ b/gcc/config/i386/i386.c +@@ -8770,13 +8770,16 @@ ix86_setup_frame_addresses (void) + labels in call and return thunks. */ + static int indirectlabelno; + +-/* True if call and return thunk functions are needed. */ ++/* True if call thunk function is needed. */ + static bool indirect_thunk_needed = false; + + /* Bit masks of integer registers, which contain branch target, used +- by call and return thunks functions. */ ++ by call thunk functions. */ + static int indirect_thunks_used; + ++/* True if return thunk function is needed. */ ++static bool indirect_return_needed = false; ++ + /* True if return thunk function via CX is needed. */ + static bool indirect_return_via_cx; + +@@ -8899,17 +8902,19 @@ output_indirect_thunk (int regno) + } + + /* Output a funtion with a call and return thunk for indirect branch. +- If REGNO != -1, the function address is in REGNO. Otherwise, the +- function address is on the top of stack. */ ++ If REGNO != UNVALID_REGNUM, ++ the function address is in REGNO. Otherwise, the function address is ++ on the top of stack. Thunk is used for function return if RET_P is ++ true. */ + + static void +-output_indirect_thunk_function (int regno) ++output_indirect_thunk_function (unsigned int regno, bool ret_p) + { + char name[32]; + tree decl; + + /* Create __x86_indirect_thunk. */ +- indirect_thunk_name (name, regno, false); ++ indirect_thunk_name (name, regno, ret_p); + decl = build_decl (BUILTINS_LOCATION, FUNCTION_DECL, + get_identifier (name), + build_function_type_list (void_type_node, NULL_TREE)); +@@ -8953,45 +8958,6 @@ output_indirect_thunk_function (int regno) + ASM_OUTPUT_LABEL (asm_out_file, name); + } + +- /* Create alias for __x86_return_thunk or +- __x86_return_thunk_ecx. */ +- bool need_alias; +- if (regno == INVALID_REGNUM) +- need_alias = true; +- else if (regno == CX_REG) +- need_alias = indirect_return_via_cx; +- else +- need_alias = false; +- +- if (need_alias) +- { +- char alias[32]; +- +- indirect_thunk_name (alias, regno, true); +-#if TARGET_MACHO +- if (TARGET_MACHO) +- { +- fputs ("\t.weak_definition\t", asm_out_file); +- assemble_name (asm_out_file, alias); +- fputs ("\n\t.private_extern\t", asm_out_file); +- assemble_name (asm_out_file, alias); +- putc ('\n', asm_out_file); +- ASM_OUTPUT_LABEL (asm_out_file, alias); +- } +-#else +- ASM_OUTPUT_DEF (asm_out_file, alias, name); +- if (USE_HIDDEN_LINKONCE) +- { +- fputs ("\t.globl\t", asm_out_file); +- assemble_name (asm_out_file, alias); +- putc ('\n', asm_out_file); +- fputs ("\t.hidden\t", asm_out_file); +- assemble_name (asm_out_file, alias); +- putc ('\n', asm_out_file); +- } +-#endif +- } +- + DECL_INITIAL (decl) = make_node (BLOCK); + current_function_decl = decl; + allocate_struct_function (decl, false); +@@ -9038,14 +9004,19 @@ ix86_code_end (void) + rtx xops[2]; + int regno; + ++ if (indirect_return_needed) ++ output_indirect_thunk_function (INVALID_REGNUM, true); ++ if (indirect_return_via_cx) ++ output_indirect_thunk_function (CX_REG, true); + if (indirect_thunk_needed) +- output_indirect_thunk_function (-1); ++ output_indirect_thunk_function (INVALID_REGNUM, false); + + for (regno = FIRST_REX_INT_REG; regno <= LAST_REX_INT_REG; regno++) + { + int i = regno - FIRST_REX_INT_REG + LAST_INT_REG + 1; + if ((indirect_thunks_used & (1 << i))) +- output_indirect_thunk_function (regno); ++ output_indirect_thunk_function (regno, false); ++ + } + + for (regno = AX_REG; regno <= SP_REG; regno++) +@@ -9054,7 +9025,7 @@ ix86_code_end (void) + tree decl; + + if ((indirect_thunks_used & (1 << regno))) +- output_indirect_thunk_function (regno); ++ output_indirect_thunk_function (regno, false); + + if (!(pic_labels_used & (1 << regno))) + continue; +@@ -24758,8 +24729,8 @@ ix86_output_function_return (bool long_p) + { + bool need_thunk = (cfun->machine->function_return_type + == indirect_branch_thunk); +- indirect_thunk_name (thunk_name, -1, true); +- indirect_thunk_needed |= need_thunk; ++ indirect_thunk_name (thunk_name, INVALID_REGNUM, true); ++ indirect_return_needed |= need_thunk; + fprintf (asm_out_file, "\tjmp\t%s\n", thunk_name); + } + else +@@ -24783,8 +24754,6 @@ ix86_output_indirect_function_return (rtx ret_op) + if (cfun->machine->function_return_type != indirect_branch_keep) + { + char thunk_name[32]; +- enum indirect_thunk_prefix need_prefix +- = indirect_thunk_need_prefix (current_output_insn); + unsigned int regno = REGNO (ret_op); + gcc_assert (regno == CX_REG); + +@@ -24793,7 +24762,7 @@ ix86_output_indirect_function_return (rtx ret_op) + { + bool need_thunk = (cfun->machine->function_return_type + == indirect_branch_thunk); +- indirect_thunk_name (thunk_name, regno, need_prefix, true); ++ indirect_thunk_name (thunk_name, regno, true); + if (need_thunk) + { + indirect_return_via_cx = true; +@@ -24802,7 +24771,7 @@ ix86_output_indirect_function_return (rtx ret_op) + fprintf (asm_out_file, "\tjmp\t%s\n", thunk_name); + } + else +- output_indirect_thunk (need_prefix, regno); ++ output_indirect_thunk (regno); + + return ""; + } +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c +index d1db41cc128..a605c26c46f 100644 +--- a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c +@@ -13,7 +13,7 @@ foo (void) + /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +-/* { dg-final { scan-assembler "__x86_indirect_thunk:" } } */ ++/* { dg-final { scan-assembler "__x86_return_thunk:" } } */ + /* { dg-final { scan-assembler-times {\tpause} 1 { target { ! x32 } } } } */ + /* { dg-final { scan-assembler-times {\tlfence} 1 { target { ! x32 } } } } */ + /* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?bar" { target { { ! x32 } && *-*-linux* } } } } */ diff --git a/SOURCES/gcc48-rh1537828-9.patch b/SOURCES/gcc48-rh1537828-9.patch new file mode 100644 index 00000000..7d26b7ec --- /dev/null +++ b/SOURCES/gcc48-rh1537828-9.patch @@ -0,0 +1,516 @@ +diff --git a/gcc/config/i386/constraints.md b/gcc/config/i386/constraints.md +index 43faabb7e87..328a90f45d1 100644 +--- a/gcc/config/i386/constraints.md ++++ b/gcc/config/i386/constraints.md +@@ -135,7 +135,7 @@ + + (define_constraint "w" + "@internal Call memory operand." +- (and (not (match_test "ix86_indirect_branch_register")) ++ (and (not (match_test "TARGET_INDIRECT_BRANCH_REGISTER")) + (not (match_test "TARGET_X32")) + (match_operand 0 "memory_operand"))) + +diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h +index 8ff702615b6..95206478001 100644 +--- a/gcc/config/i386/i386.h ++++ b/gcc/config/i386/i386.h +@@ -2413,6 +2413,10 @@ extern void debug_dispatch_window (int); + #define TARGET_RECIP_VEC_DIV ((recip_mask & RECIP_MASK_VEC_DIV) != 0) + #define TARGET_RECIP_VEC_SQRT ((recip_mask & RECIP_MASK_VEC_SQRT) != 0) + ++#define TARGET_INDIRECT_BRANCH_REGISTER \ ++ (ix86_indirect_branch_register \ ++ || cfun->machine->indirect_branch_type != indirect_branch_keep) ++ + #define IX86_HLE_ACQUIRE (1 << 16) + #define IX86_HLE_RELEASE (1 << 17) + +diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md +index 3320ec233d2..7a83d079bfc 100644 +--- a/gcc/config/i386/i386.md ++++ b/gcc/config/i386/i386.md +@@ -11274,7 +11274,7 @@ + [(set (pc) (match_operand 0 "indirect_branch_operand"))] + "" + { +- if (TARGET_X32 || ix86_indirect_branch_register) ++ if (TARGET_X32 || TARGET_INDIRECT_BRANCH_REGISTER) + operands[0] = convert_memory_address (word_mode, operands[0]); + cfun->machine->has_local_indirect_jump = true; + }) +@@ -11327,7 +11327,7 @@ + OPTAB_DIRECT); + } + +- if (TARGET_X32 || ix86_indirect_branch_register) ++ if (TARGET_X32 || TARGET_INDIRECT_BRANCH_REGISTER) + operands[0] = convert_memory_address (word_mode, operands[0]); + cfun->machine->has_local_indirect_jump = true; + }) +diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md +index 6c7a593084c..f6cf50ad6f5 100644 +--- a/gcc/config/i386/predicates.md ++++ b/gcc/config/i386/predicates.md +@@ -540,7 +540,7 @@ + ;; Test for a valid operand for indirect branch. + (define_predicate "indirect_branch_operand" + (ior (match_operand 0 "register_operand") +- (and (not (match_test "ix86_indirect_branch_register")) ++ (and (not (match_test "TARGET_INDIRECT_BRANCH_REGISTER")) + (not (match_test "TARGET_X32")) + (match_operand 0 "memory_operand")))) + +@@ -550,7 +550,7 @@ + (ior (match_test "constant_call_address_operand + (op, mode == VOIDmode ? mode : Pmode)") + (match_operand 0 "call_register_no_elim_operand") +- (and (not (match_test "ix86_indirect_branch_register")) ++ (and (not (match_test "TARGET_INDIRECT_BRANCH_REGISTER")) + (and (not (match_test "TARGET_X32")) + (match_operand 0 "memory_operand"))))) + +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c +index 321db770c35..135bc73b9ce 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c +@@ -14,7 +14,7 @@ male_indirect_jump (long offset) + /* Our gcc-4.8 based compiler is not as aggressive at sibcalls + where the target is in a MEM. Thus we have to scan for different + patterns here than in newer compilers. */ +-/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c +index d58451660f8..867df67143b 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c +@@ -14,7 +14,7 @@ male_indirect_jump (long offset) + /* Our gcc-4.8 based compiler is not as aggressive at sibcalls + where the target is in a MEM. Thus we have to scan for different + patterns here than in newer compilers. */ +-/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c +index 9e24a385387..2c7fb52b59d 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c +@@ -12,9 +12,8 @@ male_indirect_jump (long offset) + return 0; + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler {\tpause} } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c +index 127b5d94523..0d3f895009d 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c +@@ -12,9 +12,8 @@ male_indirect_jump (long offset) + return 0; + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler {\tpause} } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c +index 17c2d0faf88..3c72036dbaf 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-7.c +@@ -35,9 +35,8 @@ bar (int i) + } + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler {\tpause} } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c +index cd7e8d78199..e20816781f9 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c +@@ -17,7 +17,7 @@ male_indirect_jump (long offset) + /* Our gcc-4.8 based compiler is not as aggressive at sibcalls + where the target is in a MEM. Thus we have to scan for different + patterns here than in newer compilers. */ +-/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c +index 4dbd7a5e5d3..0f30d74ee37 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c +@@ -15,7 +15,7 @@ male_indirect_jump (long offset) + /* Our gcc-4.8 based compiler is not as aggressive at sibcalls + where the target is in a MEM. Thus we have to scan for different + patterns here than in newer compilers. */ +-/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c +index 4aeec1833cd..89a2bac8403 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c +@@ -14,10 +14,9 @@ male_indirect_jump (long offset) + return 0; + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ + /* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 2 } } */ + /* { dg-final { scan-assembler {\tpause} } } */ + /* { dg-final { scan-assembler {\tlfence} } } */ + /* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +-/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c +index ac0e5999f63..3eb83c3779a 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c +@@ -13,10 +13,9 @@ male_indirect_jump (long offset) + return 0; + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ + /* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 2 } } */ + /* { dg-final { scan-assembler {\tpause} } } */ + /* { dg-final { scan-assembler {\tlfence} } } */ + /* { dg-final { scan-assembler-not "__x86_indirect_thunk" } } */ +-/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c +index 573cf1ef09e..0098dd1133d 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c +@@ -14,9 +14,8 @@ male_indirect_jump (long offset) + return 0; + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ ++/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ ++/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c +index b2b37fc6e2e..ece8de15a4b 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c +@@ -13,9 +13,8 @@ male_indirect_jump (long offset) + return 0; + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ ++/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ ++/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c +index 4a43e199931..d53fc887dcc 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-7.c +@@ -36,9 +36,8 @@ bar (int i) + } + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ + /* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c +index 72de88e04aa..1f78b07f84a 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c +@@ -14,7 +14,7 @@ male_indirect_jump (long offset) + /* Our gcc-4.8 based compiler is not as aggressive at sibcalls + where the target is in a MEM. Thus we have to scan for different + patterns here than in newer compilers. */ +-/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ + /* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c +index d4137b38a1e..5397a5874aa 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c +@@ -14,7 +14,7 @@ male_indirect_jump (long offset) + /* Our gcc-4.8 based compiler is not as aggressive at sibcalls + where the target is in a MEM. Thus we have to scan for different + patterns here than in newer compilers. */ +-/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ + /* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c +index d9964c25bbd..385626850a2 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c +@@ -12,9 +12,8 @@ male_indirect_jump (long offset) + return 0; + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ ++/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ ++/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c +index d4dca4dc5fe..1ae49b137ca 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c +@@ -12,9 +12,7 @@ male_indirect_jump (long offset) + return 0; + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 1 { target { ! x32 } } } } */ + /* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c +index aece9383697..2b9a33e93dc 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-7.c +@@ -35,9 +35,8 @@ bar (int i) + } + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ + /* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ + /* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c +index e3cea3fa3c2..dbda34ab038 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c +@@ -14,7 +14,7 @@ male_indirect_jump (long offset) + /* Our gcc-4.8 based compiler is not as aggressive at sibcalls + where the target is in a MEM. Thus we have to scan for different + patterns here than in newer compilers. */ +-/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler {\tpause} } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c +index 62229969c90..810824666ef 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c +@@ -14,7 +14,7 @@ male_indirect_jump (long offset) + /* Our gcc-4.8 based compiler is not as aggressive at sibcalls + where the target is in a MEM. Thus we have to scan for different + patterns here than in newer compilers. */ +-/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler {\tpause} } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c +index 2eef6f35a75..4a63ebed8ab 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c +@@ -12,7 +12,7 @@ male_indirect_jump (long offset) + return 0; + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ + /* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 2 } } */ + /* { dg-final { scan-assembler-times {\tpause} 1 } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c +index e825a10f14c..a395ffca018 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c +@@ -12,7 +12,7 @@ male_indirect_jump (long offset) + return 0; + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?dispatch" { target { { ! x32 } && *-*-linux* } } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?dispatch" { target *-*-linux* } } } */ + /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 2 } } */ + /* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 2 } } */ + /* { dg-final { scan-assembler-times {\tpause} 1 } } */ +diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c +index c67066cf197..ea009245a58 100644 +--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c ++++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-7.c +@@ -35,8 +35,8 @@ bar (int i) + } + } + +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*\.L\[0-9\]+\\(,%" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler-not "pushq\[ \t\]%(r|e)ax" } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler {\tpause} } } */ +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-10.c b/gcc/testsuite/gcc.target/i386/ret-thunk-10.c +index e6fea84a4d9..af9023af613 100644 +--- a/gcc/testsuite/gcc.target/i386/ret-thunk-10.c ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-10.c +@@ -15,9 +15,6 @@ foo (void) + /* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk" } } */ + /* { dg-final { scan-assembler-times {\tpause} 2 } } */ + /* { dg-final { scan-assembler-times {\tlfence} 2 } } */ +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?bar" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "__x86_indirect_thunk:" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target { x32 } } } } */ +-/* { dg-final { scan-assembler "__x86_indirect_thunk_(r|e)ax:" { target { x32 } } } } */ +-/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ ++/* { 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" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-11.c b/gcc/testsuite/gcc.target/i386/ret-thunk-11.c +index e239ec4542f..ba467c59b36 100644 +--- a/gcc/testsuite/gcc.target/i386/ret-thunk-11.c ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-11.c +@@ -15,9 +15,6 @@ foo (void) + /* { dg-final { scan-assembler-times {\tlfence} 1 } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?bar" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "__x86_indirect_thunk:" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target { x32 } } } } */ +-/* { dg-final { scan-assembler "__x86_indirect_thunk_(r|e)ax:" { target { x32 } } } } */ +-/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ ++/* { 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" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-12.c b/gcc/testsuite/gcc.target/i386/ret-thunk-12.c +index fa3181303c9..43e57cac2c3 100644 +--- a/gcc/testsuite/gcc.target/i386/ret-thunk-12.c ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-12.c +@@ -15,8 +15,6 @@ foo (void) + /* { dg-final { scan-assembler-times {\tlfence} 1 } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "__x86_indirect_thunk:" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target { x32 } } } } */ +-/* { dg-final { scan-assembler "__x86_indirect_thunk_(r|e)ax:" { target { x32 } } } } */ +-/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ ++/* { 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" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-13.c b/gcc/testsuite/gcc.target/i386/ret-thunk-13.c +index fd5b41fdd3f..55f156c4376 100644 +--- a/gcc/testsuite/gcc.target/i386/ret-thunk-13.c ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-13.c +@@ -14,9 +14,8 @@ foo (void) + /* { dg-final { scan-assembler "jmp\[ \t\]*__x86_return_thunk" } } */ + /* { dg-final { scan-assembler-times {\tpause} 2 } } */ + /* { dg-final { scan-assembler-times {\tlfence} 2 } } */ +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?bar" { target { { ! x32 } && *-*-linux* } } } } */ + /* { dg-final { scan-assembler-times "jmp\[ \t\]*\.LIND" 3 } } */ + /* { dg-final { scan-assembler-times "call\[ \t\]*\.LIND" 3 } } */ + /* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_indirect_thunk" } } */ +-/* { dg-final { scan-assembler-not "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target { x32 } } } } */ +-/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ ++/* { dg-final { scan-assembler-not "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ ++/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-14.c b/gcc/testsuite/gcc.target/i386/ret-thunk-14.c +index d606373ead1..1c790436a53 100644 +--- a/gcc/testsuite/gcc.target/i386/ret-thunk-14.c ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-14.c +@@ -16,7 +16,6 @@ foo (void) + /* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk" } } */ + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?bar" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target { x32 } } } } */ +-/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?bar" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ ++/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-15.c b/gcc/testsuite/gcc.target/i386/ret-thunk-15.c +index 75e45e226b8..58aba319cba 100644 +--- a/gcc/testsuite/gcc.target/i386/ret-thunk-15.c ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-15.c +@@ -16,7 +16,6 @@ foo (void) + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler-times {\tpause} 1 } } */ + /* { dg-final { scan-assembler-times {\tlfence} 1 } } */ +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?bar" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target x32 } } } */ +-/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?bar" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ ++/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ +diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c +index a605c26c46f..eee230ca2f6 100644 +--- a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c ++++ b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c +@@ -14,11 +14,8 @@ foo (void) + /* { dg-final { scan-assembler "jmp\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "call\[ \t\]*\.LIND" } } */ + /* { dg-final { scan-assembler "__x86_return_thunk:" } } */ +-/* { dg-final { scan-assembler-times {\tpause} 1 { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler-times {\tlfence} 1 { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler "push(?:l|q)\[ \t\]*_?bar" { target { { ! x32 } && *-*-linux* } } } } */ +-/* { dg-final { scan-assembler "jmp\[ \t\]*__x86_indirect_thunk" { target { ! x32 } } } } */ +-/* { dg-final { scan-assembler-times {\tpause} 2 { target { x32 } } } } */ +-/* { dg-final { scan-assembler-times {\tlfence} 2 { target { x32 } } } } */ +-/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" { target { x32 } } } } */ +-/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" { target x32 } } } */ ++/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*_?bar" { target *-*-linux* } } } */ ++/* { dg-final { scan-assembler-times {\tpause} 2 } } */ ++/* { dg-final { scan-assembler-times {\tlfence} 2 } } */ ++/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_(r|e)ax" } } */ ++/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */ diff --git a/SOURCES/gcc48-rh1546372.patch b/SOURCES/gcc48-rh1546372.patch new file mode 100644 index 00000000..7fb0c3f3 --- /dev/null +++ b/SOURCES/gcc48-rh1546372.patch @@ -0,0 +1,162 @@ + * cif-code.def: Add NEVER_EXECUTED. + * ipa-inline-analysis.c (reset_inline_summary, + compute_inline_parameters, estimate_calls_size_and_time, + inline_update_overall_summary): Track number of calls. + (never_executed_edge_p): New predicate. + * ipa-inline.c (want_inline_self_recursive_call_p): do not inline + recursively for calls that are not going to be executed. + (inline_small_functions): Do not inline never exeucted edge if callee + has too many calls. + * ipa-inline.h (inline_summary): Add num calls. + (never_executed_edge_p): New. + +--- gcc/cif-code.def (revision 257016) ++++ gcc/cif-code.def (working copy) +@@ -103,3 +103,6 @@ DEFCIFCODE(TARGET_OPTION_MISMATCH, N_("t + + /* We can't inline because of mismatched optimization levels. */ + DEFCIFCODE(OPTIMIZATION_MISMATCH, N_("optimization level attribute mismatch")) ++ ++/* We know that the call will be optimized out. */ ++DEFCIFCODE(NEVER_EXECUTED, N_("never executed")) +--- gcc/ipa-inline-analysis.c (revision 257016) ++++ gcc/ipa-inline-analysis.c (working copy) +@@ -990,6 +990,7 @@ reset_inline_summary (struct cgraph_node + info->stack_frame_offset = 0; + info->size = 0; + info->time = 0; ++ info->num_calls = 0; + info->growth = 0; + info->scc_no = 0; + if (info->loop_iterations) +@@ -2704,6 +2705,7 @@ compute_inline_parameters (struct cgraph + /* Inlining characteristics are maintained by the cgraph_mark_inline. */ + info->time = info->self_time; + info->size = info->self_size; ++ info->num_calls = 0; + info->stack_frame_offset = 0; + info->estimated_stack_size = info->estimated_self_stack_size; + #ifdef ENABLE_CHECKING +@@ -2816,7 +2818,7 @@ estimate_edge_size_and_time (struct cgra + + static void + estimate_calls_size_and_time (struct cgraph_node *node, int *size, int *time, +- inline_hints *hints, ++ inline_hints *hints, int *num, + clause_t possible_truths, + vec known_vals, + vec known_binfos, +@@ -2826,6 +2828,7 @@ estimate_calls_size_and_time (struct cgr + for (e = node->callees; e; e = e->next_callee) + { + struct inline_edge_summary *es = inline_edge_summary (e); ++ (*num)++; + if (!es->predicate + || evaluate_predicate (es->predicate, possible_truths)) + { +@@ -2838,7 +2841,7 @@ estimate_calls_size_and_time (struct cgr + known_aggs, hints); + } + else +- estimate_calls_size_and_time (e->callee, size, time, hints, ++ estimate_calls_size_and_time (e->callee, size, time, hints, num, + possible_truths, + known_vals, known_binfos, + known_aggs); +@@ -2846,6 +2849,7 @@ estimate_calls_size_and_time (struct cgr + } + for (e = node->indirect_calls; e; e = e->next_callee) + { ++ (*num)++; + struct inline_edge_summary *es = inline_edge_summary (e); + if (!es->predicate + || evaluate_predicate (es->predicate, possible_truths)) +@@ -2936,7 +2940,8 @@ estimate_node_size_and_time (struct cgra + if (DECL_DECLARED_INLINE_P (node->symbol.decl)) + hints |= INLINE_HINT_declared_inline; + +- estimate_calls_size_and_time (node, &size, &time, &hints, possible_truths, ++ int num = 0; ++ estimate_calls_size_and_time (node, &size, &time, &hints, &num, possible_truths, + known_vals, known_binfos, known_aggs); + gcc_checking_assert (size >= 0); + gcc_checking_assert (time >= 0); +@@ -3369,13 +3374,14 @@ inline_update_overall_summary (struct cg + + info->size = 0; + info->time = 0; ++ info->num_calls = 0; + for (i = 0; vec_safe_iterate (info->entry, i, &e); i++) + { + info->size += e->size, info->time += e->time; + if (info->time > MAX_TIME * INLINE_TIME_SCALE) + info->time = MAX_TIME * INLINE_TIME_SCALE; + } +- estimate_calls_size_and_time (node, &info->size, &info->time, NULL, ++ estimate_calls_size_and_time (node, &info->size, &info->time, NULL, &info->num_calls, + ~(clause_t) (1 << predicate_false_condition), + vNULL, vNULL, vNULL); + info->time = (info->time + INLINE_TIME_SCALE / 2) / INLINE_TIME_SCALE; +@@ -3528,6 +3534,14 @@ do_estimate_edge_hints (struct cgraph_ed + return hints; + } + ++/* Return true if edge is never executed. */ ++bool ++never_executed_edge_p (struct cgraph_edge *e) ++{ ++ struct inline_edge_summary *es = inline_edge_summary (e); ++ return es->predicate && false_predicate_p (es->predicate); ++} ++ + + /* Estimate self time of the function NODE after inlining EDGE. */ + +--- gcc/ipa-inline.c (revision 257016) ++++ gcc/ipa-inline.c (working copy) +@@ -656,6 +656,11 @@ want_inline_self_recursive_call_p (struc + reason = "--param max-inline-recursive-depth exceeded."; + want_inline = false; + } ++ else if (never_executed_edge_p (edge)) ++ { ++ reason = "edge is never executed."; ++ want_inline = false; ++ } + + if (outer_node->global.inlined_to) + caller_freq = outer_node->callers->frequency; +@@ -1597,6 +1602,14 @@ inline_small_functions (void) + outer_node = where, depth++; + where = where->callers->caller; + } ++ if (never_executed_edge_p (edge) ++ && inline_summary (edge->callee)->num_calls > 30) ++ { ++ if (dump_file) ++ fprintf (dump_file, "Never executed edge\n"); ++ edge->inline_failed = CIF_NEVER_EXECUTED; ++ continue; ++ } + if (outer_node + && !want_inline_self_recursive_call_p (edge, outer_node, + true, depth)) +--- gcc/ipa-inline.h (revision 257016) ++++ gcc/ipa-inline.h (working copy) +@@ -132,6 +132,7 @@ struct GTY(()) inline_summary + /* Estimated size of the function after inlining. */ + int time; + int size; ++ int num_calls; + + /* Conditional size/time information. The summaries are being + merged during inlining. */ +@@ -226,6 +227,7 @@ inline_hints do_estimate_edge_hints (str + void initialize_growth_caches (void); + void free_growth_caches (void); + void compute_inline_parameters (struct cgraph_node *, bool); ++bool never_executed_edge_p (struct cgraph_edge *); + + /* In ipa-inline-transform.c */ + bool inline_call (struct cgraph_edge *, bool, vec *, int *, bool); + diff --git a/SOURCES/gcc48-rh1546728.patch b/SOURCES/gcc48-rh1546728.patch new file mode 100644 index 00000000..e9944e5b --- /dev/null +++ b/SOURCES/gcc48-rh1546728.patch @@ -0,0 +1,48 @@ +2015-09-03 Bill Schmidt + + * optabs.c (expand_binop): Don't create a broadcast vector with a + source element wider than the inner mode. + + * gcc.target/powerpc/vec-shift.c: New test. + +--- gcc/optabs.c ++++ gcc/optabs.c +@@ -1608,6 +1608,15 @@ expand_binop (machine_mode mode, optab binoptab, rtx op0, rtx op1, + + if (otheroptab && optab_handler (otheroptab, mode) != CODE_FOR_nothing) + { ++ /* The scalar may have been extended to be too wide. Truncate ++ it back to the proper size to fit in the broadcast vector. */ ++ machine_mode inner_mode = GET_MODE_INNER (mode); ++ if (!CONST_INT_P (op1) ++ && (GET_MODE_BITSIZE (inner_mode) ++ < GET_MODE_BITSIZE (GET_MODE (op1)))) ++ op1 = force_reg (inner_mode, ++ simplify_gen_unary (TRUNCATE, inner_mode, op1, ++ GET_MODE (op1))); + rtx vop1 = expand_vector_broadcast (mode, op1); + if (vop1) + { +--- /dev/null ++++ gcc/testsuite/gcc.target/powerpc/vec-shift.c +@@ -0,0 +1,20 @@ ++/* { dg-do compile { target { powerpc*-*-* } } } */ ++/* { dg-require-effective-target powerpc_altivec_ok } */ ++/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ ++/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ ++/* { dg-options "-mcpu=power7 -O2" } */ ++ ++/* This used to ICE. During gimplification, "i" is widened to an unsigned ++ int. We used to fail at expand time as we tried to cram an SImode item ++ into a QImode memory slot. This has been fixed to properly truncate the ++ shift amount when splatting it into a vector. */ ++ ++typedef unsigned char v16ui __attribute__((vector_size(16))); ++ ++v16ui vslb(v16ui v, unsigned char i) ++{ ++ return v << i; ++} ++ ++/* { dg-final { scan-assembler "vspltb" } } */ ++/* { dg-final { scan-assembler "vslb" } } */ diff --git a/SOURCES/gcc48-rh1552021.patch b/SOURCES/gcc48-rh1552021.patch new file mode 100644 index 00000000..c931115f --- /dev/null +++ b/SOURCES/gcc48-rh1552021.patch @@ -0,0 +1,1966 @@ +diff -Nrup gcc/config/s390/s390.c gcc/config/s390/s390.c +--- gcc/config/s390/s390.c 2018-03-27 09:33:20.158140823 -0600 ++++ gcc/config/s390/s390.c 2018-03-27 09:33:58.826861609 -0600 +@@ -958,6 +958,35 @@ s390_expand_builtin (tree exp, rtx targe + } + + ++/* Masks per jump target register indicating which thunk need to be ++ generated. */ ++static GTY(()) int indirect_branch_prez10thunk_mask = 0; ++static GTY(()) int indirect_branch_z10thunk_mask = 0; ++ ++#define INDIRECT_BRANCH_NUM_OPTIONS 4 ++ ++enum s390_indirect_branch_option ++ { ++ s390_opt_indirect_branch_jump = 0, ++ s390_opt_indirect_branch_call, ++ s390_opt_function_return_reg, ++ s390_opt_function_return_mem ++ }; ++ ++static GTY(()) int indirect_branch_table_label_no[INDIRECT_BRANCH_NUM_OPTIONS] = { 0 }; ++const char *indirect_branch_table_label[INDIRECT_BRANCH_NUM_OPTIONS] = \ ++ { "LJUMP", "LCALL", "LRETREG", "LRETMEM" }; ++const char *indirect_branch_table_name[INDIRECT_BRANCH_NUM_OPTIONS] = \ ++ { ".s390_indirect_jump", ".s390_indirect_call", ++ ".s390_return_reg", ".s390_return_mem" }; ++ ++bool ++s390_return_addr_from_memory () ++{ ++ return (cfun_frame_layout.first_save_gpr <= RETURN_REGNUM ++ && cfun_frame_layout.last_save_gpr >= RETURN_REGNUM); ++} ++ + static const int s390_hotpatch_hw_max = 1000000; + static int s390_hotpatch_hw_before_label = 0; + static int s390_hotpatch_hw_after_label = 0; +@@ -2669,6 +2698,34 @@ s390_option_override (void) + if (TARGET_64BIT && !TARGET_ZARCH) + error ("64-bit ABI not supported in ESA/390 mode"); + ++ if (s390_indirect_branch != indirect_branch_keep) ++ { ++ if (!global_options_set.x_s390_indirect_branch_call) ++ s390_indirect_branch_call = s390_indirect_branch; ++ ++ if (!global_options_set.x_s390_indirect_branch_jump) ++ s390_indirect_branch_jump = s390_indirect_branch; ++ } ++ ++ if (s390_function_return != indirect_branch_keep) ++ { ++ if (!global_options_set.x_s390_function_return_reg) ++ s390_function_return_reg = s390_function_return; ++ ++ if (!global_options_set.x_s390_function_return_mem) ++ s390_function_return_mem = s390_function_return; ++ } ++ ++ if (!TARGET_CPU_ZARCH) ++ { ++ if (s390_indirect_branch_call != indirect_branch_keep ++ || s390_indirect_branch_jump != indirect_branch_keep) ++ error ("-mindirect-branch* options require -march=z900 or higher"); ++ if (s390_function_return_reg != indirect_branch_keep ++ || s390_function_return_mem != indirect_branch_keep) ++ error ("-mfunction-return* options require -march=z900 or higher"); ++ } ++ + /* Use hardware DFP if available and not explicitly disabled by + user. E.g. with -m31 -march=z10 -mzarch */ + if (!(target_flags_explicit & MASK_HARD_DFP) && TARGET_DFP) +@@ -10873,7 +10930,6 @@ s390_emit_epilogue (bool sibcall) + rtx frame_pointer, return_reg, cfa_restores = NULL_RTX; + int area_bottom, area_top, offset = 0; + int next_offset; +- rtvec p; + int i; + + if (TARGET_TPF_PROFILING) +@@ -11023,8 +11079,14 @@ s390_emit_epilogue (bool sibcall) + && cfun_frame_layout.last_restore_gpr > RETURN_REGNUM)) + { + int return_regnum = find_unused_clobbered_reg(); +- if (!return_regnum) +- return_regnum = 4; ++ if (!return_regnum ++ || (TARGET_INDIRECT_BRANCH_NOBP_RET_OPTION ++ && !TARGET_CPU_Z10 ++ && return_regnum == INDIRECT_BRANCH_THUNK_REGNUM)) ++ { ++ gcc_assert (INDIRECT_BRANCH_THUNK_REGNUM != 4); ++ return_regnum = 4; ++ } + return_reg = gen_rtx_REG (Pmode, return_regnum); + + addr = plus_constant (Pmode, frame_pointer, +@@ -11054,16 +11116,7 @@ s390_emit_epilogue (bool sibcall) + } + + if (! sibcall) +- { +- +- /* Return to caller. */ +- +- p = rtvec_alloc (2); +- +- RTVEC_ELT (p, 0) = ret_rtx; +- RTVEC_ELT (p, 1) = gen_rtx_USE (VOIDmode, return_reg); +- emit_jump_insn (gen_rtx_PARALLEL (VOIDmode, p)); +- } ++ emit_jump_insn (gen_return_use (return_reg)); + } + + +@@ -12371,6 +12424,84 @@ s390_output_mi_thunk (FILE *file, tree t + final_end_function (); + } + ++/* Output either an indirect jump or a an indirect call ++ (RETURN_ADDR_REGNO != INVALID_REGNUM) with target register REGNO ++ using a branch trampoline disabling branch target prediction. */ ++ ++void ++s390_indirect_branch_via_thunk (unsigned int regno, ++ unsigned int return_addr_regno, ++ rtx comparison_operator, ++ enum s390_indirect_branch_type type) ++{ ++ enum s390_indirect_branch_option option; ++ ++ if (type == s390_indirect_branch_type_return) ++ { ++ if (s390_function_return_reg != indirect_branch_keep ++ && !s390_return_addr_from_memory ()) ++ option = s390_opt_function_return_reg; ++ ++ if (s390_function_return_mem != indirect_branch_keep ++ && s390_return_addr_from_memory ()) ++ option = s390_opt_function_return_mem; ++ } ++ else if (type == s390_indirect_branch_type_jump) ++ option = s390_opt_indirect_branch_jump; ++ else if (type == s390_indirect_branch_type_call) ++ option = s390_opt_indirect_branch_call; ++ else ++ gcc_unreachable (); ++ ++ if (TARGET_INDIRECT_BRANCH_TABLE) ++ { ++ char label[32]; ++ ++ ASM_GENERATE_INTERNAL_LABEL (label, ++ indirect_branch_table_label[option], ++ indirect_branch_table_label_no[option]++); ++ ASM_OUTPUT_LABEL (asm_out_file, label); ++ } ++ ++ if (return_addr_regno != INVALID_REGNUM) ++ { ++ gcc_assert (comparison_operator == NULL_RTX); ++ fprintf (asm_out_file, " \tbrasl\t%%r%d,", return_addr_regno); ++ } ++ else ++ { ++ fputs (" \tjg", asm_out_file); ++ if (comparison_operator != NULL_RTX) ++ print_operand (asm_out_file, comparison_operator, 'C'); ++ ++ fputs ("\t", asm_out_file); ++ } ++ ++ if (TARGET_CPU_Z10) ++ fprintf (asm_out_file, ++ TARGET_INDIRECT_BRANCH_THUNK_NAME_EXRL "\n", ++ regno); ++ else ++ fprintf (asm_out_file, ++ TARGET_INDIRECT_BRANCH_THUNK_NAME_EX "\n", ++ INDIRECT_BRANCH_THUNK_REGNUM, regno); ++ ++ if ((option == s390_opt_indirect_branch_jump ++ && s390_indirect_branch_jump == indirect_branch_thunk) ++ || (option == s390_opt_indirect_branch_call ++ && s390_indirect_branch_call == indirect_branch_thunk) ++ || (option == s390_opt_function_return_reg ++ && s390_function_return_reg == indirect_branch_thunk) ++ || (option == s390_opt_function_return_mem ++ && s390_function_return_mem == indirect_branch_thunk)) ++ { ++ if (TARGET_CPU_Z10) ++ indirect_branch_z10thunk_mask |= (1 << regno); ++ else ++ indirect_branch_prez10thunk_mask |= (1 << regno); ++ } ++} ++ + static bool + s390_valid_pointer_mode (enum machine_mode mode) + { +@@ -12476,6 +12607,14 @@ s390_function_ok_for_sibcall (tree decl, + if (!TARGET_64BIT && flag_pic && decl && !targetm.binds_local_p (decl)) + return false; + ++ /* The thunks for indirect branches require r1 if no exrl is ++ available. r1 might not be available when doing a sibling ++ call. */ ++ if (TARGET_INDIRECT_BRANCH_NOBP_CALL ++ && !TARGET_CPU_Z10 ++ && !decl) ++ return false; ++ + /* Register 6 on s390 is available as an argument register but unfortunately + "caller saved". This makes functions needing this register for arguments + not suitable for sibcalls. */ +@@ -12509,9 +12648,13 @@ s390_emit_call (rtx addr_location, rtx t + { + bool plt_call = false; + rtx insn; +- rtx call; +- rtx clobber; +- rtvec vec; ++ rtx vec[4] = { NULL_RTX }; ++ int elts = 0; ++ rtx *call = &vec[0]; ++ rtx *clobber_ret_reg = &vec[1]; ++ rtx *use = &vec[2]; ++ rtx *clobber_thunk_reg = &vec[3]; ++ int i; + + /* Direct function calls need special treatment. */ + if (GET_CODE (addr_location) == SYMBOL_REF) +@@ -12520,7 +12663,7 @@ s390_emit_call (rtx addr_location, rtx t + replace the symbol itself with the PLT stub. */ + if (flag_pic && !SYMBOL_REF_LOCAL_P (addr_location)) + { +- if (retaddr_reg != NULL_RTX) ++ if (TARGET_64BIT || retaddr_reg != NULL_RTX) + { + addr_location = gen_rtx_UNSPEC (Pmode, + gen_rtvec (1, addr_location), +@@ -12563,26 +12706,57 @@ s390_emit_call (rtx addr_location, rtx t + addr_location = gen_rtx_REG (Pmode, SIBCALL_REGNUM); + } + ++ if (TARGET_INDIRECT_BRANCH_NOBP_CALL ++ && GET_CODE (addr_location) != SYMBOL_REF ++ && !plt_call) ++ { ++ /* Indirect branch thunks require the target to be a single GPR. */ ++ addr_location = force_reg (Pmode, addr_location); ++ ++ /* Without exrl the indirect branch thunks need an additional ++ register for larl;ex */ ++ if (!TARGET_CPU_Z10) ++ { ++ *clobber_thunk_reg = gen_rtx_REG (Pmode, INDIRECT_BRANCH_THUNK_REGNUM); ++ *clobber_thunk_reg = gen_rtx_CLOBBER (VOIDmode, *clobber_thunk_reg); ++ } ++ } ++ + addr_location = gen_rtx_MEM (QImode, addr_location); +- call = gen_rtx_CALL (VOIDmode, addr_location, const0_rtx); ++ *call = gen_rtx_CALL (VOIDmode, addr_location, const0_rtx); + + if (result_reg != NULL_RTX) +- call = gen_rtx_SET (VOIDmode, result_reg, call); ++ *call = gen_rtx_SET (VOIDmode, result_reg, *call); + + if (retaddr_reg != NULL_RTX) + { +- clobber = gen_rtx_CLOBBER (VOIDmode, retaddr_reg); ++ *clobber_ret_reg = gen_rtx_CLOBBER (VOIDmode, retaddr_reg); + + if (tls_call != NULL_RTX) +- vec = gen_rtvec (3, call, clobber, +- gen_rtx_USE (VOIDmode, tls_call)); +- else +- vec = gen_rtvec (2, call, clobber); ++ *use = gen_rtx_USE (VOIDmode, tls_call); ++ } ++ ++ for (i = 0; i < 4; i++) ++ if (vec[i] != NULL_RTX) ++ elts++; + +- call = gen_rtx_PARALLEL (VOIDmode, vec); ++ if (elts > 1) ++ { ++ rtvec v; ++ int e = 0; ++ ++ v = rtvec_alloc (elts); ++ for (i = 0; i < 4; i++) ++ if (vec[i] != NULL_RTX) ++ { ++ RTVEC_ELT (v, e) = vec[i]; ++ e++; ++ } ++ ++ *call = gen_rtx_PARALLEL (VOIDmode, v); + } + +- insn = emit_call_insn (call); ++ insn = emit_call_insn (*call); + + /* 31-bit PLT stubs and tls calls use the GOT register implicitly. */ + if ((!TARGET_64BIT && plt_call) || tls_call != NULL_RTX) +@@ -13819,6 +13993,190 @@ s390_asm_file_end (void) + file_end_indicate_exec_stack (); + } + ++#ifdef HAVE_GAS_HIDDEN ++# define USE_HIDDEN_LINKONCE 1 ++#else ++# define USE_HIDDEN_LINKONCE 0 ++#endif ++ ++/* Output an indirect branch trampoline for target register REGNO. */ ++ ++static void ++s390_output_indirect_thunk_function (unsigned int regno, bool z10_p) ++{ ++ tree decl; ++ char thunk_label[32]; ++ ++ int i; ++ ++ if (z10_p) ++ sprintf (thunk_label, TARGET_INDIRECT_BRANCH_THUNK_NAME_EXRL, regno); ++ else ++ sprintf (thunk_label, TARGET_INDIRECT_BRANCH_THUNK_NAME_EX, ++ INDIRECT_BRANCH_THUNK_REGNUM, regno); ++ ++ decl = build_decl (BUILTINS_LOCATION, FUNCTION_DECL, ++ get_identifier (thunk_label), ++ build_function_type_list (void_type_node, NULL_TREE)); ++ DECL_RESULT (decl) = build_decl (BUILTINS_LOCATION, RESULT_DECL, ++ NULL_TREE, void_type_node); ++ TREE_PUBLIC (decl) = 1; ++ TREE_STATIC (decl) = 1; ++ DECL_IGNORED_P (decl) = 1; ++ ++ if (USE_HIDDEN_LINKONCE) ++ { ++ DECL_COMDAT_GROUP (decl) = DECL_ASSEMBLER_NAME (decl); ++ ++ targetm.asm_out.unique_section (decl, 0); ++ switch_to_section (get_named_section (decl, NULL, 0)); ++ ++ targetm.asm_out.globalize_label (asm_out_file, thunk_label); ++ fputs ("\t.hidden\t", asm_out_file); ++ assemble_name (asm_out_file, thunk_label); ++ putc ('\n', asm_out_file); ++ ASM_DECLARE_FUNCTION_NAME (asm_out_file, thunk_label, decl); ++ } ++ else ++ { ++ switch_to_section (text_section); ++ ASM_OUTPUT_LABEL (asm_out_file, thunk_label); ++ } ++ ++ DECL_INITIAL (decl) = make_node (BLOCK); ++ current_function_decl = decl; ++ allocate_struct_function (decl, false); ++ init_function_start (decl); ++ cfun->is_thunk = true; ++ first_function_block_is_cold = false; ++ final_start_function (emit_barrier (), asm_out_file, 1); ++ ++ /* This makes CFI at least usable for indirect jumps. ++ ++ jumps: stopping in the thunk: backtrace will point to the thunk ++ target is if it was interrupted by a signal ++ ++ calls: Instead of caller->thunk the backtrace will be ++ caller->callee->thunk */ ++ if (flag_asynchronous_unwind_tables) ++ { ++ fputs ("\t.cfi_signal_frame\n", asm_out_file); ++ fprintf (asm_out_file, "\t.cfi_return_column %d\n", regno); ++ for (i = 0; i < FPR15_REGNUM; i++) ++ fprintf (asm_out_file, "\t.cfi_same_value %s\n", reg_names[i]); ++ } ++ ++ if (z10_p) ++ { ++ /* exrl 0,1f */ ++ ++ /* We generate a thunk for z10 compiled code although z10 is ++ currently not enabled. Tell the assembler to accept the ++ instruction. */ ++ if (!TARGET_CPU_Z10) ++ { ++ fputs ("\t.machine push\n", asm_out_file); ++ fputs ("\t.machine z10\n", asm_out_file); ++ } ++ /* We use exrl even if -mzarch hasn't been specified on the ++ command line so we have to tell the assembler to accept ++ it. */ ++ if (!TARGET_ZARCH) ++ fputs ("\t.machinemode zarch\n", asm_out_file); ++ ++ fputs ("\texrl\t0,1f\n", asm_out_file); ++ ++ if (!TARGET_ZARCH) ++ fputs ("\t.machinemode esa\n", asm_out_file); ++ ++ if (!TARGET_CPU_Z10) ++ fputs ("\t.machine pop\n", asm_out_file); ++ } ++ else if (TARGET_CPU_ZARCH) ++ { ++ /* larl %r1,1f */ ++ fprintf (asm_out_file, "\tlarl\t%%r%d,1f\n", ++ INDIRECT_BRANCH_THUNK_REGNUM); ++ ++ /* ex 0,0(%r1) */ ++ fprintf (asm_out_file, "\tex\t0,0(%%r%d)\n", ++ INDIRECT_BRANCH_THUNK_REGNUM); ++ } ++ else ++ gcc_unreachable (); ++ ++ /* 0: j 0b */ ++ fputs ("0:\tj\t0b\n", asm_out_file); ++ ++ /* 1: br */ ++ fprintf (asm_out_file, "1:\tbr\t%%r%d\n", regno); ++ ++ final_end_function (); ++ init_insn_lengths (); ++ free_after_compilation (cfun); ++ set_cfun (NULL); ++ current_function_decl = NULL; ++} ++ ++/* Implement the asm.code_end target hook. */ ++ ++static void ++s390_code_end (void) ++{ ++ int i; ++ ++ for (i = 1; i < 16; i++) ++ { ++ if (indirect_branch_z10thunk_mask & (1 << i)) ++ s390_output_indirect_thunk_function (i, true); ++ ++ if (indirect_branch_prez10thunk_mask & (1 << i)) ++ s390_output_indirect_thunk_function (i, false); ++ } ++ ++ if (TARGET_INDIRECT_BRANCH_TABLE) ++ { ++ int o; ++ int i; ++ ++ for (o = 0; o < INDIRECT_BRANCH_NUM_OPTIONS; o++) ++ { ++ if (indirect_branch_table_label_no[o] == 0) ++ continue; ++ ++ switch_to_section (get_section (indirect_branch_table_name[o], ++ 0, ++ NULL_TREE)); ++ for (i = 0; i < indirect_branch_table_label_no[o]; i++) ++ { ++ char label_start[32]; ++ ++ ASM_GENERATE_INTERNAL_LABEL (label_start, ++ indirect_branch_table_label[o], i); ++ ++ fputs ("\t.long\t", asm_out_file); ++ assemble_name_raw (asm_out_file, label_start); ++ fputs ("-.\n", asm_out_file); ++ } ++ switch_to_section (current_function_section ()); ++ } ++ } ++} ++ ++/* Implement the TARGET_CASE_VALUES_THRESHOLD target hook. */ ++ ++unsigned int ++s390_case_values_threshold (void) ++{ ++ /* Disabling branch prediction for indirect jumps makes jump table ++ much more expensive. */ ++ if (TARGET_INDIRECT_BRANCH_NOBP_JUMP) ++ return 20; ++ ++ return default_case_values_threshold (); ++} ++ ++ + /* Initialize GCC target structure. */ + + #undef TARGET_ASM_ALIGNED_HI_OP +@@ -14015,6 +14373,12 @@ s390_asm_file_end (void) + #undef TARGET_ASM_FILE_END + #define TARGET_ASM_FILE_END s390_asm_file_end + ++#undef TARGET_ASM_CODE_END ++#define TARGET_ASM_CODE_END s390_code_end ++ ++#undef TARGET_CASE_VALUES_THRESHOLD ++#define TARGET_CASE_VALUES_THRESHOLD s390_case_values_threshold ++ + struct gcc_target targetm = TARGET_INITIALIZER; + + #include "gt-s390.h" +diff -Nrup gcc/config/s390/s390.h gcc/config/s390/s390.h +--- gcc/config/s390/s390.h 2018-03-27 09:33:19.762143683 -0600 ++++ gcc/config/s390/s390.h 2018-03-27 09:33:58.827861602 -0600 +@@ -1006,4 +1006,37 @@ extern const int processor_flags_table[] + s390_register_target_pragmas (); \ + } while (0) + ++ ++#define TARGET_INDIRECT_BRANCH_NOBP_RET_OPTION \ ++ (s390_function_return_reg != indirect_branch_keep \ ++ || s390_function_return_mem != indirect_branch_keep) ++ ++#define TARGET_INDIRECT_BRANCH_NOBP_RET \ ++ ((s390_function_return_reg != indirect_branch_keep \ ++ && !s390_return_addr_from_memory ()) \ ++ || (s390_function_return_mem != indirect_branch_keep \ ++ && s390_return_addr_from_memory ())) ++ ++#define TARGET_INDIRECT_BRANCH_NOBP_JUMP \ ++ (s390_indirect_branch_jump != indirect_branch_keep) ++ ++#define TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK \ ++ (s390_indirect_branch_jump == indirect_branch_thunk \ ++ || s390_indirect_branch_jump == indirect_branch_thunk_extern) ++ ++#define TARGET_INDIRECT_BRANCH_NOBP_JUMP_INLINE_THUNK \ ++ (s390_indirect_branch_jump == indirect_branch_thunk_inline) ++ ++#define TARGET_INDIRECT_BRANCH_NOBP_CALL \ ++ (s390_indirect_branch_call != indirect_branch_keep) ++ ++#ifndef TARGET_DEFAULT_INDIRECT_BRANCH_TABLE ++#define TARGET_DEFAULT_INDIRECT_BRANCH_TABLE 0 ++#endif ++ ++#define TARGET_INDIRECT_BRANCH_THUNK_NAME_EXRL "__s390_indirect_jump_r%d" ++#define TARGET_INDIRECT_BRANCH_THUNK_NAME_EX "__s390_indirect_jump_r%duse_r%d" ++ ++#define TARGET_INDIRECT_BRANCH_TABLE s390_indirect_branch_table ++ + #endif /* S390_H */ +diff -Nrup gcc/config/s390/s390.md gcc/config/s390/s390.md +--- gcc/config/s390/s390.md 2018-03-27 09:33:19.763143675 -0600 ++++ gcc/config/s390/s390.md 2018-03-27 09:33:58.831861573 -0600 +@@ -285,6 +285,8 @@ + [ + ; Sibling call register. + (SIBCALL_REGNUM 1) ++ ; A call-clobbered reg which can be used in indirect branch thunks ++ (INDIRECT_BRANCH_THUNK_REGNUM 1) + ; Literal pool base register. + (BASE_REGNUM 13) + ; Return address register. +@@ -304,6 +306,7 @@ + ; Floating point registers. + (FPR0_REGNUM 16) + (FPR2_REGNUM 18) ++ (FPR15_REGNUM 31) + (VR0_REGNUM 16) + (VR16_REGNUM 38) + (VR23_REGNUM 45) +@@ -402,7 +405,10 @@ + z196_cracked" + (const_string "none")) + +-(define_attr "mnemonic" "bcr_flush,unknown" (const_string "unknown")) ++; mnemonics which only get defined through if_then_else currently ++; don't get added to the list values automatically and hence need to ++; be listed here. ++(define_attr "mnemonic" "b,br,bas,bc,bcr,bcr_flush,unknown" (const_string "unknown")) + + ;; Length in bytes. + +@@ -8436,7 +8442,7 @@ + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) + (match_operand 0 "address_operand" "ZQZR") + (pc)))] +- "" ++ "!TARGET_INDIRECT_BRANCH_NOBP_JUMP" + { + if (get_attr_op_type (insn) == OP_TYPE_RR) + return "b%C1r\t%0"; +@@ -8446,6 +8452,9 @@ + [(set (attr "op_type") + (if_then_else (match_operand 0 "register_operand" "") + (const_string "RR") (const_string "RX"))) ++ (set (attr "mnemonic") ++ (if_then_else (match_operand 0 "register_operand" "") ++ (const_string "bcr") (const_string "bc"))) + (set_attr "type" "branch") + (set_attr "atype" "agen")]) + +@@ -8499,7 +8508,7 @@ + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) + (pc) + (match_operand 0 "address_operand" "ZQZR")))] +- "" ++ "!TARGET_INDIRECT_BRANCH_NOBP_JUMP" + { + if (get_attr_op_type (insn) == OP_TYPE_RR) + return "b%D1r\t%0"; +@@ -8509,6 +8518,9 @@ + [(set (attr "op_type") + (if_then_else (match_operand 0 "register_operand" "") + (const_string "RR") (const_string "RX"))) ++ (set (attr "mnemonic") ++ (if_then_else (match_operand 0 "register_operand" "") ++ (const_string "bcr") (const_string "bc"))) + (set_attr "type" "branch") + (set_attr "atype" "agen")]) + +@@ -9005,29 +9017,125 @@ + ; indirect-jump instruction pattern(s). + ; + +-(define_insn "indirect_jump" +- [(set (pc) (match_operand 0 "address_operand" "ZQZR"))] +- "" ++(define_expand "indirect_jump" ++ [(set (pc) (match_operand 0 "address_operand" "ZQZR"))] ++ "" ++{ ++ if (TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK) ++ { ++ operands[0] = force_reg (Pmode, operands[0]); ++ if (TARGET_CPU_Z10) ++ { ++ if (TARGET_64BIT) ++ emit_jump_insn (gen_indirect_jump_via_thunkdi_z10 (operands[0])); ++ else ++ emit_jump_insn (gen_indirect_jump_via_thunksi_z10 (operands[0])); ++ } ++ else ++ { ++ if (TARGET_64BIT) ++ emit_jump_insn (gen_indirect_jump_via_thunkdi (operands[0])); ++ else ++ emit_jump_insn (gen_indirect_jump_via_thunksi (operands[0])); ++ } ++ DONE; ++ } ++}) ++ ++(define_insn "*indirect_jump" ++ [(set (pc) ++ (match_operand 0 "address_operand" "ZR"))] ++ "!TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK" + { + if (get_attr_op_type (insn) == OP_TYPE_RR) + return "br\t%0"; + else + return "b\t%a0"; + } +- [(set (attr "op_type") +- (if_then_else (match_operand 0 "register_operand" "") +- (const_string "RR") (const_string "RX"))) +- (set_attr "type" "branch") +- (set_attr "atype" "agen")]) ++ [(set (attr "op_type") ++ (if_then_else (match_operand 0 "register_operand" "") ++ (const_string "RR") (const_string "RX"))) ++ (set (attr "mnemonic") ++ (if_then_else (match_operand 0 "register_operand" "") ++ (const_string "br") (const_string "b"))) ++ (set_attr "type" "branch") ++ (set_attr "atype" "agen")]) ++ ++(define_insn "indirect_jump_via_thunk_z10" ++ [(set (pc) ++ (match_operand:P 0 "register_operand" "a"))] ++ "TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK ++ && TARGET_CPU_Z10" ++{ ++ s390_indirect_branch_via_thunk (REGNO (operands[0]), ++ INVALID_REGNUM, ++ NULL_RTX, ++ s390_indirect_branch_type_jump); ++ return ""; ++} ++ [(set_attr "op_type" "RIL") ++ (set_attr "mnemonic" "jg") ++ (set_attr "type" "branch") ++ (set_attr "atype" "agen")]) ++ ++(define_insn "indirect_jump_via_thunk" ++ [(set (pc) ++ (match_operand:P 0 "register_operand" " a")) ++ (clobber (reg:P INDIRECT_BRANCH_THUNK_REGNUM))] ++ "TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK ++ && !TARGET_CPU_Z10" ++{ ++ s390_indirect_branch_via_thunk (REGNO (operands[0]), ++ INVALID_REGNUM, ++ NULL_RTX, ++ s390_indirect_branch_type_jump); ++ return ""; ++} ++ [(set_attr "op_type" "RIL") ++ (set_attr "mnemonic" "jg") ++ (set_attr "type" "branch") ++ (set_attr "atype" "agen")]) + + ; + ; casesi instruction pattern(s). + ; + +-(define_insn "casesi_jump" +- [(set (pc) (match_operand 0 "address_operand" "ZQZR")) +- (use (label_ref (match_operand 1 "" "")))] +- "" ++(define_expand "casesi_jump" ++ [(parallel ++ [(set (pc) (match_operand 0 "address_operand")) ++ (use (label_ref (match_operand 1 "")))])] ++ "" ++{ ++ if (TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK) ++ { ++ operands[0] = force_reg (GET_MODE (operands[0]), operands[0]); ++ ++ if (TARGET_CPU_Z10) ++ { ++ if (TARGET_64BIT) ++ emit_jump_insn (gen_casesi_jump_via_thunkdi_z10 (operands[0], ++ operands[1])); ++ else ++ emit_jump_insn (gen_casesi_jump_via_thunksi_z10 (operands[0], ++ operands[1])); ++ } ++ else ++ { ++ if (TARGET_64BIT) ++ emit_jump_insn (gen_casesi_jump_via_thunkdi (operands[0], ++ operands[1])); ++ else ++ emit_jump_insn (gen_casesi_jump_via_thunksi (operands[0], ++ operands[1])); ++ } ++ DONE; ++ } ++}) ++ ++(define_insn "*casesi_jump" ++ [(set (pc) (match_operand 0 "address_operand" "ZR")) ++ (use (label_ref (match_operand 1 "" "")))] ++ "!TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK" + { + if (get_attr_op_type (insn) == OP_TYPE_RR) + return "br\t%0"; +@@ -9035,11 +9143,50 @@ + return "b\t%a0"; + } + [(set (attr "op_type") ++ (if_then_else (match_operand 0 "register_operand" "") ++ (const_string "RR") (const_string "RX"))) ++ (set (attr "mnemonic") + (if_then_else (match_operand 0 "register_operand" "") +- (const_string "RR") (const_string "RX"))) ++ (const_string "br") (const_string "b"))) ++ (set_attr "type" "branch") ++ (set_attr "atype" "agen")]) ++ ++(define_insn "casesi_jump_via_thunk_z10" ++ [(set (pc) (match_operand:P 0 "register_operand" "a")) ++ (use (label_ref (match_operand 1 "" "")))] ++ "TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK ++ && TARGET_CPU_Z10" ++{ ++ s390_indirect_branch_via_thunk (REGNO (operands[0]), ++ INVALID_REGNUM, ++ NULL_RTX, ++ s390_indirect_branch_type_jump); ++ return ""; ++} ++ [(set_attr "op_type" "RIL") ++ (set_attr "mnemonic" "jg") + (set_attr "type" "branch") + (set_attr "atype" "agen")]) + ++(define_insn "casesi_jump_via_thunk" ++ [(set (pc) (match_operand:P 0 "register_operand" "a")) ++ (use (label_ref (match_operand 1 "" ""))) ++ (clobber (reg:P INDIRECT_BRANCH_THUNK_REGNUM))] ++ "TARGET_INDIRECT_BRANCH_NOBP_JUMP_THUNK ++ && !TARGET_CPU_Z10" ++{ ++ s390_indirect_branch_via_thunk (REGNO (operands[0]), ++ INVALID_REGNUM, ++ NULL_RTX, ++ s390_indirect_branch_type_jump); ++ return ""; ++} ++ [(set_attr "op_type" "RIL") ++ (set_attr "mnemonic" "jg") ++ (set_attr "type" "branch") ++ (set_attr "atype" "agen")]) ++ ++ + (define_expand "casesi" + [(match_operand:SI 0 "general_operand" "") + (match_operand:SI 1 "general_operand" "") +@@ -9141,11 +9288,30 @@ + + (define_insn "*sibcall_br" + [(call (mem:QI (reg SIBCALL_REGNUM)) +- (match_operand 0 "const_int_operand" "n"))] ++ (match_operand 0 "const_int_operand" "n"))] + "SIBLING_CALL_P (insn) +- && GET_MODE (XEXP (XEXP (PATTERN (insn), 0), 0)) == Pmode" +- "br\t%%r1" +- [(set_attr "op_type" "RR") ++ && GET_MODE (XEXP (XEXP (PATTERN (insn), 0), 0)) == Pmode" ++{ ++ if (TARGET_INDIRECT_BRANCH_NOBP_CALL) ++ { ++ gcc_assert (TARGET_CPU_Z10); ++ s390_indirect_branch_via_thunk (SIBCALL_REGNUM, ++ INVALID_REGNUM, ++ NULL_RTX, ++ s390_indirect_branch_type_call); ++ return ""; ++ } ++ else ++ return "br\t%%r1"; ++} ++ [(set (attr "op_type") ++ (if_then_else (match_test "TARGET_INDIRECT_BRANCH_NOBP_CALL") ++ (const_string "RIL") ++ (const_string "RR"))) ++ (set (attr "mnemonic") ++ (if_then_else (match_test "TARGET_INDIRECT_BRANCH_NOBP_CALL") ++ (const_string "jg") ++ (const_string "br"))) + (set_attr "type" "branch") + (set_attr "atype" "agen")]) + +@@ -9185,8 +9351,27 @@ + (match_operand 1 "const_int_operand" "n")))] + "SIBLING_CALL_P (insn) + && GET_MODE (XEXP (XEXP (XEXP (PATTERN (insn), 1), 0), 0)) == Pmode" +- "br\t%%r1" +- [(set_attr "op_type" "RR") ++{ ++ if (TARGET_INDIRECT_BRANCH_NOBP_CALL) ++ { ++ gcc_assert (TARGET_CPU_Z10); ++ s390_indirect_branch_via_thunk (SIBCALL_REGNUM, ++ INVALID_REGNUM, ++ NULL_RTX, ++ s390_indirect_branch_type_call); ++ return ""; ++ } ++ else ++ return "br\t%%r1"; ++} ++ [(set (attr "op_type") ++ (if_then_else (match_test "TARGET_INDIRECT_BRANCH_NOBP_CALL") ++ (const_string "RIL") ++ (const_string "RR"))) ++ (set (attr "mnemonic") ++ (if_then_else (match_test "TARGET_INDIRECT_BRANCH_NOBP_CALL") ++ (const_string "jg") ++ (const_string "br"))) + (set_attr "type" "branch") + (set_attr "atype" "agen")]) + +@@ -9252,7 +9437,9 @@ + [(call (mem:QI (match_operand 0 "address_operand" "ZQZR")) + (match_operand 1 "const_int_operand" "n")) + (clobber (match_operand 2 "register_operand" "=r"))] +- "!SIBLING_CALL_P (insn) && GET_MODE (operands[2]) == Pmode" ++ "!TARGET_INDIRECT_BRANCH_NOBP_CALL ++ && !SIBLING_CALL_P (insn) ++ && GET_MODE (operands[2]) == Pmode" + { + if (get_attr_op_type (insn) == OP_TYPE_RR) + return "basr\t%2,%0"; +@@ -9262,6 +9449,50 @@ + [(set (attr "op_type") + (if_then_else (match_operand 0 "register_operand" "") + (const_string "RR") (const_string "RX"))) ++ (set (attr "mnemonic") ++ (if_then_else (match_operand 0 "register_operand" "") ++ (const_string "basr") (const_string "bas"))) ++ (set_attr "type" "jsr") ++ (set_attr "atype" "agen") ++ (set_attr "z196prop" "z196_cracked")]) ++ ++(define_insn "*basr_via_thunk_z10" ++ [(call (mem:QI (match_operand:P 0 "register_operand" "a")) ++ (match_operand 1 "const_int_operand" "n")) ++ (clobber (match_operand:P 2 "register_operand" "=&r"))] ++ "TARGET_INDIRECT_BRANCH_NOBP_CALL ++ && TARGET_CPU_Z10 ++ && !SIBLING_CALL_P (insn)" ++{ ++ s390_indirect_branch_via_thunk (REGNO (operands[0]), ++ REGNO (operands[2]), ++ NULL_RTX, ++ s390_indirect_branch_type_call); ++ return ""; ++} ++ [(set_attr "op_type" "RIL") ++ (set_attr "mnemonic" "brasl") ++ (set_attr "type" "jsr") ++ (set_attr "atype" "agen") ++ (set_attr "z196prop" "z196_cracked")]) ++ ++(define_insn "*basr_via_thunk" ++ [(call (mem:QI (match_operand:P 0 "register_operand" "a")) ++ (match_operand 1 "const_int_operand" "n")) ++ (clobber (match_operand:P 2 "register_operand" "=&r")) ++ (clobber (reg:P INDIRECT_BRANCH_THUNK_REGNUM))] ++ "TARGET_INDIRECT_BRANCH_NOBP_CALL ++ && !TARGET_CPU_Z10 ++ && !SIBLING_CALL_P (insn)" ++{ ++ s390_indirect_branch_via_thunk (REGNO (operands[0]), ++ REGNO (operands[2]), ++ NULL_RTX, ++ s390_indirect_branch_type_call); ++ return ""; ++} ++ [(set_attr "op_type" "RIL") ++ (set_attr "mnemonic" "brasl") + (set_attr "type" "jsr") + (set_attr "atype" "agen") + (set_attr "z196prop" "z196_cracked")]) +@@ -9313,7 +9544,10 @@ + (call (mem:QI (match_operand 1 "address_operand" "ZQZR")) + (match_operand 2 "const_int_operand" "n"))) + (clobber (match_operand 3 "register_operand" "=r"))] +- "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode" ++ "!TARGET_INDIRECT_BRANCH_NOBP_CALL ++ && !SIBLING_CALL_P (insn) ++ && GET_MODE (operands[3]) == Pmode" ++ + { + if (get_attr_op_type (insn) == OP_TYPE_RR) + return "basr\t%3,%1"; +@@ -9323,6 +9557,54 @@ + [(set (attr "op_type") + (if_then_else (match_operand 1 "register_operand" "") + (const_string "RR") (const_string "RX"))) ++ (set (attr "mnemonic") ++ (if_then_else (match_operand 1 "register_operand" "") ++ (const_string "basr") (const_string "bas"))) ++ (set_attr "type" "jsr") ++ (set_attr "atype" "agen") ++ (set_attr "z196prop" "z196_cracked")]) ++ ++(define_insn "*basr_r_via_thunk_z10" ++ [(set (match_operand 0 "" "") ++ (call (mem:QI (match_operand 1 "register_operand" "a")) ++ (match_operand 2 "const_int_operand" "n"))) ++ (clobber (match_operand 3 "register_operand" "=&r"))] ++ "TARGET_INDIRECT_BRANCH_NOBP_CALL ++ && TARGET_CPU_Z10 ++ && !SIBLING_CALL_P (insn) ++ && GET_MODE (operands[3]) == Pmode" ++{ ++ s390_indirect_branch_via_thunk (REGNO (operands[1]), ++ REGNO (operands[3]), ++ NULL_RTX, ++ s390_indirect_branch_type_call); ++ return ""; ++} ++ [(set_attr "op_type" "RIL") ++ (set_attr "mnemonic" "brasl") ++ (set_attr "type" "jsr") ++ (set_attr "atype" "agen") ++ (set_attr "z196prop" "z196_cracked")]) ++ ++(define_insn "*basr_r_via_thunk" ++ [(set (match_operand 0 "" "") ++ (call (mem:QI (match_operand 1 "register_operand" "a")) ++ (match_operand 2 "const_int_operand" "n"))) ++ (clobber (match_operand 3 "register_operand" "=&r")) ++ (clobber (reg:P INDIRECT_BRANCH_THUNK_REGNUM))] ++ "TARGET_INDIRECT_BRANCH_NOBP_CALL ++ && !TARGET_CPU_Z10 ++ && !SIBLING_CALL_P (insn) ++ && GET_MODE (operands[3]) == Pmode" ++{ ++ s390_indirect_branch_via_thunk (REGNO (operands[1]), ++ REGNO (operands[3]), ++ NULL_RTX, ++ s390_indirect_branch_type_call); ++ return ""; ++} ++ [(set_attr "op_type" "RIL") ++ (set_attr "mnemonic" "brasl") + (set_attr "type" "jsr") + (set_attr "atype" "agen") + (set_attr "z196prop" "z196_cracked")]) +@@ -10056,15 +10338,78 @@ + "" + "s390_emit_epilogue (true); DONE;") + +-(define_insn "*return" ++(define_expand "return_use" ++ [(parallel ++ [(return) ++ (use (match_operand 0 "register_operand" "a"))])] ++ "" ++{ ++ if (!TARGET_CPU_Z10 ++ && TARGET_INDIRECT_BRANCH_NOBP_RET_OPTION) ++ { ++ if (TARGET_64BIT) ++ emit_jump_insn (gen_returndi_prez10 (operands[0])); ++ else ++ emit_jump_insn (gen_returnsi_prez10 (operands[0])); ++ DONE; ++ } ++}) ++ ++(define_insn "*return" + [(return) +- (use (match_operand 0 "register_operand" "a"))] +- "GET_MODE (operands[0]) == Pmode" +- "br\t%0" +- [(set_attr "op_type" "RR") ++ (use (match_operand:P 0 "register_operand" "a"))] ++ "TARGET_CPU_Z10 || !TARGET_INDIRECT_BRANCH_NOBP_RET_OPTION" ++{ ++ if (TARGET_INDIRECT_BRANCH_NOBP_RET) ++ { ++ s390_indirect_branch_via_thunk (REGNO (operands[0]), ++ INVALID_REGNUM, ++ NULL_RTX, ++ s390_indirect_branch_type_return); ++ return ""; ++ } ++ else ++ return "br\t%0"; ++} ++ [(set (attr "op_type") ++ (if_then_else (match_test "TARGET_INDIRECT_BRANCH_NOBP_RET") ++ (const_string "RIL") ++ (const_string "RR"))) ++ (set (attr "mnemonic") ++ (if_then_else (match_test "TARGET_INDIRECT_BRANCH_NOBP_RET") ++ (const_string "jg") ++ (const_string "br"))) + (set_attr "type" "jsr") + (set_attr "atype" "agen")]) + ++(define_insn "return_prez10" ++ [(return) ++ (use (match_operand:P 0 "register_operand" "a")) ++ (clobber (reg:P INDIRECT_BRANCH_THUNK_REGNUM))] ++ "!TARGET_CPU_Z10 && TARGET_INDIRECT_BRANCH_NOBP_RET_OPTION" ++{ ++ if (TARGET_INDIRECT_BRANCH_NOBP_RET) ++ { ++ s390_indirect_branch_via_thunk (REGNO (operands[0]), ++ INVALID_REGNUM, ++ NULL_RTX, ++ s390_indirect_branch_type_return); ++ return ""; ++ } ++ else ++ return "br\t%0"; ++} ++ [(set (attr "op_type") ++ (if_then_else (match_test "TARGET_INDIRECT_BRANCH_NOBP_RET") ++ (const_string "RIL") ++ (const_string "RR"))) ++ (set (attr "mnemonic") ++ (if_then_else (match_test "TARGET_INDIRECT_BRANCH_NOBP_RET") ++ (const_string "jg") ++ (const_string "br"))) ++ (set_attr "type" "jsr") ++ (set_attr "atype" "agen")]) ++ + + ;; Instruction definition to extend a 31-bit pointer into a 64-bit + ;; pointer. This is used for compatibility. +diff -Nrup gcc/config/s390/s390.opt gcc/config/s390/s390.opt +--- gcc/config/s390/s390.opt 2018-03-27 09:33:19.763143675 -0600 ++++ gcc/config/s390/s390.opt 2018-03-27 09:33:58.832861566 -0600 +@@ -175,3 +175,59 @@ Target Report Joined RejectNegative UInt + Set the branch costs for conditional branch instructions. Reasonable + values are small, non-negative integers. The default branch cost is + 1. ++ ++mindirect-branch= ++Target Report RejectNegative Joined Enum(indirect_branch) Var(s390_indirect_branch) Init(indirect_branch_keep) ++Wrap all indirect branches into execute in order to disable branch ++prediction. ++ ++mindirect-branch-jump= ++Target Report RejectNegative Joined Enum(indirect_branch) Var(s390_indirect_branch_jump) Init(indirect_branch_keep) ++Wrap indirect table jumps and computed gotos into execute in order to ++disable branch prediction. Using thunk or thunk-extern with this ++option requires the thunks to be considered signal handlers to order to ++generate correct CFI. For environments where unwinding (e.g. for ++exceptions) is required please use thunk-inline instead. ++ ++mindirect-branch-call= ++Target Report RejectNegative Joined Enum(indirect_branch) Var(s390_indirect_branch_call) Init(indirect_branch_keep) ++Wrap all indirect calls into execute in order to disable branch prediction. ++ ++mfunction-return= ++Target Report RejectNegative Joined Enum(indirect_branch) Var(s390_function_return) Init(indirect_branch_keep) ++Wrap all indirect return branches into execute in order to disable branch ++prediction. ++ ++mfunction-return-mem= ++Target Report RejectNegative Joined Enum(indirect_branch) Var(s390_function_return_mem) Init(indirect_branch_keep) ++Wrap indirect return branches into execute in order to disable branch ++prediction. This affects only branches where the return address is ++going to be restored from memory. ++ ++mfunction-return-reg= ++Target Report RejectNegative Joined Enum(indirect_branch) Var(s390_function_return_reg) Init(indirect_branch_keep) ++Wrap indirect return branches into execute in order to disable branch ++prediction. This affects only branches where the return address ++doesn't need to be restored from memory. ++ ++Enum ++Name(indirect_branch) Type(enum indirect_branch) ++Known indirect branch choices (for use with the -mindirect-branch=/-mfunction-return= options): ++ ++EnumValue ++Enum(indirect_branch) String(keep) Value(indirect_branch_keep) ++ ++EnumValue ++Enum(indirect_branch) String(thunk) Value(indirect_branch_thunk) ++ ++EnumValue ++Enum(indirect_branch) String(thunk-extern) Value(indirect_branch_thunk_extern) ++ ++mindirect-branch-table ++Target Report Var(s390_indirect_branch_table) Init(TARGET_DEFAULT_INDIRECT_BRANCH_TABLE) ++Generate sections .s390_indirect_jump, .s390_indirect_call, ++.s390_return_reg, and .s390_return_mem to contain the indirect branch ++locations which have been patched as part of using one of the ++-mindirect-branch* or -mfunction-return* options. The sections ++consist of an array of 32 bit elements. Each entry holds the offset ++from the entry to the patched location. +diff -Nrup gcc/config/s390/s390-opts.h gcc/config/s390/s390-opts.h +--- gcc/config/s390/s390-opts.h 2018-03-27 09:33:19.764143668 -0600 ++++ gcc/config/s390/s390-opts.h 2018-03-27 09:33:58.821861645 -0600 +@@ -39,4 +39,12 @@ enum processor_type + PROCESSOR_max + }; + ++/* Values for -mindirect-branch and -mfunction-return options. */ ++enum indirect_branch { ++ indirect_branch_unset = 0, ++ indirect_branch_keep, ++ indirect_branch_thunk, ++ indirect_branch_thunk_extern ++}; ++ + #endif +diff -Nrup gcc/config/s390/s390-protos.h gcc/config/s390/s390-protos.h +--- gcc/config/s390/s390-protos.h 2018-03-27 09:33:19.764143668 -0600 ++++ gcc/config/s390/s390-protos.h 2018-03-27 09:33:58.821861645 -0600 +@@ -41,6 +41,7 @@ extern void s390_set_has_landing_pad_p ( + extern bool s390_hard_regno_mode_ok (unsigned int, enum machine_mode); + extern bool s390_hard_regno_rename_ok (unsigned int, unsigned int); + extern int s390_class_max_nregs (enum reg_class, enum machine_mode); ++extern bool s390_return_addr_from_memory(void); + extern int s390_cannot_change_mode_class (enum machine_mode, enum machine_mode, + enum reg_class); + extern bool s390_function_arg_vector (enum machine_mode, const_tree); +@@ -124,6 +125,18 @@ extern int s390_compare_and_branch_condi + extern bool s390_extzv_shift_ok (int, int, unsigned HOST_WIDE_INT); + extern void s390_asm_output_function_label (FILE *, const char *, tree); + ++enum s390_indirect_branch_type ++ { ++ s390_indirect_branch_type_jump = 0, ++ s390_indirect_branch_type_call, ++ s390_indirect_branch_type_return ++ }; ++extern void s390_indirect_branch_via_thunk (unsigned int regno, ++ unsigned int return_addr_regno, ++ rtx comparison_operator, ++ enum s390_indirect_branch_type type); ++extern void s390_indirect_branch_via_inline_thunk (rtx execute_target); ++ + #endif /* RTX_CODE */ + + /* s390-c.c routines */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-function-pointer-nothunk.c gcc/testsuite/gcc.target/s390/nobp-function-pointer-nothunk.c +--- gcc/testsuite/gcc.target/s390/nobp-function-pointer-nothunk.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-function-pointer-nothunk.c 2018-03-27 09:33:58.832861566 -0600 +@@ -0,0 +1,59 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O3 -march=z10 --save-temps -mindirect-branch-call=thunk-extern -mindirect-branch-table" } */ ++ ++int gl; ++ ++void __attribute__((noinline,noclone)) ++foo (int a) ++{ ++ gl = a + 40; ++} ++ ++int __attribute__((noinline,noclone)) ++foo_value (int a) ++{ ++ return a + 40; ++} ++ ++void* __attribute__((noinline,noclone)) ++get_fptr (int a) ++{ ++ switch (a) ++ { ++ case 0: return &foo; break; ++ case 1: return &foo_value; break; ++ default: __builtin_abort (); ++ } ++} ++ ++void (*f) (int); ++int (*g) (int); ++ ++int ++main () ++{ ++ int res; ++ ++ f = get_fptr(0); ++ f (2); ++ if (gl != 42) ++ __builtin_abort (); ++ ++ g = get_fptr(1); ++ if (g (2) != 42) ++ __builtin_abort (); ++ ++ return 0; ++} ++ ++/* 2 x main ++/* { dg-final { scan-assembler-times "brasl\t%r\[0-9\]*,__s390_indirect_jump" 2 } } */ ++ ++/* No thunks due to thunk-extern. */ ++/* { dg-final { scan-assembler-not "exrl" } } */ ++/* { dg-final { scan-assembler-not ".globl __s390_indirect_jump" } } */ ++ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-function-pointer-z10.c gcc/testsuite/gcc.target/s390/nobp-function-pointer-z10.c +--- gcc/testsuite/gcc.target/s390/nobp-function-pointer-z10.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-function-pointer-z10.c 2018-03-27 09:33:58.833861558 -0600 +@@ -0,0 +1,56 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -march=z10 --save-temps -mindirect-branch-call=thunk -mindirect-branch-table" } */ ++ ++int gl; ++ ++void __attribute__((noinline,noclone)) ++foo (int a) ++{ ++ gl = a + 40; ++} ++ ++int __attribute__((noinline,noclone)) ++foo_value (int a) ++{ ++ return a + 40; ++} ++ ++void* __attribute__((noinline,noclone)) ++get_fptr (int a) ++{ ++ switch (a) ++ { ++ case 0: return &foo; break; ++ case 1: return &foo_value; break; ++ default: __builtin_abort (); ++ } ++} ++ ++void (*f) (int); ++int (*g) (int); ++ ++int ++main () ++{ ++ int res; ++ ++ f = get_fptr(0); ++ f (2); ++ if (gl != 42) ++ __builtin_abort (); ++ ++ g = get_fptr(1); ++ if (g (2) != 42) ++ __builtin_abort (); ++ ++ return 0; ++} ++ ++/* 2 x main ++/* { dg-final { scan-assembler-times "brasl\t%r\[0-9\]*,__s390_indirect_jump" 2 } } */ ++/* { dg-final { scan-assembler "exrl" } } */ ++ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-function-pointer-z900.c gcc/testsuite/gcc.target/s390/nobp-function-pointer-z900.c +--- gcc/testsuite/gcc.target/s390/nobp-function-pointer-z900.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-function-pointer-z900.c 2018-03-27 09:33:58.833861558 -0600 +@@ -0,0 +1,56 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -march=z900 --save-temps -mindirect-branch-call=thunk -mindirect-branch-table" } */ ++ ++int gl; ++ ++void __attribute__((noinline,noclone)) ++foo (int a) ++{ ++ gl = a + 40; ++} ++ ++int __attribute__((noinline,noclone)) ++foo_value (int a) ++{ ++ return a + 40; ++} ++ ++void* __attribute__((noinline,noclone)) ++get_fptr (int a) ++{ ++ switch (a) ++ { ++ case 0: return &foo; break; ++ case 1: return &foo_value; break; ++ default: __builtin_abort (); ++ } ++} ++ ++void (*f) (int); ++int (*g) (int); ++ ++int ++main () ++{ ++ int res; ++ ++ f = get_fptr(0); ++ f (2); ++ if (gl != 42) ++ __builtin_abort (); ++ ++ g = get_fptr(1); ++ if (g (2) != 42) ++ __builtin_abort (); ++ ++ return 0; ++} ++ ++/* 2 x main ++/* { dg-final { scan-assembler-times "brasl\t%r\[0-9\]*,__s390_indirect_jump" 2 } } */ ++/* { dg-final { scan-assembler "ex\t" } } */ ++ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-indirect-jump-nothunk.c gcc/testsuite/gcc.target/s390/nobp-indirect-jump-nothunk.c +--- gcc/testsuite/gcc.target/s390/nobp-indirect-jump-nothunk.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-indirect-jump-nothunk.c 2018-03-27 09:33:58.833861558 -0600 +@@ -0,0 +1,45 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O3 -march=z10 --save-temps -mindirect-branch-jump=thunk-extern -mindirect-branch-table" } */ ++ ++/* This is a copy of the gcc.c-torture/execute/20040302-1.c ++ testcase. */ ++ ++int code[]={0,0,0,0,1}; ++ ++void ++foo(int x) { ++ volatile int b; ++ b = 0xffffffff; ++} ++ ++void ++bar(int *pc) { ++ static const void *l[] = {&&lab0, &&end}; ++ ++ foo(0); ++ goto *l[*pc]; ++ lab0: ++ foo(0); ++ pc++; ++ goto *l[*pc]; ++ end: ++ return; ++} ++ ++int ++main() { ++ bar(code); ++ return 0; ++} ++ ++/* 2 x bar ++/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 2 } } */ ++ ++/* No thunks due to thunk-extern. */ ++/* { dg-final { scan-assembler-not "exrl" } } */ ++/* { dg-final { scan-assembler-not ".globl __s390_indirect_jump" } } */ ++ ++/* { dg-final { scan-assembler "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-indirect-jump-z10.c gcc/testsuite/gcc.target/s390/nobp-indirect-jump-z10.c +--- gcc/testsuite/gcc.target/s390/nobp-indirect-jump-z10.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-indirect-jump-z10.c 2018-03-27 09:33:58.834861551 -0600 +@@ -0,0 +1,42 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -march=z10 --save-temps -mindirect-branch-jump=thunk -mindirect-branch-table" } */ ++ ++/* This is a copy of the gcc.c-torture/execute/20040302-1.c ++ testcase. */ ++ ++int code[]={0,0,0,0,1}; ++ ++void ++foo(int x) { ++ volatile int b; ++ b = 0xffffffff; ++} ++ ++void ++bar(int *pc) { ++ static const void *l[] = {&&lab0, &&end}; ++ ++ foo(0); ++ goto *l[*pc]; ++ lab0: ++ foo(0); ++ pc++; ++ goto *l[*pc]; ++ end: ++ return; ++} ++ ++int ++main() { ++ bar(code); ++ return 0; ++} ++ ++/* 2x bar */ ++/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 2 } } */ ++/* { dg-final { scan-assembler "exrl" } } */ ++ ++/* { dg-final { scan-assembler "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-indirect-jump-z900.c gcc/testsuite/gcc.target/s390/nobp-indirect-jump-z900.c +--- gcc/testsuite/gcc.target/s390/nobp-indirect-jump-z900.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-indirect-jump-z900.c 2018-03-27 09:33:58.834861551 -0600 +@@ -0,0 +1,42 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -march=z900 --save-temps -mindirect-branch-jump=thunk -mindirect-branch-table" } */ ++ ++/* This is a copy of the gcc.c-torture/execute/20040302-1.c ++ testcase. */ ++ ++int code[]={0,0,0,0,1}; ++ ++void ++foo(int x) { ++ volatile int b; ++ b = 0xffffffff; ++} ++ ++void ++bar(int *pc) { ++ static const void *l[] = {&&lab0, &&end}; ++ ++ foo(0); ++ goto *l[*pc]; ++ lab0: ++ foo(0); ++ pc++; ++ goto *l[*pc]; ++ end: ++ return; ++} ++ ++int ++main() { ++ bar(code); ++ return 0; ++} ++ ++/* 2 x bar ++/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 2 } } */ ++/* { dg-final { scan-assembler "ex\t" } } */ ++ ++/* { dg-final { scan-assembler "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-return-mem-nothunk.c gcc/testsuite/gcc.target/s390/nobp-return-mem-nothunk.c +--- gcc/testsuite/gcc.target/s390/nobp-return-mem-nothunk.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-return-mem-nothunk.c 2018-03-27 09:33:58.834861551 -0600 +@@ -0,0 +1,44 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O3 -march=z10 -mzarch --save-temps -mfunction-return-mem=thunk-extern -mindirect-branch-table" } */ ++ ++int gl = 0; ++ ++int __attribute__((noinline,noclone)) ++bar (int a) ++{ ++ return a + 2; ++} ++ ++void __attribute__((noinline,noclone)) ++foo (int a) ++{ ++ int i; ++ ++ if (a == 42) ++ return; ++ ++ for (i = 0; i < a; i++) ++ gl += bar (i); ++} ++ ++int ++main () ++{ ++ foo (3); ++ if (gl != 9) ++ __builtin_abort (); ++ ++ return 0; ++} ++ ++/* 1 x foo, 1 x main ++/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 2 } } */ ++ ++/* No thunks due to thunk-extern. */ ++/* { dg-final { scan-assembler-not "exrl" } } */ ++/* { dg-final { scan-assembler-not ".globl __s390_indirect_jump" } } */ ++ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-return-mem-z10.c gcc/testsuite/gcc.target/s390/nobp-return-mem-z10.c +--- gcc/testsuite/gcc.target/s390/nobp-return-mem-z10.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-return-mem-z10.c 2018-03-27 09:33:58.835861544 -0600 +@@ -0,0 +1,41 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -march=z10 -mzarch --save-temps -mfunction-return-mem=thunk -mindirect-branch-table" } */ ++ ++int gl = 0; ++ ++int __attribute__((noinline,noclone)) ++bar (int a) ++{ ++ return a + 2; ++} ++ ++void __attribute__((noinline,noclone)) ++foo (int a) ++{ ++ int i; ++ ++ if (a == 42) ++ return; ++ ++ for (i = 0; i < a; i++) ++ gl += bar (i); ++} ++ ++int ++main () ++{ ++ foo (3); ++ if (gl != 9) ++ __builtin_abort (); ++ ++ return 0; ++} ++ ++/* 1 x foo, 1 x main ++/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 2 } } */ ++/* { dg-final { scan-assembler "exrl" } } */ ++ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-return-mem-z900.c gcc/testsuite/gcc.target/s390/nobp-return-mem-z900.c +--- gcc/testsuite/gcc.target/s390/nobp-return-mem-z900.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-return-mem-z900.c 2018-03-27 09:33:58.835861544 -0600 +@@ -0,0 +1,42 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -march=z900 --save-temps -mfunction-return-mem=thunk -mindirect-branch-table" } */ ++ ++int gl = 0; ++ ++int __attribute__((noinline,noclone)) ++bar (int a) ++{ ++ return a + 2; ++} ++ ++void __attribute__((noinline,noclone)) ++foo (int a) ++{ ++ int i; ++ ++ if (a == 42) ++ return; ++ ++ for (i = 0; i < a; i++) ++ gl += bar (i); ++} ++ ++int ++main () ++{ ++ foo (3); ++ if (gl != 9) ++ __builtin_abort (); ++ ++ return 0; ++} ++ ++/* 1 x foo, 1 x main ++/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 2 } } */ ++ ++/* { dg-final { scan-assembler "ex\t" } } */ ++ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-return-reg-nothunk.c gcc/testsuite/gcc.target/s390/nobp-return-reg-nothunk.c +--- gcc/testsuite/gcc.target/s390/nobp-return-reg-nothunk.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-return-reg-nothunk.c 2018-03-27 09:33:58.835861544 -0600 +@@ -0,0 +1,44 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O3 -march=z10 --save-temps -mfunction-return-reg=thunk-extern -mindirect-branch-table" } */ ++ ++int gl = 0; ++ ++int __attribute__((noinline,noclone)) ++bar (int a) ++{ ++ return a + 2; ++} ++ ++void __attribute__((noinline,noclone)) ++foo (int a) ++{ ++ int i; ++ ++ if (a == 42) ++ return; ++ ++ for (i = 0; i < a; i++) ++ gl += bar (i); ++} ++ ++int ++main () ++{ ++ foo (3); ++ if (gl != 9) ++ __builtin_abort (); ++ ++ return 0; ++} ++ ++/* 1 x bar ++/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 1 } } */ ++ ++/* No thunks due to thunk-extern. */ ++/* { dg-final { scan-assembler-not "exrl" } } */ ++/* { dg-final { scan-assembler-not ".globl __s390_indirect_jump" } } */ ++ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-return-reg-z10.c gcc/testsuite/gcc.target/s390/nobp-return-reg-z10.c +--- gcc/testsuite/gcc.target/s390/nobp-return-reg-z10.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-return-reg-z10.c 2018-03-27 09:33:58.836861537 -0600 +@@ -0,0 +1,41 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -march=z10 --save-temps -mfunction-return-reg=thunk -mindirect-branch-table" } */ ++ ++int gl = 0; ++ ++int __attribute__((noinline,noclone)) ++bar (int a) ++{ ++ return a + 2; ++} ++ ++void __attribute__((noinline,noclone)) ++foo (int a) ++{ ++ int i; ++ ++ if (a == 42) ++ return; ++ ++ for (i = 0; i < a; i++) ++ gl += bar (i); ++} ++ ++int ++main () ++{ ++ foo (3); ++ if (gl != 9) ++ __builtin_abort (); ++ ++ return 0; ++} ++ ++/* 1 x bar ++/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 1 } } */ ++/* { dg-final { scan-assembler "exrl" } } */ ++ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-return-reg-z900.c gcc/testsuite/gcc.target/s390/nobp-return-reg-z900.c +--- gcc/testsuite/gcc.target/s390/nobp-return-reg-z900.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-return-reg-z900.c 2018-03-27 09:33:58.836861537 -0600 +@@ -0,0 +1,41 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -march=z900 --save-temps -mfunction-return-reg=thunk -mindirect-branch-table" } */ ++ ++int gl = 0; ++ ++int __attribute__((noinline,noclone)) ++bar (int a) ++{ ++ return a + 2; ++} ++ ++void __attribute__((noinline,noclone)) ++foo (int a) ++{ ++ int i; ++ ++ if (a == 42) ++ return; ++ ++ for (i = 0; i < a; i++) ++ gl += bar (i); ++} ++ ++int ++main () ++{ ++ foo (3); ++ if (gl != 9) ++ __builtin_abort (); ++ ++ return 0; ++} ++ ++/* 1 x bar ++/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 1 } } */ ++/* { dg-final { scan-assembler "ex\t" } } */ ++ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler "section\t.s390_return_reg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-table-jump-z10.c gcc/testsuite/gcc.target/s390/nobp-table-jump-z10.c +--- gcc/testsuite/gcc.target/s390/nobp-table-jump-z10.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-table-jump-z10.c 2018-03-27 09:33:58.836861537 -0600 +@@ -0,0 +1,77 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -march=z10 -mzarch --save-temps -mindirect-branch-jump=thunk -mindirect-branch-table" } */ ++/* case-values-threshold will be set to 20 by the back-end when jump ++ thunk are requested. */ ++ ++int __attribute__((noinline,noclone)) foo1 (void) { return 1; } ++int __attribute__((noinline,noclone)) foo2 (void) { return 2; } ++int __attribute__((noinline,noclone)) foo3 (void) { return 3; } ++int __attribute__((noinline,noclone)) foo4 (void) { return 4; } ++int __attribute__((noinline,noclone)) foo5 (void) { return 5; } ++int __attribute__((noinline,noclone)) foo6 (void) { return 6; } ++int __attribute__((noinline,noclone)) foo7 (void) { return 7; } ++int __attribute__((noinline,noclone)) foo8 (void) { return 8; } ++int __attribute__((noinline,noclone)) foo9 (void) { return 9; } ++int __attribute__((noinline,noclone)) foo10 (void) { return 10; } ++int __attribute__((noinline,noclone)) foo11 (void) { return 11; } ++int __attribute__((noinline,noclone)) foo12 (void) { return 12; } ++int __attribute__((noinline,noclone)) foo13 (void) { return 13; } ++int __attribute__((noinline,noclone)) foo14 (void) { return 14; } ++int __attribute__((noinline,noclone)) foo15 (void) { return 15; } ++int __attribute__((noinline,noclone)) foo16 (void) { return 16; } ++int __attribute__((noinline,noclone)) foo17 (void) { return 17; } ++int __attribute__((noinline,noclone)) foo18 (void) { return 18; } ++int __attribute__((noinline,noclone)) foo19 (void) { return 19; } ++int __attribute__((noinline,noclone)) foo20 (void) { return 20; } ++ ++ ++int __attribute__((noinline,noclone)) ++bar (int a) ++{ ++ int ret = 0; ++ ++ switch (a) ++ { ++ case 1: ret = foo1 (); break; ++ case 2: ret = foo2 (); break; ++ case 3: ret = foo3 (); break; ++ case 4: ret = foo4 (); break; ++ case 5: ret = foo5 (); break; ++ case 6: ret = foo6 (); break; ++ case 7: ret = foo7 (); break; ++ case 8: ret = foo8 (); break; ++ case 9: ret = foo9 (); break; ++ case 10: ret = foo10 (); break; ++ case 11: ret = foo11 (); break; ++ case 12: ret = foo12 (); break; ++ case 13: ret = foo13 (); break; ++ case 14: ret = foo14 (); break; ++ case 15: ret = foo15 (); break; ++ case 16: ret = foo16 (); break; ++ case 17: ret = foo17 (); break; ++ case 18: ret = foo18 (); break; ++ case 19: ret = foo19 (); break; ++ case 20: ret = foo20 (); break; ++ default: ++ __builtin_abort (); ++ } ++ ++ return ret; ++} ++ ++int ++main () ++{ ++ if (bar (3) != 3) ++ __builtin_abort (); ++ ++ return 0; ++} ++ ++/* 1 x bar ++/* { dg-final { scan-assembler-times "exrl" 1 } } */ ++ ++/* { dg-final { scan-assembler "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_fromreg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_frommem" } } */ +diff -Nrup gcc/testsuite/gcc.target/s390/nobp-table-jump-z900.c gcc/testsuite/gcc.target/s390/nobp-table-jump-z900.c +--- gcc/testsuite/gcc.target/s390/nobp-table-jump-z900.c 1969-12-31 17:00:00.000000000 -0700 ++++ gcc/testsuite/gcc.target/s390/nobp-table-jump-z900.c 2018-03-27 09:33:58.837861529 -0600 +@@ -0,0 +1,78 @@ ++/* { dg-do run } */ ++/* { dg-options "-O3 -march=z900 -mzarch --save-temps -mindirect-branch-jump=thunk -mindirect-branch-table" } */ ++ ++/* case-values-threshold will be set to 20 by the back-end when jump ++ thunk are requested. */ ++ ++int __attribute__((noinline,noclone)) foo1 (void) { return 1; } ++int __attribute__((noinline,noclone)) foo2 (void) { return 2; } ++int __attribute__((noinline,noclone)) foo3 (void) { return 3; } ++int __attribute__((noinline,noclone)) foo4 (void) { return 4; } ++int __attribute__((noinline,noclone)) foo5 (void) { return 5; } ++int __attribute__((noinline,noclone)) foo6 (void) { return 6; } ++int __attribute__((noinline,noclone)) foo7 (void) { return 7; } ++int __attribute__((noinline,noclone)) foo8 (void) { return 8; } ++int __attribute__((noinline,noclone)) foo9 (void) { return 9; } ++int __attribute__((noinline,noclone)) foo10 (void) { return 10; } ++int __attribute__((noinline,noclone)) foo11 (void) { return 11; } ++int __attribute__((noinline,noclone)) foo12 (void) { return 12; } ++int __attribute__((noinline,noclone)) foo13 (void) { return 13; } ++int __attribute__((noinline,noclone)) foo14 (void) { return 14; } ++int __attribute__((noinline,noclone)) foo15 (void) { return 15; } ++int __attribute__((noinline,noclone)) foo16 (void) { return 16; } ++int __attribute__((noinline,noclone)) foo17 (void) { return 17; } ++int __attribute__((noinline,noclone)) foo18 (void) { return 18; } ++int __attribute__((noinline,noclone)) foo19 (void) { return 19; } ++int __attribute__((noinline,noclone)) foo20 (void) { return 20; } ++ ++ ++int __attribute__((noinline,noclone)) ++bar (int a) ++{ ++ int ret = 0; ++ ++ switch (a) ++ { ++ case 1: ret = foo1 (); break; ++ case 2: ret = foo2 (); break; ++ case 3: ret = foo3 (); break; ++ case 4: ret = foo4 (); break; ++ case 5: ret = foo5 (); break; ++ case 6: ret = foo6 (); break; ++ case 7: ret = foo7 (); break; ++ case 8: ret = foo8 (); break; ++ case 9: ret = foo9 (); break; ++ case 10: ret = foo10 (); break; ++ case 11: ret = foo11 (); break; ++ case 12: ret = foo12 (); break; ++ case 13: ret = foo13 (); break; ++ case 14: ret = foo14 (); break; ++ case 15: ret = foo15 (); break; ++ case 16: ret = foo16 (); break; ++ case 17: ret = foo17 (); break; ++ case 18: ret = foo18 (); break; ++ case 19: ret = foo19 (); break; ++ case 20: ret = foo20 (); break; ++ default: ++ __builtin_abort (); ++ } ++ ++ return ret; ++} ++ ++int ++main () ++{ ++ if (bar (3) != 3) ++ __builtin_abort (); ++ ++ return 0; ++} ++ ++/* 1 x bar ++/* { dg-final { scan-assembler-times "ex\t" 1 } } */ ++ ++/* { dg-final { scan-assembler "section\t.s390_indirect_jump" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_fromreg" } } */ ++/* { dg-final { scan-assembler-not "section\t.s390_return_frommem" } } */ diff --git a/SOURCES/gcc48-rh1555397.patch b/SOURCES/gcc48-rh1555397.patch new file mode 100644 index 00000000..317859f2 --- /dev/null +++ b/SOURCES/gcc48-rh1555397.patch @@ -0,0 +1,263 @@ +2017-06-28 Andreas Krebbel + + * config/s390/predicates.md: Use s390_rel_address_ok_p. + * config/s390/s390-protos.h: Add prototype of + s390_rel_address_ok_p. + * config/s390/s390.c (s390_got_symbol): New function. + (s390_rel_address_ok_p): New function. + (legitimize_pic_address): Use s390_rel_address_ok_p. + (s390_load_got): Use s390_got_symbol. + (s390_option_override): Issue error if + -mno-pic-data-is-text-relative is used without -fpic/-fPIC. + * config/s390/s390.h (TARGET_DEFAULT_PIC_DATA_IS_TEXT_RELATIVE): + New macro. + * config/s390/s390.opt: New option mpic-data-is-text-relative. + +--- gcc/config/s390/predicates.md 2013-08-14 07:55:12.000000000 -0400 ++++ gcc/config/s390/predicates.md 2018-04-09 21:36:49.428209951 -0400 +@@ -116,7 +116,7 @@ + if (GET_CODE (op) == SYMBOL_REF) + return (!SYMBOL_REF_ALIGN1_P (op) + && SYMBOL_REF_TLS_MODEL (op) == 0 +- && (!flag_pic || SYMBOL_REF_LOCAL_P (op))); ++ && s390_rel_address_ok_p (op)); + + /* Everything else must have a CONST, so strip it. */ + if (GET_CODE (op) != CONST) +@@ -141,7 +141,7 @@ + if (GET_CODE (op) == SYMBOL_REF) + return ((SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_ALIGN1) == 0 + && SYMBOL_REF_TLS_MODEL (op) == 0 +- && (!flag_pic || SYMBOL_REF_LOCAL_P (op))); ++ && s390_rel_address_ok_p (op)); + + /* Now we must have a @GOTENT offset or @PLT stub + or an @INDNTPOFF TLS offset. */ +--- gcc/config/s390/s390.c 2015-06-18 10:33:04.000000000 -0400 ++++ gcc/config/s390/s390.c 2018-04-09 21:32:43.489851529 -0400 +@@ -491,6 +491,23 @@ s390_label_align (rtx label) + return align_labels_log; + } + ++static GTY(()) rtx got_symbol; ++ ++/* Return the GOT table symbol. The symbol will be created when the ++ function is invoked for the first time. */ ++ ++static rtx ++s390_got_symbol (void) ++{ ++ if (!got_symbol) ++ { ++ got_symbol = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); ++ SYMBOL_REF_FLAGS (got_symbol) = SYMBOL_FLAG_LOCAL; ++ } ++ ++ return got_symbol; ++} ++ + static enum machine_mode + s390_libgcc_cmp_return_mode (void) + { +@@ -1863,6 +1880,9 @@ s390_option_override (void) + if (flag_prefetch_loop_arrays < 0 && HAVE_prefetch && optimize >= 3) + flag_prefetch_loop_arrays = 1; + ++ if (!s390_pic_data_is_text_relative && !flag_pic) ++ error ("-mno-pic-data-is-text-relative cannot be used without -fpic/-fPIC"); ++ + /* Use the alternative scheduling-pressure algorithm by default. */ + maybe_set_param_value (PARAM_SCHED_PRESSURE_ALGORITHM, 2, + global_options.x_param_values, +@@ -3557,6 +3577,26 @@ s390_load_address (rtx dst, rtx src) + emit_insn (gen_force_la_31 (dst, src)); + } + ++/* Return true if it ok to use SYMBOL_REF in a relative address. */ ++ ++bool ++s390_rel_address_ok_p (rtx symbol_ref) ++{ ++ tree decl; ++ ++ if (symbol_ref == s390_got_symbol () || CONSTANT_POOL_ADDRESS_P (symbol_ref)) ++ return true; ++ ++ decl = SYMBOL_REF_DECL (symbol_ref); ++ ++ if (!flag_pic || SYMBOL_REF_LOCAL_P (symbol_ref)) ++ return (s390_pic_data_is_text_relative ++ || (decl ++ && TREE_CODE (decl) == FUNCTION_DECL)); ++ ++ return false; ++} ++ + /* Return a legitimate reference for ORIG (an address) using the + register REG. If REG is 0, a new pseudo is generated. + +@@ -3594,7 +3634,7 @@ legitimize_pic_address (rtx orig, rtx re + } + + if ((GET_CODE (addr) == LABEL_REF +- || (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (addr)) ++ || (GET_CODE (addr) == SYMBOL_REF && s390_rel_address_ok_p (addr)) + || (GET_CODE (addr) == UNSPEC && + (XINT (addr, 1) == UNSPEC_GOTENT + || (TARGET_CPU_ZARCH && XINT (addr, 1) == UNSPEC_PLT)))) +@@ -8545,7 +8585,6 @@ restore_gprs (rtx base, int offset, int + + /* Return insn sequence to load the GOT register. */ + +-static GTY(()) rtx got_symbol; + rtx + s390_load_got (void) + { +@@ -8557,23 +8596,17 @@ s390_load_got (void) + aren't usable. */ + rtx got_rtx = gen_rtx_REG (Pmode, 12); + +- if (!got_symbol) +- { +- got_symbol = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); +- SYMBOL_REF_FLAGS (got_symbol) = SYMBOL_FLAG_LOCAL; +- } +- + start_sequence (); + + if (TARGET_CPU_ZARCH) + { +- emit_move_insn (got_rtx, got_symbol); ++ emit_move_insn (got_rtx, s390_got_symbol ()); + } + else + { + rtx offset; + +- offset = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, got_symbol), ++ offset = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, s390_got_symbol ()), + UNSPEC_LTREL_OFFSET); + offset = gen_rtx_CONST (Pmode, offset); + offset = force_const_mem (Pmode, offset); +--- gcc/config/s390/s390.h 2014-01-14 10:37:03.000000000 -0500 ++++ gcc/config/s390/s390.h 2018-04-09 21:21:28.076858052 -0400 +@@ -814,6 +814,10 @@ do { \ + + #define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X) + ++#ifndef TARGET_DEFAULT_PIC_DATA_IS_TEXT_RELATIVE ++#define TARGET_DEFAULT_PIC_DATA_IS_TEXT_RELATIVE 1 ++#endif ++ + + /* Assembler file format. */ + +--- gcc/config/s390/s390.opt 2015-06-18 10:33:05.000000000 -0400 ++++ gcc/config/s390/s390.opt 2018-04-09 21:28:18.842465842 -0400 +@@ -158,6 +158,10 @@ mzarch + Target Report RejectNegative Negative(mesa) Mask(ZARCH) + z/Architecture + ++mpic-data-is-text-relative ++Target Report Var(s390_pic_data_is_text_relative) Init(TARGET_DEFAULT_PIC_DATA_IS_TEXT_RELATIVE) ++Assume data segments are relative to text segment. ++ + mbranch-cost= + Target Report Joined RejectNegative UInteger Var(s390_branch_cost) Init(1) + Set the branch costs for conditional branch instructions. Reasonable +--- gcc/config/s390/s390-protos.h 2014-01-14 10:37:04.000000000 -0500 ++++ gcc/config/s390/s390-protos.h 2018-04-09 21:21:28.072858046 -0400 +@@ -52,6 +52,7 @@ extern bool s390_contiguous_bitmask_p (u + extern bool s390_split_ok_p (rtx, rtx, enum machine_mode, int); + extern bool s390_overlap_p (rtx, rtx, HOST_WIDE_INT); + extern bool s390_offset_p (rtx, rtx, rtx); ++extern bool s390_rel_address_ok_p (rtx); + extern int tls_symbolic_operand (rtx); + + extern bool s390_match_ccmode (rtx, enum machine_mode); +--- gcc/testsuite/gcc.target/s390/nodatarel-1.c 1969-12-31 19:00:00.000000000 -0500 ++++ gcc/testsuite/gcc.target/s390/nodatarel-1.c 2018-04-09 21:21:28.077858053 -0400 +@@ -0,0 +1,83 @@ ++/* Test -mno-pic-data-is-text-relative option. No relative addressing ++ of elements in .data and .bss are allowed with that option. */ ++ ++/* { dg-do compile } */ ++/* { dg-options "-O3 -fno-optimize-sibling-calls -fpic -mno-pic-data-is-text-relative -march=z10 -mtune=z9-109 -mzarch" } */ ++ ++static int a = 3; ++ ++/* With -mno-pic-data-is-text-relative these must be addressed via ++ GOT. */ ++ ++int __attribute__((noinline,noclone)) ++foo () ++{ ++ return a; ++} ++ ++static int __attribute__((noinline,noclone)) ++foostatic (void) ++{ ++ return a; ++} ++ ++/* Just to make a potentially modified. */ ++ ++void ++bar (int b) ++{ ++ a = b; ++} ++ ++/* { dg-final { scan-assembler-times "a@GOTENT" 3 } } */ ++ ++/* The exrl target is a label_ref which should not be affected at ++ all. */ ++ ++void ++mymemcpy (char *dst, char *src, long size) ++{ ++ __builtin_memcpy (dst, src, size); ++} ++ ++/* { dg-final { scan-assembler "exrl" } } */ ++ ++ ++/* PLT slots can still be addressed relatively. */ ++ ++int ++callfoo () ++{ ++ return foo (); ++} ++ ++/* { dg-final { scan-assembler-times "foo@PLT" 1 } } */ ++ ++ ++/* GOT entries can still be addressed relatively. */ ++ ++void * ++fooptr () ++{ ++ return &foo; ++} ++ ++/* { dg-final { scan-assembler-times "foo@GOTENT" 1 } } */ ++ ++ ++/* A static function can be addressed relatively. */ ++ ++int ++callfoostatic () ++{ ++ return foostatic (); ++} ++ ++void * ++foostaticptr () ++{ ++ return &foostatic; ++} ++ ++ ++/* { dg-final { scan-assembler-not "foostatic@" } } */ diff --git a/SOURCES/gcc48-rh330771.patch b/SOURCES/gcc48-rh330771.patch index 41f5c272..102730ff 100644 --- a/SOURCES/gcc48-rh330771.patch +++ b/SOURCES/gcc48-rh330771.patch @@ -8,7 +8,7 @@ @@ -550,7 +550,7 @@ libgcj_tools_la_LDFLAGS = -rpath $(toole $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF) \ $(LIBJAVA_LDFLAGS_LIBMATH) - + -libgcj_tools_la_LIBADD = libgcj.la +libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec \ @@ -19,9 +19,9 @@ @@ -1110,7 +1110,7 @@ libgcj_tools_la_LDFLAGS = -rpath $(toole $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF) \ $(LIBJAVA_LDFLAGS_LIBMATH) - + -libgcj_tools_la_LIBADD = libgcj.la +libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec \ - $(libgcj_tools_la_version_dep) $(am__append_19) + $(libgcj_tools_la_version_dep) $(am__append_19) libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS) \ diff --git a/SOURCES/gcc48-s390-z13.patch b/SOURCES/gcc48-s390-z13.patch index 997da177..05a3d5fa 100644 --- a/SOURCES/gcc48-s390-z13.patch +++ b/SOURCES/gcc48-s390-z13.patch @@ -569,35 +569,35 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX + | PF_Z13 | PF_VX }; - + /* Change optimizations to be performed, depending on the --- gcc/config/s390/2827.md 2015-06-18 17:09:04.000000000 +0200 +++ gcc/config/s390/2827.md 2016-05-11 18:03:45.000000000 +0200 @@ -18,20 +18,19 @@ ;; along with GCC; see the file COPYING3. If not see ;; . - + - -(define_attr "ooo_cracked" "" +(define_attr "zEC12_cracked" "" (cond [(eq_attr "mnemonic" "cgdbr,clfxtr,cdgtr,celfbr,cxgtr,clfebr,clc,lngfr,cs,cfxbr,xc,clfdbr,basr,ex,cxlgtr,clfdtr,srdl,lpgfr,cdlgbr,cgxtr,cxlftr,nc,cxftr,cdfbr,clfxbr,cdftr,clgxbr,cgdtr,cxlgbr,mvc,clgdtr,cegbr,cfebr,cdlftr,sldl,cdlgtr,csg,chhsi,clgebr,cxgbr,cxfbr,cdlfbr,cgebr,lzxr,oc,cdgbr,brasl,cgxbr,cxlfbr,clgxtr,exrl,cfdbr,celgbr,clgdbr,lxr,cpsdr,lcgfr,bras,srda,cefbr") (const_int 1)] (const_int 0))) - + -(define_attr "ooo_expanded" "" +(define_attr "zEC12_expanded" "" (cond [(eq_attr "mnemonic" "dlr,dsgr,d,dsgf,stam,dsgfr,dlgr,dsg,cds,dr,stm,mvc,dl,cdsg,stmy,dlg,stmg,lam") (const_int 1)] (const_int 0))) - + -(define_attr "ooo_endgroup" "" +(define_attr "zEC12_endgroup" "" (cond [(eq_attr "mnemonic" "ipm") (const_int 1)] (const_int 0))) - + -(define_attr "ooo_groupalone" "" +(define_attr "zEC12_groupalone" "" (cond [(eq_attr "mnemonic" "lnxbr,madb,ltxtr,clc,axtr,msebr,slbgr,xc,alcr,lpxbr,slbr,maebr,mlg,mfy,lxdtr,maeb,lxeb,nc,mxtr,sxtr,dxbr,alc,msdbr,ltxbr,lxdb,madbr,lxdbr,lxebr,mvc,m,mseb,mlr,mlgr,slb,tcxb,msdb,sqxbr,alcgr,oc,flogr,alcg,mxbr,dxtr,axbr,mr,sxbr,slbg,ml,lcxbr,bcr_flush") (const_int 1)] (const_int 0))) - + --- gcc/config/s390/2964.md 1970-01-01 01:00:00.000000000 +0100 +++ gcc/config/s390/2964.md 2016-05-11 18:03:45.000000000 +0200 @@ -0,0 +1,232 @@ @@ -853,8 +853,8 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 ;; G -- Const double zero operand @@ -109,6 +117,11 @@ Access registers 36 and 37") - - + + +(define_register_constraint "v" + "VEC_REGS" + "Vector registers v0-v31") @@ -865,8 +865,8 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 ;; @@ -374,6 +387,33 @@ (match_test "s390_O_constraint_str ('n', ival)"))) - - + + +;; +;; Vector constraints follow. +;; @@ -894,15 +894,15 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + (and (and (match_code "const_vector") + (match_test "s390_const_vec_duplicate_p (op)")) + (match_test "satisfies_constraint_K (XVECEXP (op, 0, 0))"))) - - + + ;; --- gcc/config/s390/predicates.md 2013-08-14 13:55:12.000000000 +0200 +++ gcc/config/s390/predicates.md 2016-05-11 18:17:42.508662564 +0200 @@ -24,16 +24,26 @@ - + ;; operands -------------------------------------------------------------- - + -;; Return true if OP a (const_int 0) operand. - +;; Return true if OP a const 0 operand (int/float/vector). @@ -910,7 +910,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - (and (match_code "const_int, const_double") + (and (match_code "const_int,const_double,const_vector") (match_test "op == CONST0_RTX (mode)"))) - + +;; Return true if OP an all ones operand (int/vector). +(define_predicate "all_ones_operand" + (and (match_code "const_int, const_double, const_vector") @@ -923,12 +923,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + (match_test "UINTVAL (op) < 16"))) + ;; Return true if OP is constant. - + (define_special_predicate "consttable_operand" - (and (match_code "symbol_ref, label_ref, const, const_int, const_double") + (and (match_code "symbol_ref, label_ref, const, const_int, const_double, const_vector") (match_test "CONSTANT_P (op)"))) - + ;; Return true if OP is a valid S-type operand. --- gcc/config/s390/s390-builtins.def 1970-01-01 01:00:00.000000000 +0100 +++ gcc/config/s390/s390-builtins.def 2016-05-11 17:53:57.000000000 +0200 @@ -4367,11 +4367,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 +#include "plugin-api.h" +#include "cgraph.h" +#include "tm-constrs.h" - + /* Define the specific costs for a given cpu. */ - + @@ -288,6 +292,19 @@ extern int reload_completed; - + /* Kept up to date using the SCHED_VARIABLE_ISSUE hook. */ static rtx last_scheduled_insn; +#define MAX_SCHED_UNITS 3 @@ -4387,7 +4387,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + calculated. Everything beyond this gives MAX_SCHED_MIX_SCORE. + Increase this with the OOO windows size of the machine. */ +#define MAX_SCHED_MIX_DISTANCE 100 - + /* Structure used to hold the components of a S/390 memory address. A legitimate address on S/390 is of the general @@ -387,6 +404,7 @@ struct GTY(()) machine_function @@ -4395,13 +4395,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 #define GP_ARG_NUM_REG 5 #define FP_ARG_NUM_REG (TARGET_64BIT? 4 : 2) +#define VEC_ARG_NUM_REG 8 - + /* A couple of shortcuts. */ #define CONST_OK_FOR_J(x) \ @@ -407,6 +425,539 @@ struct GTY(()) machine_function bytes on a z10 (or higher) CPU. */ #define PREDICT_DISTANCE (TARGET_Z10 ? 384 : 2048) - + + +/* Indicate which ABI has been used for passing vector args. + 0 - no vector type arguments have been passed where the ABI is relevant @@ -4941,7 +4941,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -458,9 +1009,43 @@ s390_handle_hotpatch_attribute (tree *no return NULL_TREE; } - + +/* Expand the s390_vector_bool type attribute. */ + +static tree @@ -4987,7 +4987,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -524,6 +1109,35 @@ s390_scalar_mode_supported_p (enum machi return default_scalar_mode_supported_p (mode); } - + +/* Return true if the back end supports vector mode MODE. */ +static bool +s390_vector_mode_supported_p (enum machine_mode mode) @@ -5018,7 +5018,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 +} + /* Set the has_landing_pad_p flag in struct machine_function to VALUE. */ - + void @@ -595,6 +1209,11 @@ s390_match_ccmode_set (rtx set, enum mac case CCT1mode: @@ -5131,7 +5131,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + gen_rtx_SCRATCH (V2DImode))))); + return true; } - + + /* Emit a compare instruction suitable to implement the comparison OP0 CODE OP1. Return the correct condition RTL to be placed in @@ -5139,7 +5139,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -984,10 +1691,18 @@ s390_emit_compare (enum rtx_code code, r enum machine_mode mode = s390_select_ccmode (code, op0, op1); rtx cc; - + - /* Do not output a redundant compare instruction if a compare_and_swap - pattern already computed the result and the machine modes are compatible. */ - if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_CC) @@ -5157,12 +5157,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + compare_and_swap pattern already computed the result and the + machine modes are compatible. */ gcc_assert (s390_cc_modes_compatible (GET_MODE (op0), mode) - == GET_MODE (op0)); + == GET_MODE (op0)); cc = op0; @@ -1222,6 +1937,93 @@ s390_branch_condition_mask (rtx code) } break; - + + /* Vector comparison modes. */ + + case CCVEQmode: @@ -5252,21 +5252,21 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + case CCRAWmode: switch (GET_CODE (code)) - { + { @@ -1421,6 +2223,9 @@ s390_contiguous_bitmask_p (unsigned HOST /* Calculate a mask for all bits beyond the contiguous bits. */ mask = (-1LL & ~(((1ULL << (tmp_length + tmp_pos - 1)) << 1) - 1)); - + + if ((unsigned)size < sizeof (HOST_WIDE_INT) * BITS_PER_UNIT) + mask &= ((unsigned HOST_WIDE_INT) 1 << size) - 1; + if (mask & in) return false; - + @@ -1436,6 +2241,128 @@ s390_contiguous_bitmask_p (unsigned HOST return true; } - + +/* Return true if OP is a constant vector with the same constant in + all its elements. */ + @@ -5401,12 +5401,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + /* Floating point and vector registers cannot be split. */ + if (FP_REG_P (src) || FP_REG_P (dst) || VECTOR_REG_P (src) || VECTOR_REG_P (dst)) return false; - + /* We don't need to split if operands are directly accessible. */ @@ -1752,6 +2679,22 @@ s390_option_override (void) if (!(target_flags_explicit & MASK_OPT_HTM) && TARGET_CPU_HTM && TARGET_ZARCH) target_flags |= MASK_OPT_HTM; - + + if (target_flags_explicit & MASK_OPT_VX) + { + if (TARGET_OPT_VX) @@ -5435,7 +5435,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 break; default: @@ -1818,7 +2762,8 @@ s390_option_override (void) - + if (s390_tune == PROCESSOR_2097_Z10 || s390_tune == PROCESSOR_2817_Z196 - || s390_tune == PROCESSOR_2827_ZEC12) @@ -5443,10 +5443,10 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + || s390_tune == PROCESSOR_2964_Z13) { maybe_set_param_value (PARAM_MAX_UNROLLED_INSNS, 100, - global_options.x_param_values, + global_options.x_param_values, @@ -1882,16 +2827,20 @@ s390_option_override (void) /* Map for smallest class containing reg regno. */ - + const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] = -{ GENERAL_REGS, ADDR_REGS, ADDR_REGS, ADDR_REGS, - ADDR_REGS, ADDR_REGS, ADDR_REGS, ADDR_REGS, @@ -5473,7 +5473,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + VEC_REGS, VEC_REGS, VEC_REGS, VEC_REGS, /* 48 */ + VEC_REGS, VEC_REGS /* 52 */ }; - + /* Return attribute type of insn. */ @@ -2933,6 +3882,19 @@ legitimate_pic_operand_p (rtx op) static bool @@ -5502,11 +5502,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + case CONST_VECTOR: /* Accept all non-symbolic constants. */ return false; - + @@ -3101,6 +4064,25 @@ legitimate_reload_fp_constant_p (rtx op) return false; } - + +/* Returns true if the constant value OP is a legitimate vector operand + during and after reload. + This function accepts all constants which can be loaded directly @@ -5528,25 +5528,25 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + /* Given an rtx OP being reloaded into a reg required to be in class RCLASS, return the class of reg to actually use. */ - + @@ -3111,6 +4093,7 @@ s390_preferred_reload_class (rtx op, reg { /* Constants we cannot reload into general registers - must be forced into the literal pool. */ + must be forced into the literal pool. */ + case CONST_VECTOR: case CONST_DOUBLE: case CONST_INT: - if (reg_class_subset_p (GENERAL_REGS, rclass) + if (reg_class_subset_p (GENERAL_REGS, rclass) @@ -3122,6 +4105,10 @@ s390_preferred_reload_class (rtx op, reg - else if (reg_class_subset_p (FP_REGS, rclass) - && legitimate_reload_fp_constant_p (op)) - return FP_REGS; + else if (reg_class_subset_p (FP_REGS, rclass) + && legitimate_reload_fp_constant_p (op)) + return FP_REGS; + else if (reg_class_subset_p (VEC_REGS, rclass) + && legitimate_reload_vector_constant_p (op)) + return VEC_REGS; + - return NO_REGS; - + return NO_REGS; + /* If a symbolic constant or a PLUS is reloaded, @@ -3245,6 +4232,7 @@ s390_reload_symref_address (rtx reg, rtx /* Reload might have pulled a constant out of the literal pool. @@ -5555,11 +5555,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + || GET_CODE (mem) == CONST_VECTOR || GET_CODE (mem) == CONST) mem = force_const_mem (GET_MODE (reg), mem); - + @@ -3284,6 +4272,30 @@ s390_secondary_reload (bool in_p, rtx x, if (reg_classes_intersect_p (CC_REGS, rclass)) return GENERAL_REGS; - + + if (TARGET_VX) + { + /* The vst/vl vector move instructions allow only for short @@ -5588,9 +5588,9 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 { HOST_WIDE_INT offset; @@ -3299,17 +4311,15 @@ s390_secondary_reload (bool in_p, rtx x, - sri->icode = ((mode == DImode) ? CODE_FOR_reloaddi_larl_odd_addend_z10 - : CODE_FOR_reloadsi_larl_odd_addend_z10); - + sri->icode = ((mode == DImode) ? CODE_FOR_reloaddi_larl_odd_addend_z10 + : CODE_FOR_reloadsi_larl_odd_addend_z10); + - /* On z10 we need a scratch register when moving QI, TI or floating - point mode values from or to a memory location with a SYMBOL_REF - or if the symref addend of a SI or DI move is not aligned to the @@ -5598,7 +5598,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + /* Handle all the (mem (symref)) accesses we cannot use the z10 + instructions for. */ if (MEM_P (x) - && s390_loadrelative_operand_p (XEXP (x, 0), NULL, NULL) + && s390_loadrelative_operand_p (XEXP (x, 0), NULL, NULL) - && (mode == QImode || mode == TImode || FLOAT_MODE_P (mode) - || (!TARGET_ZARCH && mode == DImode) - || ((mode == HImode || mode == SImode || mode == DImode) @@ -5609,13 +5609,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + || GET_MODE_SIZE (mode) > UNITS_PER_WORD + || !s390_check_symref_alignment (XEXP (x, 0), + GET_MODE_SIZE (mode)))) - { + { #define __SECONDARY_RELOAD_CASE(M,m) \ - case M##mode: \ + case M##mode: \ @@ -3334,7 +4344,27 @@ s390_secondary_reload (bool in_p, rtx x, - __SECONDARY_RELOAD_CASE (SD, sd); - __SECONDARY_RELOAD_CASE (DD, dd); - __SECONDARY_RELOAD_CASE (TD, td); + __SECONDARY_RELOAD_CASE (SD, sd); + __SECONDARY_RELOAD_CASE (DD, dd); + __SECONDARY_RELOAD_CASE (TD, td); - + __SECONDARY_RELOAD_CASE (V1QI, v1qi); + __SECONDARY_RELOAD_CASE (V2QI, v2qi); @@ -5638,30 +5638,30 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + __SECONDARY_RELOAD_CASE (V1DF, v1df); + __SECONDARY_RELOAD_CASE (V2DF, v2df); + __SECONDARY_RELOAD_CASE (V1TF, v1tf); - default: - gcc_unreachable (); - } + default: + gcc_unreachable (); + } @@ -3371,12 +4401,12 @@ s390_secondary_reload (bool in_p, rtx x, - { - if (in_p) - sri->icode = (TARGET_64BIT ? + { + if (in_p) + sri->icode = (TARGET_64BIT ? - CODE_FOR_reloaddi_nonoffmem_in : - CODE_FOR_reloadsi_nonoffmem_in); + CODE_FOR_reloaddi_la_in : + CODE_FOR_reloadsi_la_in); - else - sri->icode = (TARGET_64BIT ? + else + sri->icode = (TARGET_64BIT ? - CODE_FOR_reloaddi_nonoffmem_out : - CODE_FOR_reloadsi_nonoffmem_out); + CODE_FOR_reloaddi_la_out : + CODE_FOR_reloadsi_la_out); - } + } } - + @@ -4610,6 +5640,256 @@ s390_expand_cmpmem (rtx target, rtx op0, return true; } - + +/* Emit a conditional jump to LABEL for condition code mask MASK using + comparsion operator COMPARISON. Return the emitted jump insn. */ + @@ -5912,13 +5912,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + LABEL_NUSES (exit_label) = 1; +} + - + /* Expand conditional increment or decrement using alc/slb instructions. Should generate code setting DST to either SRC or SRC + INCREMENT, @@ -4964,6 +6244,304 @@ s390_expand_mask_and_shift (rtx val, enu - NULL_RTX, 1, OPTAB_DIRECT); + NULL_RTX, 1, OPTAB_DIRECT); } - + +/* Generate a vector comparison COND of CMP_OP1 and CMP_OP2 and store + the result in TARGET. */ + @@ -6219,11 +6219,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + /* Structure to hold the initial parameters for a compare_and_swap operation in HImode and QImode. */ - + @@ -5259,12 +6837,37 @@ s390_output_dwarf_dtprel (FILE *file, in fputs ("@DTPOFF", file); } - + +/* Return the proper mode for REGNO being represented in the dwarf + unwind table. */ +enum machine_mode @@ -6240,7 +6240,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + #ifdef TARGET_ALTERNATE_LONG_DOUBLE_MANGLING /* Implement TARGET_MANGLE_TYPE. */ - + static const char * s390_mangle_type (const_tree type) { @@ -6268,7 +6268,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + 'R': print only the base register of a memory reference or address. 'S': print S-type memory reference (base+displacement). 'Y': print shift count operand. - + 'b': print integer X as if it's an unsigned byte. 'c': print integer X as if it's an signed byte. - 'e': "end" of DImode contiguous bitmask X. @@ -6289,12 +6289,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 'x': print integer X as if it's an unsigned halfword. + 'v': print register number as vector register (v1 instead of f1). */ - + void @@ -5701,14 +7306,7 @@ print_operand (FILE *file, rtx x, int co struct s390_address ad; - int ret; - + int ret; + - if (!MEM_P (x)) - { - output_operand_lossage ("memory reference expected for " @@ -6304,13 +6304,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - - ret = s390_decompose_address (XEXP (x, 0), &ad); + ret = s390_decompose_address (MEM_P (x) ? XEXP (x, 0) : x, &ad); - - if (!ret - || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base))) + + if (!ret + || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base))) @@ -5730,14 +7328,7 @@ print_operand (FILE *file, rtx x, int co struct s390_address ad; - int ret; - + int ret; + - if (!MEM_P (x)) - { - output_operand_lossage ("memory reference expected for " @@ -6320,9 +6320,9 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - - ret = s390_decompose_address (XEXP (x, 0), &ad); + ret = s390_decompose_address (MEM_P (x) ? XEXP (x, 0) : x, &ad); - - if (!ret - || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base))) + + if (!ret + || (ad.base && !REGNO_OK_FOR_BASE_P (REGNO (ad.base))) @@ -5815,7 +7406,17 @@ print_operand (FILE *file, rtx x, int co switch (GET_CODE (x)) { @@ -6340,11 +6340,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + else + fprintf (file, "%s", reg_names[REGNO (x)]); break; - + case MEM: @@ -5902,6 +7503,44 @@ print_operand (FILE *file, rtx x, int co - code); - } + code); + } break; + case CONST_VECTOR: + switch (code) @@ -6384,7 +6384,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + "modifier '%c'", code); + } + break; - + default: if (code == 0) @@ -6051,7 +7690,8 @@ s390_adjust_priority (rtx insn ATTRIBUTE @@ -6395,12 +6395,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + && s390_tune != PROCESSOR_2827_ZEC12 + && s390_tune != PROCESSOR_2964_Z13) return priority; - + switch (s390_safe_attr_type (insn)) @@ -6459,14 +8099,20 @@ replace_ltrel_base (rtx *x) /* We keep a list of constants which we have to add to internal constant tables in the middle of large functions. */ - + -#define NR_C_MODES 11 +#define NR_C_MODES 32 enum machine_mode constant_modes[NR_C_MODES] = @@ -6418,12 +6418,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + QImode, + V1QImode }; - + struct constant @@ -7490,6 +9136,23 @@ s390_output_pool_entry (rtx exp, enum ma mark_symbol_refs_as_used (exp); break; - + + case MODE_VECTOR_INT: + case MODE_VECTOR_FLOAT: + { @@ -6468,8 +6468,8 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + return true; + if (REGNO_PAIR_OK (regno, mode)) - { - if (mode == SImode || mode == DImode) + { + if (mode == SImode || mode == DImode) @@ -8269,19 +9948,86 @@ s390_hard_regno_rename_ok (unsigned int int s390_class_max_nregs (enum reg_class rclass, enum machine_mode mode) @@ -6560,12 +6560,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + + return 0; } - + /* Return true if register FROM can be eliminated via register TO. */ @@ -9112,6 +10858,23 @@ s390_emit_epilogue (bool sibcall) } - - + + +/* The VX ABI differs for vararg functions. Therefore we need the + prototype of the callee to be available when passing vector type + values. */ @@ -6589,7 +6589,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -9126,8 +10889,57 @@ s390_function_arg_size (enum machine_mod if (mode != BLKmode) return GET_MODE_SIZE (mode); - + - /* If we have neither type nor mode, abort */ - gcc_unreachable (); + /* If we have neither type nor mode, abort */ @@ -6644,7 +6644,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + + return TREE_CODE (type) == VECTOR_TYPE; } - + /* Return true if a function argument of type TYPE and mode MODE @@ -9136,8 +10948,7 @@ s390_function_arg_size (enum machine_mod static bool @@ -6654,10 +6654,10 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - if (size > 8) + if (s390_function_arg_size (mode, type) > 8) return false; - + /* Soft-float changes the ABI: no floating-point registers are used. */ @@ -9220,20 +11031,24 @@ s390_pass_by_reference (cumulative_args_ - bool named ATTRIBUTE_UNUSED) + bool named ATTRIBUTE_UNUSED) { int size = s390_function_arg_size (mode, type); + @@ -6666,33 +6666,33 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + if (size > 8) return true; - + if (type) { if (AGGREGATE_TYPE_P (type) && exact_log2 (size) < 0) - return 1; + return true; - + if (TREE_CODE (type) == COMPLEX_TYPE - || TREE_CODE (type) == VECTOR_TYPE) + || TREE_CODE (type) == VECTOR_TYPE) - return 1; + return true; } - + - return 0; + return false; } - + /* Update the data in CUM to advance over an argument of mode MODE and @@ -9244,11 +11059,21 @@ s390_pass_by_reference (cumulative_args_ - + static void s390_function_arg_advance (cumulative_args_t cum_v, enum machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) + const_tree type, bool named) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - + - if (s390_function_arg_float (mode, type)) + if (s390_function_arg_vector (mode, type)) + { @@ -6709,14 +6709,14 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 cum->fprs += 1; } @@ -9282,14 +11107,26 @@ s390_function_arg_advance (cumulative_ar - + static rtx s390_function_arg (cumulative_args_t cum_v, enum machine_mode mode, - const_tree type, bool named ATTRIBUTE_UNUSED) + const_tree type, bool named) { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); - + - if (s390_function_arg_float (mode, type)) + if (!named) + s390_check_type_for_vector_abi (type, true, false); @@ -6736,21 +6736,21 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - return 0; + return NULL_RTX; else - return gen_rtx_REG (mode, cum->fprs + 16); + return gen_rtx_REG (mode, cum->fprs + 16); } @@ -9299,7 +11136,7 @@ s390_function_arg (cumulative_args_t cum int n_gprs = (size + UNITS_PER_LONG - 1) / UNITS_PER_LONG; - + if (cum->gprs + n_gprs > GP_ARG_NUM_REG) - return 0; + return NULL_RTX; else if (n_gprs == 1 || UNITS_PER_WORD == UNITS_PER_LONG) - return gen_rtx_REG (mode, cum->gprs + 2); + return gen_rtx_REG (mode, cum->gprs + 2); else if (n_gprs == 2) @@ -9342,6 +11179,12 @@ s390_return_in_memory (const_tree type, || TREE_CODE (type) == REAL_TYPE) return int_size_in_bytes (type) > 8; - + + /* vector types which fit into a VR. */ + if (TARGET_VX_ABI + && TREE_CODE (type) == VECTOR_TYPE @@ -6761,8 +6761,8 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 in memory. */ if (AGGREGATE_TYPE_P (type) @@ -9384,6 +11227,12 @@ s390_function_and_libcall_value (enum ma - const_tree fntype_or_decl, - bool outgoing ATTRIBUTE_UNUSED) + const_tree fntype_or_decl, + bool outgoing ATTRIBUTE_UNUSED) { + /* For vector return types it is important to use the RET_TYPE + argument whenever available since the middle-end might have @@ -6774,9 +6774,9 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 promote_function_mode would do. */ if (ret_type) @@ -9393,10 +11242,14 @@ s390_function_and_libcall_value (enum ma - fntype_or_decl, 1); + fntype_or_decl, 1); } - + - gcc_assert (GET_MODE_CLASS (mode) == MODE_INT || SCALAR_FLOAT_MODE_P (mode)); - gcc_assert (GET_MODE_SIZE (mode) <= 8); - @@ -6791,11 +6791,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + else if (TARGET_HARD_FLOAT && SCALAR_FLOAT_MODE_P (mode)) return gen_rtx_REG (mode, 16); else if (GET_MODE_SIZE (mode) <= UNITS_PER_LONG - || UNITS_PER_LONG == UNITS_PER_WORD) + || UNITS_PER_LONG == UNITS_PER_WORD) @@ -9560,9 +11413,13 @@ s390_va_start (tree valist, rtx nextarg expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); } - + - /* Find the overflow area. */ + /* Find the overflow area. + FIXME: This currently is too pessimistic when the vector ABI is @@ -6807,7 +6807,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + || TARGET_VX_ABI) { t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx); - + @@ -9604,6 +11461,9 @@ s390_va_start (tree valist, rtx nextarg ret = args.reg_save_area[args.gpr+8] else @@ -6827,13 +6827,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + tree addr = create_tmp_var (ptr_type_node, "addr"); + bool left_align_p; /* How a value < UNITS_PER_LONG is aligned within + a stack slot. */ - + f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node)); f_fpr = DECL_CHAIN (f_gpr); @@ -9642,6 +11505,8 @@ s390_gimplify_va_arg (tree valist, tree - + size = int_size_in_bytes (type); - + + s390_check_type_for_vector_abi (type, true, false); + if (pass_by_reference (NULL, TYPE_MODE (type), type, false)) @@ -6872,14 +6872,14 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 else { @@ -9702,53 +11585,74 @@ s390_gimplify_va_arg (tree valist, tree - + sav_scale = UNITS_PER_LONG; max_reg = GP_ARG_NUM_REG - n_reg; + left_align_p = false; } - + /* Pull the value out of the saved registers ... */ - + - lab_false = create_artificial_label (UNKNOWN_LOCATION); - lab_over = create_artificial_label (UNKNOWN_LOCATION); - addr = create_tmp_var (ptr_type_node, "addr"); @@ -6899,7 +6899,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + /* + if (reg > ((typeof (reg))max_reg)) + goto lab_false; - + - gimplify_assign (addr, t, pre_p); + addr = sav + sav_ofs + reg * save_scale; + @@ -6907,18 +6907,18 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + + lab_false: + */ - + - gimple_seq_add_stmt (pre_p, gimple_build_goto (lab_over)); + lab_false = create_artificial_label (UNKNOWN_LOCATION); + lab_over = create_artificial_label (UNKNOWN_LOCATION); - + - gimple_seq_add_stmt (pre_p, gimple_build_label (lab_false)); + t = fold_convert (TREE_TYPE (reg), size_int (max_reg)); + t = build2 (GT_EXPR, boolean_type_node, reg, t); + u = build1 (GOTO_EXPR, void_type_node, lab_false); + t = build3 (COND_EXPR, void_type_node, t, u, NULL_TREE); + gimplify_and_add (t, pre_p); - + + t = fold_build_pointer_plus_hwi (sav, sav_ofs); + u = build2 (MULT_EXPR, TREE_TYPE (reg), reg, + fold_convert (TREE_TYPE (reg), size_int (sav_scale))); @@ -6930,18 +6930,18 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + + gimple_seq_add_stmt (pre_p, gimple_build_label (lab_false)); + } - + /* ... Otherwise out of the overflow area. */ - + t = ovf; - if (size < UNITS_PER_LONG) + if (size < UNITS_PER_LONG && !left_align_p) t = fold_build_pointer_plus_hwi (t, UNITS_PER_LONG - size); - + gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue); - + gimplify_assign (addr, t, pre_p); - + - t = fold_build_pointer_plus_hwi (t, size); + if (size < UNITS_PER_LONG && left_align_p) + t = fold_build_pointer_plus_hwi (t, UNITS_PER_LONG); @@ -6949,14 +6949,14 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + t = fold_build_pointer_plus_hwi (t, size); + gimplify_assign (ovf, t, pre_p); - + - gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over)); + if (reg != NULL_TREE) + gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over)); - - + + /* Increment register save count. */ - + - u = build2 (PREINCREMENT_EXPR, TREE_TYPE (reg), reg, - fold_convert (TREE_TYPE (reg), size_int (n_reg))); - gimplify_and_add (u, pre_p); @@ -6966,12 +6966,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + fold_convert (TREE_TYPE (reg), size_int (n_reg))); + gimplify_and_add (u, pre_p); + } - + if (indirect_p) { @@ -9793,7 +11697,14 @@ s390_expand_tbegin (rtx dest, rtx tdb, r } - + if (clobber_fprs_p) - emit_insn (gen_tbegin_1 (gen_rtx_CONST_INT (VOIDmode, TBEGIN_MASK), tdb)); + { @@ -6984,11 +6984,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + } else emit_insn (gen_tbegin_nofloat_1 (gen_rtx_CONST_INT (VOIDmode, TBEGIN_MASK), - tdb)); + tdb)); @@ -9831,210 +11742,6 @@ s390_expand_tbegin (rtx dest, rtx tdb, r } } - + -/* Builtins. */ - -enum s390_builtin @@ -7195,31 +7195,31 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - /* Output assembly code for the trampoline template to stdio stream FILE. - + @@ -10496,15 +12203,18 @@ s390_call_saved_register_used (tree call mode = TYPE_MODE (type); gcc_assert (mode); - + + /* We assume that in the target function all parameters are + named. This only has an impact on vector argument register + usage none of which is call-saved. */ if (pass_by_reference (&cum_v, mode, type, true)) - { - mode = Pmode; - type = build_pointer_type (type); - } - + { + mode = Pmode; + type = build_pointer_type (type); + } + - parm_rtx = s390_function_arg (cum, mode, type, 0); + parm_rtx = s390_function_arg (cum, mode, type, true); - + - s390_function_arg_advance (cum, mode, type, 0); + s390_function_arg_advance (cum, mode, type, true); - + if (!parm_rtx) - continue; + continue; @@ -10711,6 +12421,13 @@ s390_conditional_register_usage (void) for (i = 16; i < 32; i++) - call_used_regs[i] = fixed_regs[i] = 1; + call_used_regs[i] = fixed_regs[i] = 1; } + + /* Disable v16 - v31 for non-vector target. */ @@ -7229,7 +7229,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + fixed_regs[i] = call_used_regs[i] = call_really_used_regs[i] = 1; + } } - + /* Corresponding function to eh_return expander. */ @@ -11232,7 +12949,8 @@ s390_reorg (void) /* Walk over the insns and do some >=z10 specific changes. */ @@ -7242,14 +7242,14 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 rtx insn; bool insn_added_p = false; @@ -11392,27 +13110,66 @@ s390_z10_prevent_earlyload_conflicts (rt - + static int s390_sched_state; - + -#define S390_OOO_SCHED_STATE_NORMAL 3 -#define S390_OOO_SCHED_STATE_CRACKED 4 +#define S390_SCHED_STATE_NORMAL 3 +#define S390_SCHED_STATE_CRACKED 4 - + -#define S390_OOO_SCHED_ATTR_MASK_CRACKED 0x1 -#define S390_OOO_SCHED_ATTR_MASK_EXPANDED 0x2 -#define S390_OOO_SCHED_ATTR_MASK_ENDGROUP 0x4 @@ -7258,12 +7258,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 +#define S390_SCHED_ATTR_MASK_EXPANDED 0x2 +#define S390_SCHED_ATTR_MASK_ENDGROUP 0x4 +#define S390_SCHED_ATTR_MASK_GROUPALONE 0x8 - + static unsigned int s390_get_sched_attrmask (rtx insn) { unsigned int mask = 0; - + - if (get_attr_ooo_cracked (insn)) - mask |= S390_OOO_SCHED_ATTR_MASK_CRACKED; - if (get_attr_ooo_expanded (insn)) @@ -7321,47 +7321,47 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + } return mask; } - + @@ -11430,48 +13187,66 @@ s390_sched_score (rtx insn) case 0: /* Try to put insns into the first slot which would otherwise - break a group. */ + break a group. */ - if ((mask & S390_OOO_SCHED_ATTR_MASK_CRACKED) != 0 - || (mask & S390_OOO_SCHED_ATTR_MASK_EXPANDED) != 0) + if ((mask & S390_SCHED_ATTR_MASK_CRACKED) != 0 + || (mask & S390_SCHED_ATTR_MASK_EXPANDED) != 0) - score += 5; + score += 5; - if ((mask & S390_OOO_SCHED_ATTR_MASK_GROUPALONE) != 0) + if ((mask & S390_SCHED_ATTR_MASK_GROUPALONE) != 0) - score += 10; + score += 10; case 1: /* Prefer not cracked insns while trying to put together a - group. */ + group. */ - if ((mask & S390_OOO_SCHED_ATTR_MASK_CRACKED) == 0 - && (mask & S390_OOO_SCHED_ATTR_MASK_EXPANDED) == 0 - && (mask & S390_OOO_SCHED_ATTR_MASK_GROUPALONE) == 0) + if ((mask & S390_SCHED_ATTR_MASK_CRACKED) == 0 + && (mask & S390_SCHED_ATTR_MASK_EXPANDED) == 0 + && (mask & S390_SCHED_ATTR_MASK_GROUPALONE) == 0) - score += 10; + score += 10; - if ((mask & S390_OOO_SCHED_ATTR_MASK_ENDGROUP) == 0) + if ((mask & S390_SCHED_ATTR_MASK_ENDGROUP) == 0) - score += 5; + score += 5; break; case 2: /* Prefer not cracked insns while trying to put together a - group. */ + group. */ - if ((mask & S390_OOO_SCHED_ATTR_MASK_CRACKED) == 0 - && (mask & S390_OOO_SCHED_ATTR_MASK_EXPANDED) == 0 - && (mask & S390_OOO_SCHED_ATTR_MASK_GROUPALONE) == 0) + if ((mask & S390_SCHED_ATTR_MASK_CRACKED) == 0 + && (mask & S390_SCHED_ATTR_MASK_EXPANDED) == 0 + && (mask & S390_SCHED_ATTR_MASK_GROUPALONE) == 0) - score += 10; + score += 10; /* Prefer endgroup insns in the last slot. */ - if ((mask & S390_OOO_SCHED_ATTR_MASK_ENDGROUP) != 0) + if ((mask & S390_SCHED_ATTR_MASK_ENDGROUP) != 0) - score += 10; + score += 10; break; - case S390_OOO_SCHED_STATE_NORMAL: + case S390_SCHED_STATE_NORMAL: @@ -7370,20 +7370,20 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - && (mask & S390_OOO_SCHED_ATTR_MASK_EXPANDED) == 0) + if ((mask & S390_SCHED_ATTR_MASK_CRACKED) == 0 + && (mask & S390_SCHED_ATTR_MASK_EXPANDED) == 0) - score += 5; + score += 5; - if ((mask & S390_OOO_SCHED_ATTR_MASK_GROUPALONE) != 0) + if ((mask & S390_SCHED_ATTR_MASK_GROUPALONE) != 0) - score += 10; + score += 10; break; - case S390_OOO_SCHED_STATE_CRACKED: + case S390_SCHED_STATE_CRACKED: /* Try to keep cracked insns together to prevent them from - interrupting groups. */ + interrupting groups. */ - if ((mask & S390_OOO_SCHED_ATTR_MASK_CRACKED) != 0 - || (mask & S390_OOO_SCHED_ATTR_MASK_EXPANDED) != 0) + if ((mask & S390_SCHED_ATTR_MASK_CRACKED) != 0 + || (mask & S390_SCHED_ATTR_MASK_EXPANDED) != 0) - score += 5; + score += 5; break; } + @@ -7406,11 +7406,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + } return score; } - + @@ -11487,7 +13262,8 @@ s390_sched_reorder (FILE *file, int verb if (reload_completed && *nreadyp > 1) s390_z10_prevent_earlyload_conflicts (ready, nreadyp); - + - if (s390_tune == PROCESSOR_2827_ZEC12 + if ((s390_tune == PROCESSOR_2827_ZEC12 + || s390_tune == PROCESSOR_2964_Z13) @@ -7418,30 +7418,30 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 && *nreadyp > 1) { @@ -11526,12 +13302,12 @@ s390_sched_reorder (FILE *file, int verb - - if (verbose > 5) - fprintf (file, + + if (verbose > 5) + fprintf (file, - "move insn %d to the top of list\n", + ";;\t\tBACKEND: move insn %d to the top of list\n", - INSN_UID (ready[last_index])); - } - else if (verbose > 5) - fprintf (file, + INSN_UID (ready[last_index])); + } + else if (verbose > 5) + fprintf (file, - "best insn %d already on top\n", + ";;\t\tBACKEND: best insn %d already on top\n", - INSN_UID (ready[last_index])); - } - + INSN_UID (ready[last_index])); + } + @@ -11542,16 +13318,35 @@ s390_sched_reorder (FILE *file, int verb - - for (i = last_index; i >= 0; i--) - { + + for (i = last_index; i >= 0; i--) + { - if (recog_memoized (ready[i]) < 0) + unsigned int sched_mask; + rtx insn = ready[i]; + + if (recog_memoized (insn) < 0) - continue; + continue; - fprintf (file, "insn %d score: %d: ", INSN_UID (ready[i]), - s390_sched_score (ready[i])); -#define PRINT_OOO_ATTR(ATTR) fprintf (file, "%s ", get_attr_##ATTR (ready[i]) ? #ATTR : "!" #ATTR); @@ -7474,13 +7474,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + fprintf (file, " u%d", j); + fprintf (file, ")"); + } - fprintf (file, "\n"); - } - } + fprintf (file, "\n"); + } + } @@ -11570,18 +13365,19 @@ s390_sched_variable_issue (FILE *file, i { last_scheduled_insn = insn; - + - if (s390_tune == PROCESSOR_2827_ZEC12 + if ((s390_tune == PROCESSOR_2827_ZEC12 + || s390_tune == PROCESSOR_2964_Z13) @@ -7488,7 +7488,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 && recog_memoized (insn) >= 0) { unsigned int mask = s390_get_sched_attrmask (insn); - + - if ((mask & S390_OOO_SCHED_ATTR_MASK_CRACKED) != 0 - || (mask & S390_OOO_SCHED_ATTR_MASK_EXPANDED) != 0) - s390_sched_state = S390_OOO_SCHED_STATE_CRACKED; @@ -7502,28 +7502,28 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + || (mask & S390_SCHED_ATTR_MASK_GROUPALONE) != 0) + s390_sched_state = S390_SCHED_STATE_NORMAL; else - { - /* Only normal insns are left (mask == 0). */ + { + /* Only normal insns are left (mask == 0). */ @@ -11590,30 +13386,73 @@ s390_sched_variable_issue (FILE *file, i - case 0: - case 1: - case 2: + case 0: + case 1: + case 2: - case S390_OOO_SCHED_STATE_NORMAL: - if (s390_sched_state == S390_OOO_SCHED_STATE_NORMAL) + case S390_SCHED_STATE_NORMAL: + if (s390_sched_state == S390_SCHED_STATE_NORMAL) - s390_sched_state = 1; - else - s390_sched_state++; - - break; + s390_sched_state = 1; + else + s390_sched_state++; + + break; - case S390_OOO_SCHED_STATE_CRACKED: - s390_sched_state = S390_OOO_SCHED_STATE_NORMAL; + case S390_SCHED_STATE_CRACKED: + s390_sched_state = S390_SCHED_STATE_NORMAL; - break; - } - } + break; + } + } + + if (s390_tune == PROCESSOR_2964_Z13) + { @@ -7541,7 +7541,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + } + if (verbose > 5) - { + { - fprintf (file, "insn %d: ", INSN_UID (insn)); -#define PRINT_OOO_ATTR(ATTR) \ - fprintf (file, "%s ", get_attr_##ATTR (insn) ? #ATTR : ""); @@ -7589,31 +7589,31 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + fprintf (file, "%d:%d ", j, last_scheduled_unit_distance[j]); + fprintf (file, "\n"); + } - } + } } - + @@ -11630,6 +13469,7 @@ s390_sched_init (FILE *file ATTRIBUTE_UN - int max_ready ATTRIBUTE_UNUSED) + int max_ready ATTRIBUTE_UNUSED) { last_scheduled_insn = NULL_RTX; + memset (last_scheduled_unit_distance, 0, MAX_SCHED_UNITS * sizeof (int)); s390_sched_state = 0; } - + @@ -11663,7 +13503,8 @@ s390_loop_unroll_adjust (unsigned nunrol - + if (s390_tune != PROCESSOR_2097_Z10 && s390_tune != PROCESSOR_2817_Z196 - && s390_tune != PROCESSOR_2827_ZEC12) + && s390_tune != PROCESSOR_2827_ZEC12 + && s390_tune != PROCESSOR_2964_Z13) return nunroll; - + /* Count the number of memory references within the loop body. */ @@ -11691,6 +13532,84 @@ s390_loop_unroll_adjust (unsigned nunrol } } - + +/* Return the vector mode to be used for inner mode MODE when doing + vectorization. */ +static enum machine_mode @@ -7693,7 +7693,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 +} + /* Initialize GCC target structure. */ - + #undef TARGET_ASM_ALIGNED_HI_OP @@ -11797,6 +13716,8 @@ s390_loop_unroll_adjust (unsigned nunrol #define TARGET_FUNCTION_VALUE s390_function_value @@ -7701,13 +7701,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 #define TARGET_LIBCALL_VALUE s390_libcall_value +#undef TARGET_STRICT_ARGUMENT_NAMING +#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true - + #undef TARGET_FIXED_CONDITION_CODE_REGS #define TARGET_FIXED_CONDITION_CODE_REGS s390_fixed_condition_code_regs @@ -11812,6 +13733,9 @@ s390_loop_unroll_adjust (unsigned nunrol #define TARGET_ASM_OUTPUT_DWARF_DTPREL s390_output_dwarf_dtprel #endif - + +#undef TARGET_DWARF_FRAME_REG_MODE +#define TARGET_DWARF_FRAME_REG_MODE s390_dwarf_frame_reg_mode + @@ -7717,17 +7717,17 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -11820,6 +13744,9 @@ s390_loop_unroll_adjust (unsigned nunrol #undef TARGET_SCALAR_MODE_SUPPORTED_P #define TARGET_SCALAR_MODE_SUPPORTED_P s390_scalar_mode_supported_p - + +#undef TARGET_VECTOR_MODE_SUPPORTED_P +#define TARGET_VECTOR_MODE_SUPPORTED_P s390_vector_mode_supported_p + #undef TARGET_PREFERRED_RELOAD_CLASS #define TARGET_PREFERRED_RELOAD_CLASS s390_preferred_reload_class - + @@ -11864,6 +13791,21 @@ s390_loop_unroll_adjust (unsigned nunrol #undef TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P #define TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P hook_bool_const_tree_true - + +#undef TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN +#define TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN s390_invalid_arg_for_unprototyped_fn + @@ -7744,7 +7744,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 +#define TARGET_ASM_FILE_END s390_asm_file_end + struct gcc_target targetm = TARGET_INITIALIZER; - + #include "gt-s390.h" --- gcc/config/s390/s390-c.c 1970-01-01 01:00:00.000000000 +0100 +++ gcc/config/s390/s390-c.c 2016-05-11 19:20:42.792826040 +0200 @@ -8663,17 +8663,17 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + PF_Z13 = 512, + PF_VX = 1024 }; - + /* This is necessary to avoid a warning about comparing different enum @@ -64,6 +66,10 @@ enum processor_flags - (s390_arch_flags & PF_ZEC12) + (s390_arch_flags & PF_ZEC12) #define TARGET_CPU_HTM \ - (s390_arch_flags & PF_TX) + (s390_arch_flags & PF_TX) +#define TARGET_CPU_Z13 \ + (s390_arch_flags & PF_Z13) +#define TARGET_CPU_VX \ + (s390_arch_flags & PF_VX) - + /* These flags indicate that the generated code should run on a cpu providing the respective hardware facility when run in @@ -82,7 +88,15 @@ enum processor_flags @@ -8690,12 +8690,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + - pass vector arguments <= 16 bytes in VRs + - align *all* vector types to 8 bytes */ +#define TARGET_VX_ABI TARGET_VX - + #define TARGET_AVOID_CMP_AND_BRANCH (s390_tune == PROCESSOR_2817_Z196) - + @@ -97,25 +111,11 @@ enum processor_flags #define TARGET_TPF 0 - + /* Target CPU builtins. */ -#define TARGET_CPU_CPP_BUILTINS() \ - do \ @@ -8714,7 +8714,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - } \ - while (0) +#define TARGET_CPU_CPP_BUILTINS() s390_cpu_cpp_builtins (pfile) - + #ifdef DEFAULT_TARGET_64BIT -#define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_DFP | MASK_OPT_HTM) +#define TARGET_DEFAULT (MASK_64BIT | MASK_ZARCH | MASK_HARD_DFP \ @@ -8723,9 +8723,9 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 #define TARGET_DEFAULT 0 #endif @@ -184,6 +184,13 @@ enum processor_flags - + #define STACK_SIZE_MODE (Pmode) - + +/* Vector arguments are left-justified when placed on the stack during + parameter passing. */ +#define FUNCTION_ARG_PADDING(MODE, TYPE) \ @@ -8734,20 +8734,20 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + : DEFAULT_FUNCTION_ARG_PADDING ((MODE), (TYPE))) + #ifndef IN_LIBGCC2 - + /* Width of a word, in units (bytes). */ @@ -289,9 +296,11 @@ enum processor_flags Reg 35: Return address pointer - + Registers 36 and 37 are mapped to access registers - 0 and 1, used to implement thread-local storage. */ + 0 and 1, used to implement thread-local storage. + + Reg 38-53: Vector registers v16-v31 */ - + -#define FIRST_PSEUDO_REGISTER 38 +#define FIRST_PSEUDO_REGISTER 54 - + /* Standard register usage. */ #define GENERAL_REGNO_P(N) ((int)(N) >= 0 && (N) < 16) @@ -300,6 +309,8 @@ enum processor_flags @@ -8756,7 +8756,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 #define ACCESS_REGNO_P(N) ((N) == 36 || (N) == 37) +#define VECTOR_NOFP_REGNO_P(N) ((N) >= 38 && (N) <= 53) +#define VECTOR_REGNO_P(N) (FP_REGNO_P (N) || VECTOR_NOFP_REGNO_P (N)) - + #define GENERAL_REG_P(X) (REG_P (X) && GENERAL_REGNO_P (REGNO (X))) #define ADDR_REG_P(X) (REG_P (X) && ADDR_REGNO_P (REGNO (X))) @@ -307,6 +318,8 @@ enum processor_flags @@ -8765,18 +8765,18 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 #define ACCESS_REG_P(X) (REG_P (X) && ACCESS_REGNO_P (REGNO (X))) +#define VECTOR_NOFP_REG_P(X) (REG_P (X) && VECTOR_NOFP_REGNO_P (REGNO (X))) +#define VECTOR_REG_P(X) (REG_P (X) && VECTOR_REGNO_P (REGNO (X))) - + /* Set up fixed registers and calling convention: - + @@ -321,7 +334,9 @@ enum processor_flags - + On 31-bit, FPRs 18-19 are call-clobbered; on 64-bit, FPRs 24-31 are call-clobbered. - The remaining FPRs are call-saved. */ + The remaining FPRs are call-saved. + + All non-FP vector registers are call-clobbered v16-v31. */ - + #define FIXED_REGISTERS \ { 0, 0, 0, 0, \ @@ -333,7 +348,11 @@ enum processor_flags @@ -8789,7 +8789,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + 0, 0, 0, 0, \ + 0, 0, 0, 0, \ + 0, 0, 0, 0 } - + #define CALL_USED_REGISTERS \ { 1, 1, 1, 1, \ @@ -345,26 +364,35 @@ enum processor_flags @@ -8802,7 +8802,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + 1, 1, 1, 1, \ + 1, 1, 1, 1, \ + 1, 1, 1, 1 } - + #define CALL_REALLY_USED_REGISTERS \ -{ 1, 1, 1, 1, \ +{ 1, 1, 1, 1, /* r0 - r15 */ \ @@ -8821,7 +8821,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - 0, 0 } + 1, 1, 1, 1, /* v24 (46) - v31 (53) */ \ + 1, 1, 1, 1 } - + /* Preferred register allocation order. */ -#define REG_ALLOC_ORDER \ -{ 1, 2, 3, 4, 5, 0, 12, 11, 10, 9, 8, 7, 6, 14, 13, \ @@ -8834,8 +8834,8 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + 24, 25, 26, 27, 28, 29, 30, 31, \ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, \ + 15, 32, 33, 34, 35, 36, 37 } - - + + /* Fitting values into registers. */ @@ -404,26 +432,22 @@ enum processor_flags but conforms to the 31-bit ABI, GPRs can hold 8 bytes; @@ -8853,12 +8853,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + && GET_MODE_SIZE (MODE) > 8 \ + && (((TARGET_64BIT && (REGNO) >= 24 && (REGNO) <= 31)) \ + || (!TARGET_64BIT && ((REGNO) == 18 || (REGNO) == 19))))) - + /* Maximum number of registers to represent a value of mode MODE in a register of class CLASS. */ #define CLASS_MAX_NREGS(CLASS, MODE) \ s390_class_max_nregs ((CLASS), (MODE)) - + -/* If a 4-byte value is loaded into a FPR, it is placed into the - *upper* half of the register, not the lower. Therefore, we - cannot use SUBREGs to switch between modes in FP registers. @@ -8870,9 +8870,9 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - && (GET_MODE_SIZE (FROM) < 8 || GET_MODE_SIZE (TO) < 8)) \ - || reg_classes_intersect_p (ACCESS_REGS, CLASS)) : 0) + s390_cannot_change_mode_class ((FROM), (TO), (CLASS)) - + /* Register classes. */ - + @@ -451,6 +475,7 @@ enum reg_class NO_REGS, CC_REGS, ADDR_REGS, GENERAL_REGS, ACCESS_REGS, ADDR_CC_REGS, GENERAL_CC_REGS, @@ -8889,7 +8889,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + "FP_REGS", "ADDR_FP_REGS", "GENERAL_FP_REGS", \ + "VEC_REGS", "ADDR_VEC_REGS", "GENERAL_VEC_REGS", \ + "ALL_REGS" } - + /* Class -> register mapping. */ -#define REG_CLASS_CONTENTS \ -{ \ @@ -8908,12 +8908,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + { 0xffffffff, 0x003fffcd }, /* GENERAL_VEC_REGS */ \ + { 0xffffffff, 0x003fffff }, /* ALL_REGS */ \ } - + /* In some case register allocation order is not enough for IRA to @@ -504,14 +534,27 @@ extern const enum reg_class regclass_map #define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P (REGNO) - - + + -/* We need secondary memory to move data between GPRs and FPRs. With - DFP the ldgr lgdr instructions are available. But these - instructions do not handle GPR pairs so it is not possible for 31 @@ -8943,21 +8943,21 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + && (!TARGET_DFP || !TARGET_64BIT || GET_MODE_SIZE (MODE) != 8) \ + && (!TARGET_VX || (SCALAR_FLOAT_MODE_P (MODE) \ + && GET_MODE_SIZE (MODE) > 8))) - + /* Get_secondary_mem widens its argument to BITS_PER_WORD which loses on 64bit because the movsi and movsf patterns don't handle r/f moves. */ @@ -605,6 +648,11 @@ extern const enum reg_class regclass_map /* Let the assembler generate debug line info. */ #define DWARF2_ASM_LINE_DEBUG_INFO 1 - + +/* Define the dwarf register mapping. + v16-v31 -> 68-83 + rX -> X otherwise */ +#define DBX_REGISTER_NUMBER(regno) \ + ((regno >= 38 && regno <= 53) ? regno + 30 : regno) - + /* Frame registers. */ - + @@ -652,21 +700,29 @@ typedef struct s390_arg_structure { int gprs; /* gpr so far */ @@ -8965,14 +8965,14 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + int vrs; /* vr so far */ } CUMULATIVE_ARGS; - + #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, NN, N_NAMED_ARGS) \ - ((CUM).gprs=0, (CUM).fprs=0) + ((CUM).gprs=0, (CUM).fprs=0, (CUM).vrs=0) + +#define FIRST_VEC_ARG_REGNO 46 +#define LAST_VEC_ARG_REGNO 53 - + /* Arguments can be placed in general registers 2 to 6, or in floating point registers 0 and 2 for 31 bit and fprs 0, 2, 4 and 6 for 64 bit. */ @@ -8982,16 +8982,16 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + (((N) >=2 && (N) < 7) || (N) == 16 || (N) == 17 \ + || (TARGET_64BIT && ((N) == 18 || (N) == 19)) \ + || (TARGET_VX && ((N) >= FIRST_VEC_ARG_REGNO && (N) <= LAST_VEC_ARG_REGNO))) - - + + -/* Only gpr 2 and fpr 0 are ever used as return registers. */ -#define FUNCTION_VALUE_REGNO_P(N) ((N) == 2 || (N) == 16) +/* Only gpr 2, fpr 0, and v24 are ever used as return registers. */ +#define FUNCTION_VALUE_REGNO_P(N) \ + ((N) == 2 || (N) == 16 \ + || (TARGET_VX && (N) == FIRST_VEC_ARG_REGNO)) - - + + /* Function entry and exit. */ @@ -844,12 +900,20 @@ do { \ /* How to refer to registers in assembler output. This sequence is @@ -9017,13 +9017,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + { "v1", 20 }, { "v3", 21 }, { "v5", 22 }, { "v7", 23 }, \ + { "v8", 24 }, { "v10", 25 }, { "v12", 26 }, { "v14", 27 }, \ + { "v9", 28 }, { "v11", 29 }, { "v13", 30 }, { "v15", 31 } }; - + /* Print operand X (an rtx) in assembler syntax to file FILE. */ #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE) @@ -915,13 +979,31 @@ do { \ #define SYMBOL_REF_NOT_NATURALLY_ALIGNED_P(X) \ ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_NOT_NATURALLY_ALIGNED)) - + +/* Check whether integer displacement is in range for a short displacement. */ +#define SHORT_DISP_IN_RANGE(d) ((d) >= 0 && (d) <= 4095) + @@ -9032,10 +9032,10 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 (TARGET_LONG_DISPLACEMENT? ((d) >= -524288 && (d) <= 524287) \ - : ((d) >= 0 && (d) <= 4095)) + : SHORT_DISP_IN_RANGE(d)) - + /* Reads can reuse write prefetches, used by tree-ssa-prefetch-loops.c. */ #define READ_CAN_USE_WRITE_PREFETCH 1 - + extern const int processor_flags_table[]; -#endif + @@ -9059,11 +9059,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -29,5 +29,8 @@ along with GCC; see the file COPYING3. #include #endif - + +#ifdef __VEC__ +#include +#endif - + #endif /* _S390INTRIN_H*/ --- gcc/config/s390/s390.md 2015-06-18 16:33:04.000000000 +0200 +++ gcc/config/s390/s390.md 2016-05-11 19:22:59.245881189 +0200 @@ -9175,7 +9175,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + UNSPEC_VEC_VFTCIDB + UNSPEC_VEC_VFTCIDBCC +]) - + ;; ;; UNSPEC_VOLATILE usage @@ -167,6 +269,10 @@ @@ -9187,7 +9187,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + UNSPECV_SFPC + UNSPECV_EFPC ]) - + ;; @@ -198,6 +304,11 @@ ; Floating point registers. @@ -9199,56 +9199,56 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + (VR24_REGNUM 46) + (VR31_REGNUM 53) ]) - + ;; @@ -228,7 +339,7 @@ ;; Used to determine defaults for length and other attribute values. - + (define_attr "op_type" - "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY,RRF,RRR,SIL,RRS,RIS" + "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY,RRF,RRR,SIL,RRS,RIS,VRI,VRR,VRS,VRV,VRX" (const_string "NN")) - + ;; Instruction type attribute used for scheduling. @@ -306,10 +417,11 @@ ;; distinguish between g5 and g6, but there are differences between the two ;; CPUs could in theory be modeled. - + -(define_attr "cpu" "g5,g6,z900,z990,z9_109,z9_ec,z10,z196,zEC12" +(define_attr "cpu" "g5,g6,z900,z990,z9_109,z9_ec,z10,z196,zEC12,z13" (const (symbol_ref "s390_tune_attr"))) - + -(define_attr "cpu_facility" "standard,ieee,zarch,longdisp,extimm,dfp,z10,z196,zEC12" +(define_attr "cpu_facility" + "standard,ieee,zarch,longdisp,extimm,dfp,z10,z196,zEC12,vec" (const_string "standard")) - + (define_attr "enabled" "" @@ -346,6 +458,10 @@ - + (and (eq_attr "cpu_facility" "zEC12") (match_test "TARGET_ZEC12")) + (const_int 1) + + (and (eq_attr "cpu_facility" "vec") + (match_test "TARGET_VX")) - (const_int 1)] - (const_int 0))) - + (const_int 1)] + (const_int 0))) + @@ -365,6 +481,9 @@ ;; Pipeline description for zEC12 (include "2827.md") - + +;; Pipeline description for z13 +(include "2964.md") + ;; Predicates (include "predicates.md") - + @@ -376,12 +495,13 @@ - + ;; Iterators - + +(define_mode_iterator ALL [TI DI SI HI QI TF DF SF TD DD SD V1QI V2QI V4QI V8QI V16QI V1HI V2HI V4HI V8HI V1SI V2SI V4SI V1DI V2DI V1SF V2SF V4SF V1TI V1DF V2DF V1TF]) + ;; These mode iterators allow floating point patterns to be generated from the @@ -9266,12 +9266,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 (define_mode_iterator INT [(DI "TARGET_ZARCH") SI HI QI]) -(define_mode_iterator INTALL [TI DI SI HI QI]) (define_mode_iterator DINT [(TI "TARGET_ZARCH") DI SI HI QI]) - + ;; This iterator allows some 'ashift' and 'lshiftrt' pattern to be defined from @@ -476,6 +595,14 @@ ;; first and the second operand match for bfp modes. (define_mode_attr f0 [(TF "0") (DF "0") (SF "0") (TD "f") (DD "f") (DD "f")]) - + +;; This attribute is used to merge the scalar vector instructions into +;; the FP patterns. For non-supported modes (all but DF) it expands +;; to constraints which are supposed to be matched by an earlier @@ -9286,7 +9286,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -584,6 +711,19 @@ ;; In place of GET_MODE_BITSIZE (mode) (define_mode_attr bitsize [(DI "64") (SI "32") (HI "16") (QI "8")]) - + + + +; Condition code modes generated by vector fp comparisons. These will @@ -9306,7 +9306,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -1091,6 +1231,15 @@ [(set_attr "op_type" "RRE,RXE") (set_attr "type" "fsimp")]) - + +; wfcedbs, wfchdbs, wfchedbs +(define_insn "*vec_cmpdf_cconly" + [(set (reg:VFCMP CC_REGNUM) @@ -9316,13 +9316,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + "TARGET_VX && TARGET_HARD_FLOAT" + "wfcdbs\t%v2,%v0,%v1" + [(set_attr "op_type" "VRR")]) - + ; Compare and Branch instructions - + @@ -1216,17 +1365,27 @@ ; movti instruction pattern(s). ; - + +; FIXME: More constants are possible by enabling jxx, jyy constraints +; for TImode (use double-int for the calculations) (define_insn "movti" @@ -9348,13 +9348,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" "RSY,RSY,VRR,VRI,VRI,VRR,*,VRX,VRX,*,*") + (set_attr "type" "lm,stm,*,*,*,*,*,*,*,*,*") + (set_attr "cpu_facility" "*,*,vec,vec,vec,vec,vec,vec,vec,*,*")]) - + (define_split [(set (match_operand:TI 0 "nonimmediate_operand" "") @@ -1256,10 +1415,14 @@ operands[5] = operand_subword (operands[1], 0, 0, TImode); }) - + +; Use part of the TImode target reg to perform the address +; calculation. If the TImode value is supposed to be copied into a VR +; this splitter is not necessary. @@ -9368,8 +9368,8 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 { @@ -1270,6 +1433,25 @@ }) - - + + +; Split a VR -> GPR TImode move into 2 vector load GR from VR element. +; For the higher order bits we do simply a DImode move while the +; second part is done via vec extract. Both will end up as vlgvg. @@ -9395,7 +9395,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -1278,40 +1460,20 @@ ; Unfortunately there is no such variant for QI, TI and FP mode moves. ; These patterns are also used for unaligned SI and DI accesses. - + -(define_expand "reload_tomem_z10" - [(parallel [(match_operand:INTALL 0 "memory_operand" "") - (match_operand:INTALL 1 "register_operand" "=d") @@ -9429,7 +9429,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 s390_reload_symref_address (operands[1], operands[0], operands[2], 1); DONE; }) - + -(define_expand "reload_toreg_z10" - [(parallel [(match_operand:FPALL 0 "register_operand" "=d") - (match_operand:FPALL 1 "memory_operand" "") @@ -9444,7 +9444,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -1340,9 +1502,16 @@ DONE; }) - + -; Handles assessing a non-offsetable memory address +; Not all the indirect memory access instructions support the full +; format (long disp + index + base). So whenever a move from/to such @@ -9454,7 +9454,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 +; This in particular is used for: +; - non-offsetable memory accesses for multiword moves +; - full vector reg moves with long displacements - + -(define_expand "reload_nonoffmem_in" +(define_expand "reload_la_in" [(parallel [(match_operand 0 "register_operand" "") @@ -9463,14 +9463,14 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -1355,7 +1524,7 @@ DONE; }) - + -(define_expand "reload_nonoffmem_out" +(define_expand "reload_la_out" [(parallel [(match_operand 0 "" "") (match_operand 1 "register_operand" "") (match_operand:P 2 "register_operand" "=&a")])] @@ -1408,11 +1577,9 @@ - + (define_insn "*movdi_64" [(set (match_operand:DI 0 "nonimmediate_operand" - "=d,d,d,d,d,d,d,d,f,d,d,d,d,d, @@ -9517,10 +9517,10 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - *") + *,*,*,*,*,*,*") ]) - + (define_split @@ -1666,9 +1839,9 @@ - + (define_insn "*movsi_zarch" [(set (match_operand:SI 0 "nonimmediate_operand" - "=d,d,d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,d,t,Q,b,Q,t") @@ -9593,7 +9593,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 z10_super, - *")]) + *,*,*,*,*,*,*")]) - + (define_insn "*movsi_esa" - [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,d,t,Q,t") - (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,t,d,t,Q"))] @@ -9633,11 +9633,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + z10_super,*,*") + (set_attr "cpu_facility" "*,*,*,*,vec,*,vec,*,*,*,*,*,*") ]) - + (define_peephole2 @@ -1880,8 +2059,8 @@ }) - + (define_insn "*movhi" - [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,d,R,T,b,Q") - (match_operand:HI 1 "general_operand" " d,n,R,T,b,d,d,d,K"))] @@ -9673,12 +9673,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 z10_rec, - z10_super")]) + z10_super,*,*,*,*,*,*")]) - + (define_peephole2 [(set (match_operand:HI 0 "register_operand" "") @@ -1939,8 +2124,8 @@ }) - + (define_insn "*movqi" - [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S,?Q") - (match_operand:QI 1 "general_operand" " d,n,R,T,d,d,n,n,?Q"))] @@ -9713,7 +9713,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 z10_super, - *")]) + *,*,*,*,*,*,*")]) - + (define_peephole2 [(set (match_operand:QI 0 "nonimmediate_operand" "") @@ -2094,7 +2286,7 @@ @@ -9726,7 +9726,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 [(set (match_dup 0) (match_dup 1))] { @@ -2150,9 +2342,9 @@ - + (define_insn "*mov_64dfp" [(set (match_operand:DD_DF 0 "nonimmediate_operand" - "=f,f,f,d,f,f,R,T,d,d, d,RT") @@ -9760,7 +9760,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + fstoredf,fstoredf,*,lr,load,load,store,store,*,*,*,load,store") + (set_attr "z10prop" "*,*,*,*,*,*,*,*,z10_fwd_A1,z10_fr_E1,z10_fwd_A3,z10_fwd_A3,z10_rec,z10_rec,*,*,*,*,*") + (set_attr "cpu_facility" "z196,*,*,*,*,*,*,*,*,*,z10,*,z10,*,vec,vec,vec,vec,vec")]) - + (define_insn "*mov_64" - [(set (match_operand:DD_DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d,d, d,RT") - (match_operand:DD_DF 1 "general_operand" " G,f,R,T,f,f,G,d,RT, d"))] @@ -9790,11 +9790,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + fstore,fstore,*,lr,load,load,store,store,*,load,store") + (set_attr "z10prop" "*,*,*,*,*,*,z10_fwd_A1,z10_fr_E1,z10_fwd_A3,z10_fwd_A3,z10_rec,z10_rec,*,*,*") + (set_attr "cpu_facility" "z196,*,*,*,*,*,*,*,z10,*,z10,*,vec,vec,vec")]) - + (define_insn "*mov_31" [(set (match_operand:DD_DF 0 "nonimmediate_operand" @@ -2265,28 +2469,38 @@ - + (define_insn "mov" [(set (match_operand:SD_SF 0 "nonimmediate_operand" - "=f,f,f,f,R,T,d,d,d,d,R,T") @@ -9837,12 +9837,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + fstore,fstore,*,lr,load,load,load,store,store,store,*,*,*,*,load,store") + (set_attr "z10prop" "*,*,*,*,*,*,*,*,z10_fwd_A1,z10_fr_E1,z10_fr_E1,z10_fwd_A3,z10_fwd_A3,z10_rec,z10_rec,z10_rec,*,*,*,*,*,*") + (set_attr "cpu_facility" "z196,vec,*,vec,*,*,*,*,*,*,z10,*,*,z10,*,*,vec,vec,vec,vec,vec,vec")]) - + ; ; movcc instruction pattern @@ -2577,6 +2791,22 @@ ; - + (define_expand "strlen" + [(match_operand:P 0 "register_operand" "") ; result + (match_operand:BLK 1 "memory_operand" "") ; input string @@ -9879,13 +9879,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + + addr1 = gen_reg_rtx (Pmode); + addr2 = gen_reg_rtx (Pmode); - + emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX)); emit_move_insn (addr2, force_operand (XEXP (operands[2], 0), NULL_RTX)); @@ -2886,8 +3124,12 @@ operands[2] = GEN_INT (S390_TDC_INFINITY); }) - + +; This extracts CC into a GPR properly shifted. The actual IPM +; instruction will be issued by reload. The constraint of operand 1 +; forces reload to use a GPR. So reload will issue a movcc insn for @@ -9897,9 +9897,9 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 UNSPEC_CC_TO_INT))] "operands != NULL" @@ -4223,14 +4465,27 @@ - + ; fixuns_trunc(tf|df|sf|td|dd)(di|si)2 instruction patterns. - + +(define_insn "*fixuns_truncdfdi2_z13" + [(set (match_operand:DI 0 "register_operand" "=d,v") + (unsigned_fix:DI (match_operand:DF 1 "register_operand" "f,v"))) @@ -9931,7 +9931,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -4245,18 +4500,37 @@ DONE; }) - + +(define_insn "*fix_truncdfdi2_bfp_z13" + [(set (match_operand:DI 0 "register_operand" "=d,v") + (fix:DI (match_operand:DF 1 "register_operand" "f,v"))) @@ -9960,7 +9960,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 "cbr\t%0,%h2,%1" [(set_attr "op_type" "RRE") (set_attr "type" "ftoi")]) - + - +(define_expand "fix_trunc2_bfp" + [(parallel @@ -9973,7 +9973,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 ; fix_trunc(td|dd)di2 instruction pattern(s). ; @@ -4303,12 +4577,15 @@ - + ; cxgbr, cdgbr, cegbr, cxgtr, cdgtr (define_insn "floatdi2" - [(set (match_operand:FP 0 "register_operand" "=f") @@ -9990,13 +9990,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" "RRE,VRR") + (set_attr "type" "itof" ) + (set_attr "cpu_facility" "*,vec")]) - + ; cxfbr, cdfbr, cefbr (define_insn "floatsi2" @@ -4332,27 +4609,47 @@ ; floatuns(si|di)(tf|df|sf|td|dd)2 instruction pattern(s). ; - + +(define_insn "*floatunsdidf2_z13" + [(set (match_operand:DF 0 "register_operand" "=f,v") + (unsigned_float:DF (match_operand:DI 1 "register_operand" "d,v")))] @@ -10027,11 +10027,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set (match_operand:FP 0 "register_operand" "") + (unsigned_float:FP (match_operand:GPR 1 "register_operand" "")))] + "TARGET_Z196 && TARGET_HARD_FLOAT") - + ; ; truncdfsf2 instruction pattern(s). ; - + (define_insn "truncdfsf2" - [(set (match_operand:SF 0 "register_operand" "=f") - (float_truncate:SF (match_operand:DF 1 "register_operand" "f")))] @@ -10048,13 +10048,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" "RRE,VRR") + (set_attr "type" "ftruncdf") + (set_attr "cpu_facility" "*,vec")]) - + ; ; trunctf(df|sf)2 instruction pattern(s). @@ -4393,17 +4690,35 @@ ; extend(sf|df)(df|tf)2 instruction pattern(s). ; - + +(define_insn "*extendsfdf2_z13" + [(set (match_operand:DF 0 "register_operand" "=f,f,v") + (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R,v")))] @@ -10089,13 +10089,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + (float_extend:BFP (match_operand:DSF 1 "nonimmediate_operand" "")))] + "TARGET_HARD_FLOAT + && GET_MODE_SIZE (mode) > GET_MODE_SIZE (mode)") - + ; ; extendddtd2 and extendsddd2 instruction pattern(s). @@ -4616,10 +4931,29 @@ ; addti3 instruction pattern(s). ; - + -(define_insn_and_split "addti3" - [(set (match_operand:TI 0 "register_operand" "=&d") +(define_expand "addti3" @@ -10133,12 +10133,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + operands[8] = operand_subword (operands[2], 1, 0, TImode);" + [(set_attr "op_type" "*") + (set_attr "cpu_facility" "*")]) - + ; ; adddi3 instruction pattern(s). @@ -4976,17 +5312,20 @@ ; - + ; axbr, adbr, aebr, axb, adb, aeb, adtr, axtr +; FIXME: wfadb does not clobber cc (define_insn "add3" @@ -10160,13 +10160,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" ",RXE,VRR") + (set_attr "type" "fsimp") + (set_attr "cpu_facility" "*,*,vec")]) - + ; axbr, adbr, aebr, axb, adb, aeb, adtr, axtr (define_insn "*add3_cc" @@ -5026,10 +5365,29 @@ ; subti3 instruction pattern(s). ; - + -(define_insn_and_split "subti3" - [(set (match_operand:TI 0 "register_operand" "=&d") - (minus:TI (match_operand:TI 1 "register_operand" "0") @@ -10205,11 +10205,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + operands[8] = operand_subword (operands[2], 1, 0, TImode);" + [(set_attr "op_type" "*") + (set_attr "cpu_facility" "*")]) - + ; ; subdi3 instruction pattern(s). @@ -5327,16 +5687,18 @@ - + ; sxbr, sdbr, sebr, sdb, seb, sxtr, sdtr (define_insn "sub3" - [(set (match_operand:FP 0 "register_operand" "=f, f") @@ -10230,11 +10230,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" ",RXE,VRR") + (set_attr "type" "fsimp") + (set_attr "cpu_facility" "*,*,vec")]) - + ; sxbr, sdbr, sebr, sdb, seb, sxtr, sdtr (define_insn "*sub3_cc" @@ -5742,41 +6104,47 @@ - + ; mxbr, mdbr, meebr, mxb, mxb, meeb, mdtr, mxtr (define_insn "mul3" - [(set (match_operand:FP 0 "register_operand" "=f,f") @@ -10254,7 +10254,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" ",RXE,VRR") + (set_attr "type" "fmul") + (set_attr "cpu_facility" "*,*,vec")]) - + ; madbr, maebr, maxb, madb, maeb (define_insn "fma4" - [(set (match_operand:DSF 0 "register_operand" "=f,f") @@ -10276,7 +10276,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" "RRE,RXE,VRR") + (set_attr "type" "fmadd") + (set_attr "cpu_facility" "*,*,vec")]) - + ; msxbr, msdbr, msebr, msxb, msdb, mseb (define_insn "fms4" - [(set (match_operand:DSF 0 "register_operand" "=f,f") @@ -10298,11 +10298,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" "RRE,RXE,VRR") + (set_attr "type" "fmadd") + (set_attr "cpu_facility" "*,*,vec")]) - + ;; ;;- Divide and modulo instructions. @@ -6202,15 +6570,17 @@ - + ; dxbr, ddbr, debr, dxb, ddb, deb, ddtr, dxtr (define_insn "div3" - [(set (match_operand:FP 0 "register_operand" "=f,f") @@ -10322,12 +10322,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" ",RXE,VRR") + (set_attr "type" "fdiv") + (set_attr "cpu_facility" "*,*,vec")]) - - + + ;; @@ -7356,14 +7726,18 @@ (set_attr "type" "fsimp")]) - + ; lcxbr, lcdbr, lcebr +; FIXME: wflcdb does not clobber cc (define_insn "*neg2" @@ -10346,12 +10346,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" "RRE,VRR") + (set_attr "cpu_facility" "*,vec") + (set_attr "type" "fsimp,*")]) - - + + ;; @@ -7474,14 +7848,18 @@ (set_attr "type" "fsimp")]) - + ; lpxbr, lpdbr, lpebr +; FIXME: wflpdb does not clobber cc (define_insn "*abs2" @@ -10370,12 +10370,12 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" "RRE,VRR") + (set_attr "cpu_facility" "*,vec") + (set_attr "type" "fsimp,*")]) - - + + ;; @@ -7585,14 +7963,18 @@ (set_attr "type" "fsimp")]) - + ; lnxbr, lndbr, lnebr +; FIXME: wflndb does not clobber cc (define_insn "*negabs2" @@ -10394,11 +10394,11 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" "RRE,VRR") + (set_attr "cpu_facility" "*,vec") + (set_attr "type" "fsimp,*")]) - + ;; ;;- Square root instructions. @@ -7604,14 +7986,16 @@ - + ; sqxbr, sqdbr, sqebr, sqdb, sqeb (define_insn "sqrt2" - [(set (match_operand:BFP 0 "register_operand" "=f,f") @@ -10416,13 +10416,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [(set_attr "op_type" "RRE,RXE,VRR") + (set_attr "type" "fsqrt") + (set_attr "cpu_facility" "*,*,vec")]) - - + + ;; @@ -10006,6 +10390,35 @@ DONE; }) - + +; Clobber VRs since they don't get restored +(define_insn "tbegin_1_z13" + [(set (reg:CCRAW CC_REGNUM) @@ -10454,7 +10454,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + (define_insn "tbegin_1" [(set (reg:CCRAW CC_REGNUM) - (unspec_volatile:CCRAW [(match_operand 0 "const_int_operand" "D")] + (unspec_volatile:CCRAW [(match_operand 0 "const_int_operand" "D")] @@ -10141,3 +10554,30 @@ "TARGET_HTM && INTVAL (operands[2]) < 16" "ppa\t%0,%1,%2" @@ -10491,7 +10491,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -84,6 +84,23 @@ Requested mode -> Destination CCS, CCU, CCT, CCSR, CCUR -> CCZ CCA -> CCAP, CCAN - + +Vector comparison modes + +CCVEQ EQ - - NE (VCEQ) @@ -10509,13 +10509,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + + + - + *** Comments *** - + @@ -152,6 +169,15 @@ The compare and swap instructions sets t operands were equal/unequal. The CCZ1 mode ensures the result can be effectively placed into a register. - + + +CCV* + @@ -10526,7 +10526,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 +results for *all* elements. + CCRAW - + The cc mode generated by a non-compare instruction. The condition @@ -181,3 +207,38 @@ CC_MODE (CCT1); CC_MODE (CCT2); @@ -10572,7 +10572,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -76,6 +76,9 @@ Enum(processor_type) String(z196) Value( EnumValue Enum(processor_type) String(zEC12) Value(PROCESSOR_2827_ZEC12) - + +EnumValue +Enum(processor_type) String(z13) Value(PROCESSOR_2964_Z13) + @@ -10582,7 +10582,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -118,6 +121,10 @@ mhtm Target Report Mask(OPT_HTM) Use hardware transactional execution instructions - + +mvx +Target Report Mask(OPT_VX) +Use hardware vector facility instructions and enable the vector ABI @@ -10593,7 +10593,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -146,6 +153,11 @@ mmvcle Target Report Mask(MVCLE) mvcle use - + +mzvector +Target Report Mask(ZVECTOR) +Enable the z vector language extension providing the context-sensitive @@ -10611,7 +10611,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + PROCESSOR_2964_Z13, PROCESSOR_max }; - + --- gcc/config/s390/s390-protos.h 2014-01-14 16:37:04.000000000 +0100 +++ gcc/config/s390/s390-protos.h 2016-05-11 19:28:17.220349132 +0200 @@ -41,6 +41,9 @@ extern void s390_set_has_landing_pad_p ( @@ -10621,7 +10621,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 +extern int s390_cannot_change_mode_class (enum machine_mode, enum machine_mode, + enum reg_class); +extern bool s390_function_arg_vector (enum machine_mode, const_tree); - + #ifdef RTX_CODE extern int s390_extra_constraint_str (rtx, int, const char *); @@ -49,6 +52,9 @@ extern int s390_const_double_ok_for_cons @@ -10645,7 +10645,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 extern void s390_expand_cs_hqi (enum machine_mode, rtx, rtx, rtx, @@ -88,6 +96,10 @@ extern void s390_expand_cs_hqi (enum mac extern void s390_expand_atomic (enum machine_mode, enum rtx_code, - rtx, rtx, rtx, bool); + rtx, rtx, rtx, bool); extern void s390_expand_tbegin (rtx, rtx, rtx, bool); +extern void s390_expand_vec_compare (rtx, enum rtx_code, rtx, rtx); +extern void s390_expand_vec_compare_cc (rtx, enum rtx_code, rtx, rtx, bool); @@ -10656,7 +10656,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 extern rtx s390_emit_call (rtx, rtx, rtx, rtx); @@ -113,3 +125,10 @@ extern bool s390_extzv_shift_ok (int, in extern void s390_asm_output_function_label (FILE *, const char *, tree); - + #endif /* RTX_CODE */ + +/* s390-c.c routines */ @@ -14294,37 +14294,37 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 --- gcc/config.gcc 2016-05-11 14:46:08.298981685 +0200 +++ gcc/config.gcc 2016-05-11 17:17:32.000000000 +0200 @@ -452,7 +452,7 @@ s390*-*-*) - cpu_type=s390 - need_64bit_hwint=yes - extra_options="${extra_options} fused-madd.opt" + cpu_type=s390 + need_64bit_hwint=yes + extra_options="${extra_options} fused-madd.opt" - extra_headers="s390intrin.h htmintrin.h htmxlintrin.h" + extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h" - ;; + ;; # Note the 'l'; we need to be able to match e.g. "shle" or "shl". sh[123456789lbe]*-*-* | sh-*-*) @@ -2249,27 +2249,35 @@ rx-*-elf*) s390-*-linux*) - default_gnu_indirect_function=yes - tm_file="s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h" + default_gnu_indirect_function=yes + tm_file="s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h" + c_target_objs="${c_target_objs} s390-c.o" + cxx_target_objs="${cxx_target_objs} s390-c.o" - if test x$enable_targets = xall; then - tmake_file="${tmake_file} s390/t-linux64" - fi + if test x$enable_targets = xall; then + tmake_file="${tmake_file} s390/t-linux64" + fi + tmake_file="${tmake_file} s390/t-s390" - ;; + ;; s390x-*-linux*) - default_gnu_indirect_function=yes - tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h" - tm_p_file=s390/s390-protos.h + default_gnu_indirect_function=yes + tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h" + tm_p_file=s390/s390-protos.h + c_target_objs="${c_target_objs} s390-c.o" + cxx_target_objs="${cxx_target_objs} s390-c.o" - md_file=s390/s390.md - extra_modes=s390/s390-modes.def - out_file=s390/s390.c + md_file=s390/s390.md + extra_modes=s390/s390-modes.def + out_file=s390/s390.c - tmake_file="${tmake_file} s390/t-linux64" + tmake_file="${tmake_file} s390/t-linux64 s390/t-s390" - ;; + ;; s390x-ibm-tpf*) - tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h s390/tpf.h" - tm_p_file=s390/s390-protos.h @@ -14340,24 +14340,24 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + extra_modes=s390/s390-modes.def + out_file=s390/s390.c + thread_file='tpf' - extra_options="${extra_options} s390/tpf.opt" + extra_options="${extra_options} s390/tpf.opt" + tmake_file="${tmake_file} s390/t-s390" - ;; + ;; score-*-elf) - gas=yes + gas=yes @@ -3603,7 +3611,7 @@ case "${target}" in - for which in arch tune; do - eval "val=\$with_$which" - case ${val} in + for which in arch tune; do + eval "val=\$with_$which" + case ${val} in - "" | g5 | g6 | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12) + "" | g5 | g6 | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13) - # OK - ;; - *) + # OK + ;; + *) --- gcc/configure 2016-05-11 14:46:08.719976035 +0200 +++ gcc/configure 2016-05-11 19:41:14.975813805 +0200 @@ -26000,6 +26000,42 @@ $as_echo "#define HAVE_LD_PERSONALITY_RE - + fi ;; + s390*-*-*) @@ -14397,7 +14397,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 +fi + ;; esac - + # Mips and HP-UX need the GNU assembler. --- gcc/configure.ac 2015-06-18 16:32:50.000000000 +0200 +++ gcc/configure.ac 2016-05-11 19:34:04.507631160 +0200 @@ -14413,7 +14413,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + [Define if your assembler supports .gnu_attribute.])]) + ;; esac - + # Mips and HP-UX need the GNU assembler. --- gcc/doc/invoke.texi 2016-05-11 14:46:08.615977431 +0200 +++ gcc/doc/invoke.texi 2016-05-11 19:27:23.065121001 +0200 @@ -14428,7 +14428,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -18596,6 +18597,46 @@ When generating code compliant to the GN the default is @option{-mesa}. When generating code compliant to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}. - + +@item -mhtm +@itemx -mno-htm +@opindex mhtm @@ -14487,7 +14487,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -8983,6 +8983,13 @@ register in Dwarf. Otherwise, this hook If not defined, the default is to return @code{NULL_RTX}. @end deftypefn - + +@deftypefn {Target Hook} {enum machine_mode} TARGET_DWARF_FRAME_REG_MODE (int @var{regno}) +Given a register, this hook should return the mode which the +corresponding Dwarf frame register should have. This is normally @@ -14503,7 +14503,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -8854,6 +8854,8 @@ register in Dwarf. Otherwise, this hook If not defined, the default is to return @code{NULL_RTX}. @end deftypefn - + +@hook TARGET_DWARF_FRAME_REG_MODE + @hook TARGET_INIT_DWARF_REG_SIZES_EXTRA @@ -14513,28 +14513,28 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 +++ gcc/dwarf2cfi.c 2016-05-11 15:41:36.000000000 +0200 @@ -244,11 +244,9 @@ expand_builtin_init_dwarf_reg_sizes (tre if (rnum < DWARF_FRAME_REGISTERS) - { - HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode); + { + HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode); - enum machine_mode save_mode = reg_raw_mode[i]; - HOST_WIDE_INT size; + HOST_WIDE_INT size; + enum machine_mode save_mode = targetm.dwarf_frame_reg_mode (i); - + - if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode)) - save_mode = choose_hard_reg_mode (i, 1, true); - if (dnum == DWARF_FRAME_RETURN_COLUMN) - { - if (save_mode == VOIDmode) + if (dnum == DWARF_FRAME_RETURN_COLUMN) + { + if (save_mode == VOIDmode) --- gcc/genattrtab.c 2013-01-21 16:08:23.000000000 +0100 +++ gcc/genattrtab.c 2016-05-11 17:32:29.000000000 +0200 @@ -229,7 +229,7 @@ static int *insn_n_alternatives; /* Stores, for each insn code, a bitmap that has bits on for each possible alternative. */ - + -static int *insn_alternatives; +static uint64_t *insn_alternatives; - + /* Used to simplify expressions. */ - + @@ -257,7 +257,7 @@ static char *attr_printf (unsi ATTRIBUTE_PRINTF_2; static rtx make_numeric_value (int); @@ -14545,36 +14545,36 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 static rtx insert_right_side (enum rtx_code, rtx, rtx, int, int); static rtx copy_boolean (rtx); @@ -771,7 +771,7 @@ check_attr_test (rtx exp, int is_const, - if (attr == NULL) - { - if (! strcmp (XSTR (exp, 0), "alternative")) + if (attr == NULL) + { + if (! strcmp (XSTR (exp, 0), "alternative")) - return mk_attr_alt (1 << atoi (XSTR (exp, 1))); + return mk_attr_alt (((uint64_t) 1) << atoi (XSTR (exp, 1))); - else - fatal ("unknown attribute `%s' in EQ_ATTR", XSTR (exp, 0)); - } + else + fatal ("unknown attribute `%s' in EQ_ATTR", XSTR (exp, 0)); + } @@ -817,7 +817,7 @@ check_attr_test (rtx exp, int is_const, - - name_ptr = XSTR (exp, 1); - while ((p = next_comma_elt (&name_ptr)) != NULL) + + name_ptr = XSTR (exp, 1); + while ((p = next_comma_elt (&name_ptr)) != NULL) - set |= 1 << atoi (p); + set |= ((uint64_t) 1) << atoi (p); - - return mk_attr_alt (set); - } + + return mk_attr_alt (set); + } @@ -1292,7 +1292,7 @@ static struct attr_value * get_attr_value (rtx value, struct attr_desc *attr, int insn_code) { struct attr_value *av; - int num_alt = 0; + uint64_t num_alt = 0; - + value = make_canonical (attr, value); if (compares_alternatives_p (value)) @@ -1934,7 +1934,7 @@ insert_right_side (enum rtx_code code, r This routine is passed an expression and either AND or IOR. It returns a bitmask indicating which alternatives are mentioned within EXP. */ - + -static int +static uint64_t compute_alternative_mask (rtx exp, enum rtx_code code) @@ -14582,17 +14582,17 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 const char *string; @@ -1965,15 +1965,15 @@ compute_alternative_mask (rtx exp, enum return 0; - + if (string[1] == 0) - return 1 << (string[0] - '0'); - return 1 << atoi (string); + return ((uint64_t) 1) << (string[0] - '0'); + return ((uint64_t) 1) << atoi (string); } - + /* Given I, a single-bit mask, return RTX to compare the `alternative' attribute with the value represented by that bit. */ - + static rtx -make_alternative_compare (int mask) +make_alternative_compare (uint64_t mask) @@ -14601,13 +14601,13 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 } @@ -2472,7 +2472,7 @@ attr_alt_complement (rtx s) in E. */ - + static rtx -mk_attr_alt (int e) +mk_attr_alt (uint64_t e) { rtx result = rtx_alloc (EQ_ATTR_ALT); - + @@ -2499,7 +2499,7 @@ simplify_test_exp (rtx exp, int insn_cod struct attr_value *av; struct insn_ent *ie; @@ -14616,19 +14616,19 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + uint64_t i; rtx newexp = exp; bool left_alt, right_alt; - + @@ -2779,7 +2779,7 @@ simplify_test_exp (rtx exp, int insn_cod case EQ_ATTR: if (XSTR (exp, 0) == alternative_name) - { + { - newexp = mk_attr_alt (1 << atoi (XSTR (exp, 1))); + newexp = mk_attr_alt (((uint64_t) 1) << atoi (XSTR (exp, 1))); - break; - } - + break; + } + @@ -5240,10 +5240,11 @@ main (int argc, char **argv) expand_delays (); - + /* Make `insn_alternatives'. */ - insn_alternatives = oballocvec (int, insn_code_number); + insn_alternatives = oballocvec (uint64_t, insn_code_number); @@ -14637,7 +14637,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 - insn_alternatives[id->insn_code] = (1 << id->num_alternatives) - 1; + insn_alternatives[id->insn_code] + = (((uint64_t) 1) << id->num_alternatives) - 1; - + /* Make `insn_n_alternatives'. */ insn_n_alternatives = oballocvec (int, insn_code_number); --- gcc/optabs.c 2014-05-15 10:46:12.000000000 +0200 @@ -14645,26 +14645,26 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -6659,11 +6659,11 @@ expand_vec_perm (enum machine_mode mode, enum machine_mode selmode = GET_MODE (sel); if (u == 2) - sel = expand_simple_binop (selmode, PLUS, sel, sel, + sel = expand_simple_binop (selmode, PLUS, sel, sel, - sel, 0, OPTAB_DIRECT); + NULL, 0, OPTAB_DIRECT); else - sel = expand_simple_binop (selmode, ASHIFT, sel, - GEN_INT (exact_log2 (u)), + sel = expand_simple_binop (selmode, ASHIFT, sel, + GEN_INT (exact_log2 (u)), - sel, 0, OPTAB_DIRECT); + NULL, 0, OPTAB_DIRECT); gcc_assert (sel != NULL); - + /* Broadcast the low byte each element into each of its bytes. */ --- gcc/recog.h 2013-09-09 19:16:08.000000000 +0200 +++ gcc/recog.h 2016-05-11 15:52:48.000000000 +0200 @@ -21,7 +21,7 @@ along with GCC; see the file COPYING3. #define GCC_RECOG_H - + /* Random number that should be large enough for all purposes. */ -#define MAX_RECOG_ALTERNATIVES 30 +#define MAX_RECOG_ALTERNATIVES 35 - + /* Types of operands. */ enum op_type { --- gcc/target.def 2013-03-04 12:46:23.000000000 +0100 @@ -14672,7 +14672,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -1834,6 +1834,17 @@ DEFHOOK rtx, (rtx reg), hook_rtx_rtx_null) - + +/* Given a register return the mode of the corresponding DWARF frame + register. */ +DEFHOOK @@ -14692,7 +14692,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -1411,6 +1411,19 @@ default_debug_unwind_info (void) return UI_NONE; } - + +/* Determine the correct mode for a Dwarf frame register that represents + register REGNO. */ + @@ -14708,16 +14708,16 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 + /* To be used by targets where reg_raw_mode doesn't return the right mode for registers used in apply_builtin_return and apply_builtin_arg. */ - + --- gcc/targhooks.h 2013-01-21 16:03:00.000000000 +0100 +++ gcc/targhooks.h 2016-05-11 15:42:21.000000000 +0200 @@ -186,6 +186,7 @@ extern int default_label_align_max_skip extern int default_jump_align_max_skip (rtx); extern section * default_function_section(tree decl, enum node_frequency freq, - bool startup, bool exit); + bool startup, bool exit); +extern enum machine_mode default_dwarf_frame_reg_mode (int); extern enum machine_mode default_get_reg_raw_mode(int); - + extern void *default_get_pch_validity (size_t *); --- gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c 2012-12-13 11:28:46.000000000 +0100 +++ gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c 2016-05-11 17:30:16.000000000 +0200 @@ -14726,7 +14726,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details" } */ +/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -mno-vx" { target { s390*-*-* } } } */ /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -mno-sse" { target { i?86-*-* x86_64-*-* } } } */ - + #include --- gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c 2012-12-13 11:28:46.000000000 +0100 +++ gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c 2016-05-11 17:30:16.000000000 +0200 @@ -14735,7 +14735,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details" } */ +/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -mno-vx" { target { s390*-*-* } } } */ /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -mno-sse" { target { i?86-*-* x86_64-*-* } } } */ - + #include --- gcc/testsuite/gcc.target/s390/htm-builtins-z13-1.c 1970-01-01 01:00:00.000000000 +0100 +++ gcc/testsuite/gcc.target/s390/htm-builtins-z13-1.c 2016-05-11 17:34:03.000000000 +0200 @@ -14779,7 +14779,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -37,6 +37,21 @@ proc check_effective_target_htm { } { }] "-march=zEC12 -mzarch" ] } { return 0 } else { return 1 } } - + +# Return 1 if vector (va - vector add) instructions are understood by +# the assembler and can be executed. This also covers checking for +# the VX kernel feature. A kernel without that feature does not @@ -14801,7 +14801,7 @@ Backport of trunk revisions: r214898, r221047, r223367, r223368, r223369, r22339 @@ -59,5 +74,8 @@ set-torture-options $HOTPATCH_TEST_OPTS gcc-dg-runtest [lsort [glob -nocomplain $hotpatch_tests]] $DEFAULT_CFLAGS torture-finish - + +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*vector*/*.\[cS\]]] \ + "" $DEFAULT_CFLAGS + diff --git a/SOURCES/gcc48-sparc-config-detection.patch b/SOURCES/gcc48-sparc-config-detection.patch index 83fc847c..b669a5c1 100644 --- a/SOURCES/gcc48-sparc-config-detection.patch +++ b/SOURCES/gcc48-sparc-config-detection.patch @@ -1,40 +1,40 @@ --- gcc/config.gcc.jj 2008-04-24 15:42:46.000000000 -0500 +++ gcc/config.gcc 2008-04-24 15:44:51.000000000 -0500 @@ -2478,7 +2478,7 @@ sparc-*-rtems*) - tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h" - tmake_file="sparc/t-sparc sparc/t-rtems t-rtems" - ;; + tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h" + tmake_file="sparc/t-sparc sparc/t-rtems t-rtems" + ;; -sparc-*-linux*) +sparc-*-linux* | sparcv9-*-linux*) - tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h" - extra_options="${extra_options} sparc/long-double-switch.opt" - case ${target} in + tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h" + extra_options="${extra_options} sparc/long-double-switch.opt" + case ${target} in @@ -2532,7 +2532,7 @@ sparc64-*-rtems*) - extra_options="${extra_options}" - tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64 t-rtems" - ;; + extra_options="${extra_options}" + tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64 t-rtems" + ;; -sparc64-*-linux*) +sparc64*-*-linux*) - tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default-64.h sparc/linux64.h sparc/tso.h" - extra_options="${extra_options} sparc/long-double-switch.opt" - tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64" + tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default-64.h sparc/linux64.h sparc/tso.h" + extra_options="${extra_options} sparc/long-double-switch.opt" + tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64" --- libgcc/config.host.jj 2008-04-24 15:46:19.000000000 -0500 +++ libgcc/config.host 2008-04-24 15:46:49.000000000 -0500 @@ -1002,7 +1002,7 @@ sparc-*-elf*) - tmake_file="${tmake_file} t-fdpbit t-crtfm" - extra_parts="$extra_parts crti.o crtn.o crtfastmath.o" - ;; + tmake_file="${tmake_file} t-fdpbit t-crtfm" + extra_parts="$extra_parts crti.o crtn.o crtfastmath.o" + ;; -sparc-*-linux*) # SPARC's running GNU/Linux, libc6 +sparc-*-linux* | sparcv9-*-linux*) # SPARC's running GNU/Linux, libc6 - tmake_file="${tmake_file} t-crtfm" - if test "${host_address}" = 64; then - tmake_file="$tmake_file sparc/t-linux64" + tmake_file="${tmake_file} t-crtfm" + if test "${host_address}" = 64; then + tmake_file="$tmake_file sparc/t-linux64" @@ -1050,7 +1050,7 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd* - tmake_file="$tmake_file t-crtfm" - extra_parts="$extra_parts crtfastmath.o" - ;; + tmake_file="$tmake_file t-crtfm" + extra_parts="$extra_parts crtfastmath.o" + ;; -sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux +sparc64*-*-linux*) # 64-bit SPARC's running GNU/Linux - extra_parts="$extra_parts crtfastmath.o" - tmake_file="${tmake_file} t-crtfm sparc/t-linux" - if test "${host_address}" = 64; then + extra_parts="$extra_parts crtfastmath.o" + tmake_file="${tmake_file} t-crtfm sparc/t-linux" + if test "${host_address}" = 64; then diff --git a/SOURCES/isl-0.11.1-aarch64-config.patch b/SOURCES/isl-0.11.1-aarch64-config.patch index 5d5673ba..461dac02 100644 --- a/SOURCES/isl-0.11.1-aarch64-config.patch +++ b/SOURCES/isl-0.11.1-aarch64-config.patch @@ -6,10 +6,10 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. - + -timestamp='2011-05-11' +timestamp='2012-06-10' - + # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ timestamp='2011-05-11' @@ -24,56 +24,56 @@ # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -57,8 +55,8 @@ GNU config.guess ($timestamp) - + Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. - + This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -145,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or + # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward @@ -792,13 +790,12 @@ EOF - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; + esac + exit ;; i*:CYGWIN*:*) @@ -807,6 +804,9 @@ EOF *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 @@ -861,6 +861,13 @@ EOF i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; @@ -82,71 +82,71 @@ + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; @@ -895,13 +902,16 @@ EOF - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu - exit ;; + exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu - exit ;; + exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit ;; i*86:Linux:*:*) - LIBC=gnu + LIBC=gnu @@ -943,7 +953,7 @@ EOF - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-gnu @@ -978,13 +988,13 @@ EOF - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; + exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1246,7 +1256,7 @@ EOF NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1315,6 +1325,9 @@ EOF i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac - + #echo '(No uname command or uname output not recognized.)' 1>&2 --- isl-0.11.1/config.sub +++ isl-0.11.1/config.sub @@ -156,10 +156,10 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. - + -timestamp='2011-03-23' +timestamp='2012-04-18' - + # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ timestamp='2011-03-23' @@ -175,13 +175,13 @@ # distribute this file as part of a program that contains a @@ -76,8 +74,8 @@ version="\ GNU config.sub ($timestamp) - + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. - + This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -132,6 +130,10 @@ case $maybe_os in @@ -196,197 +196,197 @@ basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -223,6 +225,12 @@ case $os in - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; - -lynx*) - os=-lynxos - ;; + -lynx*) + os=-lynxos + ;; @@ -247,17 +255,22 @@ case $basic_machine in - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ @@ -291,7 +304,7 @@ case $basic_machine in - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ - | rx \ + | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ @@ -300,7 +313,7 @@ case $basic_machine in - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ - | v850 | v850e \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) @@ -315,8 +328,7 @@ case $basic_machine in - c6x) - basic_machine=tic6x-unknown - ;; + c6x) + basic_machine=tic6x-unknown + ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; + basic_machine=$basic_machine-unknown + os=-none + ;; @@ -329,7 +341,10 @@ case $basic_machine in - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; - + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; - xscaleeb) - basic_machine=armeb-unknown - ;; + xscaleeb) + basic_machine=armeb-unknown + ;; @@ -352,11 +367,13 @@ case $basic_machine in - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ @@ -365,8 +382,10 @@ case $basic_machine in - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -400,7 +419,7 @@ case $basic_machine in - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ - | romp-* | rs6000-* | rx-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ @@ -408,10 +427,11 @@ case $basic_machine in - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile-* | tilegx-* \ + | tile*-* \ - | tron-* \ - | ubicom32-* \ + | tron-* \ + | ubicom32-* \ - | v850-* | v850e-* | vax-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ @@ -711,7 +731,6 @@ case $basic_machine in - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 @@ -808,10 +827,18 @@ case $basic_machine in - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 + ncr3000) + basic_machine=i486-ncr + os=-sysv4 @@ -1120,13 +1147,8 @@ case $basic_machine in - basic_machine=t90-cray - os=-unicos - ;; + basic_machine=t90-cray + os=-unicos + ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu - ;; - tile*) + tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) + os=-linux-gnu + ;; + tx39) @@ -1336,7 +1358,7 @@ case $os in - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1521,6 +1543,9 @@ case $basic_machine in - c4x-* | tic4x-*) - os=-coff - ;; + c4x-* | tic4x-*) + os=-coff + ;; + hexagon-*) + os=-elf + ;; - tic54x-*) - os=-coff - ;; + tic54x-*) + os=-coff + ;; @@ -1548,9 +1573,6 @@ case $basic_machine in - ;; - m68000-sun) - os=-sunos3 + ;; + m68000-sun) + os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout + ;; + m68*-cisco) + os=-aout diff --git a/SOURCES/isl-0.11.1-ppc64le-config.patch b/SOURCES/isl-0.11.1-ppc64le-config.patch index d944f6c7..b718df26 100644 --- a/SOURCES/isl-0.11.1-ppc64le-config.patch +++ b/SOURCES/isl-0.11.1-ppc64le-config.patch @@ -3,36 +3,36 @@ @@ -7991,7 +7991,7 @@ ia64-*-hpux*) rm -rf conftest* ;; - + -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -8009,7 +8009,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) @@ -8028,7 +8031,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) --- isl-0.11.1/config.sub.jj 2014-04-10 20:44:52.000000000 +0200 +++ isl-0.11.1/config.sub 2014-04-10 10:38:39.203978206 +0200 @@ -1,24 +1,18 @@ @@ -79,8 +79,8 @@ +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). - - + + -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. @@ -90,12 +90,12 @@ @@ -73,9 +68,7 @@ Report bugs and patches to /dev/null` | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. @@ -400,68 +400,68 @@ +esac + # Note: order is significant - the case branches are not exclusive. - + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -200,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -302,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + echo arm-unknown-riscos + exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -801,6 +820,9 @@ EOF i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; @@ -852,21 +874,21 @@ EOF - exit ;; + exit ;; *:GNU:*:*) - # the GNU system + # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + exit ;; *:GNU/*:*:*) - # other systems with GNU libc and userland + # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; + exit ;; i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + echo ${UNAME_MACHINE}-pc-minix + exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be + UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,59 +901,54 @@ EOF - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi @@ -469,46 +469,46 @@ + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else + else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; + fi + fi + exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build @@ -520,58 +520,58 @@ - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build + eval $set_cc_for_build @@ -950,54 +967,63 @@ EOF - #endif + #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; + ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} - exit ;; + exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} - exit ;; + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; + esac + exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} - exit ;; + exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} @@ -581,55 +581,55 @@ + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} - exit ;; + exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; + exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; + exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + exit ;; i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1201,6 +1227,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; @@ -1227,19 +1256,21 @@ EOF - exit ;; + exit ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build @@ -658,13 +658,13 @@ + esac + fi + fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1330,9 +1361,6 @@ EOF - exit ;; + exit ;; esac - + -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - @@ -676,33 +676,33 @@ @@ -1268,7 +1268,7 @@ ia64-*-hpux*) rm -rf conftest* ;; - + -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -1282,7 +1282,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) @@ -1301,7 +1304,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) diff --git a/SPECS/gcc.spec b/SPECS/gcc.spec index 466f142c..904f4c11 100644 --- a/SPECS/gcc.spec +++ b/SPECS/gcc.spec @@ -2,10 +2,10 @@ %global SVNREV 225304 # Note, gcc_release must be integer, if you want to add suffixes to # %{release}, append them after %{gcc_release} on Release: line. -%global gcc_release 28 +%global gcc_release 36 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 -%global multilib_64_archs sparc64 s390x +%global multilib_64_archs sparc64 %ifarch %{ix86} x86_64 ia64 ppc ppc64 ppc64le ppc64p7 alpha aarch64 %global build_ada 0 %else @@ -26,7 +26,7 @@ %else %global build_libquadmath 0 %endif -%ifarch %{ix86} x86_64 ppc ppc64 +%ifarch %{ix86} x86_64 ppc ppc64 ppc64p7 %global build_libasan 1 %else %global build_libasan 0 @@ -47,7 +47,7 @@ %global build_libitm 0 %endif %global build_cloog 1 -%global build_libstdcxx_docs 0 +%global build_libstdcxx_docs 1 %ifarch %{ix86} x86_64 ppc ppc64 ppc64le ppc64p7 s390 s390x %{arm} aarch64 %global attr_ifunc 1 %else @@ -59,7 +59,7 @@ # With this then on the new arch do rpmbuild -ba -v --with java_bootstrap gcc.spec %global bootstrap_java %{?_with_java_bootstrap:%{build_java}}%{!?_with_java_bootstrap:0} %global build_java_tar %{?_with_java_tar:%{build_java}}%{!?_with_java_tar:0} -%ifarch s390x +%ifarch s390 %global multilib_32_arch s390 %endif %ifarch sparc64 @@ -68,9 +68,9 @@ %ifarch ppc %global multilib_32_arch ppc %endif -#%ifarch x86_64 -#%global multilib_32_arch i686 -#%endif +%ifarch i386 +%global multilib_32_arch i686 +%endif Summary: Various compilers (C, C++, Objective-C, Java, ...) Name: gcc %global gcc_version 4.8.5 @@ -258,6 +258,12 @@ Patch62: gcc48-pr80362.patch Patch63: gcc48-pr80692.patch Patch64: gcc48-pr82274.patch Patch65: gcc48-pr78416.patch +Patch66: gcc48-rh1546728.patch +Patch67: gcc48-rh1555397.patch +Patch68: gcc48-pr81395.patch +Patch69: gcc48-pr72717.patch +Patch70: gcc48-pr66840.patch +Patch71: gcc48-rh1546372.patch Patch1000: fastjar-0.97-segfault.patch Patch1001: fastjar-0.97-len1.patch @@ -295,6 +301,12 @@ Patch1320: gcc48-rh1469697-20.patch Patch1321: gcc48-rh1469697-21.patch Patch1322: gcc48-rh1469697-22.patch Patch1323: gcc48-rh1469697-23.patch +Patch1324: gcc48-rh1537828-1.patch +Patch1325: gcc48-rh1537828-2.patch +Patch1326: gcc48-rh1537828-3.patch +Patch1327: gcc48-rh1537828-4.patch +Patch1328: gcc48-rh1537828-5.patch +Patch1329: gcc48-rh1537828-10.patch Patch1401: gcc48-rh1535655-1.patch Patch1402: gcc48-rh1535655-2.patch @@ -302,6 +314,11 @@ Patch1403: gcc48-rh1535655-3.patch Patch1404: gcc48-rh1535655-4.patch Patch1405: gcc48-rh1535655-5.patch Patch1406: gcc48-rh1535655-6.patch +Patch1407: gcc48-rh1552021.patch +Patch1408: gcc48-rh1537828-6.patch +Patch1409: gcc48-rh1537828-7.patch +Patch1410: gcc48-rh1537828-8.patch +Patch1411: gcc48-rh1537828-9.patch # On ARM EABI systems, we do want -gnueabi to be part of the # target triple. @@ -311,7 +328,10 @@ Patch1406: gcc48-rh1535655-6.patch %ifarch sparcv9 %global gcc_target_platform sparc64-%{_vendor}-%{_target_os} %endif -%ifarch ppc ppc64 +%ifarch ppc ppc64p7 +%global gcc_target_platform ppc64-%{_vendor}-%{_target_os} +%endif +%ifarch ppc64 %global gcc_target_platform ppc64-powerel-%{_target_os} %endif %ifarch ppc64le @@ -968,7 +988,7 @@ package or when debugging this package. %patch3 -p0 -b .rh330771~ %patch4 -p0 -b .i386-libgomp~ %patch5 -p0 -b .sparc-config-detection~ -#%patch6 -p0 -b .libgomp-omp_h-multilib~ +%patch6 -p0 -b .libgomp-omp_h-multilib~ %patch7 -p0 -b .libtool-no-rpath~ %if %{build_cloog} %patch8 -p0 -b .cloog-dl~ @@ -979,7 +999,7 @@ package or when debugging this package. %patch11 -p0 -b .libstdc++-docs~ %endif %patch12 -p0 -b .no-add-needed~ -#%patch13 -p0 -b .pr56564~ +%patch13 -p0 -b .pr56564~ %if 0%{?fedora} >= 20 || 0%{?rhel} >= 7 %patch14 -p0 -b .color-auto~ %endif @@ -991,8 +1011,8 @@ rm -f libgo/go/crypto/elliptic/p224{,_test}.go %patch18 -p0 -b .aarch64-ada~ %endif %patch19 -p0 -b .aarch64-async-unw-tables~ -#%patch20 -p0 -b .aarch64-unwind-opt~ -#%patch21 -p0 -b .rh1243366~ +%patch20 -p0 -b .aarch64-unwind-opt~ +%patch21 -p0 -b .rh1243366~ %patch22 -p0 -b .rh1180633~ %patch23 -p0 -b .rh1278872~ %patch24 -p0 -b .pr67281~ @@ -1001,14 +1021,14 @@ rm -f libgo/go/crypto/elliptic/p224{,_test}.go %patch27 -p0 -b .pr53477~ touch -r %{PATCH27} libstdc++-v3/python/libstdcxx/v6/printers.py %patch28 -p0 -b .rh1296211~ -#%patch29 -p0 -b .rh1304449~ -#%patch30 -p0 -b .s390-z13~ +%patch29 -p0 -b .rh1304449~ +%patch30 -p0 -b .s390-z13~ %patch31 -p0 -b .rh1312850~ %patch32 -p0 -b .pr65142~ %patch33 -p0 -b .pr52714~ %patch34 -p0 -b .rh1344807~ -#%patch35 -p0 -b .libgomp-20160715~ -#%patch36 -p0 -b .pr63293~ +%patch35 -p0 -b .libgomp-20160715~ +%patch36 -p0 -b .pr63293~ %patch37 -p0 -b .pr72863~ %patch38 -p0 -b .pr78064~ %patch39 -p0 -b .pr62258~ @@ -1026,8 +1046,8 @@ touch -r %{PATCH27} libstdc++-v3/python/libstdcxx/v6/printers.py %patch51 -p0 -b .rh1457969~ %patch52 -p0 -b .pr69644~ %patch53 -p0 -b .rh1487434~ -#%patch54 -p0 -b .rh1468546~ -#%patch55 -p0 -b .rh1469384~ +%patch54 -p0 -b .rh1468546~ +%patch55 -p0 -b .rh1469384~ %patch56 -p0 -b .rh1491395~ %patch57 -p0 -b .rh1482762~ %patch58 -p0 -b .pr77375~ @@ -1038,6 +1058,12 @@ touch -r %{PATCH27} libstdc++-v3/python/libstdcxx/v6/printers.py %patch63 -p0 -b .pr80692~ %patch64 -p0 -b .pr82274~ %patch65 -p0 -b .pr78416~ +%patch66 -p0 -b .rh1546728~ +%patch67 -p0 -b .rh1555397~ +%patch68 -p0 -b .pr81395~ +%patch69 -p0 -b .pr72717~ +%patch70 -p0 -b .pr66840~ +%patch71 -p0 -b .rh1546372~ %if 0%{?_enable_debug_packages} cat > split-debuginfo.sh <<\EOF @@ -1091,10 +1117,10 @@ rm libjava/testsuite/libjava.lang/PR35020* tar xzf %{SOURCE4} -#%patch1000 -p0 -b .fastjar-0.97-segfault~ +%patch1000 -p0 -b .fastjar-0.97-segfault~ %patch1001 -p0 -b .fastjar-0.97-len1~ %patch1002 -p0 -b .fastjar-0.97-filename0~ -#%patch1003 -p0 -b .fastjar-CVE-2010-0831~ +%patch1003 -p0 -b .fastjar-CVE-2010-0831~ %patch1004 -p0 -b .fastjar-man~ %patch1005 -p0 -b .fastjar-0.97-aarch64-config~ %patch1006 -p0 -b .fastjar-0.97-ppc64le-config~ @@ -1118,26 +1144,38 @@ tar xjf %{SOURCE10} %patch1308 -p1 -b .stack-clash-8~ %patch1309 -p1 -b .stack-clash-9~ %patch1310 -p1 -b .stack-clash-10~ -#%patch1311 -p1 -b .stack-clash-11~ +%patch1311 -p1 -b .stack-clash-11~ %patch1312 -p1 -b .stack-clash-12~ %patch1313 -p1 -b .stack-clash-13~ %patch1314 -p1 -b .stack-clash-14~ %patch1315 -p1 -b .stack-clash-15~ -#%patch1316 -p1 -b .stack-clash-16~ +%patch1316 -p1 -b .stack-clash-16~ %patch1317 -p1 -b .stack-clash-17~ -#%patch1318 -p1 -b .stack-clash-18~ -#%patch1319 -p1 -b .stack-clash-19~ +%patch1318 -p1 -b .stack-clash-18~ +%patch1319 -p1 -b .stack-clash-19~ %patch1320 -p1 -b .stack-clash-20~ %patch1321 -p1 -b .stack-clash-21~ %patch1322 -p1 -b .stack-clash-22~ %patch1323 -p1 -b .stack-clash-23~ +%patch1324 -p1 -b .stack-clash-24~ +%patch1325 -p1 -b .stack-clash-25~ +%patch1326 -p1 -b .stack-clash-26~ +%patch1327 -p1 -b .stack-clash-27~ +%patch1328 -p1 -b .stack-clash-28~ +%patch1329 -p1 -b .stack-clash-29~ %patch1401 -p1 -b .retpolines-1~ -#%patch1402 -p1 -b .retpolines-2~ -#%patch1403 -p1 -b .retpolines-3~ -#%patch1404 -p1 -b .retpolines-4~ +%patch1402 -p1 -b .retpolines-2~ +%patch1403 -p1 -b .retpolines-3~ +%patch1404 -p1 -b .retpolines-4~ %patch1405 -p1 -b .retpolines-5~ -#%patch1406 -p1 -b .retpolines-6~ +%patch1406 -p1 -b .retpolines-6~ +%patch1407 -p0 -b .retpolines-7~ +%patch1408 -p0 -b .retpolines-8~ +%patch1409 -p1 -b .retpolines-9~ +%patch1410 -p1 -b .retpolines-10~ +%patch1411 -p1 -b .retpolines-11~ + sed -i -e 's/4\.8\.5/4.8.5/' gcc/BASE-VER echo 'PowerEL %{version}-%{gcc_release}' > gcc/DEV-PHASE @@ -1192,7 +1230,6 @@ fi rm -f gcc/testsuite/go.test/test/chan/goroutines.go %build - # Undo the broken autoconf change in recent Fedora versions export CONFIG_SITE=NONE @@ -1248,13 +1285,10 @@ ISL_FLAG_PIC=-fPIC %else ISL_FLAG_PIC=-fpic %endif -%ifarch x86_64 -CLOOG_OPT_FLAGS="-m64 -O3 -march=core2 -mtune=core2 -mmmx -msse -msse2 -mssse3 -msse4 -msse4.1 -msse4.2 -mavx" -%endif cd isl-build ../../isl-%{isl_version}/configure --disable-shared \ CC=/usr/bin/gcc CXX=/usr/bin/g++ \ - CFLAGS="${CLOOG_OPT_FLAGS} $ISL_FLAG_PIC" --prefix=`cd ..; pwd`/isl-install + CFLAGS="${CFLAGS:-%optflags} $ISL_FLAG_PIC" --prefix=`cd ..; pwd`/isl-install make %{?_smp_mflags} make install cd .. @@ -1272,7 +1306,7 @@ isl_prefix=`cd ../isl-install; pwd` \ ../../cloog-%{cloog_version}/configure --with-isl=system \ --with-isl-prefix=`cd ../isl-install; pwd` \ CC=/usr/bin/gcc CXX=/usr/bin/g++ \ - CFLAGS="${CLOOG_OPT_FLAGS}" CXXFLAGS="${CLOOG_OPT_FLAGS}" \ + CFLAGS="${CFLAGS:-%optflags}" CXXFLAGS="${CXXFLAGS:-%optflags}" \ --prefix=`cd ..; pwd`/cloog-install sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool @@ -1358,9 +1392,11 @@ CC="$CC" CFLAGS="$OPT_FLAGS" \ %else --without-isl --without-cloog \ %endif +%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7 %if %{attr_ifunc} --enable-gnu-indirect-function \ %endif +%endif %ifarch %{arm} --disable-sjlj-exceptions \ %endif @@ -1390,7 +1426,7 @@ CC="$CC" CFLAGS="$OPT_FLAGS" \ %endif %ifarch ppc %if 0%{?rhel} >= 7 - --with-cpu-32=power6 --with-tune-32=power6 --with-cpu-64=power7 --with-tune-64=power7 \ + --with-cpu-32=power7 --with-tune-32=power7 --with-cpu-64=power7 --with-tune-64=power7 \ %endif %if 0%{?rhel} == 6 --with-cpu-32=power4 --with-tune-32=power6 --with-cpu-64=power4 --with-tune-64=power6 \ @@ -1399,11 +1435,11 @@ CC="$CC" CFLAGS="$OPT_FLAGS" \ %ifarch ppc --build=%{gcc_target_platform} --target=%{gcc_target_platform} --with-cpu=default32 %endif -%ifarch %{ix86} x86_64 +%ifarch %{ix86} --with-tune=generic \ %endif %ifarch x86_64 - --disable-multilib \ + --with-tune=core2 --disable-multilib \ %endif %if 0%{?rhel} >= 7 %ifarch %{ix86} @@ -1417,7 +1453,7 @@ CC="$CC" CFLAGS="$OPT_FLAGS" \ --with-arch=i686 \ %endif %ifarch x86_64 - --with-arch_32=i686 \ + --with-arch=core2 --with-arch_32=core2 \ %endif %endif %ifarch s390 s390x @@ -1994,7 +2030,7 @@ ln -sf ../`echo ../../../../lib64/libgij.so.14.* | sed s~/../lib64/~/~` 32/libgi mv -f %{buildroot}%{_prefix}/lib/libobjc.*a 32/ mv -f %{buildroot}%{_prefix}/lib/libgomp.*a 32/ %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 ln -sf ../lib32/libgfortran.a 32/libgfortran.a ln -sf lib64/libgfortran.a libgfortran.a ln -sf ../lib32/libstdc++.a 32/libstdc++.a @@ -2471,7 +2507,7 @@ fi %ifarch sparc64 sparcv9 %{_prefix}/bin/sparc-%{_vendor}-%{_target_os}-gcc %endif -%ifarch ppc64 ppc64p7 +%ifarch ppc %{_prefix}/bin/ppc-%{_vendor}-%{_target_os}-gcc %endif %{_prefix}/bin/%{gcc_target_platform}-gcc @@ -2544,7 +2580,7 @@ fi %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/fxsrintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/xsaveintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/xsaveoptintrin.h -#%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/pkuintrin.h +%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/pkuintrin.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/mm_malloc.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/mm3dnow.h %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/cpuid.h @@ -2810,7 +2846,7 @@ fi %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libstdc++.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libsupc++.a %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libstdc++.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libsupc++.a @@ -2936,7 +2972,7 @@ fi %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libgfortran.a %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libgfortran.a %endif @@ -3072,7 +3108,7 @@ fi %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libgcj_bc.so %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libgcj_bc.so %endif @@ -3156,7 +3192,7 @@ fi %exclude %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/adalib/libgnat.a %exclude %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/adalib/libgnarl.a %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/adainclude %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/adalib @@ -3184,7 +3220,7 @@ fi %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/adalib/libgnat.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/adalib/libgnarl.a %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/adalib %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/adalib/libgnat.a @@ -3237,7 +3273,7 @@ fi %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libmudflap.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libmudflapth.a %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libmudflap.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libmudflapth.a @@ -3282,7 +3318,7 @@ fi %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libquadmath.a %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libquadmath.a %endif @@ -3325,7 +3361,7 @@ fi %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libitm.a %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libitm.a %endif @@ -3351,7 +3387,7 @@ fi %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libatomic.a %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libatomic.a %endif @@ -3378,7 +3414,7 @@ fi %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libasan.a %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libasan.a %endif @@ -3461,7 +3497,7 @@ fi %endif %{_prefix}/%{_lib}/go/%{gcc_version}/%{gcc_target_platform} %ifarch %{multilib_64_archs} -%ifnarch sparc64 ppc64 ppc64p7 +%ifnarch sparc64 %dir %{_prefix}/lib/go %dir %{_prefix}/lib/go/%{gcc_version} %if "%{version}" != "%{gcc_version}" @@ -3474,7 +3510,7 @@ fi %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libgobegin.a %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libgobegin.a %endif @@ -3495,7 +3531,7 @@ fi %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib32/libgo.a %endif -%ifarch sparc64 ppc64 ppc64p7 +%ifarch sparc64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/lib64/libgo.a %endif @@ -3522,6 +3558,36 @@ fi %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_version}/plugin %changelog +* Tue Jun 12 2018 Marek Polacek 4.8.5-36 +- back out the last change + +* Tue Jun 5 2018 Marek Polacek 4.8.5-35 +- adjust C++11 signatures to take a const_iterator (#1575888) + +* Thu Apr 26 2018 Marek Polacek 4.8.5-34 +- fix infinite looping in -fipa-cp-clone (#1546372) +- don't look for vsld gcc.target/powerpc/pr72717.c + +* Wed Apr 25 2018 Jeff Law 4.8.5-33 +- Fix two minor problems with the backported spectre updates + from upstream. (#1537828) + +* Thu Apr 19 2018 Jeff Law 4.8.5-32 +- Backport various stack-clash and spectre fixes from upstream +(#1537828) + +* Tue Apr 10 2018 Marek Polacek 4.8.5-31 +- backport s390 -mpic-data-is-text-relative feature (#1555397) +- fix crash when write follows large read (#1463706) +- fix emit_move_insn ICE (#1565536) +- add missing rs6000-cpus.def (#1512202) + +* Wed Apr 4 2018 Marek Polacek 4.8.5-30 +- fix ICE when generating a vector shift by scalar (#1546728) + +* Tue Mar 27 2018 Jeff Law 4.8.5-29 +- s390 retpoline support for spectre mitigation (#1552021) + * Fri Jan 19 2018 Marek Polacek 4.8.5-28 - Minor testsuite fixes to clean up test results (#1469697) - retpoline support for spectre mitigation (#1535655) diff --git a/SPECS/glibc.spec b/SPECS/glibc.spec index 7852925b..f2ad1044 100644 --- a/SPECS/glibc.spec +++ b/SPECS/glibc.spec @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.17-c758a686 %define glibcversion 2.17 -%define glibcrelease 222%{?dist} +%define glibcrelease 260%{?dist} ############################################################################## # We support the following options: # --with/--without, @@ -33,12 +33,6 @@ %undefine with_valgrind %endif %endif -%if %{with werror} -%ifarch s390x -# The 64-bit s390x builds are not -Werror clean yet. -%undefine with_werror -%endif -%endif %if %{with bootstrap} # Disable benchtests, -Werror, docs, and valgrind if we're bootstrapping %undefine with_benchtests @@ -221,7 +215,6 @@ Patch0028: glibc-fedora-localedata-rh61908.patch Patch0030: glibc-fedora-uname-getrlimit.patch Patch0031: glibc-fedora-__libc_multiple_libcs.patch Patch0032: glibc-fedora-elf-rh737223.patch -Patch0033: glibc-fedora-elf-ORIGIN.patch Patch0034: glibc-fedora-elf-init-hidden_undef.patch # Needs to be sent upstream @@ -260,6 +253,11 @@ Patch0066: glibc-rh1227699.patch # CVE-2015-7547 Patch0067: glibc-rh1296031.patch +# releng patch from Fedora +Patch0068: glibc-rh1349982.patch + +# These changes were brought forward from RHEL 6 for compatibility +Patch0069: glibc-rh1448107.patch ############################################################################## # # Patches from upstream @@ -779,7 +777,7 @@ Patch1662: glibc-rh1284959-2.patch Patch1663: glibc-rh1284959-3.patch # RHBZ #1293916 - iconv appears to be adding a duplicate "SI" -# to the output for certain inputs +# to the output for certain inputs Patch1664: glibc-rh1293916.patch # Race condition in _int_free involving fastbins: #15073 @@ -808,7 +806,7 @@ Patch1671: glibc-rh1288613.patch Patch1672: glibc-rh1064063.patch # RHBZ #140250 - Unexpected results from using posix_fallocate -# with nfs target +# with nfs target Patch1675: glibc-rh1140250.patch # RHBZ #1324427 - RHEL7.3 - S390: fprs/vrs are not saved/restored while @@ -1161,6 +1159,264 @@ Patch1900: glibc-rh1534635.patch Patch1901: glibc-rh1529982.patch Patch1902: glibc-rh1523119-compat-symbols.patch +Patch2500: glibc-rh1505492-nscd_stat.patch +Patch2501: glibc-rh1564638.patch +Patch2502: glibc-rh1566623.patch +Patch2503: glibc-rh1349967.patch +Patch2504: glibc-rh1505492-undef-malloc.patch +Patch2505: glibc-rh1505492-undef-elf-dtv-resize.patch +Patch2506: glibc-rh1505492-undef-elision.patch +Patch2507: glibc-rh1505492-undef-max_align_t.patch +Patch2508: glibc-rh1505492-unused-tst-default-attr.patch +Patch2509: glibc-rh1505492-prototypes-rtkaio.patch +Patch2510: glibc-rh1505492-zerodiv-log.patch +Patch2511: glibc-rh1505492-selinux.patch +Patch2512: glibc-rh1505492-undef-abi.patch +Patch2513: glibc-rh1505492-unused-math.patch +Patch2514: glibc-rh1505492-prototypes-1.patch +Patch2515: glibc-rh1505492-uninit-intl-plural.patch +Patch2516: glibc-rh1505492-undef-1.patch +Patch2517: glibc-rh1505492-undef-2.patch +Patch2518: glibc-rh1505492-bounded-1.patch +Patch2519: glibc-rh1505492-bounded-2.patch +Patch2520: glibc-rh1505492-bounded-3.patch +Patch2521: glibc-rh1505492-bounded-4.patch +Patch2522: glibc-rh1505492-undef-3.patch +Patch2523: glibc-rh1505492-bounded-5.patch +Patch2524: glibc-rh1505492-bounded-6.patch +Patch2525: glibc-rh1505492-bounded-7.patch +Patch2526: glibc-rh1505492-bounded-8.patch +Patch2527: glibc-rh1505492-unused-1.patch +Patch2528: glibc-rh1505492-bounded-9.patch +Patch2529: glibc-rh1505492-bounded-10.patch +Patch2530: glibc-rh1505492-bounded-11.patch +Patch2531: glibc-rh1505492-bounded-12.patch +Patch2532: glibc-rh1505492-bounded-13.patch +Patch2533: glibc-rh1505492-unused-2.patch +Patch2534: glibc-rh1505492-bounded-14.patch +Patch2535: glibc-rh1505492-bounded-15.patch +Patch2536: glibc-rh1505492-bounded-16.patch +Patch2537: glibc-rh1505492-bounded-17.patch +Patch2538: glibc-rh1505492-malloc_size_t.patch +Patch2539: glibc-rh1505492-malloc_ptrdiff_t.patch +Patch2540: glibc-rh1505492-prototypes-2.patch +Patch2541: glibc-rh1505492-prototypes-libc_fatal.patch +Patch2542: glibc-rh1505492-getlogin.patch +Patch2543: glibc-rh1505492-undef-4.patch +Patch2544: glibc-rh1505492-register.patch +Patch2545: glibc-rh1505492-prototypes-3.patch +Patch2546: glibc-rh1505492-unused-3.patch +Patch2547: glibc-rh1505492-ports-move-powerpc.patch +Patch2548: glibc-rh1505492-unused-4.patch +Patch2549: glibc-rh1505492-systemtap.patch +Patch2550: glibc-rh1505492-prototypes-wcschr-1.patch +Patch2551: glibc-rh1505492-prototypes-wcsrchr.patch +Patch2552: glibc-rh1505492-prototypes-powerpc-wcscpy.patch +Patch2553: glibc-rh1505492-prototypes-powerpc-wordcopy.patch +Patch2554: glibc-rh1505492-bsd-flatten.patch +Patch2555: glibc-rh1505492-unused-5.patch +Patch2556: glibc-rh1505492-types-1.patch +Patch2557: glibc-rh1505492-powerpc-sotruss.patch +Patch2558: glibc-rh1505492-s390x-sotruss.patch +Patch2559: glibc-rh1505492-ports-am33.patch +Patch2560: glibc-rh1505492-ports-move-arm.patch +Patch2561: glibc-rh1505492-undef-5.patch +Patch2562: glibc-rh1505492-prototypes-4.patch +Patch2563: glibc-rh1505492-ports-move-tile.patch +Patch2564: glibc-rh1505492-ports-move-m68k.patch +Patch2565: glibc-rh1505492-ports-move-mips.patch +Patch2566: glibc-rh1505492-ports-move-aarch64.patch +Patch2567: glibc-rh1505492-ports-move-alpha.patch +Patch2568: glibc-rh1505492-ports-move-ia64.patch +Patch2569: glibc-rh1505492-undef-6.patch +Patch2570: glibc-rh1505492-undef-7.patch +Patch2571: glibc-rh1505492-undef-intl.patch +Patch2572: glibc-rh1505492-undef-obstack.patch +Patch2573: glibc-rh1505492-undef-error.patch +Patch2574: glibc-rh1505492-undef-string.patch +Patch2575: glibc-rh1505492-undef-tempname.patch +Patch2576: glibc-rh1505492-undef-8.patch +Patch2577: glibc-rh1505492-undef-mktime.patch +Patch2578: glibc-rh1505492-undef-sysconf.patch +Patch2579: glibc-rh1505492-prototypes-Xat.patch +Patch2580: glibc-rh1505492-undef-ipc64.patch +Patch2581: glibc-rh1505492-undef-xfs-chown.patch +Patch2582: glibc-rh1505492-undef-9.patch +Patch2583: glibc-rh1505492-undef-10.patch +Patch2584: glibc-rh1505492-undef-11.patch +Patch2585: glibc-rh1505492-undef-12.patch +Patch2586: glibc-rh1505492-prototypes-5.patch +Patch2587: glibc-rh1505492-undef-13.patch +Patch2588: glibc-rh1505492-undef-14.patch +Patch2589: glibc-rh1505492-undef-15.patch +Patch2590: glibc-rh1505492-ports-move-hppa.patch +Patch2591: glibc-rh1505492-undef-16.patch +Patch2592: glibc-rh1505492-undef-17.patch +Patch2593: glibc-rh1505492-undef-18.patch +Patch2594: glibc-rh1505492-undef-19.patch +Patch2595: glibc-rh1505492-undef-20.patch +Patch2596: glibc-rh1505492-undef-21.patch +Patch2597: glibc-rh1505492-undef-22.patch +Patch2598: glibc-rh1505492-undef-23.patch +Patch2599: glibc-rh1505492-undef-24.patch +Patch2600: glibc-rh1505492-prototypes-rwlock.patch +Patch2601: glibc-rh1505492-undef-25.patch +Patch2602: glibc-rh1505492-undef-26.patch +Patch2603: glibc-rh1505492-undef-27.patch +Patch2604: glibc-rh1505492-undef-28.patch +Patch2605: glibc-rh1505492-undef-29.patch +Patch2606: glibc-rh1505492-undef-30.patch +Patch2607: glibc-rh1505492-undef-31.patch +Patch2608: glibc-rh1505492-undef-32.patch +Patch2609: glibc-rh1505492-undef-33.patch +Patch2610: glibc-rh1505492-prototypes-memchr.patch +Patch2611: glibc-rh1505492-undef-34.patch +Patch2612: glibc-rh1505492-prototypes-powerpc-memmove.patch +Patch2613: glibc-rh1505492-undef-35.patch +Patch2614: glibc-rh1505492-undef-36.patch +Patch2615: glibc-rh1505492-undef-37.patch +Patch2616: glibc-rh1505492-uninit-1.patch +Patch2617: glibc-rh1505492-undef-38.patch +Patch2618: glibc-rh1505492-uninit-2.patch +Patch2619: glibc-rh1505492-undef-39.patch +Patch2620: glibc-rh1505492-undef-40.patch +Patch2621: glibc-rh1505492-undef-41.patch +Patch2622: glibc-rh1505492-undef-42.patch +Patch2623: glibc-rh1505492-undef-43.patch +Patch2624: glibc-rh1505492-undef-44.patch +Patch2625: glibc-rh1505492-undef-45.patch +Patch2626: glibc-rh1505492-undef-46.patch +Patch2627: glibc-rh1505492-undef-47.patch +Patch2628: glibc-rh1505492-prototypes-6.patch +Patch2629: glibc-rh1505492-undef-48.patch +Patch2630: glibc-rh1505492-prototypes-execve.patch +Patch2631: glibc-rh1505492-prototypes-readv-writev.patch +Patch2632: glibc-rh1505492-prototypes-7.patch +Patch2633: glibc-rh1505492-prototypes-powerpc-pread-pwrite.patch +Patch2634: glibc-rh1505492-s390-backtrace.patch +Patch2635: glibc-rh1505492-unused-6.patch +Patch2636: glibc-rh1505492-prototypes-8.patch +Patch2637: glibc-rh1505492-prototypes-ctermid.patch +Patch2638: glibc-rh1505492-unused-7.patch +Patch2639: glibc-rh1505492-uninit-3.patch +Patch2640: glibc-rh1505492-types-2.patch +Patch2641: glibc-rh1505492-unused-8.patch +Patch2642: glibc-rh1505492-unused-9.patch +Patch2643: glibc-rh1505492-types-3.patch +Patch2644: glibc-rh1505492-unused-10.patch +Patch2645: glibc-rh1505492-types-5.patch +Patch2646: glibc-rh1505492-unused-11.patch +Patch2647: glibc-rh1505492-unused-12.patch +Patch2648: glibc-rh1505492-unused-13.patch +Patch2649: glibc-rh1505492-deprecated-1.patch +Patch2650: glibc-rh1505492-unused-14.patch +Patch2651: glibc-rh1505492-types-6.patch +Patch2652: glibc-rh1505492-address.patch +Patch2653: glibc-rh1505492-types-7.patch +Patch2654: glibc-rh1505492-prototypes-9.patch +Patch2655: glibc-rh1505492-diag.patch +Patch2656: glibc-rh1505492-zerodiv-1.patch +Patch2657: glibc-rh1505492-deprecated-2.patch +Patch2658: glibc-rh1505492-unused-15.patch +Patch2659: glibc-rh1505492-prototypes-sigvec.patch +Patch2660: glibc-rh1505492-werror-activate.patch +Patch2661: glibc-rh1505492-types-8.patch +Patch2662: glibc-rh1505492-prototypes-intl.patch +Patch2663: glibc-rh1505492-types-9.patch +Patch2664: glibc-rh1505492-types-10.patch +Patch2665: glibc-rh1505492-prototypes-sem_unlink.patch +Patch2666: glibc-rh1505492-prototypes-s390-pthread_once.patch +Patch2667: glibc-rh1505492-types-11.patch +Patch2668: glibc-rh1505492-types-12.patch +Patch2669: glibc-rh1505492-types-13.patch +Patch2670: glibc-rh1505492-undef-49.patch +Patch2671: glibc-rh1505492-undef-50.patch +Patch2672: glibc-rh1505492-undef-51.patch +Patch2673: glibc-rh1505492-undef-52.patch +Patch2674: glibc-rh1505492-types-14.patch +Patch2675: glibc-rh1505492-prototypes-10.patch +Patch2676: glibc-rh1505492-prototypes-wcschr-2.patch +Patch2677: glibc-rh1505492-prototypes-bzero.patch +Patch2678: glibc-rh1505492-winline.patch +Patch2679: glibc-rh1505492-prototypes-scandir.patch +Patch2680: glibc-rh1505492-prototypes-timespec_get.patch +Patch2681: glibc-rh1505492-prototypes-gettimeofday.patch +Patch2682: glibc-rh1505492-prototypes-no_cancellation.patch +Patch2683: glibc-rh1505492-prototypes-getttynam.patch +Patch2684: glibc-rh1505492-undef-53.patch +Patch2685: glibc-rh1505492-prototypes-stpcpy.patch +Patch2686: glibc-rh1505492-undef-54.patch +Patch2687: glibc-rh1505492-undef-55.patch +Patch2688: glibc-rh1505492-undef-activate.patch +Patch2689: glibc-rh1505492-prototypes-debug.patch +Patch2690: glibc-rh1505492-prototypes-putXent.patch +Patch2691: glibc-rh1505492-prototypes-11.patch +Patch2692: glibc-rh1505492-prototypes-12.patch +Patch2693: glibc-rh1505492-prototypes-13.patch +Patch2694: glibc-rh1505492-prototypes-14.patch +Patch2695: glibc-rh1505492-prototypes-15.patch +Patch2696: glibc-rh1505492-prototypes-16.patch +Patch2697: glibc-rh1505492-prototypes-17.patch +Patch2698: glibc-rh1505492-prototypes-18.patch +Patch2699: glibc-rh1505492-prototypes-activate.patch +Patch2700: glibc-rh1505492-unused-16.patch +Patch2701: glibc-rh1505492-unused-17.patch +Patch2702: glibc-rh1505492-undef-56.patch +Patch2703: glibc-rh1548002.patch +Patch2704: glibc-rh1307241-1.patch +Patch2705: glibc-rh1307241-2.patch + +Patch2706: glibc-rh1563747.patch +Patch2707: glibc-rh1476120.patch +Patch2708: glibc-rh1505647.patch + +Patch2709: glibc-rh1457479-1.patch +Patch2710: glibc-rh1457479-2.patch +Patch2711: glibc-rh1457479-3.patch +Patch2712: glibc-rh1457479-4.patch +Patch2713: glibc-rh1461231.patch + +Patch2714: glibc-rh1577333.patch +Patch2715: glibc-rh1531168-1.patch +Patch2716: glibc-rh1531168-2.patch +Patch2717: glibc-rh1531168-3.patch +Patch2718: glibc-rh1579742.patch +Patch2719: glibc-rh1579727-1.patch +Patch2720: glibc-rh1579727-2.patch +Patch2721: glibc-rh1579809-1.patch +Patch2722: glibc-rh1579809-2.patch +Patch2723: glibc-rh1505451.patch +Patch2724: glibc-rh1505477.patch +Patch2725: glibc-rh1505500.patch +Patch2726: glibc-rh1563046.patch + +# RHBZ 1560641 - backport of upstream sem_open patch +Patch2727: glibc-rh1560641.patch + +Patch2728: glibc-rh1550080.patch +Patch2729: glibc-rh1526193.patch +Patch2730: glibc-rh1372304-1.patch +Patch2731: glibc-rh1372304-2.patch +Patch2732: glibc-rh1540480-0.patch +Patch2733: glibc-rh1540480-1.patch +Patch2734: glibc-rh1540480-2.patch +Patch2735: glibc-rh1540480-3.patch +Patch2736: glibc-rh1540480-4.patch +Patch2737: glibc-rh1540480-5.patch +Patch2738: glibc-rh1540480-6.patch +Patch2739: glibc-rh1540480-7.patch +Patch2740: glibc-rh1540480-8.patch +Patch2741: glibc-rh1447808-0.patch +Patch2742: glibc-rh1447808-1.patch +Patch2743: glibc-rh1447808-2.patch +Patch2744: glibc-rh1401665-0.patch +Patch2745: glibc-rh1401665-1a.patch +Patch2746: glibc-rh1401665-1b.patch +Patch2747: glibc-rh1401665-1c.patch +Patch2748: glibc-rh1401665-2.patch +Patch2749: glibc-rh1401665-3.patch +Patch2750: glibc-rh1401665-4.patch +Patch2751: glibc-rh1401665-5.patch ############################################################################## # @@ -1293,6 +1549,8 @@ Patch2111: glibc-rh677316-legacy.patch Patch2112: glibc-rh1498566.patch Patch2113: glibc-rh1445644.patch +Patch2114: glibc-rh1471405.patch + ############################################################################## # End of glibc patches. ############################################################################## @@ -1315,6 +1573,16 @@ Provides: ld-linux.so.3 Provides: ld-linux.so.3(GLIBC_2.4) %endif +# This should remain "Provides: nss_db" (or become a subpackage) to allow easy +# migration from old systems that previously had the old nss_db package +# installed. Note that this doesn't make the migration that smooth, the +# databases still need rebuilding because the formats were different. +# The nss_db package was deprecated in F16 and onwards: +# https://lists.fedoraproject.org/pipermail/devel/2011-July/153665.html +# The different database format does cause some issues for users: +# https://lists.fedoraproject.org/pipermail/devel/2011-December/160497.html +Provides: nss_db + Requires: glibc-common = %{version}-%{release} # Require libgcc in case some program calls pthread_cancel in its %%post @@ -1358,9 +1626,13 @@ Conflicts: kernel < %{enablekernel} %ifarch %{power64} %ifarch ppc64le %define target ppc64le-powerel-linux -%else +%endif +%ifarch ppc64 %define target ppc64-powerel-linux %endif +%ifnarch ppc64 ppc64le +%define target ppc-powerel-linux +%endif %endif %ifarch %{multiarcharches} @@ -1644,7 +1916,6 @@ package or when debugging this package. %patch0030 -p1 %patch0031 -p1 %patch0032 -p1 -%patch0033 -p1 %patch0034 -p1 %patch1051 -p1 %patch0035 -p1 @@ -1729,6 +2000,7 @@ package or when debugging this package. # PPC64LE Patch set: # 1064 to 1109. + %patch1064 -p1 %patch1065 -p1 %patch1066 -p1 @@ -2107,6 +2379,7 @@ package or when debugging this package. %patch1754 -p1 %patch1755 -p1 %patch1756 -p1 +%patch0068 -p1 %patch1757 -p1 %patch17580 -p1 %patch1758 -p1 @@ -2216,7 +2489,7 @@ package or when debugging this package. %patch1855 -p1 %patch1856 -p1 -#%patch1857 -p1 +%patch1857 -p1 %patch1858 -p1 %patch1859 -p1 %patch1860 -p1 @@ -2262,6 +2535,7 @@ package or when debugging this package. %patch2111 -p1 %patch2112 -p1 %patch2113 -p1 +%patch2114 -p1 %patch1878 -p1 %patch1879 -p1 @@ -2290,6 +2564,262 @@ package or when debugging this package. %patch1900 -p1 %patch1901 -p1 %patch1902 -p1 +%patch2500 -p1 +%patch2501 -p1 +%patch2502 -p1 +%patch2503 -p1 +%patch2504 -p1 +%patch2505 -p1 +%patch2506 -p1 +%patch2507 -p1 +%patch2508 -p1 +%patch2509 -p1 +%patch2510 -p1 +%patch2511 -p1 +%patch2512 -p1 +%patch2513 -p1 +%patch2514 -p1 +%patch2515 -p1 +%patch2516 -p1 +%patch2517 -p1 +%patch2518 -p1 +%patch2519 -p1 +%patch2520 -p1 +%patch2521 -p1 +%patch2522 -p1 +%patch2523 -p1 +%patch2524 -p1 +%patch2525 -p1 +%patch2526 -p1 +%patch2527 -p1 +%patch2528 -p1 +%patch2529 -p1 +%patch2530 -p1 +%patch2531 -p1 +%patch2532 -p1 +%patch2533 -p1 +%patch2534 -p1 +%patch2535 -p1 +%patch2536 -p1 +%patch2537 -p1 +%patch2538 -p1 +%patch2539 -p1 +%patch2540 -p1 +%patch2541 -p1 +%patch2542 -p1 +%patch2543 -p1 +%patch0069 -p1 +%patch2544 -p1 +%patch2545 -p1 +%patch2546 -p1 +%patch2547 -p1 +%patch2548 -p1 +%patch2549 -p1 +%patch2550 -p1 +%patch2551 -p1 +%patch2552 -p1 +%patch2553 -p1 +%patch2554 -p1 +%patch2555 -p1 +%patch2556 -p1 +%patch2557 -p1 +%patch2558 -p1 +%patch2559 -p1 +%patch2560 -p1 +%patch2561 -p1 +%patch2562 -p1 +%patch2563 -p1 +%patch2564 -p1 +%patch2565 -p1 +%patch2566 -p1 +%patch2567 -p1 +%patch2568 -p1 +%patch2569 -p1 +%patch2570 -p1 +%patch2571 -p1 +%patch2572 -p1 +%patch2573 -p1 +%patch2574 -p1 +%patch2575 -p1 +%patch2576 -p1 +%patch2577 -p1 +%patch2578 -p1 +%patch2579 -p1 +%patch2580 -p1 +%patch2581 -p1 +%patch2582 -p1 +%patch2583 -p1 +%patch2584 -p1 +%patch2585 -p1 +%patch2586 -p1 +%patch2587 -p1 +%patch2588 -p1 +%patch2589 -p1 +%patch2590 -p1 +%patch2591 -p1 +%patch2592 -p1 +%patch2593 -p1 +%patch2594 -p1 +%patch2595 -p1 +%patch2596 -p1 +%patch2597 -p1 +%patch2598 -p1 +%patch2599 -p1 +%patch2600 -p1 +%patch2601 -p1 +%patch2602 -p1 +%patch2603 -p1 +%patch2604 -p1 +%patch2605 -p1 +%patch2606 -p1 +%patch2607 -p1 +%patch2608 -p1 +%patch2609 -p1 +%patch2610 -p1 +%patch2611 -p1 +%patch2612 -p1 +%patch2613 -p1 +%patch2614 -p1 +%patch2615 -p1 +%patch2616 -p1 +%patch2617 -p1 +%patch2618 -p1 +%patch2619 -p1 +%patch2620 -p1 +%patch2621 -p1 +%patch2622 -p1 +%patch2623 -p1 +%patch2624 -p1 +%patch2625 -p1 +%patch2626 -p1 +%patch2627 -p1 +%patch2628 -p1 +%patch2629 -p1 +%patch2630 -p1 +%patch2631 -p1 +%patch2632 -p1 +%patch2633 -p1 +%patch2634 -p1 +%patch2635 -p1 +%patch2636 -p1 +%patch2637 -p1 +%patch2638 -p1 +%patch2639 -p1 +%patch2640 -p1 +%patch2641 -p1 +%patch2642 -p1 +%patch2643 -p1 +%patch2644 -p1 +%patch2645 -p1 +%patch2646 -p1 +%patch2647 -p1 +%patch2648 -p1 +%patch2649 -p1 +%patch2650 -p1 +%patch2651 -p1 +%patch2652 -p1 +%patch2653 -p1 +%patch2654 -p1 +%patch2655 -p1 +%patch2656 -p1 +%patch2657 -p1 +%patch2658 -p1 +%patch2659 -p1 +%patch2660 -p1 +%patch2661 -p1 +%patch2662 -p1 +%patch2663 -p1 +%patch2664 -p1 +%patch2665 -p1 +%patch2666 -p1 +%patch2667 -p1 +%patch2668 -p1 +%patch2669 -p1 +%patch2670 -p1 +%patch2671 -p1 +%patch2672 -p1 +%patch2673 -p1 +%patch2674 -p1 +%patch2675 -p1 +%patch2676 -p1 +%patch2677 -p1 +%patch2678 -p1 +%patch2679 -p1 +%patch2680 -p1 +%patch2681 -p1 +%patch2682 -p1 +%patch2683 -p1 +%patch2684 -p1 +%patch2685 -p1 +%patch2686 -p1 +%patch2687 -p1 +%patch2688 -p1 +%patch2689 -p1 +%patch2690 -p1 +%patch2691 -p1 +%patch2692 -p1 +%patch2693 -p1 +%patch2694 -p1 +%patch2695 -p1 +%patch2696 -p1 +%patch2697 -p1 +%patch2698 -p1 +%patch2699 -p1 +%patch2700 -p1 +%patch2701 -p1 +%patch2702 -p1 +%patch2703 -p1 +%patch2704 -p1 +%patch2705 -p1 + +%patch2706 -p1 +%patch2707 -p1 +%patch2708 -p1 + +%patch2709 -p1 +%patch2710 -p1 +%patch2711 -p1 +%patch2712 -p1 +%patch2713 -p1 + +%patch2714 -p1 +%patch2715 -p1 +%patch2716 -p1 +%patch2717 -p1 +%patch2718 -p1 +%patch2719 -p1 +%patch2720 -p1 +%patch2721 -p1 +%patch2722 -p1 +%patch2723 -p1 +%patch2724 -p1 +%patch2725 -p1 +%patch2726 -p1 +%patch2727 -p1 +%patch2728 -p1 +%patch2729 -p1 +%patch2730 -p1 +%patch2731 -p1 +%patch2732 -p1 +%patch2733 -p1 +%patch2734 -p1 +%patch2735 -p1 +%patch2736 -p1 +%patch2737 -p1 +%patch2738 -p1 +%patch2739 -p1 +%patch2740 -p1 +%patch2741 -p1 +%patch2742 -p1 +%patch2743 -p1 +%patch2744 -p1 +%patch2745 -p1 +%patch2746 -p1 +%patch2747 -p1 +%patch2748 -p1 +%patch2749 -p1 +%patch2750 -p1 +%patch2751 -p1 ############################################################################## # %%prep - Additional prep required... @@ -2359,8 +2889,7 @@ BuildFlags="-march=i686 -mtune=generic" BuildFlags="$BuildFlags -mno-tls-direct-seg-refs" %endif %ifarch x86_64 -#BuildFlags="-m64 -O3 -march=core2 -mtune=core2 -mmmx -msse -msse2 -mssse3 -msse4 -msse4.1 -msse4.2 -mavx" -BuildFlags="-march=core2 -mtune=core2" +BuildFlags="-m64 -O3 -march=core2 -mtune=core2" %endif ############################################################################## @@ -2455,7 +2984,7 @@ build_CFLAGS="$BuildFlags -g -O3 $*" configure_CFLAGS="$build_CFLAGS -fno-asynchronous-unwind-tables" ../configure CC="$GCC" CXX="$GXX" CFLAGS="$configure_CFLAGS" \ --prefix=%{_prefix} \ - --enable-add-ons=ports,nptl$AddOns \ + --enable-add-ons=nptl$AddOns \ --with-headers=%{_prefix}/include $EnableKernel --enable-bind-now \ --build=%{target} \ %ifarch %{multiarcharches} @@ -2525,8 +3054,8 @@ build power6 %if %{buildpower8} ( - GCC="$GCC -m64 -O3 -mcpu=power8 -mtune=power8" - GXX="$GXX -m64 -O3 -mcpu=power8 -mtune=power8" + GCC="$GCC -mcpu=power8 -mtune=power8" + GXX="$GXX -mcpu=power8 -mtune=power8" core_with_options="--with-cpu=power8" build power8 ) @@ -3454,6 +3983,132 @@ rm -f *.filelist* %endif %changelog +* Wed Jun 27 2018 Patsy Franklin - 2.17-260 +- Update glibc-rh1560641.patch to initialize pad outside + the conditional eliminating an uninitialized byte warning from + valgrind. (#1560641) + +* Fri Jun 15 2018 Arjun Shankar - 2.17-259 +- Correctly set errno when send() fails on i686 (#1550080) + +* Tue Jun 12 2018 Carlos O'Donell - 2.17-258 +- Fix dynamic string token substitution in DT_RPATH etc. (#1447808, #1540480) +- Additional robust mutex fixes (#1401665) + +* Tue Jun 12 2018 Carlos O'Donell - 2.17-257 +- Improve process-shared robust mutex support (#1401665) + +* Tue Jun 12 2018 Carlos O'Donell 2.17-256 +- CVE-2017-16997: Correctly handle DT_RPATH (#1540480). +- Correctly process "$ORIGIN" element in DT_RPATH or DT_NEEDED (#1447808). + +* Tue Jun 12 2018 Carlos O'Donell - 2.17-255 +- Make transition from legacy nss_db easier (#1408964) + +* Mon Jun 11 2018 Arjun Shankar - 2.17-254 +- nptl: Avoid expected SIGALRM in most tests (#1372304) + +* Fri Jun 8 2018 Patsy Franklin - 2.17-253 +- Add support for el_GR@euro locale. Update el_GR, ur_IN and + wal_ET locales. (#1448107) + +* Fri Jun 8 2018 Arjun Shankar - 2.17-252 +- Do not scale NPTL tests with available number of CPUs (#1526193) + +* Thu Jun 7 2018 Arjun Shankar - 2.17-251 +- Correctly set errno when send() fails on s390 and s390x (#1550080) + +* Wed Jun 6 2018 Patsy Franklin - 2.17-250 +- Initialize pad field in sem_open. (#1560641) + +* Mon Jun 4 2018 Arjun Shankar - 2.17-249 +- getlogin_r: Return early when process has no associated login UID (#1563046) + +* Mon Jun 4 2018 Arjun Shankar - 2.17-248 +- Return static array, not local array from transliteration function (#1505500) + +* Mon Jun 4 2018 Arjun Shankar - 2.17-247 +- Re-write multi-statement strftime_l macros using better style (#1505477) + +* Mon Jun 4 2018 Arjun Shankar - 2.17-246 +- Fix pthread_barrier_init typo (#1505451) + +* Wed May 23 2018 Florian Weimer - 2.17-245 +- CVE-2018-11237: AVX-512 mempcpy for KNL buffer overflow (#1579809) + +* Wed May 23 2018 Florian Weimer - 2.17-244 +- resolv: Fix crash after memory allocation failure (#1579727) + +* Wed May 23 2018 Florian Weimer - 2.17-243 +- CVE-2018-11236: Path length overflow in realpath (#1579742) + +* Tue May 22 2018 DJ Delorie - 2.17-242 +- S390: fix sys/ptrace.h to make it includible again after + asm/ptrace.h (#1457479) + +* Tue May 22 2018 Florian Weimer - 2.17-241 +- x86: setcontext, makecontext alignment issues (#1531168) + +* Wed May 16 2018 DJ Delorie - 2.17-240 +- Remove abort() warning in manual (#1577333) + +* Wed May 16 2018 DJ Delorie - 2.17-239 +- Add Open File Description (OFL) locks. (#1461231) + +* Sun May 13 2018 Patsy Franklin - 2.17-238 +- Properly handle more invalid --install-langs arguments. (#1349982) + +* Fri May 11 2018 DJ Delorie - 2.17-237 +- Add O_TMPFILE macro (#1471405) +- Update syscall names list to kernel 4.16 (#1563747) +- Include in bits/fcntl-linux.h. (#1476120) +- Fix netgroup cache keys. (#1505647) +- Update ptrace constants. (#1457479) + +* Thu May 3 2018 Arjun Shankar - 2.17-236 +- Fix strfmon_l so that it groups digits (#1307241) + +* Thu May 3 2018 Arjun Shankar - 2.17-235 +- CVE-2018-6485: Integer overflow in posix_memalign in memalign (#1548002) + +* Fri Apr 13 2018 Florian Weimer - 2.17-234 +- Adjust spec file for compiler warnings cleanup (#1505492) +- Drop ports add-on +- Do not attempt to disable warnings-as-errors on s390x + +* Fri Apr 13 2018 Florian Weimer - 2.17-233 +- Compiler warnings cleanup, phase 7 (#1505492) + +* Fri Apr 13 2018 Florian Weimer - 2.17-232 +- Compiler warnings cleanup, phase 6 (#1505492) + +* Fri Apr 13 2018 Florian Weimer - 2.17-231 +- Compiler warnings cleanup, phase 5 (#1505492) + +* Fri Apr 13 2018 Florian Weimer - 2.17-230 +- Compiler warnings cleanup, phase 4 (#1505492) + +* Fri Apr 13 2018 Florian Weimer - 2.17-229 +- Compiler warnings cleanup, phase 3 (#1505492) + +* Fri Apr 13 2018 Florian Weimer - 2.17-228 +- Compiler warnings cleanup, phase 2 (#1505492) + +* Fri Apr 13 2018 Florian Weimer - 2.17-227 +- Fix downstream-specific compiler warnings (#1505492) + +* Fri Apr 13 2018 Florian Weimer - 2.17-226 +- rtkaio: Do not define IN_MODULE (#1349967) + +* Fri Apr 13 2018 Florian Weimer - 2.17-225 +- Fix K&R function definitions in libio (#1566623) + +* Fri Apr 13 2018 Florian Weimer - 2.17-224 +- Fix type errors in string tests (#1564638) + +* Fri Apr 13 2018 Florian Weimer - 2.17-223 +- Make nscd build reproducible for verification (#1505492) + * Thu Feb 1 2018 Florian Weimer - 2.17-222 - Restore internal GLIBC_PRIVATE symbols for use during upgrades (#1523119) @@ -3483,7 +4138,7 @@ rm -f *.filelist* - CVE-2017-15804: glob: Fix buffer overflow in GLOB_TILDE unescaping (#1504809) * Sat Oct 21 2017 Patsy Franklin - 2.17-214 -- Fix check-localplt test failure. +- Fix check-localplt test failure. - Include ld.so in check-localplt test. (#1440250) * Thu Oct 19 2017 Florian Weimer - 2.17-213 @@ -3508,7 +4163,7 @@ rm -f *.filelist* - aarch64: Avoid invalid relocations in the startup code (#1500908) * Fri Oct 6 2017 Patsy Franklin - 2.17-206 -- Fix timezone test failures on large parallel builds. (#1234449, #1378329) +- Fix timezone test failures on large parallel builds. (#1234449, #1378329) * Fri Oct 6 2017 DJ Delorie - 2.17-205 - Handle DSOs with no PLT (#1445781)