> I had thought of a hash table, too, but I couldn't figure out where to > initialize and free it (i.e. where it is a "live" table, so to speak). For > example, I don't know if this table would be required after gimplification, > and I also don't even know how GNAT translates its own representation to > GIMPLE (whole translation unit at once? function at a time?).
It's fairly conventional in that part. But that's not relevant here. This is used for transmitting location information on FIELD_DECLs back to the front end. Most records in Ada are defined at GCC's global level, so there's little point in doing anything other than a hash table that's initialized early on (e.g., in the routine "gigi") and never freed. Also, the current code just saves the result for EXPR_P nodes since only those have TREE_COMPLEXITY, but if you're switching to a hash table, it's probably best just to record *all* results in it. No point in getting too sophisticated here: this is just a small hack to avoid pathalogical compile-time behavior when compiling certain very complex record types.