From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8967 invoked by alias); 31 Jan 2013 09:29:12 -0000 Received: (qmail 8817 invoked by uid 48); 31 Jan 2013 09:28:32 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/53073] [4.8 Regression] 464.h264ref in SPEC CPU 2006 miscompiled Date: Thu, 31 Jan 2013 09:29:00 -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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-01/txt/msg02851.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53073 --- Comment #12 from Jakub Jelinek 2013-01-31 09:28:28 UTC --- FYI, regarding validity in C89, the wording there is similar to C99. ISO C89, 6.3.1.2 says that d[++k] is equivalent to: (*((d)+(++k))) and ++k in the last iteration is 16, so it is (*(d+16)) and then 6.3.6 part applies: "Unless both the pointer operand and the result point to elements of the same array object, or the pointer operand points one past the last element of an array object and the result points to an element of the same array object, the behavior is undefined if the result is used as an operand of the unary * operator." Here the pointer operand points to the first element of array (&d[0]) and the result points one past the last element of the array object, so again, the behavior is undefined.