This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Some Haifa scheduler bugs


	Basically any machine that defines SMALL_REGISTER_CLASSES and passes args in
	registers is playing with fire -- reload can and will silently generate incorrect
	code for such targets.  For that reason I _highly_ recommend against using
	registers for parameter passing on the x86 targets.

I'll second it.  The x86 regparm attribute is unsafe, and should not be used.
It might be possible to fix the problem by hacking reload and the x86 port,
but it doesn't seem very worthwhile.  The problem is hard to fix, and exposes
people to unnecessary risks of compiler bugs.  There are probably easier
ways to get faster x86 code.

Jeff didn't mention it, but it is also unwise to schedule before
register allocation if SMALL_REGISTER_CLASSES is defined, even if you
are not using register parameters.  The goal of the scheduler is to reduce
pipeline stalls at the expense of increasing register pressure.  This is
exactly the wrong thing to do on a SMALL_REGISTER_CLASSES machine such as
the x86, because you will get so many extra spills that the code may run
slower.  A scheduler that has different goals might be able to do better,
but given the way the existing scheduler works, I would recommend avoiding
it before register allocation on the x86.

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]