summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-02 13:50:55 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-02 13:50:55 +0000
commit056eb8d962fff9d8984214fe48cec01d8f6e89d1 (patch)
tree41b636e47d1922843adc517116bfd40c4acb7428 /libgfortran
parent957fb0833055c483ae1594a0c04080666760d44c (diff)
downloadgcc-056eb8d962fff9d8984214fe48cec01d8f6e89d1.tar.gz
2008-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/35001 * m4/shape.m4: Return 0 for extents <= 0. * generated/shape_i4.c: Regenerated. * generated/shape_i8.c: Regenerated. * generated/shape_i16.c: Regenerated. 2008-02-02 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/35001 * gfortran.dg/shape_4.f90: New test. Fixed in regression-only mode by special dispense (see the PR). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132070 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog8
-rw-r--r--libgfortran/generated/shape_i16.c5
-rw-r--r--libgfortran/generated/shape_i4.c5
-rw-r--r--libgfortran/generated/shape_i8.c5
-rw-r--r--libgfortran/m4/shape.m45
5 files changed, 20 insertions, 8 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index b71eb30065e..432aa56ee44 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,11 @@
+2008-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/35001
+ * m4/shape.m4: Return 0 for extents <= 0.
+ * generated/shape_i4.c: Regenerated.
+ * generated/shape_i8.c: Regenerated.
+ * generated/shape_i16.c: Regenerated.
+
2008-01-27 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/34980
diff --git a/libgfortran/generated/shape_i16.c b/libgfortran/generated/shape_i16.c
index 77274d6002a..0ab2654bd8c 100644
--- a/libgfortran/generated/shape_i16.c
+++ b/libgfortran/generated/shape_i16.c
@@ -45,6 +45,7 @@ shape_16 (gfc_array_i16 * const restrict ret,
{
int n;
index_type stride;
+ index_type extent;
stride = ret->dim[0].stride;
@@ -53,8 +54,8 @@ shape_16 (gfc_array_i16 * const restrict ret,
for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++)
{
- ret->data[n * stride] =
- array->dim[n].ubound + 1 - array->dim[n].lbound;
+ extent = array->dim[n].ubound + 1 - array->dim[n].lbound;
+ ret->data[n * stride] = extent > 0 ? extent : 0 ;
}
}
diff --git a/libgfortran/generated/shape_i4.c b/libgfortran/generated/shape_i4.c
index 787ba544c21..64a6fcdb994 100644
--- a/libgfortran/generated/shape_i4.c
+++ b/libgfortran/generated/shape_i4.c
@@ -45,6 +45,7 @@ shape_4 (gfc_array_i4 * const restrict ret,
{
int n;
index_type stride;
+ index_type extent;
stride = ret->dim[0].stride;
@@ -53,8 +54,8 @@ shape_4 (gfc_array_i4 * const restrict ret,
for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++)
{
- ret->data[n * stride] =
- array->dim[n].ubound + 1 - array->dim[n].lbound;
+ extent = array->dim[n].ubound + 1 - array->dim[n].lbound;
+ ret->data[n * stride] = extent > 0 ? extent : 0 ;
}
}
diff --git a/libgfortran/generated/shape_i8.c b/libgfortran/generated/shape_i8.c
index f318b170ab9..80bef318b81 100644
--- a/libgfortran/generated/shape_i8.c
+++ b/libgfortran/generated/shape_i8.c
@@ -45,6 +45,7 @@ shape_8 (gfc_array_i8 * const restrict ret,
{
int n;
index_type stride;
+ index_type extent;
stride = ret->dim[0].stride;
@@ -53,8 +54,8 @@ shape_8 (gfc_array_i8 * const restrict ret,
for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++)
{
- ret->data[n * stride] =
- array->dim[n].ubound + 1 - array->dim[n].lbound;
+ extent = array->dim[n].ubound + 1 - array->dim[n].lbound;
+ ret->data[n * stride] = extent > 0 ? extent : 0 ;
}
}
diff --git a/libgfortran/m4/shape.m4 b/libgfortran/m4/shape.m4
index 3bda0ad8cbb..c783270bec7 100644
--- a/libgfortran/m4/shape.m4
+++ b/libgfortran/m4/shape.m4
@@ -46,6 +46,7 @@ shape_'rtype_kind` ('rtype` * const restrict ret,
{
int n;
index_type stride;
+ index_type extent;
stride = ret->dim[0].stride;
@@ -54,8 +55,8 @@ shape_'rtype_kind` ('rtype` * const restrict ret,
for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++)
{
- ret->data[n * stride] =
- array->dim[n].ubound + 1 - array->dim[n].lbound;
+ extent = array->dim[n].ubound + 1 - array->dim[n].lbound;
+ ret->data[n * stride] = extent > 0 ? extent : 0 ;
}
}