This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Fix set $ev0.vec_f[0] = 1
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 08 Mar 2003 14:26:24 -0500
- Subject: [commit] Fix set $ev0.vec_f[0] = 1
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.
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;
}