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: [patch] fix wrong gimple code with ptr to forward vla


Richard Kenner wrote:
I think I understand why the heuristic works, in practice. It's based on Richard's explanation, which assumes an Ada-like language in which types are elaborated at a well-defined point.

I don't follow that comment. It would seem to me that in *any* language where you have a definition of a type that involves variables, you have a be able to specify which value of the variable is used, meaning that you have to elaborate the type at a well-defined point.

Yes -- but that doesn't necessarily correspond to a type-declaration, as signified by a TYPE_DECL.


Your approach is imposing TYPE_DECLs on front ends. Joseph's is requiring front ends to make clear when things are evaluated.

Joseph's approach is more explicit, and therefore more flexible; some languages might require that array bounds be evaluated in a particular order, for example, so that the equivalent of "int x[f()][g()];" had well-defined behavior. A TYPE_DECL for an ARRAY_TYPE with the obvious bounds doesn't make that explicit. So, the front end would need to expand things anyhow; Joseph (and I) think we might as well just require that the front end always do that.

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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