Message ID | 20230323105959.1449936-1-yunqiang.su@cipunited.com |
---|---|
State | Accepted |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2839848wrt; Thu, 23 Mar 2023 04:00:33 -0700 (PDT) X-Google-Smtp-Source: AK7set9xhgnrQDXuudtwwVCP/oDRYWEl1bscVPtQxEp6ZHA4ko/FiPllYnKy/gD+IdzKT5IW+xdg X-Received: by 2002:a17:906:abd2:b0:918:668d:d6f9 with SMTP id kq18-20020a170906abd200b00918668dd6f9mr9839079ejb.16.1679569233114; Thu, 23 Mar 2023 04:00:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679569233; cv=pass; d=google.com; s=arc-20160816; b=h3kXF8x016gsnbPovy8f6cV1uZdMhVPANOFQF+/v9K3MpJkb2tvFEIA+NeWTAx3l+K Zt/l+HIY9yUpl0XBWO1Oz7Nyc/ULnkuTnEXAlufcGPzTfHiYt1TpP1q1rBTXKzWkFs46 bf4xhu7OF6r9DVH7SWaAqdHfbfqGlaWB1gCkIBmyhq6UHuSwADmZ+xOxEmjDxy/GEIg1 SlTfVELuob+IFtLxwOGs+YPRUplsgyUQvf/iDQoMSYtFSIDpTFru1YyCZpq6XimD/Thc wAOSBTwT7IZxWo48b3F72JTKwQWLAR5oZNPbnjzpm5NTLeM3gyzRiUj8OEPIxTVQQH75 IR5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature:dmarc-filter:delivered-to; bh=PHMFDi4ITsg1GyzLg/2JyTp3I3FQCN2BASoutyC3kzo=; b=fkEVr7M344FlcxJLE/xYtOXuNn4IHsiIPnnNsqRoEmzVVN8DaS1sOIiaq5jpzCsMex B7p3gn81zoCXI+ulKPc0+UeRikDK9fYkvlMfWHrUYwiYzDDO8+9ViPQb617dMZGTis4w NLJ474Jdt7hQXdbO5bReHxzm72iguR7+hgYKxNYdXQTlek74OpaSiNvf3JpEsWW1T5jo Dq+cyiNGF1mwolQ9jE+oeHsZKS3dlCpktwmb1tGl+656ZnzG3bp6e5gKRPhj1kp4Il/+ /5k/yXgxMp37CSH+eWX/3IIhCtd+pcn3vw6JMsAN2km3P/Ust7zE4cDwvXg8BWX5aMjg 3+tQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=wXDmQgKF; arc=pass (i=1 spf=pass spfdomain=cipunited.com dkim=pass dkdomain=cipunited.com dmarc=pass fromdomain=cipunited.com); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id v6-20020a170906380600b00924e2d60bd4si16323488ejc.168.2023.03.23.04.00.32 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 04:00:33 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=wXDmQgKF; arc=pass (i=1 spf=pass spfdomain=cipunited.com dkim=pass dkdomain=cipunited.com dmarc=pass fromdomain=cipunited.com); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CF121387089C for <ouuuleilei@gmail.com>; Thu, 23 Mar 2023 11:00:31 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on20725.outbound.protection.outlook.com [IPv6:2a01:111:f400:feab::725]) by sourceware.org (Postfix) with ESMTPS id 630DA3858C20 for <binutils@sourceware.org>; Thu, 23 Mar 2023 11:00:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 630DA3858C20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cipunited.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cipunited.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i4LUNvsj+L/uyD2Imm467T7yQcFfqYLSRlyzrXRVgGHH2vX8Xe4OEG+EDhrOoDcGTl6JoUCwahTt1q3ck+syBFGbGBk/7v2wZ6X3JbOf0xjNnYzTAcJs5F3sxc3jrUPSHoUQ4+qukz/xaqKh4447u6vMzWX53Y7VBQTVqELmtM8F45U+npYAM6TNzKuQONKggRmZJOqgPE2aKeHPz2up+87WQ6ISSWvZaNYvNeX/fU4i0syj20zL19sO7fHkU4nRQNe+YW4/u7ZdSB4OCdTNSPLRE7shUe4bMQSUpkqpqKwViNnXgKOOns/Nfs2NvffFpqVmQu80I05wuJYFhiL2Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PHMFDi4ITsg1GyzLg/2JyTp3I3FQCN2BASoutyC3kzo=; b=hAp1iBNxW780dv7ZlHL9oEUkTyJTx1J6/InDSGPCPsqjNDmgSgFj7/NhntM7o0zk/GoTFt/XqSMpgpqXw/Iiu37AyNhEixRBq3C8fCqLCD5iZCqCaZT0lJX+6aYC6pB4mU58x6dlXzWtiLV4CERv488QPmmpzgcd8xLg7SQCY/TUxIw7L3rqdFrhIn74o0xBxlyCAXgwwtak/EbVbZlge4fONDJcSOfwWlC4JwAvJohGafjL2eVCf1SyaqBntQHRD2LNYoL5UL4fzsWvlpt0Enh4ZJwCY0lHNM85Not3zCOF3ZwzXTaA0sFhuIPFLv+LUwRO//mBit4nFixqMc4SHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cipunited.com; dmarc=pass action=none header.from=cipunited.com; dkim=pass header.d=cipunited.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cipunited.onmicrosoft.com; s=selector1-cipunited-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PHMFDi4ITsg1GyzLg/2JyTp3I3FQCN2BASoutyC3kzo=; b=wXDmQgKFzeGZ27N3HxecMUjskS4bTe7TCyBCdujre+YTNsls/Vqp5dTNP1tlI90n8sR9zuOX5/6b235GyG4SaPlilB3cTx0XGNa84GSqfh8czCZi6h/3lg+n3EYwOmXY5n8mddEfi0UHGyuz3jX0gzaqO6iVG11e5ii2m/A/YWU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cipunited.com; Received: from TYZPR04MB6117.apcprd04.prod.outlook.com (2603:1096:400:25a::9) by KL1PR0401MB6361.apcprd04.prod.outlook.com (2603:1096:820:c0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Thu, 23 Mar 2023 11:00:15 +0000 Received: from TYZPR04MB6117.apcprd04.prod.outlook.com ([fe80::351b:75af:3dc5:6c46]) by TYZPR04MB6117.apcprd04.prod.outlook.com ([fe80::351b:75af:3dc5:6c46%8]) with mapi id 15.20.6178.037; Thu, 23 Mar 2023 11:00:15 +0000 From: YunQiang Su <yunqiang.su@cipunited.com> To: binutils@sourceware.org Cc: syq@debian.org, macro@orcam.me.uk, xry111@xry111.site, richard.sandiford@arm.com, jiaxun.yang@flygoat.com, amodra@gmail.com, YunQiang Su <yunqiang.su@cipunited.com> Subject: [PATCH] MIPS: fix loongson3 llsc workaround Date: Thu, 23 Mar 2023 18:59:59 +0800 Message-Id: <20230323105959.1449936-1-yunqiang.su@cipunited.com> X-Mailer: git-send-email 2.30.2 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TY2PR0101CA0018.apcprd01.prod.exchangelabs.com (2603:1096:404:92::30) To TYZPR04MB6117.apcprd04.prod.outlook.com (2603:1096:400:25a::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR04MB6117:EE_|KL1PR0401MB6361:EE_ X-MS-Office365-Filtering-Correlation-Id: e3f1ef8c-a662-4bd8-e5c2-08db2b8dc811 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8xcdW+OgWawnLfYkIv7nr2J6P3Ih2vIvvUlAWf+C4S6iYNTr5QMhPjCUXdMUXl6PjqZH7ASSpToJRy0nZc6TqmsMxZvIT+WELZxA0eLS23B42ZByLggomz0sjIXneJGluLYJiER4zIsn0d+OxawWoD644+uRwvAGX++J17cdbHbNUJWvNcnzI//JsQKnr9g/fKzwd+ZRNHj/ItpM4JV5+n6fHSHUubdRVc9FPUH3kAyMUI+jsAGxmCxzf0vKW+X8Gts7Ka6V5Sa2PdYlzEie0t9dvhbejb+CuJvTLqExFBKbxabaFTOvuFUpNDNbp4xFYWvoKRoZIKOVe5S5OAF1gjflyOpZy+KihJuWusED69ANNn3axTMUPeGILfaZst7n+/CqHkXkD0tpTdTAj42xh8wpsV0606P/LQN5Foa8tNJk5dPCqgyiW6nXmSvcxwE7VYguEn7shlHexFtZOLtNP10NTH5P71fao5LZjPun6UaMcwAC6+fNkXWIy2+Hk0cdvNSx+B2huGKvWEDEt+L8B8D/pSK8iCgjmUGTPMA8kspIPQfe0DnTlien3wiMzwbLHUTUs/Ud6Zs4ndO7ZEZRYUO96UoRTF4QgAG/8cXY/Lw0hTvTeTWhPNhG0ui03363vl/dvGCRWBbfwkwcbh/RTPeQRpPnbYCLZXCVl+Qjht6gfXuYz4YsufNaQRdndtN7SdDYZCfRWhI51tO6is3fyw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR04MB6117.apcprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(366004)(39830400003)(396003)(346002)(376002)(136003)(451199018)(38100700002)(2906002)(38350700002)(83380400001)(478600001)(6486002)(52116002)(2616005)(186003)(86362001)(36756003)(316002)(66476007)(8676002)(66556008)(66946007)(4326008)(6916009)(8936002)(107886003)(6666004)(1076003)(26005)(6512007)(6506007)(5660300002)(41300700001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9Xgg94iL/fEHscgD5YXftzStba6lcQlg2Ov1XGGQmPPw+VE5nMX7zuTjkLt06Ekrvi8wcXj4+xIg8wlKBjn8bM+A3j/3Sr8NOBW9czbnEI44TZWOYHOjhMwvSgRvANufoDmtXE+za8zG72861mmZpwuGZzqnrKXPvllzKfWTrqx1W8MQK3V04rmUw/Fi82/dNdkrLirn+ctJVOIXebDcYqSE+ll/DUqAfogKHbB9zqJP+vnuz8alYINv6UN60sX53e3ZAg5kdx4FSdN2pe6ksMvNrRjOHNDC9tg7bBFYkZYZ3sqbqjJ5rRcfk4bA0gKBaWzvRJ2+qJyjSRDGqNd7f0roKOol8/JrqPQclgeYOWdEP8F8UVnC/79KS41uYMG0DCpLz7SjdJs+kKIQO8s4EhirYKcFEzpNfUe7hb+zuhb764lUsvapL5hBvpZxxN1HBEgnkRjQcM2ynrEOYYxmW4fmZ/hLUegdlkhPr6rf+JPCLdCQUG9R5oreXPjFa1E5fHS9PkpjWj0DuJPTjMLxC6QGZzp0p7265YDvHenhe2dDB67G8R8hR+pPwem+dFDVItcEnt+CeeWdfUkBGOZdCOocT1Dm9d/DAyu0Vs3hzZ+N07TFLNO32zilcpiXiUBN3/t5zkJ+2cgEC0N2ZnUr7nIYHBocb+XYab+TpAeIlicEHuncgRVn0zzhnYE3Do4CuOBmYOseRo6RQu8+y4NYA+J+CdHHYJkCRNiMe9q9by6TocxlvKxMdGICW+dXN7sx3ng9GSOGftmkw4+C514YQV+cQQ+1bZ3JKYZR+vUAMk+O0YY2Vo42AhghhIjaoEmfeYjddeAkPupdshanpvDaf0/mZFibj2bh3EaRrFOONwn2t7V4xeqNv9MjiUJ5v8JXWOzqcv1mkV5/lxqzxn1LUjQPmawSRe2wTsB6LTD+43sTLRTbc+0zsrSMoySvlaGQnUoiT30lMUcbQxm1MmVTPLaadGjYoc6ZwMjjP87wHOMIuKB4sdpwyrZ5uxs3uTRQD4Wa+Ssb3h3WdiTL6F0ZeCZoeJXAYREEfGdvPVmDK0L9NlWCMpalzLgBXEeXG4SCX34FbfTZLGqGw8Da3dP6AQcHE0v4g2HvFesR+5MpzDovCcqvNFt8HVlTw6p4aWf1j/n+4e2KLeuxrk+/EW+6Ng94K+pYRUDBsF3Fk2DMChLd+4TZcsf9dvOiA9pxyKqbgN5JsCtHTCx1qK5fpYJfS/YyuFpFRY6L8Rc6VjlJopFo+OteQU0nnRmQkS1y+ImbfI/nPSLOdEIaAOqeblCt9aEQr8ZSO7s5ZsIOMF41xlYV7dDj8lFut0m/EzdGjGcRE/SRrjYzQlFHIrnkzyIZ+1YOM+GauSf+T9oXZ2BUTT/pBlzCvimPKhdf5gt7lnqCzskKoRjbrDjOGCBFkyGxpLC/ssl1iIWAbYcAvIKGLNitcmDsT80bP1iUiYPWZRmfzlJKtUDMKv/tXpPfC758Z1oJU+Ey95WONOgfRqPEsFlNAfl1xvS0pO5pxeaFVGkThD9UuNYBhX+k53oE99iD7SGwrmDvX9B8gWYpZBtAp70V0F4CIqXuJuWChhF6S6DhXMuFc3Nc1IZQ6PgKESOyOA== X-OriginatorOrg: cipunited.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3f1ef8c-a662-4bd8-e5c2-08db2b8dc811 X-MS-Exchange-CrossTenant-AuthSource: TYZPR04MB6117.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2023 11:00:15.2399 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e31cf5b5-ee69-4d5f-9c69-edeeda2458c0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qBmTdcfCUYSF6Uu2CUv0s0k/64AqL8/q4i9ZLd8bQrku/cQaqiS33j4dJoyjZceY5It+Qul3+19oc/H5FaIZUT+v0+2laZjSCPlwp/g+SS0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0401MB6361 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761155988237376892?= X-GMAIL-MSGID: =?utf-8?q?1761155988237376892?= |
Series |
MIPS: fix loongson3 llsc workaround
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | success | Github commit url |
Commit Message
YunQiang Su
March 23, 2023, 10:59 a.m. UTC
-mfix-looongson3-llsc may add sync instructions not needed on some asm code with lots of debug info. PR: 30153 * gas/config/tc-mips.c(fix_loongson3_llsc): clear logistic. --- gas/config/tc-mips.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
Comments
ping YunQiang Su <yunqiang.su@cipunited.com> 于2023年3月23日周四 19:00写道: > > -mfix-looongson3-llsc may add sync instructions not needed on some > asm code with lots of debug info. > > PR: 30153 > * gas/config/tc-mips.c(fix_loongson3_llsc): clear logistic. > --- > gas/config/tc-mips.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c > index e911aaa904a..8a970ceada2 100644 > --- a/gas/config/tc-mips.c > +++ b/gas/config/tc-mips.c > @@ -6942,10 +6942,6 @@ fix_loongson3_llsc (struct mips_cl_insn * ip) > unsigned long lookback = ARRAY_SIZE (history); > for (i = 0; i < lookback; i++) > { > - if (streq (history[i].insn_mo->name, "ll") > - || streq (history[i].insn_mo->name, "lld")) > - break; > - > if (streq (history[i].insn_mo->name, "sc") > || streq (history[i].insn_mo->name, "scd")) > { > @@ -6953,8 +6949,8 @@ fix_loongson3_llsc (struct mips_cl_insn * ip) > > for (j = i + 1; j < lookback; j++) > { > - if (streq (history[i].insn_mo->name, "ll") > - || streq (history[i].insn_mo->name, "lld")) > + if (streq (history[j].insn_mo->name, "ll") > + || streq (history[j].insn_mo->name, "lld")) > break; > > if (delayed_branch_p (&history[j])) > @@ -6993,7 +6989,7 @@ fix_loongson3_llsc (struct mips_cl_insn * ip) > for (j = i + 1; j < lookback; j++) > { > if (streq (history[j].insn_mo->name, "ll") > - || streq (history[i].insn_mo->name, "lld")) > + || streq (history[j].insn_mo->name, "lld")) > break; > } > > -- > 2.30.2 >
On Thu, 23 Mar 2023, YunQiang Su wrote: > -mfix-looongson3-llsc may add sync instructions not needed on some > asm code with lots of debug info. I can see the change has been committed, but who has actually reviewed it? The change description doesn't say what the change actually does, so one can't say whether it is correct or not. At least an example of incorrect code produced ought to be shown and how the change affects it. As it stands I have no idea what is going on here, and surely no one who looks at it in a few year's time will. Change descriptions cannot be retrofitted, so I think the original fix ought to be reverted and, assuming it is indeed the correct one, reapplied with a correct change description (after a proper review). Maciej
Maciej W. Rozycki <macro@orcam.me.uk> 于2023年5月11日周四 08:01写道: > > On Thu, 23 Mar 2023, YunQiang Su wrote: > > > -mfix-looongson3-llsc may add sync instructions not needed on some > > asm code with lots of debug info. > > I can see the change has been committed, but who has actually reviewed > it? > > The change description doesn't say what the change actually does, so one > can't say whether it is correct or not. At least an example of incorrect > code produced ought to be shown and how the change affects it. As it > stands I have no idea what is going on here, and surely no one who looks > at it in a few year's time will. > In fact, it was a typo of i/j. > Change descriptions cannot be retrofitted, so I think the original fix > ought to be reverted and, assuming it is indeed the correct one, reapplied > with a correct change description (after a proper review). > > Maciej
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index e911aaa904a..8a970ceada2 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -6942,10 +6942,6 @@ fix_loongson3_llsc (struct mips_cl_insn * ip) unsigned long lookback = ARRAY_SIZE (history); for (i = 0; i < lookback; i++) { - if (streq (history[i].insn_mo->name, "ll") - || streq (history[i].insn_mo->name, "lld")) - break; - if (streq (history[i].insn_mo->name, "sc") || streq (history[i].insn_mo->name, "scd")) { @@ -6953,8 +6949,8 @@ fix_loongson3_llsc (struct mips_cl_insn * ip) for (j = i + 1; j < lookback; j++) { - if (streq (history[i].insn_mo->name, "ll") - || streq (history[i].insn_mo->name, "lld")) + if (streq (history[j].insn_mo->name, "ll") + || streq (history[j].insn_mo->name, "lld")) break; if (delayed_branch_p (&history[j])) @@ -6993,7 +6989,7 @@ fix_loongson3_llsc (struct mips_cl_insn * ip) for (j = i + 1; j < lookback; j++) { if (streq (history[j].insn_mo->name, "ll") - || streq (history[i].insn_mo->name, "lld")) + || streq (history[j].insn_mo->name, "lld")) break; }