efriedma added a comment.

> No, you can still link those. There's no ABI change nor any interference at 
> IR level.

The scenario I was thinking of with -ffine-grained-bitfield-accesses is 
something like the following:

File A:

  struct X { int a : 8; int b : 24; };
  void f(struct X*);
  int g() {
      struct X x;
      x.a = 10;
      f(&x);
      return x.a;
  }

File B:

  struct X { int a : 8; int b : 24; };
  void f(struct X* x) {
      x->b = 10;
  }

If both files are compiled -ffine-grained-bitfield-accesses, the fields don't 
overlap.  If both files are compiled with -fno-fine-grained-bitfield-accesses, 
the assignment in file A freezes both fields of "x".  If file A is compiled 
with -ffine-grained-bitfield-accesses, but file B is not, f() corrupts the 
field "a", so g() returns poison (if I'm not missing anything?).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128501/new/

https://reviews.llvm.org/D128501

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to