From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92956 invoked by alias); 17 Jan 2019 17:08:55 -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 92930 invoked by uid 89); 17 Jan 2019 17:08:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=Empty, sk:infcall, structs X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Jan 2019 17:08:52 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E5957A0490; Thu, 17 Jan 2019 17:08:50 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9BB2600C5; Thu, 17 Jan 2019 17:08:49 +0000 (UTC) Subject: Re: [PATCH 1/2] AArch64 AAPCS: Empty structs have non zero size in C++ To: Alan Hayward , "gdb-patches@sourceware.org" References: <20190116155734.53824-1-alan.hayward@arm.com> <20190116155734.53824-2-alan.hayward@arm.com> Cc: nd From: Pedro Alves Message-ID: <386a4a7f-f7df-e1da-42b8-b0724e1e36b2@redhat.com> Date: Thu, 17 Jan 2019 17:08:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190116155734.53824-2-alan.hayward@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-01/txt/msg00407.txt.bz2 On 01/16/2019 03:57 PM, Alan Hayward wrote: > When gdb.base/infcall-nested-structs.c is complied as C++, the structs > containing empty structs are no longer passed via float arguments. This reads a bit ambiguously. Which is it? #1 - No longer passed by GCC, but GDB still passes. #2 - No longer passed by GDB, but GCC still passes. > This is because structs in C++ have a minimum size of 1. This can then > cause padding in the struct, which is disallowed for AAPCS. Does this "disallowed" mean that structs with padding are not allowed to be passed via float arguments? Took me a while to grok that. It'd be good to clarify the commit log. > +foreach l $lang { > + set dir "$l" > + remote_exec build "rm -rf [standard_output_file ${dir}]" > + remote_exec build "mkdir -p [standard_output_file ${dir}]" I think these should be remote_exec host not "build" ? For remote-host testing, where the compiler and debugger run on the host machine. Could you please file a bug for the x86 internal errors, and kfail the test for x86? Otherwise looks fine to me. Thanks, Pedro Alves > +} > + > + > set int_types { tc ts ti tl tll } > set float_types { tf td tld } > set complex_types { tfc tdc tldc } > @@ -44,7 +58,7 @@ proc I2A { n } { > # types of the struct fields within the source. Run up to main. > # Also updates the global "testfile" to reflect the most recent build. > > -proc start_nested_structs_test { types } { > +proc start_nested_structs_test { lang types } { > global testfile > global srcfile > global binfile > @@ -53,9 +67,11 @@ proc start_nested_structs_test { types } { > global compile_flags > > standard_testfile .c > + set dir "$lang" > > # Create the additional flags > set flags $compile_flags > + lappend flags $lang > > for {set n 0} {$n<[llength ${types}]} {incr n} { > set m [I2A ${n}] > @@ -64,7 +80,7 @@ proc start_nested_structs_test { types } { > append testfile "-" "$t" > } > > - set binfile [standard_output_file ${testfile}] > + set binfile [standard_output_file ${dir}/${testfile}] > if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags}"] != "" } { > unresolved "failed to compile" > return 0 > @@ -125,48 +141,50 @@ proc run_tests {} { > # Set up a test prefix, compile the test binary, run to main, and then > # run some tests. > > -proc start_gdb_and_run_tests { types } { > +proc start_gdb_and_run_tests { lang types } { > set prefix "types" > > foreach t $types { > append prefix "-" "${t}" > } > > - with_test_prefix $prefix { > - if { [start_nested_structs_test $types] } { > - run_tests > + foreach_with_prefix l $lang { > + with_test_prefix $prefix { > + if { [start_nested_structs_test $l $types] } { > + run_tests > + } > } > } > } > > foreach ta $int_types { > - start_gdb_and_run_tests $ta > + start_gdb_and_run_tests $lang $ta > } > > if [support_complex_tests] { > foreach ta $complex_types { > - start_gdb_and_run_tests $ta > + start_gdb_and_run_tests $lang $ta > } > } > > if ![gdb_skip_float_test] { > foreach ta $float_types { > - start_gdb_and_run_tests $ta > + start_gdb_and_run_tests $lang $ta > } > > foreach ta $int_types { > foreach tb $float_types { > - start_gdb_and_run_tests [list $ta $tb] > + start_gdb_and_run_tests $lang [list $ta $tb] > } > } > > foreach ta $float_types { > foreach tb $int_types { > - start_gdb_and_run_tests [list $ta $tb] > + start_gdb_and_run_tests $lang [list $ta $tb] > } > > foreach tb $float_types { > - start_gdb_and_run_tests [list $ta $tb] > + start_gdb_and_run_tests $lang [list $ta $tb] > } > } > } >