[PATCH] Fix fortran/18966
Steve Kargl
sgk@troutmask.apl.washington.edu
Tue Dec 14 05:16:00 GMT 2004
On Mon, Dec 13, 2004 at 09:00:00PM -0800, Steve Kargl wrote:
> The attached patch fixes PR 18966 on at least 32-bit
> systems with int8_t and int16_t typedefs.
>
> 2004-12-05 Steven G. Kargl <kargls@comcast.net>
>
> * gfortran.h: typedef GFC_INTEGER_1 and GFC_INTEGER_2
> * intrinsics/cshift0.c (cshift0_1,cshift0_2): New functions;
> use typedefs.
>
eoshift also suffered a similar problem. Here's an updated patch.
2004-12-05 Steven G. Kargl <kargls@comcast.net>
* gfortran.h: typedef GFC_INTEGER_1 and GFC_INTEGER_2
* intrinsics/cshift0.c (cshift0_1,cshift0_2): New functions;
use typedefs.
* intrinsics/eoshift0.c (eoshift0_1,eoshift0_2): New functions;
use typedefs.
* intrinsics/eoshift2.c (eoshift2_1,eoshift2_2): New functions;
use typedefs.
--
Steve
-------------- next part --------------
Index: libgfortran.h
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/libgfortran.h,v
retrieving revision 1.17
diff -u -b -u -r1.17 libgfortran.h
--- libgfortran.h 12 Dec 2004 08:59:02 -0000 1.17
+++ libgfortran.h 14 Dec 2004 05:14:48 -0000
@@ -185,6 +185,8 @@
#define IMAGPART(z) (__imag__(z))
#define COMPLEX_ASSIGN(z_, r_, i_) {__real__(z_) = (r_); __imag__(z_) = (i_);}
+typedef int8_t GFC_INTEGER_1;
+typedef int16_t GFC_INTEGER_2;
typedef int32_t GFC_INTEGER_4;
typedef int64_t GFC_INTEGER_8;
typedef uint32_t GFC_UINTEGER_4;
Index: intrinsics/cshift0.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/intrinsics/cshift0.c,v
retrieving revision 1.7
diff -u -b -u -r1.7 cshift0.c
--- intrinsics/cshift0.c 13 Dec 2004 02:47:58 -0000 1.7
+++ intrinsics/cshift0.c 14 Dec 2004 05:14:49 -0000
@@ -259,3 +259,26 @@
{
cshift0 (ret, array, *pshift, pdim ? *pdim : 1);
}
+
+extern void cshift0_1 (gfc_array_char *, const gfc_array_char *,
+ const GFC_INTEGER_1 *, const GFC_INTEGER_1 *);
+export_proto(cshift0_1);
+
+void
+cshift0_1 (gfc_array_char *ret, const gfc_array_char *array,
+ const GFC_INTEGER_1 *pshift, const GFC_INTEGER_1 *pdim)
+{
+ cshift0 (ret, array, *pshift, pdim ? *pdim : 1);
+}
+
+
+extern void cshift0_2 (gfc_array_char *, const gfc_array_char *,
+ const GFC_INTEGER_2 *, const GFC_INTEGER_2 *);
+export_proto(cshift0_2);
+
+void
+cshift0_2 (gfc_array_char *ret, const gfc_array_char *array,
+ const GFC_INTEGER_2 *pshift, const GFC_INTEGER_2 *pdim)
+{
+ cshift0 (ret, array, *pshift, pdim ? *pdim : 1);
+}
Index: intrinsics/eoshift0.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/intrinsics/eoshift0.c,v
retrieving revision 1.7
diff -u -b -u -r1.7 eoshift0.c
--- intrinsics/eoshift0.c 13 Dec 2004 02:47:58 -0000 1.7
+++ intrinsics/eoshift0.c 14 Dec 2004 05:14:49 -0000
@@ -212,3 +212,31 @@
{
eoshift0 (ret, array, *pshift, pbound, pdim ? *pdim : 1);
}
+
+
+extern void eoshift0_1 (gfc_array_char *, const gfc_array_char *,
+ const GFC_INTEGER_1 *, const char *,
+ const GFC_INTEGER_1 *);
+export_proto(eoshift0_1);
+
+void
+eoshift0_1 (gfc_array_char *ret, const gfc_array_char *array,
+ const GFC_INTEGER_1 *pshift, const char *pbound,
+ const GFC_INTEGER_1 *pdim)
+{
+ eoshift0 (ret, array, *pshift, pbound, pdim ? *pdim : 1);
+}
+
+
+extern void eoshift0_2 (gfc_array_char *, const gfc_array_char *,
+ const GFC_INTEGER_2 *, const char *,
+ const GFC_INTEGER_2 *);
+export_proto(eoshift0_2);
+
+void
+eoshift0_2 (gfc_array_char *ret, const gfc_array_char *array,
+ const GFC_INTEGER_2 *pshift, const char *pbound,
+ const GFC_INTEGER_2 *pdim)
+{
+ eoshift0 (ret, array, *pshift, pbound, pdim ? *pdim : 1);
+}
Index: intrinsics/eoshift2.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/intrinsics/eoshift2.c,v
retrieving revision 1.7
diff -u -b -u -r1.7 eoshift2.c
--- intrinsics/eoshift2.c 13 Dec 2004 02:47:58 -0000 1.7
+++ intrinsics/eoshift2.c 14 Dec 2004 05:14:49 -0000
@@ -228,3 +228,31 @@
{
eoshift2 (ret, array, *pshift, bound, pdim ? *pdim : 1);
}
+
+
+extern void eoshift2_1 (gfc_array_char *, const gfc_array_char *,
+ const GFC_INTEGER_1 *, const gfc_array_char *,
+ const GFC_INTEGER_1 *);
+export_proto(eoshift2_1);
+
+void
+eoshift2_1 (gfc_array_char *ret, const gfc_array_char *array,
+ const GFC_INTEGER_1 *pshift, const gfc_array_char *bound,
+ const GFC_INTEGER_1 *pdim)
+{
+ eoshift2 (ret, array, *pshift, bound, pdim ? *pdim : 1);
+}
+
+
+extern void eoshift2_2 (gfc_array_char *, const gfc_array_char *,
+ const GFC_INTEGER_2 *, const gfc_array_char *,
+ const GFC_INTEGER_2 *);
+export_proto(eoshift2_2);
+
+void
+eoshift2_2 (gfc_array_char *ret, const gfc_array_char *array,
+ const GFC_INTEGER_2 *pshift, const gfc_array_char *bound,
+ const GFC_INTEGER_2 *pdim)
+{
+ eoshift2 (ret, array, *pshift, bound, pdim ? *pdim : 1);
+}
More information about the Fortran
mailing list