public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/102192] New: Curious '-O2'-only '-Wmaybe-uninitialized' diagnostics for 'libgomp.oacc-fortran/routine-10.f90'
@ 2021-09-03 14:59 tschwinge at gcc dot gnu.org
  2021-10-06 16:44 ` [Bug tree-optimization/102192] " msebor at gcc dot gnu.org
  2022-01-13 10:52 ` cvs-commit at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2021-09-03 14:59 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/102192] Curious '-O2'-only '-Wmaybe-uninitialized' diagnostics for 'libgomp.oacc-fortran/routine-10.f90'
  2021-09-03 14:59 [Bug tree-optimization/102192] New: Curious '-O2'-only '-Wmaybe-uninitialized' diagnostics for 'libgomp.oacc-fortran/routine-10.f90' tschwinge at gcc dot gnu.org
@ 2021-10-06 16:44 ` msebor at gcc dot gnu.org
  2022-01-13 10:52 ` cvs-commit at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-10-06 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1
                 CC|                            |msebor at gcc dot gnu.org
   Last reconfirmed|                            |2021-10-06

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
There are lots of reports about -Wmaybe-uninitialized triggering when it's not
expected to.  Some are bugs/limitations in the warning but others are inherent
in the IL the warning works with and can't be avoided given its design. 
Without a small test case to easily reproduce the suspected problem, given the
large number of reports with test cases, it's unlikely that anyone will go try
to extract one from a historical Git revision of a test, especially one written
in FORTRAN and involving complex control flow, to determine were this one
falls.  I would suggest to include the test in the bug report, along with the
output (as we ask users to do).  Better yet would be reducing the suspected
false positive to a smaller test case, and ideally converting it to C.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/102192] Curious '-O2'-only '-Wmaybe-uninitialized' diagnostics for 'libgomp.oacc-fortran/routine-10.f90'
  2021-09-03 14:59 [Bug tree-optimization/102192] New: Curious '-O2'-only '-Wmaybe-uninitialized' diagnostics for 'libgomp.oacc-fortran/routine-10.f90' tschwinge at gcc dot gnu.org
  2021-10-06 16:44 ` [Bug tree-optimization/102192] " msebor at gcc dot gnu.org
@ 2022-01-13 10:52 ` cvs-commit at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-13 10:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Thomas Schwinge <tschwinge@gcc.gnu.org>:

https://gcc.gnu.org/g:2edbcaed95b8d8cbb05a6af486179db0da6e3245

commit r12-6547-g2edbcaed95b8d8cbb05a6af486179db0da6e3245
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Thu Aug 26 16:55:21 2021 +0200

    Document current '-Wuninitialized' diagnostics for
'libgomp.oacc-fortran/routine-10.f90' [PR102192]

            libgomp/
            PR tree-optimization/102192
            * testsuite/libgomp.oacc-fortran/routine-10.f90: Document current
            '-Wuninitialized' diagnostics.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-13 10:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-03 14:59 [Bug tree-optimization/102192] New: Curious '-O2'-only '-Wmaybe-uninitialized' diagnostics for 'libgomp.oacc-fortran/routine-10.f90' tschwinge at gcc dot gnu.org
2021-10-06 16:44 ` [Bug tree-optimization/102192] " msebor at gcc dot gnu.org
2022-01-13 10:52 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).