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]

[PATCH,sim/sh] lvalue casts


Hi,

gcc-4.0.0 chokes on with an "invalid lvalue" error on the code generated
by sh/gencode.c (gdb-CVS mainline).

The patch below seems to fix this issue for me.

AFAIS, the "(unsigned int) R[]" cast are just superfluous.

Ralf

2005-05-02  Ralf Corsepius <ralf.corsepius@rtems.org>

	* gencode.c (divu R0,<REG_N>): Remove lvalue casts to please gcc4.


Index: gencode.c
===================================================================
RCS file: /cvs/src/src/sim/sh/gencode.c,v
retrieving revision 1.31
diff -u -r1.31 gencode.c
--- gencode.c	14 Apr 2005 20:16:06 -0000	1.31
+++ gencode.c	2 May 2005 15:10:03 -0000
@@ -215,7 +215,7 @@
     "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();",
     "if (R0 == 0)",
     "  R[n] = 0xffffffff;",
-    "else (unsigned int) R[n] = (unsigned int) R[n] / (unsigned int) R0;",
+    "else R[n] = R[n] / (unsigned int) R0;",
     "L (n);",
   },
   { "n", "0n", "mulr R0,<REG_N>", "0100nnnn10000000",

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