[Bug c++/51004] New: ICE in lower_stmt at gimple-low.c:428

2011-11-07 Thread kennytm at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51004

 Bug #: 51004
   Summary: ICE in lower_stmt at gimple-low.c:428
Classification: Unclassified
   Product: gcc
   Version: 4.6.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: kenn...@gmail.com


Test case:

===
#include 

struct CCC
{
int x;
};

typedef boost::python::object S;

int extract(S obj)
{
return 0;
}

void init_from_tuples_impl(S tpl)
{
new CCC{extract(tpl)};
}

void tuples()
{
&init_from_tuples_impl;
}
===

It should compile with no error. Instead, the compiler fails with error
message:

$ g++ -std=c++0x -c 2.cpp `pkg-config --cflags python3`
2.cpp: In function ‘void init_from_tuples_impl(S)’:
2.cpp:23:1: internal compiler error: in lower_stmt, at gimple-low.c:428
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

(It should be possible to remove the dependency on Boost.Python, but I haven't
have time to do so yet).





gcc config:

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/src/gcc-4.6.2/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --enable-gnu-unique-object
--enable-linker-build-id --with-ppl --enable-cloog-backend=isl --enable-lto
--enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold
--disable-multilib --disable-libssp --disable-libstdcxx-pch
--enable-checking=release
Thread model: posix
gcc version 4.6.2 (GCC)


[Bug c++/51004] ICE in lower_stmt at gimple-low.c:428

2011-11-07 Thread kennytm at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51004

--- Comment #2 from kennytm at gmail dot com 2011-11-07 16:36:37 UTC ---
Created attachment 25741
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25741
The processed file that triggers the bug.

Reduced test case:

=
struct CCC
{
int x;
};

struct S
{
~S() {}
};

void init_from_tuples_impl(S* tpl)
{
new CCC{ (S(*tpl), 0) };
}
=
$ g++ -c  2.cpp

2.cpp: In function ‘void init_from_tuples_impl(S*)’:
2.cpp:13:9: warning: extended initializer lists only available with -std=c++0x
or -std=gnu++0x [enabled by default]
2.cpp:14:1: internal compiler error: in lower_stmt, at gimple-low.c:428
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.
=


The .ii file is the same, attached for completeness.


[Bug c++/53690] New: \u0000 and \U00000000 are wrong encoded as U+0001.

2012-06-15 Thread kennytm at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53690

 Bug #: 53690
   Summary: \u and \U are wrong encoded as U+0001.
Classification: Unclassified
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: kenn...@gmail.com


Tested with gcc 4.7 and 4.5 (via ideone)

~~~

#include 
#include 

int main() {
uint32_t a = U'\U';
uint32_t b = U'\u';
uint32_t c = U'\x00';
uint32_t d = U'\0';

uint16_t e = u'\U';
uint16_t f = u'\u';
uint16_t g = u'\x00';
uint16_t h = u'\0';

printf("%x %x %x %x %x %x %x %x\n", a, b, c, d, e, f, g, h);

return 0;
}

// Compile with:
//
// g++ -std=c++11 x.cpp

~~~

This program prints "1 1 0 0 1 1 0 0", but the expected output should be "0 0 0
0 0 0 0 0".



gcc -v:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/src/gcc-4.7-20120505/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--enable-libstdcxx-time --enable-gnu-unique-object --enable-linker-build-id
--with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold
--enable-ld=default --enable-plugin --with-plugin-ld=ld.gold
--with-linker-hash-style=gnu --enable-multilib --disable-libssp
--disable-build-with-cxx --disable-build-poststage1-with-cxx
--enable-checking=release --with-fpmath=sse
Thread model: posix
gcc version 4.7.0 20120505 (prerelease) (GCC)


[Bug c++/53026] ICE with alias-declarations

2012-06-23 Thread kennytm at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53026

kennytm at gmail dot com changed:

   What|Removed |Added

 CC||kennytm at gmail dot com

--- Comment #4 from kennytm at gmail dot com 2012-06-23 18:40:55 UTC ---
A smaller test case which should be the same bug. 

--
struct M {};
template 
using K = const M;
K a;
--

Both the segfault appear in the lookup_template_class() function.


[Bug c++/51459] New: [4.6 Regression] 'double free or corruption' involving std::function, std::vector and lambdas

2011-12-07 Thread kennytm at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51459

 Bug #: 51459
   Summary: [4.6 Regression] 'double free or corruption' involving
std::function, std::vector and lambdas
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: kenn...@gmail.com


Tested with "gcc version 4.7.0 2012" on 64-bit Linux.

~

#include 
#include 

template 
std::function animate(F f) { return [=]{ f(); }; }

int main()
{
std::vector pv {0, 0};
pv.push_back(0);

std::function linear1 = []{};
std::vector> av {animate(linear1), animate(linear1)};
av[0]();

return 0;
}

~

Compiling and running this (`g++-4.7 -std=c++11 x.cpp`) results in:

*** glibc detected *** ./a.out: double free or corruption (fasttop):
0x01c7b1c0 ***
=== Backtrace: =
/lib/libc.so.6(+0x73466)[0x7fafc7a78466]
/lib/libc.so.6(cfree+0x6c)[0x7fafc7a7c33c]


~

g++-4.7 -v:

Using built-in specs.
COLLECT_GCC=g++-4.7
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with:
/tmp/packerbuild-0/gcc-snapshot/gcc-snapshot/src/gcc-4.7-2012/configure
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --datadir=/usr/share/gcc-4.7
--with-bugurl='http://aur.archlinux.org/packages.php?ID=16045'
--enable-languages=c,c++,lto --enable-shared --enable-threads=posix
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-clocale=gnu --enable-gnu-unique-object --enable-linker-build-id
--with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold
--enable-ld=default --enable-plugin --with-plugin-ld=ld.gold
--with-linker-hash-style=gnu --disable-multilib --disable-libssp
--disable-libstdcxx-pch --enable-checking=release --disable-werror
--program-suffix=-4.7 --enable-version-specific-runtime-libs
--disable-bootstrap
Thread model: posix
gcc version 4.7.0 2012 (experimental) (GCC)


[Bug c++/51459] [4.6 Regression] 'double free or corruption' involving std::function, std::vector and lambdas

2011-12-07 Thread kennytm at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51459

--- Comment #1 from kennytm at gmail dot com 2011-12-07 22:48:14 UTC ---
Created attachment 26018
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26018
The .ii file