[llvm-dev] [RFC] Coroutine and pthread_self

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 24 05:12:59 PST 2020


On Mon, Nov 23, 2020 at 05:07:49PM -0500, James Y Knight via llvm-dev wrote:
> Special handling for pthread_self doesn't seem reasonable -- all other
> functions marked '__attribute__((const))' or 'readnone' have the exact same
> problem.

I disagree. I would strongly argue that attribute const for pthread_self
is a violation of the attribute contract. As seen, it rather obviously
depends on observable state of the program. It should be pure only.

Joerg


More information about the llvm-dev mailing list