public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55652] New: [C++11][4.8] ICE (segfault) with templates and structs
@ 2012-12-11 19:12 david.abdurachmanov at gmail dot com
  2012-12-11 23:43 ` [Bug c++/55652] [4.8 Regression] " paolo.carlini at oracle dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: david.abdurachmanov at gmail dot com @ 2012-12-11 19:12 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55652
           Summary: [C++11][4.8] ICE (segfault) with templates and structs
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: david.abdurachmanov@gmail.com


Created attachment 28929
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28929
testcase used.

Hi folks,

I have started re-compiling my RPMs with GNU GCC 4.8.0 (revision 194323) to
check the status.

Below your will find the smallest test case I currently could produce showing
setfault (ICE). Yet I am still not fully sure what is causing it. I compiles w/
C++03, but not w/ C++11. It also compiles w/ GCC 4.7.2.

I am attaching *.ii.

## TESTCASE ##

#include <map>

template <typename T1, typename T2>
struct P {
  T1 first;
  T2 second;
  P() : first(T1()), second(T2()) {}
};

struct E {
};

struct B {
  B();
  B(const B &obj) throw(E);
};

int main(void) {
  P<B, std::map<B, B> > a;
  return 0;
}

## COMPILE LINE ##

g++ -v -save-temps -std=c++11 -c -o test.o ./test.cxx

## GCC OUTPUT ##

./test.cxx: In function 'int main()':
./test.cxx:19:25: internal compiler error: Segmentation fault
   P<B, std::map<B, B> > a;
                         ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

## GCC FULL OUTPUT ##

Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-unknown-linux-gnu
Configured with: ../configure
--prefix=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--disable-multilib --disable-nls --enable-languages=c,c++,fortran
--enable-gold=yes --enable-lto
--with-gmp=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-mpfr=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-mpc=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-isl=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-cloog=/build/davidlt/gcc480/b/tmp/BUILDROOT/48f7c7c6aea9a202503cd9453105a971/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--disable-isl-version-check --enable-shared CC='gcc -fPIC' CXX='c++ -fPIC'
CPP=cpp CXXCPP='c++ -E'
Thread model: posix
gcc version 4.8.0 20121208 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-c' '-o' 'test.o'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'

/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-E -quiet -v -iprefix
/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/
-D_GNU_SOURCE ./test.cxx -mtune=generic -march=x86-64 -std=c++11
-fpch-preprocess -o test.ii
ignoring nonexistent directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
ignoring duplicate directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0"
ignoring duplicate directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu"
ignoring duplicate directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward"
ignoring duplicate directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include"
ignoring duplicate directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed"
ignoring nonexistent directory
"/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0

/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu

/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward

/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include

/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed
 /usr/local/include

/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-c' '-o' 'test.o'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'

/build/davidlt/gcc480/test/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-fpreprocessed test.ii -quiet -dumpbase test.cxx -mtune=generic -march=x86-64
-auxbase-strip test.o -std=c++11 -version -o test.s
GNU C++ (GCC) version 4.8.0 20121208 (experimental) (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.8.0 20121208 (experimental), GMP version 5.0.5,
MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.8.0 20121208 (experimental) (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.8.0 20121208 (experimental), GMP version 5.0.5,
MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 7710cb843e8b8b547eb436a388da025f
./test.cxx: In function 'int main()':
./test.cxx:19:25: internal compiler error: Segmentation fault
   P<B, std::map<B, B> > a;
                         ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug c++/55652] [4.8 Regression] ICE (segfault) with templates and structs
  2012-12-11 19:12 [Bug c++/55652] New: [C++11][4.8] ICE (segfault) with templates and structs david.abdurachmanov at gmail dot com
@ 2012-12-11 23:43 ` paolo.carlini at oracle dot com
  2012-12-12  9:16 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-12-11 23:43 UTC (permalink / raw)
  To: gcc-bugs


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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-12-11
                 CC|                            |jakub at gcc dot gnu.org
            Summary|[C++11][4.8] ICE (segfault) |[4.8 Regression] ICE
                   |with templates and structs  |(segfault) with templates
                   |                            |and structs
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-12-11 23:43:15 UTC ---
Apparently has to do with the fix for c++/54207


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

* [Bug c++/55652] [4.8 Regression] ICE (segfault) with templates and structs
  2012-12-11 19:12 [Bug c++/55652] New: [C++11][4.8] ICE (segfault) with templates and structs david.abdurachmanov at gmail dot com
  2012-12-11 23:43 ` [Bug c++/55652] [4.8 Regression] " paolo.carlini at oracle dot com
@ 2012-12-12  9:16 ` jakub at gcc dot gnu.org
  2012-12-12  9:18 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-12  9:16 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0


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

