Rising gasoline prices, trumpeted in foot-tall numbers on street corners across the country, are causing concern among advisers to President Obama that a budding sense of economic optimism could be undermined just as he heads into the general election.

White House officials are preparing for Republicans to use consumer angst about the cost of oil and gas to condemn his energy programs and buttress their argument that his economic policies are not working.