From: Daniel B. <da...@te...> - 2003-05-30 20:00:58
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Istvan Marko <mi...@im...> writes: > Dump of assembler code for function arch_os_get_current_thread: > 0x80559b8 <arch_os_get_current_thread>: mov %fs:0x38,%eax > 0x80559be <arch_os_get_current_thread+6>: push %ebp > 0x80559bf <arch_os_get_current_thread+7>: mov %esp,%ebp > 0x80559c1 <arch_os_get_current_thread+9>: xor %edx,%edx > 0x80559c3 <arch_os_get_current_thread+11>: cmpl $0x0,0x8061a30 > 0x80559ca <arch_os_get_current_thread+18>: cmovne %eax,%edx > 0x80559cd <arch_os_get_current_thread+21>: mov %edx,%eax > 0x80559cf <arch_os_get_current_thread+23>: mov %ebp,%esp > 0x80559d1 <arch_os_get_current_thread+25>: pop %ebp > 0x80559d2 <arch_os_get_current_thread+26>: ret=20=20=20=20 > End of assembler dump. > (gdb) info registers=20 > fs 0x0 0 A load from %fs:0x38 is probably not a really good thing to do before it's been set up to point to a valid ldt entry (which happens later, in thread init). But that's why we test if(all_threads) before doing it. The version of gcc you're using seems to have reordered stuff so that the thread dereference happens before the test, which is obviously undesirable. I don't know if this is a gcc bug or (at least as likely) there's some constraint missing on the asm instruction that should be sitting there to prevent it being reordered. I don't suppose we have any more competent gcc users on the list, do we? =2D -dan =2D --=20 http://www.cliki.net/ - Link farm for free CL-on-Unix resources=20 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+17hdHDK5ZnWQiRMRAqBAAJ9maJYNxi6ackAfNkz0Xi7bsjlORgCcCbda OkyFK1DUJ4FRCR1BH67V7MY=3D =3Dx1nI =2D----END PGP SIGNATURE----- |