(determined without regard to section 245(a)(12)). (4) Treatment of distributions from earnings before 1987 (A) In general In the case of any dividend paid out of earnings and profits of the specified 10-percent owned foreign corporation (computed in accordance with sections 964(a) and 986) accumulated in taxable years beginning before January 1, 1987— (i) paragraphs (1), (2), and (3) shall be applied without regard to the phrase post-1986 each place it appears, and (ii) paragraph (2) shall be applied without regard to the phrase in taxable years beginning after December 31, 1986 . (B) Dividends paid first out of post-1986 earnings Dividends shall be treated as paid out of post-1986 undistributed earnings to the extent thereof. (d) Disallowance of foreign tax credit, etc (1) In general No credit shall be allowed under section 901 for any taxes paid or accrued (or treated as paid or accrued) with respect to any dividend for which a deduction is allowed under this section. (2) Denial of deduction No deduction shall be allowed under this chapter for any tax for which credit is not allowable under section 901 by reason of paragraph (1) (determined by treating the taxpayer as having elected the benefits of subpart A of part III of subchapter N). (e) Regulations The Secretary may prescribe such regulations or other guidance as may be necessary or appropriate to carry out the provisions of this section. . (b) Application of holding period requirement Subsection (c) of section 246 is amended— (1) by striking or 245 in paragraph (1) and inserting 245, or 245A