If a transaction results in a gain being chargeable, a loss, if it had arisen on the same transaction, is allowable (s 546).