This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

stormy16: Fix stormy16_output_shift bug.



One of the c-torture testcases showed this up: sometimes 'temp' can
be a MEM or something other than a REG.

Tested on stormy16-elf.

-- 
Geoff Keating <geoffk@redhat.com>

===File ~/patches/gcc-stormy-shiftnotemp.patch==============
2001-11-03  Geoffrey Keating  <geoffk@redhat.com>

	* config/stormy16/stormy16.c (stormy16_output_shift): Don't
	look at 'temp' if we won't be using it.

Index: stormy16.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/stormy16/stormy16.c,v
retrieving revision 1.7
diff -p -u -p -r1.7 stormy16.c
--- stormy16.c	2001/10/19 21:23:29	1.7
+++ stormy16.c	2001/11/03 19:51:32
@@ -1818,7 +1865,6 @@ stormy16_output_shift (mode, code, x, si
 
   r0 = reg_names [REGNO (x)];
   r1 = reg_names [REGNO (x) + 1];
-  rt = reg_names [REGNO (temp)];
 
   /* For shifts of size 1, we can use the rotate instructions.  */
   if (size == 1)
@@ -1883,6 +1929,7 @@ stormy16_output_shift (mode, code, x, si
 
   /* For the rest, we have to do more work.  In particular, we
      need a temporary.  */
+  rt = reg_names [REGNO (temp)];
   switch (code)
     {
     case ASHIFT:
============================================================


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