Stocks gain as investors take heart from upbeat earnings, dip in oil Reuters