public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/94992] New: gcc thinks a member variable is uninitialised
@ 2020-05-08  5:31 rafael at espindo dot la
  2020-05-08  5:57 ` [Bug middle-end/94992] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rafael at espindo dot la @ 2020-05-08  5:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94992
           Summary: gcc thinks a member variable is uninitialised
           Product: gcc
           Version: 10.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rafael at espindo dot la
  Target Milestone: ---

Created attachment 48477
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48477&action=edit
testcase

In the attached testcase gcc with -O1 (but not -O0 or -O2) produces the
following warning

futures_test.cc:57:22: warning: ‘f2.my_future::_promise’ is used uninitialized
in this function [-Wuninitialized]
   57 |         : _promise(x._promise)

The produced assembly also uses uninitialized memory.

The problem is that _promise is initialized to nullptr in the default
constructor.

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

end of thread, other threads:[~2020-05-08 15:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  5:31 [Bug middle-end/94992] New: gcc thinks a member variable is uninitialised rafael at espindo dot la
2020-05-08  5:57 ` [Bug middle-end/94992] " pinskia at gcc dot gnu.org
2020-05-08  5:58 ` pinskia at gcc dot gnu.org
2020-05-08 15:52 ` rafael at espindo dot la

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).