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]

g77 asserts with long sequences of elseif's



Program: g77 (compiled as part of the gcc 2.95.2 package)

Bug description: The g77 compiler asserts when encountering long strings
of elseif's.
The output from the compiler is:

$ g77 -c test.f
../../../gcc-2.95.2/gcc/f/stw.c:308: failed assertion `b->uses_ > 0'
g77: Internal compiler error: program f771 got fatal signal 6


System: K6-III 400 PC running linux kernel 2.4.0-test5 compiled for K6,
160Mb

Included in this message: Version info, gdb output, test program.

Note: The program in which this bug was discovered had compiled with
egcs-1.1.

Sincerely,
Jason Maddi
(jamaddi@lbl.gov)

################## Begin Version Information
#########################################
$ g77 -v
g77 version 2.95.2 19991024 (release) (from FSF-g77 version 0.5.25
19991024 (release))
Driving: g77 -v -c -xf77-version /dev/null -xnone
Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs

gcc version 2.95.2 19991024 (release)
 /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/cpp -lang-c -v
-D__GNUC__=2 -D__GNUC_MINOR__=95 -D__ELF__ -D__unix__ -D__i386__
-D__linux__ -D__unix -D__linux -Asystem(posix) -D_LANGUAGE_FORTRAN
-traditional -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__
-Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__ /dev/null

/dev/null
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/../../../../i586-pc-linux-gnu/include

 /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search
path:
 /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/../../../../include/g++-3

End of omitted list.
 /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/f771 -fnull-version
-quiet -dumpbase g77-version.f -version -fversion -o /tmp/ccJSBRDc.s
/dev/null
GNU F77 version 2.95.2 19991024 (release) (i586-pc-linux-gnu) compiled
by GNU C version 2.95.2 19991024 (release).
GNU Fortran Front End version 0.5.25 19991024 (release)
 as -V -Qy -o /tmp/ccCjPiFg.o /tmp/ccJSBRDc.s
GNU assembler version 2.9.5 (i386-redhat-linux) using BFD version
2.9.5.0.22
 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o /tmp/ccBXTkhm
/tmp/ccCjPiFg.o /usr/lib/crt1.o /usr/lib/crti.o
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/crtbegin.o
-L/usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2 -L/usr/local/lib -lg2c

-lm -lgcc -lc -lgcc
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/crtend.o /usr/lib/crtn.o

 /tmp/ccBXTkhm
__G77_LIBF77_VERSION__: 0.5.25 19991024 (release)
@(#)LIBF77 VERSION 19990503
__G77_LIBI77_VERSION__: 0.5.25 19991024 (release)
@(#) LIBI77 VERSION pjw,dmg-mods 19990503
__G77_LIBU77_VERSION__: 0.5.25 19991024 (release)
@(#) LIBU77 VERSION 19980709

########### End Version info ##################################

########### Begin gdb output #################################



The backtrace from gdb:

#0  0x40038d41 in __kill () from /lib/libc.so.6
#1  0x400389b6 in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x4003a0d8 in abort () at ../sysdeps/generic/abort.c:88
#3  0x81ece58 in Letext ()
#4  0x80b75f0 in ffestw_kill (b=0x828a788) at
../../../gcc-2.95.2/gcc/f/stw.c:308
#5  0x809c487 in ffestc_shriek_ifthen_ (ok=true) at
../../../gcc-2.95.2/gcc/f/stc.c:4816
#6  0x809f8a4 in ffestc_R806 (name=0x0) at
../../../gcc-2.95.2/gcc/f/stc.c:9014
#7  0x8087fe1 in ffestb_end3_ (t=0x828d460) at
../../../gcc-2.95.2/gcc/f/stb.c:3230
#8  0x8087df8 in ffestb_endxyz (t=0x828d460) at
../../../gcc-2.95.2/gcc/f/stb.c:3114
#9  0x8084cbe in ffesta_second_ (t=0x828d460) at
../../../gcc-2.95.2/gcc/f/sta.c:1359
#10 0x807fe2b in ffelex_send_token_ () at
../../../gcc-2.95.2/gcc/f/lex.c:1694
#11 0x807f038 in ffelex_finish_statement_ () at
../../../gcc-2.95.2/gcc/f/lex.c:973
#12 0x80806dd in ffelex_file_fixed (wf=0x82899e8, f=0x8277bd8) at
../../../gcc-2.95.2/gcc/f/lex.c:2326
#13 0x80be9af in ffe_file (wf=0x82899e8, f=0x8277bd8) at
../../../gcc-2.95.2/gcc/f/top.c:546
#14 0x8083468 in yyparse () at ../../../gcc-2.95.2/gcc/f/parse.c:79
#15 0x80c16a1 in compile_file (name=0xbffffadd "test.f") at
../../gcc-2.95.2/gcc/toplev.c:3265
#16 0x80c496a in main (argc=7, argv=0xbffff974) at
../../gcc-2.95.2/gcc/toplev.c:5440

A few bits from gdb that I was able to find:

(gdb) select-frame 4
(gdb) print b->uses_
$1 = 11 '\013'
(gdb) select-frame 12
(gdb) print ffelex_linecount_current_
$2 = 138
(gdb) print ffelex_card_image_
$3 = 0x8289a48 "        end"
(gdb)

########### End gdb output #################################

########### Begin test program #################################

        program abc


        integer a
        a=0

        if (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        elseif (a.eq.0) then
        endif

        end

########### End test program #################################


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