* ICE in dwarf2out_finish due to -freorder-blocks
@ 2001-12-07 9:39 Andreas Schwab
0 siblings, 0 replies; only message in thread
From: Andreas Schwab @ 2001-12-07 9:39 UTC (permalink / raw)
To: gcc
Here is a test case where the current snapshot crashes when compiling with
-O -freorder-blocks -g on ia64-linux:
typedef long unsigned int size_t;
typedef int int32_t __attribute__ ((__mode__ (__SI__)));
struct obstack
{
char *next_free;
char *chunk_limit;
};
typedef unsigned int uint32_t;
struct charmap_t
{
};
enum
{
__LC_COLLATE = 3,
};
enum
{
_NL_NUM_LC_COLLATE,
};
struct iovec
{
void *iov_base;
size_t iov_len;
};
struct localedef_t
{
union
{
struct locale_collate_t *collate;
} categories[13];
};
static inline void
obstack_int32_grow (struct obstack *obstack, int32_t data)
{
if (sizeof (int32_t) == sizeof (int))
__extension__ ({ struct obstack *__o = (obstack); if (__o->next_free + sizeof (int) > __o->chunk_limit) _obstack_newchunk (__o, sizeof (int)); *((int *)__o->next_free)++ = (data); (void) 0; });
else
__extension__ ({ struct obstack *__o = (obstack); int __len = (sizeof (int32_t)); if (__o->next_free + __len > __o->chunk_limit) _obstack_newchunk (__o, __len); memcpy ((__o->next_free), ((&data)), (__len)); __o->next_free += __len; (void) 0; });
}
struct element_t
{
size_t nwcs;
struct element_t *wcnext;
};
struct wchead_table
{
};
void wchead_table_iterate (struct wchead_table *t,
void (*fn) (uint32_t wc, struct element_t * value));
struct collidx_table
{
unsigned int p;
unsigned int q;
size_t result_size;
char *result;
};
void collidx_table_init (struct collidx_table *t);
void collidx_table_add (struct collidx_table *t, uint32_t wc, int32_t value);
struct locale_collate_t
{
struct wchead_table wcheads;
};
int32_t
output_weightwc (struct obstack *pool, struct locale_collate_t *collate,
struct element_t *elem);
void
collate_output (struct localedef_t *locale, struct charmap_t *charmap,
const char *output_path)
{
struct locale_collate_t *collate = locale->categories[__LC_COLLATE].collate;
const size_t nelems = ((int) (_NL_NUM_LC_COLLATE) & 0xffff);
struct iovec iov[2 + nelems];
uint32_t idx[nelems];
size_t cnt = 0;
struct obstack weightpool;
struct obstack extrapool;
struct collidx_table tablewc;
obstack_int32_grow (&extrapool, 0);
{
auto void add_to_tablewc (uint32_t ch, struct element_t *runp);
void add_to_tablewc (uint32_t ch, struct element_t *runp)
{
if (runp->wcnext == ((void *)0) && runp->nwcs == 1)
{
int32_t weigthidx = output_weightwc (&weightpool, collate, runp);
collidx_table_add (&tablewc, ch, weigthidx);
}
}
tablewc.p = 6;
tablewc.q = 10;
collidx_table_init (&tablewc);
wchead_table_iterate (&collate->wcheads, add_to_tablewc);
}
iov[2 + cnt].iov_base = tablewc.result;
iov[2 + cnt].iov_len = tablewc.result_size;
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
}
Andreas.
--
Andreas Schwab "And now for something
Andreas.Schwab@suse.de completely different."
SuSE Labs, SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-12-07 16:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-07 9:39 ICE in dwarf2out_finish due to -freorder-blocks Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).