[patch] Fix GC issue triggered by arithmetic overflow checking

Richard Biener richard.guenther@gmail.com
Mon Oct 10 10:49:00 GMT 2016


On Mon, Oct 10, 2016 at 12:38 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> I believe the rule is that you might only depend on the order of objects
>> with respect to their DECL_UID, not the actual value of the DECL_UID.
>> As var-tracking shouldn't look at TYPE_DECLs (?) it's probably a latent
>> var-tracking bug as well.
>
> It presumably doesn't look at TYPE_DECLs, simply the DECL_UID of variables is
> also different so this changes some hashing.

Yes.  But that's not the only source for DECL_UID differences.  Btw,
I see lots of FOR_EACH_HASH_TABLE_ELEMENT in var-tracking.c
but they don't look like their outcome is supposed to be dependent on
element ordering.

Did you track down where exactly the code-gen difference appeared?

>> I'd prefer the named parameter to be defaulted to false and the few
>> places in the FEs fixed (eventually that name business should be
>> handled like names for nodes like integer_type_node -- I see no
>> reason why build_complex_type should have this special-case at all!
>> That is, why are the named vairants in the type hash in the first place?)
>
> I think that the calls in build_common_tree_nodes need to be changed too then:
>
>   complex_integer_type_node = build_complex_type (integer_type_node);
>   complex_float_type_node = build_complex_type (float_type_node);
>   complex_double_type_node = build_complex_type (double_type_node);
>   complex_long_double_type_node = build_complex_type (long_double_type_node);
>
> in addition to:
>
> ./ada/gcc-interface/decl.c:         = build_complex_type
> ./ada/gcc-interface/decl.c:      return build_complex_type (nt);
> ./ada/gcc-interface/trans.c:      tree gnu_ctype = build_complex_type
> (gnu_type);
> ./c/c-decl.c:     specs->type = build_complex_type (specs->type);
> ./c/c-decl.c:     specs->type = build_complex_type (specs->type);
> ./c/c-decl.c:     specs->type = build_complex_type (specs->type);
> ./c/c-parser.c:                              build_complex_type
> ./c/c-typeck.c: return build_complex_type (subtype);
> ./c-family/c-common.c:  return build_complex_type (inner_type);
> ./c-family/c-lex.c:       type = build_complex_type (type);
> ./cp/decl.c:    type = build_complex_type (type);
> ./cp/typeck.c:  return build_type_attribute_variant (build_complex_type
> (subtype),
> ./fortran/trans-types.c:gfc_build_complex_type (tree scalar_type)
> ./fortran/trans-types.c:      type = gfc_build_complex_type (type);
> ./go/go-gcc.cc:
> build_complex_type(TREE_TYPE(real_tree)),
> ./go/go-gcc.cc:      type = build_complex_type(type);
> ./lto/lto-lang.c:       return build_complex_type (inner_type);
>
> Or perhaps *only* the calls in build_common_tree_nodes need to be changed?
>
> It's certainly old code (r29604, September 1999).
>
> --
> Eric Botcazou



More information about the Gcc-patches mailing list