===================================================================
@@ -12817,7 +12729,7 @@ fold_binary_loc (location_t loc,
tree arg00 = TREE_OPERAND (arg0, 0);
tree arg01 = TREE_OPERAND (arg0, 1);
tree itype = TREE_TYPE (arg00);
- if (wi::eq_p (arg01, TYPE_PRECISION (itype) - 1))
+ if (wi::eq_p (arg01, element_precision (itype) - 1))
{
if (TYPE_UNSIGNED (itype))
{
===================================================================
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+
+#include "tree-vect.h"
+
+extern void abort (void);
+
+int a, b[8] = { 2, 0, 0, 0, 0, 0, 0, 0 }, c[8];
+
+int
+main ()
+{
+ int d;
+ check_vect ();
+ for (; a < 8; a++)
+ {
+ d = b[a] >> 1;
+ c[a] = d != 0;
+ }
+ if (c[0] != 1)
+ abort ();
+ return 0;
+}