From mboxrd@z Thu Jan 1 00:00:00 1970 From: Iain McClatchie To: Nathan Myers Cc: egcs@cygnus.com Subject: Re: C++ suffers on another inner loop Date: Thu, 23 Apr 1998 21:12:00 -0000 Message-id: <353FC37F.31515E29@ix.netcom.com> References: X-SW-Source: 1998-04/msg00969.html Nathan> Try coding it like this: Nathan> str_hte_t* Nathan> probe_str_hte2( const char* str, str_hash* hashp ) Nathan> { Nathan> str_key_t key; Nathan> key.str = str; Nathan> str_hash_int* hash = (str_hash_int*) hashp; Nathan> return hash->probe_hte( key ); Nathan> } That's the C wrapper... and the main problem I see is in the inner loop. Still, I gave it a shot, and got exactly the same results as my posted code (actually, two instructions were interchanged, with no effect on speed). The problem is that seperating the string comparison test into a seperate inlined function causes egcs to explicitly represent the boolean return value in a register, rather than just fold it into control flow. Beyond that, I'm not really clear on what's going on. -Iain