If for any taxable year beginning in the recognition period an S corporation has a net recognized built-in gain, there is hereby imposed a tax (computed under subsection (b)) on the income of such corporation for such taxable year.
The amount of the tax imposed by subsection (a) shall be computed by applying the highest rate of tax specified in section 11(b) to the net recognized built-in gain of the S corporation for the taxable year.
Notwithstanding section 1371(b)(1), any net operating loss carryforward arising in a taxable year for which the corporation was a C corporation shall be allowed for purposes of this section as a deduction against the net recognized built-in gain of the S corporation for the taxable year. For purposes of determining the amount of any such loss which may be carried to subsequent taxable years, the amount of the net recognized built-in gain shall be treated as taxable income. Rules similar to the rules of the preceding sentences of this paragraph shall apply in the case of a capital loss carryforward arising in a taxable year for which the corporation was a C corporation.
Except as provided in subparagraph (B), no credit shall be allowable under part IV of subchapter A of this chapter (other than under section 34) against the tax imposed by subsection (a).
Notwithstanding section 1371(b)(1), any business credit carryforward under section 39 arising in a taxable year for which the corporation was a C corporation shall be allowed as a credit against the tax imposed by subsection (a) in the same manner as if it were imposed by section 11.
Subsection (a) shall not apply to any corporation if an election under section 1362(a) has been in effect with respect to such corporation for each of its taxable years. Except as provided in regulations, an S corporation and any predecessor corporation shall be treated as 1 corporation for purposes of the preceding sentence.
If, for any taxable year described in subparagraph (A), the amount referred to in clause (i) of subparagraph (A) exceeds the amount referred to in clause (ii) of subparagraph (A), such excess shall be treated as a recognized built-in gain in the succeeding taxable year.
Any item of income which is properly taken into account during the recognition period but which is attributable to periods before the 1st taxable year for which the corporation was an S corporation shall be treated as a recognized built-in gain for the taxable year in which it is properly taken into account.
Any amount which is allowable as a deduction during the recognition period (determined without regard to any carryover) but which is attributable to periods before the 1st taxable year referred to in subparagraph (A) shall be treated as a recognized built-in loss for the taxable year for which it is allowable as a deduction.
The amount of the net unrealized built-in gain shall be properly adjusted for amounts which would be treated as recognized built-in gains or losses under this paragraph if such amounts were properly taken into account (or allowable as a deduction) during the recognition period.
The term “recognition period” means the 5-year period beginning with the 1st day of the 1st taxable year for which the corporation was an S corporation. For purposes of applying this section to any amount includible in income by reason of distributions to shareholders pursuant to section 593(e), the preceding sentence shall be applied without regard to the phrase “5-year”.
The Secretary shall prescribe such regulations as may be necessary to carry out the purposes of this section including regulations providing for the appropriate treatment of successor corporations.