aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-01-21 09:04:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-01-21 09:04:53 +0000
commitcbf5d0e70c98103d28c869305043d9889bb36c8f (patch)
tree33d3bb74da1e52661a0940e472d95cdc4efa58ef /gcc/tree.h
parent1f36fbf4a81d10160f3083d93952ec9d6c8da7f0 (diff)
downloadgcc-cbf5d0e70c98103d28c869305043d9889bb36c8f.zip
gcc-cbf5d0e70c98103d28c869305043d9889bb36c8f.tar.gz
gcc-cbf5d0e70c98103d28c869305043d9889bb36c8f.tar.bz2
re PR middle-end/64313 (gcc.dg/torture/builtin-explog-1.c fails on bare-metal targets)
2015-01-21 Richard Biener <rguenther@suse.de> PR middle-end/64313 * tree-core.h (builtin_info, builtin_info_type): Turn from an object with two arrays into an array of an object with decl and two flags, implicit_p and declared_p. * tree.h (builtin_decl_explicit, builtin_decl_implicit, set_builtin_decl, set_builtin_decl_implicit_p, builtin_decl_explicit_p, builtin_decl_implicit_p): Adjust. (set_builtin_decl_declared_p, builtin_decl_declared_p): New functions. * builtins.c (builtin_info): Adjust. * gimplify.c (gimplify_addr_expr): References to builtins that have been declared by the user makes them eligible for use by the compiler. Call set_builtin_decl_implicit_p on them. c/ * c-decl.c (merge_decls): Call set_builtin_decl_declared_p for builtins the user declared correctly. cp/ * decl.c (duplicate_decls): Call set_builtin_decl_declared_p for builtins the user declared correctly. From-SVN: r219928
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h46
1 files changed, 36 insertions, 10 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 4f83b38..d8eaff6 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4606,7 +4606,7 @@ builtin_decl_explicit (enum built_in_function fncode)
{
gcc_checking_assert (BUILTIN_VALID_P (fncode));
- return builtin_info.decl[(size_t)fncode];
+ return builtin_info[(size_t)fncode].decl;
}
/* Return the tree node for an implicit builtin function or NULL. */
@@ -4616,10 +4616,10 @@ builtin_decl_implicit (enum built_in_function fncode)
size_t uns_fncode = (size_t)fncode;
gcc_checking_assert (BUILTIN_VALID_P (fncode));
- if (!builtin_info.implicit_p[uns_fncode])
+ if (!builtin_info[uns_fncode].implicit_p)
return NULL_TREE;
- return builtin_info.decl[uns_fncode];
+ return builtin_info[uns_fncode].decl;
}
/* Set explicit builtin function nodes and whether it is an implicit
@@ -4633,8 +4633,9 @@ set_builtin_decl (enum built_in_function fncode, tree decl, bool implicit_p)
gcc_checking_assert (BUILTIN_VALID_P (fncode)
&& (decl != NULL_TREE || !implicit_p));
- builtin_info.decl[ufncode] = decl;
- builtin_info.implicit_p[ufncode] = implicit_p;
+ builtin_info[ufncode].decl = decl;
+ builtin_info[ufncode].implicit_p = implicit_p;
+ builtin_info[ufncode].declared_p = false;
}
/* Set the implicit flag for a builtin function. */
@@ -4645,9 +4646,22 @@ set_builtin_decl_implicit_p (enum built_in_function fncode, bool implicit_p)
size_t uns_fncode = (size_t)fncode;
gcc_checking_assert (BUILTIN_VALID_P (fncode)
- && builtin_info.decl[uns_fncode] != NULL_TREE);
+ && builtin_info[uns_fncode].decl != NULL_TREE);
- builtin_info.implicit_p[uns_fncode] = implicit_p;
+ builtin_info[uns_fncode].implicit_p = implicit_p;
+}
+
+/* Set the declared flag for a builtin function. */
+
+static inline void
+set_builtin_decl_declared_p (enum built_in_function fncode, bool declared_p)
+{
+ size_t uns_fncode = (size_t)fncode;
+
+ gcc_checking_assert (BUILTIN_VALID_P (fncode)
+ && builtin_info[uns_fncode].decl != NULL_TREE);
+
+ builtin_info[uns_fncode].declared_p = declared_p;
}
/* Return whether the standard builtin function can be used as an explicit
@@ -4657,7 +4671,7 @@ static inline bool
builtin_decl_explicit_p (enum built_in_function fncode)
{
gcc_checking_assert (BUILTIN_VALID_P (fncode));
- return (builtin_info.decl[(size_t)fncode] != NULL_TREE);
+ return (builtin_info[(size_t)fncode].decl != NULL_TREE);
}
/* Return whether the standard builtin function can be used implicitly. */
@@ -4668,8 +4682,20 @@ builtin_decl_implicit_p (enum built_in_function fncode)
size_t uns_fncode = (size_t)fncode;
gcc_checking_assert (BUILTIN_VALID_P (fncode));
- return (builtin_info.decl[uns_fncode] != NULL_TREE
- && builtin_info.implicit_p[uns_fncode]);
+ return (builtin_info[uns_fncode].decl != NULL_TREE
+ && builtin_info[uns_fncode].implicit_p);
+}
+
+/* Return whether the standard builtin function was declared. */
+
+static inline bool
+builtin_decl_declared_p (enum built_in_function fncode)
+{
+ size_t uns_fncode = (size_t)fncode;
+
+ gcc_checking_assert (BUILTIN_VALID_P (fncode));
+ return (builtin_info[uns_fncode].decl != NULL_TREE
+ && builtin_info[uns_fncode].declared_p);
}
/* Return true if T (assumed to be a DECL) is a global variable.