I've committed this patch to fix a bug in the OpenMP argument parsing.

It was using a value instead of a mask to read from the arguments. Since the value in question happens to be zero, the comparison would always return true. I've not observed any bad behaviour from this, but in theory it could read attempt to read any unhandled argument as the thread limit.

Andrew
Fix libgomp plugin-gcn bug

2020-01-23  Andrew Stubbs  <a...@codesourcery.com>

	libgomp/
	* plugin/plugin-gcn.c (parse_target_attributes): Use correct mask for
	the device id.

diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c
index de470a3dd33..7854c142f05 100644
--- a/libgomp/plugin/plugin-gcn.c
+++ b/libgomp/plugin/plugin-gcn.c
@@ -1228,7 +1228,8 @@ parse_target_attributes (void **input,
 	  grid_attrs_found = true;
 	  break;
 	}
-      else if ((id & GOMP_TARGET_ARG_DEVICE_ALL) == GOMP_TARGET_ARG_DEVICE_ALL)
+      else if ((id & GOMP_TARGET_ARG_DEVICE_MASK)
+	       == GOMP_TARGET_ARG_DEVICE_ALL)
 	{
 	  gcn_dims_found = true;
 	  switch (id & GOMP_TARGET_ARG_ID_MASK)

Reply via email to