This is the mail archive of the gcc-patches@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: regclass register preferencing patch


	It does look odd, but the earlier two if/else branches
	specifically set "win" or "alt_fail" which only make sense if the rest of
	the code is processed.  Also, unlike the last else which says that it is
	in place of the ordinary cost computation and advances to the next
	constraint letter, the earlier two rely on the later code to advance to
	the next constraint.

alt_fail is used outside the inner most loop that iterates over the
constraints within an alternative.  So it does make sense to execute the
continue after setting alt_fail.

alt_cost is incremented here, and is also incremented after the switch, which
means if we don't execute the continue, then we are incrementing it twice when
it probably should have only been incremented once.

The setting of win makes sense only if we don't execute the continue.  I
think this code is spurious.

	I do not think that moving the update of constraints[i]=p to where
	you suggest is correct.  I do, however, think that classes[i]=NO_REGS
	should be moved before the special matching-constraint code so the setting
	of classes[i] is not overridden when it performs the regular cost
	calculation. 

This is fine with me.  I think the two changes will have the same affect.
Moving the classes assignment is safe and easier to understand though.

Jim



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