This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-fno-tree-cselim not working?
- From: Samuel Tardieu <sam at rfc1149 dot net>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 25 Oct 2007 11:59:29 +0200
- Subject: -fno-tree-cselim not working?
With yesterday's SVN sources, the following source produces the same
result with -ftree-cselim and -fno-tree-cselim on x86:
#include <pthread.h>
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static int acquires_count = 0;
int
trylock()
{
int res;
res = pthread_mutex_trylock(&mutex);
if (res == 0)
++acquires_count;
return res;
}
trylock:
subl $12, %esp
movl $mutex, (%esp)
call pthread_mutex_trylock
movl acquires_count, %edx
cmpl $1, %eax
adcl $0, %edx
movl %edx, acquires_count
addl $12, %esp
ret
Shouldn't the conditional store be preserved when -fno-tree-cselim is
set?
Sam
--
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/