summaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-28 16:34:36 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-28 16:34:36 +0000
commit4a68fd3cf82cde5dbdbfed957eac66f9f78820ea (patch)
treedf17a1c6a564a87e23e89f03d7cabc50414014c4 /gcc/lto
parent83f4b93be171071920df6321140d217239f7c23e (diff)
downloadgcc-4a68fd3cf82cde5dbdbfed957eac66f9f78820ea.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164689 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto-lang.c24
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 7aa054ce2a2..5d7de8dbda3 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-28 Jan Hubicka <jh@suse.cz>
+
+ * lto-lang.c (handle_leaf_attribute): New function.
+ (lto_attribute_tables): Add leaf.
+
2010-09-25 Jie Zhang <jie@codesourcery.com>
* lto.c (lto_read_all_file_options): Start a new line after
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 388a46c199c..f7c0bfeb51b 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
+static tree handle_leaf_attribute (tree *, tree, tree, int, bool *);
static tree handle_const_attribute (tree *, tree, tree, int, bool *);
static tree handle_malloc_attribute (tree *, tree, tree, int, bool *);
static tree handle_pure_attribute (tree *, tree, tree, int, bool *);
@@ -53,6 +54,8 @@ const struct attribute_spec lto_attribute_table[] =
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */
{ "noreturn", 0, 0, true, false, false,
handle_noreturn_attribute },
+ { "leaf", 0, 0, true, false, false,
+ handle_leaf_attribute },
/* The same comments as for noreturn attributes apply to const ones. */
{ "const", 0, 0, true, false, false,
handle_const_attribute },
@@ -184,6 +187,27 @@ handle_noreturn_attribute (tree *node, tree ARG_UNUSED (name),
return NULL_TREE;
}
+/* Handle a "leaf" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_leaf_attribute (tree *node, tree name,
+ tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags), bool *no_add_attrs)
+{
+ if (TREE_CODE (*node) != FUNCTION_DECL)
+ {
+ warning (OPT_Wattributes, "%qE attribute ignored", name);
+ *no_add_attrs = true;
+ }
+ if (!TREE_PUBLIC (*node))
+ {
+ warning (OPT_Wattributes, "%qE attribute has no effect on unit local functions", name);
+ *no_add_attrs = true;
+ }
+
+ return NULL_TREE;
+}
/* Handle a "const" attribute; arguments as in
struct attribute_spec.handler. */