Bug 21298

Summary: gcc crashes on undef symbol as initialized array size
Product: [Retired] Red Hat Linux Reporter: David Nečas <yeti>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-11-24 13:33:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Nečas 2000-11-24 13:33:43 UTC
gcc crashes when compiling following source

int a[SOME_UNDEFINED_SYMBOL] =

where SOME_UNDEFINED_SYMBOL is some undefined symbol.
(It does not depend on what follows the `=' so nothing is as good as
anything else, gcc never gets there.)

Using an undefined symbol as array size is clearly an error, but it
shouldn't crash the compiler.

gcc version: 2.96-54 from RedHat Linux 7.0, not modified
gcc -v:
  Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
  gcc version 2.96 20000731 (Red Hat Linux 7.0)

Command used to compile (assume the source is called g.c):
  gcc -c g.c

Got:
  g.c:1: `SOME_UNDEFINED_SYMBOL' undeclared here (not in a function)
  g.c:1: Internal error: Segmentation fault.
  Please submit a full bug report.
  See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Nevertheless they state I should report gcc-2.96 bugs to OS vendor.

Comment 1 Jakub Jelinek 2000-11-25 08:20:46 UTC
Fixed since I think gcc-2.96-61, definitely in current gcc-2.96-64.