Federer’s five-set victory (6-1, 4-6, 2-6, 6-2, 6-3), means he reached the quarter-finals of a Grand Slam tournament for the 36th consecutive time.
He next takes on Jo-Wilfried Tsonga, also from France, who easily defeated Serbian Victor Troiki in three sets (6-3, 6-3, 6-3).
“If you become negative, you lose and you go home,” Federer said after his hard-won victory.
“It was very hard for me,” the 17-time Grand Slam champion acknowledged.
“Gilles raised his level in the second and thirds sets and that forced me to do the same.”
Federer said he was proud of reaching the quarterfinals of one of tennis’s major tournaments (the other Grand Slam events are the Australian Open, Wimbledon and the US Open) for a 36th time.
“It’s something I’m very proud of and one day I’ll look back and realize the sacrifices I made to achieve it,” he said.
“I’m looking forward to playing Tsonga.”