This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Attached patch fixes PR libfortran/26769, by adding real(4) and real(8) versions of the library RESHAPE and TRANSPOSE routines, and removing the front-end special checks for these cases.
Regtested on i686-linux, OK for mainline? (I'm not sure it's worth backporting to 4.1, although it's not an ABI-breaking change)
Index: gcc/fortran/iresolve.c
===================================================================
--- gcc/fortran/iresolve.c (revision 114791)
+++ gcc/fortran/iresolve.c (working copy)
@@ -1574,14 +1574,10 @@
case 8:
case 10:
case 16:
- if (source->ts.type == BT_COMPLEX)
+ if (source->ts.type == BT_COMPLEX || source->ts.type == BT_REAL)
f->value.function.name =
gfc_get_string (PREFIX("reshape_%c%d"),
- gfc_type_letter (BT_COMPLEX), source->ts.kind);
- else if (source->ts.type == BT_REAL && (kind == 10 || kind == 16))
- f->value.function.name =
- gfc_get_string (PREFIX("reshape_%c%d"),
- gfc_type_letter (BT_REAL), source->ts.kind);
+ gfc_type_letter (source->ts.type), source->ts.kind);
else
f->value.function.name =
gfc_get_string (PREFIX("reshape_%d"), source->ts.kind);
@@ -2025,8 +2021,6 @@
void
gfc_resolve_transpose (gfc_expr * f, gfc_expr * matrix)
{
- int kind;
-
f->ts = matrix->ts;
f->rank = 2;
if (matrix->shape)
@@ -2036,9 +2030,7 @@
mpz_init_set (f->shape[1], matrix->shape[0]);
}
- kind = matrix->ts.kind;
-
- switch (kind)
+ switch (matrix->ts.kind)
{
case 4:
case 8:
@@ -2046,30 +2038,20 @@
case 16:
switch (matrix->ts.type)
{
+ case BT_REAL:
case BT_COMPLEX:
f->value.function.name =
- gfc_get_string (PREFIX("transpose_c%d"), kind);
+ gfc_get_string (PREFIX("transpose_%c%d"),
+ gfc_type_letter (matrix->ts.type),
+ matrix->ts.kind);
break;
- case BT_REAL:
- /* There is no kind=10 integer type and on 32-bit targets
- there is usually no kind=16 integer type. We need to
- call the real version. */
- if (kind == 10 || kind == 16)
- {
- f->value.function.name =
- gfc_get_string (PREFIX("transpose_r%d"), kind);
- break;
- }
-
- /* Fall through */
-
case BT_INTEGER:
case BT_LOGICAL:
/* Use the integer routines for real and logical cases. This
assumes they all have the same alignment requirements. */
f->value.function.name =
- gfc_get_string (PREFIX("transpose_i%d"), kind);
+ gfc_get_string (PREFIX("transpose_i%d"), matrix->ts.kind);
break;
default:
Index: libgfortran/Makefile.am
===================================================================
--- libgfortran/Makefile.am (revision 114791)
+++ libgfortran/Makefile.am (working copy)
@@ -312,6 +312,8 @@
generated/transpose_i4.c \
generated/transpose_i8.c \
generated/transpose_i16.c \
+generated/transpose_r4.c \
+generated/transpose_r8.c \
generated/transpose_r10.c \
generated/transpose_r16.c \
generated/transpose_c4.c \
@@ -328,6 +330,8 @@
generated/reshape_i4.c \
generated/reshape_i8.c \
generated/reshape_i16.c \
+generated/reshape_r4.c \
+generated/reshape_r8.c \
generated/reshape_r10.c \
generated/reshape_r16.c \
generated/reshape_c4.c \
Attachment:
reshape_transpose.ChangeLog
Description: Binary data
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |