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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Michael Morrell from comment #6)
> I'm curious why this transformation is being done by both
> fold_real_zero_addition_p AND simplify_binary_operation_1.  

The answer there involves the history of GCC and the history of how
optimizations were done in GCC.
Basically fold_real_zero_addition_p (fold) would only act a statement while
simplify_binary_operation_1 could happen between statements (while doing CSE
and combine, etc.). That changed with the merge of tree-ssa in
r0-58166-g6de9cd9a886ea6 (2004). 

simplify_binary_operation_1 had the optimization since the begining of git
(though it moved from cse.c to simplify-rtx in r0-24738-g0cedb36cbd7e0c and the
HONOR_SIGNED_ZEROS was done by r0-41258-g71925bc04f24a4, in 2002 before it was
just checking ieee float format and unsafe-math).

fold had it since the begining of git also (and changed in a similar fashion as
simplify-rtx for the HONOR_SIGNED_ZEROS).

Reply via email to