From patchwork Sat Jan 18 00:46:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 1225084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-517638-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=wfhoYeZQ; dkim=pass (2048-bit key; unprotected) header.d=marvell.com header.i=@marvell.com header.a=rsa-sha256 header.s=pfpt0818 header.b=PrUbsy6D; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47zzlv75hzz9s1x for ; Sat, 18 Jan 2020 11:47:05 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=eTbu9BPwBRAOvXk0IpLBXCyNm2v1o2TZyWbIdgn4adlOlPDGLO 4q+HoMrF0XQa0Ay1uWH3mh5QolK0l28BRmZAufGuHOiFjed1/r5ZH+VSg78JwKxb 86FMgCeBNCtFbm9SknyR/HSpvzFeMzL1OCfMnarmaJwSZPgJwNAb1l9xM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=NzJoDtNi0ZRKpFt3ysEUUIJL3FQ=; b=wfhoYeZQX3Loe4srS4op actYKEHEvQXeXxCxPH/dvUObrmAyEXsutVQeI99mdrJ0jH/5zyJy6bXt42rl63e+ RxjzzswY5uZeqLNCIYtwmSj//4eSj55sMsUCnjgQdu1nM6gP+lgSp2h36HeF9MXZ izEbCBbRRNbeCnbqyySQVtQ= Received: (qmail 49649 invoked by alias); 18 Jan 2020 00:46:57 -0000 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 Received: (qmail 49641 invoked by uid 89); 18 Jan 2020 00:46:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=18227 X-HELO: mx0b-0016f401.pphosted.com Received: from mx0b-0016f401.pphosted.com (HELO mx0b-0016f401.pphosted.com) (67.231.156.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 18 Jan 2020 00:46:55 +0000 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00I0kNI0006704 for ; Fri, 17 Jan 2020 16:46:53 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0818; bh=3WzY7csoYo8AjgcGWI1DdsDaCtpJwbBoVtfGIIpcXoE=; b=PrUbsy6DJomX3R0kaePWuzPM7UeR2zDOTNoAeGoge2ZlPWqln7s96ZTBpzX6S9UWBqM/ 3nTZdK2/Zb4Ux9OzY0mvWfbPB1MYJ3AYsKxg5cX2TdN8/6LfuzCo6DxfbNwbWGy3oV9t pSc2vLUa42Qrrpbh6QjalO/tPIX17OI6g8xFKUaF6T6QmgshEYewZRFHHjrlP7P4quwQ SDH4BWtPM0X9lkrDfT16khVtR5HPLyrFL47DkfSN/xasSNs3mu2Jkt4O08TtyYKFh5wT MAD59emzqOuW9gTeot/mmCmGH8v8WQLcDSfrlCxOUsbz08vcATfqZvy1FEMJnu4fN8KC MA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2xk0sn53yt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 17 Jan 2020 16:46:53 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 17 Jan 2020 16:46:51 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 17 Jan 2020 16:46:51 -0800 Received: from linux.pinskiwright.org.com (unknown [10.104.47.220]) by maili.marvell.com (Postfix) with ESMTP id 50E2E3F703F; Fri, 17 Jan 2020 16:46:47 -0800 (PST) From: To: CC: Andrew Pinski Subject: [PATCH] Fix PR 93242: patchable-function-entry broken on MIPS Date: Fri, 17 Jan 2020 16:46:23 -0800 Message-ID: <1579308383-22325-1-git-send-email-apinski@marvell.com> MIME-Version: 1.0 From: Andrew Pinski On MIPS, .set noreorder/reorder needs to emitted around the nop. The template for the nop instruction uses %(/%) to do that. But default_print_patchable_function_entry uses fprintf rather than output_asm_insn to output the instruction. This fixes the problem by using output_asm_insn to emit the nop instruction. OK? Bootstrapped and tested on x86_64-linux-gnu and built a full mips toolchain also. Thanks, Andrew Pinski ChangeLog: * targhooks.c (default_print_patchable_function_entry): Use output_asm_insn to emit the nop instruction. Change-Id: I9d7cff2fc227a41461b9068e3af1fd3a5a9c059b --- gcc/targhooks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 4819bb8..415c21b 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -1822,7 +1822,7 @@ default_print_patchable_function_entry (FILE *file, unsigned i; for (i = 0; i < patch_area_size; ++i) - fprintf (file, "\t%s\n", nop_templ); + output_asm_insn (nop_templ, NULL); } bool