From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 692663858D33; Wed, 17 Apr 2024 11:30:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 692663858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713353405; bh=63+MzwTh5ru0i07L1mj5RtsN92OOJrZNCfAOnCZ13Ao=; h=From:To:Subject:Date:In-Reply-To:References:From; b=duASP67twcLlGAxLFeu+FbPBuJLjvqbJcLzl0cB52A5QJCdRWJhqVFbON6TUWq0C1 awzrOUp67CCWZH/QmrsUr//QXAjtBWt2P0HEGgkka6pxCtc0E5/jZ6wIkq77+aWLgk 2TtYNWQusnV5DYCHVO07vvL1qRZMBfr9rGVlsYvo= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/114753] from_chars aborts with -m32 -ftrapv when passed -9223372036854775808 Date: Wed, 17 Apr 2024 11:30:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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 #5 from Jakub Jelinek --- I wouldn't call it a hack, I'd say it is the right fix. Though, we have tons of those in internal-fn.cc ops.code =3D MULT_EXPR; ops.code =3D MULT_EXPR; ops.code =3D MULT_EXPR; ops.code =3D MULT_EXPR; ops.code =3D MULT_EXPR; ops.code =3D WIDEN_MULT_EXPR; ops.code =3D MULT_HIGHPART_EXPR; ops.code =3D MULT_EXPR; ops.code =3D WIDEN_MULT_EXPR; ops.code =3D MULT_EXPR; ops.code =3D MULT_EXPR; ops.code =3D PLUS_EXPR; ops.code =3D TRUNC_DIV_EXPR; ops.code =3D TRUNC_MOD_EXPR; plus some which reuse earlier set ops.code plus some which use just some variable as ops.code. Sure, I think WIDEN_MULT_EXPR/MULT_HIGHPART_EXPR and= the div/mod neither probably consider flag_trapv, but MULT_EXPR/PLUS_EXPR does (though, perhaps the PLUS_EXPR is for vectors only). So, the question is where to put that. To cover everything, bet best would be to put it into expand_mul_overflow a= nd expand_arith_overflow and expand_vector_ubsan_overflow.=