This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/34312] [4.3 regression] spill failure with -O2 -fPIC -march=pentium-m on i386
- From: "rask at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Dec 2007 17:52:25 -0000
- Subject: [Bug rtl-optimization/34312] [4.3 regression] spill failure with -O2 -fPIC -march=pentium-m on i386
- References: <bug-34312-10561@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from rask at gcc dot gnu dot org 2007-12-03 17:52 -------
Note that reload asks for Q_REGS when the constraints allow GENERAL_REGS, so
the root cause is just reload being stupid. I bet it is this optimization from
find_reloads() that causes it:
if (! win && ! did_match
&& this_alternative[i] != (int) NO_REGS
&& GET_MODE_SIZE (operand_mode[i]) <= UNITS_PER_WORD
&& reg_class_size [(int) preferred_class[i]] > 0
&& ! SMALL_REGISTER_CLASS_P (preferred_class[i]))
{
if (! reg_class_subset_p (this_alternative[i],
preferred_class[i]))
{
/* Since we don't have a way of forming the intersection,
we just do something special if the preferred class
is a subset of the class we have; that's the most
common case anyway. */
if (reg_class_subset_p (preferred_class[i],
this_alternative[i]))
this_alternative[i] = (int) preferred_class[i];
else
reject += (2 + 2 * pref_or_nothing[i]);
}
}
Additionally, i386.h CLASS_LIKELY_SPILLED_P should probably take -mregparm and
-fPIC etc. into account in deciding if Q_REGS is likely spilled or not.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34312