public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42225]  New: GCC 4.5 ICE (segfault) on C++ templated code
@ 2009-11-30  4:14 jacob dot benoit dot 1 at gmail dot com
  2009-11-30  4:17 ` [Bug c++/42225] " jacob dot benoit dot 1 at gmail dot com
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: jacob dot benoit dot 1 at gmail dot com @ 2009-11-30  4:14 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 7698 bytes --]

Hi,

I ran into a ICE (segmentation fault) with GCC 4.5 (20091126) when building
some C++ templated code. The platform is GNU/Linux, x86-64.

Please find attached the preprocessed source:

   product_small.ii.bz2

I have compressed it because it was really huge (this codes uses a C++ template
library).

Below is the compiler output for the g++ that generated that .ii file. Scroll
to the end to see the ICE.


##### 22:58:34 ~/build/eigen/test$ /usr/bin/g++-4.5 -v -save-temps -DHAS_GSL
-DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NO_DEBUG -Wnon-virtual-dtor
-Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W
-Wpointer-arith -Wwrite-strings -Wformat-security -fexceptions -fno-check-new
-fno-common -fstrict-aliasing -Wextra -pedantic  -g2 -g0 -O2 
-fno-inline-functions -I/home/bjacob/build/eigen/test -I/home/bjacob/eigen/test
-I/home/bjacob/eigen -I/home/bjacob/build/eigen -I/usr/include/QtGui
-I/usr/include/QtCore    -DEIGEN_TEST_FUNC=product_small  -DEIGEN_TEST_PART_1=1
-o CMakeFiles/test_product_small_1.dir/product_small.cpp.o -c
/home/bjacob/eigen/test/product_small.cpp                                       
Using built-in specs.                                                           
COLLECT_GCC=/usr/bin/g++-4.5                                                    
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper     
Target: x86_64-unknown-linux-gnu                                                
Configured with: ../configure --prefix=/usr --enable-languages=c,c++
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-lto --enable-gnu-unique-object --disable-multilib
--disable-libstdcxx-pch --with-tune=generic --with-system-zlib --with-ppl
--with-cloog --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --disable-werror --enable-checking=release
--program-suffix=-4.5 --enable-version-specific-runtime-libs  
Thread model: posix                                                             
gcc version 4.5.0 20091126 (experimental) (GCC)                                 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-DHAS_GSL' '-DQT_DLL' '-DQT_GUI_LIB'
'-DQT_CORE_LIB' '-DQT_NO_DEBUG' '-Wnon-virtual-dtor' '-Wno-long-long' '-ansi'
'-Wundef' '-Wcast-align' '-Wchar-subscripts' '-Wall' '-W' '-Wpointer-arith'
'-Wwrite-strings' '-Wformat-security' '-fexceptions' '-fno-check-new'
'-fno-common' '-fstrict-aliasing' '-Wextra' '-pedantic' '-g2' '-g0' '-O2'
'-fno-inline-functions' '-I/home/bjacob/build/eigen/test'
'-I/home/bjacob/eigen/test' '-I/home/bjacob/eigen' '-I/home/bjacob/build/eigen'
'-I/usr/include/QtGui' '-I/usr/include/QtCore'
'-DEIGEN_TEST_FUNC=product_small' '-DEIGEN_TEST_PART_1=1' '-o'
'CMakeFiles/test_product_small_1.dir/product_small.cpp.o' '-c' '-shared-libgcc'
'-mtune=generic'                   
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus -E -quiet -v
-I/home/bjacob/build/eigen/test -I/home/bjacob/eigen/test -I/home/bjacob/eigen
-I/home/bjacob/build/eigen -I/usr/include/QtGui -I/usr/include/QtCore
-D_GNU_SOURCE -DHAS_GSL -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NO_DEBUG
-DEIGEN_TEST_FUNC=product_small -DEIGEN_TEST_PART_1=1
/home/bjacob/eigen/test/product_small.cpp -mtune=generic -ansi
-Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall
-W -Wpointer-arith -Wwrite-strings -Wformat-security -Wextra -pedantic
-fexceptions -fno-check-new -fno-common -fstrict-aliasing -fno-inline-functions
-O2 -fpch-preprocess -o product_small.ii                                        
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/include" 
#include "..." search starts here:                                              
#include <...> search starts here:                                              
 /home/bjacob/build/eigen/test                                                  
 /home/bjacob/eigen/test                                                        
 /home/bjacob/eigen                                                             
 /home/bjacob/build/eigen                                                       
 /usr/include/QtGui                                                             
 /usr/include/QtCore                                                            
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include/c++                        

/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include/c++/x86_64-unknown-linux-gnu 
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include/c++/backward               
 /usr/local/include                                                             
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include                            
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include-fixed                      
 /usr/include                                                                   
End of search list.                                                             
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-DHAS_GSL' '-DQT_DLL' '-DQT_GUI_LIB'
'-DQT_CORE_LIB' '-DQT_NO_DEBUG' '-Wnon-virtual-dtor' '-Wno-long-long' '-ansi'
'-Wundef' '-Wcast-align' '-Wchar-subscripts' '-Wall' '-W' '-Wpointer-arith'
'-Wwrite-strings' '-Wformat-security' '-fexceptions' '-fno-check-new'
'-fno-common' '-fstrict-aliasing' '-Wextra' '-pedantic' '-g2' '-g0' '-O2'
'-fno-inline-functions' '-I/home/bjacob/build/eigen/test'
'-I/home/bjacob/eigen/test' '-I/home/bjacob/eigen' '-I/home/bjacob/build/eigen'
'-I/usr/include/QtGui' '-I/usr/include/QtCore'
'-DEIGEN_TEST_FUNC=product_small' '-DEIGEN_TEST_PART_1=1' '-o'
'CMakeFiles/test_product_small_1.dir/product_small.cpp.o' '-c' '-shared-libgcc'
'-mtune=generic'
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus -fpreprocessed
product_small.ii -quiet -dumpbase product_small.cpp -mtune=generic -ansi
-auxbase-strip CMakeFiles/test_product_small_1.dir/product_small.cpp.o -g2 -g0
-O2 -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts
-Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wextra -pedantic
-ansi -version -fexceptions -fno-check-new -fno-common -fstrict-aliasing
-fno-inline-functions -o product_small.s
GNU C++ (GCC) version 4.5.0 20091126 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.5.0 20091126 (experimental), GMP version
4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.5.0 20091126 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.5.0 20091126 (experimental), GMP version
4.3.1, MPFR version 2.4.1, MPC version 0.8
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: b74b35577b24604a564e27e0e25efd13
In file included from /home/bjacob/eigen/test/product_small.cpp:26:0:
/home/bjacob/eigen/test/product.h: In function ‘void product(const MatrixType&)
[with MatrixType = Eigen::Matrix<float, 3, 2, 0>]’:
/home/bjacob/eigen/test/product_small.cpp:31:97:   instantiated from here
/home/bjacob/eigen/test/product.h:45:60: 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.


-- 
           Summary: GCC 4.5 ICE (segfault) on C++ templated code
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jacob dot benoit dot 1 at gmail dot com


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
@ 2009-11-30  4:17 ` jacob dot benoit dot 1 at gmail dot com
  2009-11-30 10:33 ` [Bug c++/42225] [4.5 Regression] " rguenth at gcc dot gnu dot org
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jacob dot benoit dot 1 at gmail dot com @ 2009-11-30  4:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jacob dot benoit dot 1 at gmail dot com  2009-11-30 04:17 -------
Created an attachment (id=19181)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19181&action=view)
Preprocessed C++ source triggering this ICE

To uncompress do:
  bunzip2 product_small.ii.bz2


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
  2009-11-30  4:17 ` [Bug c++/42225] " jacob dot benoit dot 1 at gmail dot com
