aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-01-06 17:48:52 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-01-06 17:48:52 +0100
commit09228fefca26ca21690426cf7fab537f93ccc6d0 (patch)
tree0beee823e1e02bc98f55d42a7a14250ab8e846a2 /gcc
parent4913e24c20f58de96248db4bb8506c8b2678d799 (diff)
downloadgcc-09228fefca26ca21690426cf7fab537f93ccc6d0.zip
gcc-09228fefca26ca21690426cf7fab537f93ccc6d0.tar.gz
gcc-09228fefca26ca21690426cf7fab537f93ccc6d0.tar.bz2
re PR lto/51774 (FAIL: gcc.dg/lto/trans-mem-* c_lto_trans-mem-1_0.o-c_lto_trans-mem-1_1.o link, -flto -fgnu-tm)
PR lto/51774 * lto-lang.c (handle_returns_twice_attribute): New function. (lto_attribute_table): Add returns_twice attribute. From-SVN: r182959
Diffstat (limited to 'gcc')
-rw-r--r--gcc/lto/ChangeLog6
-rw-r--r--gcc/lto/lto-lang.c20
2 files changed, 25 insertions, 1 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 8882abe..825d268 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR lto/51774
+ * lto-lang.c (handle_returns_twice_attribute): New function.
+ (lto_attribute_table): Add returns_twice attribute.
+
2011-12-21 Richard Guenther <rguenther@suse.de>
* lto.c (GIMPLE_REGISTER_TYPE): New define.
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 0d230ee..d255e65 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -1,5 +1,5 @@
/* Language-dependent hooks for LTO.
- Copyright 2009, 2010 Free Software Foundation, Inc.
+ Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Contributed by CodeSourcery, Inc.
This file is part of GCC.
@@ -47,6 +47,7 @@ static tree handle_nothrow_attribute (tree *, tree, tree, int, bool *);
static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *);
static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *);
static tree handle_transaction_pure_attribute (tree *, tree, tree, int, bool *);
+static tree handle_returns_twice_attribute (tree *, tree, tree, int, bool *);
static tree ignore_attribute (tree *, tree, tree, int, bool *);
static tree handle_format_attribute (tree *, tree, tree, int, bool *);
@@ -74,6 +75,8 @@ const struct attribute_spec lto_attribute_table[] =
handle_nonnull_attribute, false },
{ "nothrow", 0, 0, true, false, false,
handle_nothrow_attribute, false },
+ { "returns_twice", 0, 0, true, false, false,
+ handle_returns_twice_attribute, false },
{ "sentinel", 0, 1, false, true, true,
handle_sentinel_attribute, false },
{ "type generic", 0, 0, false, true, true,
@@ -425,6 +428,21 @@ handle_transaction_pure_attribute (tree *node, tree ARG_UNUSED (name),
return NULL_TREE;
}
+/* Handle a "returns_twice" attribute. */
+
+static tree
+handle_returns_twice_attribute (tree *node, tree ARG_UNUSED (name),
+ tree ARG_UNUSED (args),
+ int ARG_UNUSED (flags),
+ bool * ARG_UNUSED (no_add_attrs))
+{
+ gcc_assert (TREE_CODE (*node) == FUNCTION_DECL);
+
+ DECL_IS_RETURNS_TWICE (*node) = 1;
+
+ return NULL_TREE;
+}
+
/* Ignore the given attribute. Used when this attribute may be usefully
overridden by the target, but is not used generically. */