This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/33137] [4.3 Regression] Segfault in build_classic_dist_vector_1 in gcc/tree-data-ref.c



------- Comment #2 from tbm at cyrius dot com  2007-08-21 14:55 -------
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */

struct fcs_struct_state_t
{
  char freecells[4];
};
typedef struct fcs_struct_state_t fcs_state_t;
struct fcs_struct_state_with_locations_t
{
  fcs_state_t s;
};
typedef struct fcs_struct_state_with_locations_t fcs_state_with_locations_t;
fcs_card_compare (const char *card1, const char *card2)
{
  if (((*card1) & 0x0F) > ((*card2) & 0x0F))
      return 1;
  return -1;
}
freecell_solver_canonize_state (fcs_state_with_locations_t *state,
                                int freecells_num)
{
  int b, c;
  for (b = 1; b < freecells_num; b++)
    {
      c = b;
      while ((c > 0)
             &&
             (fcs_card_compare
              (&(state->s.freecells[c]), &(state->s.freecells[c - 1])) < 0))
        {
          state->s.freecells[c] = state->s.freecells[c - 1];
          c--;
        }
    }
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33137


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]