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); This is fairly harmless but might as well be fixed, so here is a patch (as far as I can see fntype[4] is only used in declaring the frexp family of functions). Bootstraps and has no impact on the Fortran testsuite (tested on mainline). OK to apply on mainline and the 4.5 and 4.6 branches?
Proposed fortran/Changelog entry: 2011-03-30 Duncan Sands <baldr...@free.fr> * f95-lang.c (build_builtin_fntypes): Swap frexp parameter types. Index: gcc/fortran/f95-lang.c =================================================================== --- gcc/fortran/f95-lang.c (revision 171716) +++ gcc/fortran/f95-lang.c (working copy) @@ -695,10 +695,9 @@ type, integer_type_node, NULL_TREE); /* type (*) (void) */ fntype[3] = build_function_type_list (type, NULL_TREE); - /* 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); /* type (*) (int, type) */ fntype[5] = build_function_type_list (type,