This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/13464] -i8 and -r8 not passed correctly to compiler proper. and -d8 does not work
- From: "sgk at troutmask dot apl dot washington dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Mar 2005 23:52:16 -0000
- Subject: [Bug driver/13464] -i8 and -r8 not passed correctly to compiler proper. and -d8 does not work
- References: <20031222115039.13464.toon@moene.indiv.nluug.nl>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From sgk at troutmask dot apl dot washington dot edu 2005-03-08 23:52 -------
The gfortran frontend defines the two options -i8 and -r8 in gfortran/lang.opt.
gcc/opts.sh appears to process lang.opt without a problem, because the produced
options.h file contains OPT_i8 and OPT_r8. However, neither -i8 nor -r8 is
passed to gfc_handle_option, which is defined to LANG_HOOKS_HANDLE_OPTION
in f95-lang.c.
I have added some debugging printfs to gfc_handle_option
int
gfc_handle_option (size_t scode, const char *arg, int value)
{
int result = 1;
enum opt_code code = (enum opt_code) scode;
printf("code = %d ", code);
if (arg != NULL) printf("arg = %s ", arg);
printf("value = %d\n", value);
The execution of gfortran shows that gfc_handle_option is
never called if -i8 or -r8 is specified.
troutmask:sgk[307] gfc41 -static -o kl -d8 kl.f90
code = 138 value = 1
troutmask:sgk[308] gfc41 -static -o kl -r8 kl.f90
gfc41: unrecognized option '-r8'
troutmask:sgk[309] gfc41 -static -o kl -i8 kl.f90
Note, -d8 is OPT_d8 in options.h and it is passed to gfc_handle_option.
So, it appears that some magic parsing of command line arguments occurs
before gfc_handle_option is called. Is there someway to inhibit this
magic??
BTW, I have a patch that actually makes -d8 work.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13464