[Bug c++/40260] New: g++ segfaults compiling template code

2009-05-26 Thread tux008 at googlemail dot com
Hello everybody,

today, I noticed a bug in gcc 4.4.0. The compiler segfaulted during 
the compilation process. I also tested the same code with gcc 4.3.3, which
works perfectly fine.
I narrowed it down to the following test program:



  template  class test
  {
  private:
  int num_bins;
  public:
  void testing(void);
  };
  template  void test::testing(void)
  {
  double jackdata[this->num_bins]; 
  }

int main()
{
test t;
t.testing();
}

---

The compilation command line is: 
  g++ test.cc
Error output:
  test.cc: In member function ‘void test::testing() [with T = double]’:
  test.cc:17:   instantiated from here
  test.cc:10: internal compiler error: Segmentation fault
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <http://gcc.gnu.org/bugs.html> for instructions.

System information:
gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared
--enable-languages=c,c++,fortran,objc,obj-c++ --enable-threads=posix
--mandir=/usr/share/man --infodir=/usr/share/info --enable-__cxa_atexit
--disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu
--disable-libstdcxx-pch --with-tune=generic
Thread model: posix
gcc version 4.4.0 (GCC)

If you need further information, please let me know.


-- 
   Summary: g++ segfaults compiling template code
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tux008 at googlemail dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug c++/40260] g++ segfaults compiling template code

2009-05-26 Thread tux008 at googlemail dot com


--- Comment #1 from tux008 at googlemail dot com  2009-05-26 16:31 ---
Created an attachment (id=17919)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17919&action=view)
precompiled file


-- 


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



[Bug c++/40260] g++ segfaults compiling template code

2009-05-26 Thread tux008 at googlemail dot com


--- Comment #2 from tux008 at googlemail dot com  2009-05-26 16:33 ---
Created an attachment (id=17920)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17920&action=view)
test program which causes gcc 4.4.0 to segfault

compiling this test program provokes a segfault of gcc 4.4.0. gcc 4.3.3 works
fine, however.


-- 


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



[Bug c++/40550] New: Segmentation fault caused by alignment error in sse code

2009-06-25 Thread tux008 at googlemail dot com
The following code is misscompiled on 32 bit machines using gcc-4.4.0,
gcc-4.3.3 and gcc-4.3.2 with the -msse switch
===

typedef float v2sf __attribute__ ((vector_size (2 * sizeof(float;

int main()
{
  v2sf a = {1.0, 0.0};
  v2sf b = {0.0, 1.0};
  v2sf d;
  d = a + b;
  return 0;
}

=

The program runs fine without the -msse switch but segfaults as soon as
compiled with -msse.
The reason for this is the use of the movaps instruction on a seemingly
unaligned chunk of memory. 

As a note, the same program compiles fine, if doubles are used instead of
floats.


-- 
   Summary: Segmentation fault caused by alignment error in sse code
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tux008 at googlemail dot com
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linux-gnu


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



[Bug c++/40550] Segmentation fault caused by alignment error in sse code

2009-06-25 Thread tux008 at googlemail dot com


--- Comment #1 from tux008 at googlemail dot com  2009-06-25 12:27 ---
Created an attachment (id=18067)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18067&action=view)
This program segfaults if compiled with gcc-4.4.0 and -msse on i686


-- 


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



[Bug c++/40550] Segmentation fault caused by alignment error in sse code

2009-06-25 Thread tux008 at googlemail dot com


--- Comment #2 from tux008 at googlemail dot com  2009-06-25 12:28 ---
Created an attachment (id=18068)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18068&action=view)
corresponding ii-file


-- 


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



[Bug c++/48073] New: ICE with -flto in templated C++ code

2011-03-11 Thread tux008 at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48073

   Summary: ICE with -flto in templated C++ code
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: tux...@googlemail.com


The following code produces an ICE if compiled with -flto on g++-4.6.0

SVN revision 170867

$$$> g++ -flto  zombie_coldatoms.cpp
zombie_coldatoms.cpp:48:1: internal compiler error: tree check: did not expect
class ‘type’, have ‘type’ (record_type) in contains_placeholder_p, at
tree.c:2820
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.


Replacing the default constructor DDQMC(); in line 36 by the automatic default
constructor (i.e. removing the corresponding code) makes the code compile.

The problem does not occur with g++-4.5.1


[Bug c++/48073] ICE with -flto in templated C++ code

2011-03-11 Thread tux008 at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48073

--- Comment #1 from tux008 at googlemail dot com 2011-03-11 14:19:51 UTC ---
Created attachment 23629
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23629
preprocessed code


[Bug c++/48073] ICE with -flto in templated C++ code

2011-03-11 Thread tux008 at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48073

--- Comment #2 from tux008 at googlemail dot com 2011-03-11 14:20:49 UTC ---
Created attachment 23630
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23630
(almost empty) assembly code file produced by g++-4.6.0 r170867