Bug 21298 - gcc crashes on undef symbol as initialized array size
Summary: gcc crashes on undef symbol as initialized array size
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-11-24 13:33 UTC by David Nečas
Modified: 2007-04-18 16:30 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-11-24 13:33:46 UTC
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.