[llvm] [TBAA] Add verifier for tbaa.struct metadata (PR #86709)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 10:23:07 PDT 2024


uweigand wrote:

This is breaking the openmp-s390x-linux build bot.  I was able to reduce the problem to the following test case:
```
typedef struct kmp_affinity_attrs_t {
  int core_type : 8;
  int core_eff : 8;
  unsigned valid : 1;
  unsigned reserved : 15;
} kmp_affinity_attrs_t;

typedef struct kmp_affinity_t {
  kmp_affinity_attrs_t core_attr_gran;
  int compact;
} kmp_affinity_t;

void test(kmp_affinity_t *affinity) {
  *affinity = (kmp_affinity_t) { { 0 }, 0 };
}
```

Building this with `clang --target=s390x-ibm-linux -O` results in
```
Overlapping tbaa.struct regions
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %.compoundliteral, i64 8, i1 false), !tbaa.struct !12
!12 = !{i64 2, i64 4, !13, i64 4, i64 4, !14}
fatal error: error in backend: Broken module found, compilation aborted!
```

The first offset of 2 seems wrong to me - not sure where this came from.  This seems to be an actual bug uncovered by this test?

https://github.com/llvm/llvm-project/pull/86709


More information about the llvm-commits mailing list