In the X86RegisterInfo.td file, RST is defined like this:

// Floating point stack registers (these are not allocatable by the
// register allocator - the floating point stackifier is responsible
// for transforming FPn allocations to STn registers)
def RST : RegisterClass<"X86", [f64], 32,
                         [ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7]> {
     let MethodProtos = [{
     iterator allocation_order_end(const MachineFunction &MF) const;
   let MethodBodies = [{
     RSTClass::allocation_order_end(const MachineFunction &MF) const {
       return begin();

Is the "begin()" in there correct? Or should it maybe be "end()"?


Yep, it is right. The FP0-x registers are allocatable for the FP stack, the RST registers are not.