re PR libfortran/34540 (cshift, eoshift, kind=1 and kind=2 arguments...)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 22 Dec 2007 01:57:07 +0000 (01:57 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 22 Dec 2007 01:57:07 +0000 (01:57 +0000)
2007-12-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/34540
* iresolve.c (gfc_resolve_cshift): Take optional dim path
only if the argument is an optional itself.
* iresolve.c (gfc_resolve_eoshift): Same.

From-SVN: r131133

gcc/fortran/ChangeLog
gcc/fortran/iresolve.c

index f90a0778812188e43cbc5ddbd44733c49bec0123..c67dca5f837ecb62ef82ce03cd97ca875a2693cd 100644 (file)
@@ -1,3 +1,10 @@
+2007-12-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/34540
+       * iresolve.c (gfc_resolve_cshift): Take optional dim path
+       only if the argument is an optional itself.
+       * iresolve.c (gfc_resolve_eoshift): Same.
+
 2007-12-21  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/34438
index a68e42e0affc96de72216d47f02614668c5eb347..cdc4ac176dd750482ec2b7d20f2c028f8593d55c 100644 (file)
@@ -590,7 +590,7 @@ gfc_resolve_cshift (gfc_expr *f, gfc_expr *array, gfc_expr *shift,
  
   if (dim != NULL)
     {
-      if (dim->expr_type != EXPR_CONSTANT)
+      if (dim->expr_type != EXPR_CONSTANT && dim->symtree->n.sym->attr.optional)
        {
          /* Mark this for later setting the type in gfc_conv_missing_dummy.  */
          dim->representation.length = shift->ts.kind;
@@ -728,7 +728,7 @@ gfc_resolve_eoshift (gfc_expr *f, gfc_expr *array, gfc_expr *shift,
  
   if (dim != NULL)
     {
-      if (dim->expr_type != EXPR_CONSTANT)
+      if (dim->expr_type != EXPR_CONSTANT && dim->symtree->n.sym->attr.optional)
        {
          /* Mark this for later setting the type in gfc_conv_missing_dummy.  */
          dim->representation.length = shift->ts.kind;