------- 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