[Bug c/21360] New: wrong result of 'if' statement with comparing of floating point with gcc.
Following code produces wrong results: #include stdio.h float f = -1.0f ; int main( void ) { if ( (unsigned int)f != (unsigned int)-1.0f ) { printf( %-12s %04d:NG...[%u]---[%u]\n, __FILE__, __LINE__, (unsigned int)-1.0f, (unsigned int)f ) ; } else { printf( [%u]---[%u] :OK\n, (unsigned int)-1.0f, (unsigned int)f ) ; } return( 0 ) ; } [EMAIL PROTECTED] tmp]$ /home/dinar/work/gcc-builds/gnu/gcc-i686-pc-linux-gnu/bin/gcc sample.c -o sample [EMAIL PROTECTED] tmp]$ ./sample sample.c 0010:NG...[0]---[4294967295] [EMAIL PROTECTED] tmp]$ /home/dinar/work/gcc-builds/gnu/gcc-i686-pc-linux-gnu/bin/gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../configure --prefix=/home/dinar/work/gcc-builds/gnu/gcc-i686-pc-linux-gnu/ --enable-languages=c,c++ Thread model: posix gcc version 4.1.0 20050429 (experimental) -- Summary: wrong result of 'if' statement with comparing of floating point with gcc. Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dtemirbulatov at ru dot mvista dot com CC: dtemirbulatov at ru dot mvista dot com,gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21360
[Bug middle-end/21360] wrong result of 'if' statement with comparing of floating point with gcc.
--- Additional Comments From dtemirbulatov at ru dot mvista dot com 2005-05-03 15:09 --- Created an attachment (id=8806) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8806action=view) testcase -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21360
[Bug middle-end/21360] wrong result of 'if' statement with comparing of floating point with gcc.
--- Additional Comments From dtemirbulatov at ru dot mvista dot com 2005-05-03 15:11 --- Created an attachment (id=8807) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8807action=view) proposed patch -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21360
[Bug middle-end/21360] wrong result of 'if' statement with comparing of floating point with gcc.
-- What|Removed |Added Known to fail||3.4.0 4.0.0 4.1.0 Known to work||3.3.5 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21360
[Bug c++/20992] New: error as no matching function with g++
g++ -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../configure --enable-language=c,c++ --prefix=/home/dinar/work/gcc-builds/gcc-4.0-i686-pc-linux-gnu/ Thread model: posix gcc version 4.0.0 20050412 (prerelease) while compiling source code: g++ sample.c -c sample.c: In function int main(): sample.c:13: error: no matching function for call to A::A(A) sample.c:4: note: candidates are: A::A(A) sample.c:13: error: initializing temporary from result of A::A(T) [with T = int] -- Summary: error as no matching function with g++ Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: critical Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dtemirbulatov at ru dot mvista dot com CC: dtemirbulatov at ru dot mvista dot com,gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20992
[Bug c++/20992] error as no matching function with g++
--- Additional Comments From dtemirbulatov at ru dot mvista dot com 2005-04-13 13:36 --- Created an attachment (id=8618) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8618action=view) source to compile -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20992