http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60546

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Looks like TBAA violations to me:

  struct QualifiedNameComponents c;
  short unsigned int _316;
  short unsigned int _317;

  <bb 53>:
  # data_157 = PHI <data_329(53), &c(52)>
  _316 = MEM[base: data_157, offset: 2B];
  _317 = MEM[base: data_157, offset: 0B];
... hashing ...
  data_329 = data_157 + 4;
  if (data_329 != &MEM[(void *)&c + 12B])
    goto <bb 53>;
  else
    goto <bb 54>;

so you hash the QualifiedNameComponents pointers, not its strings.  And
you do it by reading the pointers as 'unsigned short'.  Probably via

    template<size_t length> static inline unsigned hashMemory(const void* data)
    {
        typedef int dummylength_must_be_a_multible_of_four [(!(length % 4)) ? 1
: -1];
        return computeHash<UChar>(static_cast<const UChar*>(data), length /
sizeof(UChar));
    }

which introduces the violation.  It should not use 'short' hashing but
hashing of 'char'.

Reply via email to