From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30327 invoked by alias); 7 Jul 2010 18:26:22 -0000 Received: (qmail 30295 invoked by uid 22791); 7 Jul 2010 18:26:21 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jul 2010 18:26:15 +0000 Received: (qmail 14942 invoked from network); 7 Jul 2010 18:26:13 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 Jul 2010 18:26:13 -0000 Date: Wed, 07 Jul 2010 18:26:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: Ken Werner , gdb-patches@sourceware.org Subject: Re: [patch] Small fix for assigning values to vectors Message-ID: <20100707182610.GK8410@caradoc.them.org> References: <201007061558.07312.ken@linux.vnet.ibm.com> <201007071750.o67HoEVU029546@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201007071750.o67HoEVU029546@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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 X-SW-Source: 2010-07/txt/msg00120.txt.bz2 On Wed, Jul 07, 2010 at 07:50:14PM +0200, Ulrich Weigand wrote: > Ken Werner wrote: > > > As can be seen the GDB behaves incorrect for vector types. A quick look to the > > valops.c:value_assign function shows that value_coerce_to_target creates a > > value with lval set to lval_memory for array types (including vectors). The > > code was introduced with the following patch: http://sourceware.org/ml/gdb- > > patches/2008-03/msg00079.html. I have to admit that I do not entirely > > understand why value_coerce_to_target is called here. > > Dan, do you recall why you added a value_coerce_to_target for the *destination* > of an assignment? It seems this shouldn't really be necessary ... I'm not sure now. We could try dropping it. > > @@ -1424,6 +1424,9 @@ value_must_coerce_to_target (struct valu > > > > valtype = check_typedef (value_type (val)); > > > > + if (TYPE_VECTOR (valtype)) > > + return 0; > > + > > switch (TYPE_CODE (valtype)) > > { > > case TYPE_CODE_ARRAY: > > Ken, this doesn't look quite right: the TYPE_VECTOR flag is defined only for > TYPE_CODE_ARRAY types; you should never look at TYPE_VECTOR for any other type. > > Otherwise, this looks reasonable to me ... It does seem reasonable that a vector does not have to live in target memory. -- Daniel Jacobowitz CodeSourcery