From patchwork Wed Jul 7 12:42:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 58115 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 BA1C3B6EF3 for ; Wed, 7 Jul 2010 22:43:24 +1000 (EST) Received: (qmail 18192 invoked by alias); 7 Jul 2010 12:43:23 -0000 Received: (qmail 18183 invoked by uid 22791); 7 Jul 2010 12:43:22 -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; Wed, 07 Jul 2010 12:43:18 +0000 Received: (qmail 28884 invoked from network); 7 Jul 2010 12:43:16 -0000 Received: from unknown (HELO ?84.152.177.221?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 Jul 2010 12:43:16 -0000 Message-ID: <4C347625.5060104@codesourcery.com> Date: Wed, 07 Jul 2010 14:42:13 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100625 Thunderbird/3.0.5 MIME-Version: 1.0 To: GCC Patches Subject: Split constants in lower-subreg 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 I noticed that sometimes DImode registers weren't being eliminated in the lower-subreg pass when there were simple move-constant insns such as (set (reg:DI x) (const_int 0)) This patch seems to cure it. Bootstrapped and regression tested on i686-linux. Ok? Bernd * lower-subreg.c (simple_move_operand): Accept constants. (simple_move): Get mode from destination, not source. Index: lower-subreg.c =================================================================== --- lower-subreg.c (revision 161824) +++ lower-subreg.c (working copy) @@ -76,7 +76,7 @@ simple_move_operand (rtx x) if (GET_CODE (x) == SUBREG) x = SUBREG_REG (x); - if (!OBJECT_P (x)) + if (!OBJECT_P (x) && !CONSTANT_P (x)) return false; if (GET_CODE (x) == LABEL_REF @@ -131,7 +131,7 @@ simple_move (rtx insn) registers. That means that we can't decompose if this is a non-integer mode for which there is no integer mode of the same size. */ - mode = GET_MODE (SET_SRC (set)); + mode = GET_MODE (SET_DEST (set)); if (!SCALAR_INT_MODE_P (mode) && (mode_for_size (GET_MODE_SIZE (mode) * BITS_PER_UNIT, MODE_INT, 0) == BLKmode))