From patchwork Tue Jun 28 08:18:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Earnshaw X-Patchwork-Id: 102337 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 1B8B2B6F70 for ; Tue, 28 Jun 2011 18:19:02 +1000 (EST) Received: (qmail 27115 invoked by alias); 28 Jun 2011 08:18:59 -0000 Received: (qmail 27104 invoked by uid 22791); 28 Jun 2011 08:18:58 -0000 X-SWARE-Spam-Status: No, hits=2.2 required=5.0 tests=AWL, BAYES_20, RCVD_IN_DNSWL_NONE, RCVD_IN_JMF_BL, SARE_RECV_FREESERVE X-Spam-Check-By: sourceware.org Received: from smtp5.freeserve.com (HELO smtp5.freeserve.com) (193.252.22.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Jun 2011 08:18:41 +0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3423.me.freeserve.com (SMTP Server) with ESMTP id ECD35C000317 for ; Tue, 28 Jun 2011 10:18:38 +0200 (CEST) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf3423.me.freeserve.com (SMTP Server) with ESMTP id DF3BCC000330 for ; Tue, 28 Jun 2011 10:18:38 +0200 (CEST) Received: from barnowl.buzzard.freeserve.co.uk (unknown [95.148.210.140]) by mwinf3423.me.freeserve.com (SMTP Server) with ESMTP id C02DBC000317 for ; Tue, 28 Jun 2011 10:18:38 +0200 (CEST) Received: from [192.168.2.11] (unknown [192.168.2.11]) by barnowl.buzzard.freeserve.co.uk (Postfix) with ESMTP id 3D49FC8026F for ; Tue, 28 Jun 2011 09:18:38 +0100 (BST) Message-ID: <4E098E5D.30900@buzzard.freeserve.co.uk> Date: Tue, 28 Jun 2011 09:18:37 +0100 From: Richard Earnshaw User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: GCC Patches Subject: [ARM] fix PR target/48637 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 For a long time now the compiler has permitted printing a symbol with the %c operator, but for some reason we've never permitted symbol+offset. This patch fixes this omission and also makes the compiler slightly more friendly to users of ASM statements by not generating an ICE when it can't handle an expression. Tested on arm-eabi and installed on trunk. This is not a regression, so I don't propose to back-port it to older compilers (though doing so would most-likely be trivial). R. 2011-06-27 Richard Earnshaw PR target/48637 * arm.c (arm_print_operand): Allow sym+offset. Don't abort on invalid asm operands. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index efffcf8..8b9cb25 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -16242,8 +16242,17 @@ arm_print_operand (FILE *stream, rtx x, int code) output_addr_const (stream, x); break; + case CONST: + if (GET_CODE (XEXP (x, 0)) == PLUS + && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF) + { + output_addr_const (stream, x); + break; + } + /* Fall through. */ + default: - gcc_unreachable (); + output_operand_lossage ("Unsupported operand for code '%c'", code); } return;