From patchwork Mon Sep 27 17:31:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Zhang X-Patchwork-Id: 65888 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 66EC4B70F6 for ; Tue, 28 Sep 2010 03:31:09 +1000 (EST) Received: (qmail 9236 invoked by alias); 27 Sep 2010 17:31:07 -0000 Received: (qmail 9217 invoked by uid 22791); 27 Sep 2010 17:31:06 -0000 X-SWARE-Spam-Status: No, hits=-1.9 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; Mon, 27 Sep 2010 17:31:02 +0000 Received: (qmail 25259 invoked from network); 27 Sep 2010 17:31:00 -0000 Received: from unknown (HELO ?192.168.1.106?) (jie@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 Sep 2010 17:31:00 -0000 Message-ID: <4CA0D4D5.50503@codesourcery.com> Date: Tue, 28 Sep 2010 01:31:01 +0800 From: Jie Zhang User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100918 Icedove/3.1.4 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: [ARM] Use r9 or r10 as the PIC register only when TARGET_32BIT 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 I'm investigating FAIL: gcc.target/arm/pr42495.c (internal compiler error) FAIL: gcc.target/arm/pr42495.c (test for excess errors) FAIL: gcc.target/arm/pr42495.c scan-rtl-dump hoist "PRE/HOIST: end of bb .* copying expression": dump file does not exist for arm-uclinuxeabi target. The cause of the ICE is because GCC uses r9 as the PIC register for thumb1 code. This patch should fix it. The original line of the code is several years old. It might have been broken for a long time. It could be no one use -fpic on ARM uClinux or -msingle-pic-base on other arm targets. Or I missed something. Does this patch look OK? This patch fixes the above FAILs, but I have not fully tested it. I will do the regression testing with some other patches in a few days. Regards, * config/arm/arm.c (arm_option_override): Use r9 or r10 as the PIC register only when TARGET_32BIT. Index: config/arm/arm.c =================================================================== --- config/arm/arm.c (revision 164646) +++ config/arm/arm.c (working copy) @@ -1868,7 +1868,7 @@ arm_option_override (void) /* If stack checking is disabled, we can use r10 as the PIC register, which keeps r9 available. The EABI specifies r9 as the PIC register. */ - if (flag_pic && TARGET_SINGLE_PIC_BASE) + if (flag_pic && TARGET_SINGLE_PIC_BASE && TARGET_32BIT) { if (TARGET_VXWORKS_RTP) warning (0, "RTP PIC is incompatible with -msingle-pic-base");