-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
| Bugzilla Link | 1646 |
| Resolution | FIXED |
| Resolved on | Sep 10, 2007 18:48 |
| Version | 2.0 |
| OS | Linux |
| Attachments | testcase .ll |
| Reporter | LLVM Bugzilla Contributor |
| CC | @asl |
Extended Description
The attached testcase is the code used by gcc to test
whether a program was linked with the pthreads library.
LLVM optimizes it to
define i32 @__gthread_active_p() {
entry:
ret i32 1
}
which is wrong. Probably it thinks that the weak alias
@__gthrw_pthread_cancel = alias weak i32 (i32)* @pthread_cancel
is necessarily non-null. The original code was:
static __typeof(pthread_cancel) __gthrw_pthread_cancel attribute ((weakref("pthread_cancel")));
static inline int
__gthread_active_p (void)
{
static void *const __gthread_active_ptr
= extension (void *) &__gthrw_pthread_cancel;
return __gthread_active_ptr != 0;
}