|Igusa varieties are very useful in studying bad reduction of certain PEL-type Shimura varieties. By the result of Mantovan, the cohomology of such Shimura varieties can be expressed in terms of the cohomology of Igusa varieties and that of Rapoport-Zink spaces. In the work of Harris and Taylor on the Langlands correspondence, it is an important step to establish yet another relation between the cohomology spaces of Igusa varieties and Shimura varieties. This step relies on precise understanding of moduli data in characteristic $p$ as well as the techniques in harmonic analysis and the trace formula. I will present a recent work which works out this step in the case where endoscopy is nontrivial, assuming certain conjectures in representation theory.