From: Jim Wilson Date: Mon, 6 May 1996 23:39:46 +0000 (-0700) Subject: (gen_shifty_op): Truncate VALUE to avoid out of bounds array access. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cff3d762dc57a3a91e1dfaeccb9fbee5457b6e40;p=gcc.git (gen_shifty_op): Truncate VALUE to avoid out of bounds array access. From-SVN: r11947 --- diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 764bf31d5e8..1f3e43c39c4 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -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)