From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26819 invoked by alias); 7 Jul 2010 17:50:31 -0000 Received: (qmail 26799 invoked by uid 22791); 7 Jul 2010 17:50:29 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.17.163) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jul 2010 17:50:22 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.1/8.13.1) with ESMTP id o67HoIUl032552 for ; Wed, 7 Jul 2010 17:50:18 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o67HoIH91777894 for ; Wed, 7 Jul 2010 19:50:18 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o67HoFpu029572 for ; Wed, 7 Jul 2010 19:50:18 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id o67HoEVU029546; Wed, 7 Jul 2010 19:50:14 +0200 Message-Id: <201007071750.o67HoEVU029546@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 07 Jul 2010 19:50:14 +0200 Subject: Re: [patch] Small fix for assigning values to vectors To: ken@linux.vnet.ibm.com (Ken Werner), dan@codesourcery.com Date: Wed, 07 Jul 2010 17:50:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <201007061558.07312.ken@linux.vnet.ibm.com> from "Ken Werner" at Jul 06, 2010 03:58:07 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/msg00119.txt.bz2 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 ... > @@ -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 ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com