public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug other/94629] 10 issues located by the PVS-studio static analyzer Date: Fri, 17 Apr 2020 11:00:40 +0000 [thread overview] Message-ID: <bug-94629-4-2VEYrokL3K@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-94629-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94629 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ams at gcc dot gnu.org --- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I have a few unimportant tweaks for this in my tree. Anyway, e.g. in the GCN plugin, I wonder if we don't need: diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c index dc72c90962c..c733b8bfb18 100644 --- a/libgomp/plugin/plugin-gcn.c +++ b/libgomp/plugin/plugin-gcn.c @@ -1508,7 +1508,8 @@ init_hsa_context (void) = GOMP_PLUGIN_malloc_cleared (hsa_context.agent_count * sizeof (struct agent_info)); status = hsa_fns.hsa_iterate_agents_fn (assign_agent_ids, &agent_index); - if (agent_index != hsa_context.agent_count) + if (status != HSA_STATUS_SUCCESS + || agent_index != hsa_context.agent_count) { GOMP_PLUGIN_error ("Failed to assign IDs to all GCN agents"); return false; @@ -3473,7 +3474,8 @@ GOMP_OFFLOAD_init_device (int n) status = hsa_fns.hsa_agent_iterate_regions_fn (agent->id, get_kernarg_memory_region, &agent->kernarg_region); - if (agent->kernarg_region.handle == (uint64_t) -1) + if (status != HSA_STATUS_SUCCESS + || agent->kernarg_region.handle == (uint64_t) -1) { GOMP_PLUGIN_error ("Could not find suitable memory region for kernel " "arguments"); @@ -3486,7 +3488,8 @@ GOMP_OFFLOAD_init_device (int n) status = hsa_fns.hsa_agent_iterate_regions_fn (agent->id, get_data_memory_region, &agent->data_region); - if (agent->data_region.handle == (uint64_t) -1) + if (status != HSA_STATUS_SUCCESS + || agent->data_region.handle == (uint64_t) -1) { GOMP_PLUGIN_error ("Could not find suitable memory region for device " "data"); or if instead we should drop the "status = " for the cases where nothing checks it. Andrew?
next prev parent reply other threads:[~2020-04-17 11:00 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-16 22:58 [Bug other/94629] New: " leo at yuriev dot ru 2020-04-17 6:32 ` [Bug other/94629] " marxin at gcc dot gnu.org 2020-04-17 7:13 ` rguenth at gcc dot gnu.org 2020-04-17 7:22 ` rguenth at gcc dot gnu.org 2020-04-17 7:25 ` rguenth at gcc dot gnu.org 2020-04-17 8:39 ` cvs-commit at gcc dot gnu.org 2020-04-17 9:14 ` jakub at gcc dot gnu.org 2020-04-17 10:09 ` dcb314 at hotmail dot com 2020-04-17 10:13 ` jakub at gcc dot gnu.org 2020-04-17 10:18 ` dcb314 at hotmail dot com 2020-04-17 10:31 ` jakub at gcc dot gnu.org 2020-04-17 11:00 ` jakub at gcc dot gnu.org [this message] 2020-04-17 12:08 ` ams at gcc dot gnu.org 2020-04-17 12:13 ` jakub at gcc dot gnu.org 2020-04-17 15:02 ` cvs-commit at gcc dot gnu.org 2020-04-17 15:10 ` dcb314 at hotmail dot com 2020-04-17 22:13 ` msebor at gcc dot gnu.org 2020-04-19 20:06 ` cvs-commit at gcc dot gnu.org 2020-04-19 20:07 ` redi at gcc dot gnu.org 2020-04-20 9:56 ` marxin at gcc dot gnu.org 2020-04-20 13:22 ` leo at yuriev dot ru 2020-04-20 19:31 ` tschwinge at gcc dot gnu.org 2020-04-21 13:17 ` cvs-commit at gcc dot gnu.org 2020-04-23 14:05 ` cvs-commit at gcc dot gnu.org 2020-04-23 14:13 ` ams at gcc dot gnu.org 2020-05-08 20:09 ` leo at yuriev dot ru 2020-05-11 7:19 ` marxin at gcc dot gnu.org 2024-01-17 21:19 ` jamborm at gcc dot gnu.org 2024-01-20 17:16 ` pinskia at gcc dot gnu.org 2024-01-20 20:27 ` dcb314 at hotmail dot com 2024-01-20 20:45 ` jamborm at gcc dot gnu.org 2024-01-21 8:12 ` dcb314 at hotmail dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-94629-4-2VEYrokL3K@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).