Manufacture of undercut structures for T-gates in three-layer processes