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: mark at codesourcery dot com
- Subject: Re: egcs-20000306 ICE in `size_binop', at fold-const.c:1873
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Fri, 17 Mar 00 12:06:24 EST
- Cc: gcc-patches at gcc dot gnu dot org
I think having sizetype not be the same type as `size_t' is pretty
confusing in C.
It is the same type from all but a very low-level view.
It seems to me that offsets should have type `ptrdiff_t', and sizes
should have type `size_t'; I guess those are spelled `ssizetype' and
`sizetype'.
Right.
But, then, it should be allowed to add a `ssizetype' to a `sizetype',
just as in C you can add a `ptrdiff_t' to a `size_t'.
Yes, but when you do that in C, we generate a tree that has a conversion,
so we should do so internally as well.
I don't know about "most languages", but offsets can definitely be
negative in C and C++. Any time that `p' and `q' are two pointers, `p
- q' is a signed quantity, and that's well-defined, as long as `p' and
`q' point into the same array.
Sorry, that's not what I meant by "offset". I meant the value
returned by get_inner_reference or stored in DECL_FIELD_BITPOS: can
the value we use as an offset from a composite variable in order to
access a component of that variable ever be negative?