Did I write it was a WINE bug? No. It is very clear for me that it *is* a compiler issue.
OK, I must have misunderstood you then. Sorry ...
Instead of circumventing the compiler bug in this particular case, it might be preferable to find out which optimization phase contains the bug, and write a configure check that switches that phase off if it detects the bug (like we did with the 2.95.2 strength-reduce bug).
We'll do some research on the optimization phase. Once we found it, can anybody help us with that autoconf kungfu?
I've managed to reduce the problem to a simple testcase, which is appended below. It fails on RedHat gcc-2.96-69 (as of 12/2000) ...
Culprit *appears* to be the global common subexpression elimination, although this is not quite definite. I haven't tracked the problem down yet.
However, when switching off GCSE (-fno-gcse), correct code is produced. I'm not sure I'd like to do a complete Wine build without GCSE though; this might significantly reduce code quality ...
I'll write a configure check to switch off gcse, using the testcase below. We should probably contact RedHat (I think Jacub Jelinek handles 2.96 bugs ...) to confirm that GCSE is really at fault.
Bye, Ulrich
void clobber(int *); void compare(int, int); void use(int);
int global;
void test(int trigger, int param) { int data = trigger? global : 0; int orig_param = param;
clobber(¶m); compare(orig_param, param);
use(data); }
void clobber(int *param) { (*param)++; }
void compare(int orig_param, int param) { if (orig_param != param) printf( "PASS\n" ); else printf( "FAIL\n" ); }
void use(int data) { }
int main(void) { test(0, 0); }