961 is amended by adding at the end the following new subsection: (d) Basis in specified 10-percent owned foreign corporation reduced by nontaxed portion of dividend for purposes of determining loss If a domestic corporation receives a dividend from a specified 10-percent owned foreign corporation (as defined in section 245A) in any taxable year, solely for purposes of determining loss on any disposition of stock of such foreign corporation in such taxable year or any subsequent taxable year, the basis of such domestic corporation in such stock shall be reduced (but not below zero) by the amount of any deduction allowable to such domestic corporation under section 245A with respect to such stock. . (2) Effective date The amendments made by this subsection shall apply to dividends received in taxable years beginning after December 31, 2017. (c) Sale by a CFC of a lower tier CFC Section 964(e) is amended by adding at the end the following new paragraph: (4) Coordination with dividends received deduction (A) In general If, for any taxable year of a controlled foreign corporation beginning after December 31, 2017, any amount is treated as a dividend under paragraph (1) by reason of a sale or exchange by the controlled foreign corporation of stock in another foreign corporation held for 1 year or more, then, notwithstanding any other provision of this title— (i) the foreign-source portion of such dividend shall be treated for purposes of section 951(a)(1)(A) as subpart F income of the selling controlled foreign corporation for such taxable year, (ii) a United States shareholder with respect to the selling controlled foreign corporation shall include in gross income for the taxable year of the shareholder with or within which such taxable year of the controlled foreign corporation ends an amount equal to the shareholder's pro rata share (determined in the same manner as under section 951(a)(2)) of the amount treated as subpart F income under clause (i), and (iii) the deduction under section 245A(a) shall be allowable