Bug 27457 - ICE in match_case_eos()
Summary: ICE in match_case_eos()
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: unknown
: P3 normal
Target Milestone: 4.2.0
Assignee: Tobias Schlüter
URL:
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks: 19292
  Show dependency treegraph
 
Reported: 2006-05-06 15:58 UTC by Bernhard Reutner-Fischer
Modified: 2006-05-07 13:47 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-05-06 16:01:10


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Reutner-Fischer 2006-05-06 15:58:22 UTC
$ cat ICE_match_case_eos_1.f
! { dg-do compile }
! { dg-options "-std=gnu" }
! PR fortran
        implicit none
        integer(kind=1) :: i
        real :: r(3)
        select case (i)
        case (129) r(4) = 0
        end select
        end
(gdb) set args ICE_match_case_eos_1.f -ffixed-form -quiet -dumpbase
ICE_match_case_eos_1.f -mtune=generic -auxbase ICE_match_case_eos_1
-version -I /opt/gcc-4.2/bin/../lib/gcc/i686-linux-gnu/4.2.0/finclude -o
/tmp/ccO1JXYy.s
(gdb) run
Starting program: /opt/gcc-4.2/lib/gcc/i686-linux-gnu/4.2.0/f951
ICE_match_case_eos_1.f -ffixed-form -quiet -dumpbase
ICE_match_case_eos_1.f -mtune=generic -auxbase ICE_match_case_eos_1
-version -I /opt/gcc-4.2/bin/../lib/gcc/i686-linux-gnu/4.2.0/finclude -o
/tmp/ccO1JXYy.s
GNU F95 version 4.2.0 20060424 (experimental) (i686-linux-gnu)
        compiled by GNU C version 4.2.0 20060424 (experimental).
GGC heuristics: --param ggc-min-expand=94 --param
ggc-min-heapsize=121309

Program received signal SIGSEGV, Segmentation fault.
0x08077988 in match_case_eos () at
../../../src/gcc-4.2/gcc/fortran/match.c:3033
3033    ../../../src/gcc-4.2/gcc/fortran/match.c: No such file or
directory.
        in ../../../src/gcc-4.2/gcc/fortran/match.c
(gdb) bt
#0  0x08077988 in match_case_eos () at
../../../src/gcc-4.2/gcc/fortran/match.c:3033
#1  0x0807896c in gfc_match_case () at
../../../src/gcc-4.2/gcc/fortran/match.c:3119
#2  0x080830da in match_word (str=0x0, subr=0x80787a0 <gfc_match_case>,
old_locus=0xbfc33a88) at ../../../src/gcc-4.2/gcc/fortran/parse.c:65
#3  0x08083c7a in decode_statement () at
../../../src/gcc-4.2/gcc/fortran/parse.c:192
#4  0x08083ff8 in next_statement () at
../../../src/gcc-4.2/gcc/fortran/parse.c:476
#5  0x08085290 in parse_executable (st=<value optimized out>) at
../../../src/gcc-4.2/gcc/fortran/parse.c:2116
#6  0x08086177 in parse_progunit (st=ST_ARITHMETIC_IF) at
../../../src/gcc-4.2/gcc/fortran/parse.c:2866
#7  0x08086621 in gfc_parse_file () at
../../../src/gcc-4.2/gcc/fortran/parse.c:3182
#8  0x080a5e3d in gfc_be_parse_file (set_yydebug=0) at
../../../src/gcc-4.2/gcc/fortran/f95-lang.c:301
#9  0x082fb06a in toplev_main (argc=14, argv=0xbfc33ca4) at
../../../src/gcc-4.2/gcc/toplev.c:999
#10 0x080ce736 in main (argc=Cannot access memory at address 0x0
) at ../../../src/gcc-4.2/gcc/main.c:35
Comment 1 Tobias Schlüter 2006-05-06 16:01:10 UTC
Mine.  I'm currently testing a patch
Comment 2 Bernhard Reutner-Fischer 2006-05-06 16:02:14 UTC
Known to work: g77-3.4
Known to fail: gfortran >= 4.0
Comment 3 Tobias Schlüter 2006-05-07 13:46:09 UTC
Subject: Bug 27457

Author: tobi
Date: Sun May  7 13:46:02 2006
New Revision: 113602

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113602
Log:
fortran/
PR fortran/27457
* match.c (match_case_eos): Error out on garbage following
CASE(...).
testsuite/
PR fortran/27457
* gfortran.dg/select_6.f90: New.

Added:
    trunk/gcc/testsuite/gfortran.dg/select_6.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/match.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Tobias Schlüter 2006-05-07 13:47:14 UTC
Fixed.