-2018-25-01 Paul Thomas <pault@gcc.gnu.org>
+2018-01-30 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/37577
+ * libgfortran.h: Remove GFC_DTYPE_DERIVED_1, GFC_DTYPE_DERIVED_2,
+ GFC_DTYPE_DERIVED_4, GFC_DTYPE_DERIVED_8 and GFC_DTYPE_DERIVED_16.
+ * m4/cshift1.m4: Remove GFC_DTYPE_DERIVED_1.
+ * generated/cshift1_16.c: Regenerated.
+ * generated/cshift1_4.c: Regenerated.
+ * generated/cshift1_8.c: Regenerated.
+ * intrinsics/cshift0.c: Remove GFC_DTYPE_DERIVED_1.
+ * intrinsics/pack_generic.c (pack): Move handling of other types
+ into separate switch statement.
+ * intrinsics/spread_generic.c (spread): Likewise.
+ (spread_scalar): Likewise.
+ * intrinsics/unpack_generic.c (unpack1): Likewise.
+ (unpack0): Likewise.
+ * runtime/in_pack_generic.c (internal_pack): Likewise.
+ * runtime/in_unpack_generic.c (internal_unpack): Likewise.
+
+2018-01-25 Paul Thomas <pault@gcc.gnu.org>
PR fortran/37577
* caf/single.c (_gfortran_caf_failed_images): Access the 'type'
{
case GFC_DTYPE_LOGICAL_1:
case GFC_DTYPE_INTEGER_1:
- case GFC_DTYPE_DERIVED_1:
cshift1_16_i1 ((gfc_array_i1 *)ret, (gfc_array_i1 *) array,
h, pwhich);
return;
{
case GFC_DTYPE_LOGICAL_1:
case GFC_DTYPE_INTEGER_1:
- case GFC_DTYPE_DERIVED_1:
cshift1_4_i1 ((gfc_array_i1 *)ret, (gfc_array_i1 *) array,
h, pwhich);
return;
{
case GFC_DTYPE_LOGICAL_1:
case GFC_DTYPE_INTEGER_1:
- case GFC_DTYPE_DERIVED_1:
cshift1_8_i1 ((gfc_array_i1 *)ret, (gfc_array_i1 *) array,
h, pwhich);
return;
{
case GFC_DTYPE_LOGICAL_1:
case GFC_DTYPE_INTEGER_1:
- case GFC_DTYPE_DERIVED_1:
cshift0_i1 ((gfc_array_i1 *)ret, (gfc_array_i1 *) array, shift, which);
return;
{
case GFC_DTYPE_LOGICAL_1:
case GFC_DTYPE_INTEGER_1:
- case GFC_DTYPE_DERIVED_1:
pack_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) array,
(gfc_array_l1 *) mask, (gfc_array_i1 *) vector);
return;
return;
# endif
#endif
+ }
+
+ /* For other types, let's check the actual alignment of the data pointers.
+ If they are aligned, we can safely call the unpack functions. */
- /* For derived types, let's check the actual alignment of the
- data pointers. If they are aligned, we can safely call
- the unpack functions. */
+ switch (GFC_DESCRIPTOR_SIZE (array))
+ {
+ case 1:
+ pack_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) array,
+ (gfc_array_l1 *) mask, (gfc_array_i1 *) vector);
+ return;
- case GFC_DTYPE_DERIVED_2:
+ case 2:
if (GFC_UNALIGNED_2(ret->base_addr) || GFC_UNALIGNED_2(array->base_addr)
|| (vector && GFC_UNALIGNED_2(vector->base_addr)))
break;
(gfc_array_l1 *) mask, (gfc_array_i2 *) vector);
return;
}
-
- case GFC_DTYPE_DERIVED_4:
+
+ case 4:
if (GFC_UNALIGNED_4(ret->base_addr) || GFC_UNALIGNED_4(array->base_addr)
|| (vector && GFC_UNALIGNED_4(vector->base_addr)))
break;
return;
}
- case GFC_DTYPE_DERIVED_8:
+ case 8:
if (GFC_UNALIGNED_8(ret->base_addr) || GFC_UNALIGNED_8(array->base_addr)
|| (vector && GFC_UNALIGNED_8(vector->base_addr)))
break;
return;
}
-#ifdef HAVE_GFC_INTEGER_16
- case GFC_DTYPE_DERIVED_16:
+#ifdef HAVE_GFC_INTEGER_16
+ case 16:
if (GFC_UNALIGNED_16(ret->base_addr) || GFC_UNALIGNED_16(array->base_addr)
|| (vector && GFC_UNALIGNED_16(vector->base_addr)))
break;
else
{
pack_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) array,
- (gfc_array_l1 *) mask, (gfc_array_i16 *) vector);
+ (gfc_array_l1 *) mask, (gfc_array_i16 *) vector);
return;
}
#endif
-
+ default:
+ break;
}
size = GFC_DESCRIPTOR_SIZE (array);
type_size = GFC_DTYPE_TYPE_SIZE(ret);
switch(type_size)
{
- case GFC_DTYPE_DERIVED_1:
case GFC_DTYPE_LOGICAL_1:
case GFC_DTYPE_INTEGER_1:
spread_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) source,
# endif
#endif
- case GFC_DTYPE_DERIVED_2:
+ }
+
+ switch (GFC_DESCRIPTOR_SIZE (ret))
+ {
+ case 1:
+ spread_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) source,
+ *along, *pncopies);
+ return;
+
+ case 2:
if (GFC_UNALIGNED_2(ret->base_addr) || GFC_UNALIGNED_2(source->base_addr))
break;
else
return;
}
- case GFC_DTYPE_DERIVED_4:
+ case 4:
if (GFC_UNALIGNED_4(ret->base_addr) || GFC_UNALIGNED_4(source->base_addr))
break;
else
return;
}
- case GFC_DTYPE_DERIVED_8:
+ case 8:
if (GFC_UNALIGNED_8(ret->base_addr) || GFC_UNALIGNED_8(source->base_addr))
break;
else
*along, *pncopies);
return;
}
-
#ifdef HAVE_GFC_INTEGER_16
- case GFC_DTYPE_DERIVED_16:
+ case 16:
if (GFC_UNALIGNED_16(ret->base_addr)
|| GFC_UNALIGNED_16(source->base_addr))
break;
spread_i16 ((gfc_array_i16 *) ret, (gfc_array_i16 *) source,
*along, *pncopies);
return;
- }
+ }
#endif
+
}
spread_internal (ret, source, along, pncopies);
type_size = GFC_DTYPE_TYPE_SIZE(ret);
switch(type_size)
{
- case GFC_DTYPE_DERIVED_1:
case GFC_DTYPE_LOGICAL_1:
case GFC_DTYPE_INTEGER_1:
spread_scalar_i1 ((gfc_array_i1 *) ret, (GFC_INTEGER_1 *) source,
# endif
#endif
- case GFC_DTYPE_DERIVED_2:
+ }
+
+ switch (GFC_DESCRIPTOR_SIZE(ret))
+ {
+ case 1:
+ spread_scalar_i1 ((gfc_array_i1 *) ret, (GFC_INTEGER_1 *) source,
+ *along, *pncopies);
+ return;
+
+ case 2:
if (GFC_UNALIGNED_2(ret->base_addr) || GFC_UNALIGNED_2(source))
break;
else
return;
}
- case GFC_DTYPE_DERIVED_4:
+ case 4:
if (GFC_UNALIGNED_4(ret->base_addr) || GFC_UNALIGNED_4(source))
break;
else
return;
}
- case GFC_DTYPE_DERIVED_8:
+ case 8:
if (GFC_UNALIGNED_8(ret->base_addr) || GFC_UNALIGNED_8(source))
break;
else
return;
}
#ifdef HAVE_GFC_INTEGER_16
- case GFC_DTYPE_DERIVED_16:
+ case 16:
if (GFC_UNALIGNED_16(ret->base_addr) || GFC_UNALIGNED_16(source))
break;
else
return;
}
#endif
+ default:
+ break;
}
spread_internal_scalar (ret, source, along, pncopies);
{
case GFC_DTYPE_LOGICAL_1:
case GFC_DTYPE_INTEGER_1:
- case GFC_DTYPE_DERIVED_1:
unpack1_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) vector,
mask, (gfc_array_i1 *) field);
return;
# endif
#endif
- case GFC_DTYPE_DERIVED_2:
+ }
+
+ switch (GFC_DESCRIPTOR_SIZE(ret))
+ {
+ case 1:
+ unpack1_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) vector,
+ mask, (gfc_array_i1 *) field);
+ return;
+
+ case 2:
if (GFC_UNALIGNED_2(ret->base_addr) || GFC_UNALIGNED_2(vector->base_addr)
|| GFC_UNALIGNED_2(field->base_addr))
break;
return;
}
- case GFC_DTYPE_DERIVED_4:
+ case 4:
if (GFC_UNALIGNED_4(ret->base_addr) || GFC_UNALIGNED_4(vector->base_addr)
|| GFC_UNALIGNED_4(field->base_addr))
break;
return;
}
- case GFC_DTYPE_DERIVED_8:
+ case 8:
if (GFC_UNALIGNED_8(ret->base_addr) || GFC_UNALIGNED_8(vector->base_addr)
|| GFC_UNALIGNED_8(field->base_addr))
break;
}
#ifdef HAVE_GFC_INTEGER_16
- case GFC_DTYPE_DERIVED_16:
+ case 16:
if (GFC_UNALIGNED_16(ret->base_addr)
|| GFC_UNALIGNED_16(vector->base_addr)
|| GFC_UNALIGNED_16(field->base_addr))
return;
}
#endif
+ default:
+ break;
}
unpack_internal (ret, vector, mask, field, size);
{
case GFC_DTYPE_LOGICAL_1:
case GFC_DTYPE_INTEGER_1:
- case GFC_DTYPE_DERIVED_1:
unpack0_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) vector,
mask, (GFC_INTEGER_1 *) field);
return;
# endif
#endif
- case GFC_DTYPE_DERIVED_2:
+ }
+
+ switch (GFC_DESCRIPTOR_SIZE(ret))
+ {
+ case 1:
+ unpack0_i1 ((gfc_array_i1 *) ret, (gfc_array_i1 *) vector,
+ mask, (GFC_INTEGER_1 *) field);
+ return;
+
+ case 2:
if (GFC_UNALIGNED_2(ret->base_addr) || GFC_UNALIGNED_2(vector->base_addr)
|| GFC_UNALIGNED_2(field))
break;
return;
}
- case GFC_DTYPE_DERIVED_4:
+ case 4:
if (GFC_UNALIGNED_4(ret->base_addr) || GFC_UNALIGNED_4(vector->base_addr)
|| GFC_UNALIGNED_4(field))
break;
return;
}
- case GFC_DTYPE_DERIVED_8:
+ case 8:
if (GFC_UNALIGNED_8(ret->base_addr) || GFC_UNALIGNED_8(vector->base_addr)
|| GFC_UNALIGNED_8(field))
break;
}
#ifdef HAVE_GFC_INTEGER_16
- case GFC_DTYPE_DERIVED_16:
+ case 16:
if (GFC_UNALIGNED_16(ret->base_addr)
|| GFC_UNALIGNED_16(vector->base_addr)
|| GFC_UNALIGNED_16(field))
return;
}
#endif
-
}
memset (&tmp, 0, sizeof (tmp));
| (sizeof(GFC_COMPLEX_16) << GFC_DTYPE_SIZE_SHIFT))
#endif
-#define GFC_DTYPE_DERIVED_1 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
- | (sizeof(GFC_INTEGER_1) << GFC_DTYPE_SIZE_SHIFT))
-#define GFC_DTYPE_DERIVED_2 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
- | (sizeof(GFC_INTEGER_2) << GFC_DTYPE_SIZE_SHIFT))
-#define GFC_DTYPE_DERIVED_4 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
- | (sizeof(GFC_INTEGER_4) << GFC_DTYPE_SIZE_SHIFT))
-#define GFC_DTYPE_DERIVED_8 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
- | (sizeof(GFC_INTEGER_8) << GFC_DTYPE_SIZE_SHIFT))
-#ifdef HAVE_GFC_INTEGER_16
-#define GFC_DTYPE_DERIVED_16 ((BT_DERIVED << GFC_DTYPE_TYPE_SHIFT) \
- | (sizeof(GFC_INTEGER_16) << GFC_DTYPE_SIZE_SHIFT))
-#endif
-
/* Macros to determine the alignment of pointers. */
#define GFC_UNALIGNED_2(x) (((uintptr_t)(x)) & \
{
case GFC_DTYPE_LOGICAL_1:
case GFC_DTYPE_INTEGER_1:
- case GFC_DTYPE_DERIVED_1:
cshift1_'atype_kind`_i1 ((gfc_array_i1 *)ret, (gfc_array_i1 *) array,
h, pwhich);
return;
{
case GFC_DTYPE_INTEGER_1:
case GFC_DTYPE_LOGICAL_1:
- case GFC_DTYPE_DERIVED_1:
return internal_pack_1 ((gfc_array_i1 *) source);
case GFC_DTYPE_INTEGER_2:
# endif
#endif
- case GFC_DTYPE_DERIVED_2:
+ default:
+ break;
+ }
+
+ switch(GFC_DESCRIPTOR_SIZE (source))
+ {
+ case 1:
+ return internal_pack_1 ((gfc_array_i1 *) source);
+
+ case 2:
if (GFC_UNALIGNED_2(source->base_addr))
break;
else
return internal_pack_2 ((gfc_array_i2 *) source);
- case GFC_DTYPE_DERIVED_4:
+ case 4:
if (GFC_UNALIGNED_4(source->base_addr))
break;
else
return internal_pack_4 ((gfc_array_i4 *) source);
- case GFC_DTYPE_DERIVED_8:
+ case 8:
if (GFC_UNALIGNED_8(source->base_addr))
break;
else
return internal_pack_8 ((gfc_array_i8 *) source);
#ifdef HAVE_GFC_INTEGER_16
- case GFC_DTYPE_DERIVED_16:
+ case 16:
if (GFC_UNALIGNED_16(source->base_addr))
break;
else
return internal_pack_16 ((gfc_array_i16 *) source);
#endif
-
default:
break;
}
-
+
dim = GFC_DESCRIPTOR_RANK (source);
ssize = 1;
packed = 1;
{
case GFC_DTYPE_INTEGER_1:
case GFC_DTYPE_LOGICAL_1:
- case GFC_DTYPE_DERIVED_1:
internal_unpack_1 ((gfc_array_i1 *) d, (const GFC_INTEGER_1 *) s);
return;
# endif
#endif
- case GFC_DTYPE_DERIVED_2:
+ default:
+ break;
+ }
+
+ switch (GFC_DESCRIPTOR_SIZE(d))
+ {
+ case 1:
+ internal_unpack_1 ((gfc_array_i1 *) d, (const GFC_INTEGER_1 *) s);
+ return;
+
+ case 2:
if (GFC_UNALIGNED_2(d->base_addr) || GFC_UNALIGNED_2(s))
break;
else
internal_unpack_2 ((gfc_array_i2 *) d, (const GFC_INTEGER_2 *) s);
return;
}
- case GFC_DTYPE_DERIVED_4:
+
+ case 4:
if (GFC_UNALIGNED_4(d->base_addr) || GFC_UNALIGNED_4(s))
break;
else
return;
}
- case GFC_DTYPE_DERIVED_8:
+ case 8:
if (GFC_UNALIGNED_8(d->base_addr) || GFC_UNALIGNED_8(s))
break;
else
}
#ifdef HAVE_GFC_INTEGER_16
- case GFC_DTYPE_DERIVED_16:
+ case 16:
if (GFC_UNALIGNED_16(d->base_addr) || GFC_UNALIGNED_16(s))
break;
else
return;
}
#endif
-
default:
break;
}