[PATCH,FORTRAN 00/29] Move towards stringpool, part 1
Bernhard Reutner-Fischer
rep.dot.nop@gmail.com
Wed Sep 5 14:57:00 GMT 2018
Hi,
The fortran frontend still uses stack-based handling of (symbol) names
with fixed-sized buffers. Furthermore these buffers often are too small
when dealing with F2003 identifiers which can be up to, including 63
bytes long.
Other frontends use the stringpool since many years.
This janitorial series is a first step towards using the stringpool in
the frontend.
Consequently this allows us to use pointer-comparison to see if two
given "names" are identical instead of doing lots and lots of string
comparisons.
Part 1 switches most of the fortran FE. An eventual part 2 would
continue to switch the few remaining stack-based identifier
manipulations to use the stringpool. My initial plan was to also see if
switching gfc_symtree from treap to a hash_map would bring us any
measurable benefit, but that, too, is left for an eventual part 2.
Bootstrapped and regtested on x86_64-foo-linux.
I'd appreciate if someone could double check for regressions on other
setups. Git branch:
https://gcc.gnu.org/git/?p=gcc.git;a=log;h=refs/heads/aldot/fortran-fe-stringpool
Ok for trunk?
Bernhard Reutner-Fischer (29):
gdbinit: break on gfc_internal_error
Use stringpool for gfc_match_defined_op_name()
Use stringpool for gfc_get_name
Use stringpool for gfc_match_generic_spec
Use stringpool for gfc_match("%n")
Use stringpool for association_list
Use stringpool for some gfc_code2string return values
Add uop/name helpers
Use stringpool for modules
Do not copy name for check_function_name
Do pointer comparison instead of strcmp
Use stringpool for remaining names
Use stringpool for intrinsics and common
Fix write_omp_udr for user-operator REDUCTIONs
Use stringpool for iso_c_binding module names
Do pointer comparison in iso_c_binding_module
Use stringpool for iso_fortran_env
Use stringpool for charkind
Use stringpool and unified uppercase handling for types
Use stringpool in class et al
Use stringpool for module tbp
Use stringpool in class and procedure-pointer result
Use stringpool for module binding_label
Use stringpool for intrinsic functions
Use stringpool on loading module symbols
Use stringpool for mangled common names
Use stringpool for OMP clause reduction code
Free type-bound procedure structs
PR87103: Remove max symbol length check from gfc_new_symbol
gcc/fortran/check.c | 2 +-
gcc/fortran/class.c | 96 +++++------
gcc/fortran/decl.c | 265 ++++++++++++++---------------
gcc/fortran/expr.c | 4 +-
gcc/fortran/frontend-passes.c | 16 +-
gcc/fortran/gfortran.h | 18 +-
gcc/fortran/interface.c | 109 ++++++------
gcc/fortran/intrinsic.c | 11 +-
gcc/fortran/io.c | 10 +-
gcc/fortran/iresolve.c | 35 ++--
gcc/fortran/match.c | 143 ++++++++--------
gcc/fortran/match.h | 9 +-
gcc/fortran/matchexp.c | 22 ++-
gcc/fortran/misc.c | 2 +-
gcc/fortran/module.c | 311 ++++++++++++++--------------------
gcc/fortran/openmp.c | 120 +++++++------
gcc/fortran/parse.c | 23 ++-
gcc/fortran/primary.c | 58 ++++---
gcc/fortran/resolve.c | 81 +++++----
gcc/fortran/symbol.c | 58 ++++---
gcc/fortran/trans-array.c | 4 +-
gcc/fortran/trans-common.c | 10 +-
gcc/fortran/trans-decl.c | 38 ++---
gcc/fortran/trans-expr.c | 11 +-
gcc/fortran/trans-openmp.c | 1 +
gcc/fortran/trans-types.c | 20 +--
gcc/fortran/trans.c | 6 +-
gcc/gdbinit.in | 1 +
28 files changed, 719 insertions(+), 765 deletions(-)
--
2.19.0.rc1
More information about the Fortran
mailing list