@ 2009-11-30 10:33 ` rguenth at gcc dot gnu dot org
  2009-11-30 23:01 ` dodji at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-11-30 10:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-11-30 10:32 -------
With checking enabled I get

> g++-4.5 -S -o /dev/null product_small.ii -B /abuild/rguenther/trunk-g/gcc
In file included from /home/bjacob/eigen/test/product_small.cpp:26:0:
/home/bjacob/eigen/test/product.h: In function 'void product(const MatrixType&)
[with MatrixType = Eigen::Matrix<float, 3, 2, 0>]':
/home/bjacob/eigen/test/product_small.cpp:31:97:   instantiated from here
/home/bjacob/eigen/test/product.h:45:60: internal compiler error: tree check:
accessed elt 2 of tree_vec with 1 elts in tsubst, at cp/pt.c:9823
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

works with 4.4.2.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
      Known to work|                            |4.4.2
           Priority|P3                          |P1
   Last reconfirmed|0000-00-00 00:00:00         |2009-11-30 10:32:44
               date|                            |
            Summary|GCC 4.5 ICE (segfault) on   |[4.5 Regression] GCC 4.5 ICE
                   |C++ templated code          |(segfault) on C++ templated
                   |                            |code
   Target Milestone|---                         |4.5.0


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
  2009-11-30  4:17 ` [Bug c++/42225] " jacob dot benoit dot 1 at gmail dot com
  2009-11-30 10:33 ` [Bug c++/42225] [4.5 Regression] " rguenth at gcc dot gnu dot org
