From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BEF13858D33; Mon, 25 Apr 2022 11:14:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BEF13858D33 From: "avi at scylladb dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105373] miscompile involving lambda coroutines and an object bitwise copied instead of via the copy constructor Date: Mon, 25 Apr 2022 11:14:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.3.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: avi at scylladb dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2022 11:14:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105373 --- Comment #1 from Avi Kivity --- I randomly looked at 023t.ssa (mainly because I recognized the acronym). _45 =3D frame_ptr_182(D)->__closure; _46 =3D _45->__this; frame_ptr_182(D)->D.2159984_4_7 =3D _46->_config.memtable_to_cache_scheduling_group; _47 =3D &frame_ptr_182(D)->D.2159792_4_7; _48 =3D frame_ptr_182(D)->__closure; _49 =3D &_48->__old3; seastar::lw_shared_ptr::lw_shared_ptr (_47, _49); _50 =3D frame_ptr_182(D)->__closure; _51 =3D _50->__this; frame_ptr_182(D)->D.2159793_4_7.__this =3D _51; frame_ptr_182(D)->D.2159793_4_7.__old4 =3D frame_ptr_182(D)->D.2159792_4_= 7; _52 =3D frame_ptr_182(D)->__closure; _53 =3D _52->__newtabs; frame_ptr_182(D)->D.2159793_4_7.__newtabs =3D _53; _54 =3D &frame_ptr_182(D)->D.2159793_4_7; frame_ptr_182(D)->D.2160366_4_7 =3D seastar::with_scheduling_group, sstable_write_permit&&)::_ZN7replica5table29try_flush_memtable_to_sstableEN= 7seastar13lw_shared_ptrINS_8memtableEEEO20sstable_write_permit.Frame*)::::operator()(replica::table::try_flush_memtable_to_sstable(replica::= table::try_flush_memtable_to_sstable(seastar::lw_shared_ptr, sstable_write_permit&&)::_ZN7replica5table29try_flush_memtable_to_sstableEN= 7seastar13lw_shared_ptrINS_8memtableEEEO20sstable_write_permit.Frame*):: mutable::_ZZN7replica5table29try_flush_memtable_to_sstableEN7seastar13lw_sh= ared_ptrINS_8memtableEEEO20sstable_write_permitENUlvE_clEv.Frame*)::::operator()(replica::table::try_flush_memtable_to_sstable(replica::tabl= e::try_flush_memtable_to_sstable(seastar::lw_shared_ptr, sstable_write_permit&&)::_ZN7replica5table29try_flush_memtable_to_sstableEN= 7seastar13lw_shared_ptrINS_8memtableEEEO20sstable_write_permit.Frame*)::::operator()(replica::table::try_flush_memtable_to_sstable(replica::= table::try_flush_memtable_to_sstable(seastar::lw_shared_ptr, sstable_write_permit&&)::_ZN7replica5table29try_flush_memtable_to_sstableEN= 7seastar13lw_shared_ptrINS_8memtableEEEO20sstable_write_permit.Frame*):: mutable::_ZZN7replica5table29try_flush_memtable_to_sstableEN7seastar13lw_sh= ared_ptrINS_8memtableEEEO20sstable_write_permitENUlvE_clEv.Frame*):: mutable::_ZZZN7replica5table29try_flush_memtable_to_sstableEN7seastar13lw_s= hared_ptrINS_8memtableEEEO20sstable_write_permitENUlvE_clEvENUlvE1_clEv.Fra= me*):: > (frame_ptr_182(D)->D.2159984_4_7, _54); [return slot optimization] _55 =3D &frame_ptr_182(D)->D.2160366_4_7; frame_ptr_182(D)->Aw5_4_7 =3D seastar::operator co_await (_55); [re= turn slot optimization] In the line frame_ptr_182(D)->D.2159793_4_7.__old4 =3D frame_ptr_182(D)->D.2159792_4_= 7; Is this not a bitwise copy, which should be instead a call to the copy constructor?=