Patchwork PATCH: Add testcases for PRs middle-end/41562/46185

login
register
mail settings
Submitter H.J. Lu
Date Dec. 7, 2010, 1:30 a.m.
Message ID <20101207013006.GA21173@intel.com>
Download mbox | patch
Permalink /patch/74485/
State New
Headers show

Comments

H.J. Lu - Dec. 7, 2010, 1:30 a.m.
Hi,

I checked in this patch to add testcases for PRs middle-end/41562/46185.


H.J.
---

Patch

Index: gcc.dg/graphite/pr46185.c
===================================================================
--- gcc.dg/graphite/pr46185.c	(revision 0)
+++ gcc.dg/graphite/pr46185.c	(revision 0)
@@ -0,0 +1,46 @@ 
+/* { dg-do run } */
+/* { dg-options "-O2 -floop-interchange -ffast-math -fno-ipa-cp" } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+double u[1782225];
+
+static int __attribute__((noinline))
+foo (int N, int *res)
+{
+  int i, j;
+  double sum = 0;
+  for (i = 0; i < N; i++)
+    for (j = 0; j < N; j++)
+      sum = sum + u[i + 1335 * j];
+
+  for (i = 0; i < N; i++)
+    u[1336 * i] *= 2;
+
+  *res = sum + N + u[1336 * 2] + u[1336];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+  int i, j, res;
+
+  for (i = 0; i < 1782225; i++)
+    u[i] = 2;
+
+  foo (1335, &res);
+
+#if DEBUG
+  fprintf (stderr, "res = %d \n", res);
+#endif
+
+  if (res != 3565793)
+    abort ();
+
+  return 0;
+}
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 167526)
+++ ChangeLog	(working copy)
@@ -1,3 +1,11 @@ 
+2010-12-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR middle-end/41562
+	* g++.dg/graphite/pr41562.C: New.
+
+	PR middle-end/46185
+	* gcc.dg/graphite/pr46185.c: New.
+
 2010-12-06  Nicola Pero  <nicola.pero@meta-innovation.com>
 
 	* objc.dg/foreach-8.m: New.
Index: g++.dg/graphite/pr41562.C
===================================================================
--- g++.dg/graphite/pr41562.C	(revision 0)
+++ g++.dg/graphite/pr41562.C	(revision 0)
@@ -0,0 +1,18 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-loop-distribution -floop-block" } */
+
+typedef struct stSirenEncoder { } *SirenEncoder;
+
+int Siren7_EncodeFrame(SirenEncoder encoder, unsigned char *DataIn, unsigned char *DataOut) {
+   int number_of_regions;
+   static int absolute_region_power_index[28] = {0};
+   static int region_mlt_bit_counts[28] = {0};
+   int dwRes = 0;
+   int region;
+   if (dwRes != 0) return dwRes;
+   for(region = 0; region < number_of_regions; region++)
+   {
+     absolute_region_power_index[region] += 24;
+     region_mlt_bit_counts[region] = 0;
+   }
+}