[8u][gcc6] RFR: 8152131: aarch32: specify which overloaded variant of fmod to use
Alex Kashchenko
akashche at redhat.com
Tue Mar 22 15:52:34 UTC 2016
Hi Edward,
On 03/22/2016 10:56 AM, Edward Nevill wrote:
> Hi Alex,
>
> Thanks for this. Sorry for the delay in replying.
>
> On Thu, 2016-03-17 at 20:12 +0000, Alex Kashchenko wrote:
>> The following cast of fmod function pointer to address causes
>> "overloaded function with no contextual type information" compilation
>> error with GCC6:
>>
>> __ mov(rscratch1, (address)fmod);
>>
>> Proposed change is to cast fmod to the double version:
>>
>> __ mov(rscratch1, (address)(double (*)(double, double))fmod);
>>
>
> Could you try the following instead
>
> diff -r fbcdff021df5 src/cpu/aarch32/vm/templateTable_aarch32.cpp
> --- a/src/cpu/aarch32/vm/templateTable_aarch32.cpp Tue Mar 22 10:41:57 2016 +0000
> +++ b/src/cpu/aarch32/vm/templateTable_aarch32.cpp Tue Mar 22 10:53:10 2016 +0000
> @@ -1426,7 +1426,7 @@
> __ vmov_f64(r0, r1, d0);
> __ vmov_f64(r2, r3, d1);
> #endif
> - __ mov(rscratch1, (address)fmod);
> + __ mov(rscratch1, CAST_FROM_FN_PTR(address, fmod));
> __ bl(rscratch1);
> __ vcvt_f32_f64(d0, d0);
> break;
> @@ -1463,7 +1463,7 @@
> __ vmov_f64(r0, r1, d0);
> __ vmov_f64(r2, r3, d1);
> #endif
> - __ mov(rscratch1, (address)fmod);
> + __ mov(rscratch1, CAST_FROM_FN_PTR(address, fmod));
> __ bl(rscratch1);
> break;
> default:
>
> If this works with gcc 6 it is preferable to doing (double (*)(double, double)) casts.
I am getting the same error using that macro:
[...]/hotspot/src/cpu/aarch32/vm/templateTable_aarch32.cpp: In static
member function 'static void TemplateTable::dop2(TemplateTable::Operation)':
[...]/hotspot/src/share/vm/utilities/globalDefinitions.hpp:331:81:
error: overloaded function with no contextual type information
#define CAST_FROM_FN_PTR(new_type, func_ptr)
((new_type)((address_word)(func_ptr)))
^
[...]/hotspot/src/cpu/aarch32/vm/templateTable_aarch32.cpp:1466:23:
note: in expansion of macro 'CAST_FROM_FN_PTR'
__ mov(rscratch1, CAST_FROM_FN_PTR(address, fmod));
^~~~~~~~~~~~~~~~
[...]/hotspot/make/linux/makefiles/rules.make:157: recipe for target
'templateTable_aarch32.o' failed
--
-Alex
More information about the aarch32-port-dev
mailing list