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

--- Comment #2 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
I've noticed that with an offloading-enabled build of GCC we're losing "note:
in expansion of macro '[...]'" diagnostics.  (Effectively
'-ftrack-macro-expansion=0'?)

For example, 'libgomp.oacc-c-c++-common/vred2d-128.c' with '-fopenacc
-Wuninitialized' for a (default) GCC build without
'--enable-offload-targets=[...]':

    [...]
    [...]/libgomp.oacc-c-c++-common/vred2d-128.c: In function ‘test1’:
    [...]/libgomp.oacc-c-c++-common/vred2d-128.c:34:8: warning: ‘t1’ is used
uninitialized [-Wuninitialized]
       34 |          "acc loop vector reduction(+:t1) reduction(-:t2)")
          |        ^ ~
    [...]/libgomp.oacc-c-c++-common/vred2d-128.c:11:14: note: ‘t1’ was declared
here
       11 |   long i, j, t1, t2, t3;                        \
          |              ^~
    [...]/libgomp.oacc-c-c++-common/vred2d-128.c:33:1: note: in expansion of
macro ‘gentest’
       33 | gentest (test1, "acc parallel loop gang vector_length (128)
firstprivate (t1, t2)",
          | ^~~~~~~
    [...]/libgomp.oacc-c-c++-common/vred2d-128.c:34:8: warning: ‘t2’ is used
uninitialized [-Wuninitialized]
    [...]

... vs. a GCC build with '--enable-offload-targets=[...]':

    [...]
    [...]/libgomp.oacc-c-c++-common/vred2d-128.c: In function ‘test1’:
    [...]/libgomp.oacc-c-c++-common/vred2d-128.c:34:8: warning: ‘t1’ is used
uninitialized [-Wuninitialized]
       34 |          "acc loop vector reduction(+:t1) reduction(-:t2)")
          |        ^ ~
    [...]/libgomp.oacc-c-c++-common/vred2d-128.c:11:14: note: ‘t1’ was declared
here
       11 |   long i, j, t1, t2, t3;                        \
          |              ^~
    [...]/libgomp.oacc-c-c++-common/vred2d-128.c:34:8: warning: ‘t2’ is used
uninitialized [-Wuninitialized]
    [...]

Note that an explicit '-foffload=disable' does not cure this.

Reply via email to