The rare-earth compounds in Mg-Zn-Gd-Zr alloy were quantitatively studied by using phase separation technique, and the effects of rare-earth elements on the formation of compounds during solidification were analyzed, and the effects of W phase and its content on dynamic recrystallization were investigated. The results show that the increase of Gd content can effectively increase the content of W phase in the casting alloy, while the formation of W phase during solidification mainly depends on the ratio of Zn and Gd elements in the residual melt. When the mass ratio of Zn/Gd is less than 0.8, more W phase is produced than I phase. Increasing the mass ratio of Zn/Gd in the residual melt or increasing the content of Gd alone can increase the formation of the W phase. After homogenization, the newborn W phase originates from the decomposition of the I phase, but the amount of the newborn W phase is smaller than that of the decomposition of the I phase. According to the process hardening theory, the critical strain of dynamic recrystallization nucleation decreases with the increase of W phase, which is 0.09411, 0.07321 and 0.05591, respectively. In addition, W phase can promote the formation of recrystallized grains, and the area ratio of recrystallized grains increases from 19.81 to 24.652% with the increase of W phase.