From 78f2fb0858ad3af16b46c5b064c846a8528eb814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Schl=C3=BCter?= Date: Tue, 29 Jun 2004 19:21:37 +0200 Subject: module.c (mio_gmp_real): Correct writing of negative numbers. fortran/ * module.c (mio_gmp_real): Correct writing of negative numbers. testsuite/ * gfortran.fortran-torture/execute/parameter_2.f90: New test. Also corrected dates in previous ChangeLog entries From-SVN: r83862 --- gcc/fortran/ChangeLog | 6 +++++- gcc/fortran/module.c | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9193234..e3df360 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,8 @@ -2004-06-22 Tobias Schlueter +2004-06-29 Tobias Schlueter + + * module.c (mio_gmp_real): Correct writing of negative numbers. + +2004-06-29 Tobias Schlueter PR fortran/15963 * expr.c (check_intrinsic_op): Allow comparison of characters. diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index eace654..cf8f453 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -2274,6 +2274,15 @@ mio_gmp_real (mpf_t * real) atom_string = gfc_getmem (strlen (p) + 20); sprintf (atom_string, "0.%s@%ld", p, exponent); + + /* Fix negative numbers. */ + if (atom_string[2] == '-') + { + atom_string[0] = '-'; + atom_string[1] = '0'; + atom_string[2] = '.'; + } + write_atom (ATOM_STRING, atom_string); gfc_free (atom_string); -- cgit v1.1