From patchwork Thu Aug 5 01:09:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 60912 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 A13771007D1 for ; Thu, 5 Aug 2010 11:10:01 +1000 (EST) Received: (qmail 10015 invoked by alias); 5 Aug 2010 01:09:57 -0000 Received: (qmail 9915 invoked by uid 22791); 5 Aug 2010 01:09:55 -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; Thu, 05 Aug 2010 01:09:50 +0000 Received: (qmail 16369 invoked from network); 5 Aug 2010 01:09:48 -0000 Received: from unknown (HELO ?84.152.192.116?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Aug 2010 01:09:48 -0000 Message-ID: <4C5A0F50.4000904@codesourcery.com> Date: Thu, 05 Aug 2010 03:09:36 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100724 Thunderbird/3.1.1 MIME-Version: 1.0 To: GCC Patches CC: Richard Earnshaw Subject: Fix ARM ldm/stm peephole2 loop 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 With -mtune=xscale, arm_gen_load_multiple_1 doesn't actually generate a load-multiple for two loads, but single instructions. This causes a peephole2 loop where we try to optimize the same instructions over and over again. Fixed by teaching multiple_operation_profitable_p about this situation. Ok? Bernd PR bootstrap/45177 * config/arm/arm.c (multiple_operation_profitable_p): Return false if we'd generate single operations. Index: config/arm/arm.c =================================================================== --- config/arm/arm.c (revision 162821) +++ config/arm/arm.c (working copy) @@ -9185,7 +9192,11 @@ multiple_operation_profitable_p (bool is changes, then the test below needs to be reworked. */ if (nops == 2 && arm_ld_sched && add_offset != 0) return false; - + /* Return false if arm_gen_load_multiple_1 or + arm_gen_store_multiple_1 would just emit single operations. See + the discussion there. */ + if (nops <= 2 && arm_tune_xscale && !optimize_size) + return false; return true; }