This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [commit] Fix set $ev0.vec_f[0] = 1


On Sat, Mar 08, 2003 at 02:26:24PM -0500, Andrew Cagney wrote:
> Hello,
> 
> The attached fixes the code that handles `set variable $ev0.vec_f[0] = 
> 1'.  i.e., assignment to a vector element of a vector register.
> 
> The problem was two fold:
> 
> - the code handling the subscripting of register and builtin variables 
> never thought to set VALUE_REGNO(), leaving it with a value of -1.
> 
> - the code handling register assignments was recently revamped (fixing 
> bugs), but in the process started assuming that VALUE_REGNO() field of a 
> destination value was valid.
> 
> This patch fixes the subscript code so that the register number is valid.
> 
> committed,
> Andrew
> 
> PS: Elena's e500 tests, that I just posted, tickle this bug.

This patch is the same as the unreviewed pending/973 from Klee, by the
way.  He also fixed a related comment; should that go in too?

> 2003-03-08  Andrew Cagney  <cagney at redhat dot com>
> 
> 	* valarith.c (value_subscripted_rvalue): Copy the array's REGNO to
> 	the result.
> 
> Index: valarith.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/valarith.c,v
> retrieving revision 1.18
> diff -u -r1.18 valarith.c
> --- valarith.c	14 Jan 2003 00:49:04 -0000	1.18
> +++ valarith.c	8 Mar 2003 19:18:45 -0000
> @@ -276,6 +276,7 @@
>    else
>      VALUE_LVAL (v) = VALUE_LVAL (array);
>    VALUE_ADDRESS (v) = VALUE_ADDRESS (array);
> +  VALUE_REGNO (v) = VALUE_REGNO (array);
>    VALUE_OFFSET (v) = VALUE_OFFSET (array) + elt_offs;
>    return v;
>  }


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]