From patchwork Mon Jul 20 15:08:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 7758 Received: (qmail 114375 invoked by alias); 20 Jul 2015 15:08:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 114364 invoked by uid 89); 20 Jul 2015 15:08:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp17.uk.ibm.com Received: from e06smtp17.uk.ibm.com (HELO e06smtp17.uk.ibm.com) (195.75.94.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 20 Jul 2015 15:08:46 +0000 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Jul 2015 16:08:40 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 20 Jul 2015 16:08:39 +0100 X-MailFrom: arnez@linux.vnet.ibm.com X-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 0E01E17D8063 for ; Mon, 20 Jul 2015 16:10:01 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t6KF8dt933358062 for ; Mon, 20 Jul 2015 15:08:39 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t6KF8cd3026200 for ; Mon, 20 Jul 2015 09:08:39 -0600 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-115.boeblingen.de.ibm.com [9.152.212.115]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t6KF8b9n026168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA256 bits=256 verify=NO); Mon, 20 Jul 2015 09:08:38 -0600 From: Andreas Arnez To: "Ulrich Weigand" Cc: qiyaoltc@gmail.com (Yao Qi), dje@google.com (Doug Evans), brobecker@adacore.com (Joel Brobecker), gdb-patches@sourceware.org (gdb-patches) Subject: Re: Several regressions and we branch soon. References: <20150710162332.182E6B042@oc7340732750.ibm.com> Date: Mon, 20 Jul 2015 17:08:37 +0200 In-Reply-To: <20150710162332.182E6B042@oc7340732750.ibm.com> (Ulrich Weigand's message of "Fri, 10 Jul 2015 18:23:32 +0200 (CEST)") Message-ID: <87io9eyih6.fsf@br87z6lw.de.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15072015-0029-0000-0000-0000058ADD66 X-IsSubscribed: yes On Fri, Jul 10 2015, Ulrich Weigand wrote: > Andreas Arnez wrote: >> On Fri, Jul 10 2015, Yao Qi wrote: > >> GCC5 on ppc64le emits the ABI warning even in absence of "-mcpu=". >> Again it should help to add "-Wno-psabi". > > Yes, for ppc64 we definitely should add -Wno-psabi. OK. >> Yes. But in this case no vector ABI is used, because that test machine >> does not have a vector facility and because -march=native is not >> supported by GCC (yet). Thus vector return values are not passed in >> vector registers, but according to RETURN_VALUE_STRUCT_CONVENTION. And >> then we hit the problem that displaying such return values is not >> supported by GDB: https://sourceware.org/bugzilla/show_bug.cgi?id=8549 > > Hmm. Since this is a separate problem independent of vector support, > maybe this test case should accept the failure to display struct return > values, and pass the test (or maybe KFAIL?). Sure, that's an option. I prefer KFAIL, such that it's easy to find (and remove) when the bug is fixed. Here's a patch for both of the suggested changes. OK to apply? -- >8 -- Subject: [PATCH] gnu_vector.exp: Avoid some more known FAILs This avoids two more types of FAILs with the gnu_vector test case. First, for POWER targets newer GCCs emit an ABI note when invoked with "-mcpu=native". Then the test case fell back to non-native compile, producing code for a non-vector ABI. But that is not supported by GDB. Thus the compiler note is now suppressed with "-Wno-psabi". Second, on s390 the test case produced FAILs after falling back to a non-vector ABI when using "finish" or "return" in a vector-valued function. This was due to a long-standing known bug (Bug 8549). This case is now detected, and KFAILs are emitted instead. gdb/testsuite/ChangeLog: * gdb.base/gnu_vector.exp: Try compilation with "-mcpu=native -Wno-psabi" if "-mcpu=native" fails. For the tests with "finish" and "return" use KFAIL when GDB can not read/write the vector return value. --- gdb/testsuite/gdb.base/gnu_vector.exp | 57 +++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/gdb/testsuite/gdb.base/gnu_vector.exp b/gdb/testsuite/gdb.base/gnu_vector.exp index 173da4d..0bef3f8 100644 --- a/gdb/testsuite/gdb.base/gnu_vector.exp +++ b/gdb/testsuite/gdb.base/gnu_vector.exp @@ -25,11 +25,19 @@ standard_testfile .c # without a CPU option. If all variants fail, assume that the # compiler can not handle GNU vectors. -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" ${binfile} executable {debug quiet additional_flags=-mcpu=native}] != "" - && [gdb_compile "${srcdir}/${subdir}/${srcfile}" ${binfile} executable {debug quiet additional_flags=-march=native}] != "" - && [gdb_compile "${srcdir}/${subdir}/${srcfile}" ${binfile} executable {debug quiet}] != ""} { - untested "compiler can't handle the vector_size attribute?" - return -1 +proc do_compile { {opts {}} } { + global srcdir subdir srcfile binfile + set ccopts {debug quiet} + foreach opt $opts {lappend ccopts "additional_flags=$opt"} + gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" executable $ccopts +} + +if { [do_compile {-mcpu=native}] != "" + && [do_compile {-mcpu=native -Wno-psabi}] != "" + && [do_compile {-march=native}] != "" + && [do_compile] != ""} { + untested "compiler can't handle vector_size attribute?" + return -1 } clean_restart ${binfile} @@ -195,14 +203,37 @@ gdb_test "print add_structvecs(i2, (struct just_int2)\{2*i2\}, (struct two_int2) gdb_test "print add_singlevecs((char1) \{6\}, (int1) \{12\}, (double1) \{24\})" "= \\{42\\}" \ "call add_singlevecs" -# Test vector return value handling with "finish" and "return". +# Test "finish" from vector-valued function. gdb_breakpoint "add_some_intvecs" gdb_continue "add_some_intvecs" -gdb_test "finish" "Value returned is .* = \\{10, 20, 48, 72\\}" \ - "finish shows vector return value" +set test "finish shows vector return value" +gdb_test_multiple "finish" $test { + -re "Value returned is .* = \\{10, 20, 48, 72\\}.*$gdb_prompt $" { + pass $test + } + -re "Value returned has type: .* Cannot determine contents.*$gdb_prompt $" { + kfail "gdb/8549" $test + } +} + +# Test "return" from vector-valued function. gdb_continue "add_some_intvecs" -gdb_test "return (int4) \{4, 2, 7, 6\}" \ - "#0 .* main .*" \ - "set vector return value" \ - "Make add_some_intvecs return now. .y or n.*" "y" -gdb_test "continue" "4 2 7 6\r\n.*" "verify vector return value" +set test "set vector return value" +set ok 1 +gdb_test_multiple "return (int4) \{4, 2, 7, 6\}" $test { + -re "#0 .* main .*$gdb_prompt $" { + if { $ok } { + pass $test + gdb_test "continue" "4 2 7 6\r\n.*" "verify vector return value" + } + } + -re "The location .* is unknown.\r\n.* return value .* will be ignored.\r\n" { + kfail "gdb/8549" $test + set ok 0 + exp_continue + } + -re "Make add_some_intvecs return now. .y or n. $" { + send_gdb "y\n" + exp_continue + } +}