On Sun, Jul 25, 2021 at 1:58 PM Uecker, Martin <martin.uec...@med.uni-goettingen.de> wrote: > > > > Hi Richard, > > here is another case where it seems that TBAA goes > wrong. Since this is not in a loop, it seems this > is something else than what we discussed. Is > this a known issue?
No, it's not known and it is a bug. It seems to be related to doing Value numbering stmt = pu_6(D)->x = xy_7; Store matched earlier value, value numbering store vdefs to matching vuses. Setting value number of .MEM_8 to .MEM_5 (changed) I'm looking into it. Richard. > Best, > Martin > > > #include <stdio.h> > #include <stdlib.h> > > union u { > long x; > long long y; > }; > > __attribute__((noinline,noclone)) > long test(long *px, long long *py, union u *pu) > { > *px = 0; > *py = 1; > > long xy = pu->y; > pu->x = xy; > > return *px; > } > > int main(void) > { > union u u; > printf("%ld\n", test(&u.x, &u.y, &u)); > } > > https://godbolt.org/z/a9drezEza >