https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to jos...@codesourcery.com from comment #1)
> Ideally the front-end folding of expressions-of-constants might avoid 
> folding-for-optimization such as this (instead just folding cases where 
> the evaluated operands are actually constants, so not folding anything 
> where 1 / 0 is an evaluated operand).

I understand that Marek is saying that currently: "1 / 0" is not folded, but "0
* (1 / 0)" is folded into 0.

The answer is that we really need to separate the FE folding from the ME one,
and do only FE folding for language conformance purposes, while we can do ME
folding for warnings and when the FE is finished.  Isn't this what you explain
in text quoted at A.5 at https://gcc.gnu.org/wiki/Better_Diagnostics?

This will also liberate the ME to do optimizations that before could not do
because we wanted to reject invalid programs with -pedantic-errors.

I seem to remember there has been further discussion about this after or while
match.pd was implemented, discussing whether it was worth it that the FE saves
the GIMPLE generated when doing FE folding (or ME folding in case of FE
warnings requesting it), but I cannot find a link now.

Reply via email to