Porosity is a common casting defect induced by solidification shrinkage as well as gas segregation, nevertheless, it may exert a beneficial effect on reducing alloying element segregation. Unfortunately, the influence of porosity formation on alloying elements segregation in casting alloys have not been synthetically investigated by neither experiment nor theoretical analysis. In this regards, here a theoretical model, based on analyses of the redistribution behaviours of both gas element and the alloying elements, is proposed to simultaneously predict the porosity and segregation in as-solidified Al-based alloys. First, Al-4.5 wt pct Cu alloy with a columnar dendritic interface is selected to mathematically predict the porosity forming process. The modelling results show the same tendency with Poirier’s prediction, but the volume percentage of porosity calculated by the present model is lower than that of Poirier’s. Besides, the present model predicts a decrease in porosity fraction at late stage of solidification, and more than the previous studies, the gas escaped from eutectic liquid is also evaluated. Then, the impact of porosity formation on the velocity of interdendritic feeding flow is estimated, the porosity in the mushy zone apparently slow down the suction of interdendritic liquid. Finally, a mathematical model for element segregation is derived with consideration of porosity formation. Numerical results show that the solute enrichment in interdendritic liquid gets relieved slightly with porosity formation. Consequently, porosity will reduce the solute segregation.