The net operating loss deduction allowed by section 172 is available to estates and trusts generally, with the following exceptions and limitations:
(a) In computing gross income and deductions for the purposes of section 172, a trust shall exclude that portion of the income and deductions attributable to the grantor or another person under sections 671 through 678 (relating to grantors and others treated as substantial owners).
(b) An estate or trust shall not, for the purposes of section 172, avail itself of the deductions allowed by section 642(c) (relating to charitable contributions deductions) and sections 651 and 661 (relating to deductions for distributions).