This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch,gfortran] PR 22607: PURE return-by-reference functions


:ADDPATCH fortran:

Here's a patch for PR 22607; PURE (including ELEMENTAL)
return-by-reference functions don't currently work.  If we
avoid setting

        DECL_IS_PURE (fndecl) = 1;

in trans-decl.c(build_function_decl), the problem is fixed.

I do, however, not know much about the backend.  Among the things
I don't know is whether DECL_IS_PURE (fndecl) = 1 is supposed to
work for return-by-ref. functions or not (might this actually be
a backend bug?).  Comments from people with better understanding
of the backend are wellcome.

Bootstrapped & tested on Linux/x86, Ok?


        Erik


2005-11-08  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/22607
        * trans-decl.c(build_function_decl): Don't set 
        DECL_IS_PURE (fndecl) = 1 for return-by-reference
        functions.


2005-11-08  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/22607
        * gfortran-dg/pure_byref_1.f90: New.
        * gfortran-dg/pure_byref_2.f90: New.

Attachment: 22607.diff
Description: Text document

Attachment: pure_byref_1.f90
Description: Text document

Attachment: pure_byref_2.f90
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]