This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/21567] New: Segmentation fault of the compiler when compiling
- From: "alexander_herrmann at yahoo dot com dot au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 May 2005 11:29:07 -0000
- Subject: [Bug c/21567] New: Segmentation fault of the compiler when compiling
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The compiler get's a segmentation fault on this one :)
The compiler 4.0.0 was configurated with --enable-languages=c,c++,java
--enable-shared --enable-threads=posix --with-cpu=i686 and built with make
CFLAGS='-O' LIBCFLAGS='-g -O2' \
LIBCXXFLAGS='-g -O2 -fno-implicit-templates' profiledbootstrap
aie_sql_meta.c: In Funktion aie_sql_meta_create_indexซ:
aie_sql_meta.c:23: interner Compiler-Fehler: Segmentation fault
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
// reduced Testcase
// compiled with
// gcc -Wall -O3 aie_sql_meta.c
// Alexander J. Herrmann 13.05.2005 webmaster@aiengine.org
typedef int bool;
bool aie_sql_meta_create_index(void);
void aie_sql_meta_get_index_def_from_id(int indexid, int *tableid,
int *index_typ);
int main(void)
{
aie_sql_meta_create_index();
return(0);
}
bool aie_sql_meta_create_index(void)
{
bool rc = 1;
int tableid; // Never gets initialized
int index_typ = 1;
int indexid = 0;
aie_sql_meta_get_index_def_from_id(indexid, &tableid, &index_typ);
if (__builtin_expect(((index_typ) || (tableid <= 0)),0))
{
// error variables not set but also not used
rc = 0;
}
else
{
// tableid was never initialized
printf("%d %d\n", tableid, index_typ);
}
return(rc);
}
void aie_sql_meta_get_index_def_from_id(int indexid, int *tableid,
int *index_typ)
{
if (indexid == 1)
{
// the Good case
*tableid = 1;
*index_typ = 0;
}
else
{
*index_typ = 0;
}
}
--
Summary: Segmentation fault of the compiler when compiling
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: alexander_herrmann at yahoo dot com dot au
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux
GCC host triplet: i686-pc-linux
GCC target triplet: i686-pc-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21567