[PATCH] D135919: [Clang] Set thread_local Itanium ABI guard variables before calling constructors.

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 14 12:54:27 PDT 2022


hubert.reinterpretcast added a comment.

In D135919#3859491 <https://reviews.llvm.org/D135919#3859491>, @tahonermann wrote:

>> the case from https://github.com/llvm/llvm-project/issues/57828 is not for a block-scope variable, but the case in the patch description is...
>
> Thanks, Hubert. Yes, I found that the reported issue occurred for any case where thread safe guard variables are not required. I chose the block-scope variable example for the patch summary because I felt it better presented the issue.
>
> Your question inspired me to do some additional testing though and I see both gcc and icc also exhibit the re-initialization behavior for that case, but not the case reported in https://github.com/llvm/llvm-project/issues/57828.

For the block-scope case, https://eel.is/c++draft/stmt.dcl#3: If control re-enters the declaration recursively while the variable is being initialized, the behavior is undefined.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135919



More information about the cfe-commits mailing list