From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E42F0396E849; Fri, 1 May 2020 22:21:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E42F0396E849 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588371673; bh=YBkoLskL1IHtHK8dlB9wHxik8A6dSDz3dIkulh9EFaY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=J9nDdd9KIUYeaMj8woaSjNQ9bc7p8zlI8SMNlqhkzWjDy3wTD2QyMkXfCyTXqAAoy yo8QIQrrlUeMFS5/xMdIIImCZrUl1XA+KxTLSeMLJBwHvq0Npss2qyoKK2mIJ89A+u J3/tiNrTrDP5XMxy4M7xJ9NcSijbi33TpdpeqH/4= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/94911] Failure to optimize comparisons of VLA sizes Date: Fri, 01 May 2020 22:21:13 +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.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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 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: Fri, 01 May 2020 22:21:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94911 --- Comment #2 from Andrew Pinski --- (In reply to Marc Glisse from comment #1) > gcc computes sizeof(a) as 4ul*(size_t)n, and unsigned types don't provide > nice overflow guarantees, so that complicates things. While the C++ front-end does: (sizetype) ((ssizetype) n + -1) + 1) * 4)=