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] Avoid static initialization in the strlen pass


On 11/20/2017 02:14 PM, Jakub Jelinek wrote:
Hi!

All the hash_maps in tree-ssa-strlen.c except for the newly added one
were pointers to hash maps, which were constructed either lazily or during
the pass.  But strlen_to_stridx is now constructed at the compiler start,
which is something I'd prefer to avoid, it affects even -O0 that way and
empty/small file compilation, something e.g. the kernel folks care so much
about.

Apparently the hash map is only needed when one of the two warnings
is enabled, so this patch initializes it only in that case and otherwise
doesn't fill it or query it.

This same change is also in the latest patch I posted for 82945
just yesterday:

  https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01670.html

Martin


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