gold gains on safe-haven demand amid global stock market meltdown