[8u][gcc6] RFR: 8152131: aarch32: specify which overloaded variant of fmod to use

Edward Nevill edward.nevill at gmail.com
Tue Mar 22 10:56:14 UTC 2016


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.

All the best,
Ed.




More information about the aarch32-port-dev mailing list