What evil lurks beneath macros... (an AIX xlc optimizer bug)

2002-08-16 Thread Bill Stoddard
While trying to create a simple testcase demonstrating a bug in the xlc compiler, I did a little experiment. Here is a code snip from core.c: snip /* Code from core.c */ if (mode == AP_MODE_INIT) { return APR_SUCCESS; } if (!ctx) { ctx = apr_pcalloc(f-c-pool, sizeof(*ctx));

Re: What evil lurks beneath macros... (an AIX xlc optimizer bug)

2002-08-16 Thread Rodent of Unusual Size
Bill Stoddard wrote: And here is that same code with the macros unrolled. The xlc optimizer chokes on this. This is just nasty. /me vomits I've hated the concealment of code inside these macros from Day 1. One or two lines of code in a macro, fine; functionality like this.. megasuckage. --

Re: What evil lurks beneath macros... (an AIX xlc optimizer bug)

2002-08-16 Thread Cliff Woolley
On Fri, 16 Aug 2002, Bill Stoddard wrote: And here is that same code with the macros unrolled. The xlc optimizer chokes on this. avoid_xlc_bug() just returns 1 and does nothing else (and makes the optimzer happy again). This is just nasty. Can you be more specific about what the bug is,

Re: What evil lurks beneath macros... (an AIX xlc optimizer bug)

2002-08-16 Thread Ian Holsman
Bill Stoddard wrote: While trying to create a simple testcase demonstrating a bug in the xlc compiler, I did a little experiment. Here is a code snip from core.c: I'm just wondering if there is any kind of measureable performance benefit in keeping these as a macro vs putting them in a

Re: What evil lurks beneath macros... (an AIX xlc optimizer bug)

2002-08-16 Thread Cliff Woolley
On Fri, 16 Aug 2002, Ian Holsman wrote: I'm just wondering if there is any kind of measureable performance benefit in keeping these as a macro vs putting them in a function (possibly inline if the compiler can support it). I'm quite sure there is a performance benefit, though admittedly I

Re: What evil lurks beneath macros... (an AIX xlc optimizer bug)

2002-08-16 Thread Ryan Bloom
On Fri, 16 Aug 2002, Cliff Woolley wrote: On Fri, 16 Aug 2002, Ian Holsman wrote: I'm just wondering if there is any kind of measureable performance benefit in keeping these as a macro vs putting them in a function (possibly inline if the compiler can support it). I'm quite sure

Re: What evil lurks beneath macros... (an AIX xlc optimizer bug)

2002-08-16 Thread Jim Jagielski
Ian Holsman wrote: Bill Stoddard wrote: While trying to create a simple testcase demonstrating a bug in the xlc compiler, I did a little experiment. Here is a code snip from core.c: I'm just wondering if there is any kind of measureable performance benefit in keeping these as a

Re: What evil lurks beneath macros... (an AIX xlc optimizer bug)

2002-08-16 Thread Cliff Woolley
On Fri, 16 Aug 2002, Ryan Bloom wrote: A better question IMHO, is whether any of those macros can be made less complex. It's a good question, but IMO the answer is no. The ring macros are very tight and easy to read... like I said, they're about four lines each. The brigade macros are, for

Re: What evil lurks beneath macros... (an AIX xlc optimizer bug)

2002-08-16 Thread Ryan Bloom
On Fri, 16 Aug 2002, Cliff Woolley wrote: On Fri, 16 Aug 2002, Ryan Bloom wrote: A better question IMHO, is whether any of those macros can be made less complex. It's a good question, but IMO the answer is no. The ring macros are very tight and easy to read... like I said, they're