Last known to work with: "Mon Dec 12 22:04:54 UTC 2005 (revision 108426M)". Known to fail with: "Mon Jan 2 13:08:54 UTC 2006 (revision 109236M)": Running /home/hp/combined/combined/gcc/testsuite/gcc.c-torture/execute/execute.exp ... FAIL: gcc.c-torture/execute/960802-1.c execution, -O1 FAIL: gcc.c-torture/execute/960802-1.c execution, -O2 With the message in gcc.log showing an abort call. The assembly code acts as if the line v = (v & 0x00ffffff) | (o & 0xff000000); was v = o; (actually there are no instructions which is the same as passing on the return value from the previous call as the first parameter in this ABI.) Looking at the RTL dumps, it seems combine is at fault; all the bit fiddling is gone. As there has been changes in this area after Jan 2, I expect it to have been fixed but it seemed proper to add this PR before updating. I assign it to myself until I've checked whether it remains, so no-one is tempted to do a wild goose chase.
It's still there LAST_UPDATED "Thu Jan 5 03:26:35 UTC 2006 (revision 109371M)", so I unassign myself, at least temporarily. Bonzini, a comment?
If it's still there, assign it to me.
As offered in comment #2. Thanks!
Combine does not try to combine across a call. But it does not invalidate equivalences and, in this case, it tries to replace v (the result of a function call) with the return value register... even though in the meanwhile a different function call has clobbered it. H-P can you please run an assembly language comparison on this patch, to check that it does not pessimize anything? I think the bug is latent in other branches as well.
Created attachment 10585 [details] patch to try
I built and checked cross from i686-pc-linux-gnu to cris-axis-linux-gnu with this patch, and built CSiBE-2.1.1 at -O0, -O1, -O2 (note 1) and -O3 compile-time tests and -Os compile-time and size tests, with just the two expected differences in the generated code (using the previously posted unrandomization and asm-wrapper patches). Thanks! (note 1: fails to compile -O2: invalid assembly code is generated for linux-2.4.23-pre3-testplatform/net/ipv4/tcp_input.c at -O2 with and without the patch due to a different bug)
Patch committed