OSDN Git Service

2009-01-21 Daniel Kraft <d@domob.eu>
authordomob <domob@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Jan 2009 13:34:55 +0000 (13:34 +0000)
committerdomob <domob@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Jan 2009 13:34:55 +0000 (13:34 +0000)
* trans-stmt.c (gfc_conv_elemental_dependencies):  Cleaned up comment.

2009-01-21  Daniel Kraft  <d@domob.eu>

PR fortran/38887
* runtime/in_unpack_generic.c (internal_unpack):  Return instead of
abort when called with empty array.
* m4/in_unpack.m4:  Ditto.
* generated/in_unpack_i1.c:  Regenerated.
* generated/in_unpack_i2.c:  Regenerated.
* generated/in_unpack_i4.c:  Regenerated.
* generated/in_unpack_i8.c:  Regenerated.
* generated/in_unpack_i16.c: Regenerated.
* generated/in_unpack_r4.c:  Regenerated.
* generated/in_unpack_r8.c:  Regenerated.
* generated/in_unpack_r10.c: Regenerated.
* generated/in_unpack_r16.c: Regenerated.
* generated/in_unpack_c4.c:  Regenerated.
* generated/in_unpack_c8.c:  Regenerated.
* generated/in_unpack_c10.c: Regenerated.
* generated/in_unpack_c16.c: Regenerated.

2009-01-21  Daniel Kraft  <d@domob.eu>

PR fortran/38887
* gfortran.dg/mvbits_5.f90:  New test.

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

20 files changed:
gcc/fortran/ChangeLog
gcc/fortran/trans-stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/mvbits_5.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/generated/in_unpack_c10.c
libgfortran/generated/in_unpack_c16.c
libgfortran/generated/in_unpack_c4.c
libgfortran/generated/in_unpack_c8.c
libgfortran/generated/in_unpack_i1.c
libgfortran/generated/in_unpack_i16.c
libgfortran/generated/in_unpack_i2.c
libgfortran/generated/in_unpack_i4.c
libgfortran/generated/in_unpack_i8.c
libgfortran/generated/in_unpack_r10.c
libgfortran/generated/in_unpack_r16.c
libgfortran/generated/in_unpack_r4.c
libgfortran/generated/in_unpack_r8.c
libgfortran/m4/in_unpack.m4
libgfortran/runtime/in_unpack_generic.c

index 7c56c00..a744290 100644 (file)
@@ -1,3 +1,7 @@
+2009-01-21  Daniel Kraft  <d@domob.eu>
+
+       * trans-stmt.c (gfc_conv_elemental_dependencies):  Cleaned up comment.
+
 2009-01-20  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/38907
index 031fe88..82ecca8 100644 (file)
@@ -311,14 +311,11 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
          info->offset = gfc_create_var (gfc_array_index_type, NULL);     
          gfc_add_modify (&se->pre, info->offset, offset);
 
-
          /* Copy the result back using unpack.  */
          tmp = build_call_expr (gfor_fndecl_in_unpack, 2, parmse.expr, data);
          gfc_add_expr_to_block (&se->post, tmp);
 
-         /* XXX: This is possibly not needed; but isn't it cleaner this way? */
          gfc_add_block_to_block (&se->pre, &parmse.pre);
-
          gfc_add_block_to_block (&se->post, &parmse.post);
          gfc_add_block_to_block (&se->post, &temp_post);
        }
index 4bf0f2f..cffbad4 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-21  Daniel Kraft  <d@domob.eu>
+
+       PR fortran/38887
+       * gfortran.dg/mvbits_5.f90:  New test.
+
 2009-01-21  Bingfeng Mei  <bmei@broadcom.com>
 
        * gcc.dg/sms-6.c: New test.
