public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add parentheses to clarify precedence between operators [PR106907]
       [not found] <f5963991-53b4-bf69-fd3a-e2273a7131b1@linux.vnet.ibm.com>
@ 2023-06-07  6:17 ` P Jeevitha
  0 siblings, 0 replies; only message in thread
From: P Jeevitha @ 2023-06-07  6:17 UTC (permalink / raw)
  To: gcc-patches, Peter Bergner

PR106907 has few warnings spotted from cppcheck. Inorder to clarify the
order of precedence between operators added parentheses to explicitly
group operations based on desired order of evaluation.

2023-06-07  Jeevitha Palanisamy  <jeevitha@linux.ibm.com>

gcc/
	PR target/106907
	* config/gcn/gcn.cc (gcn_hsa_declare_function_name): Add parentheses
	to group the operations.


diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc
index efb7211d54e..d2b5cb74204 100644
--- a/gcc/config/gcn/gcn.cc
+++ b/gcc/config/gcn/gcn.cc
@@ -6300,7 +6300,7 @@ gcn_hsa_declare_function_name (FILE *file, const char *name, tree)
   fprintf (file, "\t  .amdhsa_system_vgpr_workitem_id\t%i\n",
 	   (cfun->machine->args.requested & (1 << WORK_ITEM_ID_Z_ARG))
 	   ? 2
-	   : cfun->machine->args.requested & (1 << WORK_ITEM_ID_Y_ARG)
+	   : (cfun->machine->args.requested & (1 << WORK_ITEM_ID_Y_ARG))
 	   ? 1 : 0);
   fprintf (file,
 	   "\t  .amdhsa_next_free_vgpr\t%i\n"


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-07  6:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <f5963991-53b4-bf69-fd3a-e2273a7131b1@linux.vnet.ibm.com>
2023-06-07  6:17 ` [PATCH] Add parentheses to clarify precedence between operators [PR106907] P Jeevitha

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).