From xemacs-m  Mon Feb 10 19:21:44 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id TAA17074
	for <xemacs-beta@xemacs.org>; Mon, 10 Feb 1997 19:21:42 -0600 (CST)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.5/8.8.5) id RAA07283;
	Mon, 10 Feb 1997 17:33:16 -0800
To: xemacs-beta@xemacs.org
Subject: Re: b93 dead on arrival
References: <199702102255.RAA08625@anthem.CNRI.Reston.Va.US> 	<m2ybcwtfrh.fsf@altair.xemacs.org> <199702102323.SAA08664@anthem.CNRI.Reston.Va.US>
X-Url: http://www.miranova.com/%7Esteve/
Mail-Copies-To: never
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@miranova.com>
In-Reply-To: "Barry A. Warsaw"'s message of Mon, 10 Feb 1997 18:23:02 -0500
Mime-Version: 1.0 (generated by tm-edit 7.103)
Content-Type: multipart/mixed;
 boundary="Multipart_Mon_Feb_10_17:33:13_1997-1"
Content-Transfer-Encoding: 7bit
Date: 10 Feb 1997 17:33:13 -0800
Message-ID: <m2k9ogt9d2.fsf@altair.xemacs.org>
Lines: 105
X-Mailer: Gnus v5.4.12/XEmacs 20.1

--Multipart_Mon_Feb_10_17:33:13_1997-1
Content-Type: text/plain; charset=US-ASCII

Barry A Warsaw writes:

>>>>>> "sb" == Steven L Baur <steve@miranova.com> writes:

sb> O.K.  You have the same problem Vinnie Shelton reported.  What
sb> version of Gcc do you guys have?  Barry, could you try
sb> building with the SparcWorks compiler to see if that works any
sb> better?

> I'm using 2.7.2.  Unfortunately it's the only C compiler I have on
> Sparc (I *really* need to remedy that soon).  I have access to an
> Irix 5.3 box with, I think, an SGI compiler.  Will try that and see what
> happens.

--Multipart_Mon_Feb_10_17:33:13_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="sr_bug.c"
Content-Transfer-Encoding: 7bit

/* sr_bug.c
 *
 * This program tests for a gcc bug.
 * To compile this test program:  gcc -O2 sr_bug.c
 *
 * Sometimes gcc for Intel CPUs generates bad code at optimization
 * level 2.  The bad code is 'almost right' and stay hidden inside
 * a program that seems to work - including the Linux kernel.
 * The bug is very old and has been reported.  As of 19-Dec-95,
 * the bug has not been fixed.
 *
 * If you change this code you should test it, because even a
 * tiny change will hide this elusive bug.  If you think you
 * fixed the bug, please run the original test just to make
 * sure. You can find the original test below, after the #if 0.
 * I wrote this version of the test to be user-friendly, and
 * it may not be as solid as the original.
 *
 * Some people who know more than I do:
 * davis@space.mit.edu (John E. Davis)
 * anlauf@crunch.ikp.physik.th-darmstadt.de (Harald Anlauf)
 * craigs@iii2.iii.net (Craig Shrimpton)
 *
 * User-friendly version by Albert Cahalan
 *
 */
 
#include <stdio.h>

int gcc_sr_bug(void){
  static int Array[3]; /* must be static (or global) */
  unsigned int B = 3;  /* must be unsigned 32-bit */
  int i;
  for(i=0; i<B; i++) Array[i] = i - 3;
  for(i=0; i<B; i++) printf(" %d,%d", i, Array[i]);
  return !Array[1];
}

int main(){
  printf("Testing for gcc bug...");
  if(gcc_sr_bug()){
    printf("\n\nBad code! Your compiler generates bad output.\n\n");
    printf("Add -fno-strength-reduce to your gcc command line\n");
    printf("or put it into your gcc config file, such as in\n");
    printf("/usr/lib/gcc-lib/i486-linux/2.7.0/specs.\n");
    exit(1);
  }else{
    printf("\nOK, no problem.\n");
    exit(0);
  }
}

#if 0
/*********  original code + whitespace  ***********/

#include <stdio.h>

int A[3];
unsigned int B = 3;

void printit(void){
  int i;
  for(i = 0; i < B; i++) fprintf(stdout, "A[%d] = %d\n", i, A[i]);
}

int main(){
  int i;
  for(i = 0; i < B; i++) A[i] = i - 3;
  printit();
  return 0;
}

#endif

--Multipart_Mon_Feb_10_17:33:13_1997-1
Content-Type: text/plain; charset=US-ASCII


-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.

--Multipart_Mon_Feb_10_17:33:13_1997-1--

