From 5256e11570d033e38f9fb3d5a88d190b19d4b8ce Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Thu, 23 Dec 2010 18:52:04 +0000 Subject: [PATCH] Fix PR45552: backport fix for PR45758 to 4.5 branch. 2010-12-23 Sebastian Pop Backport from mainline Fix PR45758: reset scevs before Graphite. 2010-09-24 Sebastian Pop PR tree-optimization/45552 * graphite.c (graphite_initialize): Call scev_reset. * gcc.dg/graphite/pr45552.c From-SVN: r168213 --- gcc/ChangeLog | 9 +++++ gcc/graphite.c | 1 + gcc/testsuite/ChangeLog | 6 ++++ gcc/testsuite/gcc.dg/graphite/pr45552.c | 46 +++++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/graphite/pr45552.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed346ab2c66a..a436a6d92b27 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2010-12-23 Sebastian Pop + + Backport from mainline + Fix PR45758: reset scevs before Graphite. + 2010-09-24 Sebastian Pop + + PR tree-optimization/45552 + * graphite.c (graphite_initialize): Call scev_reset. + 2010-12-23 Sebastian Pop PR tree-optimization/43023 diff --git a/gcc/graphite.c b/gcc/graphite.c index 2933d21571c3..fdbc81a5ee7d 100644 --- a/gcc/graphite.c +++ b/gcc/graphite.c @@ -210,6 +210,7 @@ graphite_initialize (void) return false; } + scev_reset (); recompute_all_dominators (); initialize_original_copy_tables (); cloog_initialize (); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7a4a902efb1e..13dc9e1bf151 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-12-23 Sebastian Pop + + PR tree-optimization/45552 + * gcc.dg/graphite/pr45552.c + + 2010-12-23 Sebastian Pop 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 index 000000000000..be1d6520009b --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr45552.c @@ -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; inum_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; bnum_cells; ++b) { + draw_cell(); + draw_cell(); + } +} +reshape_glcells( int width, int height ) +{ + render( 0 ); +} -- 2.47.2