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

Paul Kapinos kapinos@itc.rwth-aachen.de
Mon May 2 15:51:00 GMT 2016


Dear Tobias,

did you remember about my report 3 years ago? see below or
https://gcc.gnu.org/ml/fortran/2013-03/msg00083.html

Well, the ICE is still here in /6.1.0 after 3 years..

Another issue:
'-Wno-missing-include-dirs' and '-Wmissing-include-dirs'  - see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55534

so current behaviour is:

 > $ gfortran -I/no/such/dir -Wno-missing-include-dirs acumem_testprogramm.f90
 > f951: Warning: Nonexistent include directory '/no/such/dir'
 >     [-Wmissing-include-dirs]

which is rather puzzling, as on other side you cannot use 
'-Wno-missing-include-dirs' (it is not an gfortran option neither  described in 
the 'man gfortran') but in other side the warning tell about 
'-Wmissing-include-dirs' be active...

Maybe there is another way as '-Wno-missing-include-dirs' for fortran programs?

Best

Paul Kapinos


------------------------------------------------------------------------------
f951: Warning: Include directory './foo/bar': Permission denied
f951: internal compiler error: in cpp_diagnostic, at libcpp/errors.c:59
0x10d39b7 cpp_diagnostic
         ../../../SOURCES/gcc-6.1.0/libcpp/errors.c:59
0x10d3ae6 cpp_error(cpp_reader*, int, char const*, ...)
         ../../../SOURCES/gcc-6.1.0/libcpp/errors.c:76
0x8b7891 remove_duplicates
         ../../../SOURCES/gcc-6.1.0/gcc/incpath.c:258
0x8b7e3f merge_include_chains
         ../../../SOURCES/gcc-6.1.0/gcc/incpath.c:360
0x8b7e3f register_include_chains(cpp_reader*, char const*, char const*, char 
const*, int, int, int)
         ../../../SOURCES/gcc-6.1.0/gcc/incpath.c:486
0x5ddb55 gfc_cpp_register_include_paths()
         ../../../SOURCES/gcc-6.1.0/gcc/fortran/cpp.c:703
0x638da4 gfc_post_options(char const**)
         ../../../SOURCES/gcc-6.1.0/gcc/fortran/options.c:390
0x5c296b process_options
         ../../../SOURCES/gcc-6.1.0/gcc/toplev.c:1217
0x5c296b do_compile
         ../../../SOURCES/gcc-6.1.0/gcc/toplev.c:1942
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
------------------------------------------------------------------------------




On 03/19/13 09:57, Tobias Burnus wrote:
> 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
>
>


-- 
Dipl.-Inform. Paul Kapinos   -   High Performance Computing,
RWTH Aachen University, IT Center
Seffenter Weg 23,  D 52074  Aachen (Germany)
Tel: +49 241/80-24915

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4891 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160502/08e08153/attachment.p7s>


More information about the Fortran mailing list