gfortran46: Error: Type of argument 'z' in call to 'dimag' at (1) should be COMPLEX(16), not COMPLEX(8)

Anton Shterenlikht mexas at bris.ac.uk
Fri Jul 12 11:05:40 UTC 2013


>From sgk at troutmask.apl.washington.edu Fri Jul 12 07:25:06 2013
>
>You need to look at -fdump-tree-original.
>This produces gcc's intermediate code, and
>may show the promotion.

on ia64 the intermediate code is identical
with and without -fdefault-real-8:

$ cat z.f90
complex*16 :: z
z = (1,2)
write (*,*) dimag(z)
end
$ gfortran46 -fdump-tree-original z.f90
$ mv z.f90.003t.original z1
$ gfortran46 -fdump-tree-original -fdefault-real-8 z.f90
$ diff z.f90.003t.original z1
$ cat z.f90.003t.original
MAIN__ ()
{
  complex(kind=8) z;

  z = __complex__ (1.0e+0, 2.0e+0);
  {
    struct __st_parameter_dt dt_parm.0;

    dt_parm.0.common.filename = &"z.f90"[1]{lb: 1 sz: 1};
    dt_parm.0.common.line = 3;
    dt_parm.0.common.flags = 128;
    dt_parm.0.common.unit = 6;
    _gfortran_st_write (&dt_parm.0);
    {
      real(kind=8) D.719;

      D.719 = IMAGPART_EXPR <z>;
      _gfortran_transfer_real_write (&dt_parm.0, &D.719, 8);
    }
    _gfortran_st_write_done (&dt_parm.0);
  }
}


main (integer(kind=4) argc, character(kind=1) * * argv)
{
  static integer(kind=4) options.1[8] = {68, 511, 0, 0, 0, 1, 0, 1};

  _gfortran_set_args (argc, argv);
  _gfortran_set_options (8, &options.1[0]);
  MAIN__ ();
  return 0;
}


$ 

Anton


More information about the freebsd-fortran mailing list