From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 24183385DC32 for ; Mon, 25 May 2020 22:14:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 24183385DC32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id BC2011E072; Mon, 25 May 2020 18:14:34 -0400 (EDT) Subject: Re: [PATCH 1/7] Fix function argument and return value locations To: Hannes Domani , Gdb-patches References: <20200525185659.59346-1-ssbssa@yahoo.de> <20200525185659.59346-2-ssbssa@yahoo.de> <7c09d137-6938-6a01-3f8d-ff8ae26c87b5@simark.ca> <977050290.5716513.1590442329577@mail.yahoo.com> From: Simon Marchi Message-ID: <1cc831e4-c36a-d0a3-a500-7f57bc7775e9@simark.ca> Date: Mon, 25 May 2020 18:14:34 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <977050290.5716513.1590442329577@mail.yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 25 May 2020 22:14:36 -0000 On 2020-05-25 5:32 p.m., Hannes Domani via Gdb-patches wrote: > You're probably right, the thing is, I was only able to test complex float > and complex double, because gdb doesn't like complex integral types: > > complex int complex_int = 5 + 6i; > > (gdb) p complex_int > 'complex_int' has unknown type; cast it to its declared type > (gdb) pt complex_int > 'complex_int' has unknown type; cast it to its declared type > > So I guess it should check for target-type float as well: >        || (type->code () == TYPE_CODE_COMPLEX >            && TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_FLT)) > > Do many people use complex int, because I personally wouldn't have expected > that this even exists. Err right that doesn't make sense, let's use floats instead. I see: $ cat hello.c #include void other(float real, float imag); void func (complex float n) { other(creal(n), cimag(n)); } $ x86_64-w64-mingw32-gcc hello.c -g3 -O0 -c $ x86_64-w64-mingw32-objdump -d hello.o hello.o: file format pe-x86-64 Disassembly of section .text: 0000000000000000 : 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp 4: 48 83 ec 20 sub $0x20,%rsp 8: 48 89 4d 10 mov %rcx,0x10(%rbp) c: f3 0f 10 45 14 movss 0x14(%rbp),%xmm0 11: f3 0f 5a c0 cvtss2sd %xmm0,%xmm0 15: f2 0f 5a c8 cvtsd2ss %xmm0,%xmm1 19: f3 0f 10 45 10 movss 0x10(%rbp),%xmm0 1e: f3 0f 5a c0 cvtss2sd %xmm0,%xmm0 22: f2 0f 5a c0 cvtsd2ss %xmm0,%xmm0 26: e8 00 00 00 00 callq 2b 2b: 90 nop 2c: 48 83 c4 20 add $0x20,%rsp 30: 5d pop %rbp 31: c3 retq Doesn't this suggest that the parameter gets passed through rcx? I'm not saying you are wrong, I'm just trying to understand how things work :). Simon