public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110328] New: Module related optimization is too aggressive
@ 2023-06-20 18:26 m-matti-a.lehtonen at iki dot fi
  2024-03-06 16:41 ` [Bug c++/110328] " ppalka at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: m-matti-a.lehtonen at iki dot fi @ 2023-06-20 18:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110328
           Summary: Module related optimization is too aggressive
           Product: gcc
           Version: 12.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: m-matti-a.lehtonen at iki dot fi
  Target Milestone: ---

Created attachment 55375
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55375&action=edit
Example sources

When the module example (files test.cc and test2.cc) is compiles as
> g++-12 --std=c++20 -Wall -Wextra -Werror -pedantic  -fmodules-ts -O1  -DNDEBUG test2.cc test.cc
it generates the following error:
> In file included from test.cc:4,
> of module test, imported at test2.cc:5:
> In destructor ‘virtual std::bad_optional_access::~bad_optional_access()’,
>     inlined from ‘virtual std::bad_optional_access::~bad_optional_access()’ at > test2.cc:8:15:
> /usr/include/c++/12/optional:102:13: error: ‘this’ is used uninitialized [-Werror=uninitialized]
>   102 |     virtual ~bad_optional_access() = default;
>       |             ^
> In file included from test2.cc:2:
> /usr/include/c++/12/optional: In destructor ‘virtual std::bad_optional_access::~bad_optional_access()’:
> /usr/include/c++/12/optional:102:13: note: ‘this’ was declared here
>   102 |     virtual ~bad_optional_access() = default;
>       |             ^

If the if statement at test2.cc is uncommented, no error is generated.

If basically the same code (file test3.cc) is compiled without using modules,
no problem
> g++-12 --std=c++20 -Wall -Wextra -Werror -pedantic -O1  -DNDEBUG test3.cc

Exact version and system (Ubuntu 22.04.2 LTS)
> $ g++-12  --version
> g++-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0

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

* [Bug c++/110328] Module related optimization is too aggressive
  2023-06-20 18:26 [Bug c++/110328] New: Module related optimization is too aggressive m-matti-a.lehtonen at iki dot fi
@ 2024-03-06 16:41 ` ppalka at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-03-06 16:41 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
                 CC|                            |ppalka at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
I can't reproduce this with GCC 13 or trunk, so let's call this fixed since GCC
13.

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

end of thread, other threads:[~2024-03-06 16:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-20 18:26 [Bug c++/110328] New: Module related optimization is too aggressive m-matti-a.lehtonen at iki dot fi
2024-03-06 16:41 ` [Bug c++/110328] " ppalka 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).