From patchwork Fri Aug 12 13:59:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramana Radhakrishnan X-Patchwork-Id: 109841 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 96A32B6F80 for ; Fri, 12 Aug 2011 23:59:58 +1000 (EST) Received: (qmail 20601 invoked by alias); 12 Aug 2011 13:59:54 -0000 Received: (qmail 20336 invoked by uid 22791); 12 Aug 2011 13:59:52 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, TW_TB X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Aug 2011 13:59:39 +0000 Received: by qwh5 with SMTP id 5so1758739qwh.20 for ; Fri, 12 Aug 2011 06:59:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.34.20 with SMTP id j20mr625858qad.60.1313157578218; Fri, 12 Aug 2011 06:59:38 -0700 (PDT) Received: by 10.224.89.67 with HTTP; Fri, 12 Aug 2011 06:59:38 -0700 (PDT) Date: Fri, 12 Aug 2011 14:59:38 +0100 Message-ID: Subject: [Patch ARM] Fix PR target/48328 part 1 From: Ramana Radhakrishnan To: gcc-patches Cc: Patch Tracking 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 Hi, The Thumb2 tbh instruction can take half word values that are multiplied by 2 which implies the maximum offset is 0x1FFFF when you add it to the pc , rather than 0xFFF which is what the current range check of 0x2000 for HImode values indicates. Checked that a pre-compiled insn-recog.i that I had lying around got about 5 more tbh's *and* assembled and generally looks sane. Tests running for T2 v7-a on qemu. Will commit after results come out. cheers Ramana 2011-08-12 Ramana Radhakrishnan PR target/48328 * config/arm/arm.h (CASE_VECTOR_SHORTEN_MODE): Fix distance for tbh instructions. : QImode)) diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 869b9a9..0a6e6f2 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1906,7 +1906,7 @@ typedef struct : min >= -4096 && max < 4096 \ ? (ADDR_DIFF_VEC_FLAGS (body).offset_unsigned = 0, HImode) \ : SImode) \ - : ((min < 0 || max >= 0x2000 || !TARGET_THUMB2) ? SImode \ + : ((min < 0 || max >= 0x20000 || !TARGET_THUMB2) ? SImode \ : (max >= 0x200) ? HImode \