From bc18915d9b6c5082d0a77f079e2123bfb858011e Mon Sep 17 00:00:00 2001 From: meissner Date: Thu, 21 Jun 2018 22:55:50 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261870 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 3 +++ gcc/config/rs6000/rs6000.c | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 02d59040db38..9fdd3e62a0ec 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 11ef766a531a..3cc64456a3ed 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); -- 2.47.2