]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix PR45552: backport fix for PR45758 to 4.5 branch.
authorSebastian Pop <sebastian.pop@amd.com>
Thu, 23 Dec 2010 18:52:04 +0000 (18:52 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Thu, 23 Dec 2010 18:52:04 +0000 (18:52 +0000)
2010-12-23  Sebastian Pop  <sebastian.pop@amd.com>

Backport from mainline
Fix PR45758: reset scevs before Graphite.
        2010-09-24  Sebastian Pop  <sebastian.pop@amd.com>

PR tree-optimization/45552
* graphite.c (graphite_initialize): Call scev_reset.

* gcc.dg/graphite/pr45552.c

From-SVN: r168213

gcc/ChangeLog
gcc/graphite.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/pr45552.c [new file with mode: 0644]

index ed346ab2c66abaee066f53cc63ef3a62e0a61c7b..a436a6d92b27a3c91312e32797d25c74c19869c5 100644 (file)
@@ -1,3 +1,12 @@
+2010-12-23  Sebastian Pop  <sebastian.pop@amd.com>
+
+       Backport from mainline
+       Fix PR45758: reset scevs before Graphite.
+        2010-09-24  Sebastian Pop  <sebastian.pop@amd.com>
+
+       PR tree-optimization/45552
+       * graphite.c (graphite_initialize): Call scev_reset.
+
 2010-12-23  Sebastian Pop  <sebastian.pop@amd.com>
 
        PR tree-optimization/43023
index 2933d21571c371b7df845e3b88b397f3c952161a..fdbc81a5ee7de5f05231f230d08fd22c8c7bb759 100644 (file)
@@ -210,6 +210,7 @@ graphite_initialize (void)
       return false;
     }
 
+  scev_reset ();
   recompute_all_dominators ();
   initialize_original_copy_tables ();
   cloog_initialize ();
index 7a4a902efb1ebc630a6cc2ad5e6a1fcc7ba6377d..13dc9e1bf1510b3d8a5ce9c25a39492909fba56f 100644 (file)
@@ -1,3 +1,9 @@
+2010-12-23  Sebastian Pop  <sebastian.pop@amd.com>
+
+       PR tree-optimization/45552
+       * gcc.dg/graphite/pr45552.c
+
+
 2010-12-23  Sebastian Pop  <sebastian.pop@amd.com>
 
        PR tree-optimization/43023
diff --git a/gcc/testsuite/gcc.dg/graphite/pr45552.c b/gcc/testsuite/gcc.dg/graphite/pr45552.c
new file mode 100644 (file)
index 0000000..be1d652
--- /dev/null
@@ -0,0 +1,46 @@
+typedef struct
+{
+  double z;
+} Vector;
+typedef struct
+{
+  float *vertex;
+  float *normal;
+} VertexArray;
+typedef struct
+{
+  Vector *vertex;
+  int num_vertex;
+} ObjectSmooth;
+typedef struct
+{
+  int num_cells;
+} State;
+static void *array_from_ObjectSmooth( ObjectSmooth *obj )
+{
+  int i, j;
+  VertexArray *array = (VertexArray *) __builtin_malloc( sizeof( VertexArray ) );
+  array->vertex = (float *) __builtin_malloc( 3*sizeof(float)*obj->num_vertex );
+  array->normal = (float *) __builtin_malloc( 3*sizeof(float)*obj->num_vertex );
+  for (i=0, j=0; i<obj->num_vertex; ++i) {
+    array->normal[j++] = 9;
+    array->vertex[j] = obj->vertex[i].z;
+    array->normal[j++] = 1;
+  }
+}
+static void draw_cell( void )
+{
+  glCallList( array_from_ObjectSmooth( (ObjectSmooth *) __builtin_malloc(10) ));
+}
+static int render( State *st)
+{
+  int b;
+  for (b=0; b<st->num_cells; ++b) {
+    draw_cell();
+    draw_cell();
+  }
+}
+reshape_glcells( int width, int height )
+{
+  render( 0 );
+}