From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 82EAE3858412; Thu, 16 Dec 2021 20:00:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82EAE3858412 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/102697] [12 Regression] overflow warning missing after -O2 vectorization Date: Thu, 16 Dec 2021 20:00:22 +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: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor 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: 12.0 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2021 20:00:22 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102697 --- Comment #4 from Martin Sebor --- The warning for the test in comment #0 fails to trigger because of the hack below in pointer-query.cc: /* A helper of compute_objsize_r() to determine the size from MEM_REF MREF. Return true on success and false on failure. */ static bool handle_mem_ref (tree mref, gimple *stmt, int ostype, access_ref *pref, ssa_name_limit_t &snlim, pointer_query *qry) { gcc_assert (TREE_CODE (mref) =3D=3D MEM_REF); tree mreftype =3D TYPE_MAIN_VARIANT (TREE_TYPE (mref)); if (VECTOR_TYPE_P (mreftype)) { /* Hack: Handle MEM_REFs of vector types as those to complete objects; those may be synthesized from multiple assignments to consecutive data members (see PR 93200 and 96963). FIXME: Vectorized assignments should only be present after vectorization so this hack is only necessary after it has run and could be avoided in calls from prior passes (e.g., tree-ssa-strlen.c). FIXME: Deal with this more generally, e.g., by marking up such MEM_REFs at the time they're created. */ ostype =3D 0; }=