[PATCH] D154284: [C11] Correct global atomic pointer initialization from an integer constant

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 2 11:42:33 PDT 2023


aaron.ballman added a comment.

In D154284#4467154 <https://reviews.llvm.org/D154284#4467154>, @efriedma wrote:

> The testcase doesn't actually trigger the assertion... but I guess it still tests the output, so that's probably okay?  Maybe add a case `static _Atomic(int *) glob_pointer_from_long = 0LL;` just to be sure.

Thanks for catching that! I added an additional test that doesn't use `static`, as that was relevant to reproducing the original issue: https://godbolt.org/z/cf4Wzeo3z

> Otherwise LGTM
>
> (The "VarSize == CstSize" assertion has been catching a surprising number of cases of bad codegen; I'm happy I spent the time to add it.)

Yeah, this is a handy assertion!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154284



More information about the cfe-commits mailing list