From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 497 invoked by alias); 23 Dec 2010 08:13:52 -0000 Received: (qmail 487 invoked by uid 22791); 23 Dec 2010 08:13:50 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-vw0-f47.google.com (HELO mail-vw0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Dec 2010 08:13:47 +0000 Received: by vws6 with SMTP id 6so2315496vws.20 for ; Thu, 23 Dec 2010 00:13:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.195.195 with SMTP id ed3mr2280935vcb.10.1293092025603; Thu, 23 Dec 2010 00:13:45 -0800 (PST) Received: by 10.220.12.83 with HTTP; Thu, 23 Dec 2010 00:13:45 -0800 (PST) Date: Thu, 23 Dec 2010 08:13:00 -0000 Message-ID: Subject: register allocation From: roy rosen To: gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg00447.txt.bz2 Hi All, I am looking at the code generated by my port and it seems that I have a problem that too many copies between registers are generated. I looked a bit at the register allocation and wanted to verify that I understand its behavior. Is that true that it first chooses a register class for each pseodo and only then starts coloring? I think that my problem is that in my architecture there are two register classes which can do all arithmetic operation but class X can also do loads and stores and class Y can also do DSP operations. So when there are for example two DSP operations and between them some arithmetic operations I expect to use only class Y but GCC prefers to copy registers and do the arithmetic operations using X because for some reason it determined that the prefered class for the registers in the arithmetic operations is X. It seems that determining the class does not look at the whole flow but rather looks only at insns in which the register appears. Do I understand the situation correctly? Is there something I can do about it? Thanks, Roy.