(The *new* patch is attached.)

Hi, Jakub and Thomas~  I found some problems when compiling GCC, and it turns
out it was related to libgomp.

        $ git clone ...
        $ mkdir gcc-build
        $ cd gcc-build

If I configure GCC with

        $ CC=gcc-14 CXX=g++-14 CFLAGS=-DNDEBUG ../gcc/configure 
--enable-languages=c++ --disable-multilib --disable-checking 
--disable-bootstrap --program-suffix=-test

Then

        $ make -j2

It will fail because

        ../../../gcc/libgomp/oacc-mem.c: In function ‘acc_unmap_data’:
        ../../../gcc/libgomp/oacc-mem.c:483:8: error: unused variable 
‘is_tgt_unmapped’ [-Werror=unused-variable]
          483 |   bool is_tgt_unmapped = gomp_remove_var (acc_dev, n);
              |        ^~~~~~~~~~~~~~~
        .
        .
        .

This patch applies `__attribute__((unused))` to these variables, eliminating
the need for additional `-Wno` flag thus retaining the static checking
capabilities provided by GCC.

Thanks for reviewing!

Attachment: 0001-Avoid-unused-variable-error-when-configured-with-CFL.patch
Description: 0001-Avoid-unused-variable-error-when-configured-with-CFL.patch

Reply via email to