From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 32D7B38582A4; Fri, 31 Mar 2023 08:08:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32D7B38582A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680250091; bh=euHGb+IEtlNpdl9y3SX+jxQrlMZjr3CkhRyghSD9tiQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=N6NnkqFnDV8nVhbRwV3K/09SG1V1xCfpOfp451aU44UNcpA8gYBruDz8vA+/3p+BG DrT34E77hjYlVFVCGSZ7ylq/LVrlnpXveNANEvfnNEKvKz8hWSR/qle5pXt7jvDYwJ xgkvPuH1k1vqtMVHUr3IutObehbjKJVJ3nKPsWdY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109353] FAIL: 23_containers/vector/bool/allocator/copy.cc (test for excess errors) Date: Fri, 31 Mar 2023 08:08:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: diagnostic, missed-optimization, testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109353 --- Comment #2 from Richard Biener --- So it seems to be _M_insert_aux(iterator __position, bool __x) { if (this->_M_impl._M_finish._M_p !=3D this->_M_impl._M_end_addr()) { std::copy_backward(__position, this->_M_impl._M_finish, this->_M_impl._M_finish + 1); *__position =3D __x; ++this->_M_impl._M_finish; } else { const size_type __len =3D _M_check_len(size_type(1), "vector::_M_insert_aux"); _Bit_pointer __q =3D this->_M_allocate(__len); iterator __start(std::__addressof(*__q), 0); iterator __i =3D _M_copy_aligned(begin(), __position, __start); /= / <-- *__i++ =3D __x; where the compiler fails to optimize the case of no existing allocation. Since that's from the push_back () itself no caching of the null start in libstdc++ is possible. Disabling early threading avoids the diagnostic because we then inline very differently, not exposing most of the above.=