f951: internal compiler error // when compiling with preprocessing and an unavail include dir

Tobias Burnus burnus@net-b.de
Tue Mar 19 09:14:00 GMT 2013


Hello Paul,

Paul Kapinos wrote:
> f951: internal compiler error: Aborted
>
> The issue is aligned on using both the preprocessing (indicated by F90 
> instead of f90) and access to an directory which exists but is not 
> permitted to read.

I could reproduce it with GCC 4.8. With the C compiler (i.e. cc1), the 
error is detected:


Breakpoint 1, remove_duplicates (pfile=pfile@entry=0x1618cb0, 
head=0x1623070, system=0x1623190, join=0x1623190, 
verbose=verbose@entry=1) at ../../gcc/incpath.c:246
246     {
(gdb) n
250       for (pcur = &head; *pcur; )
(gdb)
246     {
(gdb)
250       for (pcur = &head; *pcur; )
(gdb)
256           if (stat (cur->name, &st))
(gdb)
259               if (errno != ENOENT)
(gdb)
260                 cpp_errno (pfile, CPP_DL_ERROR, cur->name);
(gdb)
cc1: error: foo/bar: Permission denied

* * *

I am a bit surprised that GCC 4.8/4.9's gfortran also has this problem, 
given that add_path_to_list contains a similar code:

   if (stat (q, &st))
     {
       if (errno != ENOENT)
         gfc_warning_now ("Include directory \"%s\": %s", path,
                          xstrerror(errno));
...
       return;
     }

gfortran: error: mini.F90: No such file or directory


But this error seems to come from the driver (gfortran) and not from the 
the compiler itself (f951).

* * *

On the other hand, also with gfortran (or rather f951), one calls: 
gfc_cpp_register_include_paths -> register_include_chains -> 
merge_include_chains -> remove_duplicates.

Indeed, the problem is not the nonexisting directory, but that
   pfile->cb.error == NULL
cb.error is a function pointer with the prototype:
   bool (*)(cpp_reader *, int, int, source_location, unsigned int, const 
char *, va_list *)

In case of C/C++, that's declared at c-family/c-common.c and used in 
c-opts.c: "cb->error = c_cpp_error;". Seems as if such a function is 
missing.


I will fill a bug report as soon as the web server is working again. 
(There is a big server hardware+OS update ongoing, which started 
yesterday. It seems as if nearly everything is working, except of the 
webserver + Bugzilla.)

Tobias



More information about the Fortran mailing list