From: Michael Meissner Date: Thu, 21 Jun 2018 22:55:50 +0000 (+0000) Subject: rs6000.c (init_float128_ieee): Prevent complex multiply and divide external functions... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ed044066ac73d9678ae8fabc141f647b54ed91c2;p=gcc.git rs6000.c (init_float128_ieee): Prevent complex multiply and divide external functions from being created more... 2018-06-23 Michael Meissner * config/rs6000/rs6000.c (init_float128_ieee): Prevent complex multiply and divide external functions from being created more than once. From-SVN: r261870 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 02d59040db3..9fdd3e62a0e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -5,6 +5,9 @@ IEEE 128-bit long double. (neg2_internal): Use the correct mode to check whether the mode is IBM extended. + * config/rs6000/rs6000.c (init_float128_ieee): Prevent complex + multiply and divide external functions from being created more + than once. 2018-06-21 Eric Botcazou diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 11ef766a531..3cc64456a3e 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -17892,9 +17892,14 @@ init_float128_ieee (machine_mode mode) { if (FLOAT128_VECTOR_P (mode)) { - /* Set up to call __mulkc3 and __divkc3 under -mabi=ieeelongdouble. */ - if (mode == TFmode && TARGET_IEEEQUAD) + static bool complex_muldiv_init_p = false; + + /* Set up to call __mulkc3 and __divkc3 under -mabi=ieeelongdouble. If + we have clone or target attributes, this will be called a second + time. We want to create the built-in function only once. */ + if (mode == TFmode && TARGET_IEEEQUAD && !complex_muldiv_init_p) { + complex_muldiv_init_p = true; built_in_function fncode_mul = (built_in_function) (BUILT_IN_COMPLEX_MUL_MIN + TCmode - MIN_MODE_COMPLEX_FLOAT);