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

            Bug ID: 102192
           Summary: Curious '-O2'-only '-Wmaybe-uninitialized' diagnostics
                    for 'libgomp.oacc-fortran/routine-10.f90'
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: burnus at gcc dot gnu.org
            Blocks: 24639
  Target Milestone: ---

The 'libgomp.oacc-fortran/routine-10.f90' test case as originally added in
commit 12df77ab6df4b91d4770240bcc4ab443e4bb18b9 shows curious
'-Wmaybe-uninitialized' diagnostics.  Now, of course this is
'-Wmaybe-uninitialized', so may easily be dismissed "don't care", but maybe
there's something to be improved here?

For standard host compilation (no '-fopenacc'), but only with '-O2', we get
diagnosed:

    libgomp.oacc-fortran/routine-10.f90:28:21: Warning: ‘c’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
    libgomp.oacc-fortran/routine-10.f90:21:50: note: ‘c’ was declared here
    libgomp.oacc-fortran/routine-10.f90:46:30: Warning: ‘c’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
    libgomp.oacc-fortran/routine-10.f90:21:50: note: ‘c’ was declared here

Not seeing this with any other '-O[...]' level, and also goes away with '-O2
-fno-inline', for example.  Have not quickly been able to reproduce with '-O3'
plus various '-fno-[...].


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
[Bug 24639] [meta-bug] bug to track all Wuninitialized issues

Reply via email to