This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/33137] [4.3 Regression] Segfault in build_classic_dist_vector_1 in gcc/tree-data-ref.c
- From: "tbm at cyrius dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Aug 2007 14:55:43 -0000
- Subject: [Bug middle-end/33137] [4.3 Regression] Segfault in build_classic_dist_vector_1 in gcc/tree-data-ref.c
- References: <bug-33137-12387@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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