https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99061

--- Comment #2 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Wed, Feb 10, 2021 at 06:03:56PM +0000, kargl at gcc dot gnu.org wrote:
> diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
> index 5c9258c65c3..0cf0aa56811 100644
> --- a/gcc/fortran/trans-intrinsic.c
> +++ b/gcc/fortran/trans-intrinsic.c
> @@ -4717,6 +4717,7 @@ gfc_conv_intrinsic_cotand (gfc_se *se, gfc_expr *expr)
>  static void
>  gfc_conv_intrinsic_atan2d (gfc_se *se, gfc_expr *expr)
>  {
> +  gfc_intrinsic_map_t *m;
>    tree args[2];
>    tree atan2d;
>    tree type;
> @@ -4724,7 +4725,13 @@ gfc_conv_intrinsic_atan2d (gfc_se *se, gfc_expr *expr)
>    gfc_conv_intrinsic_function_args (se, expr, args, 2);
>    type = TREE_TYPE (args[0]);
> 
> -  atan2d = gfc_builtin_decl_for_float_kind (BUILT_IN_ATAN2, expr->ts.kind);
> +  /* Find tan builtin function.  */

I suppose whomever commits the patch will fix the comment.

> +  m = gfc_intrinsic_map;
> +  for (; m->id != GFC_ISYM_NONE || m->double_built_in != END_BUILTINS; m++)
> +    if (GFC_ISYM_ATAN2 == m->id)
> +      break;
> +
> +  atan2d = gfc_get_intrinsic_lib_fndecl (m, expr);
>    atan2d = build_call_expr_loc (input_location, atan2d, 2, args[0], args[1]);
> 
>    se->expr = fold_build2_loc (input_location, MULT_EXPR, type, atan2d,

Reply via email to