This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/81695] [5/6/7/8 Regression] internal compiler error: in size_binop_loc, at fold-const.c:1768


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81695

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Btw, one mistake in the folding is that

  if (TREE_CODE (sub) == POINTER_PLUS_EXPR
      && TREE_CODE (TREE_OPERAND (sub, 1)) == INTEGER_CST)
    {
      tree op00 = TREE_OPERAND (sub, 0);
      tree op01 = TREE_OPERAND (sub, 1);
^^^

this has to be interpreted as signed (but is always sizetype).  I suspect
restricting this to INTEGER_CST min_val and doing the arithmetic with
offset_ints is easiest.  The non-ARRAY_TYPE cases look ok to me.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]