(1) INCOME ITEMS
An amount which is required to be included in the gross income of a shareholder and shown on his return shall be taken into account under subparagraph (A) or (B) of subsection (a)(1) only to the extent such amount is included in the shareholder's gross income on his return, increased or decreased by any adjustment of such amount in a redetermination of the shareholder's tax liability.
(2) ADJUSTMENTS IN BASIS OF INDEBTEDNESS
(A) REDUCTION OF BASIS
If for any taxable year the amounts specified in subparagraphs (B), (C), (D), and (E) of subsection (a)(2) exceed the amount which reduces the shareholder's basis to zero, such excess shall be applied to reduce (but not below zero) the shareholder's basis in any indebtedness of the S corporation to the shareholder.
(B) RESTORATION OF BASIS
If for any taxable year beginning after December 31, 1982, there is a reduction under subparagraph (A) in the shareholder's basis in the indebtedness of an S corporation to a shareholder, any net increase (after the application of paragraphs (1) and (2) of subsection (a)) for any subsequent taxable year shall be applied to restore such reduction in basis before any of it may be used to increase the shareholder's basis in the stock of the S corporation.
(3) COORDINATION WITH SECTIONS 165(g) AND 166(d)
This section and section 1366 shall be applied before the application of sections 165(g) and 166(d) to any taxable year of the shareholder or the corporation in which the security or debt becomes worthless.
(4) ADJUSTMENTS IN CASE OF INHERITED STOCK.--
(A) IN GENERAL.--
If any person acquires stock in an S corporation by reason of the death of a decedent or by bequest, devise, or inheritance, section 691 shall be applied with respect to any item of income of the S corporation in the same manner as if the decedent had held directly his pro rata share of such item.
(B) ADJUSTMENTS TO BASIS.--
The basis determined under section 1014 of any stock in an S corporation shall be reduced by the portion of the value of the stock which is attributable to items constituting income in respect of the decedent.