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
Mark
Here's a patch but I'm not sure if it's technically correct.
With the patch applied the test case compiles on x86 and the
generated code looks correct.
Graham
Changelog
* (get_inner_reference): Convert offset to correct 'size type'.
=============================expr.c.diff=====================================
*** expr.c Wed Mar 8 12:29:58 2000
--- expr.c.new Sun Mar 12 19:03:04 2000
*************** get_inner_reference (exp, pbitsize, pbit
*** 4992,4998 ****
*pbitpos += TREE_INT_CST_LOW (constant);
offset
! = size_binop (PLUS_EXPR, offset,
convert (sizetype,
size_binop (EXACT_DIV_EXPR, var,
bitsize_int (BITS_PER_UNIT))));
--- 4992,4998 ----
*pbitpos += TREE_INT_CST_LOW (constant);
offset
! = size_binop (PLUS_EXPR, convert (sizetype, offset),
convert (sizetype,
size_binop (EXACT_DIV_EXPR, var,
bitsize_int (BITS_PER_UNIT))));
==============================================================================