@ 2009-11-30 23:01 ` dodji at gcc dot gnu dot org
  2009-12-01  0:26 ` dodji at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-11-30 23:01 UTC (permalink / raw)
  To: gcc-bugs



-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|dodji at gcc dot gnu dot org|
         AssignedTo|unassigned at gcc dot gnu   |dodji at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-11-30 10:32:44         |2009-11-30 23:01:09
               date|                            |


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (2 preceding siblings ...)
  2009-11-30 23:01 ` dodji at gcc dot gnu dot org
@ 2009-12-01  0:26 ` dodji at gcc dot gnu dot org
  2009-12-01  0:28 ` hjl dot tools at gmail dot com
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-12-01  0:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dodji at gcc dot gnu dot org  2009-12-01 00:26 -------
A reduced test case seems to be:

~=~
template<class T>
struct A
{
    typedef T I;
};

template<class T, int>
struct B
{   
    typedef T TT;
    typedef typename TT::I TT_I;
    typedef A<TT_I> TA;
};  

template<class T>
void  
foo() 
{
    typedef T TT;
    typedef typename TT::I TT_I;
    typedef A<TT_I> TA;
}

int
main ()
{
    foo<A<int> >();
}
~=~

It ICEs with:
test.cc:27:18:   instantiated from here
test.cc:21:21: internal compiler error: tree check: accessed elt 2 of tree_vec
with 1 elts in tsubst, at cp/pt.c:9823


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (3 preceding siblings ...)
  2009-12-01  0:26 ` dodji at gcc dot gnu dot org
@ 2009-12-01  0:28 ` hjl dot tools at gmail dot com
  2009-12-03 14:07 ` dodji at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-01  0:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl dot tools at gmail dot com  2009-12-01 00:27 -------
It is caused by revision 145440:

http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg00060.html


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (4 preceding siblings ...)
  2009-12-01  0:28 ` hjl dot tools at gmail dot com
@ 2009-12-03 14:07 ` dodji at gcc dot gnu dot org
  2009-12-11 14:36 ` dodji at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-12-03 14:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dodji at gcc dot gnu dot org  2009-12-03 14:07 -------
A patch was submitted to
http://gcc.gnu.org/ml/gcc-patches/2009-12/msg00194.html


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (5 preceding siblings ...)
  2009-12-03 14:07 ` dodji at gcc dot gnu dot org
@ 2009-12-11 14:36 ` dodji at gcc dot gnu dot org
  2009-12-11 14:37 ` dodji at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-12-11 14:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dodji at gcc dot gnu dot org  2009-12-11 14:36 -------
Subject: Bug 42225

Author: dodji
Date: Fri Dec 11 14:36:05 2009
New Revision: 155160

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155160
Log:
Fix PR c++/42225

gcc/cp/ChangeLog:
        PR c++/42225
        * typeck.c (incompatible_dependent_typedefs_p): New function.
        (structural_comptypes): Use it.
        * cp-tree.h (cp_set_underlying_type): Declare ...
        * tree.c (cp_set_underlying_type): ... new function.
        * class.c (build_self_reference): Use cp_set_underlying_type
        instead of set_underlying_type.
        * decl2.c (grokfield): Likewise.
        * name-lookup.c (pushdecl_maybe_friend): Likewise.

gcc/testsuite/ChangeLog:
        PR c++/42225
        * g++.dg/template/typedef24.C: New test.
        * g++.dg/template/typedef25.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/typedef24.C
    trunk/gcc/testsuite/g++.dg/template/typedef25.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl2.c
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/cp/tree.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (6 preceding siblings ...)
  2009-12-11 14:36 ` dodji at gcc dot gnu dot org
@ 2009-12-11 14:37 ` dodji at gcc dot gnu dot org
  2009-12-11 17:07 ` jacob dot benoit dot 1 at gmail dot com
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-12-11 14:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dodji at gcc dot gnu dot org  2009-12-11 14:37 -------
Fixed in trunk (4.5)


-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (7 preceding siblings ...)
  2009-12-11 14:37 ` dodji at gcc dot gnu dot org
