From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DDB81383940C; Mon, 6 Sep 2021 11:32:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DDB81383940C From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/77899] incorrect VR_RANGE for a signed char function argument Date: Mon, 06 Sep 2021 11:32:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 7.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on assigned_to bug_status 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 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: Mon, 06 Sep 2021 11:32:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D77899 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-09-06 Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot = gnu.org Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 --- Comment #12 from Andrew Pinski --- p_6 =3D &d[130] + _1; if (&MEM [(void *)&d + 2B] > p_6) Even this should be folded but is not currently: void f (signed char i) { char d [260]; const char *p =3D &d[130]; p +=3D i; if (p =3D=3D d + 2 || d + 257 =3D=3D p) __builtin_abort (); } I am thinking ptr_difference_const is not able to handle &MEM [(void *)&d + 2B] correctly.=