From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 206A83954C76; Tue, 18 May 2021 11:54:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 206A83954C76 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100499] Different results with -fpeel-loops -ftree-loop-vectorize options Date: Tue, 18 May 2021 11:54:31 +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: 10.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: amker 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 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: Tue, 18 May 2021 11:54:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100499 --- Comment #15 from rguenther at suse dot de --- On Tue, 18 May 2021, amker at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100499 >=20 > --- Comment #14 from bin cheng --- > (In reply to Richard Biener from comment #12) > > So in number_of_iterations_ne it looks like the step 's' is always cons= tant > > which makes me wonder if we can somehow use ranger to tell multiple_of_p > > (type, c, s) > > or at least whether, if c is x * s, the multiplication could have overf= lowed? >=20 > Yeah, I am looking if "multiple of" can be feasibly checked in niter anal= ysis, > with help of some basic information from multiple_of_p. >=20 > BTW, I am not following changes in "ranger", how should I used in analysi= s? or > similar to value range info? I'm not sure - let's see if the ranger folks have any good idea here. Btw, there's tree_ctz which looks more conservative and could be used for power-of-two 's'. split_constant_offset also recently got refactoring to avoid a plethora of overflow issues it ran into, so we can eventually improve multiple_of_p to be correct without pre-conditions. But I fear that for DECL_SIZE & friends where we "know" that multiplications by 8 to get from byte to bit size do not overflow we cannot be too conservative here. Maybe in the end we need to distinguish those with new MULT_NO_OVERFLOW, PLUS_NO_OVERFLOW, etc. When creating those expressions we should already be using size_{bin,un}op. The conversion handling of course still looks bogus to me even in this context.=