[gfortran] Exponentiation by integral exponents

Paul Brook paul@codesourcery.com
Wed Apr 28 18:14:00 GMT 2004


> I found the bug which made my test fail: My problem was due to the fact
> that my testcase was trying to exponentiate a complex variable. This of
> course failed, because it unconditionally falls through to the real
> case, even though rse.expr has just been converted to a complex type.
> I'll let this as is, as I only want to try the builtin for the moment.

Ah, of course.

> Now I have to find out, how to correctly use the builtin. Simply
> replacing "pow" by "__builtin_pow" in trans-decl.c didn't work, the
> compiler generates a call to __builtin_pow in the assembly, which is not
> what I want.

You need to remove gfor_fndecl_math_pow* and create the nodes in 
gfc_init_builtin_functions, like we do for floor and round.
You can then use built_in_decls[BUILT_IN_POW] instead of gfor_fndecl_math_pow.

Paul



More information about the Fortran mailing list