This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-20000306 ICE in `size_binop', at fold-const.c:1873
- To: grahams at rcp dot co dot uk
- Subject: Re: egcs-20000306 ICE in `size_binop', at fold-const.c:1873
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Tue, 14 Mar 2000 09:15:26 -0800
- Cc: kenner at vlsi1 dot ultra dot nyu dot edu, gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <200003121601.e2CG17b18610@sleipnir.valparaiso.cl><20000312091821C.mitchell@codesourcery.com><38CBEE77.DE711AA0@rcp.co.uk>
>>>>> "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