[Bug rtl-optimization/23837] [4.0/4.1/4.2 regression] Wrong code with -fschedule-insns
------- Comment #19 from steven at gcc dot gnu dot org 2005-12-12 22:03 -------
The dumps before and after scheduling look OK to me.
There are three groups of instructions for libcalls:
1) 19-14-18-20
inputs: regs 95, 99, and 102 (all of them for x)
result: reg 97
clobbers: nothing
2) 29-24-28-30
inputs: regs 95, 99, and 102
result: reg 104
clobbers: nothing
3) 37-34-35-36-38
inputs: regs 95, and 113
result: reg 112
clobbers: nothing
Surrounding those, you have the following additional insns:
* insn 6 loads %r25 into reg 95
* insn 11 and insn 15 load the low and high parts of 95 into new regs 99
and 102, so they must go before groups 1 and 2
* insn 33 sets reg 113 <- reg 102 << 31, so it goes before group 3
* insn 31 sets reg 111 <- reg 97 XOR reg 104, so groups 1 and two need to
be scheduled before this instruction
* insn 46 sets reg %28 <- reg 111 XOR reg 112, so it goes after insn 31 and
also after group 3.
Before scheduling, the order is,
insn 6 --> out 95
insn 11 --> out 99, in 95
insn 15 --> out 102, in 95
group 1 --> out 97, in 95 99 102
group 2 --> out 104, in 95 99 102
insn 31 --> out 111, in 97 104
insn 33 --> out 113, in 102
group 3 --> out 112, in 95 113
insn 46 --> out %26, in 111 112
After scheduling, the order is,
insn 6 --> out 95
insn 15 --> out 102, in 95
insn 33 --> out 113, in 102
insn 11 --> out 99, in 95
group 3 --> out 112, in 95 113
group 1 --> out 97, in 95 99 102
group 2 --> out 104, in 95 99 102
insn 31 --> out 111, in 97 104
insn 46 --> out %26, in 111 112
The groups are scheduled properly as groups, and the required regs are all
scheduled before the groups that they are needed in.
In short, unless I'm getting it all wrong, the scheduler is not to blame here.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23837
------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.
Reply to: