Is there really only one symbol_ref object referring to each symbolic label?
Zack Weinberg
zack@codesourcery.com
Sun Jun 29 04:28:00 GMT 2003
Geoff Keating <geoffk@geoffk.org> writes:
> Yup. They should look like
>
> gen_rtx_SYMBOL_REF (xxx, ggc_strdup ("yyy"))
>
> You don't want to make the ggc_strdup be part of gen_rtx_* because 99%
> of the time it's not necessary and the extra hash-table lookup is
> slow...
ggc_strdup is a macro wrapper for ggc_alloc_string, and
ggc_alloc_string does NOT guarantee the uniqueness of the strings it
returns. (However, I consider this a bug in ggc_alloc_string, not in
its callers. At one time ggc_alloc_string did uniquize strings - I
don't know when that got changed or why.)
zw
More information about the Gcc
mailing list