This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Proposed libf2c patch
- To: gcc-patches at gcc dot gnu dot org
- Subject: Proposed libf2c patch
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sun, 29 Aug 1999 05:05:29 -0600
- Reply-To: law at cygnus dot com
I have no idea if this patch is reasonable or not. Can one of the Fortran
folks take appropriate action for this patch.
[ If it's already been dealt with, chide me for falling way behind on patches
during the gcc-2.95 release cycle :-) ]
------- Forwarded Message
Sender: owner-egcs-bugs@egcs.cygnus.com
From: "John W. Eaton" <jwe@bevo.che.wisc.edu>
To: Thomas Hoffmann <hoffmann@ehmgs2.et.tu-dresden.de>
cc: bug-octave@bevo.che.wisc.edu, egcs-bugs@egcs.cygnus.com
Date: Wed, 14 Jul 1999 11:21:34 -0500 (CDT)
Subject: Crashing after complex division by zero
[The following bug was reported for Octave 2.0.14, but it is really a
problem with libg2c, so I'm also sending this report to the egcs-bug
list. --jwe]
On 14-Jul-1999, Thomas Hoffmann <hoffmann@ehmgs2.et.tu-dresden.de> wrote:
| Bug report for Octave 2.0.14 configured for hppa1.1-hp-hpux10.20
|
| Description:
| -----------
| octave:2> b=[0 i
| > 0 0]
| b =
|
| 0 + 0i 0 + 1i
| 0 + 0i 0 + 0i
|
| octave:3> inv(b)
| complex division by zero
| Abort(coredump)
|
| Repeat-By:
| ---------
|
| b=[0 i
| > 0 0]
|
| inv(b)
This problem is due to a bug in the complex division routine used by
g77. The following patch will make it behave the same as the complex
division code used by g++ (which was adapted from the libf2c code).
The code in c_div.c is not relevant to Octave, but it has the same
problem.
To take advantage of this patch with Octave, you will have to
recompile the libg2c library from egcs then relink Octave.
Thanks,
jwe
Wed Jul 14 09:58:23 1999 John W. Eaton <jwe@bevo.che.wisc.edu>
* libF77/z_div.c (z_div): Don't call sig_die for division by zero.
* libF77/c_div.c (c_div): Likewise.
*** egcs-1.1.2/libf2c/libF77/z_div.c 1999/07/14 14:54:15 1.1
- --- egcs-1.1.2/libf2c/libF77/z_div.c 1999/07/14 14:55:00
***************
*** 18,25 ****
abi = - abi;
if( abr <= abi )
{
- - if(abi == 0)
- - sig_die("complex division by zero", 1);
ratio = b->r / b->i ;
den = b->i * (1 + ratio*ratio);
res.r = (a->r*ratio + a->i) / den;
- --- 18,23 ----
*** egcs-1.1.2/libf2c/libF77/c_div.c 1999/07/14 14:54:19 1.1
- --- egcs-1.1.2/libf2c/libF77/c_div.c 1999/07/14 14:54:52
***************
*** 19,26 ****
abi = - abi;
if( abr <= abi )
{
- - if(abi == 0)
- - sig_die("complex division by zero", 1);
ratio = (double)b->r / b->i ;
den = b->i * (1 + ratio*ratio);
res.r = (a->r*ratio + a->i) / den;
- --- 19,24 ----
------- End of Forwarded Message