[PATCH] D31885: Remove TBAA information from LValues representing union members

Krzysztof Parzyszek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 10 08:57:59 PDT 2017

kparzysz added a comment.

In https://reviews.llvm.org/D31885#748889, @rjmccall wrote:

> Sounds to me like we should just not apply struct-path TBAA data that runs through a union field because either LLVM's representation can't handle it or Clang isn't generating the representation right.  That should be simple to do in a targeted place in Clang rather than awkwardly doing it retroactively like in the current patch.

The TBAA information seems to be assembled from several smaller pieces during code generation.  There is already a check for unions in EmitLValueForField, which turns off path TBAA information for union fields, but that is not sufficient to avoid problems.  Both testcases will still fail with this code in place (the C++ testcase needs to be updated: it's missing "-O2 -std=c++11").



More information about the cfe-commits mailing list