From patchwork Mon Oct 11 00:58:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 67376 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 F1AADB70AE for ; Mon, 11 Oct 2010 11:58:42 +1100 (EST) Received: (qmail 11716 invoked by alias); 11 Oct 2010 00:58:40 -0000 Received: (qmail 11707 invoked by uid 22791); 11 Oct 2010 00:58:39 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Oct 2010 00:58:34 +0000 Received: (qmail 9458 invoked from network); 11 Oct 2010 00:58:32 -0000 Received: from unknown (HELO codesourcery.com) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Oct 2010 00:58:32 -0000 Date: Sun, 10 Oct 2010 20:58:30 -0400 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Subject: [PATCH] use immediate_operand in nonmemory_operand Message-ID: <20101011005829.GB24720@nightcrawler> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 This patch replaces complex conditionals in nonmemory_operand with a call to immediate_operand, which contains the same conditionals. Bootstrapped on x86_64-unknown-linux-gnu. OK to commit? -Nathan * recog.c (nonmemory_operand): Call immediate_operand for CONSTANT_P operands. diff --git a/gcc/recog.c b/gcc/recog.c index 368783f..e16a85c 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1158,24 +1158,7 @@ int nonmemory_operand (rtx op, enum machine_mode mode) { if (CONSTANT_P (op)) - { - /* Don't accept CONST_INT or anything similar - if the caller wants something floating. */ - if (GET_MODE (op) == VOIDmode && mode != VOIDmode - && GET_MODE_CLASS (mode) != MODE_INT - && GET_MODE_CLASS (mode) != MODE_PARTIAL_INT) - return 0; - - if (CONST_INT_P (op) - && mode != VOIDmode - && trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op)) - return 0; - - return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode - || mode == VOIDmode) - && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op)) - && LEGITIMATE_CONSTANT_P (op)); - } + return immediate_operand (op, mode); if (GET_MODE (op) != mode && mode != VOIDmode) return 0;