From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14590 invoked by alias); 10 May 2015 21:43:41 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14543 invoked by uid 48); 10 May 2015 21:43:37 -0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/66090] Wrong loop code generation with -O2 on ARM Date: Sun, 10 May 2015 21:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: bug_status resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-05/txt/msg00805.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66090 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #2 from Andrew Pinski --- Since the pointer is wrapping to null, you need to use -fno-delete-null-pointer-checks to disable removing of checks of null pointers or rather it enables allowing pointers to wrap to become null. In C, once a pointer is non-null, it can't become null by adding a value to it. So GCC enables an optimization around that case (and fno-delete-null-pointer-checks disables that optimization). So no GCC bug, just wrongly assuming pointers can't become null pointers if they were not null pointers.