This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/21032] GCC 3.4.3 wrongly reorders floating-point operations
- From: "bagnara at cs dot unipr dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Apr 2005 07:01:38 -0000
- Subject: [Bug middle-end/21032] GCC 3.4.3 wrongly reorders floating-point operations
- References: <20050414215230.21032.bagnara@cs.unipr.it>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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
operations
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
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21032