aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-09-28 18:34:36 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-09-28 16:34:36 +0000
commit0d6e14fdda97a04b5bfba17b3a0fd30e08f814da (patch)
treedf17a1c6a564a87e23e89f03d7cabc50414014c4 /gcc/fortran
parent697c3575e2a72e4957cccd73a32930f8697847bd (diff)
downloadgcc-0d6e14fdda97a04b5bfba17b3a0fd30e08f814da.zip
gcc-0d6e14fdda97a04b5bfba17b3a0fd30e08f814da.tar.gz
gcc-0d6e14fdda97a04b5bfba17b3a0fd30e08f814da.tar.bz2
builtin-attrs.def (ATTR_LEAF): New attribute.
* builtin-attrs.def (ATTR_LEAF): New attribute. (ATTR_NOVOPS_LEAF_LIST, ATTR_LEAF_LIST, ATTR_NOTHROW_LEAF_LIST, ATTR_CONST_NOTHROW_LEAF_LIST, ATTR_PURE_NOTHROW_LEAF_LIST, ATTR_PURE_NOTHROW_NOVOPS_LEAF_LIST, ATTR_NORETURN_NOTHROW_LEAF_LIST, ATTR_MALLOC_NOTHROW_LEAF_LIST, ATTR_SENTINEL_NOTHROW_LEAF_LIST, ATTR_NOTHROW_NONNULL_LEAF, ATTR_CONST_NOTHROW_NONNULL_LEAF, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF, ATTR_PURE_NOTHROW_NONNULL_LEAF, ATTR_MALLOC_NOTHROW_NONNULL_LEAF): New attribute lists. * sync-builtins.def: Annotate all builtins by leaf. * omp-builtins.def: Annotate all builtins by leaf. * builtins.def: Annotate relevant builtins with leaf attribute. (ATTR_MATHFN_ERRNO, ATTR_MATHFN_FPROUNDING, ATTR_MATHFN_FPROUNDING_ERRNO, ATTR_MATHFN_FPROUNDING_STORE): Make leaf. * gcc-interface/utils.c (handle_leaf_attribute): New function. (gnat_internal_attribute_tables): Add leaf. * lto-lang.c (handle_leaf_attribute): New function. (lto_attribute_tables): Add leaf. * f95-lang.c (gfc_define_builtin): Make leaf. (gfc_init_builtin_functions): Handle only ATTR_CONST_NOTHROW_LEAF_LIST and ATTR_NOTHROW_LEAF_LIST. (DEF_SYNC_BUILTIN): Check ATTR_CONST_NOTHROW_LEAF_LIST. (DEF_GOMP_BUILTIN): Likewise. From-SVN: r164689
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/f95-lang.c10
2 files changed, 14 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 54687ee..138f458 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-28 Jan Hubicka <jh@suse.cz>
+
+ * f95-lang.c (gfc_define_builtin): Make leaf.
+ (gfc_init_builtin_functions): Handle only ATTR_CONST_NOTHROW_LEAF_LIST
+ and ATTR_NOTHROW_LEAF_LIST.
+ (DEF_SYNC_BUILTIN): Check ATTR_CONST_NOTHROW_LEAF_LIST.
+ (DEF_GOMP_BUILTIN): Likewise.
+
2010-09-28 Tobias Burnus <burnus@net-b.de>
PR fortran/45756
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index d00b7f0..dc67847 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -638,6 +638,8 @@ gfc_define_builtin (const char *name,
if (const_p)
TREE_READONLY (decl) = 1;
TREE_NOTHROW (decl) = 1;
+ DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("leaf"),
+ NULL, DECL_ATTRIBUTES (decl));
built_in_decls[code] = decl;
implicit_built_in_decls[code] = decl;
@@ -728,8 +730,8 @@ gfc_init_builtin_functions (void)
enum
{
/* So far we need just these 2 attribute types. */
- ATTR_NOTHROW_LIST,
- ATTR_CONST_NOTHROW_LIST
+ ATTR_NOTHROW_LEAF_LIST,
+ ATTR_CONST_NOTHROW_LEAF_LIST
};
tree mfunc_float[6];
@@ -1083,7 +1085,7 @@ gfc_init_builtin_functions (void)
#undef DEF_SYNC_BUILTIN
#define DEF_SYNC_BUILTIN(code, name, type, attr) \
gfc_define_builtin (name, builtin_types[type], code, name, \
- attr == ATTR_CONST_NOTHROW_LIST);
+ attr == ATTR_CONST_NOTHROW_LEAF_LIST);
#include "../sync-builtins.def"
#undef DEF_SYNC_BUILTIN
@@ -1092,7 +1094,7 @@ gfc_init_builtin_functions (void)
#undef DEF_GOMP_BUILTIN
#define DEF_GOMP_BUILTIN(code, name, type, attr) \
gfc_define_builtin ("__builtin_" name, builtin_types[type], \
- code, name, attr == ATTR_CONST_NOTHROW_LIST);
+ code, name, attr == ATTR_CONST_NOTHROW_LEAF_LIST);
#include "../omp-builtins.def"
#undef DEF_GOMP_BUILTIN
}