🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #99

bug in g++ 2.2.1 (fatal signal)

#99
From: Klamer Schutte
Date: Mon, 20 Jul 1992 18:32
124 lines
4189 bytes
Hi,

I noticed g++ giving a fatal signal. Here is the input file:

char	*strcat();
char	*strncat();
int	strcmp();
int	strncmp();
int	strcasecmp();
char	*strcpy();
char	*strncpy();
int	strlen();
char	*index();
char	*rindex();

extern "C" {
typedef int ptrdiff_t;
typedef int size_t;
typedef short unsigned int wchar_t;
}

extern "C" {

char*     strcat(char*, const char*);
char*     strchr(const char*, int);
int       strcmp(const char*, const char*);
int       strcoll(const char*, const char*);
char*     strcpy(char*, const char*);
size_t    strcspn(const char*, const char*);
char*     strdup(const char*);
size_t    strlen(const char*);
char*     strncat(char*, const char*, size_t);
int       strncmp(const char*, const char*, size_t);
char*     strncpy(char*, const char*, size_t);
char*     strpbrk(const char*, const char*);
char*     strrchr(const char*, int);
size_t    strspn(const char*, const char*);
char*     strstr(const char*, const char *);
char*     strtok(char*, const char*);
size_t    strxfrm(char*, const char*, size_t);

}

extern "C" {
char*     index(const char*, int);
char*     rindex(const char*, int);
}

extern "C" {

void*     memalign(size_t, size_t);
void*     memccpy(void*, const void*, int, size_t);
void*     memchr(const void*, int, size_t);
int       memcmp(const void*, const void*, size_t);
void*     memcpy(void*, const void*, size_t);
void*     memset(void*, int, size_t);
int       ffs(int);
size_t    getpagesize(void);
void*     valloc(size_t);

}

extern "C" {
void      bcopy(const void*, void*, size_t);  
int       bcmp(const void*, const void*, int);
void      bzero(void*, int);
}

main()
{
	strcmp("a","b");
}

and here is the output of gcc -v:
>]Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.1/specs
>]gcc version 2.2.1
>] /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.1/cpp -lang-c++ -v -undef -D__GNU
>]C__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__
>]unix__ -D__sparc -D__sun -D__unix gcc_dump2.cc /tmp/cca01022.i
>]GNU CPP version 2.2.1 (sparc)
>] /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.2.1/cc1plus /tmp/cca01022.i -quiet
>]-dumpbase gcc_dump2.cc -version -o /tmp/cca01022.s
>]GNU C++ version 2.2.1 (sparc) compiled by GNU C version 2.2.1.
>]gcc: Internal compiler error: program cc1plus got fatal signal 11

Similar behaviour in cc1plus version 2.1. cc1plus is the standard
2.2.1, with one patch applied which had to be applied:
-]
-]From: mrs@cygnus.com (Mike Stump)
-]Subject: Re:  gcc 2.2.1 bug report for sparc-sun-sunos4.1
-]Message-ID: <9206250431.AA16813@cygnus.com>
-]Sender: gnulists@ai.mit.edu
-]Organization: GNUs Not Usenet
-]Distribution: gnu
-]Date: Thu, 25 Jun 1992 04:31:39 GMT
-]Approved: bug-g++@prep.ai.mit.edu
-]Lines: 64
-]
-]This problem should not exist in the next release of gcc.
-]
-]Here is a patch that EVERYONE should APPLY right now:
-]--------------
-]Doing diffs in cp-tree.c.~1~:
-]*** cp-tree.c.~1~       Tue May 26 15:29:15 1992
-]--- cp-tree.c   Fri Jun 12 10:22:56 1992
-]*************** break_out_calls (exp)
-]*** 212,218 ****
-]
-]      case 'e':  /* a expression */
-]      case 's':  /* an expression with side effects */
-]!       for (i = tree_code_length[(int) code]; i >= 0; i--)
-]        {
-]          t1 = break_out_calls (TREE_OPERAND (exp, i));
-]          if (t1 != TREE_OPERAND (exp, i))
-]--- 212,218 ----
-]
-]      case 'e':  /* a expression */
-]      case 's':  /* an expression with side effects */
-]!       for (i = tree_code_length[(int) code] - 1; i >= 0; i--)
-]        {
-]          t1 = break_out_calls (TREE_OPERAND (exp, i));
-]          if (t1 != TREE_OPERAND (exp, i))

Klamer
Technical Details
Message-ID: <9207201432.AA09127@mi.el.utwente.nl>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mi.eltn.utwente.NL!klamer

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mi.eltn.utwente.NL!klamer
From: klamer@mi.eltn.utwente.NL (Klamer Schutte)
Subject: bug in g++ 2.2.1 (fatal signal)
Message-ID: <9207201432.AA09127@mi.el.utwente.nl>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Mon, 20 Jul 1992 18:32:31 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 125