Bug 3581 - large string causes Segmentation Fault in cc1
Summary: large string causes Segmentation Fault in cc1
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.0
: P3 normal
Target Milestone: ---
Assignee: Richard Henderson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-07-05 17:06 UTC by ocie
Modified: 2003-10-07 03:32 UTC (History)
3 users (show)

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


Attachments
crashtest.c.gz (2.16 KB, application/x-gzip )
2003-05-21 15:16 UTC, ocie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ocie 2001-07-05 17:06:09 UTC
The example code has a large string composed by 
concatenating many smaller strings.  Earlier versions of gcc
(2.95) were able to compile this, but gcc 3.0 gives the
following error message:

% gcc -c -Wall crashtest.c -o crashtest.o
gcc: Internal error: Segmentation Fault (program cc1)
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

I have attached a copy of crashtest.c.  Note that this takes
a long time to compile.

Release:
gcc version 3.0

Environment:
Sparc Solaris 2.8

How-To-Repeat:
gcc -c -Wall crashtest.c -o crashtest.o
Comment 1 rocky 2001-07-06 15:09:57 UTC
From: "Rocky S. Lee" <rocky@chinaren-inc.com>
To: <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: c/3581: large string causes Segmentation Fault in cc1
Date: Fri, 6 Jul 2001 15:09:57 +0800

 faint.....
 
 Sooooo large attachment..
 
 

Comment 2 rocky 2001-07-06 15:10:33 UTC
From: "Rocky S. Lee" <rocky@gnuchina.org>
To: <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: c/3581: large string causes Segmentation Fault in cc1
Date: Fri, 6 Jul 2001 15:10:33 +0800

 faint.....
 
 Sooooo large attachment..
 
 
 
 
Comment 3 Richard Henderson 2002-04-25 21:02:16 UTC
Responsible-Changed-From-To: unassigned->rth
Responsible-Changed-Why: .
Comment 4 Richard Henderson 2002-04-26 01:12:49 UTC
State-Changed-From-To: open->closed
State-Changed-Why: http://gcc.gnu.org/ml/gcc-patches/2002-04/msg01568.html
Comment 5 GCC Commits 2004-10-29 07:19:08 UTC
Subject: Bug 3581

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_2-rhl8-branch
Changes by:	jakub@gcc.gnu.org	2004-10-29 07:19:00

Modified files:
	gcc            : ChangeLog c-common.c c-common.h c-parse.in 
	                 c-typeck.c 
	gcc/cp         : ChangeLog parse.y rtti.c semantics.c spew.c 
	gcc/objc       : objc-act.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: concat1.C 
	gcc/testsuite/gcc.dg: concat2.c 

Log message:
	2002-04-26  Richard Henderson  <rth@redhat.com>
	
	PR c/3581
	* c-common.c (fix_string_type): Split out of ...
	(combine_strings): ... here.  Take a varray, not a tree list.
	(c_expand_builtin_printf): Use fix_string_type.
	* c-common.h: Update decls.
	* c-parse.in (string): Remove.  Update all uses to use STRING
	instead, and not call combine_strings.
	(yylexstring): New.
	(_yylex): Use it.
	* c-typeck.c (simple_asm_stmt): Don't call combine_strings.
	(build_asm_stmt): Likewise.
	* objc/objc-act.c (my_build_string): Use fix_string_type.
	(build_objc_string_object): Build varray for combine_strings.
	cp/
	* parse.y (string): Remove.  Update all uses to use STRING
	instead, and not call combine_strings.
	* rtti.c (tinfo_name): Use fix_string_type.
	* semantics.c (finish_asm_stmt): Don't call combine_strings.
	* spew.c (yylexstring): New.
	(read_token): Use it.
	testsuite/
	* g++.dg/parse/concat1.C: New test.
	* gcc.dg/concat2.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.13152.2.657.2.27.2.203&r2=1.13152.2.657.2.27.2.204
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.294.2.9.2.1.2.6&r2=1.294.2.9.2.1.2.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.115.2.3.4.1.2.3&r2=1.115.2.3.4.1.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-parse.in.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.127.2.2.4.1.2.5&r2=1.127.2.2.4.1.2.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.180.2.2.4.1.2.4&r2=1.180.2.2.4.1.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.2685.2.114.2.8.2.30&r2=1.2685.2.114.2.8.2.31
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parse.y.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.248.2.5.4.1.2.5&r2=1.248.2.5.4.1.2.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/rtti.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.130.6.1.2.2&r2=1.130.6.1.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.252.2.6.8.3&r2=1.252.2.6.8.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/spew.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.61.10.2&r2=1.61.10.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/objc/objc-act.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.126.2.1.8.1&r2=1.126.2.1.8.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.1672.2.166.2.8.2.85&r2=1.1672.2.166.2.8.2.86
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/concat1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=NONE&r2=1.1.106.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/concat2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=NONE&r2=1.1.106.1