Federer will next face another Spaniard, Feliciano Lopez, who ended the last hope for a homegrown winner in sixth seed Milos Raonic 6-4 6-7(5) 6-3.
The other semi-final will see rising star Grigor Dimitrov take on Jo-Wilfried Tsonga, who has reached the last four by knocking off world number one Novak Djokovic and twice-champion and eighth seed Andy Murray in Friday’s quarter-final.
With Ferrer 14-0 against the Swiss maestro there was little concern the fifth seed might spoil the party as the capacity crowd serenaded 17-time grand slam winner Federer with a chorus of “Happy Birthday” between games during the second set.
But there would be no gifts from Ferrer, who made Federer work a little longer and little harder than he wanted.
“It’s a dream come true to still be playing tennis at this age,” Federer told the cheering crowd. “I love tennis but it is a whole lot more fun when you do win and play against guys like David who leave it all out there.
“Stay injury free and go out on my terms, maybe try and win tournaments, I have two this year and hopefully we will have a few more.
“It starts here tomorrow again on the court.”
His next opponent Lopez excels on grass and reached the final at Queen’s before clinching his fourth career title at Eastbourne a week later, but he has looked at home on the Canadian hardcourts.
After knocking off fourth seed Tomas Berdych in the third round he will now have to record another big upset in Federer if he is to reach his first ATP Tour Masters 1000 final.
Lopez’s victory deflated the capacity crowd and was a crushing loss for Raonic, who came into his home tournament with huge expectations, sitting a career high number six in the world and riding the momentum from a win last Sunday in Washington.
Raonic blasted 18 aces past Lopez but in the end the big-hitting Canadian said it was a lack of courage, not muscle, that cost him the win.
“He (Lopez) stepped up and played well on the important moments, especially on his service game,” said Raonic. “I just need to show in a few situations more courage and go for a little bit more.
“Not just that third set but all throughout the match. I just felt like I never let it go through or impose myself, and I think that’s what cost me over time.”
A confident Tsonga heads into Saturday having already taken out Djokovic and Murray, who between them had won five of the last seven Canadian hard-court titles.
After ending an 11-match losing run against Djokovic in the third round, Tsonga brought another barren stretch to an end against Murray with a 7-6(5) 4-6 6-4 win.
The Scotsman had dominated their head-to-head encounters, winning nine of 10 contests, with the Frenchman’s only victory in that stretch coming in 2008 at the Australian Open.
“It’s going better and better every day,” said Tsonga. “These last couple of months I practiced a lot because I didn’t win many matches and I also made the choice to practice than play tournaments because I was not really ready after the knee problem I had last year.
“Now I feel like I’m ready to play. I’m sure I’m playing better than before.”
Tsonga has found success over the years on the Canadian hardcourts, reaching the semi-finals in three of his four visits and with a win over Dimitrov will advance to his third ATP Masters final.
Dimitrov needed to dig deep to avoid having his name added to the upset list, the seventh seed battling back to beat South African Kevin Anderson 5-7 7-5 7-6(6). (Reuters)