This is the mail archive of the gdb-cvs@sourceware.org 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]

[binutils-gdb] sim: h8300: move unused/buggy lregs array


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c78dff22918f29b3970729f32f70060b70e75678

commit c78dff22918f29b3970729f32f70060b70e75678
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Wed Dec 30 01:49:53 2015 -0500

    sim: h8300: move unused/buggy lregs array
    
    This array isn't used anywhere, and the init phase actually corrupts
    some memory because the array has 18 elements but tries to set the
    19th (ZERO) position.

Diff:
---
 sim/h8300/ChangeLog | 5 +++++
 sim/h8300/compile.c | 4 ----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index b4ad754..b293b29 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -1,5 +1,10 @@
 2015-12-30  Mike Frysinger  <vapier@gentoo.org>
 
+	* compile.c (lreg): Delete.
+	(init_pointers): Delete lreg assignments.
+
+2015-12-30  Mike Frysinger  <vapier@gentoo.org>
+
 	* inst.h: Delete file.
 	* Makefile.in (compile.o): Delete rule.
 
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index bc91725..beb2ab6 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -1251,7 +1251,6 @@ compile (SIM_DESC sd, int pc)
 
 static unsigned char  *breg[32];
 static unsigned short *wreg[16];
-static unsigned int   *lreg[18];
 
 #define GET_B_REG(X)     *(breg[X])
 #define SET_B_REG(X, Y) (*(breg[X])) = (Y)
@@ -1828,11 +1827,8 @@ init_pointers (SIM_DESC sd)
 	    sim_io_printf (sd, "init_pointers: internal error.\n");
 
 	  h8_set_reg (sd, i, 0);
-	  lreg[i] = h8_get_reg_buf (sd) + i;
 	}
 
-      /* Note: sim uses pseudo-register ZERO as a zero register.  */
-      lreg[ZERO_REGNUM] = h8_get_reg_buf (sd) + ZERO_REGNUM;
       init_pointers_needed = 0;
 
       /* Initialize the seg registers.  */


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