From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67315 invoked by alias); 15 Oct 2019 09:11:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 67306 invoked by uid 89); 15 Oct 2019 09:11:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_00,KAM_NUMSUBJECT autolearn=no version=3.3.1 spammy=visit, HContent-Transfer-Encoding:8bit X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 15 Oct 2019 09:11:20 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 4BEDC20188; Tue, 15 Oct 2019 05:11:19 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 67819201A6; Tue, 15 Oct 2019 05:11:17 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 4489629ECF; Tue, 15 Oct 2019 05:11:17 -0400 (EDT) X-Gerrit-PatchSet: 1 Date: Tue, 15 Oct 2019 09:11:00 -0000 From: "Tom de Vries (Code Review)" To: gdb-patches@sourceware.org Cc: Simon Marchi Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: Change in binutils-gdb[master]: [gdb/tdep] Fix inferior call arg passing for amd64 X-Gerrit-Change-Id: Id55c74755f0a431ce31223acc86865718ae0c123 X-Gerrit-Change-Number: 31 X-Gerrit-ChangeURL: X-Gerrit-Commit: e499f523ffa616f72d0ccb42849d55b3177d8d91 In-Reply-To: References: X-Gerrit-Comment-Date: Tue, 15 Oct 2019 05:11:17 -0400 Reply-To: tdevries@suse.de, simon.marchi@polymtl.ca, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191015091117.4489629ECF@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-10/txt/msg00406.txt.bz2 Tom de Vries has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/31 ...................................................................... Patch Set 1: (1 comment) https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/31/1/gdb/amd64-tdep.c File gdb/amd64-tdep.c: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/31/1/gdb/amd64-tdep.c@645 PS1, Line 645: theclass[1] = amd64_merge_classes (theclass[1], subclass[1]); > If we reach here, isn't subclass[1] always NO_CLASS? So this if would be unnecessary? Doing: ... if (pos == 0) - theclass[1] = amd64_merge_classes (theclass[1], subclass[1]); + { + gdb_assert (subclass[1] == AMD64_NO_CLASS); + theclass[1] = amd64_merge_classes (theclass[1], subclass[1]); + } ... gives 180 failure in gdb.base/infcall-nested-structs.exp. The assert is triggered for the cases where amd64_classify sets theclass[1], in this test-case: - long double - double _Complex. Structurewise, we have (leaving out the massive comment that makes it hard to read): ... theclass[pos] = amd64_merge_classes (theclass[pos], subclass[0]); if (bitsize <= 64 && pos == 0 && endpos == 1) theclass[1] = amd64_merge_classes (theclass[1], subclass[0]); if (pos == 0) theclass[1] = amd64_merge_classes (theclass[1], subclass[1]); ... so 'reach here' means just pos == 0. This would actually be more precise: ... - if (pos == 0) + if (pos == 0 && endpos == 1) theclass[1] = amd64_merge_classes (theclass[1], subclass[1]); ... and therefore we could restructure to: ... theclass[pos] = amd64_merge_classes (theclass[pos], subclass[0]); if (pos == 0 && endpos == 1) { theclass[1] = amd64_merge_classes (theclass[1], subclass[1]); if (bitsize <= 64) theclass[1] = amd64_merge_classes (theclass[1], subclass[0]); } ... But I don't think we want to do refactoring like this in this commit. -- To view, visit https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/31 To unsubscribe, or for help writing mail filters, visit https://gnutoolchain-gerrit.osci.io/r/settings