+2015-11-18 Ajit Agarwal <ajitkum@xilinx.com>
+
+ * gcc.dg/tree-ssa/split-path-1.c: Fix the testcase
+ to avoid undefined behaviour.
+
2015-11-18 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/68157
#include <stdio.h>
#include <stdlib.h>
+#include <ctype.h>
-#define RGBMAX 255
+#define RGBMAX 255
-int
+unsigned char
test()
{
int i, Pels;
- unsigned char sum = 0;
+ int sum = 0;
unsigned char xr, xg, xb;
- unsigned char xc, xm, xy, xk;
+ unsigned char xc, xm, xy, xk = 0;
unsigned char *ReadPtr, *EritePtr;
ReadPtr = ( unsigned char *) malloc (sizeof (unsigned char) * 100);
ReadPtr[i] = 100 - i;
}
- for (i = 0; i < 100; i++)
+ for (i = 0; i < 24; i++)
{
xr = *ReadPtr++;
xg = *ReadPtr++;
*EritePtr++ = xm;
*EritePtr++ = xy;
*EritePtr++ = xk;
- sum += *EritePtr;
+ sum += *(--EritePtr);
+
}
return sum;
}
int
main()
{
- if (test() != 33)
+ if (test() != 196)
abort();
return 0;