diff --git a/gcc/testsuite/gfortran.dg/mvbits_5.f90 b/gcc/testsuite/gfortran.dg/mvbits_5.f90
new file mode 100644 (file)
index 0000000..42d8346
--- /dev/null
@@ -0,0 +1,17 @@
+! { dg-do run }
+
+! PR fortran/38887
+! This aborted at runtime for the runtime zero-sized array arguments.
+
+! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
+
+program try_ya0013
+  integer ida(9)
+  call ya0013(ida,1,5,6)
+end program
+
+SUBROUTINE YA0013(IDA,nf1,nf5,nf6)
+  INTEGER IDA(9)
+  IDA = 1
+  CALL MVBITS(IDA(NF5:NF1), 0, 1, IDA(NF6:NF1),2)
+END SUBROUTINE
index 7b1241d..96fd675 100644 (file)
@@ -1,3 +1,23 @@
+2009-01-21  Daniel Kraft  <d@domob.eu>
+
+       PR fortran/38887
+       * runtime/in_unpack_generic.c (internal_unpack):  Return instead of
+       abort when called with empty array.
+       * m4/in_unpack.m4:  Ditto.
+       * generated/in_unpack_i1.c:  Regenerated.
+       * generated/in_unpack_i2.c:  Regenerated.
+       * generated/in_unpack_i4.c:  Regenerated.
+       * generated/in_unpack_i8.c:  Regenerated.
+       * generated/in_unpack_i16.c: Regenerated.
+       * generated/in_unpack_r4.c:  Regenerated.
+       * generated/in_unpack_r8.c:  Regenerated.
+       * generated/in_unpack_r10.c: Regenerated.
+       * generated/in_unpack_r16.c: Regenerated.
+       * generated/in_unpack_c4.c:  Regenerated.
+       * generated/in_unpack_c8.c:  Regenerated.
+       * generated/in_unpack_c10.c: Regenerated.
+       * generated/in_unpack_c16.c: Regenerated.
+
 2009-01-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libfortran/38772
index 2d971bf..930cfae 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_c10 (gfc_array_c10 * d, const GFC_COMPLEX_10 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index f09b0b4..45927b8 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_c16 (gfc_array_c16 * d, const GFC_COMPLEX_16 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index ed77a70..1a7d707 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_c4 (gfc_array_c4 * d, const GFC_COMPLEX_4 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index e1fada3..5dbfca0 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_c8 (gfc_array_c8 * d, const GFC_COMPLEX_8 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index 0e7ab11..ccaa0d2 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_1 (gfc_array_i1 * d, const GFC_INTEGER_1 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index 3658485..8d0ddf5 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_16 (gfc_array_i16 * d, const GFC_INTEGER_16 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index 246c3f3..cb5048f 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_2 (gfc_array_i2 * d, const GFC_INTEGER_2 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index d0c0f15..1295644 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_4 (gfc_array_i4 * d, const GFC_INTEGER_4 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index 5f2975e..a228ded 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_8 (gfc_array_i8 * d, const GFC_INTEGER_8 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index 66ebe82..5099b9a 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_r10 (gfc_array_r10 * d, const GFC_REAL_10 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index 722dee7..d2e5579 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_r16 (gfc_array_r16 * d, const GFC_REAL_16 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index 65bdb07..2c37459 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_r4 (gfc_array_r4 * d, const GFC_REAL_4 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index 70c11b5..e0e91e9 100644 (file)
@@ -60,12 +60,12 @@ internal_unpack_r8 (gfc_array_r8 * d, const GFC_REAL_8 * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index 5c5b5b1..a2a92d0 100644 (file)
@@ -63,12 +63,12 @@ internal_unpack_'rtype_ccode` ('rtype` * d, const 'rtype_name` * src)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   if (dsize != 0)
index 81d1f04..b15f4dd 100644 (file)
@@ -178,12 +178,12 @@ internal_unpack (gfc_array_char * d, const void * s)
       stride[n] = d->dim[n].stride;
       extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound;
       if (extent[n] <= 0)
-        abort ();
+       return;
 
       if (dsize == stride[n])
-        dsize *= extent[n];
+       dsize *= extent[n];
       else
-        dsize = 0;
+       dsize = 0;
     }
 
   src = s;