aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2015-01-07 00:15:46 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-01-07 00:15:46 +0000
commit80e3412f4fa5f55804bd1c23dcf478f55574c907 (patch)
tree83c575513016067fdc92c093bd8bfdbbccd991b7
parent7d7d64c1ae3c0732b167d2050b101808f078d711 (diff)
downloadgcc-80e3412f4fa5f55804bd1c23dcf478f55574c907.zip
gcc-80e3412f4fa5f55804bd1c23dcf478f55574c907.tar.gz
gcc-80e3412f4fa5f55804bd1c23dcf478f55574c907.tar.bz2
compiler: Add explicit sign to exported complex constants without imaginary component.
Fixes issue 31. From-SVN: r219273
-rw-r--r--gcc/go/gofrontend/expressions.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index ccb472b..d386b81 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -2450,7 +2450,7 @@ Complex_expression::export_complex(String_dump* exp, const mpc_t val)
if (!mpfr_zero_p(mpc_realref(val)))
{
Float_expression::export_float(exp, mpc_realref(val));
- if (mpfr_sgn(mpc_imagref(val)) > 0)
+ if (mpfr_sgn(mpc_imagref(val)) >= 0)
exp->write_c_string("+");
}
Float_expression::export_float(exp, mpc_imagref(val));