aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-gcc.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2014-10-24 05:01:50 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2014-10-24 05:01:50 +0000
commit5eda5bad3c455d499b6a3611b433f2945caa239d (patch)
treec692cb03790db22948d2d1d2c21226b54e7c9a25 /gcc/go/go-gcc.cc
parent3c7652863686230db5cb861ebfcbc600f10156e0 (diff)
downloadgcc-5eda5bad3c455d499b6a3611b433f2945caa239d.zip
gcc-5eda5bad3c455d499b6a3611b433f2945caa239d.tar.gz
gcc-5eda5bad3c455d499b6a3611b433f2945caa239d.tar.bz2
compiler: Use MPC library for complex numbers.
* go-gcc.cc (Gcc_backend::complex_constant_expression): Take one mpc_t parameter instead of two mpfr_t parameters. From-SVN: r216611
Diffstat (limited to 'gcc/go/go-gcc.cc')
-rw-r--r--gcc/go/go-gcc.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index 6bac84f..caf66db 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -247,7 +247,7 @@ class Gcc_backend : public Backend
float_constant_expression(Btype* btype, mpfr_t val);
Bexpression*
- complex_constant_expression(Btype* btype, mpfr_t real, mpfr_t imag);
+ complex_constant_expression(Btype* btype, mpc_t val);
Bexpression*
string_constant_expression(const std::string& val);
@@ -1241,7 +1241,7 @@ Gcc_backend::float_constant_expression(Btype* btype, mpfr_t val)
// Return a typed real and imaginary value as a constant complex number.
Bexpression*
-Gcc_backend::complex_constant_expression(Btype* btype, mpfr_t real, mpfr_t imag)
+Gcc_backend::complex_constant_expression(Btype* btype, mpc_t val)
{
tree t = btype->get_tree();
tree ret;
@@ -1249,12 +1249,12 @@ Gcc_backend::complex_constant_expression(Btype* btype, mpfr_t real, mpfr_t imag)
return this->error_expression();
REAL_VALUE_TYPE r1;
- real_from_mpfr(&r1, real, TREE_TYPE(t), GMP_RNDN);
+ real_from_mpfr(&r1, mpc_realref(val), TREE_TYPE(t), GMP_RNDN);
REAL_VALUE_TYPE r2;
real_convert(&r2, TYPE_MODE(TREE_TYPE(t)), &r1);
REAL_VALUE_TYPE r3;
- real_from_mpfr(&r3, imag, TREE_TYPE(t), GMP_RNDN);
+ real_from_mpfr(&r3, mpc_imagref(val), TREE_TYPE(t), GMP_RNDN);
REAL_VALUE_TYPE r4;
real_convert(&r4, TYPE_MODE(TREE_TYPE(t)), &r3);