------- Comment #11 from jakub at gcc dot gnu dot org 2010-03-26 11:03 ------- Ah, apparently the type returned by c_common_signed_type -> ... -> build_nonstandard_integer_type is not referenced from anywhere anymore during FRE, except from static GTY ((if_marked ("type_hash_marked_p"), param_is (struct type_hash))) htab_t type_hash_table; With -g0 at the end of FRE ggc_collect actually performs GC, while with -g it doesn't at this point (different amount of memory allocated, ...). As that signed 1 bit type isn't marked, it is removed from the hash table and therefore during PRE when get_alias_set is called again on the unsigned 1 bit type, this signed 1 bit type isn't found anymore and thus build_nonstandard_integer_type returns a fresh new type. BTW, even if GC didn't happen, type_hash_marked_p returns return ggc_marked_p (type) || TYPE_SYMTAB_POINTER (type); where TYPE_SYMTAB_POINTER depends on -g vs. -g0. I think there can't be too many non-standard integer types, so perhaps just build_nonstandard_type should make sure whatever it once returns isn't garbage collected.
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43516