This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Dec 2004 00:51:41 -0000
- Subject: [Bug tree-optimization/18746] New: segfault with cc1 compiled with checking disabled
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Build cc1 with checking disabled.
Then compile the following with ./cc1 -quiet -O2.
extern void abort (void) __attribute__ ((noreturn));
extern char *strcpy (char *__restrict __dest, __const char *__restrict __src);
int
foo (int aaa, int bbb)
{
static char buf[30];
const char *p;
switch (aaa)
{
case 10:
p = "hello";
break;
case 20:
p = "world";
break;
default:
abort ();
}
if (bbb)
{
strcpy (buf, "banana");
return 1;
}
strcpy (buf, p);
return 0;
}
I get "internal compiler error: Segmentation fault".
The testcase was reduced from i386.c.
--
Summary: segfault with cc1 compiled with checking disabled
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kazu at cs dot umass dot edu
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18746