public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jbeitaharon at intrusic dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/21666] Optimization level -O2 breaks float (double) conversion
Date: Thu, 19 May 2005 20:44:00 -0000 [thread overview]
Message-ID: <20050519204400.31106.qmail@sourceware.org> (raw)
In-Reply-To: <20050519183504.21666.jbeitaharon@intrusic.com>
------- Additional Comments From jbeitaharon at intrusic dot com 2005-05-19 20:43 -------
Subject: Re: Optimization level -O2 breaks float (double) conversion
Dear Pinskia and Co.,
As a former compiler developer myself I was just trying to help, and I'm
sorry to tell you that your answer was not to the point.
In order to transmit this double-precision-float we have to reformat it
into/from "Network Byte Ordering". The compiler generated no warnings,
and the generated code works fine when un-optimized or when optimized
with -O1.
The problem reproduction program reformats X into Y and then reformats Y
into X with the inverse operation. It then verifies that the original X
has the same value as the final X.
There is absolutely no reason why the -O2 optimization should break the
code, and hence this bug is valid as a regression in -O2 relative to -O1.
Regards,
Jonathan
pinskia at gcc dot gnu dot org wrote:
>------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-19 19:15 -------
>You are violating C aliasing rules:
>((long *) &s)[0] = __extension__ ({ register u_long __X = (nt.li[1]); __asm
>("xchgb %h1, %b1\n\trorl $16, %1\n\txchgb %h1, %b1" : "=q" (__X) : "0" (__X));
>__X; });
>
>s is a double but you are accessing it as a long.
>
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21666
next prev parent reply other threads:[~2005-05-19 20:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-19 19:12 [Bug c/21666] New: " jbeitaharon at intrusic dot com
2005-05-19 19:34 ` [Bug c/21666] " pinskia at gcc dot gnu dot org
2005-05-19 20:44 ` jbeitaharon at intrusic dot com [this message]
2005-05-19 21:34 ` pinskia at gcc dot gnu dot org
2005-06-05 9:19 ` pinskia at gcc dot gnu dot org
2005-06-05 9:19 ` pinskia at gcc dot gnu dot org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050519204400.31106.qmail@sourceware.org \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).