This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Exception Handling address comparison implementation error
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: Exception Handling address comparison implementation error
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Mon, 01 Oct 2001 21:04:50 -0400
- cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
I tried changing fde_unencoded_compare to
static saddr
fde_unencoded_compare (struct object *ob __attribute__((unused)),
fde *x, fde *y)
{
if (x->pc_begin < y->pc_begin)
return -1;
else if (x->pc_begin > y->pc_begin)
return 1;
else
return 0;
}
but that does not work correctly for me. Maybe I am missing some trivial
typo.
I still am trying to figure out if the signed integer sort was
intended for the "linear" and "erratic" address arrays. A comment says:
Split LINEAR into a linear sequence with low values and an erratic
sequence with high values, put the linear one (of longest possible
length) into LINEAR and the erratic one into ERRATIC.
The signed integer comparison first is used to determine when to place
FDEs on the erratic list.
The signed integer final sort does not seem like it could work
with a binary search of the resulting table comparing unsigned addresses
(pc and pc_begin are "void *"):
size_t i = (lo + hi) / 2;
fde *f = vec->array[i];
pc_begin = ((void **)f->pc_begin)[0];
pc_range = ((uaddr *)f->pc_begin)[1];
if (pc < pc_begin)
hi = i;
else if (pc >= pc_begin + pc_range)
lo = i + 1;
else
return f;
Thanks, David