https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91237

            Bug ID: 91237
           Summary: ICE in gfortran with preprocessor directives
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Melven.Roehrig-Zoellner at DLR dot de
  Target Milestone: ---

I obtain a strange ICE for a very minimalistic piece of preprocessing
directives with gfortran (at least versions 4.8.5, 5.4.0, 8.1.0, 9.1.0 fail,
some tested on Ubuntu 16.04 and some on a SLED system):

Steps to reproduce:

> cat example.F90 
#ifndef ELEM
#   define ELEM 'Z'
#endif
#if ELEM == 'D'
#   define ELEM_TYPE real(kind=DT_ELEM_KIND)
#elif ELEM == 'Z'
#   define ELEM_TYPE complex(kind=ZT_ELEM_KIND)
#endif

> gfortran --version
GNU Fortran (GCC) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

> gfortran -c example.F90 
<built-in>: internal compiler error: Segmentation fault
0xb0e154 crash_signal
        /tools/modulesystem/tools/gcc/gcc-9.1.0/src/gcc/toplev.c:326
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to