On Sat, Nov 23, 2013 at 8:20 PM, Mike Stump <mikest...@comcast.net> wrote:
> Richi has asked the we break the wide-int patch so that the individual port 
> and front end maintainers can review their parts without have to go through 
> the entire patch.    This patch covers the builtins code.

-  HOST_WIDE_INT c[2];
   HOST_WIDE_INT ch;
   unsigned int i, j;
+  HOST_WIDE_INT tmp[MAX_BITSIZE_MODE_ANY_INT / HOST_BITS_PER_WIDE_INT];
+  unsigned int len = (GET_MODE_PRECISION (mode) + HOST_BITS_PER_WIDE_INT - 1)
+    / HOST_BITS_PER_WIDE_INT;
+
+  for (i = 0; i < len; i++)
+    tmp[i] = 0;

   gcc_assert (GET_MODE_CLASS (mode) == MODE_INT);

The assert should be moved before accessing the mode precision.

Btw, this function makes me always think twice on whether it
returns the correct thing for big vs. little endian if the mode
is bigger than a HWI ... and I suspect it does not(?).

Ok with moving the assert.

Thanks,
Richard.

> Ok?
>

Reply via email to