I'm looking to the broken behavior of gfortran with its
-r8, -i8, and -d8 options.  gfortran/lang.opt contains


d8
F95 RejectNegative
Set the default real and integer kinds to double precision

i8
F95
Set the default integer kind to double precision

r8
F95
Set the default real kind to double precision


I have modified gfortran/options.c as follows:

    case OPT_i8:
      gfc_option.i8 = value;
      printf("i8 = %d\n", gfc_option.i8);
      break;

    case OPT_r8:
      gfc_option.r8 = value;
      printf("r8 = %d\n", gfc_option.r8);
      break;

    case OPT_d8:
      gfc_option.i8 = value;
      gfc_option.r8 = value;
      printf("i8 = %d\n", gfc_option.i8);
      printf("r8 = %d\n", gfc_option.r8);
      break;

I now process a test file:

kargl[216] cat hy.f90
program hy
   real x
   integer i
   x = 1.e0
   i = 2
   print *, x
   print *, i
end program hy
kargl[217] gfc41 -static -o z -d8 hy.f90
i8 = 0
r8 = 0
i8 = 1
r8 = 1
kargl[218] ./z
   1.00000000000000     
                    2
kargl[219] gfc41 -static -o z -i8 hy.f90
i8 = 0
r8 = 0
kargl[220] ./z
   1.000000    
           2
kargl[221] gfc41 -static -o z -r8 hy.f90
gfc41: unrecognized option '-r8'
i8 = 0
r8 = 0
kargl[222] ./z
   1.000000    
           2
kargl[223] gfc41 -static -o z hy.f90
i8 = 0
r8 = 0

So, -d8 works as expected, but -i8 and -r8 are completely ignored
by gfortran.  It appears that the processing of lang.opt is 
broken.  Any insight into the broken nature of processing would
be appreciate.

-- 
Steve

Reply via email to