Impurity segregation to sink layer during phosphorus gettering