------- Comment #2 from paul dot richard dot thomas at cea dot fr  2006-01-25 
14:52 -------
The code is really crazy for this example. Please note that I have Jakub's
nongomp type patch in place.  This bug is independent of the completeness of
the types, however.

The problem is that the character length of the DUMMY argument is somehow being
referenced in the main program.  This aberrant behaviour is somehow associated
with the IO transfer.

MAIN__ ()
{
  char a[2][1:4];
  static void fun (struct array1_int4 &, struct array1_unknown &, int4);

  {
    struct __st_parameter_dt dt_parm.8;

    dt_parm.8.common.filename = "pr24557.f90";
    dt_parm.8.common.line = 5;
    dt_parm.8.common.unit = 6;
    dt_parm.8.common.flags = 128;
    _gfortran_st_write (&dt_parm.8);
    {
      void * D.840;
      int4 D.839;
      struct array1_int4 atmp.12;
      int4 D.837;
      int4 D.836;
      int4 D.835;
      struct array1_unknown parm.11;
      int4 D.833;
      int4 D.832;
      char[0:][1:_arg] * parm.10;      /******Here******/
      struct array1_unknown * D.830;
      struct array1_unknown parm.9;

      parm.9.dtype = 305;
      parm.9.dim[0].lbound = 1;
      parm.9.dim[0].ubound = 2;
      parm.9.dim[0].stride = 1;
      parm.9.data = (void *) (char[0:][1:4] *) &a[0];
      parm.9.offset = 0;
      D.830 = &parm.9;
      parm.10 = (char[0:][1:_arg] *) (char[0:][1:4] *) D.830->data; /*Here*/
      D.832 = D.830->dim[0].ubound - D.830->dim[0].lbound + 1;
      D.833 = -D.830->dim[0].stride;
      parm.11.dtype = ((<unnamed type>) _arg << 6) + 49;    /***and here***/
      D.835 = D.830->dim[0].stride;
      parm.11.dim[0].lbound = 1;
      parm.11.dim[0].ubound = D.832;
      parm.11.dim[0].stride = NON_LVALUE_EXPR <D.835>;
      parm.11.data = (void *) (char[0:][1:_arg] *) &(*parm.10)[0];  /*here*/
      parm.11.offset = 0;
      D.836 = _gfortran_size0 (&parm.11);
      D.837 = D.836 - 1;
      atmp.12.dtype = 265;
      atmp.12.dim[0].stride = 1;
      atmp.12.dim[0].lbound = 0;
      atmp.12.dim[0].ubound = NON_LVALUE_EXPR <D.837>;
      D.839 = NON_LVALUE_EXPR <D.837> + 1;
      D.840 = _gfortran_internal_malloc (D.839 * 4);
      atmp.12.data = D.840;
      atmp.12.offset = 0;
      atmp.12.dim[0].stride = 0;
      fun (&atmp.12, D.830, 4);        /* After the call, all is well.*/

Paul


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24557

Reply via email to