# New Ticket Created by Andy Dougherty # Please include the string: [perl #47397] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=47397 >
I was trying parrot for the first time in a while today, and the test suite hung at t/op/arithmetics_22.pasm. (This is with gcc-4.1.0 on Solaris 8/SPARC.) It just sits and uses up CPU. It appears to be stuck in the 'gcd' op. It's been a while since I tried compiling with gcc, so I don't know how long this problem has been here. After poking around quite a bit, the following patch fixes it: --- parrot-current/src/ops/experimental.ops Wed Oct 17 19:15:15 2007 +++ parrot-andy/src/ops/experimental.ops Mon Nov 12 15:13:43 2007 @@ -91,7 +91,7 @@ FLOATVAL temp2 = fabs($2); FLOATVAL temp3 = fabs($3); - while (!FLOAT_IS_ZERO(temp3)) { + while (temp3 != 0.0) { q = floor((FLOATVAL)temp2/temp3); c = temp2 - temp3*q; temp2 = temp3; It may well be there's an issue with gcc's optimizer, since the problem goes away without optimization, but I think it's also fair to say that the definition of FLOAT_IS_ZERO in include/parrot/misc.h is perhaps not optimal here. I'd prefer the simpler definition: #define FLOAT_IS_ZER0(f) ((f) == 0.0) but I didn't get anywhere last time I proposed that. I don't know what else to do. Summary of my parrot 0.4.17 (r0) configuration: configdate='Mon Nov 12 16:06:03 2007 GMT' Platform: osname=solaris, archname=sun4-solaris jitcapable=0, jitarchname=nojit, jitosname=solaris, jitcpuarch=sun4 execcapable=0 perl=perl5.8 Compiler: cc='gcc', ccflags='-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_FORMAT -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -DDISABLE_GC_DEBUG=1 -DNDEBUG -O4 -fstrict-aliasing -funroll-loops -mno-unaligned-doubles -Wcast-align', Linker and Libraries: ld='gcc', ldflags=' -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/SC4.2/lib -L/usr/local/lib ', cc_ldflags='', libs='-lsocket -lnsl -ldl -lm -lpthread -lrt' Dynamic Linking: share_ext='.so', ld_share_flags='-G -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/SC4.2/lib -L/usr/local/lib', load_ext='.so', ld_load_flags='-G -L/usr/lib -L/usr/ccs/lib -L/opt/SUNWspro/SC4.2/lib -L/usr/local/lib' Types: iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4, ptrsize=4, ptr_alignment=4 byteorder=4321, nv=double, numvalsize=8, doublesize=8 -- Andy Dougherty [EMAIL PROTECTED]