@ 2009-12-11 17:07 ` jacob dot benoit dot 1 at gmail dot com
  2009-12-11 17:11 ` jacob dot benoit dot 1 at gmail dot com
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jacob dot benoit dot 1 at gmail dot com @ 2009-12-11 17:07 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]



------- Comment #8 from jacob dot benoit dot 1 at gmail dot com  2009-12-11 17:07 -------
(In reply to comment #7)
> Fixed in trunk (4.5)
> 

Thanks for fixing this bug!

Maybe I'm just ignorant, but I can't get the fix to work for me. I have SVN
r155167. I am still getting a ICE, albeit at a slightly different line number
now:

##### 12:01:44 ~/build/eigen$ make product_small_1
Building CXX object test/CMakeFiles/product_small_1.dir/product_small.cpp.o
In file included from /home/bjacob/eigen/test/product_small.cpp:26:0:
/home/bjacob/eigen/test/product.h: In function ‘void product(const MatrixType&)
[with MatrixType = Eigen::Matrix<float, 3, 2, 0>]’:
/home/bjacob/eigen/test/product_small.cpp:31:5:   instantiated from here
/home/bjacob/eigen/test/product.h:45:60: internal compiler error: tree check:
accessed elt 2 of tree_vec with 1 elts in tsubst, at cp/pt.c:9822
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (8 preceding siblings ...)
  2009-12-11 17:07 ` jacob dot benoit dot 1 at gmail dot com
@ 2009-12-11 17:11 ` jacob dot benoit dot 1 at gmail dot com
  2009-12-11 17:24 ` hjl dot tools at gmail dot com
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jacob dot benoit dot 1 at gmail dot com @ 2009-12-11 17:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jacob dot benoit dot 1 at gmail dot com  2009-12-11 17:10 -------
I also confirm that I still have the ICE with the .ii file attached to this bug
report.


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (9 preceding siblings ...)
  2009-12-11 17:11 ` jacob dot benoit dot 1 at gmail dot com
@ 2009-12-11 17:24 ` hjl dot tools at gmail dot com
  2009-12-11 22:12 ` dodji at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-11 17:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from hjl dot tools at gmail dot com  2009-12-11 17:24 -------
Confirmed.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (10 preceding siblings ...)
  2009-12-11 17:24 ` hjl dot tools at gmail dot com
@ 2009-12-11 22:12 ` dodji at gcc dot gnu dot org
  2009-12-11 22:47 ` dodji at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-12-11 22:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from dodji at gcc dot gnu dot org  2009-12-11 22:12 -------
Hah. It looks like there are several slightly different problems at play here.
Apparently I just fixed one of them, which I was the one I narrowed in the
reduced test case above.
Then I forgot to try my fix on the initial test case attached to the bug. I
only tried on the reduced test case. Sorry about that.

Here is, I think, a reduced test case for this particular issue:

struct A
{
    static const int i = 1;
    typedef int TI;
};

template<class T0>
struct S0
{
    int i;
};

template<class _T, int>
struct S1
{
    typedef _T T;
    typedef typename T::TI TTI;
    typedef S0<TTI> TT0;
};

template<class T>
void
foo(const T&)
{
    typedef typename T::TI TTI;
    typedef S0<TTI> TT1;
}

int   
main()
{
    A a;
    foo (a);
}


I am currently testing a patch and this time I tested it first on the initial
testcase :-)


-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |ASSIGNED
   Last reconfirmed|2009-11-30 23:01:09         |2009-12-11 22:12:03
               date|                            |


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (11 preceding siblings ...)
  2009-12-11 22:12 ` dodji at gcc dot gnu dot org
@ 2009-12-11 22:47 ` dodji at gcc dot gnu dot org
  2009-12-11 22:51 ` jacob dot benoit dot 1 at gmail dot com
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-12-11 22:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from dodji at gcc dot gnu dot org  2009-12-11 22:47 -------
Created an attachment (id=19278)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19278&action=view)
Draft patch

