From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6AD283858C52; Mon, 3 Jul 2023 08:40:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AD283858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688373643; bh=ZxSBjZ0n57I52FxLZ+3lQHUA7TvuzTQyM5lTxKuLDk0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=q9CTR9euxHxGBJv/arBVG9CP1wAOM6Rc1q6WOu9zq+cRP60GU9USgee9BNP2eVyLD dDddUrhRDugRtIWouJG4z/Idssmkv9D5VBjiXZXWqhDloNyVN8Qc1Lw1H/U0N9j4pI Qj+9HKQuHT4G8OZznQ7CvYmbEW3RUv8kOiVp22ec= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110495] fre introduces signed wrap for vector Date: Mon, 03 Jul 2023 08:40:42 +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: rguenth 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=3D110495 --- Comment #3 from Richard Biener --- OK, that's a reasonable stance give we have VL vectors. I'll note that previously build_vector looked like the following, so TREE_OVERFLOW was set according to the encoded elements. Now that's no longer the case. I'll post a patch for comments. /* Return a new VECTOR_CST node whose type is TYPE and whose values are in a list pointed to by VALS. */ tree build_vector_stat (tree type, tree *vals MEM_STAT_DECL) { int over =3D 0; unsigned cnt =3D 0; tree v =3D make_vector (TYPE_VECTOR_SUBPARTS (type)); TREE_TYPE (v) =3D type; /* Iterate through elements and check for overflow. */ for (cnt =3D 0; cnt < TYPE_VECTOR_SUBPARTS (type); ++cnt) { tree value =3D vals[cnt]; VECTOR_CST_ELT (v, cnt) =3D value; /* Don't crash if we get an address constant. */ if (!CONSTANT_CLASS_P (value)) continue; over |=3D TREE_OVERFLOW (value); } TREE_OVERFLOW (v) =3D over; return v;=