In both cases it will be BOUGHT. The original shares will be devalued to give you a basis in the new shares from the spinoff.
Original shares: 1000 @ $10 = $10,000
Several years later
Original shares: 1000 @ $15 = $15,000
New shares 1000 @ $5 = $5,000
Total Value is $20,000
$5000 for new shares is 25% of $20,000
25% of the original $10 is $2.50
Cost basis of the original shares is $7.50
Cost basis of new shares is $2.50
The stock you acquired by dividend reinvestment will have the value of the dividends that were deposited as their basis.