@@ -191,12 +191,14 @@ static void partition_struct(tree *fields, unsigned long length, struct partitio
191
191
192
192
static void performance_shuffle (tree * newtree , unsigned long length , ranctx * prng_state )
193
193
{
194
- unsigned long i , x ;
194
+ unsigned long i , x , index ;
195
195
struct partition_group size_group [length ];
196
196
unsigned long num_groups = 0 ;
197
197
unsigned long randnum ;
198
198
199
199
partition_struct (newtree , length , (struct partition_group * )& size_group , & num_groups );
200
+
201
+ /* FIXME: this group shuffle is currently a no-op. */
200
202
for (i = num_groups - 1 ; i > 0 ; i -- ) {
201
203
struct partition_group tmp ;
202
204
randnum = ranval (prng_state ) % (i + 1 );
@@ -206,11 +208,14 @@ static void performance_shuffle(tree *newtree, unsigned long length, ranctx *prn
206
208
}
207
209
208
210
for (x = 0 ; x < num_groups ; x ++ ) {
209
- for (i = size_group [x ].start + size_group [ x ]. length - 1 ; i > size_group [ x ]. start ; i -- ) {
211
+ for (index = size_group [x ].length - 1 ; index > 0 ; index -- ) {
210
212
tree tmp ;
213
+
214
+ i = size_group [x ].start + index ;
211
215
if (DECL_BIT_FIELD_TYPE (newtree [i ]))
212
216
continue ;
213
- randnum = ranval (prng_state ) % (i + 1 );
217
+ randnum = ranval (prng_state ) % (index + 1 );
218
+ randnum += size_group [x ].start ;
214
219
// we could handle this case differently if desired
215
220
if (DECL_BIT_FIELD_TYPE (newtree [randnum ]))
216
221
continue ;
0 commit comments