[Bug c++/49751] Incorrect optimization related to smallest int64_t value.

2011-07-14 Thread blaise at suitabletech dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49751

--- Comment #1 from Blaies Gassend  2011-07-14 
18:49:59 UTC ---
Created attachment 24759
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24759
The sample program that fails.


[Bug c++/49751] New: Incorrect optimization related to smallest int64_t value.

2011-07-14 Thread blaise at suitabletech dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49751

   Summary: Incorrect optimization related to smallest int64_t
value.
   Product: gcc
   Version: 4.4.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: bla...@suitabletech.com


The attached program has different behavior with no optimization, and with -O2.
It appears that in optimized mode, the compiler considers that taking the
negative of a value always yields a negative value. This makes it tricky to
write code that properly handles the largest negative value. 

blaise@bnl: /st/stor1/blaise/temp $ g++ test_overflow.cpp -o test_overflow -O3
&& ./test_overflow 
blaise@bnl: /st/stor1/blaise/temp $ g++ test_overflow.cpp -o test_overflow &&
./test_overflow 
test_overflow: test_overflow.cpp:13: int main(): Assertion `a > 0' failed.
Aborted

blaise@bnl: /st/stor1/blaise/texas-plumbing/stacks/texas_videoconf/build $ g++
-v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc
--disable-werror --with-arch-32=i486 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)


[Bug libstdc++/48472] New: some flavors of std::bind are included in the global namespace when you include with -std=c++0x

2011-04-05 Thread blaise at suitabletech dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48472

   Summary: some flavors of std::bind are included in the global
namespace when you include  with
-std=c++0x
   Product: gcc
   Version: 4.4.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: bla...@suitabletech.com


The following program compiles correctly. I believe it should not because bind
should not be in the global namespace. (If you take A out of std this program
fails as one would expect.)

-
// Compile with: g++ test.cpp -std=c++0x -c
#include 

namespace std
{
class A
{};
}

void f(std::A a)
{
  bind(&f, a);
}
-

Output of g++ -v:
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc
--disable-werror --with-arch-32=i486 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)