From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 641B7385AC32; Mon, 31 Oct 2022 03:32:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 641B7385AC32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667187159; bh=AWseP2Cmolb5MunfojtUI6DMFlbMlzlHfrF7/5O3h/o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=usGxbIwiTMzlig9gFJwqgGKHdxDYhwPbcv9ffHYua736tP0+sD54qAO4CxAiZRPWu ApqFbgjgYrBRD18CMl5obUuEbGMkpvutCa2d/y3AexwH9S4hZPxRRwE3DZcQCrz/Gh AIaOVXVfIzmAAoZSBkTMGF4tSaatkfW+z31uJvxw= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/105533] UBSAN: gcc/expmed.cc:3272:26: runtime error: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long int' Date: Mon, 31 Oct 2022 03:32:38 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: component cf_gcctarget cf_gcchost 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=3D105533 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|tree-optimization |middle-end Target| |x86_64-pc-linux-gnu Host|x86_64-pc-linux-gnu | --- Comment #1 from Andrew Pinski --- choose_mult_variant (machine_mode mode, HOST_WIDE_INT val, ... synth_mult (&alg2, val - 1, &limit, mode); But slsr should not be processing any of these IR I don't think. _7 =3D _4 * Inf; c$imag_8 =3D (long intD.8) _7; # VUSE <.MEM_16> i.1_9 =3D iD.1980; # RANGE [-2147483648, 2147483647] _10 =3D (long intD.8) i.1_9; c$real_23 =3D c$real_6 * _10; c$imag_24 =3D c$imag_8 * _10; Huh? This does not make sense at all. float _4; float _7; if (tree_fits_shwi_p (rhs2)) return mult_by_coeff_cost (tree_to_shwi (rhs2), lhs_mode, speed); But I don't see that even call that. bool tree_fits_shwi_p (const_tree t) { return (t !=3D NULL_TREE && TREE_CODE (t) =3D=3D INTEGER_CST && wi::fits_shwi_p (wi::to_widest (t))); }=