From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25885 invoked by alias); 20 Dec 2002 09:26:04 -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 25868 invoked by uid 71); 20 Dec 2002 09:26:03 -0000 Date: Fri, 20 Dec 2002 01:26:00 -0000 Message-ID: <20021220092603.25867.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Christian Ehrhardt" Subject: Re: optimization/7799: [3.2/3.3 regression] Loop bug with optimization flag -Os in gcc Reply-To: "Christian Ehrhardt" X-SW-Source: 2002-12/txt/msg01081.txt.bz2 List-Id: The following reply was made to PR optimization/7799; it has been noted by GNATS. From: "Christian Ehrhardt" To: Segher Boessenkool Cc: nejataydin@superonline.com, gcc-gnats@gcc.gnu.org, gcc@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Subject: Re: optimization/7799: [3.2/3.3 regression] Loop bug with optimization flag -Os in gcc Date: Fri, 20 Dec 2002 10:23:56 +0100 On Thu, Dec 19, 2002 at 05:33:49PM +0100, Segher Boessenkool wrote: > > This transformation is IMHO illegal because there is no way to make the > > comparison in general equivialent to that in the original for loop. > > If p is initially 0x7ffffffc the comparison must be treated as unsigned, > > however, if p is initially 0xfffffffc the comparison must be treated as > > signed. > > >From C99 final draft (I wish I had the final version of the standard): > > [ arrays can't wrap around address 0 ] Thanks. Others pointed this out as well. > The comparison should always be unsigned; I don't remember the x86 ISA well > enough to know if jle is unsigned, but I believe so. That's the point: jle is signed. jbe is unsigned. The signedness of the comparison is derived from the type of i which is wrong after elimination of the loop variable. regards Christian -- THAT'S ALL FOLKS!