From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C9A213858D37; Wed, 17 Apr 2024 10:49:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9A213858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713350970; bh=v/Yufzz/soFdvJ+qSc+ZwlHrbk73ZJL91OnrsIIl4uY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WZ2EoF3EQEULL7Sx/+SUljgT6Qrf24Kp0Tcz4GnUq0TbucNZ2965fkKsDSk94tEk0 ymJYmGnuDnQMb27qs7RQ1ws3PRH+TO321W5Vf9/mL/R7rORnw16Z/nJT70GyDlMlb1 VOySe90j8RUumedrCiO+MpOvQbfbJgBRZw3vDM/U= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114753] from_chars aborts with -m32 -ftrapv when passed -9223372036854775808 Date: Wed, 17 Apr 2024 10:49: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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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=3D114753 --- Comment #2 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #1) > With __val =3D 9223372036854775808LL __sign =3D -1LL Oops, that should be __val =3D 9223372036854775808ULL and __sign =3D -1 i.e. int main() { unsigned long long val =3D 9223372036854775808ULL; int sign =3D -1; long long res; return __builtin_mul_overflow(val, sign, &res); } This shouldn't trap.=