From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C1713385737C; Thu, 28 Apr 2022 14:57:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1713385737C From: "avi at scylladb dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/63164] unnecessary calls to __dynamic_cast Date: Thu, 28 Apr 2022 14:57:29 +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: 4.9.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: avi at scylladb dot com 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 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: Thu, 28 Apr 2022 14:57:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D63164 --- Comment #3 from Avi Kivity --- I have something like this: =E2=94=82 2680 future<> system_keyspace_make(distributed& dist_db, distributed& dist_ss, sharded& dist_gossiper, db::config& cfg) { =E2= =94=82 =E2=94=82 2681 register_virtual_tables(dist_db, dist_ss, dist_goss= iper, cfg);=20=20 ... =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20 =E2=94=82 =E2=94=82 2687 for (auto&& table : system_keyspace::all_tables(db_= config)) {=20=20=20 ... =E2=94=82 2695 co_await db.create_keyspace(ksm, dist_ss.local().get_erm_factory(), true, replica::database::system_keyspace::yes);=20=20=20 And I see a crash as if the std::vector returned by all_tables() is not persisted. This worked in previous gcc versions and works in clang. I don't now what the standard says, but it really should persist temporarie= s in range for that contains a suspension point, or a lot of buggy code will be written.=