* gcc.dg/tree-ssa/predcom-1.c (count_averages): Avoid overflow
during addition if an int is only 16 bits wide.
* gcc.dg/tree-ssa/predcom-2.c (fib): Avoid overflow of 16-bit int.
From-SVN: r126908
+2007-07-25 Rask Ingemann Lambertsen <rask@sygehus.dk>
+
+ * gcc.dg/tree-ssa/predcom-1.c (count_averages): Avoid overflow
+ during addition if an int is only 16 bits wide.
+ * gcc.dg/tree-ssa/predcom-2.c (fib): Avoid overflow of 16-bit int.
+
2007-07-25 Rask Ingemann Lambertsen <rask@sygehus.dk>
* gcc.dg/torture/pr29584.c: Only run test if pointers have the same
int i;
for (i = 1; i < n; i++)
- avg[i] = ((fib[i - 1] + fib[i] + fib[i + 1]) / 3) & 0xffff;
+ avg[i] = (((unsigned long) fib[i - 1] + fib[i] + fib[i + 1]) / 3) & 0xffff;
}
int main(void)
void abort (void);
-int fib[1000];
+long int fib[1000];
void count_fib(void)
{