From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21839 invoked by alias); 17 Sep 2013 13:50:32 -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 21830 invoked by uid 89); 17 Sep 2013 13:50:32 -0000 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 17 Sep 2013 13:50:32 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C6812116399; Tue, 17 Sep 2013 09:50:43 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SNL4wtS8QFon; Tue, 17 Sep 2013 09:50:43 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 755E0116170; Tue, 17 Sep 2013 09:50:43 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 78392E1290; Tue, 17 Sep 2013 06:50:29 -0700 (PDT) Date: Tue, 17 Sep 2013 13:50:00 -0000 From: Joel Brobecker To: Pierre Muller Cc: 'Mark Kettenis' , gdb-patches@sourceware.org Subject: Re: [RFC-v2] amd64-windows: Fix funcall with by-pointer arguments Message-ID: <20130917135029.GJ3132@adacore.com> References: <1351099417-18960-1-git-send-email-brobecker@adacore.com> <201210251317.q9PDHrnJ026193@glazunov.sibelius.xs4all.nl> <20130116115840.GS6143@adacore.com> <003101ceb0ce$22cfd340$686f79c0$@muller@ics-cnrs.unistra.fr> <20130916205705.GC3132@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130916205705.GC3132@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-09/txt/msg00510.txt.bz2 > Thanks for doing that. I haven't completely finished reviewing > the patch yet, but I wanted to send a message so that you and > everyone else knows that I am on it. The patch looked good, minus > some trivial formatting issues which I will fix, but I noticed > a problem with function returning arrays. I am not sure where > it is coming from, whether from me incorrectly applying your > change, or missing something else, or whether it's a regression. > > I ran out of time for today, but will try to pursue this further > tomorrow. Small update for today. This is the change I had to apply on top of your patch in order to fix the problem: - else if (amd64_windows_passed_by_integer_register (type)) - regnum = AMD64_RAX_REGNUM; + else if (len == 1 || len == 2 || len == 4 || len == 8) + { + /* All values of this size are returned via RAX. */ + regnum = AMD64_RAX_REGNUM; + } It fixes the case where we return a small array of integers. The documentation I have said, at the time: Return values that can fit into 64-bits are returned through RAX (including __m64 types), except for __m128, __m128i, __m128d, floats, and doubles, which are returned in XMM0. [...] User defined types to be returned must be 1, 2, 4, 8, 16, 32, or 64 bits in length. This all made me realize that merging our two patches creates a bit of confusion about what is a pure rewrite, and what is an attempt to fix what. So, here is what I will do: I will clean my patch up, retest, also remove all amd64-windows-specific hooks as initially said, and then send you an updated patch containing your changes, with my fixes. If you could please: 1. Re-test, making sure that I did not break anything back; 2. Re-submit each piece for each problem that you're solving, with description provided with each patch. This will make the review process easier for me. Thank you! -- Joel