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: constant slices or string arrays patch


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


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