Deductions & credits

I understand what you are saying, and have wondered that myself.  However, as far as I can tell, the Basis of the Gift does not come into play.  So you can essentially ignore the Gift completely for the gain/loss calculation.

It takes a few times of reading those two Regs above, but the examples in those two Regs indicate the Gift Basis really doesn't come into play (again, read Example #1 in the first link).

Because of the examples, I interpret that the Gift is NOT giving a piece of the property itself (which would take a piece of the property's Basis), but the reduced sale price is like Gifting cash simultaneously or after-the-sale.