From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21714 invoked by alias); 23 Oct 2013 19:58:28 -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 21700 invoked by uid 89); 23 Oct 2013 19:58:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: glazunov.sibelius.xs4all.nl Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 23 Oct 2013 19:58:26 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id r9NJwFJJ024116; Wed, 23 Oct 2013 21:58:15 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id r9NJwEje005359; Wed, 23 Oct 2013 21:58:14 +0200 (CEST) Date: Wed, 23 Oct 2013 19:58:00 -0000 Message-Id: <201310231958.r9NJwEje005359@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: jose.marchesi@oracle.com CC: gdb-patches@sourceware.org In-reply-to: <87ob6qo7bs.fsf@oracle.com> (jose.marchesi@oracle.com) Subject: Re: [PATCH] Fix passing double float complex arguments in sparc64 References: <87ob6qo7bs.fsf@oracle.com> X-SW-Source: 2013-10/txt/msg00726.txt.bz2 > From: jose.marchesi@oracle.com (Jose E. Marchesi) > Date: Tue, 15 Oct 2013 17:57:27 +0200 > > Hi. > > Double float complex objects are not 16-byte aligned in either gcc or > solaris studio. This patch makes gdb to not align double float complex > arguments in the dummy frame when calling a function. > > This makes all the tests in gdb.base/varargs.exp to pass in > sparc64-*-linux-gnu. > > 2013-10-15 Jose E. Marchesi > > * sparc64-tdep.c (sparc64_store_arguments): Do not align complex > double float arguments to 16-byte. Hi Jose, A bit of digging around seems to confirm that we shouldn't align double complex variables. However, I think that with your diff we're still not storing things in the right registers. Mark > Index: sparc64-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/sparc64-tdep.c,v > retrieving revision 1.62 > diff -u -r1.62 sparc64-tdep.c > --- sparc64-tdep.c 1 Jan 2013 06:32:51 -0000 1.62 > +++ sparc64-tdep.c 15 Oct 2013 15:46:25 -0000 > @@ -831,7 +831,7 @@ > quad-aligned, and thus a hole might be introduced > into the parameter array to force alignment." Skip > an element if necessary. */ > - if (num_elements % 2) > + if ((num_elements % 2) && sparc64_16_byte_align_p (type)) > num_elements++; > } > else > @@ -913,7 +913,7 @@ > /* Floating arguments. */ > if (len == 16) > { > - if (element % 2) > + if ((element % 2) && sparc64_16_byte_align_p (type)) > element++; > if (element < 16) > regnum = SPARC64_Q0_REGNUM + element / 2; > @@ -961,7 +961,7 @@ > } > else if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q8_REGNUM) > { > - gdb_assert (element < 5); > + gdb_assert (element < 6); > regnum = SPARC_O0_REGNUM + element; > regcache_cooked_write (regcache, regnum, valbuf); > regcache_cooked_write (regcache, regnum + 1, valbuf + 8); >