On Sun, Sep 18, 2022 at 08:19:29PM +0100, Julian Brown wrote: > @@ -2609,6 +2672,9 @@ gfc_trans_omp_clauses (stmtblock_t *block, > gfc_omp_clauses *clauses, > if (clauses == NULL) > return NULL_TREE; > > + hash_map<gfc_symbol *, gfc_omp_namelist *> sym_rooted_nl;
Isn't hash_map ctor pretty costly (allocates memory etc.)? And gfc_trans_omp_clauses is called for all OpenMP constructs, in many cases they are never going to have any map clauses or even if they do, they might not trigger this code. > + bool built_sym_hash = false; So, I think usually we don't construct such hash_maps right away, but have just pointer to the hash map initialized to NULL (then you don't need to built_sym_hash next to it) and you simply new the hash_map when needed the first time and delete it at the end (which does nothing if it is NULL). Jakub