🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6120

"internal compiler error" in gcc version 2.7.2.1

#6120
From: Jochen Voss
Date: Wed, 04 Dec 1996 00:00
126 lines
4415 bytes
-----BEGIN PGP SIGNED MESSAGE-----


I have found a bug in the GNU C compiler version 2.7.2.1 on
`i486-linux'.  The output of "gcc -v" is

    Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2.1/specs
    gcc version 2.7.2.1

When I feed the appended (and already preprocessed) input file via the
command "gcc bug.c" into gcc, I got the following output.

    bug.c: In function `main':
    bug.c:33: warning: initialization makes pointer from integer without a cast
    bug.c:33: incompatible types in initialization
    bug.c:34: incompatible types in initialization
    bug.c:36: incompatible types in initialization
    bug.c:37: incompatible types in initialization
    bug.c:39: incompatible types in initialization
    bug.c:41: incompatible types in initialization
    gcc: Internal compiler error: program cc1 got fatal signal 6

The last line indicates a bug as "reliable compilers never crash".

I hope, this bug report helps you to improve GCC.

	Regards, jochen

=== "bug.c" starts after this line =============================================
typedef enum { FALSE, TRUE } bool;
struct voption {
  const char  *name;		 
  char  short_name;		 
  bool *flag_ptr;		 
  bool  has_arg;		 
  const char *arg_name;		 
  const char *help;		 
};
extern  int  vgetopt (const struct voption *, const char **);
extern  void  show_options (const struct voption *);

extern  char **xargv;
extern  int  xargc;
extern  bool  interactive_flag;
void  vinit (int argc, char **argv);
typedef  double  number;

extern  bool  interactive_flag;
extern  bool  verbose_flag;
extern  const char *default_device_name (void)  __attribute__ ((const)) ;
bool  interactive_flag;
bool  verbose_flag;

int
main (int argc, char **argv)
{
  const char *device_name = default_device_name ();
  bool  error_flag = FALSE;	 
  bool  help_flag = FALSE;	 
  bool  version_flag = FALSE;	 
  struct voption  option_tab [] = {
    { "device", 'T', TRUE, ((void *)0) , "NAME", "choose the output device" },
    { "interactive", 'i', FALSE, &interactive_flag, ((void *)0) ,
      "run in interacitve mode, even if `stdin' is not a tty" },
    { "help", 'h', FALSE, &help_flag, ((void *)0) , "show this message and exit" },
    { "verbose", 'v', FALSE, &verbose_flag, ((void *)0) ,
      "emit additional informative messages" },
    { "version", 'V', FALSE, &version_flag, ((void *)0) ,
      "show vplot's version number and exit" },
    { ((void *)0) , '\0', FALSE, ((void *)0) , ((void *)0) , ((void *)0)  }
  };
  int  c;
  setlocale (6 , "");
  xargc = argc;
  xargv = xmalloc (xargc*sizeof (char *));
  memcpy (xargv, argv, xargc*sizeof (char *));
  interactive_flag = isatty (fileno (((_IO_FILE*)(&_IO_stdin_))  ));
  verbose_flag = FALSE;
  while (! error_flag) {
    const char *argptr;
    c = vgetopt (option_tab, &argptr);
    if (c == -1)  break;
    switch (c) {
    case 'T':
      device_name = argptr;
      break;
    case 'i':
      interactive_flag = TRUE;
      break;
    case 'h':			 
      help_flag = TRUE;
      break;
    case 'v':
      verbose_flag = TRUE;
      break;
    case 'V':			 
      version_flag = TRUE;
      break;
    case '?':
      error_flag = TRUE;
      break;
    default:
    }
  }
  prepare_output (device_name);
  if (xargc > 1) {
    int  i;
    for (i=1; i<xargc && xargv[i][0]=='-'; ++i) {
      error ("Unknown option \"%s\"", xargv[i]);
    }
    if (i==1 || i+1<xargc)  error ("Too much arguments.");
    fputc ('\n', ((_IO_FILE*)(&_IO_stderr_))  );
    error_flag = TRUE;
  }
  return  0 ;
}
=== "bug.c" ends before this line ==============================================

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQBVAwUBMqWPR1oPBmsfCGBBAQG0lgH/Y805rZw3fsPNEc8uMxBPtU1xhDbLU+bw
l/naTiZlw0mf/ZTxItBFibOPyq5qmWhLwQ59g906dat8Q//7ijHRPg==
=r/9T
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <9612040948.aa06227@io.mathematik.uni-kl.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,f4cad26798a5a9e3,start
X-Google-Attributes: gid113d02,public
From: voss@mathematik.uni-kl.de (Jochen Voss)
Subject: "internal compiler error" in gcc version 2.7.2.1
Date: 1996/12/04
Message-ID: <9612040948.aa06227@io.mathematik.uni-kl.de>
X-Deja-AN: 202328861
sender: bug-gcc-request@prep.ai.mit.edu
x-gateway: relay3.UU.NET from bug-gcc to gnu.gcc.bug; Wed, 4 Dec 1996 11:45:09 EST
newsgroups: gnu.gcc.bug