aboutsummaryrefslogtreecommitdiffstats
path: root/main/gcc
diff options
context:
space:
mode:
authorBartłomiej Piotrowski <b@bpiotrowski.pl>2016-07-20 13:14:29 +0200
committerBartłomiej Piotrowski <b@bpiotrowski.pl>2016-07-20 13:34:36 +0200
commita114f25561160aebb61fa56e1b0ffd066008d99f (patch)
treedab6c152ef00917e03219b5c4b92203c0950404c /main/gcc
parent82ad44ed9ef9eacd81a5a0a5e11bef1902cff250 (diff)
downloadaports-a114f25561160aebb61fa56e1b0ffd066008d99f.tar.bz2
aports-a114f25561160aebb61fa56e1b0ffd066008d99f.tar.xz
main/gcc: don't use vectorized builtins when NEON is not available
Diffstat (limited to 'main/gcc')
-rw-r--r--main/gcc/APKBUILD6
-rw-r--r--main/gcc/gcc-6.1-71056-Don-t-use-vectorized-builtins-when-N.patch85
2 files changed, 90 insertions, 1 deletions
diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD
index 2b3cc6a82b..b0427ca837 100644
--- a/main/gcc/APKBUILD
+++ b/main/gcc/APKBUILD
@@ -8,7 +8,7 @@ _cross=""
&& _cross="-$CTARGET"
pkgname="$pkgname$_cross"
-pkgrel=2
+pkgrel=3
pkgdesc="The GNU Compiler Collection"
url="http://gcc.gnu.org"
arch="all"
@@ -169,6 +169,7 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2
libada-cross-shared.patch
gcc-4.9-musl-fortify.patch
gcc-6.1-musl-libssp.patch
+ gcc-6.1-71056-Don-t-use-vectorized-builtins-when-N.patch
boehm-gc-musl.patch
gcc-pure64.patch
fix-gcj-stdgnu14-link.patch
@@ -637,6 +638,7 @@ a7836fe20d35f91ddf623e3c62a920fe 205-nopie.patch
246aef378ea9730d9bf97bc42fd392d2 libada-cross-shared.patch
9e658e590bc51be611f39945183f6aa2 gcc-4.9-musl-fortify.patch
32c40cd9c22a01621c2b7d60ac4255a0 gcc-6.1-musl-libssp.patch
+fad1bba965c4fd341eb027950d35111d gcc-6.1-71056-Don-t-use-vectorized-builtins-when-N.patch
0ea0f556d4ef9c260d1353b7fd33970c boehm-gc-musl.patch
3cb420ef6240a8b96f52fb1b479ddaab gcc-pure64.patch
1e143d6a88cdcbc4e3266b19208df0fd fix-gcj-stdgnu14-link.patch
@@ -674,6 +676,7 @@ df92e2f03615c1591278c132cd38ee0ed2c576cd942d8ea751a44d0521057e6b 207-static-pie
aa3e570f9ccd9dcaadf00369ed2c4ae26ba640c49256f32aee7e631e2b836771 libada-cross-shared.patch
dc93f97dff28b872f9c7e241fb87a3eca0271f706534d196b3517781b05667fa gcc-4.9-musl-fortify.patch
4ece19529edb8e681e1778e977e2ba1d47984ccfcb82505e8b898bb29d659625 gcc-6.1-musl-libssp.patch
+2b61762aa8c5fe2f1fe896dfd2aaa3238235fb63842b04a4c79c0b6a0b92a3c5 gcc-6.1-71056-Don-t-use-vectorized-builtins-when-N.patch
6ccca88695ef84c0d038cd315cad5ae5b799672ecb009fdaab34e68ba60b733c boehm-gc-musl.patch
0625ab76ec3f7b47364becdb9ddc66bec9215ebfbeab1d58df8e1855a1cd76bb gcc-pure64.patch
c03165e7ce812c93a33fdb0893847b4f9eb892e353d32d85b23249610fb24396 fix-gcj-stdgnu14-link.patch
@@ -711,6 +714,7 @@ d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2
497e73650b4e7ac1cc92158b993f543b1506d3af4f9df9cb1e9504af4db657a9fc6e4429b4cb2bf5b3c1c8c06a5cec5d8b19bc958fd57b92d7b4d5e58b34554c libada-cross-shared.patch
600fe5098dc54edaa9808fd5717af9dec058953f9ad37d49cfba1db4f7e9a7a8f02019342f75157fc575946fa693259422184de27b7ecc8386d9f3ecc0f7cc5d gcc-4.9-musl-fortify.patch
dbe0ee917fc7668571722364ab7c806731e3a31e8bfa30b4941b28b16b877d2a32b4a3897ef533399a28f82d43cac9b28e92de0493f0e779046db56584e07fa4 gcc-6.1-musl-libssp.patch
+df8ca05b82250977354d4677e5e90b3d597c77281ff697c699ef129fe1dbbccd39a736c9257405c76aaf4bc51ab9f128381e40ee72f163a771c7e1f52b15ad17 gcc-6.1-71056-Don-t-use-vectorized-builtins-when-N.patch
bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc24698c7abc8878dd15f231bcc5119f1860e575a120b311706c7 boehm-gc-musl.patch
cd94f7be10de7511b17355dbb6b86dc70919b4a41c8aec1d7c5961820248aa00cf1594ed66fdd412c12b02a94605600530f674b32ab4cbd0ca6456968475ecbb gcc-pure64.patch
2253941f3d19b6d08801d3782f5f5ed56c3b73fbc9d3561a8f01c702963ac4fab91599c686076e7081eb6a80c37ccd33591ae978996d6eee1dc0ce0f1c50259a fix-gcj-stdgnu14-link.patch
diff --git a/main/gcc/gcc-6.1-71056-Don-t-use-vectorized-builtins-when-N.patch b/main/gcc/gcc-6.1-71056-Don-t-use-vectorized-builtins-when-N.patch
new file mode 100644
index 0000000000..ed72b893f6
--- /dev/null
+++ b/main/gcc/gcc-6.1-71056-Don-t-use-vectorized-builtins-when-N.patch
@@ -0,0 +1,85 @@
+From 7286da3d2d19806e8a1273558fb08e094bb7ffe7 Mon Sep 17 00:00:00 2001
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 19 May 2016 13:43:58 +0000
+Subject: [PATCH 2/2] PR target/71056: Don't use vectorized builtins when NEON
+ is not available
+
+ PR target/71056
+ * config/arm/arm-builtins.c (arm_builtin_vectorized_function): Return
+ NULL_TREE early if NEON is not available. Remove now redundant check
+ in ARM_CHECK_BUILTIN_MODE.
+
+ * gcc.target/arm/pr71056.c: New test.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236459 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/config/arm/arm-builtins.c | 6 +++++-
+ gcc/testsuite/gcc.target/arm/pr71056.c | 32 ++++++++++++++++++++++++++++++++
+ 2 files changed, 37 insertions(+), 1 deletion(-)
+ create mode 100644 gcc/testsuite/gcc.target/arm/pr71056.c
+
+diff --git a/gcc/config/arm/arm-builtins.c b/gcc/config/arm/arm-builtins.c
+index 90fb40f..68b2839 100644
+--- a/gcc/config/arm/arm-builtins.c
++++ b/gcc/config/arm/arm-builtins.c
+@@ -2861,6 +2861,10 @@ arm_builtin_vectorized_function (unsigned int fn, tree type_out, tree type_in)
+ int in_n, out_n;
+ bool out_unsigned_p = TYPE_UNSIGNED (type_out);
+
++ /* Can't provide any vectorized builtins when we can't use NEON. */
++ if (!TARGET_NEON)
++ return NULL_TREE;
++
+ if (TREE_CODE (type_out) != VECTOR_TYPE
+ || TREE_CODE (type_in) != VECTOR_TYPE)
+ return NULL_TREE;
+@@ -2875,7 +2879,7 @@ arm_builtin_vectorized_function (unsigned int fn, tree type_out, tree type_in)
+ NULL_TREE is returned if no such builtin is available. */
+ #undef ARM_CHECK_BUILTIN_MODE
+ #define ARM_CHECK_BUILTIN_MODE(C) \
+- (TARGET_NEON && TARGET_FPU_ARMV8 \
++ (TARGET_FPU_ARMV8 \
+ && flag_unsafe_math_optimizations \
+ && ARM_CHECK_BUILTIN_MODE_1 (C))
+
+diff --git a/gcc/testsuite/gcc.target/arm/pr71056.c b/gcc/testsuite/gcc.target/arm/pr71056.c
+new file mode 100644
+index 0000000..136754e
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/arm/pr71056.c
+@@ -0,0 +1,32 @@
++/* PR target/71056. */
++/* { dg-do compile } */
++/* { dg-require-effective-target arm_vfp3_ok } */
++/* { dg-options "-O3 -mfpu=vfpv3" } */
++
++/* Check that compiling for a non-NEON target doesn't try to introduce
++ a NEON vectorized builtin. */
++
++extern char *buff;
++int f2 ();
++struct T1
++{
++ int reserved[2];
++ unsigned int ip;
++ unsigned short cs;
++ unsigned short rsrv2;
++};
++void
++f3 (const char *p)
++{
++ struct T1 x;
++ __builtin_memcpy (&x, p, sizeof (struct T1));
++ x.reserved[0] = __builtin_bswap32 (x.reserved[0]);
++ x.reserved[1] = __builtin_bswap32 (x.reserved[1]);
++ x.ip = __builtin_bswap32 (x.ip);
++ x.cs = x.cs << 8 | x.cs >> 8;
++ x.rsrv2 = x.rsrv2 << 8 | x.rsrv2 >> 8;
++ if (f2 ())
++ {
++ __builtin_memcpy (buff, "\n", 1);
++ }
++}
+--
+2.7.2
+