This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29067] Internal Error: gfc_resolve_expr(): Bad expression type



------- Comment #8 from fxcoudert at gcc dot gnu dot org  2006-10-13 07:38 -------
(In reply to comment #3)
> Can you upgrade and confirm that the code compiles?

No, Steve, it doesn't work for me either on i686-linux. I downloaded the code
from comment #2 (and to answer Paul: it doesn't contain any tab), and it fails
to compile with

$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /home/fxcoudert/gfortran_nightbuild/trunk/configure
--prefix=/home/fxcoudert/gfortran_nightbuild/irun-20061012
--enable-languages=c,fortran
--with-gmp=/home/fxcoudert/gfortran_nightbuild/software
Thread model: posix
gcc version 4.2.0 20061012 (experimental)
$ gfortran -c ircmva.f 
 In file ircmva.f:91

      END                                                               
                                                                       1
 Internal Error at (1):
 gfc_resolve_expr(): Bad expression type

while the same file compiles fine on x86_64-unknown-linux-gnu. The backtrace of
the ICE is:

Breakpoint 2, gfc_internal_error (
    format=0x85d2f48 "gfc_resolve_expr(): Bad expression type")
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/error.c:667
667     /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/error.c: No such
file or directory.
        in /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/error.c
(gdb) where
#0  gfc_internal_error (
    format=0x85d2f48 "gfc_resolve_expr(): Bad expression type")
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/error.c:667
#1  0x0808e082 in gfc_resolve_expr (e=0x9407790)
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/resolve.c:3107
#2  0x0809162b in resolve_code (code=0x9407588, ns=0x94013a8)
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/resolve.c:4864
#3  0x08093edd in gfc_resolve_blocks (b=0x9407548, ns=0x94013a8)
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/resolve.c:4796
#4  0x080915fa in resolve_code (code=0x9407678, ns=0x94013a8)
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/resolve.c:4853
#5  0x08093edd in gfc_resolve_blocks (b=0x94062f8, ns=0x94013a8)
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/resolve.c:4796
#6  0x080915fa in resolve_code (code=0x9404c68, ns=0x94013a8)
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/resolve.c:4853
#7  0x08092e83 in gfc_resolve (ns=0x94013a8)
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/resolve.c:6919
#8  0x08087d39 in gfc_parse_file ()
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/parse.c:3212
#9  0x080a928d in gfc_be_parse_file (set_yydebug=0)
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/fortran/f95-lang.c:303
#10 0x083a6dc5 in toplev_main (argc=14, argv=0xbfc6ba64)
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/toplev.c:1033
#11 0x080de53f in main (argc=2, argv=0x0)
    at /home/fxcoudert/gfortran_nightbuild/trunk/gcc/main.c:35

gfc_internal_error is called in resolve.c because, in gfc_resolve_expr,
argument e has value:

(gdb) p *e
$2 = {expr_type = 0, ts = {type = BT_INTEGER, kind = 4, derived = 0x0, 
    cl = 0x0}, rank = 0, shape = 0x0, symtree = 0x96ae868, ref = 0x96d77e8, 
  where = {nextc = 0x96cc62b "NUMCMP(NRCMP)", ' ' <repeats 40 times>, 
    lb = 0x96cc608}, from_H = 0, inline_noncopying_intrinsic = 0, value = {
    logical = 0, integer = {{_mp_alloc = 0, _mp_size = 0, _mp_d = 0x0}}, 
    real = {{_mpfr_prec = 0, _mpfr_sign = 0, _mpfr_exp = 0, _mpfr_d = 0x0}}, 
    complex = {r = {{_mpfr_prec = 0, _mpfr_sign = 0, _mpfr_exp = 0, 
          _mpfr_d = 0x0}}, i = {{_mpfr_prec = 0, _mpfr_sign = 0, 
          _mpfr_exp = 0, _mpfr_d = 0x0}}}, op = {
      operator = GFC_INTRINSIC_BEGIN, uop = 0x0, op1 = 0x0, op2 = 0x0}, 
    function = {actual = 0x0, name = 0x0, isym = 0x0, esym = 0x0}, 
    character = {length = 0, string = 0x0}, constructor = 0x0}}

It has expr_type = 0, which should not happen. This happens for symbol numcmp:

(gdb) p *e->symtree
$3 = {priority = 15818, left = 0x0, right = 0x0, name = 0x96d07cd "numcmp", 
  ambiguous = 0, n = {sym = 0x96d20b8, uop = 0x96d20b8, common = 0x96d20b8}}
(gdb) p *e->symtree->n.sym
$4 = {name = 0x96d07cd "numcmp", module = 0x0, declared_at = {
    nextc = 0x96b1f20 ", NCMPVE, NCMPRF,", ' ' <repeats 23 times>, 
    lb = 0x96b1ef0}, ts = {type = BT_INTEGER, kind = 4, derived = 0x0, 
    cl = 0x0}, attr = {allocatable = 0, dimension = 1, external = 0, 
    intrinsic = 0, optional = 0, pointer = 0, save = 0, target = 0, dummy = 1, 
    result = 0, assign = 0, threadprivate = 0, data = 0, use_assoc = 0, 
    in_namelist = 0, in_common = 0, in_equivalence = 0, function = 0, 
    subroutine = 0, generic = 0, implicit_type = 0, untyped = 0, sequence = 0, 
    elemental = 0, pure = 0, recursive = 0, unmaskable = 0, masked = 0, 
    contained = 0, noreturn = 0, entry = 0, entry_master = 0, 
    mixed_entry_master = 0, always_explicit = 0, referenced = 1, 
    is_main_program = 0, access = ACCESS_UNKNOWN, intent = INTENT_UNKNOWN, 
    flavor = FL_VARIABLE, if_source = IFSRC_UNKNOWN, proc = PROC_UNKNOWN, 
    cray_pointer = 0, cray_pointee = 0, alloc_comp = 0}, generic = 0x0, 
  component_access = ACCESS_UNKNOWN, formal = 0x0, formal_ns = 0x0, 
  value = 0x0, as = 0x96d2850, result = 0x0, components = 0x0, 
  cp_pointer = 0x0, common_next = 0x0, common_head = 0x0, dummy_order = 8, 
  entry_id = 0, namelist = 0x0, namelist_tail = 0x0, old_symbol = 0x0, 
  tlink = 0x0, mark = 1, new = 0, equiv_built = 0, forall_index = 0, refs = 1, 
  ns = 0x96d13a8, backend_decl = 0x0}


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org
   GCC host triplet|debian testing              |
           Keywords|                            |ice-on-valid-code


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29067


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]