From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id s6iiFjlKjWGNMAAAWB0awg (envelope-from ) for ; Thu, 11 Nov 2021 11:52:09 -0500 Received: by simark.ca (Postfix, from userid 112) id 4C5751F0BD; Thu, 11 Nov 2021 11:52:09 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A1B701ECEB for ; Thu, 11 Nov 2021 11:52:08 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DB3E33857C74 for ; Thu, 11 Nov 2021 16:52:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB3E33857C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1636649527; bh=2/AcsZ3WaSun6+nuw2corprw6z+DuFgamUHbFDeI3Hg=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=l0wxn9VO1p9CkrntSR/oeWTTC9cKC2GL1gNE26h3jtJ5fPKgL7wSEL9Pdtv1PLIfG 5liuaHgC1BpWxezWHUjw70idmChz+VyPO9zdvOsN8WypNIvU/6dFpbzkYbVz3AZfQz p+A2KeH2p+tv9/AVmQhybkT1n9XT39HQt+nM48Ts= Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 9E8853857C6E for ; Thu, 11 Nov 2021 16:50:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9E8853857C6E Received: by mail-pl1-x62f.google.com with SMTP id y7so6342166plp.0 for ; Thu, 11 Nov 2021 08:50:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:from:to:subject; bh=+LUbF9SbwMpPuT58BgJ3rK6Ky5YA5KYA0AbC9sdoOjE=; b=Goyc8dr0Z3KT4/5XrvFpG62cCQxSuwMtFqQC8+yXw8BwYjTwIl3T6qqfrGpV1D1+Lu 8jBTSL8yApaSZhilByZsc5e200haiVEIAhAgoj1dXLi3BqlVWEXgNsVZpjw8FTndi0nW Sui3UEWFOJEqdLKFv2CMCY4hV5z8hyD4HxwkJz5lod1SLj7qtvUUKx5lDMqlOBjw6pXf rl3Mzr+kvW/6rMIiOmonA2iOLlf5RFPafhUGqH9HXttQ0qfvMUdi8JlEzBkrD2HyX6vB STGKIz7qu3/Vqg9ntgSr/nUb0T2iANtQJp5YP7UFBOU8Kdyb4eWFFNj4jlx1UT0bOW9q kbjw== X-Gm-Message-State: AOAM532exXqRvCBppcm9UlrMmgOddFAjYZfHfgqv6mOuvfRBVYaWCvHB NoxCCTck4OTimckVGE1gp8OF8OB+4V4= X-Google-Smtp-Source: ABdhPJyJGRIN+PAHI7s4MN+UWCwLUDcf/rvfRYF4BsdgNyXKY1XlxEUut+qXnHl+twHavouBNhxCvw== X-Received: by 2002:a17:90b:4d09:: with SMTP id mw9mr9791907pjb.238.1636649455439; Thu, 11 Nov 2021 08:50:55 -0800 (PST) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id o4sm8631234pjq.23.2021.11.11.08.50.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Nov 2021 08:50:54 -0800 (PST) Content-Type: multipart/mixed; boundary="------------jUUU9jKC9jp78rAs19KbrYh1" Message-ID: <36fb4284-5ddc-50c3-959c-b30e0cc96096@gmail.com> Date: Thu, 11 Nov 2021 09:50:54 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Content-Language: en-US To: gdb-patches@sourceware.org Subject: Minor fix for H8 simulator X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jeff Law via Gdb-patches Reply-To: Jeff Law Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" This is a multi-part message in MIME format. --------------jUUU9jKC9jp78rAs19KbrYh1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit I haven't regularly contributed to gdb/sim for a long time. So please be gentle if I goof on process stuff. The upstream GCC tester hasĀ  showed spurious execution failures on the H8 target for the H8/SX multilibs. I suspected memory corruption or an uninitialized variable early as the same binary would sometimes work and sometimes it got the wrong result. Worse yet, the point where the test determined it was getting the wrong result would change. Because it only happened on the H8/SX variant I was able to zero in on the "mova" support and the "short form" of those instructions in particular. As the code stands it checks if code->op3.type == 0 to try and identify cases where op3 wasn't filled in and thus we've got the short form of the mova instruction. But for the short-form of those instructions we never set any of the "op3" data structure. We get whatever was lying around -- it's usually zero and thus things usually work, but if the stale data was nonzero, then we'd fail to recognize the instruction as a short-form and fail to set up the various fields appropriately. I initially initialized the op3.type field to zero, but didn't like that because it was inconsistent with how other operands were initialized. Bringing consistency meant using -1 as the initializer value and adjusting the check for short form mova appropriately. I've had this in the upstream GCC tester for perhaps a year at this point and haven't seen any of the intermittent failures again. OK to push to master (assuming I even still have permissions to do so)? Thanks, Jeff --------------jUUU9jKC9jp78rAs19KbrYh1 Content-Type: text/plain; charset=UTF-8; name="0006-h8simfix.patch" Content-Disposition: attachment; filename="0006-h8simfix.patch" Content-Transfer-Encoding: base64 CSogaDgzMDAvY29tcGlsZS5jIChkZWNvZGUpOiBJbml0aWFsaXplIG9wMy50eXBlIHRvIC0x LgoJKHN0ZXBfb25jZSk6IEFkanVzdCB0ZXN0IG9mIG9wMy50eXBlLgoKZGlmZiAtLWdpdCBh L3NpbS9oODMwMC9jb21waWxlLmMgYi9zaW0vaDgzMDAvY29tcGlsZS5jCmluZGV4IGMxYzYx ZDgyMTEuLmFmOTEzN2Q2ZDYgMTAwNjQ0Ci0tLSBhL3NpbS9oODMwMC9jb21waWxlLmMKKysr IGIvc2ltL2g4MzAwL2NvbXBpbGUuYwpAQCAtNTY4LDYgKzU2OCw3IEBAIGRlY29kZSAoU0lN X0RFU0Mgc2QsIGludCBhZGRyLCB1bnNpZ25lZCBjaGFyICpkYXRhLCBkZWNvZGVkX2luc3Qg KmRzdCkKIAogICBkc3QtPmRzdC50eXBlID0gLTE7CiAgIGRzdC0+c3JjLnR5cGUgPSAtMTsK KyAgZHN0LT5vcDMudHlwZSA9IC0xOwogCiAgIC8qIEZpbmQgdGhlIGV4YWN0IG9wY29kZS9h cmcgY29tYm8uICAqLwogICBmb3IgKHEgPSBoOF9vcGNvZGVzOyBxLT5uYW1lOyBxKyspCkBA IC0xOTQwLDcgKzE5NDEsNyBAQCBzdGVwX29uY2UgKFNJTV9ERVNDIHNkLCBTSU1fQ1BVICpj cHUpCiAJCW9mIHRoZSBzYW1lIHJlZ2lzdGVyLgogCSAgKi8KIAotCSAgaWYgKGNvZGUtPm9w My50eXBlID09IDApCisJICBpZiAoY29kZS0+b3AzLnR5cGUgPT0gLTEpCiAJICAgIHsKIAkg ICAgICAvKiBTaG9ydCBmb3JtOiBzcmMgPT0gSU5ERVhCL0lOREVYVywgZHN0ID09IG9wMyA9 PSAwLgogCQkgV2UgZ2V0IHRvIGNvbXBvc2UgZHN0IGFuZCBvcDMgYXMgZm9sbG93czoK --------------jUUU9jKC9jp78rAs19KbrYh1--