🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42398

Serious problem with GCC 2.7.0 on Cyrix 586

#42398
From: root root
Date: Mon, 18 Dec 1995 00:00
53 lines
1760 bytes
Hi all,

I am having serious problems with gcc 2.7.0 under linux 1.2.3
on a Cyrix Cx5x86 processor.

I write numerical codes and in the following example which gives
the same (correct) result on many flavours of unix workstation, I
receive slightly different results each time when I run the code
on my PC. There was no problem with my previous Intel DX2-66
machine upon which this code was developed.

Basically all is well before the following subroutine
(because nothing has been done yet !) :


   void orthoganalise(double *v, int n)
   {
     double norm;
     int i;

     norm=0.0;

     for(i=0; i<n; i++) norm+=v[i];

     printf(" Norm = %20.15e ",norm);  --------- (1)

     norm=norm/(1.0*n);

     printf(" %20.15e \n",norm);       --------- (2)

     for(i=0; i<n; i++) v[i]-=norm;
   }

Without the print statements the value of norm is wrong.
Without print statement (1), the value is wrong.
WITH print statement (1) the value of norm is CORRECT.

This is with optimisation set to -O2 and -O1, it is alright for
no optimisation.

Therefore, there is either one of :

        (1)     a bug in gcc 2.7.0,
        (2)     a problem with the Cyrix 586,
        (3)     or gcc 2.7.0 combined with the Cyrix 586.

Which of the above I do not know, but this is a very
serious problem where ever it comes from.

Any thoughts?

cheers
Technical Details
Message-ID: <4b2n4p$ppb@oban.cc.ic.ac.uk>
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: 11318c,c742f7a32dd985bb,start
X-Google-Attributes: gid11318c,public
From: root@ (root)
Subject: Serious problem with GCC 2.7.0 on Cyrix 586
Date: 1995/12/18
Message-ID: <4b2n4p$ppb@oban.cc.ic.ac.uk>
X-Deja-AN: 122393823
organization: I need to put my ORGANIZATION here.
newsgroups: gnu.gcc.help