https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81752

            Bug ID: 81752
           Summary: num_gangs(65536) converted to 0
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

num_gangs hits a limit at 65536 for nvptx. For this example:
...
int
main ()
{
#pragma acc parallel num_gangs(65536)
  ;
  return 0;
}
...

we get this warning:
...
/tmp/ccjtQtKi.c:47:21: warning: unsigned conversion from 'int' to 'short
unsigned int' changes value from '65536' to '0' [-Woverflow]
  {"main$_omp_fn$0", 0x10000, 0x1, 0x20}
...

The code triggering the warning in more detail:
...
static const struct nvptx_fn {
  const char *name;
  unsigned short dim[3];
} func_mappings[] = {

        {"main$_omp_fn$0", 0x10000, 0x1, 0x20}
};
...

Reply via email to