This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: constant slices or string arrays patch
- From: Ian Lance Taylor <iant at google dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: 06 Dec 2006 08:41:28 -0800
- Subject: Re: constant slices or string arrays patch
- References: <1165361441.3607.30.camel@localhost.localdomain>
Andrew MacLeod <amacleod@redhat.com> writes:
> This patch works for my testcase, and we get the proper constant array
> slice. What I'm not sure of is if I am using all the widgetry correctly.
> Can the offset and lower bound of a string constant be different types?
> Someone who knows how to use this code properly will have to let me know
> if I am missing some conversions, or something else :-).
I think you need to fold_convert offset and lower_bound to sizetype.
I don't think there is any particular guarantee that they have that
type, or that they have the same type. In particular the lower bound
will typically have type TYPE_DOMAIN (array_type), which in Ada can
probably be any random type.
Patch is OK with that change.
Thanks.
Ian