Here is the patch I am testing.
It seems to be working fine so far.
Note that g++ says the code is not valid though. Did you expect it to compile
without error ?


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (12 preceding siblings ...)
  2009-12-11 22:47 ` dodji at gcc dot gnu dot org
@ 2009-12-11 22:51 ` jacob dot benoit dot 1 at gmail dot com
  2009-12-11 23:39 ` hjl at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jacob dot benoit dot 1 at gmail dot com @ 2009-12-11 22:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jacob dot benoit dot 1 at gmail dot com  2009-12-11 22:51 -------
(In reply to comment #12)
> Note that g++ says the code is not valid though. Did you expect it to compile
> without error ?

The .ii file I have attached? Yes, I was expecting it to be correct, it
compiles without error or warnings with GCC 4.4, even with all warnings
enabled, AFAIK.


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (13 preceding siblings ...)
  2009-12-11 22:51 ` jacob dot benoit dot 1 at gmail dot com
@ 2009-12-11 23:39 ` hjl at gcc dot gnu dot org
  2009-12-14  8:24 ` dodji at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: hjl at gcc dot gnu dot org @ 2009-12-11 23:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from hjl at gcc dot gnu dot org  2009-12-11 23:38 -------
Subject: Bug 42225

Author: hjl
Date: Fri Dec 11 23:36:24 2009
New Revision: 155184

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155184
Log:
Backport testcases from trunk.

2009-12-11  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2009-12-11  Dodji Seketeli  <dodji@redhat.com>

        PR c++/42225
        * g++.dg/template/typedef24.C: New test.
        * g++.dg/template/typedef25.C: New test.

        2009-12-11  Dodji Seketeli  <dodji@redhat.com>

        PR c++/42251
        * g++.dg/template/const3.C: New test.

        2009-12-10  Jakub Jelinek  <jakub@redhat.com>

        PR c++/42317
        * g++.dg/opt/dtor2.C: New test.
        * g++.dg/opt/dtor2.h: New file.
        * g++.dg/opt/dtor2-aux.cc: New file.

        2009-12-10  Jan Hubicka  <jh@suse.cz>

        PR middle-end/42110
        * g++.dg/torture/pr42110.C: new file.

        2009-12-07  Jakub Jelinek  <jakub@redhat.com>

        PR debug/42244
        * gcc.dg/debug/pr42244.c: New test.

        2009-12-04  David Daney  <ddaney@caviumnetworks.com>

        PR rtl-optimization/42164
        * gcc.c-torture/compile/pr42164.c: New test.

        2009-12-03  Jason Merrill  <jason@redhat.com>

        PR c++/41611
        * g++.dg/abi/guard2.C: New.

        2009-12-03  Dodji Seketeli  <dodji@redhat.com>

        PR c++/42217
        * g++.dg/other/bitfield4.C: New test.

        2009-12-03  Jakub Jelinek  <jakub@redhat.com>

        PR c++/42256
        * g++.dg/inherit/thunk11.C: New test.
        * g++.dg/inherit/thunk11.h: New file.
        * g++.dg/inherit/thunk11-aux.cc: New file.

        2009-12-01  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/42237
        * gcc.c-torture/compile/pr42237.c: New test.

        2009-12-01  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/42057
        * g++.dg/parse/crash54.C: New.

        2009-11-30  Martin Jambor  <mjambor@suse.cz>

        PR middle-end/42196
        * gcc.c-torture/compile/pr42196-1.c: New test.
        * gcc.c-torture/compile/pr42196-2.c: New test.
        * gcc.c-torture/compile/pr42196-3.c: New test.

        2009-11-30  Dodji Seketeli  <dodji@redhat.com>

        PR c++/42069
        * g++.dg/template/typedef23.C: New test.

        2009-11-29  H.J. Lu  <hongjiu.lu@intel.com>

        PR tree-optimization/41961
        * g++.dg/tree-ssa/pr41961.C: New.

        2009-11-29  Ira Rosen  <irar@il.ibm.com>

        PR tree-optimization/42193
        * gcc.dg/vect/pr42193.c: New test.

        2009-11-28  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/42183
        * g++.dg/torture/pr42183.C: New testcase.

        2009-11-27  Martin Jambor  <mjambor@suse.cz>

        PR middle-end/42006
        * gcc.c-torture/execute/pr42006.c: New test.

        2009-11-27  Michael Matz  <matz@suse.de>

        PR rtl-optimization/42084
        * gcc.dg/pr42084.c: New test.

        2009-11-27  Michael Matz  <matz@suse.de>

        PR c++/41906
        * g++.dg/tree-ssa/pr41906.C: New testcase.

        2009-11-26  Michael Matz  <matz@suse.de>

        PR tree-optimization/41905
        * g++.dg/tree-ssa/pr41905.C: New testcase.

        2009-11-24  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/42142
        * gcc.c-torture/execute/pr42142.c: New testcase.

        2009-11-24  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/42154
        * gcc.c-torture/execute/pr42154.c: New test.

        2009-11-21  Martin Jambor  <mjambor@suse.cz>

        PR middle-end/42025
        * gcc.c-torture/compile/pr42025-1.c: New test.
        * gcc.c-torture/compile/pr42025-2.c: New test.

        2009-11-21  Jakub Jelinek  <jakub@redhat.com>

        PR tree-optimization/42078
        * gcc.dg/pr42078.c: New test.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/abi/guard2.C
      - copied unchanged from r155170, trunk/gcc/testsuite/g++.dg/abi/guard2.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/inherit/thunk11-aux.cc
      - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/inherit/thunk11-aux.cc
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/inherit/thunk11.C
      - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/inherit/thunk11.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/inherit/thunk11.h
      - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/inherit/thunk11.h
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/opt/dtor2-aux.cc
      - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/opt/dtor2-aux.cc
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/opt/dtor2.C
      - copied unchanged from r155170, trunk/gcc/testsuite/g++.dg/opt/dtor2.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/opt/dtor2.h
      - copied unchanged from r155170, trunk/gcc/testsuite/g++.dg/opt/dtor2.h
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/other/bitfield4.C
      - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/other/bitfield4.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/parse/crash54.C
      - copied unchanged from r155172,
