This is the mail archive of the gcc-patches@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]

Re: [PTR-PLUS] Add/fix documentation for POINTER_PLUS_EXPR


On 5/7/07, Andrew_Pinski@playstation.sony.com
<Andrew_Pinski@playstation.sony.com> wrote:
Hi,
  I figured as much that I needed to update the documentation for the
addition of POINTER_PLUS_EXPR.  This patch does that and fixes one small
documentation in tree.def about the second operand.

The "small fix", documenting the 2nd operand of POINTER_PLUS_EXPR to be always unsigned instead of signed makes me curious. This effectively means that POINTER_PLUS_EXPR overflow is defined as wrapping, which will make some transformations we do now invalid and complicates re-construction of array accesses &a p+ CST to &a[CST/element_size] where this division needs to be done as signed.

So I would have thought an always signed representation of the
2nd operand would have been a more natural choice.

Any clarifications on why you came to this conclusion?

Thanks,
Richard.

Committed after bootstrap/test on i686-linux-gnu.

Thanks,
Andrew Pinski

ChangeLog:

        * tree.def (POINTER_PLUS_EXPR): The second operand
        is of type sizetype and not ssizetype.
        * doc/c-tree.texi (POINTER_PLUS_EXPR): Document.





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