[Bug c++/58336] New: internal compiler error when using a static int for the size of a char array within a class

2013-09-06 Thread holger.brunck at keymile dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58336

Bug ID: 58336
   Summary: internal compiler error when using a static int for
the size of a char array within a class
   Product: gcc
   Version: 4.7.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: holger.brunck at keymile dot com

Hi,
I hit a compiler error when compiling the following code with g++ 4.7.2:

static int b  = 5;

class A
{
public :
  A();
};

A::A() {
char c[b];
}

--
This compilation example is with a powerpc cross compiler, but a x86 compiler
shows the same result.

powerpc-gcc -v -save-temps -g -c file.cpp 

Using built-in specs.
COLLECT_GCC=powerpc-gcc
Target: powerpc-linux
Configured with:
/opt/eldk/build/eldk-rel-v5.4-2013-08-02-9a46fd5-powerpc/tmp/work-shared/gcc-4.7.2-r20/gcc-4.7.2/configure
--build=x86_64-linux --host=i686-eldk-linux --target=powerpc-linux
--prefix=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr
--exec_prefix=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr
--bindir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux
--sbindir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux
--libexecdir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/libexec/powerpc-linux
--datadir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/share
--sysconfdir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/etc
--sharedstatedir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/com
--localstatedir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/var
--libdir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/lib/powerpc-linux
--includedir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/include
--oldincludedir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/include
--infodir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/share/info
--mandir=/opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/share/man
--disable-silent-rules --disable-dependency-tracking
--with-libtool-sysroot=/opt/eldk/build/eldk-rel-v5.4-2013-08-02-9a46fd5-powerpc/tmp/sysroots/i686-nativesdk-eldk-linux
--with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix
--disable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu
--enable-libstdcxx-pch --program-prefix=powerpc-linux- --without-local-prefix
--enable-lto --enable-libssp --disable-bootstrap --disable-libmudflap
--with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id
--with-ppl=no --with-cloog=no --enable-checking=release
--enable-cheaders=c_global
--with-gxx-include-dir=/opt/eldk-5.4/powerpc/sysroots/powerpc-linux/usr/include/c++
--with-build-time-tools=/opt/eldk/build/eldk-rel-v5.4-2013-08-02-9a46fd5-powerpc/tmp/sysroots/x86_64-linux/usr/powerpc-linux/bin
--with-sysroot=/opt/eldk-5.4/powerpc/sysroots/powerpc-linux
--with-build-sysroot=/opt/eldk/build/eldk-rel-v5.4-2013-08-02-9a46fd5-powerpc/tmp/sysroots/generic-powerpc
--disable-libunwind-exceptions --disable-libssp --disable-libgomp
--disable-libmudflap
--with-mpfr=/opt/eldk/build/eldk-rel-v5.4-2013-08-02-9a46fd5-powerpc/tmp/sysroots/i686-nativesdk-eldk-linux
--with-mpc=/opt/eldk/build/eldk-rel-v5.4-2013-08-02-9a46fd5-powerpc/tmp/sysroots/i686-nativesdk-eldk-linux
--enable-nls --enable-__cxa_atexit --with-long-double-128
Thread model: posix
gcc version 4.7.2 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-g' '-c'

/opt/keymile/ELDK/eldk_5_4-km.git/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/../../libexec/powerpc-linux/gcc/powerpc-linux/4.7.2/cc1plus
-E -quiet -v -iprefix
/opt/keymile/ELDK/eldk_5_4-km.git/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/../../lib/powerpc-linux/gcc/powerpc-linux/4.7.2/
-D_GNU_SOURCE -D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux
-D__linux -Asystem=linux -Asystem=unix -Asystem=posix file.cpp -g
-fworking-directory -fpch-preprocess -o file.ii
ignoring nonexistent directory
"/opt/keymile/ELDK/eldk_5_4-km.git/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/../../lib/powerpc-linux/gcc/powerpc-linux/4.7.2/../../../../../powerpc-linux/include"
ignoring duplicate directory
"/opt/keymile/ELDK/eldk_5_4-km.git/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/../../lib/powerpc-linux/gcc/../../../lib/powerpc-linux/gcc/powerpc-linux/4.7.2/include"
ignoring duplicate directory
"/opt/keymile/ELDK/eldk_5_4-km.git/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/../../lib/powerpc-linux/gcc/../../../lib/powerpc-linux/gcc/powerpc-linux/4.7.2/include-fixed"
ignoring nonexistent directory
"/opt/keymile/ELDK/eldk_5_4-km.git/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/../../lib/powerpc-linux/gcc/../../../lib/powerpc-linux/gcc/powerpc-linux/4.7.2/../../../../../powerpc-linux/include"
#in

[Bug c++/58336] internal compiler error when using a static int for the size of a char array within a class

2013-09-07 Thread holger.brunck at keymile dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58336

--- Comment #2 from holger.brunck at keymile dot com ---
With a g++ verison 4.7.2 it's definetely crashing on my side, but I
doublechecked with a 4.7.3 compiler and the problem seems already to be fixed.

g++ --version
g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3

~$ g++ -g -c file.cpp