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]

[RFA] sh-sim, return instead of break.


Rather a fundamental logic error...

2003-07-09  Michael Snyder  <msnyder@redhat.com>

	* gencode.c (ppi_gensim): For a conditional ppi insn, if the
	condition is false, we want to return (not break).  A break
	will take us to the end of the function where registers will
	be updated, whereas the desired outcome is for nothing to change.

Index: gencode.c
===================================================================
RCS file: /cvs/src/src/sim/sh/gencode.c,v
retrieving revision 1.8
diff -p -r1.8 gencode.c
*** gencode.c	4 Jul 2003 00:03:52 -0000	1.8
--- gencode.c	9 Jul 2003 18:56:25 -0000
*************** ppi_gensim ()
*** 2459,2465 ****
  	      break;
  	    case 'c':
  	      printf ("      if ((((iword >> 8) ^ DSR) & 1) == 0)\n");
! 	      printf ("\tbreak;\n");
  	      printf ("    }\n");
  	      printf ("  case %d:      \n", p->index + 1);
  	      printf ("    {\n");
--- 2459,2465 ----
  	      break;
  	    case 'c':
  	      printf ("      if ((((iword >> 8) ^ DSR) & 1) == 0)\n");
! 	      printf ("\treturn;\n");
  	      printf ("    }\n");
  	      printf ("  case %d:      \n", p->index + 1);
  	      printf ("    {\n");

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