Fix a -join-globalcopies bug; handle undef operands.