From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122308 invoked by alias); 2 Jun 2016 22:23:34 -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 122288 invoked by uid 89); 2 Jun 2016 22:23:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_40,RCVD_IN_DNSWL_LOW,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 spammy=2016-06-03, 20160603, H*Ad:D*com.cn, flag_pic X-HELO: out1134-233.mail.aliyun.com Received: from out1134-233.mail.aliyun.com (HELO out1134-233.mail.aliyun.com) (42.120.134.233) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 Jun 2016 22:23:23 +0000 X-Alimail-AntiSpam:AC=CONTINUE;BC=0.09822676|-1;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03308;MF=chengang@emindsoft.com.cn;NM=1;PH=DS;RN=9;RT=8;SR=0;TI=SMTPD_----4tE3ACY_1464906191; Received: from localhost.localdomain(mailfrom:chengang@emindsoft.com.cn ip:223.72.90.243) by smtp.aliyun-inc.com(10.147.40.200); Fri, 03 Jun 2016 06:23:17 +0800 From: chengang@emindsoft.com.cn To: law@redhat.com Cc: rth@redhat.com, mikestump@comcast.net, gcc-patches@gcc.gnu.org, cmetcalf@ezchip.com, walt@tilera.com, peter.maydell@linaro.org, Chen Gang Subject: [PATCH v2] gcc/config/tilegx/tilegx.c (tilegx_function_profiler): Save r10 to stack before call mcount Date: Thu, 02 Jun 2016 22:23:00 -0000 Message-Id: <1464906189-3453-1-git-send-email-chengang@emindsoft.com.cn> X-SW-Source: 2016-06/txt/msg00233.txt.bz2 From: Chen Gang r10 may also be as parameter stack pointer for the nested function, so need save it before call mcount. 2016-06-03 Chen Gang gcc/ PR target/71331 * config/tilegx/tilegx.c (tilegx_function_profiler): Save r10 to stack before call mcount. --- gcc/config/tilegx/tilegx.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c index 06c832c..bc41105 100644 --- a/gcc/config/tilegx/tilegx.c +++ b/gcc/config/tilegx/tilegx.c @@ -5510,18 +5510,32 @@ tilegx_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED) if (flag_pic) { fprintf (file, + "\t{\n" + "\taddi\tsp, sp, -8\n" + "\tst\tsp, r10\n" + "\t}\n" "\t{\n" "\tmove\tr10, lr\n" "\tjal\tplt(%s)\n" - "\t}\n", MCOUNT_NAME); + "\t}\n" + "\taddi\tsp, sp, 8\n" + "\tld\tr10, sp\n", + MCOUNT_NAME); } else { fprintf (file, + "\t{\n" + "\taddi\tsp, sp, -8\n" + "\tst\tsp, r10\n" + "\t}\n" "\t{\n" "\tmove\tr10, lr\n" "\tjal\t%s\n" - "\t}\n", MCOUNT_NAME); + "\t}\n" + "\taddi\tsp, sp, 8\n" + "\tld\tr10, sp\n", + MCOUNT_NAME); } tilegx_in_bundle = false; -- 1.9.3