From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22542 invoked by alias); 16 May 2002 13:40:23 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 22484 invoked by uid 61); 16 May 2002 13:40:15 -0000 Date: Thu, 16 May 2002 06:40:00 -0000 Message-ID: <20020516134014.22483.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, namsh@kldp.org, nobody@gcc.gnu.org From: jakub@gcc.gnu.org Reply-To: jakub@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, namsh@kldp.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: optimization/6673: gcc-3.1 produces wrong assembly code X-SW-Source: 2002-05/txt/msg00451.txt.bz2 List-Id: Synopsis: gcc-3.1 produces wrong assembly code State-Changed-From-To: open->feedback State-Changed-By: jakub State-Changed-When: Thu May 16 06:40:11 2002 State-Changed-Why: Why do you think this is wrong? If there is no volatile, there is nothing which prevents gcc e.g. with ++a; ++a; ++a to do all the additions at once and store just the final result. Similarly with your testcase, gcc does all additions together and stores the end result after all infinity iterations. Since the loop will never finish, gcc can as well optimize the final store out. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6673