[Bug c++/37679] New: -fstrict-aliasing causes omission of double-to-float conversion

2008-09-29 Thread dhatch at ilm dot com
The program which will be attached
demonstrates a case where,
when the -fstrict-aliasing optimization is turned on,
the result of the final one of 6 double-to-float conversions
does not get written to memory as it should.
According to valgrind (memory debugging tool), the target memory
gets left uninitialized.

The expected output and actual output are described in the program's comments.

I don't think I have done any illegal pointer aliasing in this program,
and the -Wstrict-aliasing=2 option doesn't warn of any such errors.

The problem occurs in g++ 4.1.2.
It does not occur in older versions I tried (4.0.2, 3.3.5)
nor at lower optimization levels.

The compiler version info, as shown by g++ -v, is:
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --libdir=/usr/lib64 --libexecdir=/usr/lib64
--with-gxx-include-dir=/usr/include/c++/4.1.2 --enable-languages=c,c++,fortran
--enable-shared --enable-threads=posix --disable-checking --with-system-zlib
--enable-__cxa_atexit --without-system-libunwind --enable-spp --disable-libssp
--enable-version-specific-runtime-libs --host=x86_64-suse-linux
Thread model: posix
gcc version 4.1.2


-- 
   Summary: -fstrict-aliasing causes omission of double-to-float
conversion
   Product: gcc
   Version: 4.1.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: dhatch at ilm dot com
 GCC build triplet: x86_64-suse-linux
  GCC host triplet: x86_64-suse-linux
GCC target triplet: x86_64-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37679



[Bug c++/37679] -fstrict-aliasing causes omission of double-to-float conversion

2008-09-29 Thread dhatch at ilm dot com


--- Comment #1 from dhatch at ilm dot com  2008-09-30 03:15 ---
Created an attachment (id=16430)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16430&action=view)
BUG.cpp: test program to reproduce bug 37679


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37679