diff mbox

[wide-int] fixed several regressions in branch.

Message ID 52D5E3F9.3020503@naturalbridge.com
State New
Headers show

Commit Message

Kenneth Zadeck Jan. 15, 2014, 1:27 a.m. UTC
This patch fixes what appears to have been a long standing failure in 
the conversion of tree-vect-generic.c:build_replicated_const. This 
failure caused several regressions on the branch.

Committed as revision 206616
diff mbox

Patch

Index: gcc/tree-vect-generic.c
===================================================================
--- gcc/tree-vect-generic.c	(revision 206609)
+++ gcc/tree-vect-generic.c	(working copy)
@@ -57,7 +57,8 @@  static tree
 build_replicated_const (tree type, tree inner_type, HOST_WIDE_INT value)
 {
   int width = tree_to_uhwi (TYPE_SIZE (inner_type));
-  int n = TYPE_PRECISION (type) / width;
+  int n = (TYPE_PRECISION (type) + HOST_BITS_PER_WIDE_INT - 1) 
+    / HOST_BITS_PER_WIDE_INT;
   unsigned HOST_WIDE_INT low, mask;
   HOST_WIDE_INT a[WIDE_INT_MAX_ELTS];
   int i;