From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16519 invoked by alias); 22 Jan 2002 06:21:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 16466 invoked from network); 22 Jan 2002 06:20:56 -0000 Received: from unknown (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sources.redhat.com with SMTP; 22 Jan 2002 06:20:56 -0000 Received: from hiauly1.hia.nrc.ca (localhost [127.0.0.1]) by hiauly1.hia.nrc.ca (8.12.0.Beta16/8.12.0.Beta16) with ESMTP id g0M6KtFN013322; Tue, 22 Jan 2002 01:20:55 -0500 (EST) Received: (from dave@localhost) by hiauly1.hia.nrc.ca (8.12.0.Beta16/8.12.0.Beta16) id g0M6KsB6013321; Tue, 22 Jan 2002 01:20:54 -0500 (EST) Message-Id: <200201220620.g0M6KsB6013321@hiauly1.hia.nrc.ca> Subject: Re: Fix predicate in decrement_and_branch_until_zero pattern on PA To: rth@redhat.com (Richard Henderson) Date: Mon, 21 Jan 2002 22:48:00 -0000 From: "John David Anglin" Cc: gcc-patches@gcc.gnu.org, law@redhat.com In-Reply-To: <20020121162442.U19335@redhat.com> from "Richard Henderson" at Jan 21, 2002 04:24:42 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg01468.txt.bz2 > On Mon, Jan 21, 2002 at 06:29:42PM -0500, John David Anglin wrote: > > Isn't 'r' still preferred if a reload isn't needed? The predicate > > ensures that the operand is always a register operand before reload. > > Sorry, "penalized" not "preferred". "r" is preferred because of > lack of "*", but should also not be penalized with "!". The following simple program compiled at -O2 on the PA with the current mainline code uses the decrement_and_branch_until_zero pattern. main () { int i; int j=0; for (i =0; i < 10; i++) j=j+1; exit (j); } The loop variable after combine ends up in a register (%r19) and not a memory location. Thus, the interpretation that "!" always severely disparages an alternative is not correct. On a different subject, I don't know why the loop wasn't eliminated as the compiler determined the final result for j. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605)