Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: ken@linux.vnet.ibm.com (Ken Werner), dan@codesourcery.com
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Small fix for assigning values to vectors
Date: Wed, 07 Jul 2010 17:50:00 -0000	[thread overview]
Message-ID: <201007071750.o67HoEVU029546@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <201007061558.07312.ken@linux.vnet.ibm.com> from "Ken Werner" at Jul 06, 2010 03:58:07 PM

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


  reply	other threads:[~2010-07-07 17:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-06 13:58 Ken Werner
2010-07-07 17:50 ` Ulrich Weigand [this message]
2010-07-07 18:26   ` Daniel Jacobowitz
2010-07-09 10:39     ` Ken Werner
2010-07-09 13:03       ` Daniel Jacobowitz
2010-07-09 13:16         ` Ulrich Weigand
2010-07-09 13:12       ` Ulrich Weigand
2010-07-10 13:04         ` Ken Werner
2010-07-10 15:39           ` Daniel Jacobowitz
2010-07-10 17:05             ` Ken Werner
2010-07-12 14:55               ` Ulrich Weigand
2010-07-14 14:55                 ` Ken Werner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201007071750.o67HoEVU029546@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ken@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox