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

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 14 09:30:26 PDT 2022


rjmccall requested changes to this revision.
rjmccall added a comment.
This revision now requires changes to proceed.

We can't set the flag if initialization is aborted by an exception, which is not ruled out by the use of thread-unsafe statics.  So this is not a correct change.

More basically, I don't think "recursive calls try to re-initialize" is actually worse behavior than "recursive calls access an uninitialized object".  And both seem to be allowed.

The real problem here is that everyone understands this flag to be a request to generate a cheap code sequence for testing initialization, but it's not actually possible to do the maximally cheap sequence and have it still be safe against recursive entry; you need to generate guards and diagnose the failure.


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