Except as provided in section
312
(k)(4), for purposes of this section, the earnings and profits of any foreign corporation for any taxable year shall be determined according to rules substantially similar to those applicable to domestic corporations, under regulations prescribed by the Secretary.