OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [pr36908.c] - Diff between revs 298 and 338

Only display areas with differences | Details | Blame | View Log

Rev 298 Rev 338
/* { dg-do compile } */
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-loop-distribution" } */
/* { dg-options "-O2 -ftree-loop-distribution" } */
#define NULL ((void *)0)
#define NULL ((void *)0)
 
 
__extension__ typedef __SIZE_TYPE__ size_t;
__extension__ typedef __SIZE_TYPE__ size_t;
extern void *foo(size_t nelem, size_t elsize);
extern void *foo(size_t nelem, size_t elsize);
extern void bar (char*, ...);
extern void bar (char*, ...);
 
 
typedef struct alt_state *alt_state_t;
typedef struct alt_state *alt_state_t;
typedef struct state *state_t;
typedef struct state *state_t;
 
 
struct alt_state
struct alt_state
{
{
  alt_state_t next_alt_state;
  alt_state_t next_alt_state;
};
};
 
 
static alt_state_t first_free_alt_state = NULL;
static alt_state_t first_free_alt_state = NULL;
 
 
static void
static void
free_alt_state (alt_state_t alt_state)
free_alt_state (alt_state_t alt_state)
{
{
  if (alt_state == NULL)
  if (alt_state == NULL)
    return;
    return;
  alt_state->next_alt_state = first_free_alt_state;
  alt_state->next_alt_state = first_free_alt_state;
  first_free_alt_state = alt_state;
  first_free_alt_state = alt_state;
}
}
 
 
/* The function frees list started with node ALT_STATE_LIST.  */
/* The function frees list started with node ALT_STATE_LIST.  */
static void
static void
free_alt_states (alt_state_t alt_states_list)
free_alt_states (alt_state_t alt_states_list)
{
{
  alt_state_t curr_alt_state;
  alt_state_t curr_alt_state;
  alt_state_t next_alt_state;
  alt_state_t next_alt_state;
 
 
  for (curr_alt_state = alt_states_list;
  for (curr_alt_state = alt_states_list;
       curr_alt_state != NULL;
       curr_alt_state != NULL;
       curr_alt_state = next_alt_state)
       curr_alt_state = next_alt_state)
    {
    {
      next_alt_state = curr_alt_state->next_alt_state;
      next_alt_state = curr_alt_state->next_alt_state;
      free_alt_state (curr_alt_state);
      free_alt_state (curr_alt_state);
    }
    }
}
}
 
 
int
int
main (void)
main (void)
{
{
  int i;
  int i;
  alt_state_t state, act_state;
  alt_state_t state, act_state;
 
 
  act_state = state = foo (1, sizeof (struct alt_state));
  act_state = state = foo (1, sizeof (struct alt_state));
  for (i = 0; i < 2; i ++)
  for (i = 0; i < 2; i ++)
  {
  {
    act_state->next_alt_state = foo (1, sizeof (struct alt_state));
    act_state->next_alt_state = foo (1, sizeof (struct alt_state));
    act_state = act_state->next_alt_state;
    act_state = act_state->next_alt_state;
  }
  }
 
 
  free_alt_states (state);
  free_alt_states (state);
 
 
  for (act_state = first_free_alt_state;
  for (act_state = first_free_alt_state;
       act_state != NULL;
       act_state != NULL;
       act_state = act_state->next_alt_state)
       act_state = act_state->next_alt_state)
       bar ("going from %p to %p\n", act_state, act_state->next_alt_state);
       bar ("going from %p to %p\n", act_state, act_state->next_alt_state);
 
 
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.