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

            Bug ID: 121156
           Summary: [16 Regression][gcn] GCC build fails with
                    'libgomp/config/gcn/bar.c:82:16: error: variable
                    ‘generation’ set but not used'
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: ams at gcc dot gnu.org
  Target Milestone: ---
            Target: gcn

Seems as if some compiler diagnostic improved.

At least I see now the following GCN GCC build fail:

/home/users/tburnus/repos/gcc/libgomp/config/gcn/bar.c: In function
‘gomp_team_barrier_wait_end’:
/home/users/tburnus/repos/gcc/libgomp/config/gcn/bar.c:82:16: error: variable
‘generation’ set but not used [-Werror=unused-but-set-variable=]
   82 |   unsigned int generation, gen;
      |                ^~~~~~~~~~

/home/users/tburnus/repos/gcc/libgomp/config/gcn/bar.c: In function
‘gomp_team_barrier_wait_cancel_end’:
/home/users/tburnus/repos/gcc/libgomp/config/gcn/bar.c:155:16: error: variable
‘generation’ set but not used [-Werror=unused-but-set-variable=]
  155 |   unsigned int generation, gen;
      |                ^~~~~~~~~~


* * *


I think the compiler is right:

gomp_team_barrier_wait_end (gomp_barrier_t *bar, gomp_barrier_state_t state)
{
  unsigned int generation, gen;
…
  generation = state;
…
      generation |= gen & BAR_WAITING_FOR_TASK;
…
}

AND

gomp_team_barrier_wait_cancel_end (gomp_barrier_t *bar,
                                   gomp_barrier_state_t state)
{
  unsigned int generation, gen;
…
  generation = state;
…
      generation |= gen & BAR_WAITING_FOR_TASK;
…
}

Reply via email to