Fabio Fognini shocked top seed Tommy Haas to reach the semi-finals of the Mercedes Cup in Stuttgart for a second time.