the taxable year of such disposition and all prior taxable years over the amounts taken into account under this subsection for all prior taxable years. (g) Termination of amortization No deduction shall be allowed under subsection (a) with respect to any stock in an electing S corporation with respect to any period beginning after the earlier of— (1) the date on which the corporation’s election under section 1362 terminates, or (2) the date on which the shareholder transfers such stock to any other person. (h) Treatment of certain transfers (1) Distributions from estates or trusts Notwithstanding any other provision of this section, in the case of a distribution of stock from an estate or trust to a beneficiary, the beneficiary (and not the estate or trust) shall be treated as the shareholder to which this section applies with respect to periods after such distribution. (2) Certain transfers involving spouses Notwithstanding any other provision of this section, in the case of a transfer described in section 1041, the transferee (and not the transferor) shall be treated as the shareholder to which this section applies with respect to periods after such transfer. (i) Treatment of income in respect of the decedent (1) Adjustment to built-in gain of property held by S corporation For purposes of subsection (b)(2), the fair market value of any property taken into account under subparagraph (A) thereof shall be decreased by any amount of income in respect of the decedent with respect to such property to which section 691 applies. For purposes of subsection (e)(1)(A), the gain recognized on the disposition of such property shall be reduced by such amount. (2) Adjustment to basis of S corporation stock For adjustment to basis of S corporation stock, see section 1367(b)(4)(B). (j) Reporting Except as otherwise provided by the Secretary, for purposes of section 6037, the amounts determined under subsections (b)(2), (e)(1), and (f)(2) shall be treated as items of the corporation and the pro rata share determined under such