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

            Bug ID: 78162
           Summary: ICE on invalid code at -Os and above on
                    x86_64-linux-gnu: Segmentation fault
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

This is a regression from 6.2.x.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.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 7.0.0 20161030 (experimental) [trunk revision 241684] (GCC) 
$ 
$ gcc-trunk -O1 -c small.c
$ gcc-6.2 -Os -c small.c
$ 
$ gcc-trunk -Os -c small.c
small.c: In function ‘fn1’:
small.c:3:6: internal compiler error: Segmentation fault
 void fn1()
      ^~~
0xbedacf crash_signal
        ../../gcc-source-trunk/gcc/toplev.c:338
0x12dfed1 vec<gimple*, va_heap, vl_embed>::operator[](unsigned int)
        ../../gcc-source-trunk/gcc/vec.h:732
0x12dfed1 vec<gimple*, va_heap, vl_ptr>::operator[](unsigned int)
        ../../gcc-source-trunk/gcc/vec.h:1216
0x12dfed1 get_alias_type_for_stmts
        ../../gcc-source-trunk/gcc/gimple-ssa-store-merging.c:941
0x12dfed1 output_merged_store
        ../../gcc-source-trunk/gcc/gimple-ssa-store-merging.c:1129
0x12dfed1 output_merged_stores
        ../../gcc-source-trunk/gcc/gimple-ssa-store-merging.c:1213
0x12dfed1 terminate_and_process_chain
        ../../gcc-source-trunk/gcc/gimple-ssa-store-merging.c:1251
0x12dfed1 terminate_and_release_chain
        ../../gcc-source-trunk/gcc/gimple-ssa-store-merging.c:833
0x12e0d38 terminate_all_aliasing_chains
        ../../gcc-source-trunk/gcc/gimple-ssa-store-merging.c:811
0x12e120e execute
        ../../gcc-source-trunk/gcc/gimple-ssa-store-merging.c:1456
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


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


int a, b[1][2]; 

void fn1() 
{
  for (a = 0; a < 2; a++)
    b[-1][a] = 0;
}

Reply via email to