https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89547
Bug ID: 89547 Summary: pthread_mutex_lock and pthread_cond_wait do not behave properly when compiler with -flto Product: gcc Version: lto Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: maqsood3525 at live dot com Target Milestone: --- Created attachment 45865 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45865&action=edit reporoducer Hi, When compiled with -flto the calls to pthread_mutex_lock and pthread_cond_wait do not behave as they should, i might be missing something here but i have attached a small reporducer for the issue both examples should block at the second pthread_mutex_lock but the one compiled with -flto does not. is that the desired behaviour ?