This is the mail archive of the gcc-bugs@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]

[Bug middle-end/80423] [7 Regression] GC related -fcompare-debug failure


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80423

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the bug is in:
      t = build_array_type (elt_type, index_type);
      if (elt_type == unsigned_char_type_node
          || elt_type == signed_char_type_node
          || elt_type == char_type_node
          || (TREE_CODE (elt_type) == ENUMERAL_TYPE
              && TYPE_CONTEXT (elt_type) == std_node
              && !strcmp ("byte", TYPE_NAME_STRING (elt_type))))
        TYPE_TYPELESS_STORAGE (t) = 1;
We modify a flag on a cached shared type.  Now, as the flag is controlled
solely by the element type, if all the build_array_type{,_nelts} calls were
done only through this routine, it would just be set everywhere and not a
problem.
But that is not the case, the middle-end etc. also build array types and don't
set the typeless storage flag on it anywhere.
So, either the above needs to be a langhook and we'd need to force that flag on
every array building (but then we need to handle it somehow with LTO too),
or we must not share array types with/without the TYPE_TYPELESS_STORAGE flag.
I'll try to write an untested patch for the latter.

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