From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30656 invoked by alias); 8 Jun 2014 11:27:19 -0000 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 Received: (qmail 30644 invoked by uid 89); 8 Jun 2014 11:27:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 08 Jun 2014 11:27:16 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WtbFn-0006nv-1Y from ChungLin_Tang@mentor.com ; Sun, 08 Jun 2014 04:27:11 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sun, 8 Jun 2014 04:27:10 -0700 Received: from [0.0.0.0] (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Sun, 8 Jun 2014 04:27:09 -0700 Message-ID: <5394488D.6060806@codesourcery.com> Date: Sun, 08 Jun 2014 11:27:00 -0000 From: Chung-Lin Tang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: gcc-patches CC: Richard Earnshaw , Ramana Radhakrishnan , Julian Brown Subject: [PATCH, ARM] MI-thunk fix for TARGET_THUMB1_ONLY Content-Type: multipart/mixed; boundary="------------010405090804060207050900" X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00680.txt.bz2 --------------010405090804060207050900 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Content-length: 676 Hi Richard, Ramana, Attached is a small fix for resolving a g++.old-deja/g++.jason/thunk2.C regression we found under a TARGET_THUMB1_ONLY multilib (-mthumb -march=armv6-m to be exact). Basically under those conditions, the thunk is in Thumb mode, so the subtraction should be 4 rather than 8. Original patch was by Julian, with trivial adaptations for trunk by me. We've been carrying this fix for a while by now. Okay for trunk? (and stable branches?) Thanks, Chung-Lin 2014-06-08 Julian Brown Chung-Lin Tang * config/arm/arm.c (arm_output_mi_thunk): Fix offset for TARGET_THUMB1_ONLY. Add comments. --------------010405090804060207050900 Content-Type: text/x-patch; name="armv6m-mi-thunk.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="armv6m-mi-thunk.patch" Content-length: 837 Index: config/arm/arm.c =================================================================== --- config/arm/arm.c (revision 211353) +++ config/arm/arm.c (working copy) @@ -28428,9 +28428,13 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIB fputs (":\n", file); if (flag_pic) { - /* Output ".word .LTHUNKn-7-.LTHUNKPCn". */ + /* Output ".word .LTHUNKn-[37]-.LTHUNKPCn". */ rtx tem = XEXP (DECL_RTL (function), 0); - tem = plus_constant (GET_MODE (tem), tem, -7); + /* For TARGET_THUMB1_ONLY the thunk is in Thumb mode, so the PC + pipeline offset is four rather than eight. Adjust the offset + accordingly. */ + tem = plus_constant (GET_MODE (tem), tem, + TARGET_THUMB1_ONLY ? -3 : -7); tem = gen_rtx_MINUS (GET_MODE (tem), tem, gen_rtx_SYMBOL_REF (Pmode, --------------010405090804060207050900--