The first round would be canceled, and a new election would be organized
French newspapers like to answer this question during election times. For example, this article is an interview of Michel Lascombes, a constitutional law profesor. The main source is article 7 of the French constitution.
To summarize the article:
If a candidate dies or is incapacitated before the first round, the election is postponed. The decision is made by the Constitutional Council.
From the article 7 of the French constitution (in French),
Si, avant le premier tour, un des candidats décède ou se trouve empêché, le Conseil constitutionnel prononce le report de l'élection.
Translation by Google Translate:
If, before the first round, one of the candidates dies or is prevented, the Constitutional Council pronounces the postponement of the election.
The rules are not precisely set in the constitution: how long is the delay? Are new candidates accepted?... since the case never happened before, it is left to the Constitutional Council to decide.
If one of the two leading candidates die between the two rounds, the first round is canceled and the election has to be reorganized
From the article 7 of the French constitution:
En cas de décès ou d'empêchement de l'un des deux candidats les plus favorisés au premier tour avant les retraits éventuels, le Conseil constitutionnel déclare qu'il doit être procédé de nouveau à l'ensemble des opérations électorales ; il en est de même en cas de décès ou d'empêchement de l'un des deux candidats restés en présence en vue du second tour.
In the event of the death or incapacity of one of the two most favored candidates in the first round before any withdrawals, the Constitutional Council declares that all electoral operations must be carried out again; the same applies in the event of the death or incapacity of one of the two candidates who remained in attendance for the second round.
The article precise that the current president stays in office until the next election. Also, the precise meaning of incapacitated is left to the Constitutional Council.