trunk/gcc/testsuite/g++.dg/parse/crash54.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/const3.C
      - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/template/const3.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/typedef23.C
      - copied unchanged from r155181,
trunk/gcc/testsuite/g++.dg/template/typedef23.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/typedef24.C
      - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/template/typedef24.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/typedef25.C
      - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/template/typedef25.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42110.C
      - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/torture/pr42110.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42183.C
      - copied unchanged from r155181,
trunk/gcc/testsuite/g++.dg/torture/pr42183.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/tree-ssa/pr41905.C
      - copied unchanged from r155182,
trunk/gcc/testsuite/g++.dg/tree-ssa/pr41905.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/tree-ssa/pr41906.C
      - copied unchanged from r155182,
trunk/gcc/testsuite/g++.dg/tree-ssa/pr41906.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/tree-ssa/pr41961.C
      - copied unchanged from r155181,
trunk/gcc/testsuite/g++.dg/tree-ssa/pr41961.C
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42025-1.c
      - copied unchanged from r155182,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42025-1.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42025-2.c
      - copied unchanged from r155182,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42025-2.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42164.c
      - copied unchanged from r155170,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42164.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42196-1.c
      - copied unchanged from r155181,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42196-1.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42196-2.c
      - copied unchanged from r155181,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42196-2.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42196-3.c
      - copied unchanged from r155181,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42196-3.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42237.c
      - copied unchanged from r155171,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42237.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr42006.c
      - copied unchanged from r155181,
trunk/gcc/testsuite/gcc.c-torture/execute/pr42006.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr42142.c
      - copied unchanged from r155182,
trunk/gcc/testsuite/gcc.c-torture/execute/pr42142.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr42154.c
      - copied unchanged from r155182,
trunk/gcc/testsuite/gcc.c-torture/execute/pr42154.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/debug/pr42244.c
      - copied unchanged from r155170,
trunk/gcc/testsuite/gcc.dg/debug/pr42244.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42078.c
      - copied unchanged from r155182, trunk/gcc/testsuite/gcc.dg/pr42078.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42084.c
      - copied unchanged from r155182, trunk/gcc/testsuite/gcc.dg/pr42084.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/pr42193.c
      - copied unchanged from r155181,
trunk/gcc/testsuite/gcc.dg/vect/pr42193.c
Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (14 preceding siblings ...)
  2009-12-11 23:39 ` hjl at gcc dot gnu dot org
@ 2009-12-14  8:24 ` dodji at gcc dot gnu dot org
  2009-12-14 12:43 ` jacob dot benoit dot 1 at gmail dot com
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-12-14  8:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from dodji at gcc dot gnu dot org  2009-12-14 08:24 -------
(In reply to comment #13)
> The .ii file I have attached? Yes, I was expecting it to be correct, it
> compiles without error or warnings with GCC 4.4, even with all warnings
> enabled, AFAIK.

Fair enough. It was me doing weird things.

I submitted a patch to http://gcc.gnu.org/ml/gcc-patches/2009-12/msg00669.html
Let's see how it turns out.

Thanks for your feedback.


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (15 preceding siblings ...)
  2009-12-14  8:24 ` dodji at gcc dot gnu dot org
