From: marvinw@intrepid18.wv.tek.COM
Subject: gcc-2.3.1 -msoft-float bug
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 10 Nov 1992 23:34:05 GMT

A small C program is included in the script below.  The compiler, cc1,
core dumps!  This same file compiles with gcc-2.2.2.

		Marvin Wyckoff
                Tektronix, Inc.
                503-685-2985
                marvinw@orca.wv.tek.com


Script started on Tue Nov 10 15:24:12 1992

[ent] cat config.status
#!/bin/sh
# GCC was configured as follows:
../configure --host=mips --target=mips-mips-bsd
echo host=mips-mips-none target=mips-mips-bsd build=mips-mips-none
[ent] uname -a
enterprise enterprise 5.0 RISCos mips
[ent] cat tt.c
typedef unsigned char F_char;
 
typedef struct F_FILE {
  F_char  *b_base;     
  long    b_size;      
  F_char  *b_ptr;      
  long    b_cnt;       
  F_char  flags;       
  F_char  ungotc;      
  short   error;       
  int     fd;          
} F_FILE;
typedef union ps_value {
  char            *valueP;      
  int              value;       
  int              integer;     
  float            real;        
  int              boolean;     
  struct ps_obj   *arrayP;      
  unsigned char   *stringP;     
  char            *nameP;       
  F_FILE	*fileP;       
} psvalue;
int             tokenType;      
psvalue         tokenValue;     
static F_FILE	*inputFileP;     
static double Exp10T[128];
static long m_value;
static long m_scale;
static long e_value;
static long r_scale;
static int REAL(ch)
  int ch;
{
  double temp;
  if ((m_scale >= 0 && e_value <= 0)
      || (m_scale <= 0 && e_value >= 0)) {
    tokenValue.real = (double)(m_value) * ((m_scale + e_value) == 0 ? (double)(1.0) : (-64 <= (m_scale + e_value) && (m_scale + e_value) <= 63 ? Exp10T[(m_scale + e_value)+64] : P10(m_scale + e_value) )) ;
  }
  else {
    temp = (double)(m_value) * ((m_scale) == 0 ? (double)(1.0) : (-64 <= (m_scale) && (m_scale) <= 63 ? Exp10T[(m_scale)+64] : P10(m_scale) )) ;
    tokenValue.real = temp * ((e_value) == 0 ? (double)(1.0) : (-64 <= (e_value) && (e_value) <= 63 ? Exp10T[(e_value)+64] : P10(e_value) )) ;
  }
  tokenType =          (12) ;
  return( (256) );
}
[ent] gcc -O2 -msoft-float -c -v tt.c
gcc version 2.3.1
 /big1/people/marvinw/nwd/tools/mips/lib/gcc-lib/mips-mips-bsd/2.3.1/cpp -lang-c -v -undef -D__GNUC__=2 -Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_BSD43 -D_mips -D_unix -D_host_mips -D_MIPSEB -D_R3000 -D_SYSTYPE_BSD43 -D__mips__ -D__unix__ -D__host_mips__ -D__MIPSEB__ -D__R3000__ -D__SYSTYPE_BSD43__ -D___mips__ -D___unix__ -D___host_mips__ -D___MIPSEB__ -D___R3000__ -D___SYSTYPE_BSD43__ -D__mips -D__unix -D__host_mips -D__MIPSEB -D__R3000 -D__SYSTYPE_BSD43 -D___mips -D___unix -D___host_mips -D___



MIPSEB -D___R3000 -D___SYSTYPE_BSD43 -D__OPTIMIZE__ -D__LANGUAGE_C -D_LANGUAGE_C -DLANGUAGE_C tt.c /usr/tmp/cc016718.i
GNU CPP version 2.3.1 [AL 1.1, MM 28] RISC-OS BSD Mips
 /big1/people/marvinw/nwd/tools/mips/lib/gcc-lib/mips-mips-bsd/2.3.1/cc1 /usr/tmp/cc016718.i -mgpopt -quiet -dumpbase tt.c -msoft-float -O2 -version -o /usr/tmp/cc016718.s
GNU C version 2.3.1 [AL 1.1, MM 28] RISC-OS BSD Mips compiled by CC.
mgcc: Internal compiler error: program cc1 got fatal signal 4

Newsgroups: gnu.gcc.bug