On Thu, 2007-04-12 at 08:59 +0000, Mick CORNUT wrote: > Hi Andrew, > Ps: I've just tried with gcc 4.1.1, but the problem doesn't occur > since gcc removes the temporary buffer allocation on the stack, > furthermore, we want to keep gcc 3.4.x!
Changing the testcase to void trace(int p1, int p2, int p3, int p4, char * message) { char temp[512]; pr(temp, message); } is sufficient to demonstrate that the bug has been fixed in all gcc-4.x versions. So the problem was fixed some time between 3.4 and 4.0. Sorry, I don't know precisely which patch, but you are welcome to trawl back through the gcc-patches email archives for that time frame if you wish; but don't expect any patches you find to apply directly to the old code... :-) R.