From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4814 invoked by alias); 18 Jun 2008 14:46:06 -0000 Received: (qmail 4794 invoked by uid 22791); 18 Jun 2008 14:46:03 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 18 Jun 2008 14:45:43 +0000 Received: from zps38.corp.google.com (zps38.corp.google.com [172.25.146.38]) by smtp-out.google.com with ESMTP id m5IEjKp2027887; Wed, 18 Jun 2008 15:45:20 +0100 Received: from smtp.corp.google.com (spacemonkey2.corp.google.com [192.168.120.114]) by zps38.corp.google.com with ESMTP id m5IEjIrp013793 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 18 Jun 2008 07:45:19 -0700 Received: from localhost.localdomain.google.com ([137.122.72.118]) (authenticated bits=0) by smtp.corp.google.com (8.13.8/8.13.8) with ESMTP id m5IEjBZJ008786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 18 Jun 2008 07:45:14 -0700 To: Anatoly Sokolov Cc: gcc-patches@gcc.gnu.org, rth@redhat.com, chertykov@gmail.com Subject: Re: Add more restriction in 'peep2_find_free_register' References: <113229086.20080618021412@post.ru> From: Ian Lance Taylor Date: Wed, 18 Jun 2008 14:47:00 -0000 In-Reply-To: <113229086.20080618021412@post.ru> (Anatoly Sokolov's message of "Wed\, 18 Jun 2008 02\:14\:12 +0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg01169.txt.bz2 Anatoly Sokolov writes: > This patch add two more check in 'peep2_find_free_register' function, which > find free hard registers for use as scratch registers in peephole2. > > * It is not allowed to use register that are being declared as global, as > scratch register. > > * For an interrupt function it is safety to use only call-used registers > which are saved in prologue. In 'rename_registers' optimization pass this > check is done in HARD_REGNO_RENAME_OK macro. This patch add > HARD_REGNO_SCRATCH_OK macro for 'peephole2' pass. The > HARD_REGNO_SCRATCH_OK macro sould be difined for target which use interrupt > and 'match_scratch' in peephole2 (avr, m68k). Please make a new target hook instead (I know that the existing HARD_REGNO_RENAME_OK is still a macro). Thanks. Ian