Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA][2/5] New port: Cell BE SPU (valops.c fix)
@ 2006-11-11 18:38 Ulrich Weigand
  2006-11-22 14:15 ` [PING] " Ulrich Weigand
  2006-11-22 14:23 ` Daniel Jacobowitz
  0 siblings, 2 replies; 35+ messages in thread
From: Ulrich Weigand @ 2006-11-11 18:38 UTC (permalink / raw)
  To: gdb-patches

Hello,

this fixes another problem for the SPU port.  In value_assign,
when assigning to a register that is marked as CONVERT_REGISTER_P,
the front end always calls VALUE_TO_REGISTER, which always cleans
out the full previous contents of the register.

This happens even if the value is a bitfield that occupies only
part of the register, and the remaining contents should *not* be
changed.  The back end's VALUE_TO_REGISTER has no real chance to
do this right since it doesn't even get the value object as input,
and thus doesn't know that value_bitsize is nonzero.

This probably rarely triggers on other architectures, as those
registers that require CONVERT_REGISTER_P tend to be special 
registers that usually don't hold bitfield values.  On the SPU
however, every general-purpose register needs CONVERT_REGISTER_P
(since they are really 16-byte vector registers, and loading/
storing scalar values required a special conversion).

The patch below 'fixes' this for SPU by at least not calling
VALUE_TO_REGISTER for bitfield assignments, but falling back
to the default code.  This happens to work for SPU; other 
platforms with special conversion needs might need to get a
chance for the back-end to get involved even then.  I guess
when this happens we can think of an extended interface that
would pass the bitsize information through to the back-end ...

Tested on SPU (where it fixes about a dozen test cases).
Also tested without regressions on s390-ibm-linux and
s390x-ibm-linux.

OK?


Bye,
Ulrich


ChangeLog:

	* valops.c (value_assign): Do not call VALUE_TO_REGISTER
	for bitfield assignments.


diff -urN gdb-orig/gdb/valops.c gdb-head/gdb/valops.c
--- gdb-orig/gdb/valops.c	2006-10-09 21:28:14.000000000 +0200
+++ gdb-head/gdb/valops.c	2006-10-30 19:39:02.972619008 +0100
@@ -643,6 +643,7 @@
 	  error (_("Value being assigned to is no longer active."));
 	
 	if (VALUE_LVAL (toval) == lval_register
+	    && value_bitsize (toval) == 0
 	    && CONVERT_REGISTER_P (VALUE_REGNUM (toval), type))
 	  {
 	    /* If TOVAL is a special machine register requiring
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2006-12-08 15:50 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-11 18:38 [RFA][2/5] New port: Cell BE SPU (valops.c fix) Ulrich Weigand
2006-11-22 14:15 ` [PING] " Ulrich Weigand
2006-11-22 14:23 ` Daniel Jacobowitz
2006-11-22 19:25   ` Jim Blandy
2006-11-22 19:28     ` Daniel Jacobowitz
2006-11-22 19:55       ` Ulrich Weigand
2006-11-22 20:30         ` Daniel Jacobowitz
2006-11-22 20:43           ` Ulrich Weigand
2006-11-22 20:57             ` Daniel Jacobowitz
2006-11-22 22:13               ` Ulrich Weigand
2006-11-22 22:48                 ` Daniel Jacobowitz
2006-11-23 13:57                   ` Ulrich Weigand
2006-11-23 16:16                     ` Daniel Jacobowitz
2006-11-23 17:55                       ` Ulrich Weigand
2006-11-23 19:59                         ` Mark Kettenis
2006-11-24  2:08                           ` Daniel Jacobowitz
2006-11-24 15:51                             ` Ulrich Weigand
2006-11-28 14:56                               ` Daniel Jacobowitz
2006-11-27 19:31                         ` Jim Blandy
2006-11-27 22:06                           ` Ulrich Weigand
2006-11-27 22:31                             ` Jim Blandy
2006-11-27 23:23                               ` Ulrich Weigand
2006-11-27 23:59                                 ` Jim Blandy
2006-11-28  0:01                                 ` Daniel Jacobowitz
2006-12-06 16:29                                   ` Ulrich Weigand
2006-12-06 16:43                                     ` Daniel Jacobowitz
2006-12-06 17:10                                       ` Ulrich Weigand
2006-12-06 17:12                                         ` Daniel Jacobowitz
2006-12-07  6:34                                           ` Vladimir Prus
2006-12-06 21:21                                     ` Jim Blandy
2006-12-06 22:02                                       ` Daniel Jacobowitz
2006-12-06 23:24                                         ` Jim Blandy
2006-12-06 23:16                                       ` Ulrich Weigand
2006-12-06 23:39                                         ` Jim Blandy
2006-12-08 15:50                                           ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox