This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fallout from -fdefault-integer-8


Well, I determined the nature of the problems found
by Dominique with spacing() and rrspacing().  Unfortunately,
the problem may be propagated to many runtime library
routines.  Specificly, for rrspacing() we need

@@ -1742,6 +1742,13 @@
   prec = gfc_get_actual_arglist ();
   prec->name = "p";
   prec->expr = gfc_int_expr (gfc_real_kinds[k].digits);
+  if (prec->expr->ts.kind != 4)
+    {
+      gfc_typespec ts;
+      ts.type = BT_INTEGER;
+      ts.kind = 4;
+      gfc_convert_type (prec->expr, &ts, 2);
+    }
   f->value.function.actual->next = prec;
 }

Well, it just so happens that gfc_resolve_scale() is nearby and
I noticed

  /* The implementation calls scalbn which takes an int as the
     second argument.  */
  if (i->ts.kind != gfc_c_int_kind)
    {
      gfc_typespec ts;
      ts.type = BT_INTEGER;
      ts.kind = gfc_default_integer_kind;
      gfc_convert_type_warn (i, &ts, 2, 0);
    }

In the context of -fdefault-integer-8, the above is a bug.  I
think we'll need to audit all uses of 

      ts.kind = gfc_default_integer_kind;

to determine if it is used correctly.

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]