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 <jeevi...@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"