------- 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