Launchpad has imported 10 comments from the remote bug at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60999.
If you reply to an imported comment from within Launchpad, your comment will be sent to the remote bug automatically. Read more about Launchpad's inter-bugtracker facilities at https://documentation.ubuntu.com/launchpad/user/reference/bugs/multi-project-bugs/about-multi-project-bugs/#bugs-in-external-trackers. ------------------------------------------------------------------------ On 2014-04-29T12:32:04+00:00 Deniz Bahadir wrote: Created attachment 32705 source which can reproduce the ICE The following code produces an internal compiler error (ICE) in GCC 4.9, but did compile fine in GCC 4.8: <code> // general template template <typename A> struct foo { }; // template specialization template<> struct foo<int> { static constexpr int code = 42; unsigned int bar = static_cast<unsigned int>(code); // ICE at static_cast during instantiation. --^ }; // instantiation foo<int> a; </code> Compiling with the following line (using GCC 4.9) reproduced the ICE: g++ -Wall -Wextra -std=c++11 -c ICE.cpp The output of 'g++ -v -save-temps -Wall -Wextra -std=c++11 -c ICE.cpp' yields the following information: Using built-in specs. COLLECT_GCC=g++ Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9-20140406-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.9.0 20140405 (experimental) [trunk revision 209157] (Ubuntu 4.9-20140406-1ubuntu1) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra' '-std=c++11' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-linux-gnu/4.9/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE ICE.cpp -mtune=generic -march=x86-64 -std=c++11 -Wall -Wextra -fpch-preprocess -fstack-protector -Wformat -Wformat-security -o ICE.ii ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/4.9" ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../x86_64-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/include/c++/4.9 /usr/include/x86_64-linux-gnu/c++/4.9 /usr/include/c++/4.9/backward /usr/lib/gcc/x86_64-linux-gnu/4.9/include /usr/local/include /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/include End of search list. COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra' '-std=c++11' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-linux-gnu/4.9/cc1plus -fpreprocessed ICE.ii -quiet -dumpbase ICE.cpp -mtune=generic -march=x86-64 -auxbase ICE -Wall -Wextra -std=c++11 -version -fstack-protector -Wformat -Wformat-security -o ICE.s GNU C++ (Ubuntu 4.9-20140406-1ubuntu1) version 4.9.0 20140405 (experimental) [trunk revision 209157] (x86_64-linux-gnu) compiled by GNU C version 4.9.0 20140405 (experimental) [trunk revision 209157], GMP version 5.1.3, MPFR version 3.1.2-p3, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C++ (Ubuntu 4.9-20140406-1ubuntu1) version 4.9.0 20140405 (experimental) [trunk revision 209157] (x86_64-linux-gnu) compiled by GNU C version 4.9.0 20140405 (experimental) [trunk revision 209157], GMP version 5.1.3, MPFR version 3.1.2-p3, MPC version 1.0.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 6752b609dd6385b31002233d89fe2356 ICE.cpp:17:10: in constexpr expansion of ‘a.foo<int>::foo()’ ICE.cpp:17:10: internal compiler error: unexpected expression ‘static_cast<unsigned int>(foo<int>::code)’ of kind static_cast_expr foo<int> a; ^ Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions. Preprocessed source stored into /tmp/cc5DJH1d.out file, please attach this to your bugreport. Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1314182/comments/0 ------------------------------------------------------------------------ On 2014-04-29T12:36:30+00:00 Deniz Bahadir wrote: Created attachment 32706 preprocessed source generated by GCC with option '-save-temps' Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1314182/comments/1 ------------------------------------------------------------------------ On 2014-04-29T13:46:16+00:00 Rguenth wrote: Confirmed. Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1314182/comments/5 ------------------------------------------------------------------------ On 2014-04-29T18:06:50+00:00 Jakub-gcc wrote: Started with r204818. Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1314182/comments/6 ------------------------------------------------------------------------ On 2014-04-30T00:05:12+00:00 Paolo-carlini wrote: I'm finishing testing this, appears to work fine so far: Index: pt.c =================================================================== --- pt.c (revision 209916) +++ pt.c (working copy) @@ -463,6 +463,7 @@ maybe_begin_member_template_processing (tree decl) if (nsdmi) decl = (CLASSTYPE_TEMPLATE_INFO (DECL_CONTEXT (decl)) + && uses_template_parms (DECL_CONTEXT (decl)) ? CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (decl)) : NULL_TREE); Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1314182/comments/7 ------------------------------------------------------------------------ On 2014-05-06T22:33:21+00:00 Paolo-k wrote: Author: paolo Date: Tue May 6 22:32:49 2014 New Revision: 210126 URL: http://gcc.gnu.org/viewcvs?rev=210126&root=gcc&view=rev Log: /cp 2014-05-06 Paolo Carlini <[email protected]> PR c++/60999 * pt.c (maybe_begin_member_template_processing): Use uses_template_parms. /testsuite 2014-05-06 Paolo Carlini <[email protected]> PR c++/60999 * g++.dg/cpp0x/nsdmi-template9.C: New. * g++.dg/cpp0x/nsdmi-template10.C: Likewise. Added: trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template10.C trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template9.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1314182/comments/8 ------------------------------------------------------------------------ On 2014-05-06T22:34:43+00:00 Paolo-k wrote: Author: paolo Date: Tue May 6 22:34:11 2014 New Revision: 210127 URL: http://gcc.gnu.org/viewcvs?rev=210127&root=gcc&view=rev Log: /cp 2014-05-06 Paolo Carlini <[email protected]> PR c++/60999 * pt.c (maybe_begin_member_template_processing): Use uses_template_parms. /testsuite 2014-05-06 Paolo Carlini <[email protected]> PR c++/60999 * g++.dg/cpp0x/nsdmi-template9.C: New. * g++.dg/cpp0x/nsdmi-template10.C: Likewise. Added: branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/nsdmi-template10.C branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/nsdmi-template9.C Modified: branches/gcc-4_9-branch/gcc/cp/ChangeLog branches/gcc-4_9-branch/gcc/cp/pt.c Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1314182/comments/9 ------------------------------------------------------------------------ On 2014-05-06T22:36:05+00:00 Paolo-carlini wrote: Fixed mainline and 4.9.1. Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1314182/comments/10 ------------------------------------------------------------------------ On 2014-05-07T07:23:47+00:00 Paolo-k wrote: Author: paolo Date: Wed May 7 07:23:15 2014 New Revision: 210139 URL: http://gcc.gnu.org/viewcvs?rev=210139&root=gcc&view=rev Log: /cp 2014-05-06 Paolo Carlini <[email protected]> PR c++/60999 * pt.c (maybe_begin_member_template_processing): Use uses_template_parms. /testsuite 2014-05-06 Paolo Carlini <[email protected]> PR c++/60999 * g++.dg/cpp0x/nsdmi-template9.C: New. * g++.dg/cpp0x/nsdmi-template10.C: Likewise. Modified: branches/gcc-4_9-branch/gcc/testsuite/ChangeLog Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1314182/comments/11 ------------------------------------------------------------------------ On 2014-05-07T07:24:52+00:00 Paolo-k wrote: Author: paolo Date: Wed May 7 07:24:21 2014 New Revision: 210140 URL: http://gcc.gnu.org/viewcvs?rev=210140&root=gcc&view=rev Log: /cp 2014-05-06 Paolo Carlini <[email protected]> PR c++/60999 * pt.c (maybe_begin_member_template_processing): Use uses_template_parms. /testsuite 2014-05-06 Paolo Carlini <[email protected]> PR c++/60999 * g++.dg/cpp0x/nsdmi-template9.C: New. * g++.dg/cpp0x/nsdmi-template10.C: Likewise. Modified: trunk/gcc/testsuite/ChangeLog Reply at: https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1314182/comments/12 ** Changed in: gcc Status: Unknown => Fix Released ** Changed in: gcc Importance: Unknown => Medium -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1314182 Title: [4.9/4.10 Regression] ICE when static_cast from constexpr in specialization of template-class To manage notifications about this bug go to: https://bugs.launchpad.net/gcc/+bug/1314182/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
