OSDN Git Service

* interface.c (fold_unary): Rename to...
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Jun 2009 06:42:49 +0000 (06:42 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Jun 2009 06:42:49 +0000 (06:42 +0000)
(fold_unary_intrinsic): ... this.
(gfc_extend_expr): Adjust caller.
(gfc_match_generic_spec): Likewise.  Initialize *op to INTRINSIC_NONE
to avoid warnings.
* expr.c (gfc_simplify_expr): Initialize start and end before calling
gfc_extract_int.

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

gcc/fortran/ChangeLog
gcc/fortran/expr.c
gcc/fortran/interface.c

index cb53120..68ad797 100644 (file)
@@ -1,3 +1,13 @@
+2009-06-11  Jakub Jelinek  <jakub@redhat.com>
+
+       * interface.c (fold_unary): Rename to...
+       (fold_unary_intrinsic): ... this.
+       (gfc_extend_expr): Adjust caller.
+       (gfc_match_generic_spec): Likewise.  Initialize *op to INTRINSIC_NONE
+       to avoid warnings.
+       * expr.c (gfc_simplify_expr): Initialize start and end before calling
+       gfc_extract_int.
+
 2009-06-10  Dave Korn  <dave.korn.cygwin@gmail.com>
 
        * trans-decl.c (create_main_function):  Don't build main decl twice.
index f76c35e..9342719 100644 (file)
@@ -1654,18 +1654,16 @@ gfc_simplify_expr (gfc_expr *p, int type)
          gfc_char_t *s;
          int start, end;
 
+         start = 0;
          if (p->ref && p->ref->u.ss.start)
            {
              gfc_extract_int (p->ref->u.ss.start, &start);
              start--;  /* Convert from one-based to zero-based.  */
            }
-         else
-           start = 0;
 
+         end = p->value.character.length;
          if (p->ref && p->ref->u.ss.end)
            gfc_extract_int (p->ref->u.ss.end, &end);
-         else
-           end = p->value.character.length;
 
          s = gfc_get_wide_string (end - start + 2);
          memcpy (s, p->value.character.string + start,
index 48c026c..6cd34fa 100644 (file)
@@ -95,7 +95,7 @@ gfc_free_interface (gfc_interface *intr)
    minus respectively, leaving the rest unchanged.  */
 
 static gfc_intrinsic_op
-fold_unary (gfc_intrinsic_op op)
+fold_unary_intrinsic (gfc_intrinsic_op op)
 {
   switch (op)
     {
@@ -136,10 +136,11 @@ gfc_match_generic_spec (interface_type *type,
   if (gfc_match (" operator ( %o )", &i) == MATCH_YES)
     {                          /* Operator i/f */
       *type = INTERFACE_INTRINSIC_OP;
-      *op = fold_unary (i);
+      *op = fold_unary_intrinsic (i);
       return MATCH_YES;
     }
 
+  *op = INTRINSIC_NONE;
   if (gfc_match (" operator ( ") == MATCH_YES)
     {
       m = gfc_match_defined_op_name (buffer, 1);
@@ -2482,7 +2483,7 @@ gfc_extend_expr (gfc_expr *e)
       actual->next->expr = e->value.op.op2;
     }
 
-  i = fold_unary (e->value.op.op);
+  i = fold_unary_intrinsic (e->value.op.op);
 
   if (i == INTRINSIC_USER)
     {