From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0770C3882103; Wed, 17 May 2023 19:07:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0770C3882103 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684350450; bh=IX/4JSkJeWQOmcqD0Dfx67A1sZauc9k8rFAV2+zfo4Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JJCXR1tUoBz5gFFUYaBRffp8OSDiVKAJpHCIp4gBNPMBM32v2nx9LeP0EQUSkyR50 g4dBbTN5nXYB7UiwmcH1dMvX97zs24tj+yCy3I2oAyTLhHExbBnBWA8/t6zn4AsIBU 0LlLH068NlKgEIKvv8o+8WR22phw4JHYYUn8fy8Q= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/109886] UBSAN error: shift exponent 64 is too large for 64-bit type when compiling gcc.c-torture/compile/pr96796.c Date: Wed, 17 May 2023 19:07:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: bug_status cf_reconfirmed_on blocked keywords everconfirmed 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=3D109886 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2023-05-17 Blocks| |63426 Keywords| |ice-on-valid-code Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski --- Breakpoint 6, range_cast (r=3D..., type=3D) = at /home/apinski/src/upstream-gcc/gcc/gcc/range-op.cc:4853 4853 Value_Range tmp (r); Confirmed. The code looks like: ``` int g_5, func_1_l_32, func_50___trans_tmp_31; ... int func_1() { func_50(g_3_4, g_5, func_1_l_32, 8, 3); } ... struct S0 *func_50(int p_51, struct S0 p_52, struct S1 p_53, int p_54, int p_55) { ... } ``` Code in gcc: if (TREE_CODE (arg) =3D=3D SSA_NAME && param_type /* Limit the ranger query to integral types as the rest of this file uses value_range's, which only hold integers and pointers. */ && irange::supports_p (TREE_TYPE (arg)) && get_range_query (cfun)->range_of_expr (vr, arg) && !vr.undefined_p ()) { value_range resvr =3D vr; range_cast (resvr, param_type); if (!resvr.undefined_p () && !resvr.varying_p ()) ipa_set_jfunc_vr (jfunc, &resvr); else gcc_assert (!jfunc->m_vr); } else gcc_assert (!jfunc->m_vr); Maybe there should be an extra check for `irange::supports_p (param_type)` = too to catch the case where param_type type is not supported at all. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D63426 [Bug 63426] [meta-bug] Issues found with -fsanitize=3Dundefined=