Papal lackeys have been working overtime to defend the pope's instantly-infamous statement about rabbity Catholics and a mother who "tempted God" by becoming pregnant for the 8th time after having 7 c-sections.
Some papal lackeys have speculated that Francis had additional background information about this woman's situation.
However, a larger problem which this issue raises is how he acquired this sensitive, personal information in the first place. An obvious source of information would be the confessional. But if he's publicly divulging confidential information disclosed to him in the confessional, then that's grounds for automatic excommunication. According to the CCC,
1467 Given the delicacy and greatness of this ministry and the respect due to persons, the Church declares that every priest who hears confessions is bound under very severe penalties to keep absolute secrecy regarding the sins that his penitents have confessed to him. He can make no use of knowledge that confession gives him about penitents' lives.72 This secret, which admits of no exceptions, is called the "sacramental seal," because what the penitent has made known to the priest remains "sealed" by the sacrament.
2490 The secret of the sacrament of reconciliation is sacred, and cannot be violated under any pretext. "The sacramental seal is inviolable; therefore, it is a crime for a confessor in any way to betray a penitent by word or in any other manner or for any reason."284
According to the Code of Canon Law
Can. 1388 §1. A confessor who directly violates the sacramental seal incurs a latae sententiae excommunication reserved to the Apostolic See; one who does so only indirectly is to be punished according to the gravity of the delict.
Perhaps, though, the pope could weasel out of this by claiming that he is above the law: