summaryrefslogtreecommitdiffstats
path: root/source/d/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/gcc')
-rwxr-xr-xsource/d/gcc/gcc.SlackBuild5
-rw-r--r--source/d/gcc/patches/gfortran.deferred-shape-vs-assumed-shape.patch40
2 files changed, 44 insertions, 1 deletions
diff --git a/source/d/gcc/gcc.SlackBuild b/source/d/gcc/gcc.SlackBuild
index aa95d3687..c154888e6 100755
--- a/source/d/gcc/gcc.SlackBuild
+++ b/source/d/gcc/gcc.SlackBuild
@@ -57,7 +57,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=gcc
SRCVER=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
VERSION=$(echo $SRCVER | cut -f 1 -d _)
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# How many jobs to run in parallel:
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
@@ -168,6 +168,9 @@ cd gcc-$SRCVER || exit 1
# Smite the fixincludes:
zcat $CWD/patches/gcc-no_fixincludes.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
+# Fix a gfortran bug:
+zcat $CWD/patches/gfortran.deferred-shape-vs-assumed-shape.patch.gz | patch -p0 --verbose --backup --suffix=.orig || exit 1
+
# Fix perms/owners:
chown -R root:root .
find . \
diff --git a/source/d/gcc/patches/gfortran.deferred-shape-vs-assumed-shape.patch b/source/d/gcc/patches/gfortran.deferred-shape-vs-assumed-shape.patch
new file mode 100644
index 000000000..f695b969e
--- /dev/null
+++ b/source/d/gcc/patches/gfortran.deferred-shape-vs-assumed-shape.patch
@@ -0,0 +1,40 @@
+[PATCH] deferred-shape vs assumed-shape
+Steve Kargl sgk@troutmask.apl.washington.edu
+Wed Apr 1 20:04:43 GMT 2020
+
+See
+https://stackoverflow.com/questions/60972134/whats-wrong-with-the-following-fortran-code-gfortran-dtio-dummy-argument-at
+
+Is A(:) a deferred-shape array or an assumed-shape array? The
+answer of course depends on context.
+
+This patch fixes the issue found at the above URL.
+
+Index: gcc/fortran/interface.c
+===================================================================
+--- gcc/fortran/interface.c (revision 280157)
++++ gcc/fortran/interface.c (working copy)
+@@ -4916,10 +4916,15 @@ check_dtio_arg_TKR_intent (gfc_symbol *fsym, bool type
+ || ((type != BT_CLASS) && fsym->attr.dimension)))
+ gfc_error ("DTIO dummy argument at %L must be a scalar",
+ &fsym->declared_at);
+- else if (rank == 1
+- && (fsym->as == NULL || fsym->as->type != AS_ASSUMED_SHAPE))
+- gfc_error ("DTIO dummy argument at %L must be an "
+- "ASSUMED SHAPE ARRAY", &fsym->declared_at);
++ else if (rank == 1)
++ {
++ if (fsym->as == NULL
++ || !(fsym->as->type == AS_ASSUMED_SHAPE
++ || (fsym->as->type == AS_DEFERRED && fsym->attr.dummy
++ && !fsym->attr.allocatable && !fsym->attr.pointer)))
++ gfc_error ("DTIO dummy argument at %L must be an "
++ "ASSUMED-SHAPE ARRAY", &fsym->declared_at);
++ }
+
+ if (type == BT_CHARACTER && fsym->ts.u.cl->length != NULL)
+ gfc_error ("DTIO character argument at %L must have assumed length",
+
+--
+Steve
+