On Tue, Nov 08, 2011 at 12:30:36AM +0000, Joseph S. Myers wrote: > On Tue, 8 Nov 2011, Alan Modra wrote: > > > OK, so you made the stack ties conflict with all memory. I wondered > > about that too, but didn't find a testcase where it mattered. It > > The test I had was one of those from the various PRs for this issue. > > int find_num(int i) > { > const int arr[5] = {0, 1, 2, 3, 4}; > return arr[i]; > } > > (-O2 -mcpu=603). But I don't know if it reproduces with FSF 4.4 or trunk; > there were plenty of other local changes in the 4.4-based tree where I > found this to be necessary.
The testcase generates good code on current gcc-4.7, gcc-4.6, and gcc-4.5, but fails on current gcc-4.4. I thought I had this PR fixed on all active branches. :-( It's been a while since I looked at what was happening with this testcase, but from memory what stops sheduling over the stack_tie is alias.c:base_alias_check. Which relies on tracking registers to see whether two memory accesses using different regs could alias. Quite possibly gcc-4.4 is deficient in this area. -- Alan Modra Australia Development Lab, IBM