Federer, his play spotty but good enough to continue his domination of his frequent foe, ousted Gonzalez 6-3, 5-7, 6-2.
Andy Roddick, the lone American remaining in the singles draw, came back strong in the third set to beat David Ferrer 7-6 (5), 3-6, 6-3. Roddick finished with 10 aces against his Spanish opponent, who served eight of his own.
Roddick, ranked No. 7, had trouble keeping his shots on the court in the second set, then found the range again in the third to pull out the match.
He finished with 38 unforced errors, five more than Ferrer.
Andy Murray also advanced, extending his fine 2009 start to 18-1 when Tommy Robredo retired in the second set of their match because of a wrist injury. Murray won the first set 6-2 and was up 3-0 in the second.
Defending champion and No. 3 Novak Djokovic outlasted Stanislas Wawrinka 7-6 (7), 7-6 (6). Juan Martin del Potro defeated John Isner 7-6 (4), 7-6 (3), and Ivan Ljubicic downed Igor Andreev 4-6, 7-6 (5), 7-6 (4).
Federer, ranked No. 2 after losing his four-year hold on the top spot to Rafael Nadal last year, was inconsistent against No. 17 Gonzalez. The Chilean fought his way back into the match in the second set, overcoming earlier frustration he had vented by slamming a racket onto the court — three times — and shattering it.
Federer, the tournament champion three consecutive years beginning in 2004, said he felt he finally was able to establish some rhythm in his game after playing mostly serve-and-return against his first two opponents.
“Today was a bit more baseline, even though I couldn’t find his (Gonzalez’s) backhand,” Federer said. “If you don’t find his backhand, the point is over quickly. He has such a massive forehand.
“I’m looking forward to playing against (Fernando) Verdasco. It’s a good thing that I’m still in the tournament and facing an opponent who actually is going to extend the rallies a little bit.”
Verdasco defeated Philipp Kohlschreiber 6-4, 3-6, 6-1 to earn the quarterfinal appearance against Federer.
Murray, ranked No. 4, said he anticipated a difficult test heading into his match against Robredo.
“I was expecting a tough match. I had lost to Tommy two previous times I played him,” the 21-year-old Scot said. “I knew I had to be on my game.”
Murray said he was aware Robredo had a problem with his wrist, although he still seemed to be hitting the ball OK.
“But mentally, a wrist problem can be tough,” Murray said. “I know because I’ve been through it. It’s just the pain that’s there and feeling like something might happen.”
On the women’s side, No. 6 Vera Zvonareva defeated No. 13 Caroline Wozniacki 6-4, 6-2.
Also on NBCSports.com
College hoops: Check out brackets, play the game
NHL: It's a no-brainer — Brodeur best goalie | Video
NBA: Fact or fiction of players missing in action
NFL: Peppers probably won't end up with Pats
Baseball: Only one solution — amnesty for users