@ 2009-12-14 12:43 ` jacob dot benoit dot 1 at gmail dot com
  2009-12-14 13:03 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: jacob dot benoit dot 1 at gmail dot com @ 2009-12-14 12:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from jacob dot benoit dot 1 at gmail dot com  2009-12-14 12:43 -------
(In reply to comment #15)
> Fair enough. It was me doing weird things.
> 
> I submitted a patch to http://gcc.gnu.org/ml/gcc-patches/2009-12/msg00669.html
> Let's see how it turns out.
> 
> Thanks for your feedback.
> 

Thanks for your responsiveness! The whole Eigen team is very pleased about
this.

By the way, this bug report comes from trying to build the Eigen test suite
(development branch). This is a great real-world use case for mixing very
complate C++ template stuff with other specific topics such as SSE intrinsics,
etc. If you want to test it yourself, install CMake and Mercurial, and do:

   $ hg clone https://bitbucket.org/eigen/eigen/
   $ mkdir eigen-build
   $ cd eigen-build
   $ cmake ../eigen
   $ make check

I mention this because I heared that GCC has a list of project it builds before
releasing a version, as real-world test cases. Maybe Eigen's test suite can be
added to that list? Maybe after we make the next release? (The current stable
release, 2.0, didn't trigger this GCC error).


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (16 preceding siblings ...)
  2009-12-14 12:43 ` jacob dot benoit dot 1 at gmail dot com
@ 2009-12-14 13:03 ` rguenth at gcc dot gnu dot org
  2009-12-19 22:41 ` dodji at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-12-14 13:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from rguenth at gcc dot gnu dot org  2009-12-14 13:03 -------
