Global stocks gain on corporate results, rising commodities