(gen_shifty_op): Truncate VALUE to avoid out of bounds array access.
authorJim Wilson <wilson@gcc.gnu.org>
Mon, 6 May 1996 23:39:46 +0000 (16:39 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Mon, 6 May 1996 23:39:46 +0000 (16:39 -0700)
From-SVN: r11947

gcc/config/sh/sh.c

index 764bf31d5e8203b1ee4ca2df3f4f6860c685f641..1f3e43c39c4faf710eda4aa3f0237af7f71a1caa 100644 (file)
@@ -901,6 +901,9 @@ gen_shifty_op (code, operands)
   int value = INTVAL (operands[2]);
   int max, i;
 
+  /* Truncate the shift count in case it is out of bounds.  */
+  value = value & 0x1f;
   if (value == 31)
     {
       if (code == LSHIFTRT)