From patchwork Thu May 12 21:58:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 95390 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id BE309B6F10 for ; Fri, 13 May 2011 07:59:16 +1000 (EST) Received: (qmail 1252 invoked by alias); 12 May 2011 21:59:15 -0000 Received: (qmail 1243 invoked by uid 22791); 12 May 2011 21:59:14 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 May 2011 21:58:59 +0000 Received: by qwh5 with SMTP id 5so1160074qwh.20 for ; Thu, 12 May 2011 14:58:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.26.131 with SMTP id e3mr594843qcc.254.1305237538971; Thu, 12 May 2011 14:58:58 -0700 (PDT) Received: by 10.229.182.7 with HTTP; Thu, 12 May 2011 14:58:58 -0700 (PDT) In-Reply-To: References: <20110512195514.GA14028@intel.com> Date: Thu, 12 May 2011 14:58:58 -0700 Message-ID: Subject: Re: PATCH: Change maybe_eh_return to bool From: "H.J. Lu" To: Uros Bizjak Cc: gcc-patches@gcc.gnu.org X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Thu, May 12, 2011 at 2:09 PM, Uros Bizjak wrote: > > FWIW, the return type of ix86_save_reg (and ix86_hard_regno_mode_ok > and perhaps many others...) can also be changed to bool. This patch changes the return type of ix86_save_reg to bool and return value of ix86_hard_regno_mode_ok to bool. OK for trunk? Thanks. 2011-05-12 H.J. Lu * config/i386/i386.c (ix86_save_reg): Change return type to bool. (ix86_hard_regno_mode_ok): Change return value to bool. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 357e57c..c06b45d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -9065,7 +9065,7 @@ ix86_select_alt_pic_regnum (void) } /* Return 1 if we need to save REGNO. */ -static int +static bool ix86_save_reg (unsigned int regno, bool maybe_eh_return) { if (pic_offset_table_rtx @@ -9074,11 +9074,7 @@ ix86_save_reg (unsigned int regno, bool maybe_eh_return) || crtl->profile || crtl->calls_eh_return || crtl->uses_const_pool)) - { - if (ix86_select_alt_pic_regnum () != INVALID_REGNUM) - return 0; - return 1; - } + return ix86_select_alt_pic_regnum () == INVALID_REGNUM; if (crtl->calls_eh_return && maybe_eh_return) { @@ -9089,12 +9085,12 @@ ix86_save_reg (unsigned int regno, bool maybe_eh_return) if (test == INVALID_REGNUM) break; if (test == regno) - return 1; + return true; } } if (crtl->drap_reg && regno == REGNO (crtl->drap_reg)) - return 1; + return true; return (df_regs_ever_live_p (regno) && !call_used_regs[regno] @@ -29010,7 +29006,7 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode) if (GET_MODE_CLASS (mode) == MODE_CC || GET_MODE_CLASS (mode) == MODE_RANDOM || GET_MODE_CLASS (mode) == MODE_PARTIAL_INT) - return 0; + return false; if (FP_REGNO_P (regno)) return VALID_FP_MODE_P (mode); if (SSE_REGNO_P (regno)) @@ -29040,26 +29036,26 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode) /* Take care for QImode values - they can be in non-QI regs, but then they do cause partial register stalls. */ if (regno <= BX_REG || TARGET_64BIT) - return 1; + return true; if (!TARGET_PARTIAL_REG_STALL) - return 1; - return reload_in_progress || reload_completed; + return true; + return reload_in_progress != 0 || reload_completed != 0; } /* We handle both integer and floats in the general purpose registers. */ else if (VALID_INT_MODE_P (mode)) - return 1; + return true; else if (VALID_FP_MODE_P (mode)) - return 1; + return true; else if (VALID_DFP_MODE_P (mode)) - return 1; + return true; /* Lots of MMX code casts 8 byte vector modes to DImode. If we then go on to use that value in smaller contexts, this can easily force a pseudo to be allocated to GENERAL_REGS. Since this is no worse than supporting DImode, allow it. */ else if (VALID_MMX_REG_MODE_3DNOW (mode) || VALID_MMX_REG_MODE (mode)) - return 1; + return true; - return 0; + return false; } /* A subroutine of ix86_modes_tieable_p. Return true if MODE is a