From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 61CA23858402; Sat, 18 May 2024 20:23:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61CA23858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716063808; bh=foRGCU4ANWcSuo4/+WgN5jc7MVLvKXFg0sKHLkaco4k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mLPJ9eqLVV1Kt9HA+CYwCiVIo99hBsxGq2iauV+TTrhzdgib4N/1bKRLuLS0BnAPs X+B6oBYVoX3SXwzdmIEfHX7gHKwuC5mz5pLRIatHdHMX45J6eJ2T21wxt3Hv5Hq3pJ 5VEKi6kYxFm+XqrgudKE8hiVL023fUYhVwigrMPY= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/115127] [12/13/14/15 Regression] passing zero to __builtin_ctz() check missing Date: Sat, 18 May 2024 20:23:27 +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: 12.3.0 X-Bugzilla-Keywords: needs-reduction X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 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=3D115127 --- Comment #2 from Andrew Pinski --- Also I tested even the simplified testcase: ``` volatile int t =3D 1; int main (int argc, char* argv[]) { volatile int print_hash_value =3D 0; if (t =3D=3D 2) print_hash_value =3D 1; __builtin_ctz(print_hash_value); return 0; } ``` And the trunk reports: /app/example.cpp:261:5: runtime error: passing zero to ctz(), which is not a valid argument Just fine.=