This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/9240] weird scheduling on v850 unless -fno-sched-spec specified
- From: "vmakarov at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jan 2004 17:22:37 -0000
- Subject: [Bug optimization/9240] weird scheduling on v850 unless -fno-sched-spec specified
- References: <20030109010600.9240.miles@gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From vmakarov at redhat dot com 2004-01-15 17:22 -------
Some analysis:
1. Scheduler uses own algorithm of probablity calculation (3 basic
blocks of the test have probability 100/50/100%).
2. It should use common infrastructure bb frequency and edge
probablility.
3. Even if it used the common infrastructure, bb frequnecies would be
still wrong (10000, 9001, 10000 or 100/90/100%). So builtin-expect
is ignored in the infrastructure too. I saw broken builtin-expect
many times during my 6 years work on gcc.
4. Becuase the probability of the 2nd bb is 50%, it includes 2
insns from it to schedule into the 1st bb.
So fixing the problem could be:
1. Taking builtin_expect into account in scheduler algorithm of
probablity calculation.
2. Start using the common infrastructure bb frequency and edge
probablility and fixing there builtin_expect.
Neither the 1st solution nor the 2nd one is easy. And they include
the risk of new bugs. So I think it is not reasonable to fix it for
3.4. It is a just generation of non-optimal code (scheduler works by
heuristics. there will be always some unoptimal schedules. we are
just oriented to guarantee that scheduler improves code in overall on
credible benchmarks like Spec). The problem was pressent in 3.3.
I'll try to fix the problem in 3-4 months.
Vlad
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |vmakarov at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9240