fn spec attribute on builtin function in fortran
Jakub Jelinek
jakub@redhat.com
Mon Dec 1 08:43:00 GMT 2014
On Mon, Dec 01, 2014 at 09:35:25AM +0100, Tom de Vries wrote:
> I've been adding an fn spec function attribute to some openacc builtin functions:
> ...
> diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def
> index 9c05a94..4e34192 100644
> --- a/gcc/builtin-attrs.def
> +++ b/gcc/builtin-attrs.def
> @@ -64,6 +64,7 @@ DEF_ATTR_FOR_INT (6)
> DEF_ATTR_TREE_LIST (ATTR_LIST_##ENUM, ATTR_NULL, \
> ATTR_##ENUM, ATTR_NULL)
> DEF_ATTR_FOR_STRING (STR1, "1")
> +DEF_ATTR_FOR_STRING (DOT_DOT_DOT_r_r_r, "...rrr")
> #undef DEF_ATTR_FOR_STRING
>
> /* Construct a tree for a list of two integers. */
> @@ -127,6 +128,8 @@ DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_LIST, ATTR_PURE,\
> ATTR_NULL, ATTR_NOTHROW_LIST)
> DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_LEAF_LIST, ATTR_PURE, \
> ATTR_NULL, ATTR_NOTHROW_LEAF_LIST)
> +DEF_ATTR_TREE_LIST (ATTR_FNSPEC_DOT_DOT_DOT_NOCLOB_NOCLOB_NOCLOB_NOTHROW_LIST,\
> + ATTR_FNSPEC, ATTR_LIST_DOT_DOT_DOT_r_r_r, ATTR_NOTHROW_LIST)
> DEF_ATTR_TREE_LIST (ATTR_NORETURN_NOTHROW_LIST, ATTR_NORETURN, \
> ATTR_NULL, ATTR_NOTHROW_LIST)
> DEF_ATTR_TREE_LIST (ATTR_NORETURN_NOTHROW_LEAF_LIST, ATTR_NORETURN,\
> ...
>
> That worked well for c. When compiling the fortran compiler, I ran into this error:
> ...
> In file included from gcc/fortran/f95-lang.c:1194:0:
> gcc/fortran/../oacc-builtins.def: In function 'void gfc_init_builtin_functions()':
> gcc/fortran/../oacc-builtins.def:32:1: error:
> 'ATTR_FNSPEC_DOT_DOT_DOT_NOCLOB_NOCLOB_NOCLOB_NOTHROW_LIST' was not declared
> in this scope
> make[2]: *** [fortran/f95-lang.o] Error 1
Fortran FE uses gfc_build_library_function_decl_with_spec to build these.
Jakub
More information about the Gcc
mailing list