From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5787638515DD; Fri, 21 May 2021 10:21:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5787638515DD From: "stream009 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/95137] Sanitizers seem to be missing support for coroutines Date: Fri, 21 May 2021 10:21:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stream009 at gmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: iains at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Fri, 21 May 2021 10:21:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95137 stream009 changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stream009 at gmail dot com --- Comment #42 from stream009 --- I got strange compile error when I use coroutine with UBSAN. The weird thing is error is reported in compile time not runtime. The code compile fine without UBSAN. GCC version: 11.1 compile option: -std=3Dc++20 -Wall -Wextra -pedantic-errors -fcoroutines -fsanitize=3Dundefined compiler explorer link: https://godbolt.org/z/Yva6b1YTz It seems error happen only coroutine that doesn't return value (promise has return_void() defined). I don't get error with coroutine that return value. (https://godbolt.org/z/3jcvYPcqa) Let me know if I should report this as separate bug. =3D=3D=3D begin source =3D=3D=3D #include struct result { struct promise_type { std::suspend_never initial_suspend() { return {}; } std::suspend_never final_suspend() noexcept { return {}; } result get_return_object() { return {}; } void return_void() {} void unhandled_exception() {} }; }; result error(int i) { if (i =3D=3D 0) { co_return; } } =3D=3D=3D end source =3D=3D=3D =3D=3D=3D begin compile error =3D=3D=3D : In function 'void _Z5errori.actor(error(int)::_Z5errori.frame*)': :21:9: warning: '' may be used uninitialized [-Wmaybe-uninitialized] 21 | co_return; | ^~~~~~~~~ :21:9: note: '' was declared here 21 | co_return; | ^~~~~~~~~ =3D=3D=3D end compile error =3D=3D=3D=