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]

Re: [Fortran-Experiments]: regressions


Hi Chris,

Christopher D. Rickett wrote:
> i'll look into this. i remember having had problems like this before,
> but they were fixed when i handled is_c_interop in gfc_clear_ts ().
> i'll see why this isn't applied to internal symbols.
Have a look at the following patch. It fixes it for me. In two cases I'm
not sure whether it is needed/correct, but the rest should be ok.

Tobias
Index: decl.c
===================================================================
*** decl.c	(Revision 123065)
--- decl.c	(Arbeitskopie)
*************** variable_decl (int elem)
*** 1386,1391 ****
--- 1386,1393 ----
  	  sym->ts.kind = current_ts.kind;
  	  sym->ts.cl = cl;
  	  sym->ts.derived = current_ts.derived;
+ 	  sym->ts.is_c_interop = current_ts.is_c_interop;
+ 	  sym->ts.is_iso_c = current_ts.is_iso_c;
  	  m = MATCH_YES;
  	
  	  /* Check to see if we have an array specification.  */
*************** match_type_spec (gfc_typespec *ts, int i
*** 2006,2011 ****
--- 2008,2015 ----
    ts->type = BT_DERIVED;
    ts->kind = 0;
    ts->derived = sym;
+   ts->is_iso_c = 0;
+   ts->is_c_interop = 0;
  
    return MATCH_YES;
  
Index: data.c
===================================================================
*** data.c	(Revision 123065)
--- data.c	(Arbeitskopie)
*************** gfc_assign_data_value (gfc_expr *lvalue,
*** 336,341 ****
--- 336,343 ----
  	      expr->expr_type = EXPR_STRUCTURE;
  	      expr->ts.type = BT_DERIVED;
  	      expr->ts.derived = ref->u.c.sym;
+ 	      expr->ts.is_iso_c = 0; /* Is this needed/correct? */
+ 	      expr->ts.is_c_interop = 0;
  	    }
  	  else
  	    gcc_assert (expr->expr_type == EXPR_STRUCTURE);
*************** gfc_assign_data_value_range (gfc_expr *l
*** 525,530 ****
--- 527,534 ----
  	      expr->expr_type = EXPR_STRUCTURE;
  	      expr->ts.type = BT_DERIVED;
  	      expr->ts.derived = ref->u.c.sym;
+ 	      expr->ts.is_iso_c = 0; /* Is this needed/correct? */
+ 	      expr->ts.is_c_interop = 0;
  	    }
  	  else
  	    gcc_assert (expr->expr_type == EXPR_STRUCTURE);
Index: primary.c
===================================================================
*** primary.c	(Revision 123065)
--- primary.c	(Arbeitskopie)
*************** got_delim:
*** 971,976 ****
--- 971,978 ----
    e->ref = NULL;
    e->ts.type = BT_CHARACTER;
    e->ts.kind = kind;
+   e->ts.is_c_interop = 0;
+   e->ts.is_iso_c = 0;
    e->where = start_locus;
  
    e->value.character.string = p = gfc_getmem (length + 1);
*************** match_logical_constant (gfc_expr **resul
*** 1042,1047 ****
--- 1044,1051 ----
    e->value.logical = i;
    e->ts.type = BT_LOGICAL;
    e->ts.kind = kind;
+   e->ts.is_c_interop = 0;
+   e->ts.is_iso_c = 0;
    e->where = gfc_current_locus;
  
    *result = e;
*************** match_complex_constant (gfc_expr **resul
*** 1226,1231 ****
--- 1230,1237 ----
      }
    target.type = BT_REAL;
    target.kind = kind;
+   target.is_c_interop = 0;
+   target.is_iso_c = 0;
  
    if (real->ts.type != BT_REAL || kind != real->ts.kind)
      gfc_convert_type (real, &target, 2);

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