From patchwork Thu Jul 21 13:07:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 106041 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 726B6B6F80 for ; Thu, 21 Jul 2011 23:07:54 +1000 (EST) Received: (qmail 13709 invoked by alias); 21 Jul 2011 13:07:53 -0000 Received: (qmail 13701 invoked by uid 22791); 21 Jul 2011 13:07:52 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_ZJ, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-pv0-f175.google.com (HELO mail-pv0-f175.google.com) (74.125.83.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Jul 2011 13:07:36 +0000 Received: by pvf24 with SMTP id 24so1274047pvf.20 for ; Thu, 21 Jul 2011 06:07:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.254.21 with SMTP id b21mr101942wfi.249.1311253656368; Thu, 21 Jul 2011 06:07:36 -0700 (PDT) Received: by 10.142.89.19 with HTTP; Thu, 21 Jul 2011 06:07:36 -0700 (PDT) Date: Thu, 21 Jul 2011 15:07:36 +0200 Message-ID: Subject: [PATCH, i386]: Reject wrong RTXes from index early From: Uros Bizjak To: gcc-patches@gcc.gnu.org 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 Hello! Just a small optimization, we can reject non-register RTXes and wrong subregs from index early. No functional change - these RTXes were rejected in ix86_legitimate_address_p anyway. 2011-07-21 Uros Bizjak * config/i386/i386.c (ix86_decompose_address): Reject all but register operands and DImode hard registers in index. Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN. Uros. Index: i386.c =================================================================== --- i386.c (revision 176550) +++ i386.c (working copy) @@ -11203,7 +11203,9 @@ ; /* Allow only subregs of DImode hard regs. */ else if (GET_CODE (index) == SUBREG - && !register_no_elim_operand (SUBREG_REG (index), DImode)) + && register_no_elim_operand (SUBREG_REG (index), DImode)) + ; + else return 0; }