(In reply to comment #16)
> I mention this because I heared that GCC has a list of project it builds before
> releasing a version, as real-world test cases. Maybe Eigen's test suite can be
> added to that list? Maybe after we make the next release? (The current stable
> release, 2.0, didn't trigger this GCC error).

Nah, we don't do this anymore (well, testing a specific list of projects).
Instead we rely on the community providing feedback during development.

Richard.


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (17 preceding siblings ...)
  2009-12-14 13:03 ` rguenth at gcc dot gnu dot org
@ 2009-12-19 22:41 ` dodji at gcc dot gnu dot org
  2009-12-19 22:44 ` dodji at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-12-19 22:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from dodji at gcc dot gnu dot org  2009-12-19 22:40 -------
Subject: Bug 42225

Author: dodji
Date: Sat Dec 19 22:40:37 2009
New Revision: 155363

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155363
Log:
Fix PR c++/42225, take 2

gcc/cp/ChangeLog:
        PR c++/42225
        * pt.c (push_template_decl_real): Set DECL_CONTEXT of template type
        parms to their containing template decl.
        * typeck.c (comp_template_parms_position): Split this from
        structural_comptypes.
        (incompatible_template_type_parms_p): Renamed
        incompatible_dependent_typedefs_p into this. Change the function to
        handle comparison between TEMPLATE_TYPE_PARMs only.
        (structural_comptypes): Use comp_template_parms_position in
        TEMPLATE_TEMPLATE_PARM and BOUND_TEMPLATE_TEMPLATE_PARM cases.
        Use incompatible_template_type_parms_p in TEMPLATE_TYPE_PARM case.
        * mangle.c (decl_mangling_context): Template type parms don't have
        a mangling context.
        * tree.c (cp_set_underlying_type): Set type structural equality
        only for TEMPLATE_TYPE_PARMs.

gcc/testsuite/ChangeLog:
        PR c++/42225
        * g++.dg/template/typedef26.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/typedef26.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/mangle.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/tree.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (18 preceding siblings ...)
  2009-12-19 22:41 ` dodji at gcc dot gnu dot org
@ 2009-12-19 22:44 ` dodji at gcc dot gnu dot org
  2009-12-21 18:59 ` jacob dot benoit dot 1 at gmail dot com
  2009-12-22 18:18 ` hjl at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: dodji at gcc dot gnu dot org @ 2009-12-19 22:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from dodji at gcc dot gnu dot org  2009-12-19 22:43 -------
This should now be fixed in trunk for 4.5


-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (19 preceding siblings ...)
  2009-12-19 22:44 ` dodji at gcc dot gnu dot org
@ 2009-12-21 18:59 ` jacob dot benoit dot 1 at gmail dot com
  2009-12-22 18:18 ` hjl at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: jacob dot benoit dot 1 at gmail dot com @ 2009-12-21 18:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from jacob dot benoit dot 1 at gmail dot com  2009-12-21 18:59 -------
Thank you, I can confirm that it's fixed here.

However I now hit another ICE, see bug #42450, but it seems unrelated.


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug c++/42225] [4.5 Regression] GCC 4.5 ICE (segfault) on C++ templated code
  2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
                   ` (20 preceding siblings ...)
  2009-12-21 18:59 ` jacob dot benoit dot 1 at gmail dot com
@ 2009-12-22 18:18 ` hjl at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: hjl at gcc dot gnu dot org @ 2009-12-22 18:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from hjl at gcc dot gnu dot org  2009-12-22 18:18 -------
Subject: Bug 42225

Author: hjl
Date: Tue Dec 22 18:17:53 2009
New Revision: 155403

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155403
Log:
Backport testcases from mainline.

2009-12-22  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2009-12-19  Dodji Seketeli  <dodji@redhat.com>

        PR c++/42225
        * g++.dg/template/typedef26.C: New test.

        2009-12-17  Jakub Jelinek  <jakub@redhat.com>

        PR c++/42386
        * g++.dg/opt/dtor3.C: New test.

        2009-12-15  Jason Merrill  <jason@redhat.com>

        PR c++/42358
        * g++.dg/cpp0x/variadic98.C: New.

        2009-12-13  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/42357
        * g++.dg/torture/pr42357.C: New testcase.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/variadic98.C
      - copied unchanged from r155402,
trunk/gcc/testsuite/g++.dg/cpp0x/variadic98.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/opt/dtor3.C
      - copied unchanged from r155402, trunk/gcc/testsuite/g++.dg/opt/dtor3.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/typedef26.C
      - copied unchanged from r155402,
trunk/gcc/testsuite/g++.dg/template/typedef26.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42357.C
      - copied unchanged from r155402,
trunk/gcc/testsuite/g++.dg/torture/pr42357.C
Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2009-12-22 18:18 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-30  4:14 [Bug c++/42225] New: GCC 4.5 ICE (segfault) on C++ templated code jacob dot benoit dot 1 at gmail dot com
2009-11-30  4:17 ` [Bug c++/42225] " jacob dot benoit dot 1 at gmail dot com
2009-11-30 10:33 ` [Bug c++/42225] [4.5 Regression] " rguenth at gcc dot gnu dot org
2009-11-30 23:01 ` dodji at gcc dot gnu dot org
2009-12-01  0:26 ` dodji at gcc dot gnu dot org
2009-12-01  0:28 ` hjl dot tools at gmail dot com
2009-12-03 14:07 ` dodji at gcc dot gnu dot org
2009-12-11 14:36 ` dodji at gcc dot gnu dot org
2009-12-11 14:37 ` dodji at gcc dot gnu dot org
2009-12-11 17:07 ` jacob dot benoit dot 1 at gmail dot com
2009-12-11 17:11 ` jacob dot benoit dot 1 at gmail dot com
2009-12-11 17:24 ` hjl dot tools at gmail dot com
2009-12-11 22:12 ` dodji at gcc dot gnu dot org
2009-12-11 22:47 ` dodji at gcc dot gnu dot org
2009-12-11 22:51 ` jacob dot benoit dot 1 at gmail dot com
2009-12-11 23:39 ` hjl at gcc dot gnu dot org
2009-12-14  8:24 ` dodji at gcc dot gnu dot org
2009-12-14 12:43 ` jacob dot benoit dot 1 at gmail dot com
2009-12-14 13:03 ` rguenth at gcc dot gnu dot org
2009-12-19 22:41 ` dodji at gcc dot gnu dot org
2009-12-19 22:44 ` dodji at gcc dot gnu dot org
2009-12-21 18:59 ` jacob dot benoit dot 1 at gmail dot com
2009-12-22 18:18 ` hjl at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).