From owner-bug-octave at bevo dot che dot wisc dot edu Fri Jan 24 18:57:38 1997 Subject: Re: octave-2.0.1: bad optimization From: Joao Cardoso To: bug-octave at bevo dot che dot wisc dot edu Date: Fri, 24 Jan 97 00:56:17 GMT John W. Eaton wrote: | From: "John W. Eaton" | To: Martin Pfost | Subject: octave-2.0.1: bad optimization | | On 14-Jan-1997, Martin Pfost wrote: ... | : Besides, it seems that GNU Fortran 0.5.19 built on gcc 2.7.2.1 | : produces buggy code with optimization turned on. Maybe someone could | : comment on this since I hope it is only due to a faulty | : installation. | : | : Correct results without optimization (FFLAGS=""): | : | : octave:1> [ 1 i; 1 2i; 1 3i] \ [ 1; 2; 3] | : ans = | : | : -0.00000 + 0.00000i | : 0.00000 - 1.00000i | : | : Pretty wrong results with optimization (FFLAGS="-O"): | : | : octave:1> [ 1 i; 1 2i; 1 3i] \ [ 1; 2; 3] | : ans = | : | : 0 | : 0 | | I'm not sure that the bug is in g77. Please try replacing | libcruft/blas/dznrm2.f with the following version and let me know if | it still fails with -O. | | Thanks, | | jwe At least in part, it seems to be a g77 problems. _Without_ your patch applied, FFLAGS = -O -malign-double -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fomit-frame-pointer -mieee-fp -pipe (yes, I know, I should get a faster CPU :)) octave:1> [ 1 i; 1 2i; 1 3i] \ [ 1; 2; 3] ans = 0 0 without the -O octave:1> [ 1 i; 1 2i; 1 3i] \ [ 1; 2; 3] ans = 2.2969e-16 - 2.9439e-17i 1.4720e-17 - 1.0000e+00i and finally: g77 -c dznrm2.f octave:1> [ 1 i; 1 2i; 1 3i] \ [ 1; 2; 3] ans = 2.2969e-16 - 2.9439e-17i 1.4720e-17 - 1.0000e+00i this last results are also obtained with an old 'f2c', but with g77 - -lf2c and f2c.h. This is g77-0.5.18 on top of gcc-2.7.2.1 with libg++-2.7.1 on a SCO-3.2v4. Thanks, Joao -- Joao Cardoso, INESC | e-mail: jcardoso at inescn dot pt R. Jose Falcao 110 | tel: + 351 2 2094345 4000 Porto, Portugal | fax: + 351 2 2008487