Bug 10981 - ICE with undeclared variable in any_external_decl at c-decl.c:1553
Summary: ICE with undeclared variable in any_external_decl at c-decl.c:1553
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.4.0
: P2 critical
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2003-05-26 12:08 UTC by Christian Ehrhardt
Modified: 2003-05-26 15:27 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Ehrhardt 2003-05-26 12:08:23 UTC
This piece of legal code gives an ICE with 3.4. This is a regression from 3.3:
--------- cut --------
int x = y ;
int y ;
--------- cut --------
reduce.3797.out:1: error: `y' undeclared here (not in a function)
reduce.3797.out:2: internal compiler error: tree check: expected class 'd', have 'x' (error_mark) in any_external_decl, at c-decl.c:1553
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Andrew Pinski 2003-05-26 14:52:19 UTC
I cannot reproduce this on 3.4, could give the exact compiler version meaning date also.
I am using 3.4 (20030526).


tin:~/src/gnu/gcctest>gcc r10981.c 
r10981.c:2: error: `y' undeclared here (not in a function)
tin:~/src/gnu/gcctest>g++ r10981.c
r10981.c:2: error: `y' was not declared in this scope
tin:~/src/gnu/gcctest>gcc -v
Reading specs from /home/gates/pinskia/linux/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: /home/gates/pinskia/src/gnu/gcc/src/configure --target=i686-pc-linux-
gnu --enable-__cxa_atexit --prefix=/home/gates/pinskia/linux --enable-threads=posix --
enable-shared
Thread model: posix
gcc version 3.4 20030526 (ex
perimental)
tin:~/src/gnu/gcctest>
Comment 2 Christian Ehrhardt 2003-05-26 15:27:38 UTC
I used 20030519, but I can confirm that this is already fixerd in
today's CVS.