In the German list, Roland Goretzki found a GPC bug (roland2). I've made a fix for older GPC versions (such as 20040516 he's using), which is attached.
However, in Waldek's newer GPC versions, the respective code is "#if 0"d, with the comment: "/* save_expr would cause problems */".
Unfortunately this comment is not very informative to me. I've built gpc-20060325 with the code back in ("#if 1") on i586-pc-linux-gnu (Debian 3.1) with gcc-3.4.4, and all tests passed (except roland2, of course). So I suppose the problems only affect gcc-4.x or other platforms, is this right?
Then I've applied my patch and all test passed, including roland2.
Anyway, the point is that in the original code, save_expr is only applied to the string length (which is used twice). However, the whole string expression may contain side-effects (as in roland2.pas), and is accessed for the length (once using save_expr, twice otherwise) and for the chars. So we need to save this. This is what my patch does, removing the (now useless) save_expr for the length.
Waldek's code still saves the length, in different way, so the problem still exists. Perhaps save_expr_string works with gcc-4/other platforms, so we don't need the new code. If not, can you change your code to save the whole string, or change save_expr_string if necessary (as you probably know what you'll have to test then; I don't).
Frank