Hi Tobias,

Pong. It helps to send Fortran patches also to fortran@ ...

indeed :)

On 30/03/11 16:43, Duncan Sands wrote:
While working on the dragonegg plugin I noticed that the Fortran front-end
declares frexp with the parameters the wrong way round. Instead of
double frexp(double x, int *exp);
it is declared as
double frexp(int *exp, double x);

OK to apply on mainline and the 4.5 and 4.6 branches?

OK and thanks for the patch. Do you have an GCC SVN account?

I do, so that's not a problem.  By the way I just noticed that the arguments to
the scalbn functions also seem to be the wrong way round:

  gfc_define_builtin ("__builtin_scalbnl", mfunc_longdouble[5],
                      BUILT_IN_SCALBNL, "scalbnl", 
ATTR_CONST_NOTHROW_LEAF_LIST);
  gfc_define_builtin ("__builtin_scalbn", mfunc_double[5],
                      BUILT_IN_SCALBN, "scalbn", ATTR_CONST_NOTHROW_LEAF_LIST);
  gfc_define_builtin ("__builtin_scalbnf", mfunc_float[5],
                      BUILT_IN_SCALBNF, "scalbnf", 
ATTR_CONST_NOTHROW_LEAF_LIST);

but

  /* type (*) (int, type) */
  fntype[5] = build_function_type_list (type,
                                        integer_type_node, type, NULL_TREE);

so it looks like you get scalbn(int, double) and not scalbn(double, int) etc.
If you agree that they are the wrong way round I will fix this too.

Ciao, Duncan.


Tobias

2011-03-30 Duncan Sands <baldr...@free.fr>

* f95-lang.c (build_builtin_fntypes): Swap frexp parameter types.

- /* type (*) (&int, type) */
- fntype[4] = build_function_type_list (type,
+ /* type (*) (type, &int) */
+ fntype[4] = build_function_type_list (type, type,
build_pointer_type (integer_type_node),
- type,
NULL_TREE);



Reply via email to