https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70634

            Bug ID: 70634
           Summary: ICE on valid code on x86_64-linux-gnu: Segmentation
                    fault (program cc1plus)
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following code causes an ICE when compiled with the current GCC trunk on
x86_64-linux-gnu in both 32-bit and 64-bit modes.  

This is a regression from 5.3.x.


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 6.0.0 20160411 (experimental) [trunk revision 234874] (GCC) 
$ 
$ g++-5.3 -c small.cpp
$ clang++ -c small.cpp
$ 
$ g++-trunk -c small.cpp
g++-trunk: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


-------------------------------------------------


template < typename T > 
bool foo ()
{
  const int i = sizeof (i) > 1 ? sizeof (T) : 0;
  return i > 0;
}

Reply via email to