- Green Growth
- Your Consultant
The 16-time Grand Slam champion will contest a place in the final with French 12th seed Gael
Monfils, last year's beaten finalist, who upset British third seed Andy Murray 6-2, 2-6, 6-3.
Federer served and returned with breath-taking efficiency in the first set against Melzer, breaking his opponent twice in succession to go 5-0 up inside 15 minutes and securing a one-set lead with a pair of thumping aces.
The top seed, chasing a third straight title after successes in Stockholm and Basel, encountered stiffer resistance in a tight second set.
Melzer, a semi-finalist at this year's French Open, matched the Swiss great stride for stride but was undone in the tie-break after netting a straightforward volley to gift Federer a 5-4 lead that he did not relinquish.
"I served well the whole match, but in the second set he was able to play a bit more solidly overall and serve a bit better," said Federer.
"I think I played a perfect first set, but after that I knew it was going to be closer because the first set wasn't really reality."
Monfils had been taken to three long sets in a sapping third-round win over Spain's Fernando Verdasco on Thursday, but he showed few signs of fatigue as he broke Murray twice to take the first set.
The Scot was quick to bite back, however, breaking in the sixth game of set two when his charge to the net forced Monfils to net a hurried backhand volley.
Murray won the second set to level the match, but a wild forehand into the tramlines from the world number four gifted Monfils a break in the fifth game of the deciding set and the freely-hitting Frenchman didn't look back.
"I've never beaten Roger," said Monfils, looking ahead to his semi-final.
"Whenever I've played him I've had opportunities, but I've never seized them. Hopefully I'll have some more chances this time and maybe I'll try to change the way I play."
Murray, whose third-round win over Marin Cilic the day before finished after midnight, admitted: "I wasn't expecting to feel great today.
"Getting to bed at three o'clock in the morning the night before a match is not ideal preparation. It's difficult to come out and play your best tennis."
Earlier, two-time French Open finalist Robin Soderling eased into the semi-finals with a 7-5, 6-4 defeat of American eighth seed Andy Roddick.
The Swedish fourth seed, who will compete alongside Roddick at the year-end ATP World Tour Finals in London later this month, now faces unseeded Frenchman Michael Llodra, who upset Russian 10th seed Nikolay Davydenko 7-5, 6-1.
Roddick began the match with three straight aces, but Soderling secured the only break of the first set and then broke early in the second before cruising to a victory that avenged losses to Roddick at Indian Wells and Cincinnati earlier this year.
"We've played five times now and we've always had tough matches," said Soderling, who lost in the Roland Garros finals in 2009 and 2010.
"Against Andy it's always a matter of taking the chances you get."
Llodra, who eliminated defending champion Novak Djokovic in the previous round, came from 2-4 down to win the first set against 2006 champion Davydenko before running away with the match in the second.
The 30-year-old left-hander, a member of the French team that tackles Serbia in next month's Davis Cup final, had never previously gone beyond the third round of a Masters event.