Reduction for certain distributions
(A) In general The qualified retirement savings contributions determined under paragraph (1) shall be reduced (but not below zero) by the aggregate distributions received by the individual during the testing period from any entity of a type to which contributions under paragraph (1) may be made. The preceding sentence shall not apply to the portion of any distribution which is not includible in gross income by reason of a trustee-to-trustee transfer or a rollover distribution.
(B) Testing period For purposes of subparagraph (A), the testing period, with respect to a taxable year, is the period which includes— (i) such taxable year, (ii) the 2 preceding taxable years, and (iii) the period after such taxable year and before the due date (including extensions) for filing the return of tax for such taxable year.
(C) Excepted distributions There shall not be taken into account under subparagraph (A)— (i) any distribution referred to in section 72(p), 401(k)(8), 401(m)(6), 402(g)(2), 404(k), or 408(d)(4), and (ii) any distribution to which section 408A(d)(3) applies.
(D) Treatment of distributions received by spouse of individual For purposes of determining distributions received by an individual under subparagraph (A) for any taxable year, any distribution received by the spouse of such individual shall be treated as received by such individual if such individual and spouse file a joint return for such taxable year and for the taxable year during which the spouse receives the distribution.