Most builtins in omp-builtins.def is marked as LEAF. At a glance,
that's surprising but looking at the functions, it turns out
that most of them just call 'gomp_thread ()' which is a simple
inline function such that no function call remains.

However, that's not true for all - and omp_get_mapped_ptr and
omp_getinterop_int really do more.

(The other one is an accidental change of mine, which I somehow
missed: omp_is_initial_device in the library returns a constant
and is already simplified in the compiler. Thus, it really
doesn't call any other function.)

Comments before I commit this patch, planed for later today?

Tobias
omp-builtins.def: Leaf attribute fixes to omp_{is_initial_device,get_{mapped_ptr,interop_int}}

gcc/ChangeLog:

	* omp-builtins.def (BUILT_IN_OMP_IS_INITIAL_DEVICE): Re-add LEAF
	to the attributes.
	(BUILT_IN_OMP_GET_MAPPED_PTR, BUILT_IN_OMP_GET_INTEROP_INT): Remove
	LEAF from the attributes as functions are called.

 gcc/omp-builtins.def | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/omp-builtins.def b/gcc/omp-builtins.def
index db1ec963841..2df2b18122b 100644
--- a/gcc/omp-builtins.def
+++ b/gcc/omp-builtins.def
@@ -71,7 +71,7 @@ DEF_GOACC_BUILTIN_ONLY (BUILT_IN_GOACC_SINGLE_COPY_END, "GOACC_single_copy_end",
 
 DEF_GOMP_BUILTIN_COMPILER (BUILT_IN_OMP_IS_INITIAL_DEVICE,
 			   "omp_is_initial_device", BT_FN_INT,
-			   ATTR_CONST_NOTHROW_LIST)
+			   ATTR_CONST_NOTHROW_LEAF_LIST)
 DEF_GOMP_BUILTIN_COMPILER (BUILT_IN_OMP_GET_INITIAL_DEVICE,
 			   "omp_get_initial_device", BT_FN_INT,
 			   ATTR_PURE_NOTHROW_LIST)
@@ -86,13 +86,13 @@ DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_TEAM_NUM, "omp_get_team_num",
 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_NUM_TEAMS, "omp_get_num_teams",
 		  BT_FN_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_MAPPED_PTR, "omp_get_mapped_ptr",
-		  BT_FN_PTR_CONST_PTR_INT, ATTR_NOTHROW_LEAF_LIST)
+		  BT_FN_PTR_CONST_PTR_INT, ATTR_NOTHROW_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_DEFAULT_DEVICE, "omp_get_default_device",
 		  BT_FN_INT, ATTR_NOTHROW_LEAF_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_OMP_SET_DEFAULT_DEVICE, "omp_set_default_device",
 		  BT_FN_INT, ATTR_NOTHROW_LEAF_LIST)
 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_INTEROP_INT, "omp_get_interop_int",
-		  BT_FN_PTRMODE_PTR_INT_PTR, ATTR_NOTHROW_LEAF_LIST)
+		  BT_FN_PTRMODE_PTR_INT_PTR, ATTR_NOTHROW_LIST)
 
 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ATOMIC_START, "GOMP_atomic_start",
 		  BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)

Reply via email to