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

--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Tue, Feb 01, 2022 at 03:52:51PM +0000, kargl at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104313
> 
> --- Comment #2 from kargl at gcc dot gnu.org ---
> diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
> index 6493cc2f6b1..908a4c6d42e 100644
> --- a/gcc/fortran/trans-decl.cc
> +++ b/gcc/fortran/trans-decl.cc
> @@ -6474,7 +6474,7 @@ gfc_generate_return (void)
>              NULL_TREE, and a 'return' is generated without a variable.
>              The following generates a 'return __result_XXX' where XXX is
>              the function name.  */
> -         if (sym == sym->result && sym->attr.function)
> +         if (sym == sym->result && sym->attr.function && !flag_f2c)
>             {
>               result = gfc_get_fake_result_decl (sym, 0);
>               result = fold_build2_loc (input_location, MODIFY_EXPR,
> 

Passes regression testing.

Reply via email to