This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/21032] GCC 3.4.3 wrongly reorders floating-point operations

------- Additional Comments From bagnara at cs dot unipr dot it  2005-04-15 07:01 -------
Subject: Re:  GCC 3.4.3 wrongly reorders floating-point

pinskia at gcc dot gnu dot org wrote:
> Note neg just flips a bit so it is correct anyways
 > and there is no loss of precession.

Can you please clarify what do you mean by "correct"?
I believe that:

1) The produced code is incorrect, since operations cannot
    be reordered that way.  Notice that the compiler cannot
    prove that the result is the same (in fact it is not,
    in general, as it depends on the rounding direction).

2) A piece of standard C that, when correctly compiled,
    performs a double to float conversion rounding up, when
    the rounding mode is downward, or rounding down, when
    the rounding mode is upward, no longer works when
    compiled with GCC.  So the produced code is incorrect
    not only from a language-lawyer point of view: I am
    actually obtaining the wrong results.

All the best,

     Roberto Bagnara


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]