This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] Fix PR 18111: set DECL_ARTIFICAL on function result parameters
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: GCC Fortran mailing list <fortran at gcc dot gnu dot org>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 23 Oct 2004 21:40:42 +0200
- Subject: [gfortran] Fix PR 18111: set DECL_ARTIFICAL on function result parameters
PR 18111 is a case where the hidden function argument .__result is not set,
and a warning is emitted about this when the compiler is run with -Wunused.
This patch sets DECL_ARTIFICIAL on this and the accompanying __result, which
fixes the warning.
Built and tested. OK?
- Tobi
2004-10-23 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/18111
* trans-decl.c (create_function_arglist): Set DECL_ARTIFICIAL for
hidden result parameters.
Index: trans-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-decl.c,v
retrieving revision 1.46
diff -u -p -r1.46 trans-decl.c
--- trans-decl.c 13 Oct 2004 22:37:12 -0000 1.46
+++ trans-decl.c 23 Oct 2004 19:32:48 -0000
@@ -1135,6 +1135,7 @@ create_function_arglist (gfc_symbol * sy
DECL_CONTEXT (parm) = fndecl;
DECL_ARG_TYPE (parm) = type;
TREE_READONLY (parm) = 1;
+ DECL_ARTIFICIAL (parm) = 1;
gfc_finish_decl (parm, NULL_TREE);
arglist = chainon (arglist, parm);
@@ -1162,6 +1163,7 @@ create_function_arglist (gfc_symbol * sy
DECL_CONTEXT (length) = fndecl;
DECL_ARG_TYPE (length) = type;
TREE_READONLY (length) = 1;
+ DECL_ARTIFICIAL (length) = 1;
gfc_finish_decl (length, NULL_TREE);
}
}