This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-20000306 ICE in `size_binop', at fold-const.c:1873
>>>>> "grahams" == grahams <grahams@rcp.co.uk> writes:
grahams> Mark
grahams> Here's a patch but I'm not sure if it's technically
grahams> correct.
I don't know either. But I hope not.
In get_inner_reference, offset is initialized to size_zero_node. It's
never assigned to, except as the result of `size_binop'. And, yet, it
ends up not having sizetype, do to oddness in `fold'. Surely, if we
just keep calling size_binop, and passing the result back to
size_binop, we should not have to explicitly convert to size_type
between each call. So, either size_binop should convert its result,
or `fold' should not be doing what it's doing.
What's odd here is that sizetype is an unsigned type, and yet you've
found a place where offset is quite reasonably negative. The fix
might be that get_inner_reference should use integer_type, rather that
sizetype.
I hope Kenner will fix the bug, since he's been working on this stuff
lately, and has the clearest sense of his own intentions.
Thanks for the patch,
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com