* [Bug c++/55652] [4.8 Regression] ICE (segfault) with templates and structs
  2012-12-11 19:12 [Bug c++/55652] New: [C++11][4.8] ICE (segfault) with templates and structs david.abdurachmanov at gmail dot com
  2012-12-11 23:43 ` [Bug c++/55652] [4.8 Regression] " paolo.carlini at oracle dot com
  2012-12-12  9:16 ` jakub at gcc dot gnu.org
@ 2012-12-12  9:18 ` jakub at gcc dot gnu.org
  2012-12-13 14:35 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-12  9:18 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-12 09:18:06 UTC ---
Created attachment 28934
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28934
gcc48-pr55652.patch

Untested fix.


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

* [Bug c++/55652] [4.8 Regression] ICE (segfault) with templates and structs
  2012-12-11 19:12 [Bug c++/55652] New: [C++11][4.8] ICE (segfault) with templates and structs david.abdurachmanov at gmail dot com
                   ` (2 preceding siblings ...)
  2012-12-12  9:18 ` jakub at gcc dot gnu.org
@ 2012-12-13 14:35 ` jakub at gcc dot gnu.org
  2012-12-13 15:53 ` jakub at gcc dot gnu.org
  2013-02-01 14:06 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-13 14:35 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-13 14:35:22 UTC ---
Author: jakub
Date: Thu Dec 13 14:35:12 2012
New Revision: 194479

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194479
Log:
    PR c++/55652
    * typeck2.c (merge_exception_specifiers): Don't call operand_equal_p
    if noex is NULL.

    * g++.dg/cpp0x/noexcept19.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/noexcept19.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck2.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/55652] [4.8 Regression] ICE (segfault) with templates and structs
  2012-12-11 19:12 [Bug c++/55652] New: [C++11][4.8] ICE (segfault) with templates and structs david.abdurachmanov at gmail dot com
                   ` (3 preceding siblings ...)
  2012-12-13 14:35 ` jakub at gcc dot gnu.org
@ 2012-12-13 15:53 ` jakub at gcc dot gnu.org
  2013-02-01 14:06 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-13 15:53 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-13 15:52:33 UTC ---
Fixed.


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

* [Bug c++/55652] [4.8 Regression] ICE (segfault) with templates and structs
  2012-12-11 19:12 [Bug c++/55652] New: [C++11][4.8] ICE (segfault) with templates and structs david.abdurachmanov at gmail dot com
                   ` (4 preceding siblings ...)
  2012-12-13 15:53 ` jakub at gcc dot gnu.org
@ 2013-02-01 14:06 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-01 14:06 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-01 14:05:52 UTC ---
Author: jakub
Date: Fri Feb  1 14:05:42 2013
New Revision: 195653

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195653
Log:
    Backported from mainline
    2012-12-13  Jakub Jelinek  <jakub@redhat.com>

    PR c++/55652
    * typeck2.c (merge_exception_specifiers): Don't call operand_equal_p
    if noex is NULL.

    * g++.dg/cpp0x/noexcept19.C: New test.

    2012-12-06  Jakub Jelinek  <jakub@redhat.com>

    PR c++/54207
    * except.c (build_noexcept_spec): Avoid direct comparison
    with boolean_true_node or boolean_false_node, instead use
    operand_equal_p and/or INTEGER_CST check.
    * pt.c (tsubst_exception_specification): Likewise.
    * typeck2.c (merge_exception_specifiers): Likewise.

    * g++.dg/cpp0x/noexcept18.C: New test.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/noexcept18.C
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/noexcept19.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/except.c
    branches/gcc-4_7-branch/gcc/cp/pt.c
    branches/gcc-4_7-branch/gcc/cp/typeck2.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2013-02-01 14:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-11 19:12 [Bug c++/55652] New: [C++11][4.8] ICE (segfault) with templates and structs david.abdurachmanov at gmail dot com
2012-12-11 23:43 ` [Bug c++/55652] [4.8 Regression] " paolo.carlini at oracle dot com
2012-12-12  9:16 ` jakub at gcc dot gnu.org
2012-12-12  9:18 ` jakub at gcc dot gnu.org
2012-12-13 14:35 ` jakub at gcc dot gnu.org
2012-12-13 15:53 ` jakub at gcc dot gnu.org
2013-02-01 14:06 ` jakub at gcc dot gnu.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).