From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19800 invoked by alias); 16 Oct 2009 13:21:00 -0000 Received: (qmail 19789 invoked by uid 22791); 16 Oct 2009 13:20:58 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Oct 2009 13:20:54 +0000 Received: from zps38.corp.google.com (zps38.corp.google.com [172.25.146.38]) by smtp-out.google.com with ESMTP id n9GDKqbV024131 for ; Fri, 16 Oct 2009 06:20:53 -0700 Received: from pzk7 (pzk7.prod.google.com [10.243.19.135]) by zps38.corp.google.com with ESMTP id n9GDKoOB017006 for ; Fri, 16 Oct 2009 06:20:50 -0700 Received: by pzk7 with SMTP id 7so1642589pzk.30 for ; Fri, 16 Oct 2009 06:20:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.74.4 with SMTP id w4mr138865wfa.195.1255699250354; Fri, 16 Oct 2009 06:20:50 -0700 (PDT) Date: Fri, 16 Oct 2009 13:28:00 -0000 Message-ID: <7587b290910160620l1266a752n651300451b392e64@mail.gmail.com> Subject: [PATCH: PR target/41705] Enable if conversion for thumb1 by new HAVE_conditional_execution definition From: Carrot Wei To: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg01054.txt.bz2 This patch fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41705 For target ARM HAVE_conditional_execution is enabled because it is supported by ARM ISA. But when compiled to thumb1 instructions, conditional execution is not supported, the enabled HAVE_conditional_execution will disable some if conversion optimizations. Change the macro definition to (!TARGET_THUMB1) so compiler can get the correct value according to the target ISA. Test: This patch was applied to trunk GCC and tested on the arm emulator with newlib. No new failure. ChangeLog: 2009-10-16 Wei Guozhi PR target/41705 * config/arm/arm.h : New definition for macro HAVE_conditional_execution. * ifcvt.c : Change the header files order. thanks Guozhi Index: arm.h =================================================================== --- arm.h (revision 152888) +++ arm.h (working copy) @@ -2753,4 +2753,10 @@ enum arm_builtins #define NEED_INDICATE_EXEC_STACK 0 #endif +/* TARGET_THUMB1 doesn't have conditional execution capability. */ +#ifdef HAVE_conditional_execution +#undef HAVE_conditional_execution +#endif +#define HAVE_conditional_execution (!TARGET_THUMB1) + #endif /* ! GCC_ARM_H */ Index: ifcvt.c =================================================================== --- ifcvt.c (revision 152888) +++ ifcvt.c (working copy) @@ -21,13 +21,13 @@ #include "config.h" #include "system.h" #include "coretypes.h" +#include "insn-config.h" #include "tm.h" #include "rtl.h" #include "regs.h" #include "function.h" #include "flags.h" -#include "insn-config.h" #include "recog.h" #include "except.h" #include "hard-reg-set.h"