OSDN Git Service

2007-07-09 Thomas Koenig <tkoenig@gcc.gnu.org>
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 Jul 2007 22:34:43 +0000 (22:34 +0000)
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 Jul 2007 22:34:43 +0000 (22:34 +0000)
PR libfortran/32336
* m4/matmul.m4:  When the dimension of b is incorrect,
raise a runtime error instead of a failed assertion.
* generated/matmul_i1.c:  Regenerated.
* generated/matmul_i2.c:  Regenerated.
* generated/matmul_i4.c:  Regenerated.
* generated/matmul_i8.c:  Regenerated.
* generated/matmul_i16.c:  Regenerated.
* generated/matmul_r4.c:  Regenerated.
* generated/matmul_r8.c:  Regenerated.
* generated/matmul_r10.c:  Regenerated.
* generated/matmul_r16.c:  Regenerated.

2007-07-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR libfortran/32336
* gfortran.dg/matmul_5.f90:  New test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126498 138bc75d-0d04-0410-961f-82ee72b054a4

17 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/matmul_5.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/generated/matmul_c10.c
libgfortran/generated/matmul_c16.c
libgfortran/generated/matmul_c4.c
libgfortran/generated/matmul_c8.c
libgfortran/generated/matmul_i1.c
libgfortran/generated/matmul_i16.c
libgfortran/generated/matmul_i2.c
libgfortran/generated/matmul_i4.c
libgfortran/generated/matmul_i8.c
libgfortran/generated/matmul_r10.c
libgfortran/generated/matmul_r16.c
libgfortran/generated/matmul_r4.c
libgfortran/generated/matmul_r8.c
libgfortran/m4/matmul.m4

index b8de460..edbe7ed 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32336
+       * gfortran.dg/matmul_5.f90:  New test case.
+
 2007-07-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * gcc.dg/fesd-any.c: Move to gcc.dg/debug/dwarf2 directory.
 2007-07-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * gcc.dg/fesd-any.c: Move to gcc.dg/debug/dwarf2 directory.
diff --git a/gcc/testsuite/gfortran.dg/matmul_5.f90 b/gcc/testsuite/gfortran.dg/matmul_5.f90
new file mode 100644 (file)
index 0000000..b67601f
--- /dev/null
@@ -0,0 +1,11 @@
+! { dg-do run }
+! { dg-shouldfail "dimension of array B incorrect in MATMUL intrinsic" }
+program main
+  real, dimension(:,:), allocatable :: a
+  real, dimension(:), allocatable :: b
+  allocate (a(2,2), b(3))
+  call random_number(a)
+  call random_number(b)
+  print *,matmul(a,b)
+end program main
+! { dg-output "Fortran runtime error: dimension of array B incorrect in MATMUL intrinsic.*" }
index 7b6f3e5..154d241 100644 (file)
@@ -1,3 +1,18 @@
+2007-07-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR libfortran/32336
+       * m4/matmul.m4:  When the dimension of b is incorrect,
+       raise a runtime error instead of a failed assertion.
+       * generated/matmul_i1.c:  Regenerated.
+       * generated/matmul_i2.c:  Regenerated.
+       * generated/matmul_i4.c:  Regenerated.
+       * generated/matmul_i8.c:  Regenerated.
+       * generated/matmul_i16.c:  Regenerated.
+       * generated/matmul_r4.c:  Regenerated.
+       * generated/matmul_r8.c:  Regenerated.
+       * generated/matmul_r10.c:  Regenerated.
+       * generated/matmul_r16.c:  Regenerated.
+
 2007-07-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libgfortran/32678
 2007-07-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libgfortran/32678
index 5e3b281..d7d4c65 100644 (file)
@@ -169,7 +169,8 @@ matmul_c10 (gfc_array_c10 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index f730111..e9ad2d4 100644 (file)
@@ -169,7 +169,8 @@ matmul_c16 (gfc_array_c16 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index f2984ab..753e535 100644 (file)
@@ -169,7 +169,8 @@ matmul_c4 (gfc_array_c4 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index 65cc0a5..23aea6a 100644 (file)
@@ -169,7 +169,8 @@ matmul_c8 (gfc_array_c8 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index ce98de1..ae03507 100644 (file)
@@ -169,7 +169,8 @@ matmul_i1 (gfc_array_i1 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index a193669..38756dc 100644 (file)
@@ -169,7 +169,8 @@ matmul_i16 (gfc_array_i16 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index b86839e..7287b6b 100644 (file)
@@ -169,7 +169,8 @@ matmul_i2 (gfc_array_i2 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index 69b9b48..d5eed99 100644 (file)
@@ -169,7 +169,8 @@ matmul_i4 (gfc_array_i4 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index 23a87a9..4ab5547 100644 (file)
@@ -169,7 +169,8 @@ matmul_i8 (gfc_array_i8 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index e4dfd74..9f7fb4b 100644 (file)
@@ -169,7 +169,8 @@ matmul_r10 (gfc_array_r10 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index ec760f2..6a8f220 100644 (file)
@@ -169,7 +169,8 @@ matmul_r16 (gfc_array_r16 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index cf2f45f..e4a4580 100644 (file)
@@ -169,7 +169,8 @@ matmul_r4 (gfc_array_r4 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index c746f6c..e823a75 100644 (file)
@@ -169,7 +169,8 @@ matmul_r8 (gfc_array_r8 * const restrict retarray,
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
index 3156fdc..6235f63 100644 (file)
@@ -171,7 +171,8 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
       xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
     }
 
-  assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
+  if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
+    runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {
 
   if (GFC_DESCRIPTOR_RANK (b) == 1)
     {