You'd only pay gain if there is a stock+cash swap. Your gain would be limited to the amount of cash received.
Cost basis for WAMU stock
(FMV of JPM stock received)
(cash received)
--------------------
Gain on transaction
If you have a loss, it is suspended and your new basis in JPM is your basis in WAMU, less any cash received.
If you have a gain, it is recognized immediately and your basis in JPM is your basis in WAMU, less any cash received and gain recognized.